From patchwork Thu Feb 6 14:43:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikko Rapeli X-Patchwork-Id: 56779 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8B74C02196 for ; Thu, 6 Feb 2025 14:43:55 +0000 (UTC) Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) by mx.groups.io with SMTP id smtpd.web10.42636.1738853028976516618 for ; Thu, 06 Feb 2025 06:43:49 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=LeXzwOfT; spf=pass (domain: linaro.org, ip: 209.85.167.46, mailfrom: mikko.rapeli@linaro.org) Received: by mail-lf1-f46.google.com with SMTP id 2adb3069b0e04-53e389d8dc7so982496e87.0 for ; Thu, 06 Feb 2025 06:43:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738853027; x=1739457827; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=LrPRIYfGUDQ7ZjVY+VhkwnAaMgX6/brWIdLLNvoK174=; b=LeXzwOfT6zVpESn7Qxcig/eKM3eSA9BcEeIGICkCfHGVOB5/ETIis8Zk/XLFNLspGC twRHQK9vxMdqhI7HmrExQWXLagD+YiIxJ0Gm6heDBiZV+oYAE0AAHTFQ4hXEA9FwupC7 9mn9/qlIeyYyCTOkN6q8mnXlrD2wYUKIIhVh0nzJDqpVVP2brLPIvGzyK8BcrRi6GnyS KppgCkZcTGqc/Dtzcmj8FJ6YiCtDPXChBhkPHyuqBAFL0GBTDyiytqvOJ9kycKF9vlMB ape8Lz8cC9AC1Nmam638nhg55fZxBvAR6S7Nt7G/S5rK9yDOdwYkbPqMJAp8eWzDRKII 06/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738853027; x=1739457827; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LrPRIYfGUDQ7ZjVY+VhkwnAaMgX6/brWIdLLNvoK174=; b=bIikTDit2xSH0rEOtI+6yUxHsfZRQ2fBvIqFGw7tdA1gdmt0ZFsYvYcNFzpVfVkgnS SQ/iLymnTXEwd9rtLnNWUeqJQYKwFSiqkt1jPLVHaYDp5olMjUCbzXmJZzcwe6ZUZ5Mh ZXMHjbLT9nNfvmRvYgyz1TZamSSnPcLvBACSVQP8b1MVSz6SSFHD22/T4lDmzIWK73SU 7Q6xG/cH4Yg5kgOIq0iezP79lUIppFKMkzTda8GW0PZbhfKawHLtF9BnyYJxRXjh6vCj fhKh0VboOoVD6cyt7AtsgfZk8n5f60ttpj+amOqbW3yeFjyESZqdTPWUwXfDovYgAO20 agaw== X-Gm-Message-State: AOJu0YxJ31kX+OuZD+UNK4V4wHQ3+rR7ZHo8ZpwfAUVyCgX6/ZE5YYG8 ehW/iur+LCqRiNCvMai5XA7+C+dIyaO4TxUm1YsvoY5YVFdKzEJ42Z6fyKjc7YM= X-Gm-Gg: ASbGnctgEqlUbmGkGbtQdyzKqUTBRWLkgGv3uu5IQ1+cdaL8womMHMYPoQE69l04iYd GCAzEYnzKBJsk38FM7Vo59CiNfYH0F/9mH9vCaDkaze6JBze5coVux1XsqAKyWfJqS2SulyjEzo 61Q7T+BiIa8wcRZ3mQgTZ+qACenTl7Omf7+M8ygip36qjYNZhoeNhpEAqHhegXGw6AkeTcc/Pyy X/qTTT5erE3Lr3wGf/YcfF8uYUCvXc6XZ/1t+JCngEhSb56amtOkQIglOtx6Ya5C/9RC5RiSF60 ffZfFCSFX3ZuXf3mFVrRBFTkrrPJTA9NvuNdUr+AwnrTFAKkOc61SRx6qjuj X-Google-Smtp-Source: AGHT+IF1VJLgJV//WIpAa+s8CtBCfSTXldvWN4G6yFIfBpsQpIhuYOmgnIvjVkjp2SiNMDg1wSLXxg== X-Received: by 2002:a2e:bea2:0:b0:306:501:4752 with SMTP id 38308e7fff4ca-307cf2f6a38mr28893411fa.11.1738853026729; Thu, 06 Feb 2025 06:43:46 -0800 (PST) Received: from localhost.localdomain (78-27-76-97.bb.dnainternet.fi. [78.27.76.97]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-307de2b98c0sm1446241fa.69.2025.02.06.06.43.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 06:43:46 -0800 (PST) From: Mikko Rapeli To: poky@lists.yoctoproject.org Cc: openembedded-core@lists.openembedded.org, Mikko Rapeli Subject: [PATCH 1/2] systemd: use serial-getty-generator on genericarm64 Date: Thu, 6 Feb 2025 16:43:12 +0200 Message-ID: <20250206144312.1328179-1-mikko.rapeli@linaro.org> X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 06 Feb 2025 14:43:55 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/210938 systemd-serialgetty recipe sets serial consoles based on SERIAL_CONSOLES build time variable. These fail to be detected on multiple devices including qemu and the resulting failures delay boot to systemd "running" state by one minute on an example aarch64 build machine and qemu. Serial console login works with both since udev will trigger agetty on correct devices. Using systemd side serial-getty-generator disables systemd-serialgetty. qemu-system-aarch64 core-image-base boot time with systemd-serialgetty before this patch: $ systemd-analyze Startup finished in 8.314s (firmware) + 9.805s (loader) + 14.338s (kernel) + 1min 34.392s (userspace) = 2min 6.851s multi-user.target reached after 1min 34.387s in userspace. with this patch: Startup finished in 8.312s (firmware) + 9.804s (loader) + 14.295s (kernel) + 29.808s (userspace) = 1min 2.220s multi-user.target reached after 29.802s in userspace. Signed-off-by: Mikko Rapeli --- meta-yocto-bsp/recipes-core/systemd/systemd_%.bbappend | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 meta-yocto-bsp/recipes-core/systemd/systemd_%.bbappend diff --git a/meta-yocto-bsp/recipes-core/systemd/systemd_%.bbappend b/meta-yocto-bsp/recipes-core/systemd/systemd_%.bbappend new file mode 100644 index 0000000000..f23852a351 --- /dev/null +++ b/meta-yocto-bsp/recipes-core/systemd/systemd_%.bbappend @@ -0,0 +1,3 @@ +# auto detection instead of build time configured via SERIAL_CONSOLES +# to support multiple devices +PACKAGECONFIG:append:genericarm64 = " serial-getty-generator" From patchwork Thu Feb 6 14:44:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikko Rapeli X-Patchwork-Id: 56780 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id A566EC02196 for ; Thu, 6 Feb 2025 14:44:35 +0000 (UTC) Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) by mx.groups.io with SMTP id smtpd.web11.42923.1738853067662755841 for ; Thu, 06 Feb 2025 06:44:28 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=UJZinSR4; spf=pass (domain: linaro.org, ip: 209.85.167.41, mailfrom: mikko.rapeli@linaro.org) Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-5440d5aae5cso1098217e87.0 for ; Thu, 06 Feb 2025 06:44:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738853066; x=1739457866; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=v3k2E360cSwEGwtHk2vivgdYS88g5eIEgAPvtq9morc=; b=UJZinSR405YVYPHUtqe2Wj4g2ERLw3d/6Ja69RtwHSXmBJ0M90cBn0iX+sIdGTpiJC k6v2s+x2ScJiFmOfM8LMS8UM7JlPxDqoUdDRkagnSYEDEyOUWbmVXX5PneZGJ1Bu8JD7 Kdz8myx/w4KgUlqyqY36jp2Uft//F5mpSQuNZDNjhB+C+kLgsBnqvGB0t4oBXe5n2plu O4PoENNFTsMEaO8lThf9m9Jl0epUzhyioZ2q7Rl/bFRrhfxtGHsyR9Wb24wmuS0l39N+ OTglyFLvoA03z64QGTDmGo8hX5ydtaeaC3+hebH/CQcIRP8Hrmfp/4fDI235aRVyMzFP aWow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738853066; x=1739457866; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=v3k2E360cSwEGwtHk2vivgdYS88g5eIEgAPvtq9morc=; b=nx9IsoZ04y7cud9MHX2IHikyHpnxMX8K89WqnwwXwwfPzTI9KYukWmrbQl91cvK6A8 72z3+x6JtS6eeNJo8bCR650s439WwXynXddIRrWBrfzJsv66JxlUVWlbm71y6PWE72GI X8gWG0r+pSSyNCg1RngKr19AEusowwObVpp/VRXI1+E/28kZ+d/3SmMv9aMxSzAebcjT PuGclkXljcsh845zZHpEXqx5S36OGHCCt75exbj8V+XV3Qqh0/nE1G3pJZ8IviOj5elB T7aroXHg8RwHKb5Angp6wP8ZH/s4F0/I5QhgN+1Ggqj5ub2psJxQEKlDVfq2aMWrlX4t 0Lag== X-Gm-Message-State: AOJu0YxMyfsEJtSdJj/C6Igty2Q+d+WqaV4NeEToL4ip2IV3feZ9dR9M mrLqUaJaAmBHaYrIrR/66rb9/XnnY8nbYUjOICOClJmnLSb2hjKIL2NdUDXqLpMIRVfXFMdCzej YPKI= X-Gm-Gg: ASbGncsOfqOwKGn2o2+OxxVphR8uAG0nwe+nQSozY6NV7bvmnW3cJclmMXTE61K8ZiO NOnBYYNHJJSd6zPwS3Y8C9Ch8fwe6PiMgftMCCEzKmA34i25e3rAj49+mQMmVyu8PoP/FwMkMZL FZhup0CpjmGYcjzQEPXZalKryZWHAhIH+K+riyzQ5quRAFGQZn695uqc1gTvmx5EQbITObLML32 lU2Yy7MIF+t+ZIhICwKtjTV9QNsPnpsQvbRqsDFTcMXRlPIMJtfJMcr/eGPWMu+T2X0sTRkF+44 Ixbs1ABU8Pptk7ThneG0eglTfDKOBTjfKKbceztZetb71FhdASvmmoYPTUD3 X-Google-Smtp-Source: AGHT+IERrxwf2DNCzpqbtls71TRCy0winpdXF5GRM2YVfyvUct8KHx/NOrq34AlHL6F/IdgA5o4t6A== X-Received: by 2002:a05:6512:2343:b0:544:124f:1721 with SMTP id 2adb3069b0e04-544124f1842mr614312e87.6.1738853065750; Thu, 06 Feb 2025 06:44:25 -0800 (PST) Received: from localhost.localdomain (78-27-76-97.bb.dnainternet.fi. [78.27.76.97]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-544106040b4sm147434e87.226.2025.02.06.06.44.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 06:44:24 -0800 (PST) From: Mikko Rapeli To: openembedded-core@lists.openembedded.org Cc: poky@lists.yoctoproject.org, Mikko Rapeli Subject: [PATCH 2/2] psplash: start via udev if framebuffer device detected Date: Thu, 6 Feb 2025 16:44:06 +0200 Message-ID: <20250206144406.1328276-1-mikko.rapeli@linaro.org> X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 06 Feb 2025 14:44:35 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/210939 psplash-start.service expected to find /dev/fb0 and failed if device was not found. This failure breaks systemd oeqa runtime test with "runqemu nographic". Starting psplash based on detected framebuffer device fixes systemd boot status and systemd oeqa runtime tests for qemu boots with and without graphics support. Note that psplash-systemd.service still depends on /dev/fb0 so startup with multiple framebuffer devices may not work correctly. I don't have devices with multiple framebuffer devices to test with. On qemu machine with graphics, psplash displays yocto logo correctly and boot progress bar as well. Once boot completes to systemd "running" state, the logo is replaced by login prompt. On qemu machine without graphics, boot completes without psplash or failures and login over serial console works normally. Tested with genericarm64 machine poky-altcfg distro and core-image-base image on qemu. AMD kv260 tested as well but graphics stack is not yet working there so boot is similar to qemu without graphics. Signed-off-by: Mikko Rapeli --- meta/recipes-core/psplash/files/fb.rules | 1 + .../{psplash-start.service => psplash-start@.service} | 5 ++--- meta/recipes-core/psplash/files/psplash-systemd.service | 8 +++----- meta/recipes-core/psplash/psplash_git.bb | 9 ++++++--- 4 files changed, 12 insertions(+), 11 deletions(-) create mode 100644 meta/recipes-core/psplash/files/fb.rules rename meta/recipes-core/psplash/files/{psplash-start.service => psplash-start@.service} (84%) diff --git a/meta/recipes-core/psplash/files/fb.rules b/meta/recipes-core/psplash/files/fb.rules new file mode 100644 index 0000000000..accdb8386c --- /dev/null +++ b/meta/recipes-core/psplash/files/fb.rules @@ -0,0 +1 @@ +SUBSYSTEM=="graphics", KERNEL=="fb[0-9]*", TAG+="systemd", ENV{SYSTEMD_WANTS}+="psplash-start@%k.service psplash-systemd.service" diff --git a/meta/recipes-core/psplash/files/psplash-start.service b/meta/recipes-core/psplash/files/psplash-start@.service similarity index 84% rename from meta/recipes-core/psplash/files/psplash-start.service rename to meta/recipes-core/psplash/files/psplash-start@.service index bec9368427..1bc3642fc2 100644 --- a/meta/recipes-core/psplash/files/psplash-start.service +++ b/meta/recipes-core/psplash/files/psplash-start@.service @@ -3,11 +3,10 @@ Description=Start psplash boot splash screen DefaultDependencies=no RequiresMountsFor=/run ConditionFileIsExecutable=/usr/bin/psplash +After=dev-%i.device +Wants=dev-%i.device [Service] Type=notify ExecStart=/usr/bin/psplash RemainAfterExit=yes - -[Install] -WantedBy=sysinit.target diff --git a/meta/recipes-core/psplash/files/psplash-systemd.service b/meta/recipes-core/psplash/files/psplash-systemd.service index e93e3deb35..f9aaa2db3d 100644 --- a/meta/recipes-core/psplash/files/psplash-systemd.service +++ b/meta/recipes-core/psplash/files/psplash-systemd.service @@ -1,14 +1,12 @@ [Unit] Description=Start psplash-systemd progress communication helper DefaultDependencies=no -After=psplash-start.service -Requires=psplash-start.service +After=psplash-start@fb0.service +Requires=psplash-start@fb0.service RequiresMountsFor=/run ConditionFileIsExecutable=/usr/bin/psplash +ConditionFileExists=/run/psplash_fifo [Service] ExecStart=/usr/bin/psplash-systemd RemainAfterExit=yes - -[Install] -WantedBy=sysinit.target diff --git a/meta/recipes-core/psplash/psplash_git.bb b/meta/recipes-core/psplash/psplash_git.bb index 30cf61a2cb..fce5995efe 100644 --- a/meta/recipes-core/psplash/psplash_git.bb +++ b/meta/recipes-core/psplash/psplash_git.bb @@ -11,8 +11,9 @@ PV = "0.1+git" SRC_URI = "git://git.yoctoproject.org/${BPN};branch=master;protocol=https \ file://psplash-init \ - file://psplash-start.service \ + file://psplash-start@.service \ file://psplash-systemd.service \ + file://fb.rules \ ${SPLASH_IMAGES}" UPSTREAM_CHECK_COMMITS = "1" @@ -112,8 +113,10 @@ do_install:append() { if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then install -d ${D}${systemd_system_unitdir} - install -m 644 ${UNPACKDIR}/psplash-start.service ${D}/${systemd_system_unitdir} + install -m 644 ${UNPACKDIR}/psplash-start@.service ${D}/${systemd_system_unitdir} install -m 644 ${UNPACKDIR}/psplash-systemd.service ${D}/${systemd_system_unitdir} + install -d ${D}${sysconfdir}/udev/rules.d + install -m 0644 ${UNPACKDIR}/fb.rules ${D}${sysconfdir}/udev/rules.d/ fi install -d ${D}${bindir} @@ -124,7 +127,7 @@ do_install:append() { } SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}" -SYSTEMD_SERVICE:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'systemd', 'psplash-start.service psplash-systemd.service', '', d)}" +SYSTEMD_SERVICE:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'systemd', 'psplash-start@.service psplash-systemd.service', '', d)}" INITSCRIPT_NAME = "psplash.sh" INITSCRIPT_PARAMS = "start 0 S . stop 20 0 1 6 ."