diff options
author | Tomasz Maciej Nowak <tomek_n@o2.pl> | 2019-03-28 18:07:08 +0100 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2019-04-06 16:31:10 +0200 |
commit | 4e8345ff68f56e10167c2b7c9109d844c77053bd (patch) | |
tree | 40b0bb787e85f8fa4ffc6dc949f8bf7107603436 /target/linux/mvebu/base-files/lib/preinit/79_move_config | |
parent | 727c3df5bb017e32e05258e31348d45187177347 (diff) | |
download | upstream-4e8345ff68f56e10167c2b7c9109d844c77053bd.tar.gz upstream-4e8345ff68f56e10167c2b7c9109d844c77053bd.tar.bz2 upstream-4e8345ff68f56e10167c2b7c9109d844c77053bd.zip |
mvebu: base-files: autodetect upgrade device
Since some boards could be also booted from other mediums than SD card,
lets make the upgrade block device autodetected.
Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
Diffstat (limited to 'target/linux/mvebu/base-files/lib/preinit/79_move_config')
-rw-r--r-- | target/linux/mvebu/base-files/lib/preinit/79_move_config | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/target/linux/mvebu/base-files/lib/preinit/79_move_config b/target/linux/mvebu/base-files/lib/preinit/79_move_config index 73ddf09155..64c0cc0eea 100644 --- a/target/linux/mvebu/base-files/lib/preinit/79_move_config +++ b/target/linux/mvebu/base-files/lib/preinit/79_move_config @@ -1,12 +1,13 @@ #!/bin/sh # Copyright (C) 2015 OpenWrt.org -BOOTPART=/dev/mmcblk0p1 - . /lib/functions.sh +. /lib/upgrade/common.sh move_config() { - if [ -b $BOOTPART ]; then + local partdev + + if export_bootdevice && export_partdevice partdev 1; then case $(board_name) in turris-omnia) insmod nls_cp437 @@ -16,7 +17,7 @@ move_config() { ;; esac mkdir -p /boot - mount -o rw,noatime $BOOTPART /boot + mount -o rw,noatime "/dev/$partdev" /boot [ -f /boot/sysupgrade.tgz ] && mv -f /boot/sysupgrade.tgz / umount /boot fi |