aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mvebu
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/mvebu')
-rw-r--r--target/linux/mvebu/base-files/lib/preinit/79_move_config9
-rw-r--r--target/linux/mvebu/base-files/lib/upgrade/sdcard.sh19
2 files changed, 18 insertions, 10 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
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
}