Skip to contentSkip to conversation

use single variable to set baud rate

PATCH Superseded Chong Lu 3 participants 6 messages Dec 9, 2014

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Chong Lu

author
#0 lore raw

v2 cover use single variable to set baud rate

Change since V1:
Set default value for SERIAL_CONSOLE.

The following changes since commit b813bdebb36501500e86fea5f7e15b4b15ea0902:

qemu/libc-package: Fix qemu option handling (2014-12-05 18:01:08 +0000)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib chonglu/baudrate
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=chonglu/baudrate

Chong Lu (3):
bitbake.conf: Set default value for SERIAL_CONSOLE syslinux.bbclass: use single variable to set baud rate grub-efi.bbclass: use single variable to set baud rate

 meta/classes/grub-efi.bbclass | 5 +++--
 meta/classes/syslinux.bbclass | 4 ++--
 meta/conf/bitbake.conf        | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH v2 1/3 bitbake.conf: Set default value for SERIAL_CONSOLE

Define a default value for SERIAL_CONSOLE, we can use it if machine doesn't configure.

[YOCTO #6331]

---
 meta/conf/bitbake.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/conf/bitbake.conf +1 -1
index 7902bd7..7a659a7 100644
@@ -739,7 +739,7 @@ COMBINED_FEATURES = "\
     ${@base_both_contain("DISTRO_FEATURES", "MACHINE_FEATURES", "wifi", d)}"
 COMBINED_FEATURES[vardeps] += "DISTRO_FEATURES MACHINE_FEATURES"
 
-SERIAL_CONSOLE ??= ""
+SERIAL_CONSOLE ??= "115200 ttyS0"
 SERIAL_CONSOLES ??= "${@d.getVar('SERIAL_CONSOLE', True).replace(' ', ';')}"
 
 NO_RECOMMENDATIONS ?= ""
Signature · 1 line
1.9.1
author
#4 lore raw

PATCH v2 2/3 syslinux.bbclass: use single variable to set baud rate

In reply to Chong Lu

Use SERIAL_CONSOLE to set baud rate in syslinux.cfg file.

[YOCTO #6331]

---
 meta/classes/syslinux.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/classes/syslinux.bbclass +2 -2
index d6498d9..b5eea07 100644
@@ -27,8 +27,8 @@ SYSLINUXDIR = "/"
 # The kernel has an internal default console, which you can override with
 # a console=...some_tty...
 SYSLINUX_DEFAULT_CONSOLE ?= ""
-SYSLINUX_SERIAL ?= "0 115200"
-SYSLINUX_SERIAL_TTY ?= "console=ttyS0,115200"
+SYSLINUX_SERIAL ?= "${@filter(str.isdigit, d.getVar('SERIAL_CONSOLE', True).split()[1])} ${@d.getVar('SERIAL_CONSOLE', True).split()[0]}"
+SYSLINUX_SERIAL_TTY ?= "console=${@d.getVar('SERIAL_CONSOLE', True).split()[1]},${@d.getVar('SERIAL_CONSOLE', True).split()[0]}"
 ISO_BOOTIMG = "isolinux/isolinux.bin"
 ISO_BOOTCAT = "isolinux/boot.cat"
 MKISOFS_OPTIONS = "-no-emul-boot -boot-load-size 4 -boot-info-table"
Signature · 1 line
1.9.1
author
#5 lore raw

PATCH v2 3/3 grub-efi.bbclass: use single variable to set baud rate

In reply to Chong Lu

Use SERIAL_CONSOLE to set baud rate in grub.cfg file.

[YOCTO #6331]

---
 meta/classes/grub-efi.bbclass | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
meta/classes/grub-efi.bbclass +3 -2
index 47bd35e..37c21f9 100644
@@ -18,11 +18,12 @@
 do_bootimg[depends] += "${MLPREFIX}grub-efi:do_deploy"
 do_bootdirectdisk[depends] += "${MLPREFIX}grub-efi:do_deploy"
 
-GRUB_SERIAL ?= "console=ttyS0,115200"
+GRUB_SERIAL ?= "console=${@d.getVar('SERIAL_CONSOLE', True).split()[1]},${@d.getVar('SERIAL_CONSOLE', True).split()[0]}"
 GRUBCFG = "${S}/grub.cfg"
 GRUB_TIMEOUT ?= "10"
 #FIXME: build this from the machine config
-GRUB_OPTS ?= "serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1"
+GRUB_OPTS ?= "serial --unit=${@filter(str.isdigit, d.getVar('SERIAL_CONSOLE', True).split()[1])} \
+--speed=${@d.getVar('SERIAL_CONSOLE', True).split()[0]} --word=8 --parity=no --stop=1"
 
 EFIDIR = "/EFI/BOOT"
 
Signature · 1 line
1.9.1
#2 lore raw

Re: [PATCH V2 1/3] bitbake.conf: Set default value for SERIAL_CONSOLE

In reply to Chong Lu

meta/conf/bitbake.conf COMBINED_FEATURES = "\ · line 742

Quoted 3 lines · Chong Lu
meta/conf/bitbake.conf +1 -1
-SERIAL_CONSOLE ??= ""
+SERIAL_CONSOLE ??= "115200 ttyS0"

What if a machine doesn't have a serial console? My NUC certainly doesn't have one.

Ross

#3 lore raw

Re: [PATCH V2 1/3] bitbake.conf: Set default value for SERIAL_CONSOLE

In reply to Chong Lu
Quoted 21 lines · Chong Lu

Define a default value for SERIAL_CONSOLE, we can use it if machine doesn't configure.

[YOCTO #6331]

---
meta/conf/bitbake.conf | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
meta/conf/bitbake.conf +0 -0
index 7902bd7..7a659a7 100644
@@ -739,7 +739,7 @@ COMBINED_FEATURES = "\
    ${@base_both_contain("DISTRO_FEATURES", "MACHINE_FEATURES", "wifi", d)}"

COMBINED_FEATURES[vardeps] += "DISTRO_FEATURES MACHINE_FEATURES"

meta/conf/bitbake.conf

Quoted 2 lines
meta/conf/bitbake.conf +1 -1
-SERIAL_CONSOLE ??= ""
+SERIAL_CONSOLE ??= "115200 ttyS0”

I would rather prefer a warning or note.

Quoted 11 lines

SERIAL_CONSOLES ??= "${@d.getVar('SERIAL_CONSOLE', True).replace(' ', ';')}"

NO_RECOMMENDATIONS ?= ""

Signature · 7 lines
1.9.1

-- 
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core