diff --git a/live/live-root/usr/bin/kernel-cmdline-conf.sh b/live/live-root/usr/bin/kernel-cmdline-conf.sh index a973ab2456..0fc3ea9eae 100755 --- a/live/live-root/usr/bin/kernel-cmdline-conf.sh +++ b/live/live-root/usr/bin/kernel-cmdline-conf.sh @@ -1,4 +1,4 @@ -#! /bin/sh +#! /bin/bash # Script to clean kernel command line from agama specific parameters. Result is later used for bootloader proposal. @@ -12,6 +12,8 @@ write_kernel_args() { # if there is no kernel params touch "${TARGET}" + # silence the "To read lines rather than words..." hint + # shellcheck disable=SC2013 for _i in $(cat "${SOURCE}"); do case ${_i} in # remove all agama kernel params @@ -19,11 +21,23 @@ write_kernel_args() { LIBSTORAGE_* | YAST_* | inst* | agama* | live* | Y2* | ZYPP_* | autoyast*) _found=1 ;; + # remove the Kiwi PXE boot options or Live options + rd.kiwi.* | rd.live.* | ramdisk_size=* | initrd=* | BOOT_IMAGE=*) + _found=1 + ;; + # remove the network configuration options + # https://man7.org/linux/man-pages/man7/dracut.cmdline.7.html + ip=* | rd.route=* | bootdev=* | BOOTIF=* | rd.bootif=* | nameserver=* | \ + rd.peerdns=* | rd.neednet=* | vlan=* | bond=* | team=* | bridge=*) + _found=1 + ;; esac if [ -z "$_found" ]; then - echo "Non-Agama parameter found ($_i)" + echo "Using boot parameter \"$_i\"" echo -n " $_i" >>"${TARGET}" + else + echo "Ignoring boot parameter \"$_i\"" fi unset _found done diff --git a/live/src/agama-installer.changes b/live/src/agama-installer.changes index 62f1ae5098..8999eb1f65 100644 --- a/live/src/agama-installer.changes +++ b/live/src/agama-installer.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Apr 24 15:11:35 UTC 2025 - Ladislav Slezák + +- Filter out the special PXE boot parameters, do not pass them + to the installed system. Remove also most of the network + settings (gh#agama-project/agama#2280) + ------------------------------------------------------------------- Wed Apr 23 08:39:34 UTC 2025 - Ladislav Slezák diff --git a/live/test/fixtures/expected/cmdline b/live/test/fixtures/expected/cmdline index d07b617330..5198688aad 100644 --- a/live/test/fixtures/expected/cmdline +++ b/live/test/fixtures/expected/cmdline @@ -1 +1 @@ - BOOT_IMAGE=/boot/vmlinuz splash=silent mitigations=auto quiet nosimplefb=1 \ No newline at end of file + splash=silent mitigations=auto quiet nosimplefb=1 \ No newline at end of file diff --git a/live/test/fixtures/source/cmdline b/live/test/fixtures/source/cmdline index d43325ea28..ea6bd8c1d6 100644 --- a/live/test/fixtures/source/cmdline +++ b/live/test/fixtures/source/cmdline @@ -1 +1 @@ -BOOT_IMAGE=/boot/vmlinuz splash=silent agama.auto=ftp://example.suse.cz/profile.json LIBSTORAGE_MULTIPATH=1 mitigations=auto Y2DEBUG=1 quiet nosimplefb=1 +BOOT_IMAGE=/boot/vmlinuz initrd=/boot/initrd rd.kiwi.install.pxe rd.kiwi.install.image=http://example.com/agama-installer.x86_64-42.0.0.xz ip=eth0:10.42.0.42 splash=silent agama.auto=ftp://example.suse.cz/profile.json LIBSTORAGE_MULTIPATH=1 mitigations=auto Y2DEBUG=1 quiet nosimplefb=1