From d206fc1d11f184dbc78d7891d546443c251e7e68 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Tue, 13 Jan 2015 17:17:49 +0100 Subject: [PATCH] meta-digi-arm: configure the console for ccardimx28js dynamically Revert to the old way of setting the console for ccardimx28js. Configure the console on the generic ttyS0 port name and let the device managers create a symbolic link to the correct device at runtime. Trying to set it statically at compile time lead to some side effects with some packages not being recompiled after a change of the preferred kernel version in the project's local.conf (e.g. udev-extraconf and sysvinit-inittab). Signed-off-by: Javier Viguera --- meta-digi-arm/conf/machine/ccardimx28js.conf | 9 +++++++-- .../recipes-core/udev/udev-extraconf_1.1.bbappend | 12 ++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/meta-digi-arm/conf/machine/ccardimx28js.conf b/meta-digi-arm/conf/machine/ccardimx28js.conf index f1766f202..a12c0b5c3 100644 --- a/meta-digi-arm/conf/machine/ccardimx28js.conf +++ b/meta-digi-arm/conf/machine/ccardimx28js.conf @@ -11,8 +11,13 @@ KERNEL_DEVICETREE = "imx28-${MACHINE}.dtb" # Serial console SERIAL_CONSOLES ?= "115200;${@base_conditional('IS_KERNEL_2X', '1' , 'ttyAM0', 'ttyAMA0', d)}" -# Bluetooth tty -BT_TTY ?= "${@base_conditional('IS_KERNEL_2X', '1' , 'ttySP0', 'ttyAPP0', d)}" +# Use standard serial port name and let device handlers (mdev, udev) +# create a symlink to the correct device. +SERIAL_CONSOLES = "115200;ttyS0" + +# Console and bluetooth tty's +BT_TTY ?= "${@base_conditional('IS_KERNEL_2X', '1' , 'ttySP0', 'ttyAPP0', d)}" +CON_TTY ?= "${@base_conditional('IS_KERNEL_2X', '1' , 'ttyAM0', 'ttyAMA0', d)}" # U-Boot script to be copied to the SD image BOOT_SCRIPTS = "boot-sd.scr:boot.scr" diff --git a/meta-digi-arm/recipes-core/udev/udev-extraconf_1.1.bbappend b/meta-digi-arm/recipes-core/udev/udev-extraconf_1.1.bbappend index 5cd9d5491..ea48cb129 100644 --- a/meta-digi-arm/recipes-core/udev/udev-extraconf_1.1.bbappend +++ b/meta-digi-arm/recipes-core/udev/udev-extraconf_1.1.bbappend @@ -7,6 +7,15 @@ SRC_URI += "file://mount_bootparts.sh" do_install_append() { install -m 0755 ${WORKDIR}/mount_bootparts.sh ${D}${sysconfdir}/udev/scripts/ + # Console tty symlink + if [ -n "${CON_TTY}" ]; then + printf "%s\n%s\n" \ + "# Symlink to the console tty" \ + "KERNEL==\"${CON_TTY}\", MODE=\"0660\", GROUP=\"dialout\", SYMLINK+=\"ttyS0\"" \ + >> ${D}${sysconfdir}/udev/rules.d/localextra.rules + fi + + # Bluetooth tty symlink if [ -n "${BT_TTY}" ]; then printf "%s\n%s\n" \ "# Symlink to the bluetooth tty" \ @@ -15,5 +24,8 @@ do_install_append() { fi } +# CON_TTY and BT_TTY depend on linux version so make it a signature dependence +do_install[vardeps] += "PREFERRED_VERSION_linux-dey" + # BT_TTY is machine specific (defined in machine config file) PACKAGE_ARCH = "${MACHINE_ARCH}"