• [gentoo-dev] [PATCH] kernel-install.eclass: fix test phase on systemd s

    From Andrew Ammerlaan@21:1/5 to All on Mon Dec 11 08:50:02 2023
    Patch is part of https://github.com/gentoo/gentoo/pull/34024

    Best regards,
    Andrew

    From 03e17149eef9eba08f8c8bf32845c18106d32290 Mon Sep 17 00:00:00 2001
    From: Andrew Ammerlaan <[email protected]>
    Date: Mon, 11 Dec 2023 08:36:58 +0100
    Subject: [PATCH] kernel-install.eclass: fix test phase on systemd systems

    On systemd systems the dracut systemd modules are included automatically. Systemd insists our dummy root has some valid /etc/os-release file,
    otherwise
    it refuses the switch root operation. However, with this fix it still
    does not
    boot up correctly on systemd systems, it gets stuck in an infinite boot
    loop.
    Presumably the reason has something to do with our dummy root not having
    a real
    systemd init to switch root to. We add the systemd dracut modules to the
    omit
    list to prevent the problem and ensure the test phase behaves the same on systemd and non-systemd systems.

    Signed-off-by: Andrew Ammerlaan <[email protected]>
    ---
    eclass/kernel-install.eclass | 12 ++++++++++++
    1 file changed, 12 insertions(+)

    diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass
    index b4d84f3986c0d..f2a6ec75f2a88 100644
    --- a/eclass/kernel-install.eclass
    +++ b/eclass/kernel-install.eclass
    @@ -231,6 +231,17 @@ kernel-install_create_qemu_image() {
    # some layout needed to pass dracut's usable_root() validation
    mkdir -p "${imageroot}"/{bin,dev,etc,lib,proc,root,sbin,sys} || die
    touch "${imageroot}/lib/ld-fake.so" || die
    + # Initrd images with systemd require some os-release file
    + cat <<-EOT >> "${imageroot}/etc/os-release" || die
    + NAME=Gentoo
    + ID=gentoo
    + PRETTY_NAME="Gentoo Linux"
    + ANSI_COLOR="1;32"
    + HOME_URL="https://www.gentoo.org/"
    + SUPPORT_URL="https://www.gentoo.org/support/"
    + BUG_REPORT_URL="https://bugs.gentoo.org/"
    + VERSION_ID="dist-kernel testing"
    + EOT

    kernel-install_create_init "${imageroot}/sbin/init"

    @@ -263,6 +274,7 @@ kernel-install_test() {
    plymouth # hangs, o
  • From =?UTF-8?Q?Micha=C5=82_G=C3=B3rny?=@21:1/5 to Andrew Ammerlaan on Mon Dec 11 12:20:01 2023
    On Mon, 2023-12-11 at 08:43 +0100, Andrew Ammerlaan wrote:
    Patch is part of https://github.com/gentoo/gentoo/pull/34024

    Best regards,
    Andrew

    From 03e17149eef9eba08f8c8bf32845c18106d32290 Mon Sep 17 00:00:00 2001
    From: Andrew Ammerlaan <[email protected]>
    Date: Mon, 11 Dec 2023 08:36:58 +0100
    Subject: [PATCH] kernel-install.eclass: fix test phase on systemd systems

    On systemd systems the dracut systemd modules are included automatically. Systemd insists our dummy root has some valid /etc/os-release file, otherwise
    it refuses the switch root operation. However, with this fix it still
    does not
    boot up correctly on systemd systems, it gets stuck in an infinite boot loop.
    Presumably the reason has something to do with our dummy root not having
    a real
    systemd init to switch root to. We add the systemd dracut modules to the omit
    list to prevent the problem and ensure the test phase behaves the same on systemd and non-systemd systems.

    Signed-off-by: Andrew Ammerlaan <[email protected]>
    ---
    eclass/kernel-install.eclass | 12 ++++++++++++
    1 file changed, 12 insertions(+)

    diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass index b4d84f3986c0d..f2a6ec75f2a88 100644
    --- a/eclass/kernel-install.eclass
    +++ b/eclass/kernel-install.eclass
    @@ -231,6 +231,17 @@ kernel-install_create_qemu_image() {
    # some layout needed to pass dracut's usable_root() validation
    mkdir -p "${imageroot}"/{bin,dev,etc,lib,proc,root,sbin,sys} || die
    touch "${imageroot}/lib/ld-fake.so" || die
    + # Initrd images with systemd require some os-release file
    + cat <<-EOT >> "${imageroot}/etc/os-release" || die
    + NAME=Gentoo
    + ID=gentoo
    + PRETTY_NAME="Gentoo Linux"
    + ANSI_COLOR="1;32"
    + HOME_URL="https://www.gentoo.org/"
    + SUPPORT_URL="https://www.gentoo.org/support/"
    + BUG_REPORT_URL="https://bugs.gentoo.org/"
    + VERSION_ID="dist-kernel testing"
    + EOT


    Can't we just copy it from host?

    --
    Best regards,
    Michał Górny


    -----BEGIN PGP SIGNATURE-----

    iQFGBAABCgAwFiEEx2qEUJQJjSjMiybFY5ra4jKeJA4FAmV27mQSHG1nb3JueUBn ZW50b28ub3JnAAoJEGOa2uIyniQOWZsIAMQX/9TwN8/B7oIhNZeK9zmszjU/rE6x 1ja+CqJDPTv5JSG/tpYFzK58lXzu1YLZ9TrMJbL+Lj3ImvJtVESuhNQxJnfFgIQQ CtZOojvP1xKPzpIOm8ISZsAkO2Open4d9i0LXKxIdO40OblNqmz5oKNaD7zeK6qt xt95CoscEKBd4zElWICQlhK0cKwUfk9IruLy3kc7j9keGJw8WMjZRvlMb+KZSrbi GHoneZplcxhQHc6Q4sQexlVJ+N8Kuj/O2nXSnxmdKbuGKVRpUrG8rayTxSRDmdKP WH4g+wgMfb4q+kVn1PENRopuxfCcu5fk83mPEupPBzxfj6GYWxLwoSI=
    =hakA
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)