Skip to content

Commit

Permalink
target: Make TARGET_SERIAL independent of GRUB configuration
Browse files Browse the repository at this point in the history
GRUB_SERIAL is also used for the default serial on the target and not
only in grub. When no grub was build it was not available and the build
fails.

Rename GRUB_SERIAL to TARGET_SERIAL and make it always available on x86
and armsr targets.

Fixes: openwrt#14063
Fixes: b107684 ("x86,armsr: interpolate GRUB_SERIAL into /etc/inittab")
Signed-off-by: Hauke Mehrtens <[email protected]>
  • Loading branch information
hauke committed Nov 29, 2023
1 parent 6c118ef commit 4211eab
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
13 changes: 7 additions & 6 deletions config/Config-images.in
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,6 @@ menu "Target Images"
depends on GRUB_IMAGES || GRUB_EFI_IMAGES
default y

config GRUB_SERIAL
string "Serial port device"
depends on GRUB_IMAGES || GRUB_EFI_IMAGES
default "ttyS0"

config GRUB_BAUDRATE
int "Serial port baud rate"
depends on GRUB_IMAGES || GRUB_EFI_IMAGES
Expand All @@ -231,7 +226,8 @@ menu "Target Images"

config GRUB_FLOWCONTROL
bool "Use RTE/CTS on serial console"
depends on GRUB_SERIAL != ""
depends on GRUB_IMAGES || GRUB_EFI_IMAGES
depends on TARGET_SERIAL != ""

config GRUB_BOOTOPTS
string "Extra kernel boot options"
Expand Down Expand Up @@ -277,6 +273,11 @@ menu "Target Images"
depends on GRUB_IMAGES || GRUB_EFI_IMAGES
select PACKAGE_kmod-e1000

config TARGET_SERIAL
string "Serial port device"
depends on TARGET_x86 || TARGET_armsr
default "ttyS0"

config TARGET_IMAGES_GZIP
bool "GZip images"
depends on TARGET_ROOTFS_EXT4FS || TARGET_x86 || TARGET_armsr || TARGET_malta
Expand Down
4 changes: 2 additions & 2 deletions target/linux/armsr/base-files.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GRUB_SERIAL:=$(call qstrip,$(CONFIG_GRUB_SERIAL))
GRUB_SERIAL:=$(call qstrip,$(CONFIG_TARGET_SERIAL))
ifeq ($(GRUB_SERIAL),)
$(error This platform requires CONFIG_GRUB_SERIAL be set!)
$(error This platform requires CONFIG_TARGET_SERIAL be set!)
endif

define Package/base-files/install-target
Expand Down
2 changes: 1 addition & 1 deletion target/linux/armsr/image/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ifneq ($(CONFIG_GRUB_CONSOLE),)
GRUB_TERMINALS += console
endif

GRUB_SERIAL:=$(call qstrip,$(CONFIG_GRUB_SERIAL))
GRUB_SERIAL:=$(call qstrip,$(CONFIG_TARGET_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_TERMINALS += serial
Expand Down
4 changes: 2 additions & 2 deletions target/linux/x86/base-files.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GRUB_SERIAL:=$(call qstrip,$(CONFIG_GRUB_SERIAL))
GRUB_SERIAL:=$(call qstrip,$(CONFIG_TARGET_SERIAL))
ifeq ($(GRUB_SERIAL),)
$(error This platform requires CONFIG_GRUB_SERIAL be set!)
$(error This platform requires CONFIG_TARGET_SERIAL be set!)
endif

define Package/base-files/install-target
Expand Down
2 changes: 1 addition & 1 deletion target/linux/x86/image/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ifneq ($(CONFIG_GRUB_CONSOLE),)
GRUB_TERMINALS += console
endif

GRUB_SERIAL:=$(call qstrip,$(CONFIG_GRUB_SERIAL))
GRUB_SERIAL:=$(call qstrip,$(CONFIG_TARGET_SERIAL))

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)
Expand Down

0 comments on commit 4211eab

Please sign in to comment.