79_move_config 491 B

1234567891011121314151617181920212223
  1. #!/bin/sh
  2. # Copyright (C) 2012-2015 OpenWrt.org
  3. move_config() {
  4. local partdev
  5. . /lib/upgrade/common.sh
  6. if export_bootdevice && export_partdevice partdev 1; then
  7. mkdir -p /boot
  8. if mount -t ext4 -o ro,noatime "/dev/$partdev" /boot; then
  9. if [ -f /boot/sysupgrade.tgz ]; then
  10. mount /boot -o remount,rw,noatime
  11. mv -f /boot/sysupgrade.tgz /
  12. mount /boot -o remount,ro,noatime
  13. fi
  14. mount --bind /boot/boot /boot
  15. fi
  16. fi
  17. }
  18. boot_hook_add preinit_mount_root move_config