0
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2025-11-03 06:58:40 +00:00
Files
openwrt/target/linux/bcm27xx/base-files/lib/preinit/79_move_config
Álvaro Fernández Rojas c82ca6dc74 bcm27xx: base-files: properly detect boot partition
Automatically detect boot partition instead of forcing /dev/mmcblk0p1.
This way users can still get /boot mounted when booting from USB.

(cherry picked from commit a391760102)
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2024-02-01 10:48:04 +01:00

24 lines
454 B
Plaintext

# Copyright (C) 2015 OpenWrt.org
. /lib/upgrade/common.sh
move_config() {
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 /dev/$partdev /boot
[ -f "/boot/$BACKUP_FILE" ] && mv -f "/boot/$BACKUP_FILE" /
fi
}
boot_hook_add preinit_mount_root move_config