[OpenWrt-Devel] [PATCH] x86: fix platform_export_bootpart() for Xen virtual disks

Alexander Dahl post at lespocky.de
Thu Mar 17 17:04:04 EDT 2016


From: Alexander Dahl <alex at netz39.de>

Virtual disk devices in a Xen virtual machine (DomU) can be /dev/xvda,
/dev/xvdb and so on with partitions like /dev/xdva1. Devices named like
this where not considered before. This resulted in a non working
sysupgrade, because the boot partition could not be found.

Signed-off-by: Alexander Dahl <alex at netz39.de>
Suggested-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
Tested with Gluon v2016.1.x and Freifunk Magdeburg firmware on a
Debian Jessie amd64 Xen host. See:
https://github.com/FreifunkMD/gluon/blob/fix-sysupgrade-xen/patches/openwrt/0058-x86-fix-platform_export_bootpart-for-Xen-virtual-disks.patch
---
 target/linux/x86/base-files/lib/upgrade/platform.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/x86/base-files/lib/upgrade/platform.sh b/target/linux/x86/base-files/lib/upgrade/platform.sh
index 86696ae..c21f1a7 100644
--- a/target/linux/x86/base-files/lib/upgrade/platform.sh
+++ b/target/linux/x86/base-files/lib/upgrade/platform.sh
@@ -17,7 +17,7 @@ platform_export_bootpart() {
 			PARTUUID=[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]-02)
 				uuid="${disk#PARTUUID=}"
 				uuid="${uuid%-02}"
-				for disk in /dev/[hsv]d[a-z]; do
+				for disk in /dev/[hsv]d[a-z] /dev/xvd[a-z]; do
 					set -- $(dd if=$disk bs=1 skip=440 count=4 2>/dev/null | hexdump -v -e '4/1 "%02x "')
 					if [ "$4$3$2$1" = "$uuid" ]; then
 						export BOOTPART="${disk}1"
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list