From 277f8a4bdf6ff67d0153e96a7bae76905ec95d38f205543986f4b2d3ffa435f5 Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Fri, 29 Mar 2024 02:44:36 +0000 Subject: [PATCH] Accepting request 1163417 from home:michael-chang:branches:Base:System - Fix os name is used for root file system mount (bsc#1220949) * 0001-10_linux-Ensure-persistence-of-root-file-system-moun.patch OBS-URL: https://build.opensuse.org/request/show/1163417 OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=498 --- ...persistence-of-root-file-system-moun.patch | 51 +++++++++++++++++++ grub2.changes | 6 +++ grub2.spec | 1 + 3 files changed, 58 insertions(+) create mode 100644 0001-10_linux-Ensure-persistence-of-root-file-system-moun.patch diff --git a/0001-10_linux-Ensure-persistence-of-root-file-system-moun.patch b/0001-10_linux-Ensure-persistence-of-root-file-system-moun.patch new file mode 100644 index 0000000..fdd199f --- /dev/null +++ b/0001-10_linux-Ensure-persistence-of-root-file-system-moun.patch @@ -0,0 +1,51 @@ +From 28440c9b5f83b82b4715554fa5c2d3f013b769e6 Mon Sep 17 00:00:00 2001 +From: Michael Chang +Date: Tue, 26 Mar 2024 13:55:53 +0800 +Subject: [PATCH] 10_linux: Ensure persistence of root file system mounting + +This commit addresses the issue where the by-uuid or by-partuuid device +symlinks might be unavailable in an installation system. Despite the +absence of these symlinks, the resulting system remains fully functional +for mounting the root file system by using persistent names +(root=(UUID|PARTUUID)=). + +The patch implemented in this commit aims to prevent fallback to the OS +name as the root= parameter, as persistent names are preferred for +stability and predictability. + +To achieve this, the fallback to the OS name won't be triggered if the +corresponding by-uuid or by-partuuid symlinks are missing, ensuring the +use of persistent names. Instead, a warning will be logged for the +missing symlinks, providing visibility into the issue. + +Signed-off-by: Michael Chang +--- + util/grub.d/10_linux.in | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in +index 5531239eb..4d8bdeac2 100644 +--- a/util/grub.d/10_linux.in ++++ b/util/grub.d/10_linux.in +@@ -54,14 +54,16 @@ esac + if ( [ "x${GRUB_DEVICE_UUID}" = "x" ] && [ "x${GRUB_DEVICE_PARTUUID}" = "x" ] ) \ + || ( [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \ + && [ "x${GRUB_DISABLE_LINUX_PARTUUID}" = "xtrue" ] ) \ +- || ( ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \ +- && ! test -e "/dev/disk/by-partuuid/${GRUB_DEVICE_PARTUUID}" ) \ + || ( test -e "${GRUB_DEVICE}" && uses_abstraction "${GRUB_DEVICE}" lvm ); then + LINUX_ROOT_DEVICE=${GRUB_DEVICE} + elif [ "x${GRUB_DEVICE_UUID}" = "x" ] \ + || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ]; then ++ test -e "/dev/disk/by-partuuid/${GRUB_DEVICE_PARTUUID}" || ++ echo "WARN: Use PARTUUID=${GRUB_DEVICE_PARTUUID} despite missing by-partuuid symlink" >&2 + LINUX_ROOT_DEVICE=PARTUUID=${GRUB_DEVICE_PARTUUID} + else ++ test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" || ++ echo "WARN: Use UUID=${GRUB_DEVICE_UUID} despite missing by-uuid symlink" >&2 + LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID} + fi + +-- +2.44.0 + diff --git a/grub2.changes b/grub2.changes index 1273527..ba46b9e 100644 --- a/grub2.changes +++ b/grub2.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Mar 29 01:58:00 UTC 2024 - Michael Chang + +- Fix os name is used for root file system mount (bsc#1220949) + * 0001-10_linux-Ensure-persistence-of-root-file-system-moun.patch + ------------------------------------------------------------------- Wed Mar 27 04:51:33 UTC 2024 - Michael Chang diff --git a/grub2.spec b/grub2.spec index 6686182..31cea18 100644 --- a/grub2.spec +++ b/grub2.spec @@ -404,6 +404,7 @@ Patch210: 0008-blscfg-reading-bls-fragments-if-boot-present.patch Patch211: 0009-10_linux-Some-refinement-for-BLS.patch Patch212: grub2-bsc1220338-key_protector-implement-the-blocklist.patch Patch213: 0001-ofdisk-Enhance-canonical-path-handling-for-bootpath.patch +Patch214: 0001-10_linux-Ensure-persistence-of-root-file-system-moun.patch Requires: gettext-runtime %if 0%{?suse_version} >= 1140