All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-raspberrypi][morty][PATCH 1/3] udev: Create rules file to generate serial0/1
@ 2017-04-18 18:13 Andrei Gherzan
  2017-04-18 18:13 ` [meta-raspberrypi][morty][PATCH 2/3] rpi-base.inc: Recommend udev-rules-rpi Andrei Gherzan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andrei Gherzan @ 2017-04-18 18:13 UTC (permalink / raw)
  To: yocto

Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
---
 recipes-core/udev/udev-rules-rpi.bb           | 12 ++++++++++++
 recipes-core/udev/udev-rules-rpi/99-com.rules | 21 +++++++++++++++++++++
 2 files changed, 33 insertions(+)
 create mode 100644 recipes-core/udev/udev-rules-rpi.bb
 create mode 100644 recipes-core/udev/udev-rules-rpi/99-com.rules

diff --git a/recipes-core/udev/udev-rules-rpi.bb b/recipes-core/udev/udev-rules-rpi.bb
new file mode 100644
index 0000000..20443d3
--- /dev/null
+++ b/recipes-core/udev/udev-rules-rpi.bb
@@ -0,0 +1,12 @@
+DESCRIPTION = "udev rules for Raspberry Pi Boards"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+SRC_URI = " file://99-com.rules"
+
+S = "${WORKDIR}"
+
+do_install () {
+    install -d ${D}${sysconfdir}/udev/rules.d
+    install -m 0644 ${WORKDIR}/99-com.rules ${D}${sysconfdir}/udev/rules.d/
+}
diff --git a/recipes-core/udev/udev-rules-rpi/99-com.rules b/recipes-core/udev/udev-rules-rpi/99-com.rules
new file mode 100644
index 0000000..6bf019b
--- /dev/null
+++ b/recipes-core/udev/udev-rules-rpi/99-com.rules
@@ -0,0 +1,21 @@
+KERNEL=="ttyAMA[01]", PROGRAM="/bin/sh -c '\
+	ALIASES=/proc/device-tree/aliases; \
+	if cmp -s $ALIASES/uart0 $ALIASES/serial0; then \
+		echo 0;\
+	elif cmp -s $ALIASES/uart0 $ALIASES/serial1; then \
+		echo 1; \
+	else \
+		exit 1; \
+	fi\
+'", SYMLINK+="serial%c"
+
+KERNEL=="ttyS0", PROGRAM="/bin/sh -c '\
+	ALIASES=/proc/device-tree/aliases; \
+	if cmp -s $ALIASES/uart1 $ALIASES/serial0; then \
+		echo 0; \
+	elif cmp -s $ALIASES/uart1 $ALIASES/serial1; then \
+		echo 1; \
+	else \
+		exit 1; \
+	fi \
+'", SYMLINK+="serial%c"
-- 
2.12.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [meta-raspberrypi][morty][PATCH 2/3] rpi-base.inc: Recommend udev-rules-rpi
  2017-04-18 18:13 [meta-raspberrypi][morty][PATCH 1/3] udev: Create rules file to generate serial0/1 Andrei Gherzan
@ 2017-04-18 18:13 ` Andrei Gherzan
  2017-04-18 18:13 ` [meta-raspberrypi][morty][PATCH 3/3] raspberrypi*.conf: Be able to overwrite SERIAL_CONSOLE Andrei Gherzan
  2017-04-19 16:52 ` [meta-raspberrypi][morty][PATCH 1/3] udev: Create rules file to generate serial0/1 Andrei Gherzan
  2 siblings, 0 replies; 4+ messages in thread
From: Andrei Gherzan @ 2017-04-18 18:13 UTC (permalink / raw)
  To: yocto

Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
---
 conf/machine/include/rpi-base.inc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/conf/machine/include/rpi-base.inc b/conf/machine/include/rpi-base.inc
index dc98099..50eebb4 100644
--- a/conf/machine/include/rpi-base.inc
+++ b/conf/machine/include/rpi-base.inc
@@ -57,3 +57,6 @@ IMAGE_BOOT_FILES ?= "bcm2835-bootfiles/* ${KERNEL_IMAGETYPE};${SDIMG_KERNELIMAGE
 # The kernel image is installed into the FAT32 boot partition and does not need
 # to also be installed into the rootfs.
 RDEPENDS_kernel-base = ""
+
+# Extra udev rules
+MACHINE_EXTRA_RRECOMMENDS += "udev-rules-rpi"
-- 
2.12.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [meta-raspberrypi][morty][PATCH 3/3] raspberrypi*.conf: Be able to overwrite SERIAL_CONSOLE
  2017-04-18 18:13 [meta-raspberrypi][morty][PATCH 1/3] udev: Create rules file to generate serial0/1 Andrei Gherzan
  2017-04-18 18:13 ` [meta-raspberrypi][morty][PATCH 2/3] rpi-base.inc: Recommend udev-rules-rpi Andrei Gherzan
@ 2017-04-18 18:13 ` Andrei Gherzan
  2017-04-19 16:52 ` [meta-raspberrypi][morty][PATCH 1/3] udev: Create rules file to generate serial0/1 Andrei Gherzan
  2 siblings, 0 replies; 4+ messages in thread
From: Andrei Gherzan @ 2017-04-18 18:13 UTC (permalink / raw)
  To: yocto

Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
---
 conf/machine/raspberrypi.conf       | 2 +-
 conf/machine/raspberrypi0-wifi.conf | 2 +-
 conf/machine/raspberrypi0.conf      | 2 +-
 conf/machine/raspberrypi2.conf      | 2 +-
 conf/machine/raspberrypi3.conf      | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/conf/machine/raspberrypi.conf b/conf/machine/raspberrypi.conf
index ad3b061..ddd3801 100644
--- a/conf/machine/raspberrypi.conf
+++ b/conf/machine/raspberrypi.conf
@@ -7,7 +7,7 @@ DEFAULTTUNE ?= "arm1176jzfshf"
 require conf/machine/include/tune-arm1176jzf-s.inc
 include conf/machine/include/rpi-base.inc
 
-SERIAL_CONSOLE = "115200 ttyAMA0"
+SERIAL_CONSOLE ?= "115200 ttyAMA0"
 
 UBOOT_MACHINE = "rpi_config"
 VC4_CMA_SIZE_raspberrypi ?= "cma-64"
diff --git a/conf/machine/raspberrypi0-wifi.conf b/conf/machine/raspberrypi0-wifi.conf
index 2b7cea4..41be06b 100644
--- a/conf/machine/raspberrypi0-wifi.conf
+++ b/conf/machine/raspberrypi0-wifi.conf
@@ -7,5 +7,5 @@ include conf/machine/raspberrypi.conf
 
 MACHINE_EXTRA_RRECOMMENDS += "linux-firmware-bcm43430"
 
-SERIAL_CONSOLE = "115200 ttyS0"
+SERIAL_CONSOLE ?= "115200 ttyS0"
 VC4_CMA_SIZE ?= "cma-128"
diff --git a/conf/machine/raspberrypi0.conf b/conf/machine/raspberrypi0.conf
index 7c2b811..3bd9e95 100644
--- a/conf/machine/raspberrypi0.conf
+++ b/conf/machine/raspberrypi0.conf
@@ -5,5 +5,5 @@
 MACHINEOVERRIDES = "raspberrypi:${MACHINE}"
 include conf/machine/raspberrypi.conf
 
-SERIAL_CONSOLE = "115200 ttyAMA0"
+SERIAL_CONSOLE ?= "115200 ttyAMA0"
 VC4_CMA_SIZE ?= "cma-128"
diff --git a/conf/machine/raspberrypi2.conf b/conf/machine/raspberrypi2.conf
index 9b4c02a..a17289c 100644
--- a/conf/machine/raspberrypi2.conf
+++ b/conf/machine/raspberrypi2.conf
@@ -7,7 +7,7 @@ DEFAULTTUNE ?= "cortexa7thf-neon-vfpv4"
 require conf/machine/include/tune-cortexa7.inc
 include conf/machine/include/rpi-base.inc
 
-SERIAL_CONSOLE = "115200 ttyAMA0"
+SERIAL_CONSOLE ?= "115200 ttyAMA0"
 
 UBOOT_MACHINE = "rpi_2_config"
 VC4_CMA_SIZE ?= "cma-256"
diff --git a/conf/machine/raspberrypi3.conf b/conf/machine/raspberrypi3.conf
index 1ac5928..b15621d 100644
--- a/conf/machine/raspberrypi3.conf
+++ b/conf/machine/raspberrypi3.conf
@@ -7,5 +7,5 @@ include conf/machine/raspberrypi2.conf
 
 MACHINE_EXTRA_RRECOMMENDS += "linux-firmware-bcm43430"
 
-SERIAL_CONSOLE = "115200 ttyS0"
+SERIAL_CONSOLE ?= "115200 ttyS0"
 VC4_CMA_SIZE ?= "cma-256"
-- 
2.12.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [meta-raspberrypi][morty][PATCH 1/3] udev: Create rules file to generate serial0/1
  2017-04-18 18:13 [meta-raspberrypi][morty][PATCH 1/3] udev: Create rules file to generate serial0/1 Andrei Gherzan
  2017-04-18 18:13 ` [meta-raspberrypi][morty][PATCH 2/3] rpi-base.inc: Recommend udev-rules-rpi Andrei Gherzan
  2017-04-18 18:13 ` [meta-raspberrypi][morty][PATCH 3/3] raspberrypi*.conf: Be able to overwrite SERIAL_CONSOLE Andrei Gherzan
@ 2017-04-19 16:52 ` Andrei Gherzan
  2 siblings, 0 replies; 4+ messages in thread
From: Andrei Gherzan @ 2017-04-19 16:52 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 2076 bytes --]

On Tue, Apr 18, 2017 at 07:13:32PM +0100, Andrei Gherzan wrote:
> Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
> ---
>  recipes-core/udev/udev-rules-rpi.bb           | 12 ++++++++++++
>  recipes-core/udev/udev-rules-rpi/99-com.rules | 21 +++++++++++++++++++++
>  2 files changed, 33 insertions(+)
>  create mode 100644 recipes-core/udev/udev-rules-rpi.bb
>  create mode 100644 recipes-core/udev/udev-rules-rpi/99-com.rules
>
> diff --git a/recipes-core/udev/udev-rules-rpi.bb b/recipes-core/udev/udev-rules-rpi.bb
> new file mode 100644
> index 0000000..20443d3
> --- /dev/null
> +++ b/recipes-core/udev/udev-rules-rpi.bb
> @@ -0,0 +1,12 @@
> +DESCRIPTION = "udev rules for Raspberry Pi Boards"
> +LICENSE = "MIT"
> +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
> +
> +SRC_URI = " file://99-com.rules"
> +
> +S = "${WORKDIR}"
> +
> +do_install () {
> +    install -d ${D}${sysconfdir}/udev/rules.d
> +    install -m 0644 ${WORKDIR}/99-com.rules ${D}${sysconfdir}/udev/rules.d/
> +}
> diff --git a/recipes-core/udev/udev-rules-rpi/99-com.rules b/recipes-core/udev/udev-rules-rpi/99-com.rules
> new file mode 100644
> index 0000000..6bf019b
> --- /dev/null
> +++ b/recipes-core/udev/udev-rules-rpi/99-com.rules
> @@ -0,0 +1,21 @@
> +KERNEL=="ttyAMA[01]", PROGRAM="/bin/sh -c '\
> +	ALIASES=/proc/device-tree/aliases; \
> +	if cmp -s $ALIASES/uart0 $ALIASES/serial0; then \
> +		echo 0;\
> +	elif cmp -s $ALIASES/uart0 $ALIASES/serial1; then \
> +		echo 1; \
> +	else \
> +		exit 1; \
> +	fi\
> +'", SYMLINK+="serial%c"
> +
> +KERNEL=="ttyS0", PROGRAM="/bin/sh -c '\
> +	ALIASES=/proc/device-tree/aliases; \
> +	if cmp -s $ALIASES/uart1 $ALIASES/serial0; then \
> +		echo 0; \
> +	elif cmp -s $ALIASES/uart1 $ALIASES/serial1; then \
> +		echo 1; \
> +	else \
> +		exit 1; \
> +	fi \
> +'", SYMLINK+="serial%c"
> --
> 2.12.2
>

Merged only this patch to morty as the other two need additional work.

--
Andrei Gherzan
gpg: rsa4096/D4D94F67AD0E9640 | t: @agherzan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 849 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-04-19 16:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-18 18:13 [meta-raspberrypi][morty][PATCH 1/3] udev: Create rules file to generate serial0/1 Andrei Gherzan
2017-04-18 18:13 ` [meta-raspberrypi][morty][PATCH 2/3] rpi-base.inc: Recommend udev-rules-rpi Andrei Gherzan
2017-04-18 18:13 ` [meta-raspberrypi][morty][PATCH 3/3] raspberrypi*.conf: Be able to overwrite SERIAL_CONSOLE Andrei Gherzan
2017-04-19 16:52 ` [meta-raspberrypi][morty][PATCH 1/3] udev: Create rules file to generate serial0/1 Andrei Gherzan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.