mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2024-11-25 14:36:14 +00:00
fe0081eecf
This allows booting from USB/NVME while keeping SD compatibility. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
27 lines
502 B
Plaintext
27 lines
502 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
|
|
if [ -f "/boot/$BACKUP_FILE" ]; then
|
|
mv -f "/boot/$BACKUP_FILE" /
|
|
export BCM27XX_SET_ROOT_PART=1
|
|
fi
|
|
fi
|
|
}
|
|
|
|
boot_hook_add preinit_mount_root move_config
|