From 7633ced6fa0c52eaaba1270b3337ec2b1a627f16 2018-11-25 21:24:48 From: Unknown Date: 2018-11-25 21:24:48 Subject: [PATCH] add files for last commit - add udev rules for serial0 and serial1 alias used in many programs and projects as an alias. Helps with rpi3 problem having 2 uart - add kernel printk.conf --- diff --git a/files/etc/99-com.rules b/files/etc/99-com.rules new file mode 100644 index 0000000..fd6621d --- /dev/null +++ b/files/etc/99-com.rules @@ -0,0 +1,33 @@ +SUBSYSTEM=="input", GROUP="input", MODE="0660" +SUBSYSTEM=="i2c-dev", GROUP="i2c", MODE="0660" +SUBSYSTEM=="spidev", GROUP="spi", MODE="0660" +SUBSYSTEM=="bcm2835-gpiomem", GROUP="gpio", MODE="0660" + +SUBSYSTEM=="gpio", GROUP="gpio", MODE="0660" +SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c '\ + chown -R root:gpio /sys/class/gpio && chmod -R 770 /sys/class/gpio;\ + chown -R root:gpio /sys/devices/virtual/gpio && chmod -R 770 /sys/devices/virtual/gpio;\ + chown -R root:gpio /sys$devpath && chmod -R 770 /sys$devpath\ +'" + +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" diff --git a/files/sysctl.d/83-rpi-printk.conf b/files/sysctl.d/83-rpi-printk.conf new file mode 100644 index 0000000..f8948fb --- /dev/null +++ b/files/sysctl.d/83-rpi-printk.conf @@ -0,0 +1 @@ +kernel.printk = 3 4 1 3 \ No newline at end of file