SHA256
1
0
forked from pool/grub2
grub2/grub2-fix-multi-device-root-kernel-argument.patch

45 lines
2.1 KiB
Diff

Index: grub-2.02~beta2/util/grub.d/10_linux.in
===================================================================
--- grub-2.02~beta2.orig/util/grub.d/10_linux.in
+++ grub-2.02~beta2/util/grub.d/10_linux.in
@@ -45,12 +45,14 @@ esac
# btrfs may reside on multiple devices. We cannot pass them as value of root= parameter
# and mounting btrfs requires user space scanning, so force UUID in this case.
-if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
+if ( [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
|| ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
- || ( test -e "${GRUB_DEVICE}" && uses_abstraction "${GRUB_DEVICE}" lvm ); then
+ || uses_abstraction "${GRUB_DEVICE}" lvm ) && test -e "${GRUB_DEVICE}"; then
LINUX_ROOT_DEVICE=${GRUB_DEVICE}
else
- LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
+ if [ "x${GRUB_DEVICE_UUID}" != "x" ]; then
+ LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
+ fi
fi
if [ "x$GRUB_CONMODE" != "x" ]; then
Index: grub-2.02~beta2/util/grub.d/20_linux_xen.in
===================================================================
--- grub-2.02~beta2.orig/util/grub.d/20_linux_xen.in
+++ grub-2.02~beta2/util/grub.d/20_linux_xen.in
@@ -55,12 +55,14 @@ esac
# btrfs may reside on multiple devices. We cannot pass them as value of root= parameter
# and mounting btrfs requires user space scanning, so force UUID in this case.
-if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
+if ( [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
|| ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
- || ( test -e "${GRUB_DEVICE}" && uses_abstraction "${GRUB_DEVICE}" lvm ); then
+ || uses_abstraction "${GRUB_DEVICE}" lvm ) && test -e "${GRUB_DEVICE}"; then
LINUX_ROOT_DEVICE=${GRUB_DEVICE}
else
- LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
+ if [ "x${GRUB_DEVICE_UUID}" != "x" ]; then
+ LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
+ fi
fi
# Allow overriding GRUB_CMDLINE_LINUX and GRUB_CMDLINE_LINUX_DEFAULT.