Skip to contentSkip to conversation

package/systemd: handle vconsole w/ keymap support

PATCH Applied Romain Naour 2 participants 2 messages Aug 2, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/systemd: handle vconsole w/ keymap support

systemd v254 provide a new option "default-keymap" to handle vconsole with keymap support [1]. With this change systemd now use the "us" keymap by default and requires keytable files and keyboard utilities from kbd package.

The keymap support can still be disabled using -Ddefault-keymap="" at build time.

Handle the vconsole w/ keymap support and allow to use another keymap than "us" by default.

Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/4768561206 (TestInitSystemSystemdRwNetworkd)
https://gitlab.com/buildroot.org/buildroot/-/jobs/4768561203 (TestInitSystemSystemdRwIfupdownDbusbrokerDbus)
https://gitlab.com/buildroot.org/buildroot/-/jobs/4768561202 (TestInitSystemSystemdRwIfupdownDbusbroker)
https://gitlab.com/buildroot.org/buildroot/-/jobs/4768561201 (TestInitSystemSystemdRwIfupdown)
https://gitlab.com/buildroot.org/buildroot/-/jobs/4768561199 (TestInitSystemSystemdRwFull)
https://gitlab.com/buildroot.org/buildroot/-/jobs/4768561197 (TestInitSystemSystemdRoNetworkd)
https://gitlab.com/buildroot.org/buildroot/-/jobs/4768561194 (TestInitSystemSystemdRoIfupdownDbusbrokerDbus)
https://gitlab.com/buildroot.org/buildroot/-/jobs/4768561190 (TestInitSystemSystemdRoIfupdownDbusbroker)
https://gitlab.com/buildroot.org/buildroot/-/jobs/4768561189 (TestInitSystemSystemdRoIfupdown)
https://gitlab.com/buildroot.org/buildroot/-/jobs/4768561186 (TestInitSystemSystemdRoFull)

[1] https://github.com/systemd/systemd/releases/tag/v254
[2] https://github.com/systemd/systemd-stable/commit/1cd421106893c5126e33e211cf6634e9167d1762

Cc James Hilliard <[email protected]>
---
 package/systemd/Config.in  | 15 +++++++++++++++
 package/systemd/systemd.mk |  6 ++++++
 2 files changed, 21 insertions(+)
package/systemd/Config.in +15 -0
index bea717a456..174ee77b29 100644
@@ -569,4 +569,19 @@ config BR2_PACKAGE_SYSTEMD_VCONSOLE
 
 	  https://www.freedesktop.org/software/systemd/man/systemd-vconsole-setup.service.html
 
+config BR2_PACKAGE_SYSTEMD_VCONSOLE_KEYMAP
+	bool "enable vconsole w/ keymap support"
+	depends on BR2_PACKAGE_SYSTEMD_VCONSOLE
+	select BR2_PACKAGE_KBD
+	help
+	  systemd-vconsole-setup requires keytable files and keyboard
+	  utilities only if at least one keymap is used by default.
+
+config BR2_PACKAGE_SYSTEMD_VCONSOLE_DEFAULT_KEYMAP
+	string "vconsole default keymap"
+	default "us"
+	depends on BR2_PACKAGE_SYSTEMD_VCONSOLE_KEYMAP
+	help
+	  default keymap used when populating /etc/vconsole.conf.
+
 endif
package/systemd/systemd.mk +6 -0
index 0aa1da3fb8..f6d131c304 100644
@@ -353,6 +353,12 @@ else
 SYSTEMD_CONF_OPTS += -Dvconsole=false
 endif
 
+ifeq ($(BR2_PACKAGE_SYSTEMD_VCONSOLE_KEYMAP),y)
+SYSTEMD_CONF_OPTS += -Ddefault-keymap=$(call qstrip,$(BR2_PACKAGE_SYSTEMD_VCONSOLE_DEFAULT_KEYMAP))
+else
+SYSTEMD_CONF_OPTS += -Ddefault-keymap=""
+endif
+
 ifeq ($(BR2_PACKAGE_SYSTEMD_QUOTACHECK),y)
 SYSTEMD_CONF_OPTS += -Dquotacheck=true
 else
Signature · 6 lines
2.41.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Romain, All,

On 2023-08-02 14:02 +0200, Romain Naour spake thusly:

Quoted 38 lines

systemd v254 provide a new option "default-keymap" to handle vconsole with keymap support [1]. With this change systemd now use the "us" keymap by default and requires keytable files and keyboard utilities from kbd package.

The keymap support can still be disabled using -Ddefault-keymap="" at build time.

Handle the vconsole w/ keymap support and allow to use another keymap than "us" by default.

Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/4768561206 (TestInitSystemSystemdRwNetworkd)
https://gitlab.com/buildroot.org/buildroot/-/jobs/4768561203 (TestInitSystemSystemdRwIfupdownDbusbrokerDbus)
https://gitlab.com/buildroot.org/buildroot/-/jobs/4768561202 (TestInitSystemSystemdRwIfupdownDbusbroker)
https://gitlab.com/buildroot.org/buildroot/-/jobs/4768561201 (TestInitSystemSystemdRwIfupdown)
https://gitlab.com/buildroot.org/buildroot/-/jobs/4768561199 (TestInitSystemSystemdRwFull)
https://gitlab.com/buildroot.org/buildroot/-/jobs/4768561197 (TestInitSystemSystemdRoNetworkd)
https://gitlab.com/buildroot.org/buildroot/-/jobs/4768561194 (TestInitSystemSystemdRoIfupdownDbusbrokerDbus)
https://gitlab.com/buildroot.org/buildroot/-/jobs/4768561190 (TestInitSystemSystemdRoIfupdownDbusbroker)
https://gitlab.com/buildroot.org/buildroot/-/jobs/4768561189 (TestInitSystemSystemdRoIfupdown)
https://gitlab.com/buildroot.org/buildroot/-/jobs/4768561186 (TestInitSystemSystemdRoFull)

[1] https://github.com/systemd/systemd/releases/tag/v254
[2] https://github.com/systemd/systemd-stable/commit/1cd421106893c5126e33e211cf6634e9167d1762

Cc James Hilliard <[email protected]>
---
 package/systemd/Config.in  | 15 +++++++++++++++
 package/systemd/systemd.mk |  6 ++++++
 2 files changed, 21 insertions(+)
package/systemd/Config.in +0 -0
index bea717a456..174ee77b29 100644

package/systemd/Config.in config BR2_PACKAGE_SYSTEMD_VCONSOLE · line 572

Quoted 4 lines
package/systemd/Config.in +1 -0
@@ -569,4 +569,19 @@ config BR2_PACKAGE_SYSTEMD_VCONSOLE
 
 	  https://www.freedesktop.org/software/systemd/man/systemd-vconsole-setup.service.html
 
+config BR2_PACKAGE_SYSTEMD_VCONSOLE_KEYMAP

There's no need for this intermediate option, see below...

Quoted 20 lines
package/systemd/Config.in +14 -0
+	bool "enable vconsole w/ keymap support"
+	depends on BR2_PACKAGE_SYSTEMD_VCONSOLE
+	select BR2_PACKAGE_KBD
+	help
+	  systemd-vconsole-setup requires keytable files and keyboard
+	  utilities only if at least one keymap is used by default.
+
+config BR2_PACKAGE_SYSTEMD_VCONSOLE_DEFAULT_KEYMAP
+	string "vconsole default keymap"
+	default "us"
+	depends on BR2_PACKAGE_SYSTEMD_VCONSOLE_KEYMAP
+	help
+	  default keymap used when populating /etc/vconsole.conf.
+
 endif
package/systemd/systemd.mk +0 -0
index 0aa1da3fb8..f6d131c304 100644

package/systemd/systemd.mk else · line 359

Quoted 7 lines
package/systemd/systemd.mk +4 -0
@@ -353,6 +353,12 @@ else
 SYSTEMD_CONF_OPTS += -Dvconsole=false
 endif
 
+ifeq ($(BR2_PACKAGE_SYSTEMD_VCONSOLE_KEYMAP),y)
+SYSTEMD_CONF_OPTS += -Ddefault-keymap=$(call qstrip,$(BR2_PACKAGE_SYSTEMD_VCONSOLE_DEFAULT_KEYMAP))
+else
+SYSTEMD_CONF_OPTS += -Ddefault-keymap=""

There's nothing that prevents BR2_PACKAGE_SYSTEMD_VCONSOLE_DEFAULT_KEYMAP from being empty, in which case the above sets the option to an empty string, exactly as is done if the boolean is not set.

So the boolean is superfluous, and I dropped it (I moved the select to kbd to the vconsole option instead, with a condition on the keymap not being empty).

This in turns simplifies the condition in the .mk file as well.

Applied to master with the above changes, thanks.

Regards,
Yann E. MORIN.

Quoted 12 lines
package/systemd/systemd.mk +2 -0
+endif
+
 ifeq ($(BR2_PACKAGE_SYSTEMD_QUOTACHECK),y)
 SYSTEMD_CONF_OPTS += -Dquotacheck=true
 else
Signature · 6 lines
2.41.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot