901a289b66f6fbb22a52b1083e20cbeba38af72d
[openwrt/openwrt.git] / target / linux / layerscape / base-files / lib / preinit / 79_move_config
1 . /lib/functions.sh
2 . /lib/upgrade/common.sh
3
4 BOOTPART=/dev/mmcblk0p1
5
6 move_config() {
7 local board=$(board_name)
8
9 case "$board" in
10 fsl,ls1012a-frwy-sdboot | \
11 fsl,ls1021a-iot-sdboot | \
12 fsl,ls1021a-twr-sdboot | \
13 fsl,ls1043a-rdb-sdboot | \
14 fsl,ls1046a-frwy-sdboot | \
15 fsl,ls1046a-rdb-sdboot | \
16 fsl,ls1088a-rdb-sdboot)
17 if [ -b $BOOTPART ]; then
18 mkdir -p /boot
19 mount -t ext4 -o rw,noatime $BOOTPART /boot 2>&1
20 [ -f "/boot/$BACKUP_FILE" ] && mv -f "/boot/$BACKUP_FILE" /
21 umount /boot
22 fi
23 ;;
24 esac
25 }
26
27 boot_hook_add preinit_mount_root move_config