Automatically detect boot partition instead of forcing /dev/mmcblk0p1.
This way users can still get /boot mounted when booting from USB.
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
. /lib/upgrade/common.sh
-BOOTPART=/dev/mmcblk0p1
-
move_config() {
- if [ -b $BOOTPART ]; then
+ local partdev
+
+ export_bootdevice && export_partdevice partdev 1 || {
+ partdev=mmcblk0p1
+ }
+
+ if [ -b "/dev/$partdev" ]; then
insmod nls_cp437
insmod nls_iso8859-1
insmod fat
insmod vfat
mkdir -p /boot
- mount -t vfat -o rw,noatime $BOOTPART /boot
+ mount -t vfat -o rw,noatime /dev/$partdev /boot
[ -f "/boot/$BACKUP_FILE" ] && mv -f "/boot/$BACKUP_FILE" /
fi
}