From f795e58483f80f5de9f8662a648e041f9f2d7c88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 3 Aug 2015 03:00:59 +0200 Subject: [PATCH] Undo 'Boot Loader Spec' by deleting /boot/MACHINE_ID The specification doesn't cover how to boot Xen (or any other multiboot binary), but the sole presence of such directory changes dracut default path. So get rid of that directory. --- rpm_spec/core-dom0-linux.spec | 2 ++ system-config/kernel-remove-bls.install | 15 +++++++++++++++ 2 files changed, 17 insertions(+) create mode 100755 system-config/kernel-remove-bls.install diff --git a/rpm_spec/core-dom0-linux.spec b/rpm_spec/core-dom0-linux.spec index 68cc143..378c29c 100644 --- a/rpm_spec/core-dom0-linux.spec +++ b/rpm_spec/core-dom0-linux.spec @@ -151,6 +151,7 @@ install -m 644 system-config/00-qubes-ignore-devices.rules $RPM_BUILD_ROOT/etc/u install -m 644 system-config/60-persistent-storage.rules $RPM_BUILD_ROOT/etc/udev/rules.d/ install -m 644 -D system-config/disable-lesspipe $RPM_BUILD_ROOT/etc/profile.d/zz-disable-lesspipe install -m 755 -D system-config/kernel-grub2.install $RPM_BUILD_ROOT/usr/lib/kernel/install.d/90-grub2.install +install -m 755 -D system-config/kernel-remove-bls.install $RPM_BUILD_ROOT/usr/lib/kernel/install.d/99-remove-bls.install ### Icons mkdir -p $RPM_BUILD_ROOT/usr/share/qubes/icons @@ -275,5 +276,6 @@ chmod -x /etc/grub.d/10_linux %files kernel-install /usr/lib/kernel/install.d/90-grub2.install +/usr/lib/kernel/install.d/99-remove-bls.install %changelog diff --git a/system-config/kernel-remove-bls.install b/system-config/kernel-remove-bls.install new file mode 100755 index 0000000..1db623e --- /dev/null +++ b/system-config/kernel-remove-bls.install @@ -0,0 +1,15 @@ +#!/bin/sh + +# The Boot Loader Specification is not useful for Qubes OS, because it handles +# only direct Linux boot, not Xen or any other multiboot application (like +# tboot). +# Because of that Qubes OS still uses generated grub2 configuration. +# Unfortunately the sole existence of /boot/${MACHINE_ID} changes behaviour of +# some tools - for example default output file in dracut. So forcibly remove +# the directory (which was just created...). + +[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id + +if [[ $MACHINE_ID ]] && ( [[ -d /boot/${MACHINE_ID} ]] || [[ -L /boot/${MACHINE_ID} ]] ); then + rm -rf /boot/${MACHINE_ID} +fi