[Buildroot] [PATCH 1/1] board/raspberrypi/post-build.sh: avoid HDMI login when getty disabled

Thomas Petazzoni thomas.petazzoni at bootlin.com
Sun Oct 27 11:39:02 UTC 2019


Hello Christophe,

On Tue,  1 Oct 2019 14:50:28 +0200
Christophe Blaess <mailist at logilin.fr> wrote:

> -# Add a console on tty1
>  if [ -e ${TARGET_DIR}/etc/inittab ]; then
> -    grep -qE '^tty1::' ${TARGET_DIR}/etc/inittab || \
> -	sed -i '/GENERIC_SERIAL/a\
> +	# Remove tty1 line
> +	sed -i '/^tty1::/d' ${TARGET_DIR}/etc/inittab
> +	# Add a tty1 line if GENERIC_SERIAL is present (and not commented)
> +	sed -i '/^[^#].*GENERIC_SERIAL/a\
>  tty1::respawn:/sbin/getty -L  tty1 0 vt100 # HDMI console' ${TARGET_DIR}/etc/inittab
>  fi

We're fine with the idea, but we would like the implementation to rely
on the BR2 option. So something like this:

# Add a console on tty1
if grep -Eq "^BR2_TARGET_GENERIC_GETTY=y$" ${BR2_CONFIG} && [ -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
fi

Probably the shell syntax is bogus, but you get the point: we want to
rely on BR2_TARGET_GENERIC_GETTY=y to decide whether or not to add a
getty on tty1.

Could you rework your patch in that direction ?

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


More information about the buildroot mailing list