diff options
| author | Álvaro Fernández Rojas <noltari@gmail.com> | 2024-01-30 21:41:26 +0100 |
|---|---|---|
| committer | Álvaro Fernández Rojas <noltari@gmail.com> | 2024-02-01 09:58:17 +0100 |
| commit | a39176010299f3ad7d325b03d892fbf65e6dd23b (patch) | |
| tree | 1b11a94845bfc0ea9012434a50ac807aa4383abe /target/linux | |
| parent | 6d27032a37f53e60e08d492883d42d10fcc926cf (diff) | |
| download | upstream-a39176010299f3ad7d325b03d892fbf65e6dd23b.tar.gz upstream-a39176010299f3ad7d325b03d892fbf65e6dd23b.tar.bz2 upstream-a39176010299f3ad7d325b03d892fbf65e6dd23b.zip | |
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.
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux')
| -rw-r--r-- | target/linux/bcm27xx/base-files/lib/preinit/79_move_config | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/target/linux/bcm27xx/base-files/lib/preinit/79_move_config b/target/linux/bcm27xx/base-files/lib/preinit/79_move_config index c9fb59a64fe..db5bf93b626 100644 --- a/target/linux/bcm27xx/base-files/lib/preinit/79_move_config +++ b/target/linux/bcm27xx/base-files/lib/preinit/79_move_config @@ -2,16 +2,20 @@ . /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 } |
