bcm27xx: base-files: properly detect boot partition
[openwrt/openwrt.git] / target / linux / bcm27xx / base-files / lib / preinit / 79_move_config
1 # Copyright (C) 2015 OpenWrt.org
2
3 . /lib/upgrade/common.sh
4
5 move_config() {
6 local partdev
7
8 export_bootdevice && export_partdevice partdev 1 || {
9 partdev=mmcblk0p1
10 }
11
12 if [ -b "/dev/$partdev" ]; then
13 insmod nls_cp437
14 insmod nls_iso8859-1
15 insmod fat
16 insmod vfat
17 mkdir -p /boot
18 mount -t vfat -o rw,noatime /dev/$partdev /boot
19 [ -f "/boot/$BACKUP_FILE" ] && mv -f "/boot/$BACKUP_FILE" /
20 fi
21 }
22
23 boot_hook_add preinit_mount_root move_config