0018-x86-fix-platform_export_bootpart-for-Xen-virtual-disks.patch 1.2 KB

12345678910111213141516171819202122232425
  1. From: Alexander Dahl <alex@netz39.de>
  2. Date: Thu, 17 Mar 2016 15:04:09 +0100
  3. Subject: x86: fix platform_export_bootpart() for Xen virtual disks
  4. Virtual disk devices in a Xen virtual machine (DomU) can be /dev/xvda,
  5. /dev/xvdb and so on with partitions like /dev/xdva1. Devices named like
  6. this where not considered before. This resulted in a non working
  7. sysupgrade, because the boot partition could not be found.
  8. Signed-off-by: Alexander Dahl <alex@netz39.de>
  9. Suggested-by: Matthias Schiffer <mschiffer@universe-factory.net>
  10. diff --git a/target/linux/x86/base-files/lib/upgrade/platform.sh b/target/linux/x86/base-files/lib/upgrade/platform.sh
  11. index 73ab5ef..adc119c 100644
  12. --- a/target/linux/x86/base-files/lib/upgrade/platform.sh
  13. +++ b/target/linux/x86/base-files/lib/upgrade/platform.sh
  14. @@ -17,7 +17,7 @@ platform_export_bootpart() {
  15. 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)
  16. uuid="${disk#PARTUUID=}"
  17. uuid="${uuid%-02}"
  18. - for disk in /dev/[hsv]d[a-z]; do
  19. + for disk in /dev/[hsv]d[a-z] /dev/xvd[a-z]; do
  20. set -- $(dd if=$disk bs=1 skip=440 count=4 2>/dev/null | hexdump -v -e '4/1 "%02x "')
  21. if [ "$4$3$2$1" = "$uuid" ]; then
  22. export BOOTPART="${disk}1"