From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 5D28E158013 for ; Mon, 11 Dec 2023 11:22:47 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1A9BB2BC026; Mon, 11 Dec 2023 11:22:43 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id CA7012BC01D for ; Mon, 11 Dec 2023 11:22:42 +0000 (UTC) Message-ID: <295e7517-98c4-4397-96a3-96388e81d078@gentoo.org> Date: Mon, 11 Dec 2023 12:22:37 +0100 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [gentoo-dev] [PATCH v2] kernel-install.eclass: fix test phase on systemd systems Content-Language: en-US, nl-NL To: gentoo-dev@lists.gentoo.org References: <52e0360e-965f-42e2-bb69-17de424f7d05@gentoo.org> <13496e5a0edc7613db8fb374c2943c9464eaa5bb.camel@gentoo.org> From: Andrew Ammerlaan Autocrypt: addr=andrewammerlaan@gentoo.org; keydata= xsBNBF3n3cUBCAC6uoDZ0XzaO29l8AzUblXQ5rxZI7nbGEnfFqjEQCK3oEXxsDa9Ez1myx3M ir53Vyx64Iz1Bq/TOS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lTTF+RDYGv5hUoWkmcXDM2X/Cl0XB4XYOWr17Wa6+WXC+80/iLxxolMqM4KfuIR5OizbqK 2CRAJY7la7TSv1lTD1cAEQEAAcLAfAQYAQgAJgIbDBYhBAb/U0G9gF2wvH0HpqGfY2zU7bzR BQJlNiHABQkJL3d7AAoJEKGfY2zU7bzRjDwH/1fp/87km2YYVgrfP1aWLjAA/TwcEVycRJQQ S9Q6xuzgD5AYhjzBSONoN46cwf+gla6xndY0lCawsZN7whtJ/DhqSZEfL0HgHkJ6T8FCXexf n1s6XmIAxqIrMmfsuOkAPLJIHzAAGzQX8DXcRSj1cIDUpa1Uy7ncVvI4EzJBRtJVJXIbl+53 NGauXU8ZuprPYkMSPuW3eHATFc0F5DhmlFUXh+HYYK+2QTO73TENMhngkrYcw63je5bRp/+f 72XFKlf1gXHK1ivg8nYueyUfrxZTBGKagusOiQeOao2I1uYcHoFhPYJrQWePMyZiYyB6PR0K DR4B/Ulo3v0eBXaaYzo= Organization: Gentoo Linux In-Reply-To: <13496e5a0edc7613db8fb374c2943c9464eaa5bb.camel@gentoo.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Archives-Salt: 1dacd083-3b79-4859-b551-4ba804f666d6 X-Archives-Hash: c65cfaa2f4a55a5f5a058c25a84e2760 >> + # 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? > I guess we can, we would be assuming that the host has a valid one but this shouldn't be a problem since at least for systemd systems you can apparently not boot at all if it is not valid. v2: From 0a22dcc93c8ba16cdb450f2443ad256e56111d6e Mon Sep 17 00:00:00 2001 From: Andrew Ammerlaan 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 --- eclass/kernel-install.eclass | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass index b4d84f3986c0d..e244f6d51a9cd 100644 --- a/eclass/kernel-install.eclass +++ b/eclass/kernel-install.eclass @@ -231,6 +231,8 @@ 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 + cp /etc/os-release "${imageroot}/etc/os-release" || die kernel-install_create_init "${imageroot}/sbin/init" @@ -263,6 +265,7 @@ kernel-install_test() { plymouth # hangs, or sometimes steals output rngd # hangs or segfaults sometimes i18n # copies all the fonts from /usr/share/consolefonts + dracut-systemd systemd systemd-initrd # gets stuck in boot loop ) # NB: if you pass a path that does not exist or is not a regular