mirror of
https://github.com/openwrt/openwrt.git
synced 2025-02-08 03:50:48 +00:00
x86,armsr: interpolate GRUB_SERIAL into /etc/inittab
Some platforms have their console on other ports than ttyS0, so allow the developer to tailor this on bespoke platform images. Fixes issue #13401. Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
This commit is contained in:
parent
5a64a482a2
commit
b10768476f
8
target/linux/armsr/base-files.mk
Normal file
8
target/linux/armsr/base-files.mk
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
GRUB_SERIAL:=$(call qstrip,$(CONFIG_GRUB_SERIAL))
|
||||||
|
ifeq ($(GRUB_SERIAL),)
|
||||||
|
$(error This platform requires CONFIG_GRUB_SERIAL be set!)
|
||||||
|
endif
|
||||||
|
|
||||||
|
define Package/base-files/install-target
|
||||||
|
$(SED) "s#@GRUB_SERIAL@#$(GRUB_SERIAL)#" $(1)/etc/inittab
|
||||||
|
endef
|
@ -1,7 +1,7 @@
|
|||||||
::sysinit:/etc/init.d/rcS S boot
|
::sysinit:/etc/init.d/rcS S boot
|
||||||
::shutdown:/etc/init.d/rcS K shutdown
|
::shutdown:/etc/init.d/rcS K shutdown
|
||||||
ttyAMA0::askfirst:/usr/libexec/login.sh
|
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
|
tty0::askfirst:/usr/libexec/login.sh
|
||||||
hvc0::askfirst:/usr/libexec/login.sh
|
hvc0::askfirst:/usr/libexec/login.sh
|
||||||
ttymxc0::askfirst:/usr/libexec/login.sh
|
ttymxc0::askfirst:/usr/libexec/login.sh
|
||||||
|
@ -17,14 +17,10 @@ endif
|
|||||||
|
|
||||||
GRUB_SERIAL:=$(call qstrip,$(CONFIG_GRUB_SERIAL))
|
GRUB_SERIAL:=$(call qstrip,$(CONFIG_GRUB_SERIAL))
|
||||||
|
|
||||||
ifneq ($(GRUB_SERIAL),)
|
GRUB_SERIAL_CONFIG := serial --unit=0 --speed=$(CONFIG_GRUB_BAUDRATE) --word=8 --parity=no --stop=1 --rtscts=$(if $(CONFIG_GRUB_FLOWCONTROL),on,off)
|
||||||
GRUB_SERIAL_CONFIG := serial --unit=0 --speed=$(CONFIG_GRUB_BAUDRATE) --word=8 --parity=no --stop=1 --rtscts=$(if $(CONFIG_GRUB_FLOWCONTROL),on,off)
|
GRUB_TERMINALS += serial
|
||||||
GRUB_TERMINALS += serial
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(GRUB_TERMINALS),)
|
GRUB_TERMINAL_CONFIG := terminal_input $(GRUB_TERMINALS); terminal_output $(GRUB_TERMINALS)
|
||||||
GRUB_TERMINAL_CONFIG := terminal_input $(GRUB_TERMINALS); terminal_output $(GRUB_TERMINALS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ROOTPART:=$(call qstrip,$(CONFIG_TARGET_ROOTFS_PARTNAME))
|
ROOTPART:=$(call qstrip,$(CONFIG_TARGET_ROOTFS_PARTNAME))
|
||||||
ROOTPART:=$(if $(ROOTPART),$(ROOTPART),PARTUUID=$(IMG_PART_SIGNATURE)-02)
|
ROOTPART:=$(if $(ROOTPART),$(ROOTPART),PARTUUID=$(IMG_PART_SIGNATURE)-02)
|
||||||
|
8
target/linux/x86/base-files.mk
Normal file
8
target/linux/x86/base-files.mk
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
GRUB_SERIAL:=$(call qstrip,$(CONFIG_GRUB_SERIAL))
|
||||||
|
ifeq ($(GRUB_SERIAL),)
|
||||||
|
$(error This platform requires CONFIG_GRUB_SERIAL be set!)
|
||||||
|
endif
|
||||||
|
|
||||||
|
define Package/base-files/install-target
|
||||||
|
$(SED) "s#@GRUB_SERIAL@#$(GRUB_SERIAL)#" $(1)/etc/inittab
|
||||||
|
endef
|
@ -1,5 +1,5 @@
|
|||||||
::sysinit:/etc/init.d/rcS S boot
|
::sysinit:/etc/init.d/rcS S boot
|
||||||
::shutdown:/etc/init.d/rcS K shutdown
|
::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
|
hvc0::askfirst:/usr/libexec/login.sh
|
||||||
tty1::askfirst:/usr/libexec/login.sh
|
tty1::askfirst:/usr/libexec/login.sh
|
||||||
|
@ -18,15 +18,11 @@ endif
|
|||||||
|
|
||||||
GRUB_SERIAL:=$(call qstrip,$(CONFIG_GRUB_SERIAL))
|
GRUB_SERIAL:=$(call qstrip,$(CONFIG_GRUB_SERIAL))
|
||||||
|
|
||||||
ifneq ($(GRUB_SERIAL),)
|
GRUB_CONSOLE_CMDLINE += console=$(GRUB_SERIAL),$(CONFIG_GRUB_BAUDRATE)n8$(if $(CONFIG_GRUB_FLOWCONTROL),r,)
|
||||||
GRUB_CONSOLE_CMDLINE += console=$(GRUB_SERIAL),$(CONFIG_GRUB_BAUDRATE)n8$(if $(CONFIG_GRUB_FLOWCONTROL),r,)
|
GRUB_SERIAL_CONFIG := serial --unit=0 --speed=$(CONFIG_GRUB_BAUDRATE) --word=8 --parity=no --stop=1 --rtscts=$(if $(CONFIG_GRUB_FLOWCONTROL),on,off)
|
||||||
GRUB_SERIAL_CONFIG := serial --unit=0 --speed=$(CONFIG_GRUB_BAUDRATE) --word=8 --parity=no --stop=1 --rtscts=$(if $(CONFIG_GRUB_FLOWCONTROL),on,off)
|
GRUB_TERMINALS += serial
|
||||||
GRUB_TERMINALS += serial
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(GRUB_TERMINALS),)
|
GRUB_TERMINAL_CONFIG := terminal_input $(GRUB_TERMINALS); terminal_output $(GRUB_TERMINALS)
|
||||||
GRUB_TERMINAL_CONFIG := terminal_input $(GRUB_TERMINALS); terminal_output $(GRUB_TERMINALS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ROOTPART:=$(call qstrip,$(CONFIG_TARGET_ROOTFS_PARTNAME))
|
ROOTPART:=$(call qstrip,$(CONFIG_TARGET_ROOTFS_PARTNAME))
|
||||||
ROOTPART:=$(if $(ROOTPART),$(ROOTPART),PARTUUID=$(IMG_PART_SIGNATURE)-02)
|
ROOTPART:=$(if $(ROOTPART),$(ROOTPART),PARTUUID=$(IMG_PART_SIGNATURE)-02)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user