Skip to contentSkip to conversation

systemd: Point to target binary paths for loadkeys and setfont

PATCH In review Khem Raj 3 participants 4 messages Aug 3, 2023 – Aug 4, 2023

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 systemd: Point to target binary paths for loadkeys and setfont

with newer systemd, if not specified, these paths are searched on build host /usr dir

log.do_configure.2373278:Program /usr/sbin/loadkeys found: YES (/usr/sbin/loadkeys) log.do_configure.2373278:Program /usr/sbin/setfont found: YES (/usr/sbin/setfont)

and if build host happens to have kbd installed then it
uses those locations, this would work fine if the assumption between OE distro and host distro matches but fail otherwise e.g. on archlinux these binaries are in /usr/sbin but in OE they are in ${base_bindir}

This results in
qemux86-64 systemd-vconsole-setup[211]: /usr/sbin/loadkeys failed with exit status 1.

Cc Luca Boccassi <[email protected]>
---
 meta/recipes-core/systemd/systemd_254.bb | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
meta/recipes-core/systemd/systemd_254.bb +6 -2
index a4cfc7b1f44..653fd6910d3 100644
@@ -241,7 +241,9 @@ EXTRA_OEMESON += "-Dnobody-user=nobody \
                   -Dsystem-gid-max=999 \
                   "
 
-# Hardcode target binary paths to avoid using paths from sysroot
+# Hardcode target binary paths to avoid using paths from sysroot or worse
+# it pokes for these binaries on build host and encodes that distro assumption
+# into target
 EXTRA_OEMESON += "-Dkexec-path=${sbindir}/kexec \
                   -Dkmod-path=${base_bindir}/kmod \
                   -Dmount-path=${base_bindir}/mount \
@@ -249,7 +251,9 @@ EXTRA_OEMESON += "-Dkexec-path=${sbindir}/kexec \
                   -Dquotaon-path=${sbindir}/quotaon \
                   -Dsulogin-path=${base_sbindir}/sulogin \
                   -Dnologin-path=${base_sbindir}/nologin \
-                  -Dumount-path=${base_bindir}/umount"
+                  -Dumount-path=${base_bindir}/umount \
+                  -Dloadkeys-path=${base_bindir}/loadkeys \
+                  -Dsetfont-path=${base_bindir}/setfont"
 
 # The 60 seconds is watchdog's default vaule.
 WATCHDOG_TIMEOUT ??= "60"
Signature · 1 line
2.41.0
Acked-by on v1 1/1
#1 lore raw

(please don't send to my microsoft email account, it's absolutely rubbish for mailing lists and can't use plain text mode)

________________________________
From: Khem Raj <[email protected]>
Sent: 03 August 2023 05:39
To: [email protected] <[email protected]>
Cc: Khem Raj <[email protected]>; Luca Boccassi <[email protected]>
Subject: [PATCH] systemd: Point to target binary paths for loadkeys and setfont

[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

with newer systemd, if not specified, these paths are searched on build host /usr dir

log.do_configure.2373278:Program /usr/sbin/loadkeys found: YES (/usr/sbin/loadkeys) log.do_configure.2373278:Program /usr/sbin/setfont found: YES (/usr/sbin/setfont)

and if build host happens to have kbd installed then it
uses those locations, this would work fine if the assumption between OE distro and host distro matches but fail otherwise e.g. on archlinux these binaries are in /usr/sbin but in OE they are in ${base_bindir}

This results in
qemux86-64 systemd-vconsole-setup[211]: /usr/sbin/loadkeys failed with exit status 1.

Cc Luca Boccassi <[email protected]>
---
 meta/recipes-core/systemd/systemd_254.bb | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
meta/recipes-core/systemd/systemd_254.bb +6 -2
index a4cfc7b1f44..653fd6910d3 100644
@@ -241,7 +241,9 @@ EXTRA_OEMESON += "-Dnobody-user=nobody \
                   -Dsystem-gid-max=999 \
                   "
 
-# Hardcode target binary paths to avoid using paths from sysroot
+# Hardcode target binary paths to avoid using paths from sysroot or worse
+# it pokes for these binaries on build host and encodes that distro assumption
+# into target
 EXTRA_OEMESON += "-Dkexec-path=${sbindir}/kexec \
                   -Dkmod-path=${base_bindir}/kmod \
                   -Dmount-path=${base_bindir}/mount \
@@ -249,7 +251,9 @@ EXTRA_OEMESON += "-Dkexec-path=${sbindir}/kexec \
                   -Dquotaon-path=${sbindir}/quotaon \
                   -Dsulogin-path=${base_sbindir}/sulogin \
                   -Dnologin-path=${base_sbindir}/nologin \
-                  -Dumount-path=${base_bindir}/umount"
+                  -Dumount-path=${base_bindir}/umount \
+                  -Dloadkeys-path=${base_bindir}/loadkeys \
+                  -Dsetfont-path=${base_bindir}/setfont"
 
 # The 60 seconds is watchdog's default vaule.
 WATCHDOG_TIMEOUT ??= "60"

--
2.41.0

#2 lore raw
In reply to Khem Raj

Review

Quoted 2 lines · Khem Raj via lists.openembedded.org
(quoted diff) +2 -0
+                  -Dloadkeys-path=${base_bindir}/loadkeys \
+                  -Dsetfont-path=${base_bindir}/setfont”

From systemctl status systemd-vconsole-setup:

Aug 04 15:12:21 qemu-generic-arm64 systemd-vconsole-setup[290]: /bin/loadkeys failed with exit status 1.
root@qemu-generic-arm64:~# which loadkeys
/usr/bin/loadkeys
$ oe-pkgdata-util find-path */loadkeys
kbd: /usr/bin/loadkeys

Patch incoming.

Ross

author
#3 lore raw
Quoted 7 lines · Ross Burton

Review

Quoted 2 lines · Khem Raj via lists.openembedded.org
(quoted diff) +2 -0
+                  -Dloadkeys-path=${base_bindir}/loadkeys \
+                  -Dsetfont-path=${base_bindir}/setfont”

From systemctl status systemd-vconsole-setup:

Quoted 7 lines
Aug 04 15:12:21 qemu-generic-arm64 systemd-vconsole-setup[290]: /bin/loadkeys failed with exit status 1.
root@qemu-generic-arm64:~# which loadkeys
/usr/bin/loadkeys
$ oe-pkgdata-util find-path */loadkeys
kbd: /usr/bin/loadkeys

Hmm, my distro uses usrmerge and bindir and base_bindir are same, hence I missed it. all distros have different location to put these binaries sadly.

Quoted 3 lines

Patch incoming.

Thanks
-Khem

Quoted 1 line

Ross