aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh
diff options
context:
space:
mode:
authorTomasz Maciej Nowak <tomek_n@o2.pl>2019-03-28 18:07:08 +0100
committerHauke Mehrtens <hauke@hauke-m.de>2019-04-06 16:31:10 +0200
commit4e8345ff68f56e10167c2b7c9109d844c77053bd (patch)
tree40b0bb787e85f8fa4ffc6dc949f8bf7107603436 /target/linux/mvebu/base-files/lib/upgrade/sdcard.sh
parent727c3df5bb017e32e05258e31348d45187177347 (diff)
downloadupstream-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/upgrade/sdcard.sh')
-rw-r--r--target/linux/mvebu/base-files/lib/upgrade/sdcard.sh19
1 files changed, 13 insertions, 6 deletions
diff --git a/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh b/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh
index a05df834ba..7aa91f463c 100644
--- a/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh
+++ b/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh
@@ -19,9 +19,12 @@ platform_check_image_sdcard() {
platform_do_upgrade_sdcard() {
local board=$(board_name)
+ local diskdev
sync
- get_image "$1" | dd of=/dev/mmcblk0 bs=2M conv=fsync
+ if export_bootdevice && export_partdevice diskdev 0; then
+ get_image "$1" | dd of=/dev/$diskdev bs=2M conv=fsync
+ fi
case "$board" in
armada-385-turris-omnia)
@@ -36,9 +39,13 @@ platform_do_upgrade_sdcard() {
}
platform_copy_config_sdcard() {
- mkdir -p /boot
- [ -f /boot/kernel.img ] || mount -o rw,noatime /dev/mmcblk0p1 /boot
- cp -af "$CONF_TAR" /boot/
- sync
- umount /boot
+ local partdev
+
+ if export_partdevice partdev 1; then
+ mkdir -p /boot
+ [ -f /boot/kernel.img ] || mount -o rw,noatime /dev/$partdev /boot
+ cp -af "$CONF_TAR" /boot/
+ sync
+ umount /boot
+ fi
}