0090-x86-search-PARTUUID-in-any-block-device.patch 1021 B

12345678910111213141516171819202122
  1. From: Jo-Philipp Wich <jo@mein.io>
  2. Date: Wed, 30 Mar 2016 03:19:23 +0200
  3. Subject: x86: search PARTUUID in any block device
  4. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
  5. Backport of LEDE 924fb794bde41eca8289c6cf10322bf6683b4a80
  6. diff --git a/target/linux/x86/base-files/lib/upgrade/platform.sh b/target/linux/x86/base-files/lib/upgrade/platform.sh
  7. index f12deebf6484df6f3f69e453ad67688a76d57972..29eac77dfb0ae52f241696f3f62dce7d16106b20 100644
  8. --- a/target/linux/x86/base-files/lib/upgrade/platform.sh
  9. +++ b/target/linux/x86/base-files/lib/upgrade/platform.sh
  10. @@ -17,7 +17,8 @@ platform_export_bootpart() {
  11. 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)
  12. uuid="${disk#PARTUUID=}"
  13. uuid="${uuid%-02}"
  14. - for disk in /dev/[hsv]d[a-z] /dev/xvd[a-z]; do
  15. + for disk in /dev/*; do
  16. + [ -b "$disk" ] || continue
  17. set -- $(dd if=$disk bs=1 skip=440 count=4 2>/dev/null | hexdump -v -e '4/1 "%02x "')
  18. if [ "$4$3$2$1" = "$uuid" ]; then
  19. export BOOTPART="${disk}1"