Skip to content

Commit

Permalink
x86,armsr: interpolate GRUB_SERIAL into /etc/inittab
Browse files Browse the repository at this point in the history
Some platforms have their console on other ports than ttyS0, so
allow the developer to tailor this on bespoke platform images.

Fixes issue openwrt#13401.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
  • Loading branch information
pprindeville committed Sep 14, 2023
1 parent ba6ba5b commit f7602a8
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
10 changes: 10 additions & 0 deletions target/linux/armsr/base-files.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
GRUB_SERIAL:=$(call qstrip,$(CONFIG_GRUB_SERIAL))
ifeq ($(GRUB_SERIAL),)
$(error This platform requires CONFIG_GRUB_SERIAL be set!)
endif

ifneq ($(GRUB_SERIAL),)
define Package/base-files/install-target
$(SED) "s#@GRUB_SERIAL@#$(GRUB_SERIAL)#" $(1)/etc/inittab
endef
endif
2 changes: 1 addition & 1 deletion target/linux/armsr/base-files/etc/inittab
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
ttyAMA0::askfirst:/usr/libexec/login.sh
ttyS0::askfirst:/usr/libexec/login.sh
@GRUB_SERIAL@::askfirst:/usr/libexec/login.sh
tty0::askfirst:/usr/libexec/login.sh
hvc0::askfirst:/usr/libexec/login.sh
ttymxc0::askfirst:/usr/libexec/login.sh
Expand Down
10 changes: 10 additions & 0 deletions target/linux/x86/base-files.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
GRUB_SERIAL:=$(call qstrip,$(CONFIG_GRUB_SERIAL))
ifeq ($(GRUB_SERIAL),)
$(error This platform requires CONFIG_GRUB_SERIAL be set!)
endif

ifneq ($(GRUB_SERIAL),)
define Package/base-files/install-target
$(SED) "s#@GRUB_SERIAL@#$(GRUB_SERIAL)#" $(1)/etc/inittab
endef
endif
2 changes: 1 addition & 1 deletion target/linux/x86/base-files/etc/inittab
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
ttyS0::askfirst:/usr/libexec/login.sh
@GRUB_SERIAL@::askfirst:/usr/libexec/login.sh
hvc0::askfirst:/usr/libexec/login.sh
tty1::askfirst:/usr/libexec/login.sh

0 comments on commit f7602a8

Please sign in to comment.