From 0959dda89f7b48b9c469fefcd6eb7403edc5b4fc Mon Sep 17 00:00:00 2001 From: Roland Clobus Date: Sun, 27 Oct 2024 12:34:04 +0100 Subject: [PATCH] dracut: Support diverted configuration files of Calamares When a configuration file for Calamares is diverted by e.g. `config-package-dev`, it becomes a symlink. The in-place modifications must be applied on the symlinked file, not on a newly created copy. After removal of the package, no remainders are left. See https://salsa.debian.org/live-team/live-build/-/merge_requests/353#note_540394 --- share/hooks/normal/5050-dracut.hook.chroot | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/hooks/normal/5050-dracut.hook.chroot b/share/hooks/normal/5050-dracut.hook.chroot index 22065094e..60acd1676 100755 --- a/share/hooks/normal/5050-dracut.hook.chroot +++ b/share/hooks/normal/5050-dracut.hook.chroot @@ -29,17 +29,17 @@ apt-get autoremove --yes # Adjust the path for Calamares if [ -e /etc/calamares/modules/unpackfs.conf ] then - sed -i -e 's|/run/live/medium|/run/initramfs/live|' /etc/calamares/modules/unpackfs.conf + sed --follow-symlinks -i -e 's|/run/live/medium|/run/initramfs/live|' /etc/calamares/modules/unpackfs.conf fi # Use dracut instead of initramfs-tools if [ -e /etc/calamares/settings.conf ] then - sed -i -e '/initramfscfg/d;s/initramfs/dracut/' /etc/calamares/settings.conf + sed --follow-symlinks -i -e '/initramfscfg/d;s/initramfs/dracut/' /etc/calamares/settings.conf fi # Add dracut-live to the list of packages to uninstall if [ -e /etc/calamares/modules/packages.conf ] then - sed -i -e "s/'live-boot'/'dracut-live'/" /etc/calamares/modules/packages.conf + sed --follow-symlinks -i -e "s/'live-boot'/'dracut-live'/" /etc/calamares/modules/packages.conf fi # Calamares script for /etc/apt/sources.list during the installation SOURCES_MEDIA=/usr/share/calamares/helpers/calamares-sources-media