mirror of
https://github.com/openwrt/openwrt.git
synced 2025-02-08 03:50:48 +00:00
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 a39176010299f3ad7d325b03d892fbf65e6dd23b) Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
This commit is contained in:
parent
8a7f667fb5
commit
c82ca6dc74
@ -2,16 +2,20 @@
|
|||||||
|
|
||||||
. /lib/upgrade/common.sh
|
. /lib/upgrade/common.sh
|
||||||
|
|
||||||
BOOTPART=/dev/mmcblk0p1
|
|
||||||
|
|
||||||
move_config() {
|
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_cp437
|
||||||
insmod nls_iso8859-1
|
insmod nls_iso8859-1
|
||||||
insmod fat
|
insmod fat
|
||||||
insmod vfat
|
insmod vfat
|
||||||
mkdir -p /boot
|
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" /
|
[ -f "/boot/$BACKUP_FILE" ] && mv -f "/boot/$BACKUP_FILE" /
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user