Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] board/raspberrypi: enable hdmi console for systemd
@ 2023-08-12  5:08 Alexey Roslyakov
  2023-08-12 10:47 ` Thomas Petazzoni via buildroot
  2023-09-12  6:05 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Alexey Roslyakov @ 2023-08-12  5:08 UTC (permalink / raw)
  To: buildroot; +Cc: Alexey Roslyakov

Most of the users use HDMI console on RPi and with increasing popularity
of systemd they face a trouble.
systemd doesn't use /etc/inittab, enable getty@tty1.service instead.

Signed-off-by: Alexey Roslyakov <alexey.roslyakov@gmail.com>
---
 board/raspberrypi/post-build.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/board/raspberrypi/post-build.sh b/board/raspberrypi/post-build.sh
index b24256fcea..5da989f37c 100755
--- a/board/raspberrypi/post-build.sh
+++ b/board/raspberrypi/post-build.sh
@@ -8,6 +8,12 @@ if [ -e ${TARGET_DIR}/etc/inittab ]; then
     grep -qE '^tty1::' ${TARGET_DIR}/etc/inittab || \
 	sed -i '/GENERIC_SERIAL/a\
 tty1::respawn:/sbin/getty -L  tty1 0 vt100 # HDMI console' ${TARGET_DIR}/etc/inittab
+else
+	# systemd doesn't use /etc/inittab, enable getty.tty1.service instead
+	if [ -d ${TARGET_DIR}/etc/systemd ]; then
+		mkdir -p "${TARGET_DIR}/etc/systemd/system/getty.target.wants"
+		ln -sf "/lib/systemd/system/getty@.service" "${TARGET_DIR}/etc/systemd/system/getty.target.wants/getty@tty1.service"
+	fi
 fi
 
 # exnsure overlays exists for genimage
-- 
2.41.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH 1/1] board/raspberrypi: enable hdmi console for systemd
  2023-08-12  5:08 [Buildroot] [PATCH 1/1] board/raspberrypi: enable hdmi console for systemd Alexey Roslyakov
@ 2023-08-12 10:47 ` Thomas Petazzoni via buildroot
  2023-09-12  6:05 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-08-12 10:47 UTC (permalink / raw)
  To: Alexey Roslyakov; +Cc: buildroot

Hello Alexey,

On Sat, 12 Aug 2023 13:08:45 +0800
Alexey Roslyakov <alexey.roslyakov@gmail.com> wrote:

> Most of the users use HDMI console on RPi and with increasing popularity
> of systemd they face a trouble.
> systemd doesn't use /etc/inittab, enable getty@tty1.service instead.
> 
> Signed-off-by: Alexey Roslyakov <alexey.roslyakov@gmail.com>
> ---
>  board/raspberrypi/post-build.sh | 6 ++++++
>  1 file changed, 6 insertions(+)

Applied to master, but slightly reworked to avoid the nested if
condition:

 tty1::respawn:/sbin/getty -L  tty1 0 vt100 # HDMI console' ${TARGET_DIR}/etc/inittab
+# systemd doesn't use /etc/inittab, enable getty.tty1.service instead
+elif [ -d ${TARGET_DIR}/etc/systemd ]; then
+    mkdir -p "${TARGET_DIR}/etc/systemd/system/getty.target.wants"
+    ln -sf /lib/systemd/system/getty@.service \
+       "${TARGET_DIR}/etc/systemd/system/getty.target.wants/getty@tty1.service"
 fi

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH 1/1] board/raspberrypi: enable hdmi console for systemd
  2023-08-12  5:08 [Buildroot] [PATCH 1/1] board/raspberrypi: enable hdmi console for systemd Alexey Roslyakov
  2023-08-12 10:47 ` Thomas Petazzoni via buildroot
@ 2023-09-12  6:05 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2023-09-12  6:05 UTC (permalink / raw)
  To: Alexey Roslyakov; +Cc: buildroot

>>>>> "Alexey" == Alexey Roslyakov <alexey.roslyakov@gmail.com> writes:

 > Most of the users use HDMI console on RPi and with increasing popularity
 > of systemd they face a trouble.
 > systemd doesn't use /etc/inittab, enable getty@tty1.service instead.

 > Signed-off-by: Alexey Roslyakov <alexey.roslyakov@gmail.com>

Committed to 2023.02.x and 2023.05.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-09-12  6:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-12  5:08 [Buildroot] [PATCH 1/1] board/raspberrypi: enable hdmi console for systemd Alexey Roslyakov
2023-08-12 10:47 ` Thomas Petazzoni via buildroot
2023-09-12  6:05 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox