From 848e3797e16f328bf00d855a8ff454bbb2177914 Mon Sep 17 00:00:00 2001 From: Jesse Gilles Date: Tue, 4 Nov 2014 11:51:34 -0600 Subject: initial commit of mLinux layer --- udev-182/cellular_radios.rules | 47 ++++++++++++++ udev-182/init | 138 +++++++++++++++++++++++++++++++++++++++++ udev-182/mtcdt/mtcdt.rules | 12 ++++ udev-extraconf/automount.rules | 24 +++++++ udev-extraconf_1.0.bbappend | 2 + udev_182.bbappend | 11 ++++ 6 files changed, 234 insertions(+) create mode 100644 udev-182/cellular_radios.rules create mode 100644 udev-182/init create mode 100644 udev-182/mtcdt/mtcdt.rules create mode 100644 udev-extraconf/automount.rules create mode 100644 udev-extraconf_1.0.bbappend create mode 100644 udev_182.bbappend diff --git a/udev-182/cellular_radios.rules b/udev-182/cellular_radios.rules new file mode 100644 index 0000000..81271ac --- /dev/null +++ b/udev-182/cellular_radios.rules @@ -0,0 +1,47 @@ +ACTION=="remove", GOTO="mlinux_end" +SUBSYSTEM!="tty", GOTO="mlinux_end" +KERNEL!="ttyUSB[0-9]*|ttyACM[0-9]*", GOTO="mlinux_end" + +SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}" +ENV{ID_IFACE}=="", GOTO="mlinux_end" + +# All modem ports +# H5 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="00", SYMLINK+="modem0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="02", SYMLINK+="modem1" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="04", SYMLINK+="modem2" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="06", SYMLINK+="modem3" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="08", SYMLINK+="modem4" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="0a", SYMLINK+="modem5" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="0c", SYMLINK+="modem6" +# EV3 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="00", SYMLINK+="modem0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="01", SYMLINK+="modem1" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="02", SYMLINK+="modem2" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="03", SYMLINK+="modem3" +# H4 +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="00", SYMLINK+="modem0" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="01", SYMLINK+="modem1" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="02", SYMLINK+="modem2" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="03", SYMLINK+="modem3" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="04", SYMLINK+="modem4" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="05", SYMLINK+="modem5" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="06", SYMLINK+="modem6" +# EV2 +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="0028", SYMLINK+="modem$env{ID_PORT}" + +# AT Command ports +# H5: ttyACM0, ttyACM3 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="06", SYMLINK+="modem_at1" +# EV3: ttyUSB2, ttyUSB3 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="02", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="03", SYMLINK+="modem_at1" +# H4: ttyUSB3, ttyUSB4, ttyUSB5 +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="03", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="04", SYMLINK+="modem_at1" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="05", SYMLINK+="modem_at2" +# EV2: ttyUSB0 +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="0028", ENV{ID_PORT}=="0", SYMLINK+="modem_at0" + +LABEL="mlinux_end" diff --git a/udev-182/init b/udev-182/init new file mode 100644 index 0000000..bd716b0 --- /dev/null +++ b/udev-182/init @@ -0,0 +1,138 @@ +#!/bin/sh + +### BEGIN INIT INFO +# Provides: udev +# Required-Start: mountvirtfs +# Required-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Start udevd, populate /dev and load drivers. +### END INIT INFO + +export TZ=/etc/localtime + +[ -d /sys/class ] || exit 1 +[ -r /proc/mounts ] || exit 1 +[ -x @UDEVD@ ] || exit 1 +[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache +[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf +[ -f /etc/default/rcS ] && . /etc/default/rcS + +readfiles () { + READDATA="" + for filename in $@; do + if [ -r $filename ]; then + while read line; do + READDATA="$READDATA$line" + done < $filename + fi + done +} + +kill_udevd () { + pid=`pidof -x udevd` + [ -n "$pid" ] && kill $pid +} + +case "$1" in + start) + export ACTION=add + # propagate /dev from /sys + echo "Starting udev" + + # Check for requireed devtmpfs before trying to start udev and + # mount a no-existant fs. + if ! grep -q devtmpfs /proc/filesystems + then + echo "Missing devtmpfs, which is required for udev to run"; + echo "Halting..." + halt + fi + # mount the devtmpfs on /dev, if not already done + LANG=C awk '$2 == "/dev" && ($3 == "devtmpfs") { exit 1 }' /proc/mounts && { + mount -n -o mode=0755 -t devtmpfs none "/dev" + } + [ -e /dev/pts ] || mkdir -m 0755 /dev/pts + [ -e /dev/shm ] || mkdir -m 1777 /dev/shm + # the automount rule for udev needs /tmp directory available, as /tmp is a symlink + # to /var/tmp which in turn is a symlink to /var/volatile/tmp, we need to make sure + # /var/volatile/tmp directory to be available. + mkdir -p /var/volatile/tmp + + # Cache handling. + # A list of files which are used as a criteria to judge whether the udev cache could be reused. + CMP_FILE_LIST="/proc/version /proc/cmdline /proc/devices /proc/atags" + if [ "$DEVCACHE" != "" ]; then + if [ -e $DEVCACHE ]; then + readfiles $CMP_FILE_LIST + NEWDATA="$READDATA" + readfiles /etc/udev/cache.data + OLDDATA="$READDATA" + if [ "$OLDDATA" = "$NEWDATA" ]; then + (cd /; tar xf $DEVCACHE > /dev/null 2>&1) + not_first_boot=1 + [ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE" + [ -e /dev/shm/udev.cache ] && rm -f /dev/shm/udev.cache + else + # Output detailed reason why the cached /dev is not used + if [ "$VERBOSE" != "no" ]; then + echo "udev: udev cache not used" + echo "udev: we use $CMP_FILE_LIST as criteria to judge whether the cache /dev could be resued" + echo "udev: olddata: $OLDDATA" + echo "udev: newdata: $NEWDATA" + fi + echo "$NEWDATA" > /dev/shm/udev.cache + fi + else + if [ "$ROOTFS_READ_ONLY" != "yes" ]; then + # If rootfs is not read-only, it's possible that a new udev cache would be generated; + # otherwise, we do not bother to read files. + readfiles $CMP_FILE_LIST + echo "$READDATA" > /dev/shm/udev.cache + fi + fi + fi + + # make_extra_nodes + kill_udevd > "/dev/null" 2>&1 + + # trigger the sorted events + echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug + @UDEVD@ -d + + udevadm control --env=STARTUP=1 + if [ "$not_first_boot" != "" ];then + if [ "$PROBE_PLATFORM_BUS" != "yes" ]; then + PLATFORM_BUS_NOMATCH="--subsystem-nomatch=platform" + else + PLATFORM_BUS_NOMATCH="" + fi + udevadm trigger --action=add --subsystem-nomatch=tty --subsystem-nomatch=mem --subsystem-nomatch=vc --subsystem-nomatch=vtconsole --subsystem-nomatch=misc --subsystem-nomatch=dcon --subsystem-nomatch=pci_bus --subsystem-nomatch=graphics --subsystem-nomatch=backlight --subsystem-nomatch=video4linux $PLATFORM_BUS_NOMATCH + (udevadm settle --timeout=10; udevadm control --env=STARTUP=)& + else + udevadm trigger --action=add + udevadm settle + fi + ;; + stop) + echo "Stopping udevd" + start-stop-daemon --stop --name udevd --quiet + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + status) + pid=`pidof -x udevd` + if [ -n "$pid" ]; then + echo "udevd (pid $pid) is running ..." + else + echo "udevd is stopped" + fi + ;; + *) + echo "Usage: $0 {start|stop|status|restart}" + exit 1 +esac +exit 0 diff --git a/udev-182/mtcdt/mtcdt.rules b/udev-182/mtcdt/mtcdt.rules new file mode 100644 index 0000000..3bdbe5d --- /dev/null +++ b/udev-182/mtcdt/mtcdt.rules @@ -0,0 +1,12 @@ +ACTION=="remove", GOTO="mlinux_end" +SUBSYSTEM!="tty", GOTO="mlinux_end" +KERNEL!="ttyXRUSB[0-9]*", GOTO="mlinux_end" + +SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}" +ENV{ID_IFACE}=="", GOTO="mlinux_end" + +# Accessory Ports +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="00", SYMLINK+="ttyAP1" +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="02", SYMLINK+="ttyAP2" + +LABEL="mlinux_end" diff --git a/udev-extraconf/automount.rules b/udev-extraconf/automount.rules new file mode 100644 index 0000000..b4a8f22 --- /dev/null +++ b/udev-extraconf/automount.rules @@ -0,0 +1,24 @@ +# There are a number of modifiers that are allowed to be used in some +# of the different fields. They provide the following subsitutions: +# +# %n the "kernel number" of the device. +# For example, 'sda3' has a "kernel number" of '3' +# %e the smallest number for that name which does not matches an existing node +# %k the kernel name for the device +# %M the kernel major number for the device +# %m the kernel minor number for the device +# %b the bus id for the device +# %c the string returned by the PROGRAM +# %s{filename} the content of a sysfs attribute +# %% the '%' char itself +# + +SUBSYSTEM!="block", GOTO="automount_end" +# only mount SD cards and mass storage devices +KERNEL!="sd[a-z][0-9]*|mmcblk[0-9]p[0-9]*", GOTO="automount_end" + +# Media automounting +SUBSYSTEM=="block", ACTION=="add" RUN+="/etc/udev/scripts/mount.sh" +SUBSYSTEM=="block", ACTION=="remove" RUN+="/etc/udev/scripts/mount.sh" + +LABEL="automount_end" diff --git a/udev-extraconf_1.0.bbappend b/udev-extraconf_1.0.bbappend new file mode 100644 index 0000000..6d4804d --- /dev/null +++ b/udev-extraconf_1.0.bbappend @@ -0,0 +1,2 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + diff --git a/udev_182.bbappend b/udev_182.bbappend new file mode 100644 index 0000000..60665f9 --- /dev/null +++ b/udev_182.bbappend @@ -0,0 +1,11 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:" + +# add custom rules for persistent modem device names +SRC_URI += " file://cellular_radios.rules \ + file://${MACHINE}.rules \ + " + +do_install_append() { + install -m 644 ${WORKDIR}/cellular_radios.rules ${D}${sysconfdir}/udev/rules.d/ + install -m 644 ${WORKDIR}/${MACHINE}.rules ${D}${sysconfdir}/udev/rules.d/ +} -- cgit v1.2.3 From de94bd3b7d5935ac7d9c54ae3a2fd9b41847fbe7 Mon Sep 17 00:00:00 2001 From: Jeff Hatch Date: Tue, 13 Oct 2015 12:10:47 -0500 Subject: Add LAT1, LEU1, and LVW2 LTE modems rules --- udev-182/cellular_radios.rules | 3 +++ 1 file changed, 3 insertions(+) diff --git a/udev-182/cellular_radios.rules b/udev-182/cellular_radios.rules index 81271ac..a3c06e4 100644 --- a/udev-182/cellular_radios.rules +++ b/udev-182/cellular_radios.rules @@ -43,5 +43,8 @@ ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="04", SYMLINK+ ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="05", SYMLINK+="modem_at2" # EV2: ttyUSB0 ATTRS{idVendor}=="1199", ATTRS{idProduct}=="0028", ENV{ID_PORT}=="0", SYMLINK+="modem_at0" +# LAT1, LEU1, LVW2: port 04 and port 05 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1201", ENV{ID_IFACE}=="04", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1201", ENV{ID_IFACE}=="05", SYMLINK+="modem_at1" LABEL="mlinux_end" -- cgit v1.2.3 From 9a3083f6889fa64358d6055337b618007a771422 Mon Sep 17 00:00:00 2001 From: Jesse Gilles Date: Mon, 26 Oct 2015 16:51:42 -0500 Subject: udev: cellular_radio.rules: add ttyUSBx ports comment for LTE radios --- udev-182/cellular_radios.rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/udev-182/cellular_radios.rules b/udev-182/cellular_radios.rules index a3c06e4..e6953ed 100644 --- a/udev-182/cellular_radios.rules +++ b/udev-182/cellular_radios.rules @@ -43,7 +43,7 @@ ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="04", SYMLINK+ ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="05", SYMLINK+="modem_at2" # EV2: ttyUSB0 ATTRS{idVendor}=="1199", ATTRS{idProduct}=="0028", ENV{ID_PORT}=="0", SYMLINK+="modem_at0" -# LAT1, LEU1, LVW2: port 04 and port 05 +# LAT1, LEU1, LVW2: ttyUSB3, ttyUSB4 (port 04 and port 05) ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1201", ENV{ID_IFACE}=="04", SYMLINK+="modem_at0" ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1201", ENV{ID_IFACE}=="05", SYMLINK+="modem_at1" -- cgit v1.2.3 From 9af4e4d3924e46cfc87fb723120f01b36d5c7e33 Mon Sep 17 00:00:00 2001 From: Jesse Gilles Date: Mon, 2 May 2016 17:02:02 -0500 Subject: udev: disable dev cache, update cellular_radio.rules comments Booting MTCDT with and without DEVCACHE did not seem to make much difference in boot time and disabling the cache eliminates any issues with USB device caching. --- udev-182/cellular_radios.rules | 2 +- udev-182/udev-cache.default | 5 +++++ udev_182.bbappend | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 udev-182/udev-cache.default diff --git a/udev-182/cellular_radios.rules b/udev-182/cellular_radios.rules index e6953ed..28f3131 100644 --- a/udev-182/cellular_radios.rules +++ b/udev-182/cellular_radios.rules @@ -43,7 +43,7 @@ ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="04", SYMLINK+ ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="05", SYMLINK+="modem_at2" # EV2: ttyUSB0 ATTRS{idVendor}=="1199", ATTRS{idProduct}=="0028", ENV{ID_PORT}=="0", SYMLINK+="modem_at0" -# LAT1, LEU1, LVW2: ttyUSB3, ttyUSB4 (port 04 and port 05) +# LAT1, LEU1, LVW2: ttyUSB2, ttyUSB3 (port 04 and port 05) ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1201", ENV{ID_IFACE}=="04", SYMLINK+="modem_at0" ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1201", ENV{ID_IFACE}=="05", SYMLINK+="modem_at1" diff --git a/udev-182/udev-cache.default b/udev-182/udev-cache.default new file mode 100644 index 0000000..b1aa63f --- /dev/null +++ b/udev-182/udev-cache.default @@ -0,0 +1,5 @@ +# Default for /etc/init.d/udev + +# Comment this out to disable device cache +#DEVCACHE="/etc/dev.tar" +PROBE_PLATFORM_BUS="yes" diff --git a/udev_182.bbappend b/udev_182.bbappend index 60665f9..39a5ae1 100644 --- a/udev_182.bbappend +++ b/udev_182.bbappend @@ -1,5 +1,7 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:" +PR .= ".mlinux1" + # add custom rules for persistent modem device names SRC_URI += " file://cellular_radios.rules \ file://${MACHINE}.rules \ -- cgit v1.2.3 From b0a2b3cab2a64c4b55c6ce79f20d972fb06e5178 Mon Sep 17 00:00:00 2001 From: Jeff Hatch Date: Thu, 11 Aug 2016 14:04:48 -0500 Subject: For MTR 3.5 on mLinux, add the udev rules for the G3 and C2 radios so that modem_at0 and modem_at1 get instantiated in /dev --- udev-182/cellular_radios.rules | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/udev-182/cellular_radios.rules b/udev-182/cellular_radios.rules index 28f3131..1231d02 100644 --- a/udev-182/cellular_radios.rules +++ b/udev-182/cellular_radios.rules @@ -46,5 +46,11 @@ ATTRS{idVendor}=="1199", ATTRS{idProduct}=="0028", ENV{ID_PORT}=="0", SYMLINK+=" # LAT1, LEU1, LVW2: ttyUSB2, ttyUSB3 (port 04 and port 05) ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1201", ENV{ID_IFACE}=="04", SYMLINK+="modem_at0" ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1201", ENV{ID_IFACE}=="05", SYMLINK+="modem_at1" +# G3: ttyACM0, ttyACM1 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0022", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0022", ENV{ID_IFACE}=="02", SYMLINK+="modem_at1" +# C2: ttyUSB0, ttyUSB1 (Telit Documentation: Modem Port = USB1, Aux Port = USB0) +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1011", ENV{ID_IFACE}=="01", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1011", ENV{ID_IFACE}=="00", SYMLINK+="modem_at1" LABEL="mlinux_end" -- cgit v1.2.3 From cb6428c2326d857c9dac335dbc2804337949c1e0 Mon Sep 17 00:00:00 2001 From: Mykyta Dorokhin Date: Wed, 31 Aug 2016 12:41:03 +0300 Subject: mtp: Add initial support for the new pico machine type. Build: MACHINE=mtp bitbake mlinux-picocell-image --- udev-182/mtp/mtp.rules | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 udev-182/mtp/mtp.rules diff --git a/udev-182/mtp/mtp.rules b/udev-182/mtp/mtp.rules new file mode 100644 index 0000000..a0dc9fb --- /dev/null +++ b/udev-182/mtp/mtp.rules @@ -0,0 +1,8 @@ +ACTION=="remove", GOTO="mlinux_end" +SUBSYSTEM!="tty", GOTO="mlinux_end" +KERNEL!="ttyXRUSB[0-9]*", GOTO="mlinux_end" + +SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}" +ENV{ID_IFACE}=="", GOTO="mlinux_end" + +LABEL="mlinux_end" -- cgit v1.2.3 From c3737d043fcd62988d2a6d17c6358c7b6c0ef2f3 Mon Sep 17 00:00:00 2001 From: Brandon Bayer Date: Tue, 1 Nov 2016 16:05:17 -0500 Subject: mtcap: rename machine type mtp to mtcap --- udev-182/mtcap/mtcap.rules | 8 ++++++++ udev-182/mtp/mtp.rules | 8 -------- 2 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 udev-182/mtcap/mtcap.rules delete mode 100644 udev-182/mtp/mtp.rules diff --git a/udev-182/mtcap/mtcap.rules b/udev-182/mtcap/mtcap.rules new file mode 100644 index 0000000..a0dc9fb --- /dev/null +++ b/udev-182/mtcap/mtcap.rules @@ -0,0 +1,8 @@ +ACTION=="remove", GOTO="mlinux_end" +SUBSYSTEM!="tty", GOTO="mlinux_end" +KERNEL!="ttyXRUSB[0-9]*", GOTO="mlinux_end" + +SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}" +ENV{ID_IFACE}=="", GOTO="mlinux_end" + +LABEL="mlinux_end" diff --git a/udev-182/mtp/mtp.rules b/udev-182/mtp/mtp.rules deleted file mode 100644 index a0dc9fb..0000000 --- a/udev-182/mtp/mtp.rules +++ /dev/null @@ -1,8 +0,0 @@ -ACTION=="remove", GOTO="mlinux_end" -SUBSYSTEM!="tty", GOTO="mlinux_end" -KERNEL!="ttyXRUSB[0-9]*", GOTO="mlinux_end" - -SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}" -ENV{ID_IFACE}=="", GOTO="mlinux_end" - -LABEL="mlinux_end" -- cgit v1.2.3 From ce5bc509db829370944170ea419b7cc5ccf38bba Mon Sep 17 00:00:00 2001 From: Jeff Hatch Date: Tue, 29 Nov 2016 10:18:46 -0600 Subject: Add udev Ethernet AC card interface naming rules --- udev-182/mtcdt/accessory_ethernet.rules | 21 +++++++++++++++++++++ udev_182.bbappend | 9 ++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 udev-182/mtcdt/accessory_ethernet.rules diff --git a/udev-182/mtcdt/accessory_ethernet.rules b/udev-182/mtcdt/accessory_ethernet.rules new file mode 100644 index 0000000..376486b --- /dev/null +++ b/udev-182/mtcdt/accessory_ethernet.rules @@ -0,0 +1,21 @@ +#To add new rule for new device you have to run (in case if you want to add eth1 interface) +#admin@mtcdt:~# udevadm info --attribute-walk --path=/sys/class/net/eth1 +# looking at device '/devices/ahb.0/700000.ehci/usb1/1-2/1-2.1/1-2.1.1/1-2.1.1:1.0/net/eth1': +# KERNEL=="eth1" +# SUBSYSTEM=="net" +# DRIVER=="" +# ATTR{mtu}=="1500" +# ATTR{type}=="1" +# ........... +# ........... + +# looking at parent device '/devices/ahb.0/700000.ehci/usb1/1-2/1-2.1/1-2.1.1/1-2.1.1:1.0': +# KERNELS=="1-2.1.1:1.0" <------------------- extract this record to add to the rule +# SUBSYSTEMS=="usb" +# DRIVERS=="smsc75xx" +# ATTRS{bInterfaceClass}=="ff" +# ATTRS{bInterfaceSubClass}=="00" +# ........... + +KERNELS=="1-2.1.1:1.0", SUBSYSTEMS=="usb", DRIVERS=="smsc75xx", NAME="eth1" +KERNELS=="1-2.1.2:1.0", SUBSYSTEMS=="usb", DRIVERS=="smsc75xx", NAME="eth2" diff --git a/udev_182.bbappend b/udev_182.bbappend index 39a5ae1..f5548c1 100644 --- a/udev_182.bbappend +++ b/udev_182.bbappend @@ -4,10 +4,17 @@ PR .= ".mlinux1" # add custom rules for persistent modem device names SRC_URI += " file://cellular_radios.rules \ - file://${MACHINE}.rules \ + file://${MACHINE}.rules \ " +SRC_URI_append_mtcdt = " file://accessory_ethernet.rules \ + " + do_install_append() { install -m 644 ${WORKDIR}/cellular_radios.rules ${D}${sysconfdir}/udev/rules.d/ install -m 644 ${WORKDIR}/${MACHINE}.rules ${D}${sysconfdir}/udev/rules.d/ } + +do_install_append_mtcdt() { + install -m 644 ${WORKDIR}/accessory_ethernet.rules ${D}${sysconfdir}/udev/rules.d/ +} -- cgit v1.2.3 From ac6e79e17b0e0ab2f7ad45559241acebe9cd9406 Mon Sep 17 00:00:00 2001 From: John Klug Date: Thu, 1 Dec 2016 09:58:51 -0600 Subject: Spirea incident 2166, ttyAP1 and ttyAP2 missing --- udev-182/mtcdt/mtcdt.rules | 2 ++ 1 file changed, 2 insertions(+) diff --git a/udev-182/mtcdt/mtcdt.rules b/udev-182/mtcdt/mtcdt.rules index 3bdbe5d..5d528e6 100644 --- a/udev-182/mtcdt/mtcdt.rules +++ b/udev-182/mtcdt/mtcdt.rules @@ -7,6 +7,8 @@ ENV{ID_IFACE}=="", GOTO="mlinux_end" # Accessory Ports ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="00", SYMLINK+="ttyAP1" +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="00", SYMLINK+="ttyAP1" ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="02", SYMLINK+="ttyAP2" +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="02", SYMLINK+="ttyAP2" LABEL="mlinux_end" -- cgit v1.2.3 From 2df09b57a83f94ff75cdaabedc2eba140d3b7aae Mon Sep 17 00:00:00 2001 From: Jeff Hatch Date: Thu, 2 Feb 2017 09:44:00 -0600 Subject: Update cellular_radios.rules for udev adding LAT3, LVW3 and LEU3 new modem rules --- udev-182/cellular_radios.rules | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/udev-182/cellular_radios.rules b/udev-182/cellular_radios.rules index 1231d02..810750b 100644 --- a/udev-182/cellular_radios.rules +++ b/udev-182/cellular_radios.rules @@ -14,6 +14,13 @@ ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="06", SYMLINK+ ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="08", SYMLINK+="modem4" ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="0a", SYMLINK+="modem5" ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="0c", SYMLINK+="modem6" +# LAT3, LVW3 and LEU3 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="00", SYMLINK+="modem0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="02", SYMLINK+="modem1" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="04", SYMLINK+="modem2" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="06", SYMLINK+="modem3" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="08", SYMLINK+="modem4" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="0a", SYMLINK+="modem5" # EV3 ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="00", SYMLINK+="modem0" ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="01", SYMLINK+="modem1" @@ -34,6 +41,9 @@ ATTRS{idVendor}=="1199", ATTRS{idProduct}=="0028", SYMLINK+="modem$env{ID_PORT}" # H5: ttyACM0, ttyACM3 ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="06", SYMLINK+="modem_at1" +# LAT3, LVW3 and LEU3 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="06", SYMLINK+="modem_at1" # EV3: ttyUSB2, ttyUSB3 ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="02", SYMLINK+="modem_at0" ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="03", SYMLINK+="modem_at1" -- cgit v1.2.3 From 1a38bee3aa7815653a73313f86d92262f1f4e660 Mon Sep 17 00:00:00 2001 From: John Klug Date: Tue, 18 Apr 2017 17:00:07 -0500 Subject: Att new LJP1 and LNA3 cellular radios. --- udev-182/cellular_radios.rules | 3 +++ 1 file changed, 3 insertions(+) diff --git a/udev-182/cellular_radios.rules b/udev-182/cellular_radios.rules index 810750b..fd36bbd 100644 --- a/udev-182/cellular_radios.rules +++ b/udev-182/cellular_radios.rules @@ -56,6 +56,9 @@ ATTRS{idVendor}=="1199", ATTRS{idProduct}=="0028", ENV{ID_PORT}=="0", SYMLINK+=" # LAT1, LEU1, LVW2: ttyUSB2, ttyUSB3 (port 04 and port 05) ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1201", ENV{ID_IFACE}=="04", SYMLINK+="modem_at0" ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1201", ENV{ID_IFACE}=="05", SYMLINK+="modem_at1" +# LJP1(LE910-JN1), LNA3(LE910-NA1): ttyACM0, ttyACM3 (port 00 and port 03) +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="06", SYMLINK+="modem_at1" # G3: ttyACM0, ttyACM1 ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0022", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0022", ENV{ID_IFACE}=="02", SYMLINK+="modem_at1" -- cgit v1.2.3 From 0bbe1c7d7e37f16227a47e8ed5cf10a5ab71e5b3 Mon Sep 17 00:00:00 2001 From: John Klug Date: Mon, 24 Apr 2017 10:39:03 -0500 Subject: Bump the level to correspond to new udev rules for new cellular radios. --- udev_182.bbappend | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/udev_182.bbappend b/udev_182.bbappend index f5548c1..e793d1d 100644 --- a/udev_182.bbappend +++ b/udev_182.bbappend @@ -1,6 +1,6 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:" -PR .= ".mlinux1" +PR .= ".mlinux2" # add custom rules for persistent modem device names SRC_URI += " file://cellular_radios.rules \ -- cgit v1.2.3 From f6b09007644b03fa5909947a80686b6cfdcb37fb Mon Sep 17 00:00:00 2001 From: Jeff Hatch Date: Mon, 13 Feb 2017 14:34:48 -0600 Subject: Initial commit of Yocto 2.1 changes --- eudev-3.1.5/cellular_radios.rules | 59 ++++++++++++ eudev-3.1.5/init | 138 +++++++++++++++++++++++++++++ eudev-3.1.5/mtcap/mtcap.rules | 8 ++ eudev-3.1.5/mtcdt/accessory_ethernet.rules | 21 +++++ eudev-3.1.5/mtcdt/mtcdt.rules | 14 +++ eudev-3.1.5/udev-cache.default | 5 ++ eudev_3.1.5.bbappend | 20 +++++ udev-182/cellular_radios.rules | 69 --------------- udev-182/init | 138 ----------------------------- udev-182/mtcap/mtcap.rules | 8 -- udev-182/mtcdt/accessory_ethernet.rules | 21 ----- udev-182/mtcdt/mtcdt.rules | 14 --- udev-182/udev-cache.default | 5 -- udev-extraconf_%.bbappend | 2 + udev-extraconf_1.0.bbappend | 2 - udev_182.bbappend | 20 ----- 16 files changed, 267 insertions(+), 277 deletions(-) create mode 100644 eudev-3.1.5/cellular_radios.rules create mode 100644 eudev-3.1.5/init create mode 100644 eudev-3.1.5/mtcap/mtcap.rules create mode 100644 eudev-3.1.5/mtcdt/accessory_ethernet.rules create mode 100644 eudev-3.1.5/mtcdt/mtcdt.rules create mode 100644 eudev-3.1.5/udev-cache.default create mode 100644 eudev_3.1.5.bbappend delete mode 100644 udev-182/cellular_radios.rules delete mode 100644 udev-182/init delete mode 100644 udev-182/mtcap/mtcap.rules delete mode 100644 udev-182/mtcdt/accessory_ethernet.rules delete mode 100644 udev-182/mtcdt/mtcdt.rules delete mode 100644 udev-182/udev-cache.default create mode 100644 udev-extraconf_%.bbappend delete mode 100644 udev-extraconf_1.0.bbappend delete mode 100644 udev_182.bbappend diff --git a/eudev-3.1.5/cellular_radios.rules b/eudev-3.1.5/cellular_radios.rules new file mode 100644 index 0000000..aa05e96 --- /dev/null +++ b/eudev-3.1.5/cellular_radios.rules @@ -0,0 +1,59 @@ +ACTION=="remove", GOTO="mlinux_end" +SUBSYSTEM!="tty", GOTO="mlinux_end" +KERNEL!="ttyUSB[0-9]*|ttyACM[0-9]*", GOTO="mlinux_end" + +SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}" +ENV{ID_IFACE}=="", GOTO="mlinux_end" + +# All modem ports +# H5 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="00", SYMLINK+="modem0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="02", SYMLINK+="modem1" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="04", SYMLINK+="modem2" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="06", SYMLINK+="modem3" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="08", SYMLINK+="modem4" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="0a", SYMLINK+="modem5" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="0c", SYMLINK+="modem6" +# EV3 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="00", SYMLINK+="modem0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="01", SYMLINK+="modem1" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="02", SYMLINK+="modem2" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="03", SYMLINK+="modem3" +# H4 +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="00", SYMLINK+="modem0" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="01", SYMLINK+="modem1" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="02", SYMLINK+="modem2" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="03", SYMLINK+="modem3" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="04", SYMLINK+="modem4" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="05", SYMLINK+="modem5" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="06", SYMLINK+="modem6" +# EV2 +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="0028", SYMLINK+="modem$env{ID_PORT}" + +# AT Command ports +# H5: ttyACM0, ttyACM3 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="06", SYMLINK+="modem_at1" +# EV3: ttyUSB2, ttyUSB3 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="02", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="03", SYMLINK+="modem_at1" +# H4: ttyUSB3, ttyUSB4, ttyUSB5 +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="03", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="04", SYMLINK+="modem_at1" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="05", SYMLINK+="modem_at2" +# EV2: ttyUSB0 +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="0028", ENV{ID_PORT}=="0", SYMLINK+="modem_at0" +# LAT1, LEU1, LVW2: ttyUSB2, ttyUSB3 (port 04 and port 05) +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1201", ENV{ID_IFACE}=="04", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1201", ENV{ID_IFACE}=="05", SYMLINK+="modem_at1" +# LJP1(LE910-JN1), LNA3(LE910-NA1): ttyACM0, ttyACM3 (port 00 and port 03) +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="06", SYMLINK+="modem_at1" +# G3: ttyACM0, ttyACM1 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0022", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0022", ENV{ID_IFACE}=="02", SYMLINK+="modem_at1" +# C2: ttyUSB0, ttyUSB1 (Telit Documentation: Modem Port = USB1, Aux Port = USB0) +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1011", ENV{ID_IFACE}=="01", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1011", ENV{ID_IFACE}=="00", SYMLINK+="modem_at1" + +LABEL="mlinux_end" diff --git a/eudev-3.1.5/init b/eudev-3.1.5/init new file mode 100644 index 0000000..bd716b0 --- /dev/null +++ b/eudev-3.1.5/init @@ -0,0 +1,138 @@ +#!/bin/sh + +### BEGIN INIT INFO +# Provides: udev +# Required-Start: mountvirtfs +# Required-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Start udevd, populate /dev and load drivers. +### END INIT INFO + +export TZ=/etc/localtime + +[ -d /sys/class ] || exit 1 +[ -r /proc/mounts ] || exit 1 +[ -x @UDEVD@ ] || exit 1 +[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache +[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf +[ -f /etc/default/rcS ] && . /etc/default/rcS + +readfiles () { + READDATA="" + for filename in $@; do + if [ -r $filename ]; then + while read line; do + READDATA="$READDATA$line" + done < $filename + fi + done +} + +kill_udevd () { + pid=`pidof -x udevd` + [ -n "$pid" ] && kill $pid +} + +case "$1" in + start) + export ACTION=add + # propagate /dev from /sys + echo "Starting udev" + + # Check for requireed devtmpfs before trying to start udev and + # mount a no-existant fs. + if ! grep -q devtmpfs /proc/filesystems + then + echo "Missing devtmpfs, which is required for udev to run"; + echo "Halting..." + halt + fi + # mount the devtmpfs on /dev, if not already done + LANG=C awk '$2 == "/dev" && ($3 == "devtmpfs") { exit 1 }' /proc/mounts && { + mount -n -o mode=0755 -t devtmpfs none "/dev" + } + [ -e /dev/pts ] || mkdir -m 0755 /dev/pts + [ -e /dev/shm ] || mkdir -m 1777 /dev/shm + # the automount rule for udev needs /tmp directory available, as /tmp is a symlink + # to /var/tmp which in turn is a symlink to /var/volatile/tmp, we need to make sure + # /var/volatile/tmp directory to be available. + mkdir -p /var/volatile/tmp + + # Cache handling. + # A list of files which are used as a criteria to judge whether the udev cache could be reused. + CMP_FILE_LIST="/proc/version /proc/cmdline /proc/devices /proc/atags" + if [ "$DEVCACHE" != "" ]; then + if [ -e $DEVCACHE ]; then + readfiles $CMP_FILE_LIST + NEWDATA="$READDATA" + readfiles /etc/udev/cache.data + OLDDATA="$READDATA" + if [ "$OLDDATA" = "$NEWDATA" ]; then + (cd /; tar xf $DEVCACHE > /dev/null 2>&1) + not_first_boot=1 + [ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE" + [ -e /dev/shm/udev.cache ] && rm -f /dev/shm/udev.cache + else + # Output detailed reason why the cached /dev is not used + if [ "$VERBOSE" != "no" ]; then + echo "udev: udev cache not used" + echo "udev: we use $CMP_FILE_LIST as criteria to judge whether the cache /dev could be resued" + echo "udev: olddata: $OLDDATA" + echo "udev: newdata: $NEWDATA" + fi + echo "$NEWDATA" > /dev/shm/udev.cache + fi + else + if [ "$ROOTFS_READ_ONLY" != "yes" ]; then + # If rootfs is not read-only, it's possible that a new udev cache would be generated; + # otherwise, we do not bother to read files. + readfiles $CMP_FILE_LIST + echo "$READDATA" > /dev/shm/udev.cache + fi + fi + fi + + # make_extra_nodes + kill_udevd > "/dev/null" 2>&1 + + # trigger the sorted events + echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug + @UDEVD@ -d + + udevadm control --env=STARTUP=1 + if [ "$not_first_boot" != "" ];then + if [ "$PROBE_PLATFORM_BUS" != "yes" ]; then + PLATFORM_BUS_NOMATCH="--subsystem-nomatch=platform" + else + PLATFORM_BUS_NOMATCH="" + fi + udevadm trigger --action=add --subsystem-nomatch=tty --subsystem-nomatch=mem --subsystem-nomatch=vc --subsystem-nomatch=vtconsole --subsystem-nomatch=misc --subsystem-nomatch=dcon --subsystem-nomatch=pci_bus --subsystem-nomatch=graphics --subsystem-nomatch=backlight --subsystem-nomatch=video4linux $PLATFORM_BUS_NOMATCH + (udevadm settle --timeout=10; udevadm control --env=STARTUP=)& + else + udevadm trigger --action=add + udevadm settle + fi + ;; + stop) + echo "Stopping udevd" + start-stop-daemon --stop --name udevd --quiet + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + status) + pid=`pidof -x udevd` + if [ -n "$pid" ]; then + echo "udevd (pid $pid) is running ..." + else + echo "udevd is stopped" + fi + ;; + *) + echo "Usage: $0 {start|stop|status|restart}" + exit 1 +esac +exit 0 diff --git a/eudev-3.1.5/mtcap/mtcap.rules b/eudev-3.1.5/mtcap/mtcap.rules new file mode 100644 index 0000000..a0dc9fb --- /dev/null +++ b/eudev-3.1.5/mtcap/mtcap.rules @@ -0,0 +1,8 @@ +ACTION=="remove", GOTO="mlinux_end" +SUBSYSTEM!="tty", GOTO="mlinux_end" +KERNEL!="ttyXRUSB[0-9]*", GOTO="mlinux_end" + +SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}" +ENV{ID_IFACE}=="", GOTO="mlinux_end" + +LABEL="mlinux_end" diff --git a/eudev-3.1.5/mtcdt/accessory_ethernet.rules b/eudev-3.1.5/mtcdt/accessory_ethernet.rules new file mode 100644 index 0000000..376486b --- /dev/null +++ b/eudev-3.1.5/mtcdt/accessory_ethernet.rules @@ -0,0 +1,21 @@ +#To add new rule for new device you have to run (in case if you want to add eth1 interface) +#admin@mtcdt:~# udevadm info --attribute-walk --path=/sys/class/net/eth1 +# looking at device '/devices/ahb.0/700000.ehci/usb1/1-2/1-2.1/1-2.1.1/1-2.1.1:1.0/net/eth1': +# KERNEL=="eth1" +# SUBSYSTEM=="net" +# DRIVER=="" +# ATTR{mtu}=="1500" +# ATTR{type}=="1" +# ........... +# ........... + +# looking at parent device '/devices/ahb.0/700000.ehci/usb1/1-2/1-2.1/1-2.1.1/1-2.1.1:1.0': +# KERNELS=="1-2.1.1:1.0" <------------------- extract this record to add to the rule +# SUBSYSTEMS=="usb" +# DRIVERS=="smsc75xx" +# ATTRS{bInterfaceClass}=="ff" +# ATTRS{bInterfaceSubClass}=="00" +# ........... + +KERNELS=="1-2.1.1:1.0", SUBSYSTEMS=="usb", DRIVERS=="smsc75xx", NAME="eth1" +KERNELS=="1-2.1.2:1.0", SUBSYSTEMS=="usb", DRIVERS=="smsc75xx", NAME="eth2" diff --git a/eudev-3.1.5/mtcdt/mtcdt.rules b/eudev-3.1.5/mtcdt/mtcdt.rules new file mode 100644 index 0000000..5d528e6 --- /dev/null +++ b/eudev-3.1.5/mtcdt/mtcdt.rules @@ -0,0 +1,14 @@ +ACTION=="remove", GOTO="mlinux_end" +SUBSYSTEM!="tty", GOTO="mlinux_end" +KERNEL!="ttyXRUSB[0-9]*", GOTO="mlinux_end" + +SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}" +ENV{ID_IFACE}=="", GOTO="mlinux_end" + +# Accessory Ports +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="00", SYMLINK+="ttyAP1" +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="00", SYMLINK+="ttyAP1" +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="02", SYMLINK+="ttyAP2" +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="02", SYMLINK+="ttyAP2" + +LABEL="mlinux_end" diff --git a/eudev-3.1.5/udev-cache.default b/eudev-3.1.5/udev-cache.default new file mode 100644 index 0000000..b1aa63f --- /dev/null +++ b/eudev-3.1.5/udev-cache.default @@ -0,0 +1,5 @@ +# Default for /etc/init.d/udev + +# Comment this out to disable device cache +#DEVCACHE="/etc/dev.tar" +PROBE_PLATFORM_BUS="yes" diff --git a/eudev_3.1.5.bbappend b/eudev_3.1.5.bbappend new file mode 100644 index 0000000..e793d1d --- /dev/null +++ b/eudev_3.1.5.bbappend @@ -0,0 +1,20 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:" + +PR .= ".mlinux2" + +# add custom rules for persistent modem device names +SRC_URI += " file://cellular_radios.rules \ + file://${MACHINE}.rules \ + " + +SRC_URI_append_mtcdt = " file://accessory_ethernet.rules \ + " + +do_install_append() { + install -m 644 ${WORKDIR}/cellular_radios.rules ${D}${sysconfdir}/udev/rules.d/ + install -m 644 ${WORKDIR}/${MACHINE}.rules ${D}${sysconfdir}/udev/rules.d/ +} + +do_install_append_mtcdt() { + install -m 644 ${WORKDIR}/accessory_ethernet.rules ${D}${sysconfdir}/udev/rules.d/ +} diff --git a/udev-182/cellular_radios.rules b/udev-182/cellular_radios.rules deleted file mode 100644 index fd36bbd..0000000 --- a/udev-182/cellular_radios.rules +++ /dev/null @@ -1,69 +0,0 @@ -ACTION=="remove", GOTO="mlinux_end" -SUBSYSTEM!="tty", GOTO="mlinux_end" -KERNEL!="ttyUSB[0-9]*|ttyACM[0-9]*", GOTO="mlinux_end" - -SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}" -ENV{ID_IFACE}=="", GOTO="mlinux_end" - -# All modem ports -# H5 -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="00", SYMLINK+="modem0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="02", SYMLINK+="modem1" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="04", SYMLINK+="modem2" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="06", SYMLINK+="modem3" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="08", SYMLINK+="modem4" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="0a", SYMLINK+="modem5" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="0c", SYMLINK+="modem6" -# LAT3, LVW3 and LEU3 -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="00", SYMLINK+="modem0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="02", SYMLINK+="modem1" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="04", SYMLINK+="modem2" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="06", SYMLINK+="modem3" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="08", SYMLINK+="modem4" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="0a", SYMLINK+="modem5" -# EV3 -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="00", SYMLINK+="modem0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="01", SYMLINK+="modem1" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="02", SYMLINK+="modem2" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="03", SYMLINK+="modem3" -# H4 -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="00", SYMLINK+="modem0" -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="01", SYMLINK+="modem1" -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="02", SYMLINK+="modem2" -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="03", SYMLINK+="modem3" -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="04", SYMLINK+="modem4" -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="05", SYMLINK+="modem5" -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="06", SYMLINK+="modem6" -# EV2 -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="0028", SYMLINK+="modem$env{ID_PORT}" - -# AT Command ports -# H5: ttyACM0, ttyACM3 -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="06", SYMLINK+="modem_at1" -# LAT3, LVW3 and LEU3 -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="06", SYMLINK+="modem_at1" -# EV3: ttyUSB2, ttyUSB3 -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="02", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="03", SYMLINK+="modem_at1" -# H4: ttyUSB3, ttyUSB4, ttyUSB5 -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="03", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="04", SYMLINK+="modem_at1" -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="05", SYMLINK+="modem_at2" -# EV2: ttyUSB0 -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="0028", ENV{ID_PORT}=="0", SYMLINK+="modem_at0" -# LAT1, LEU1, LVW2: ttyUSB2, ttyUSB3 (port 04 and port 05) -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1201", ENV{ID_IFACE}=="04", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1201", ENV{ID_IFACE}=="05", SYMLINK+="modem_at1" -# LJP1(LE910-JN1), LNA3(LE910-NA1): ttyACM0, ttyACM3 (port 00 and port 03) -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="06", SYMLINK+="modem_at1" -# G3: ttyACM0, ttyACM1 -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0022", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0022", ENV{ID_IFACE}=="02", SYMLINK+="modem_at1" -# C2: ttyUSB0, ttyUSB1 (Telit Documentation: Modem Port = USB1, Aux Port = USB0) -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1011", ENV{ID_IFACE}=="01", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1011", ENV{ID_IFACE}=="00", SYMLINK+="modem_at1" - -LABEL="mlinux_end" diff --git a/udev-182/init b/udev-182/init deleted file mode 100644 index bd716b0..0000000 --- a/udev-182/init +++ /dev/null @@ -1,138 +0,0 @@ -#!/bin/sh - -### BEGIN INIT INFO -# Provides: udev -# Required-Start: mountvirtfs -# Required-Stop: -# Default-Start: S -# Default-Stop: -# Short-Description: Start udevd, populate /dev and load drivers. -### END INIT INFO - -export TZ=/etc/localtime - -[ -d /sys/class ] || exit 1 -[ -r /proc/mounts ] || exit 1 -[ -x @UDEVD@ ] || exit 1 -[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache -[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf -[ -f /etc/default/rcS ] && . /etc/default/rcS - -readfiles () { - READDATA="" - for filename in $@; do - if [ -r $filename ]; then - while read line; do - READDATA="$READDATA$line" - done < $filename - fi - done -} - -kill_udevd () { - pid=`pidof -x udevd` - [ -n "$pid" ] && kill $pid -} - -case "$1" in - start) - export ACTION=add - # propagate /dev from /sys - echo "Starting udev" - - # Check for requireed devtmpfs before trying to start udev and - # mount a no-existant fs. - if ! grep -q devtmpfs /proc/filesystems - then - echo "Missing devtmpfs, which is required for udev to run"; - echo "Halting..." - halt - fi - # mount the devtmpfs on /dev, if not already done - LANG=C awk '$2 == "/dev" && ($3 == "devtmpfs") { exit 1 }' /proc/mounts && { - mount -n -o mode=0755 -t devtmpfs none "/dev" - } - [ -e /dev/pts ] || mkdir -m 0755 /dev/pts - [ -e /dev/shm ] || mkdir -m 1777 /dev/shm - # the automount rule for udev needs /tmp directory available, as /tmp is a symlink - # to /var/tmp which in turn is a symlink to /var/volatile/tmp, we need to make sure - # /var/volatile/tmp directory to be available. - mkdir -p /var/volatile/tmp - - # Cache handling. - # A list of files which are used as a criteria to judge whether the udev cache could be reused. - CMP_FILE_LIST="/proc/version /proc/cmdline /proc/devices /proc/atags" - if [ "$DEVCACHE" != "" ]; then - if [ -e $DEVCACHE ]; then - readfiles $CMP_FILE_LIST - NEWDATA="$READDATA" - readfiles /etc/udev/cache.data - OLDDATA="$READDATA" - if [ "$OLDDATA" = "$NEWDATA" ]; then - (cd /; tar xf $DEVCACHE > /dev/null 2>&1) - not_first_boot=1 - [ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE" - [ -e /dev/shm/udev.cache ] && rm -f /dev/shm/udev.cache - else - # Output detailed reason why the cached /dev is not used - if [ "$VERBOSE" != "no" ]; then - echo "udev: udev cache not used" - echo "udev: we use $CMP_FILE_LIST as criteria to judge whether the cache /dev could be resued" - echo "udev: olddata: $OLDDATA" - echo "udev: newdata: $NEWDATA" - fi - echo "$NEWDATA" > /dev/shm/udev.cache - fi - else - if [ "$ROOTFS_READ_ONLY" != "yes" ]; then - # If rootfs is not read-only, it's possible that a new udev cache would be generated; - # otherwise, we do not bother to read files. - readfiles $CMP_FILE_LIST - echo "$READDATA" > /dev/shm/udev.cache - fi - fi - fi - - # make_extra_nodes - kill_udevd > "/dev/null" 2>&1 - - # trigger the sorted events - echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug - @UDEVD@ -d - - udevadm control --env=STARTUP=1 - if [ "$not_first_boot" != "" ];then - if [ "$PROBE_PLATFORM_BUS" != "yes" ]; then - PLATFORM_BUS_NOMATCH="--subsystem-nomatch=platform" - else - PLATFORM_BUS_NOMATCH="" - fi - udevadm trigger --action=add --subsystem-nomatch=tty --subsystem-nomatch=mem --subsystem-nomatch=vc --subsystem-nomatch=vtconsole --subsystem-nomatch=misc --subsystem-nomatch=dcon --subsystem-nomatch=pci_bus --subsystem-nomatch=graphics --subsystem-nomatch=backlight --subsystem-nomatch=video4linux $PLATFORM_BUS_NOMATCH - (udevadm settle --timeout=10; udevadm control --env=STARTUP=)& - else - udevadm trigger --action=add - udevadm settle - fi - ;; - stop) - echo "Stopping udevd" - start-stop-daemon --stop --name udevd --quiet - ;; - restart) - $0 stop - sleep 1 - $0 start - ;; - status) - pid=`pidof -x udevd` - if [ -n "$pid" ]; then - echo "udevd (pid $pid) is running ..." - else - echo "udevd is stopped" - fi - ;; - *) - echo "Usage: $0 {start|stop|status|restart}" - exit 1 -esac -exit 0 diff --git a/udev-182/mtcap/mtcap.rules b/udev-182/mtcap/mtcap.rules deleted file mode 100644 index a0dc9fb..0000000 --- a/udev-182/mtcap/mtcap.rules +++ /dev/null @@ -1,8 +0,0 @@ -ACTION=="remove", GOTO="mlinux_end" -SUBSYSTEM!="tty", GOTO="mlinux_end" -KERNEL!="ttyXRUSB[0-9]*", GOTO="mlinux_end" - -SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}" -ENV{ID_IFACE}=="", GOTO="mlinux_end" - -LABEL="mlinux_end" diff --git a/udev-182/mtcdt/accessory_ethernet.rules b/udev-182/mtcdt/accessory_ethernet.rules deleted file mode 100644 index 376486b..0000000 --- a/udev-182/mtcdt/accessory_ethernet.rules +++ /dev/null @@ -1,21 +0,0 @@ -#To add new rule for new device you have to run (in case if you want to add eth1 interface) -#admin@mtcdt:~# udevadm info --attribute-walk --path=/sys/class/net/eth1 -# looking at device '/devices/ahb.0/700000.ehci/usb1/1-2/1-2.1/1-2.1.1/1-2.1.1:1.0/net/eth1': -# KERNEL=="eth1" -# SUBSYSTEM=="net" -# DRIVER=="" -# ATTR{mtu}=="1500" -# ATTR{type}=="1" -# ........... -# ........... - -# looking at parent device '/devices/ahb.0/700000.ehci/usb1/1-2/1-2.1/1-2.1.1/1-2.1.1:1.0': -# KERNELS=="1-2.1.1:1.0" <------------------- extract this record to add to the rule -# SUBSYSTEMS=="usb" -# DRIVERS=="smsc75xx" -# ATTRS{bInterfaceClass}=="ff" -# ATTRS{bInterfaceSubClass}=="00" -# ........... - -KERNELS=="1-2.1.1:1.0", SUBSYSTEMS=="usb", DRIVERS=="smsc75xx", NAME="eth1" -KERNELS=="1-2.1.2:1.0", SUBSYSTEMS=="usb", DRIVERS=="smsc75xx", NAME="eth2" diff --git a/udev-182/mtcdt/mtcdt.rules b/udev-182/mtcdt/mtcdt.rules deleted file mode 100644 index 5d528e6..0000000 --- a/udev-182/mtcdt/mtcdt.rules +++ /dev/null @@ -1,14 +0,0 @@ -ACTION=="remove", GOTO="mlinux_end" -SUBSYSTEM!="tty", GOTO="mlinux_end" -KERNEL!="ttyXRUSB[0-9]*", GOTO="mlinux_end" - -SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}" -ENV{ID_IFACE}=="", GOTO="mlinux_end" - -# Accessory Ports -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="00", SYMLINK+="ttyAP1" -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="00", SYMLINK+="ttyAP1" -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="02", SYMLINK+="ttyAP2" -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="02", SYMLINK+="ttyAP2" - -LABEL="mlinux_end" diff --git a/udev-182/udev-cache.default b/udev-182/udev-cache.default deleted file mode 100644 index b1aa63f..0000000 --- a/udev-182/udev-cache.default +++ /dev/null @@ -1,5 +0,0 @@ -# Default for /etc/init.d/udev - -# Comment this out to disable device cache -#DEVCACHE="/etc/dev.tar" -PROBE_PLATFORM_BUS="yes" diff --git a/udev-extraconf_%.bbappend b/udev-extraconf_%.bbappend new file mode 100644 index 0000000..6d4804d --- /dev/null +++ b/udev-extraconf_%.bbappend @@ -0,0 +1,2 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + diff --git a/udev-extraconf_1.0.bbappend b/udev-extraconf_1.0.bbappend deleted file mode 100644 index 6d4804d..0000000 --- a/udev-extraconf_1.0.bbappend +++ /dev/null @@ -1,2 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" - diff --git a/udev_182.bbappend b/udev_182.bbappend deleted file mode 100644 index e793d1d..0000000 --- a/udev_182.bbappend +++ /dev/null @@ -1,20 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:" - -PR .= ".mlinux2" - -# add custom rules for persistent modem device names -SRC_URI += " file://cellular_radios.rules \ - file://${MACHINE}.rules \ - " - -SRC_URI_append_mtcdt = " file://accessory_ethernet.rules \ - " - -do_install_append() { - install -m 644 ${WORKDIR}/cellular_radios.rules ${D}${sysconfdir}/udev/rules.d/ - install -m 644 ${WORKDIR}/${MACHINE}.rules ${D}${sysconfdir}/udev/rules.d/ -} - -do_install_append_mtcdt() { - install -m 644 ${WORKDIR}/accessory_ethernet.rules ${D}${sysconfdir}/udev/rules.d/ -} -- cgit v1.2.3 From b2180badaecd46d2d18e22fdb01ee9facb5c74fb Mon Sep 17 00:00:00 2001 From: John Klug Date: Tue, 25 Apr 2017 13:32:53 -0500 Subject: Make eudev bbappend allow new levels of uedev --- eudev-3.1.5/cellular_radios.rules | 59 ------------ eudev-3.1.5/init | 138 ----------------------------- eudev-3.1.5/mtcap/mtcap.rules | 8 -- eudev-3.1.5/mtcdt/accessory_ethernet.rules | 21 ----- eudev-3.1.5/mtcdt/mtcdt.rules | 14 --- eudev-3.1.5/udev-cache.default | 5 -- eudev/cellular_radios.rules | 59 ++++++++++++ eudev/init | 138 +++++++++++++++++++++++++++++ eudev/mtcap/mtcap.rules | 8 ++ eudev/mtcdt/accessory_ethernet.rules | 21 +++++ eudev/mtcdt/mtcdt.rules | 14 +++ eudev/udev-cache.default | 5 ++ eudev_%.bbappend | 21 +++++ eudev_3.1.5.bbappend | 20 ----- 14 files changed, 266 insertions(+), 265 deletions(-) delete mode 100644 eudev-3.1.5/cellular_radios.rules delete mode 100644 eudev-3.1.5/init delete mode 100644 eudev-3.1.5/mtcap/mtcap.rules delete mode 100644 eudev-3.1.5/mtcdt/accessory_ethernet.rules delete mode 100644 eudev-3.1.5/mtcdt/mtcdt.rules delete mode 100644 eudev-3.1.5/udev-cache.default create mode 100644 eudev/cellular_radios.rules create mode 100644 eudev/init create mode 100644 eudev/mtcap/mtcap.rules create mode 100644 eudev/mtcdt/accessory_ethernet.rules create mode 100644 eudev/mtcdt/mtcdt.rules create mode 100644 eudev/udev-cache.default create mode 100644 eudev_%.bbappend delete mode 100644 eudev_3.1.5.bbappend diff --git a/eudev-3.1.5/cellular_radios.rules b/eudev-3.1.5/cellular_radios.rules deleted file mode 100644 index aa05e96..0000000 --- a/eudev-3.1.5/cellular_radios.rules +++ /dev/null @@ -1,59 +0,0 @@ -ACTION=="remove", GOTO="mlinux_end" -SUBSYSTEM!="tty", GOTO="mlinux_end" -KERNEL!="ttyUSB[0-9]*|ttyACM[0-9]*", GOTO="mlinux_end" - -SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}" -ENV{ID_IFACE}=="", GOTO="mlinux_end" - -# All modem ports -# H5 -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="00", SYMLINK+="modem0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="02", SYMLINK+="modem1" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="04", SYMLINK+="modem2" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="06", SYMLINK+="modem3" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="08", SYMLINK+="modem4" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="0a", SYMLINK+="modem5" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="0c", SYMLINK+="modem6" -# EV3 -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="00", SYMLINK+="modem0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="01", SYMLINK+="modem1" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="02", SYMLINK+="modem2" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="03", SYMLINK+="modem3" -# H4 -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="00", SYMLINK+="modem0" -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="01", SYMLINK+="modem1" -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="02", SYMLINK+="modem2" -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="03", SYMLINK+="modem3" -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="04", SYMLINK+="modem4" -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="05", SYMLINK+="modem5" -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="06", SYMLINK+="modem6" -# EV2 -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="0028", SYMLINK+="modem$env{ID_PORT}" - -# AT Command ports -# H5: ttyACM0, ttyACM3 -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="06", SYMLINK+="modem_at1" -# EV3: ttyUSB2, ttyUSB3 -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="02", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="03", SYMLINK+="modem_at1" -# H4: ttyUSB3, ttyUSB4, ttyUSB5 -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="03", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="04", SYMLINK+="modem_at1" -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="05", SYMLINK+="modem_at2" -# EV2: ttyUSB0 -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="0028", ENV{ID_PORT}=="0", SYMLINK+="modem_at0" -# LAT1, LEU1, LVW2: ttyUSB2, ttyUSB3 (port 04 and port 05) -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1201", ENV{ID_IFACE}=="04", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1201", ENV{ID_IFACE}=="05", SYMLINK+="modem_at1" -# LJP1(LE910-JN1), LNA3(LE910-NA1): ttyACM0, ttyACM3 (port 00 and port 03) -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="06", SYMLINK+="modem_at1" -# G3: ttyACM0, ttyACM1 -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0022", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0022", ENV{ID_IFACE}=="02", SYMLINK+="modem_at1" -# C2: ttyUSB0, ttyUSB1 (Telit Documentation: Modem Port = USB1, Aux Port = USB0) -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1011", ENV{ID_IFACE}=="01", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1011", ENV{ID_IFACE}=="00", SYMLINK+="modem_at1" - -LABEL="mlinux_end" diff --git a/eudev-3.1.5/init b/eudev-3.1.5/init deleted file mode 100644 index bd716b0..0000000 --- a/eudev-3.1.5/init +++ /dev/null @@ -1,138 +0,0 @@ -#!/bin/sh - -### BEGIN INIT INFO -# Provides: udev -# Required-Start: mountvirtfs -# Required-Stop: -# Default-Start: S -# Default-Stop: -# Short-Description: Start udevd, populate /dev and load drivers. -### END INIT INFO - -export TZ=/etc/localtime - -[ -d /sys/class ] || exit 1 -[ -r /proc/mounts ] || exit 1 -[ -x @UDEVD@ ] || exit 1 -[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache -[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf -[ -f /etc/default/rcS ] && . /etc/default/rcS - -readfiles () { - READDATA="" - for filename in $@; do - if [ -r $filename ]; then - while read line; do - READDATA="$READDATA$line" - done < $filename - fi - done -} - -kill_udevd () { - pid=`pidof -x udevd` - [ -n "$pid" ] && kill $pid -} - -case "$1" in - start) - export ACTION=add - # propagate /dev from /sys - echo "Starting udev" - - # Check for requireed devtmpfs before trying to start udev and - # mount a no-existant fs. - if ! grep -q devtmpfs /proc/filesystems - then - echo "Missing devtmpfs, which is required for udev to run"; - echo "Halting..." - halt - fi - # mount the devtmpfs on /dev, if not already done - LANG=C awk '$2 == "/dev" && ($3 == "devtmpfs") { exit 1 }' /proc/mounts && { - mount -n -o mode=0755 -t devtmpfs none "/dev" - } - [ -e /dev/pts ] || mkdir -m 0755 /dev/pts - [ -e /dev/shm ] || mkdir -m 1777 /dev/shm - # the automount rule for udev needs /tmp directory available, as /tmp is a symlink - # to /var/tmp which in turn is a symlink to /var/volatile/tmp, we need to make sure - # /var/volatile/tmp directory to be available. - mkdir -p /var/volatile/tmp - - # Cache handling. - # A list of files which are used as a criteria to judge whether the udev cache could be reused. - CMP_FILE_LIST="/proc/version /proc/cmdline /proc/devices /proc/atags" - if [ "$DEVCACHE" != "" ]; then - if [ -e $DEVCACHE ]; then - readfiles $CMP_FILE_LIST - NEWDATA="$READDATA" - readfiles /etc/udev/cache.data - OLDDATA="$READDATA" - if [ "$OLDDATA" = "$NEWDATA" ]; then - (cd /; tar xf $DEVCACHE > /dev/null 2>&1) - not_first_boot=1 - [ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE" - [ -e /dev/shm/udev.cache ] && rm -f /dev/shm/udev.cache - else - # Output detailed reason why the cached /dev is not used - if [ "$VERBOSE" != "no" ]; then - echo "udev: udev cache not used" - echo "udev: we use $CMP_FILE_LIST as criteria to judge whether the cache /dev could be resued" - echo "udev: olddata: $OLDDATA" - echo "udev: newdata: $NEWDATA" - fi - echo "$NEWDATA" > /dev/shm/udev.cache - fi - else - if [ "$ROOTFS_READ_ONLY" != "yes" ]; then - # If rootfs is not read-only, it's possible that a new udev cache would be generated; - # otherwise, we do not bother to read files. - readfiles $CMP_FILE_LIST - echo "$READDATA" > /dev/shm/udev.cache - fi - fi - fi - - # make_extra_nodes - kill_udevd > "/dev/null" 2>&1 - - # trigger the sorted events - echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug - @UDEVD@ -d - - udevadm control --env=STARTUP=1 - if [ "$not_first_boot" != "" ];then - if [ "$PROBE_PLATFORM_BUS" != "yes" ]; then - PLATFORM_BUS_NOMATCH="--subsystem-nomatch=platform" - else - PLATFORM_BUS_NOMATCH="" - fi - udevadm trigger --action=add --subsystem-nomatch=tty --subsystem-nomatch=mem --subsystem-nomatch=vc --subsystem-nomatch=vtconsole --subsystem-nomatch=misc --subsystem-nomatch=dcon --subsystem-nomatch=pci_bus --subsystem-nomatch=graphics --subsystem-nomatch=backlight --subsystem-nomatch=video4linux $PLATFORM_BUS_NOMATCH - (udevadm settle --timeout=10; udevadm control --env=STARTUP=)& - else - udevadm trigger --action=add - udevadm settle - fi - ;; - stop) - echo "Stopping udevd" - start-stop-daemon --stop --name udevd --quiet - ;; - restart) - $0 stop - sleep 1 - $0 start - ;; - status) - pid=`pidof -x udevd` - if [ -n "$pid" ]; then - echo "udevd (pid $pid) is running ..." - else - echo "udevd is stopped" - fi - ;; - *) - echo "Usage: $0 {start|stop|status|restart}" - exit 1 -esac -exit 0 diff --git a/eudev-3.1.5/mtcap/mtcap.rules b/eudev-3.1.5/mtcap/mtcap.rules deleted file mode 100644 index a0dc9fb..0000000 --- a/eudev-3.1.5/mtcap/mtcap.rules +++ /dev/null @@ -1,8 +0,0 @@ -ACTION=="remove", GOTO="mlinux_end" -SUBSYSTEM!="tty", GOTO="mlinux_end" -KERNEL!="ttyXRUSB[0-9]*", GOTO="mlinux_end" - -SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}" -ENV{ID_IFACE}=="", GOTO="mlinux_end" - -LABEL="mlinux_end" diff --git a/eudev-3.1.5/mtcdt/accessory_ethernet.rules b/eudev-3.1.5/mtcdt/accessory_ethernet.rules deleted file mode 100644 index 376486b..0000000 --- a/eudev-3.1.5/mtcdt/accessory_ethernet.rules +++ /dev/null @@ -1,21 +0,0 @@ -#To add new rule for new device you have to run (in case if you want to add eth1 interface) -#admin@mtcdt:~# udevadm info --attribute-walk --path=/sys/class/net/eth1 -# looking at device '/devices/ahb.0/700000.ehci/usb1/1-2/1-2.1/1-2.1.1/1-2.1.1:1.0/net/eth1': -# KERNEL=="eth1" -# SUBSYSTEM=="net" -# DRIVER=="" -# ATTR{mtu}=="1500" -# ATTR{type}=="1" -# ........... -# ........... - -# looking at parent device '/devices/ahb.0/700000.ehci/usb1/1-2/1-2.1/1-2.1.1/1-2.1.1:1.0': -# KERNELS=="1-2.1.1:1.0" <------------------- extract this record to add to the rule -# SUBSYSTEMS=="usb" -# DRIVERS=="smsc75xx" -# ATTRS{bInterfaceClass}=="ff" -# ATTRS{bInterfaceSubClass}=="00" -# ........... - -KERNELS=="1-2.1.1:1.0", SUBSYSTEMS=="usb", DRIVERS=="smsc75xx", NAME="eth1" -KERNELS=="1-2.1.2:1.0", SUBSYSTEMS=="usb", DRIVERS=="smsc75xx", NAME="eth2" diff --git a/eudev-3.1.5/mtcdt/mtcdt.rules b/eudev-3.1.5/mtcdt/mtcdt.rules deleted file mode 100644 index 5d528e6..0000000 --- a/eudev-3.1.5/mtcdt/mtcdt.rules +++ /dev/null @@ -1,14 +0,0 @@ -ACTION=="remove", GOTO="mlinux_end" -SUBSYSTEM!="tty", GOTO="mlinux_end" -KERNEL!="ttyXRUSB[0-9]*", GOTO="mlinux_end" - -SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}" -ENV{ID_IFACE}=="", GOTO="mlinux_end" - -# Accessory Ports -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="00", SYMLINK+="ttyAP1" -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="00", SYMLINK+="ttyAP1" -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="02", SYMLINK+="ttyAP2" -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="02", SYMLINK+="ttyAP2" - -LABEL="mlinux_end" diff --git a/eudev-3.1.5/udev-cache.default b/eudev-3.1.5/udev-cache.default deleted file mode 100644 index b1aa63f..0000000 --- a/eudev-3.1.5/udev-cache.default +++ /dev/null @@ -1,5 +0,0 @@ -# Default for /etc/init.d/udev - -# Comment this out to disable device cache -#DEVCACHE="/etc/dev.tar" -PROBE_PLATFORM_BUS="yes" diff --git a/eudev/cellular_radios.rules b/eudev/cellular_radios.rules new file mode 100644 index 0000000..aa05e96 --- /dev/null +++ b/eudev/cellular_radios.rules @@ -0,0 +1,59 @@ +ACTION=="remove", GOTO="mlinux_end" +SUBSYSTEM!="tty", GOTO="mlinux_end" +KERNEL!="ttyUSB[0-9]*|ttyACM[0-9]*", GOTO="mlinux_end" + +SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}" +ENV{ID_IFACE}=="", GOTO="mlinux_end" + +# All modem ports +# H5 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="00", SYMLINK+="modem0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="02", SYMLINK+="modem1" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="04", SYMLINK+="modem2" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="06", SYMLINK+="modem3" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="08", SYMLINK+="modem4" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="0a", SYMLINK+="modem5" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="0c", SYMLINK+="modem6" +# EV3 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="00", SYMLINK+="modem0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="01", SYMLINK+="modem1" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="02", SYMLINK+="modem2" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="03", SYMLINK+="modem3" +# H4 +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="00", SYMLINK+="modem0" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="01", SYMLINK+="modem1" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="02", SYMLINK+="modem2" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="03", SYMLINK+="modem3" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="04", SYMLINK+="modem4" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="05", SYMLINK+="modem5" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="06", SYMLINK+="modem6" +# EV2 +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="0028", SYMLINK+="modem$env{ID_PORT}" + +# AT Command ports +# H5: ttyACM0, ttyACM3 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="06", SYMLINK+="modem_at1" +# EV3: ttyUSB2, ttyUSB3 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="02", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="03", SYMLINK+="modem_at1" +# H4: ttyUSB3, ttyUSB4, ttyUSB5 +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="03", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="04", SYMLINK+="modem_at1" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="05", SYMLINK+="modem_at2" +# EV2: ttyUSB0 +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="0028", ENV{ID_PORT}=="0", SYMLINK+="modem_at0" +# LAT1, LEU1, LVW2: ttyUSB2, ttyUSB3 (port 04 and port 05) +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1201", ENV{ID_IFACE}=="04", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1201", ENV{ID_IFACE}=="05", SYMLINK+="modem_at1" +# LJP1(LE910-JN1), LNA3(LE910-NA1): ttyACM0, ttyACM3 (port 00 and port 03) +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="06", SYMLINK+="modem_at1" +# G3: ttyACM0, ttyACM1 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0022", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0022", ENV{ID_IFACE}=="02", SYMLINK+="modem_at1" +# C2: ttyUSB0, ttyUSB1 (Telit Documentation: Modem Port = USB1, Aux Port = USB0) +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1011", ENV{ID_IFACE}=="01", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1011", ENV{ID_IFACE}=="00", SYMLINK+="modem_at1" + +LABEL="mlinux_end" diff --git a/eudev/init b/eudev/init new file mode 100644 index 0000000..bd716b0 --- /dev/null +++ b/eudev/init @@ -0,0 +1,138 @@ +#!/bin/sh + +### BEGIN INIT INFO +# Provides: udev +# Required-Start: mountvirtfs +# Required-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Start udevd, populate /dev and load drivers. +### END INIT INFO + +export TZ=/etc/localtime + +[ -d /sys/class ] || exit 1 +[ -r /proc/mounts ] || exit 1 +[ -x @UDEVD@ ] || exit 1 +[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache +[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf +[ -f /etc/default/rcS ] && . /etc/default/rcS + +readfiles () { + READDATA="" + for filename in $@; do + if [ -r $filename ]; then + while read line; do + READDATA="$READDATA$line" + done < $filename + fi + done +} + +kill_udevd () { + pid=`pidof -x udevd` + [ -n "$pid" ] && kill $pid +} + +case "$1" in + start) + export ACTION=add + # propagate /dev from /sys + echo "Starting udev" + + # Check for requireed devtmpfs before trying to start udev and + # mount a no-existant fs. + if ! grep -q devtmpfs /proc/filesystems + then + echo "Missing devtmpfs, which is required for udev to run"; + echo "Halting..." + halt + fi + # mount the devtmpfs on /dev, if not already done + LANG=C awk '$2 == "/dev" && ($3 == "devtmpfs") { exit 1 }' /proc/mounts && { + mount -n -o mode=0755 -t devtmpfs none "/dev" + } + [ -e /dev/pts ] || mkdir -m 0755 /dev/pts + [ -e /dev/shm ] || mkdir -m 1777 /dev/shm + # the automount rule for udev needs /tmp directory available, as /tmp is a symlink + # to /var/tmp which in turn is a symlink to /var/volatile/tmp, we need to make sure + # /var/volatile/tmp directory to be available. + mkdir -p /var/volatile/tmp + + # Cache handling. + # A list of files which are used as a criteria to judge whether the udev cache could be reused. + CMP_FILE_LIST="/proc/version /proc/cmdline /proc/devices /proc/atags" + if [ "$DEVCACHE" != "" ]; then + if [ -e $DEVCACHE ]; then + readfiles $CMP_FILE_LIST + NEWDATA="$READDATA" + readfiles /etc/udev/cache.data + OLDDATA="$READDATA" + if [ "$OLDDATA" = "$NEWDATA" ]; then + (cd /; tar xf $DEVCACHE > /dev/null 2>&1) + not_first_boot=1 + [ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE" + [ -e /dev/shm/udev.cache ] && rm -f /dev/shm/udev.cache + else + # Output detailed reason why the cached /dev is not used + if [ "$VERBOSE" != "no" ]; then + echo "udev: udev cache not used" + echo "udev: we use $CMP_FILE_LIST as criteria to judge whether the cache /dev could be resued" + echo "udev: olddata: $OLDDATA" + echo "udev: newdata: $NEWDATA" + fi + echo "$NEWDATA" > /dev/shm/udev.cache + fi + else + if [ "$ROOTFS_READ_ONLY" != "yes" ]; then + # If rootfs is not read-only, it's possible that a new udev cache would be generated; + # otherwise, we do not bother to read files. + readfiles $CMP_FILE_LIST + echo "$READDATA" > /dev/shm/udev.cache + fi + fi + fi + + # make_extra_nodes + kill_udevd > "/dev/null" 2>&1 + + # trigger the sorted events + echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug + @UDEVD@ -d + + udevadm control --env=STARTUP=1 + if [ "$not_first_boot" != "" ];then + if [ "$PROBE_PLATFORM_BUS" != "yes" ]; then + PLATFORM_BUS_NOMATCH="--subsystem-nomatch=platform" + else + PLATFORM_BUS_NOMATCH="" + fi + udevadm trigger --action=add --subsystem-nomatch=tty --subsystem-nomatch=mem --subsystem-nomatch=vc --subsystem-nomatch=vtconsole --subsystem-nomatch=misc --subsystem-nomatch=dcon --subsystem-nomatch=pci_bus --subsystem-nomatch=graphics --subsystem-nomatch=backlight --subsystem-nomatch=video4linux $PLATFORM_BUS_NOMATCH + (udevadm settle --timeout=10; udevadm control --env=STARTUP=)& + else + udevadm trigger --action=add + udevadm settle + fi + ;; + stop) + echo "Stopping udevd" + start-stop-daemon --stop --name udevd --quiet + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + status) + pid=`pidof -x udevd` + if [ -n "$pid" ]; then + echo "udevd (pid $pid) is running ..." + else + echo "udevd is stopped" + fi + ;; + *) + echo "Usage: $0 {start|stop|status|restart}" + exit 1 +esac +exit 0 diff --git a/eudev/mtcap/mtcap.rules b/eudev/mtcap/mtcap.rules new file mode 100644 index 0000000..a0dc9fb --- /dev/null +++ b/eudev/mtcap/mtcap.rules @@ -0,0 +1,8 @@ +ACTION=="remove", GOTO="mlinux_end" +SUBSYSTEM!="tty", GOTO="mlinux_end" +KERNEL!="ttyXRUSB[0-9]*", GOTO="mlinux_end" + +SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}" +ENV{ID_IFACE}=="", GOTO="mlinux_end" + +LABEL="mlinux_end" diff --git a/eudev/mtcdt/accessory_ethernet.rules b/eudev/mtcdt/accessory_ethernet.rules new file mode 100644 index 0000000..376486b --- /dev/null +++ b/eudev/mtcdt/accessory_ethernet.rules @@ -0,0 +1,21 @@ +#To add new rule for new device you have to run (in case if you want to add eth1 interface) +#admin@mtcdt:~# udevadm info --attribute-walk --path=/sys/class/net/eth1 +# looking at device '/devices/ahb.0/700000.ehci/usb1/1-2/1-2.1/1-2.1.1/1-2.1.1:1.0/net/eth1': +# KERNEL=="eth1" +# SUBSYSTEM=="net" +# DRIVER=="" +# ATTR{mtu}=="1500" +# ATTR{type}=="1" +# ........... +# ........... + +# looking at parent device '/devices/ahb.0/700000.ehci/usb1/1-2/1-2.1/1-2.1.1/1-2.1.1:1.0': +# KERNELS=="1-2.1.1:1.0" <------------------- extract this record to add to the rule +# SUBSYSTEMS=="usb" +# DRIVERS=="smsc75xx" +# ATTRS{bInterfaceClass}=="ff" +# ATTRS{bInterfaceSubClass}=="00" +# ........... + +KERNELS=="1-2.1.1:1.0", SUBSYSTEMS=="usb", DRIVERS=="smsc75xx", NAME="eth1" +KERNELS=="1-2.1.2:1.0", SUBSYSTEMS=="usb", DRIVERS=="smsc75xx", NAME="eth2" diff --git a/eudev/mtcdt/mtcdt.rules b/eudev/mtcdt/mtcdt.rules new file mode 100644 index 0000000..5d528e6 --- /dev/null +++ b/eudev/mtcdt/mtcdt.rules @@ -0,0 +1,14 @@ +ACTION=="remove", GOTO="mlinux_end" +SUBSYSTEM!="tty", GOTO="mlinux_end" +KERNEL!="ttyXRUSB[0-9]*", GOTO="mlinux_end" + +SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}" +ENV{ID_IFACE}=="", GOTO="mlinux_end" + +# Accessory Ports +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="00", SYMLINK+="ttyAP1" +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="00", SYMLINK+="ttyAP1" +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="02", SYMLINK+="ttyAP2" +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="02", SYMLINK+="ttyAP2" + +LABEL="mlinux_end" diff --git a/eudev/udev-cache.default b/eudev/udev-cache.default new file mode 100644 index 0000000..b1aa63f --- /dev/null +++ b/eudev/udev-cache.default @@ -0,0 +1,5 @@ +# Default for /etc/init.d/udev + +# Comment this out to disable device cache +#DEVCACHE="/etc/dev.tar" +PROBE_PLATFORM_BUS="yes" diff --git a/eudev_%.bbappend b/eudev_%.bbappend new file mode 100644 index 0000000..2a15734 --- /dev/null +++ b/eudev_%.bbappend @@ -0,0 +1,21 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:" + +PR .= ".mlinux2" + +# add custom rules for persistent modem device names +SRC_URI += " file://cellular_radios.rules \ + file://${MACHINE}.rules \ + " +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI_append_mtcdt = " file://accessory_ethernet.rules \ + " + +do_install_append() { + install -m 644 ${WORKDIR}/cellular_radios.rules ${D}${sysconfdir}/udev/rules.d/ + install -m 644 ${WORKDIR}/${MACHINE}.rules ${D}${sysconfdir}/udev/rules.d/ +} + +do_install_append_mtcdt() { + install -m 644 ${WORKDIR}/accessory_ethernet.rules ${D}${sysconfdir}/udev/rules.d/ +} diff --git a/eudev_3.1.5.bbappend b/eudev_3.1.5.bbappend deleted file mode 100644 index e793d1d..0000000 --- a/eudev_3.1.5.bbappend +++ /dev/null @@ -1,20 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:" - -PR .= ".mlinux2" - -# add custom rules for persistent modem device names -SRC_URI += " file://cellular_radios.rules \ - file://${MACHINE}.rules \ - " - -SRC_URI_append_mtcdt = " file://accessory_ethernet.rules \ - " - -do_install_append() { - install -m 644 ${WORKDIR}/cellular_radios.rules ${D}${sysconfdir}/udev/rules.d/ - install -m 644 ${WORKDIR}/${MACHINE}.rules ${D}${sysconfdir}/udev/rules.d/ -} - -do_install_append_mtcdt() { - install -m 644 ${WORKDIR}/accessory_ethernet.rules ${D}${sysconfdir}/udev/rules.d/ -} -- cgit v1.2.3 From 3080b3877fa617d6924cfd8a0bb1f3f9caff7f37 Mon Sep 17 00:00:00 2001 From: John Klug Date: Wed, 31 May 2017 16:09:30 -0500 Subject: Update cellular_radios.rules for udev adding LAT3, LVW3 and LEU3 new modem rules --- eudev/cellular_radios.rules | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/eudev/cellular_radios.rules b/eudev/cellular_radios.rules index aa05e96..fd36bbd 100644 --- a/eudev/cellular_radios.rules +++ b/eudev/cellular_radios.rules @@ -14,6 +14,13 @@ ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="06", SYMLINK+ ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="08", SYMLINK+="modem4" ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="0a", SYMLINK+="modem5" ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="0c", SYMLINK+="modem6" +# LAT3, LVW3 and LEU3 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="00", SYMLINK+="modem0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="02", SYMLINK+="modem1" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="04", SYMLINK+="modem2" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="06", SYMLINK+="modem3" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="08", SYMLINK+="modem4" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="0a", SYMLINK+="modem5" # EV3 ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="00", SYMLINK+="modem0" ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="01", SYMLINK+="modem1" @@ -34,6 +41,9 @@ ATTRS{idVendor}=="1199", ATTRS{idProduct}=="0028", SYMLINK+="modem$env{ID_PORT}" # H5: ttyACM0, ttyACM3 ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="06", SYMLINK+="modem_at1" +# LAT3, LVW3 and LEU3 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="06", SYMLINK+="modem_at1" # EV3: ttyUSB2, ttyUSB3 ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="02", SYMLINK+="modem_at0" ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="03", SYMLINK+="modem_at1" -- cgit v1.2.3 From 66fc196f04b71f41bcbc4fc18f9fc00cd08a2b7b Mon Sep 17 00:00:00 2001 From: John Klug Date: Tue, 20 Jun 2017 09:33:45 -0500 Subject: Add new radios for Japan --- eudev/cellular_radios.rules | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eudev/cellular_radios.rules b/eudev/cellular_radios.rules index fd36bbd..096f10a 100644 --- a/eudev/cellular_radios.rules +++ b/eudev/cellular_radios.rules @@ -59,6 +59,9 @@ ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1201", ENV{ID_IFACE}=="05", SYMLINK+ # LJP1(LE910-JN1), LNA3(LE910-NA1): ttyACM0, ttyACM3 (port 00 and port 03) ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="06", SYMLINK+="modem_at1" +# LJP1(LE866) ttyACM0, ttyACM2 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="2300", ENV{ID_IFACE}=="02", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="2300", ENV{ID_IFACE}=="06", SYMLINK+="modem_at1" # G3: ttyACM0, ttyACM1 ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0022", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0022", ENV{ID_IFACE}=="02", SYMLINK+="modem_at1" -- cgit v1.2.3 From 0a1100bb4f5d80d9e94b8a3a3e756c7b05aa8c5d Mon Sep 17 00:00:00 2001 From: John Klug Date: Wed, 19 Jul 2017 17:21:49 -0500 Subject: Users in the disk group should be able to write fat/vfat by default --- udev-extraconf/mount.patch | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 udev-extraconf/mount.patch diff --git a/udev-extraconf/mount.patch b/udev-extraconf/mount.patch new file mode 100644 index 0000000..5468295 --- /dev/null +++ b/udev-extraconf/mount.patch @@ -0,0 +1,24 @@ +diff -Naru old/mount.sh new/mount.sh +--- old/mount.sh 2017-07-13 14:38:01.497487772 -0500 ++++ new/mount.sh 2017-07-19 17:18:08.749856242 -0500 +@@ -4,7 +4,6 @@ + # + # Attempt to mount any added block devices and umount any removed devices + +- + MOUNT="/bin/mount" + PMOUNT="/usr/bin/pmount" + UMOUNT="/bin/umount" +@@ -66,7 +65,11 @@ + if [ -x "$PMOUNT" ]; then + $PMOUNT $DEVNAME 2> /dev/null + elif [ -x $MOUNT ]; then +- $MOUNT $DEVNAME 2> /dev/null ++ if [[ $ID_FS_TYPE =~ fat ]] ; then ++ $MOUNT -o umask=002,gid=disk $DEVNAME 2> /dev/null ++ else ++ $MOUNT $DEVNAME 2> /dev/null ++ fi + fi + + # If the device isn't mounted at this point, it isn't -- cgit v1.2.3 From 862f474532b5733bb422cebe94934a25547fe26c Mon Sep 17 00:00:00 2001 From: John Klug Date: Wed, 16 Aug 2017 16:01:13 -0500 Subject: Upward compatibility for udev and /media --- udev-extraconf/mount.patch | 17 ++++++++++++++--- udev-extraconf_%.bbappend | 3 +++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/udev-extraconf/mount.patch b/udev-extraconf/mount.patch index 5468295..16e0672 100644 --- a/udev-extraconf/mount.patch +++ b/udev-extraconf/mount.patch @@ -1,6 +1,6 @@ diff -Naru old/mount.sh new/mount.sh ---- old/mount.sh 2017-07-13 14:38:01.497487772 -0500 -+++ new/mount.sh 2017-07-19 17:18:08.749856242 -0500 +--- old/mount.sh 2017-08-16 15:14:20.386456313 -0500 ++++ new/mount.sh 2017-08-16 15:21:28.898443627 -0500 @@ -4,7 +4,6 @@ # # Attempt to mount any added block devices and umount any removed devices @@ -9,7 +9,18 @@ diff -Naru old/mount.sh new/mount.sh MOUNT="/bin/mount" PMOUNT="/usr/bin/pmount" UMOUNT="/bin/umount" -@@ -66,7 +65,11 @@ +@@ -21,6 +20,10 @@ + name="`basename "$DEVNAME"`" + + ! test -d "/run/media/$name" && mkdir -p "/run/media/$name" ++ if [ "$name" = mmcblk0p1 ] ; ++ then ++ ln -sf /run/media/$name /run/media/card ++ fi + # Silent util-linux's version of mounting auto + if [ "x`readlink $MOUNT`" = "x/bin/mount.util-linux" ] ; + then +@@ -66,7 +69,11 @@ if [ -x "$PMOUNT" ]; then $PMOUNT $DEVNAME 2> /dev/null elif [ -x $MOUNT ]; then diff --git a/udev-extraconf_%.bbappend b/udev-extraconf_%.bbappend index 6d4804d..708a07c 100644 --- a/udev-extraconf_%.bbappend +++ b/udev-extraconf_%.bbappend @@ -1,2 +1,5 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" +PR = "m1" + +SRC_URI += "file://mount.patch" -- cgit v1.2.3 From 328f8edd5830c05c2eeca83c8b71a831859e7610 Mon Sep 17 00:00:00 2001 From: John Klug Date: Tue, 19 Sep 2017 11:15:51 -0500 Subject: MTR CATM Telit ME910 --- eudev/cellular_radios.rules | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eudev/cellular_radios.rules b/eudev/cellular_radios.rules index 096f10a..bfae9a3 100644 --- a/eudev/cellular_radios.rules +++ b/eudev/cellular_radios.rules @@ -68,5 +68,8 @@ ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0022", ENV{ID_IFACE}=="02", SYMLINK+ # C2: ttyUSB0, ttyUSB1 (Telit Documentation: Modem Port = USB1, Aux Port = USB0) ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1011", ENV{ID_IFACE}=="01", SYMLINK+="modem_at0" ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1011", ENV{ID_IFACE}=="00", SYMLINK+="modem_at1" +# CATM Telit ME910 +ATTRS{idVendor}==”1bc7”, ATTRS{idProduct}==”1101”, ENV{ID_IFACE}==”01”, SYMLINK+=”modem_at0” +ATTRS{idVendor}==”1bc7”, ATTRS{idProduct}==”1101”, ENV{ID_IFACE}==”02”, SYMLINK+=”modem_at1” LABEL="mlinux_end" -- cgit v1.2.3 From a429b8c7b2a5664adbdcd87a0df392d90feb1ca6 Mon Sep 17 00:00:00 2001 From: John Klug Date: Tue, 19 Sep 2017 12:00:27 -0500 Subject: Bump level for CAT M Radio --- eudev_%.bbappend | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eudev_%.bbappend b/eudev_%.bbappend index 2a15734..5b9c16c 100644 --- a/eudev_%.bbappend +++ b/eudev_%.bbappend @@ -1,6 +1,6 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:" -PR .= ".mlinux2" +PR .= ".mlinux3" # add custom rules for persistent modem device names SRC_URI += " file://cellular_radios.rules \ -- cgit v1.2.3 From a0104bf5414e551858df4fae514c5abcaa890c1f Mon Sep 17 00:00:00 2001 From: John Klug Date: Tue, 3 Oct 2017 09:46:59 -0500 Subject: Fix quote typos and add 2nd ME910 ID --- eudev/cellular_radios.rules | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/eudev/cellular_radios.rules b/eudev/cellular_radios.rules index bfae9a3..6dd293d 100644 --- a/eudev/cellular_radios.rules +++ b/eudev/cellular_radios.rules @@ -69,7 +69,10 @@ ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0022", ENV{ID_IFACE}=="02", SYMLINK+ ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1011", ENV{ID_IFACE}=="01", SYMLINK+="modem_at0" ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1011", ENV{ID_IFACE}=="00", SYMLINK+="modem_at1" # CATM Telit ME910 -ATTRS{idVendor}==”1bc7”, ATTRS{idProduct}==”1101”, ENV{ID_IFACE}==”01”, SYMLINK+=”modem_at0” -ATTRS{idVendor}==”1bc7”, ATTRS{idProduct}==”1101”, ENV{ID_IFACE}==”02”, SYMLINK+=”modem_at1” +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1100", ENV{ID_IFACE}=="01", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1100", ENV{ID_IFACE}=="02", SYMLINK+="modem_at1" +# CATM Telit ME910 dual USB +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1101", ENV{ID_IFACE}=="01", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1101", ENV{ID_IFACE}=="02", SYMLINK+="modem_at1" LABEL="mlinux_end" -- cgit v1.2.3 From 77edc1e2817f01679e29fa6bfd40b15ce5b41eef Mon Sep 17 00:00:00 2001 From: Jeff Hatch Date: Tue, 15 May 2018 09:26:59 -0500 Subject: IN003115: Support Portal Case #5088842: Getting Corrupt Installs and Corrupt SD Card --- udev-extraconf/mount.patch | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/udev-extraconf/mount.patch b/udev-extraconf/mount.patch index 16e0672..71ccc56 100644 --- a/udev-extraconf/mount.patch +++ b/udev-extraconf/mount.patch @@ -1,6 +1,6 @@ diff -Naru old/mount.sh new/mount.sh ---- old/mount.sh 2017-08-16 15:14:20.386456313 -0500 -+++ new/mount.sh 2017-08-16 15:21:28.898443627 -0500 +--- old/mount.sh 2018-05-15 09:07:02.814673114 -0500 ++++ new/mount.sh 2018-05-15 09:06:30.862674060 -0500 @@ -4,7 +4,6 @@ # # Attempt to mount any added block devices and umount any removed devices @@ -20,6 +20,15 @@ diff -Naru old/mount.sh new/mount.sh # Silent util-linux's version of mounting auto if [ "x`readlink $MOUNT`" = "x/bin/mount.util-linux" ] ; then +@@ -31,7 +34,7 @@ + # grant it with w/r/x permissions. + case $ID_FS_TYPE in + vfat|fat) +- MOUNT="$MOUNT -o umask=007,gid=`awk -F':' '/^disk/{print $3}' /etc/group`" ++ MOUNT="$MOUNT -o errors=continue -o umask=007,gid=`awk -F':' '/^disk/{print $3}' /etc/group`" + ;; + # TODO + *) @@ -66,7 +69,11 @@ if [ -x "$PMOUNT" ]; then $PMOUNT $DEVNAME 2> /dev/null -- cgit v1.2.3 From d4dbf9a054cd28fc226c1d2266ee335a4ba38cfe Mon Sep 17 00:00:00 2001 From: John Klug Date: Thu, 20 Dec 2018 13:49:47 -0600 Subject: Add a rulefile for mtrv1 --- eudev/mtrv1/mtrv1.rules | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 eudev/mtrv1/mtrv1.rules diff --git a/eudev/mtrv1/mtrv1.rules b/eudev/mtrv1/mtrv1.rules new file mode 100644 index 0000000..5d528e6 --- /dev/null +++ b/eudev/mtrv1/mtrv1.rules @@ -0,0 +1,14 @@ +ACTION=="remove", GOTO="mlinux_end" +SUBSYSTEM!="tty", GOTO="mlinux_end" +KERNEL!="ttyXRUSB[0-9]*", GOTO="mlinux_end" + +SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}" +ENV{ID_IFACE}=="", GOTO="mlinux_end" + +# Accessory Ports +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="00", SYMLINK+="ttyAP1" +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="00", SYMLINK+="ttyAP1" +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="02", SYMLINK+="ttyAP2" +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="02", SYMLINK+="ttyAP2" + +LABEL="mlinux_end" -- cgit v1.2.3 From dc168fd2ba396cc7c2e1d373fe693bebf527cb04 Mon Sep 17 00:00:00 2001 From: John Klug Date: Thu, 3 Jan 2019 17:50:18 -0600 Subject: Fix mtrv1.rules for mtrv1 udev --- eudev/mtrv1/mtrv1.rules | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/eudev/mtrv1/mtrv1.rules b/eudev/mtrv1/mtrv1.rules index 5d528e6..239a846 100644 --- a/eudev/mtrv1/mtrv1.rules +++ b/eudev/mtrv1/mtrv1.rules @@ -1,14 +1,13 @@ ACTION=="remove", GOTO="mlinux_end" SUBSYSTEM!="tty", GOTO="mlinux_end" -KERNEL!="ttyXRUSB[0-9]*", GOTO="mlinux_end" +KERNEL!="ttyUSB[0-9]*|ttyACM[0-9]*|ttyXRUSB[0-9]*|ttyS*", GOTO="mlinux_end" SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}" ENV{ID_IFACE}=="", GOTO="mlinux_end" -# Accessory Ports -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="00", SYMLINK+="ttyAP1" -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="00", SYMLINK+="ttyAP1" -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="02", SYMLINK+="ttyAP2" -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="02", SYMLINK+="ttyAP2" +# mtr revA: bluetooth on exar chip (ACM0, iface 0) +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="00", SYMLINK+="bt" +# mtr revA: external serial on exar chip (ACM1, iface 2) +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="02", SYMLINK+="ext_serial" LABEL="mlinux_end" -- cgit v1.2.3 From 9d6d83e7aa323c7314b95f9b7a98eeb6ef02327f Mon Sep 17 00:00:00 2001 From: John Klug Date: Mon, 7 Jan 2019 15:44:55 -0600 Subject: Set name of EXAR devices to ttyXRUSB* --- eudev/mtcdt/mtcdt.rules | 11 +++++++---- eudev/mtrv1/mtrv1.rules | 5 +++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/eudev/mtcdt/mtcdt.rules b/eudev/mtcdt/mtcdt.rules index 5d528e6..0066f3b 100644 --- a/eudev/mtcdt/mtcdt.rules +++ b/eudev/mtcdt/mtcdt.rules @@ -6,9 +6,12 @@ SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}" ENV{ID_IFACE}=="", GOTO="mlinux_end" # Accessory Ports -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="00", SYMLINK+="ttyAP1" -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="00", SYMLINK+="ttyAP1" -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="02", SYMLINK+="ttyAP2" -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="02", SYMLINK+="ttyAP2" +# ttyXRUSB is Vizzini driver name, for compatiblity. +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="00", SYMLINK+="ttyAP1", NAME="ttyXRUSB0" +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="00", SYMLINK+="ttyAP1", NAME="ttyXRUSB0" +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="02", SYMLINK+="ttyAP2", NAME="ttyXRUSB1" +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="02", SYMLINK+="ttyAP2", NAME="ttyXRUSB1" +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="04", NAME="ttyXRUSB2" +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="06", NAME="ttyXRUSB3" LABEL="mlinux_end" diff --git a/eudev/mtrv1/mtrv1.rules b/eudev/mtrv1/mtrv1.rules index 239a846..0ca31f9 100644 --- a/eudev/mtrv1/mtrv1.rules +++ b/eudev/mtrv1/mtrv1.rules @@ -6,8 +6,9 @@ SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}" ENV{ID_IFACE}=="", GOTO="mlinux_end" # mtr revA: bluetooth on exar chip (ACM0, iface 0) -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="00", SYMLINK+="bt" +# ttyXRUSB is Vizzini driver name, for compatiblity. +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="00", NAME="ttyXRUSB0", SYMLINK+="bt" # mtr revA: external serial on exar chip (ACM1, iface 2) -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="02", SYMLINK+="ext_serial" +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="02", NAME="ttyXRUSB1", SYMLINK+="ext_serial" LABEL="mlinux_end" -- cgit v1.2.3 From 7dcdd71309a43d00c998bb784e4217f6b9aedf0b Mon Sep 17 00:00:00 2001 From: John Klug Date: Tue, 8 Jan 2019 12:35:51 -0600 Subject: Kernel is inconsistent in applying NAME changes, so use SYMLINKS --- eudev/mtcdt/mtcdt.rules | 12 ++++++------ eudev/mtrv1/mtrv1.rules | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/eudev/mtcdt/mtcdt.rules b/eudev/mtcdt/mtcdt.rules index 0066f3b..d7ff3e1 100644 --- a/eudev/mtcdt/mtcdt.rules +++ b/eudev/mtcdt/mtcdt.rules @@ -7,11 +7,11 @@ ENV{ID_IFACE}=="", GOTO="mlinux_end" # Accessory Ports # ttyXRUSB is Vizzini driver name, for compatiblity. -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="00", SYMLINK+="ttyAP1", NAME="ttyXRUSB0" -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="00", SYMLINK+="ttyAP1", NAME="ttyXRUSB0" -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="02", SYMLINK+="ttyAP2", NAME="ttyXRUSB1" -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="02", SYMLINK+="ttyAP2", NAME="ttyXRUSB1" -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="04", NAME="ttyXRUSB2" -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="06", NAME="ttyXRUSB3" +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="00", SYMLINK+="ttyXRUSB0", SYMLINK+="ttyAP1" +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="00", SYMLINK+="ttyXRUSB0", SYMLINK+="ttyAP1" +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="02", SYMLINK+="ttyXRUSB1", SYMLINK+="ttyAP2" +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="02", SYMLINK+="ttyXRUSB1", SYMLINK+="ttyAP2" +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="04", SYMLINK+="ttyXRUSB2" +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="06", SYMLINK+="ttyXRUSB3" LABEL="mlinux_end" diff --git a/eudev/mtrv1/mtrv1.rules b/eudev/mtrv1/mtrv1.rules index 0ca31f9..7dc5479 100644 --- a/eudev/mtrv1/mtrv1.rules +++ b/eudev/mtrv1/mtrv1.rules @@ -7,8 +7,8 @@ ENV{ID_IFACE}=="", GOTO="mlinux_end" # mtr revA: bluetooth on exar chip (ACM0, iface 0) # ttyXRUSB is Vizzini driver name, for compatiblity. -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="00", NAME="ttyXRUSB0", SYMLINK+="bt" +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="00", SYMLINK+="ttyXRUSB0", SYMLINK+="bt" # mtr revA: external serial on exar chip (ACM1, iface 2) -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="02", NAME="ttyXRUSB1", SYMLINK+="ext_serial" +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="02", SYMLINK+="ttyXRUSB1", SYMLINK+="ext_serial" LABEL="mlinux_end" -- cgit v1.2.3 From 842938fb1d9b840627408ebf10866941e9a456ec Mon Sep 17 00:00:00 2001 From: John Klug Date: Tue, 8 Jan 2019 13:31:25 -0600 Subject: Bump the level of eudev --- eudev_%.bbappend | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eudev_%.bbappend b/eudev_%.bbappend index 5b9c16c..cde2f10 100644 --- a/eudev_%.bbappend +++ b/eudev_%.bbappend @@ -1,6 +1,6 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:" -PR .= ".mlinux3" +PR .= ".mlinux4" # add custom rules for persistent modem device names SRC_URI += " file://cellular_radios.rules \ -- cgit v1.2.3 From 946f6cc021f0e683591b7ca57c59e0c7378c02cf Mon Sep 17 00:00:00 2001 From: John Klug Date: Tue, 8 Jan 2019 17:47:05 -0600 Subject: Bluetooth is not /dev/TTYXRUSB0 on mtrv1 --- eudev/mtrv1/mtrv1.rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eudev/mtrv1/mtrv1.rules b/eudev/mtrv1/mtrv1.rules index 7dc5479..620c77a 100644 --- a/eudev/mtrv1/mtrv1.rules +++ b/eudev/mtrv1/mtrv1.rules @@ -7,7 +7,7 @@ ENV{ID_IFACE}=="", GOTO="mlinux_end" # mtr revA: bluetooth on exar chip (ACM0, iface 0) # ttyXRUSB is Vizzini driver name, for compatiblity. -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="00", SYMLINK+="ttyXRUSB0", SYMLINK+="bt" +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="00", SYMLINK+="ttyXRUSB0" # mtr revA: external serial on exar chip (ACM1, iface 2) ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="02", SYMLINK+="ttyXRUSB1", SYMLINK+="ext_serial" -- cgit v1.2.3 From 9d6123a352dbc7c333585a534529fa91c3fa400c Mon Sep 17 00:00:00 2001 From: John Klug Date: Tue, 15 Jan 2019 11:57:56 -0600 Subject: Wrong kernel device name for symlinks --- eudev/mtcdt/mtcdt.rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eudev/mtcdt/mtcdt.rules b/eudev/mtcdt/mtcdt.rules index d7ff3e1..95ac967 100644 --- a/eudev/mtcdt/mtcdt.rules +++ b/eudev/mtcdt/mtcdt.rules @@ -1,6 +1,6 @@ ACTION=="remove", GOTO="mlinux_end" SUBSYSTEM!="tty", GOTO="mlinux_end" -KERNEL!="ttyXRUSB[0-9]*", GOTO="mlinux_end" +KERNEL!="ttyACM[0-9]*", GOTO="mlinux_end" SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}" ENV{ID_IFACE}=="", GOTO="mlinux_end" -- cgit v1.2.3 From 6d6ac15d088e99dd43f2be1c01001d4962d4ab88 Mon Sep 17 00:00:00 2001 From: John Klug Date: Mon, 21 Jan 2019 12:53:28 -0600 Subject: Vizzini driver back in --- eudev/mtcdt/mtcdt.rules | 10 ++++------ eudev/mtrv1/mtrv1.rules | 3 +-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/eudev/mtcdt/mtcdt.rules b/eudev/mtcdt/mtcdt.rules index 95ac967..79434c3 100644 --- a/eudev/mtcdt/mtcdt.rules +++ b/eudev/mtcdt/mtcdt.rules @@ -7,11 +7,9 @@ ENV{ID_IFACE}=="", GOTO="mlinux_end" # Accessory Ports # ttyXRUSB is Vizzini driver name, for compatiblity. -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="00", SYMLINK+="ttyXRUSB0", SYMLINK+="ttyAP1" -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="00", SYMLINK+="ttyXRUSB0", SYMLINK+="ttyAP1" -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="02", SYMLINK+="ttyXRUSB1", SYMLINK+="ttyAP2" -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="02", SYMLINK+="ttyXRUSB1", SYMLINK+="ttyAP2" -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="04", SYMLINK+="ttyXRUSB2" -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="06", SYMLINK+="ttyXRUSB3" +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="00", SYMLINK+="ttyAP1" +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="00", SYMLINK+="ttyAP1" +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="02", SYMLINK+="ttyAP2" +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="02", SYMLINK+="ttyAP2" LABEL="mlinux_end" diff --git a/eudev/mtrv1/mtrv1.rules b/eudev/mtrv1/mtrv1.rules index 620c77a..c280402 100644 --- a/eudev/mtrv1/mtrv1.rules +++ b/eudev/mtrv1/mtrv1.rules @@ -7,8 +7,7 @@ ENV{ID_IFACE}=="", GOTO="mlinux_end" # mtr revA: bluetooth on exar chip (ACM0, iface 0) # ttyXRUSB is Vizzini driver name, for compatiblity. -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="00", SYMLINK+="ttyXRUSB0" # mtr revA: external serial on exar chip (ACM1, iface 2) -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="02", SYMLINK+="ttyXRUSB1", SYMLINK+="ext_serial" +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="02", SYMLINK+="ext_serial" LABEL="mlinux_end" -- cgit v1.2.3 From c086bdb67927fc6ba86fa02ed8d5a32702cb3c34 Mon Sep 17 00:00:00 2001 From: John Klug Date: Mon, 28 Jan 2019 15:33:02 -0600 Subject: Restore the mtrv1 /dev/bt link, and add old mtr to udev. --- eudev/mtr/mtr.rules | 13 +++++++++++++ eudev/mtrv1/mtrv1.rules | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 eudev/mtr/mtr.rules diff --git a/eudev/mtr/mtr.rules b/eudev/mtr/mtr.rules new file mode 100644 index 0000000..239a846 --- /dev/null +++ b/eudev/mtr/mtr.rules @@ -0,0 +1,13 @@ +ACTION=="remove", GOTO="mlinux_end" +SUBSYSTEM!="tty", GOTO="mlinux_end" +KERNEL!="ttyUSB[0-9]*|ttyACM[0-9]*|ttyXRUSB[0-9]*|ttyS*", GOTO="mlinux_end" + +SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}" +ENV{ID_IFACE}=="", GOTO="mlinux_end" + +# mtr revA: bluetooth on exar chip (ACM0, iface 0) +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="00", SYMLINK+="bt" +# mtr revA: external serial on exar chip (ACM1, iface 2) +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="02", SYMLINK+="ext_serial" + +LABEL="mlinux_end" diff --git a/eudev/mtrv1/mtrv1.rules b/eudev/mtrv1/mtrv1.rules index c280402..239a846 100644 --- a/eudev/mtrv1/mtrv1.rules +++ b/eudev/mtrv1/mtrv1.rules @@ -6,7 +6,7 @@ SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}" ENV{ID_IFACE}=="", GOTO="mlinux_end" # mtr revA: bluetooth on exar chip (ACM0, iface 0) -# ttyXRUSB is Vizzini driver name, for compatiblity. +ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="00", SYMLINK+="bt" # mtr revA: external serial on exar chip (ACM1, iface 2) ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="02", SYMLINK+="ext_serial" -- cgit v1.2.3 From a2ae695b8a4bdca6c356e8b569c79a03923d0303 Mon Sep 17 00:00:00 2001 From: John Klug Date: Wed, 13 Mar 2019 14:00:51 -0500 Subject: Put back mtcdt.rules since ACM driver does not work. --- eudev/mtcdt/mtcdt.rules | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/eudev/mtcdt/mtcdt.rules b/eudev/mtcdt/mtcdt.rules index 79434c3..5d528e6 100644 --- a/eudev/mtcdt/mtcdt.rules +++ b/eudev/mtcdt/mtcdt.rules @@ -1,12 +1,11 @@ ACTION=="remove", GOTO="mlinux_end" SUBSYSTEM!="tty", GOTO="mlinux_end" -KERNEL!="ttyACM[0-9]*", GOTO="mlinux_end" +KERNEL!="ttyXRUSB[0-9]*", GOTO="mlinux_end" SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}" ENV{ID_IFACE}=="", GOTO="mlinux_end" # Accessory Ports -# ttyXRUSB is Vizzini driver name, for compatiblity. ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="00", SYMLINK+="ttyAP1" ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="00", SYMLINK+="ttyAP1" ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="02", SYMLINK+="ttyAP2" -- cgit v1.2.3 From df29384fa7aa00ca7091e4c56e0b75e848a0904d Mon Sep 17 00:00:00 2001 From: Jeff Hatch Date: Thu, 11 Apr 2019 10:46:46 -0500 Subject: Add Quectel EG-95 rules for enumerating modem_at0 and modem_at1 --- eudev/cellular_radios.rules | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eudev/cellular_radios.rules b/eudev/cellular_radios.rules index 6dd293d..078f710 100644 --- a/eudev/cellular_radios.rules +++ b/eudev/cellular_radios.rules @@ -75,4 +75,8 @@ ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1100", ENV{ID_IFACE}=="02", SYMLINK+ ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1101", ENV{ID_IFACE}=="01", SYMLINK+="modem_at0" ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1101", ENV{ID_IFACE}=="02", SYMLINK+="modem_at1" +# Quectel EG-95 +ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0195", ENV{ID_IFACE}=="02", SYMLINK+="modem_at0" +ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0195", ENV{ID_IFACE}=="03", SYMLINK+="modem_at1" + LABEL="mlinux_end" -- cgit v1.2.3 From 5e714fa1317acb72f34a10e883e65ad33bd55dc6 Mon Sep 17 00:00:00 2001 From: John Klug Date: Thu, 25 Jul 2019 14:20:07 -0500 Subject: Move mount.patch forward for Yocto Thud --- udev-extraconf/mount.patch | 55 ++++++++++++++++------------------------------ 1 file changed, 19 insertions(+), 36 deletions(-) diff --git a/udev-extraconf/mount.patch b/udev-extraconf/mount.patch index 71ccc56..0c62873 100644 --- a/udev-extraconf/mount.patch +++ b/udev-extraconf/mount.patch @@ -1,44 +1,27 @@ diff -Naru old/mount.sh new/mount.sh ---- old/mount.sh 2018-05-15 09:07:02.814673114 -0500 -+++ new/mount.sh 2018-05-15 09:06:30.862674060 -0500 -@@ -4,7 +4,6 @@ - # - # Attempt to mount any added block devices and umount any removed devices +--- old/mount.sh 2019-07-25 13:22:28.209140732 -0500 ++++ new/mount.sh 2019-07-25 14:07:12.797061256 -0500 +@@ -49,6 +49,11 @@ -- - MOUNT="/bin/mount" - PMOUNT="/usr/bin/pmount" - UMOUNT="/bin/umount" -@@ -21,6 +20,10 @@ - name="`basename "$DEVNAME"`" + [ -d "/run/media/$name" ] || mkdir -p "/run/media/$name" - ! test -d "/run/media/$name" && mkdir -p "/run/media/$name" -+ if [ "$name" = mmcblk0p1 ] ; -+ then -+ ln -sf /run/media/$name /run/media/card -+ fi - # Silent util-linux's version of mounting auto - if [ "x`readlink $MOUNT`" = "x/bin/mount.util-linux" ] ; - then -@@ -31,7 +34,7 @@ - # grant it with w/r/x permissions. - case $ID_FS_TYPE in - vfat|fat) -- MOUNT="$MOUNT -o umask=007,gid=`awk -F':' '/^disk/{print $3}' /etc/group`" -+ MOUNT="$MOUNT -o errors=continue -o umask=007,gid=`awk -F':' '/^disk/{print $3}' /etc/group`" - ;; - # TODO - *) -@@ -66,7 +69,11 @@ ++ if [ "$name" = mmcblk0p1 ] ; then ++ ln -sf /run/media/$name ++ /run/media/card ++ fi ++ + MOUNT="$MOUNT -o silent" + + # If filesystemtype is vfat, change the ownership group to 'disk', and +@@ -78,7 +83,11 @@ if [ -x "$PMOUNT" ]; then $PMOUNT $DEVNAME 2> /dev/null elif [ -x $MOUNT ]; then -- $MOUNT $DEVNAME 2> /dev/null -+ if [[ $ID_FS_TYPE =~ fat ]] ; then -+ $MOUNT -o umask=002,gid=disk $DEVNAME 2> /dev/null -+ else -+ $MOUNT $DEVNAME 2> /dev/null -+ fi ++ if [[ $ID_FS_TYPE =~ fat ]] ; then ++ $MOUNT -o umask=002,gid=disk $DEVNAME 2> /dev/null ++ else + $MOUNT $DEVNAME 2> /dev/null ++ fi fi - + # If the device isn't mounted at this point, it isn't -- cgit v1.2.3 From fef27b81cd2526a620b62ef1ad91f40270dd9552 Mon Sep 17 00:00:00 2001 From: John Klug Date: Thu, 24 Oct 2019 18:49:50 -0500 Subject: udev mount patch to add to blacklist capability --- udev-extraconf/mount.patch | 68 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 61 insertions(+), 7 deletions(-) diff --git a/udev-extraconf/mount.patch b/udev-extraconf/mount.patch index 0c62873..1b475f3 100644 --- a/udev-extraconf/mount.patch +++ b/udev-extraconf/mount.patch @@ -1,19 +1,73 @@ -diff -Naru old/mount.sh new/mount.sh ---- old/mount.sh 2019-07-25 13:22:28.209140732 -0500 -+++ new/mount.sh 2019-07-25 14:07:12.797061256 -0500 -@@ -49,6 +49,11 @@ +diff -Naru orig/mount.blacklist new/mount.blacklist +--- orig/mount.blacklist 2019-10-24 17:08:59.796796272 -0500 ++++ new/mount.blacklist 2019-10-24 17:16:31.768782892 -0500 +@@ -3,3 +3,16 @@ + /dev/mtdblock + /dev/md + /dev/dm-* ++# These should all be mounted in fstab or not at all. ++[PARTLABEL=uboot] ++[PARTLABEL=root] ++[PARTLABEL=root1] ++[PARTLABEL=root2] ++[PARTLABEL=uboot] ++[PARTLABEL=oem] ++[PARTLABEL=oem1] ++[PARTLABEL=oem2] ++[PARTLABEL=config] ++[PARTLABEL=config1] ++[PARTLABEL=config2] ++[PARTLABEL=user_data] +diff -Naru orig/mount.sh new/mount.sh +--- orig/mount.sh 2019-10-24 17:09:11.344795931 -0500 ++++ new/mount.sh 2019-10-24 18:11:38.612684994 -0500 +@@ -25,9 +25,32 @@ + fi + + PMOUNT="/usr/bin/pmount" +- +-for line in `grep -h -v ^# /etc/udev/mount.blacklist /etc/udev/mount.blacklist.d/*` ++for line in `grep -h -v '^#$' /etc/udev/mount.blacklist /etc/udev/mount.blacklist.d/* 2>/dev/null` + do ++ if [[ $line =~ ^\[([^=]*)=([^\]]*)\] ]] ; then ++ fsspectype=${BASH_REMATCH[1]} ++ tmp="$(lsblk -o $fsspectype $DEVNAME | sed -e '1d')" ++ case $fsspectype in ++ PARTLABEL) ++ if [[ ${BASH_REMATCH[2]} == $tmp ]] ; then ++ logger "udev/mount.sh $DEVNAME is blacklisted, ignoring" ++ logger "$line" ++ exit 0 ++ fi ++ ;; ++ ++ PARTUUID) ++ if [[ ${BASH_REMATCH[2]^^} == $tmp ]] ; then ++ logger "udev/mount.sh $DEVNAME is blacklisted, ignoring" ++ logger "$line" ++ exit 0 ++ fi ++ ;; ++ *) ++ logger "[$fsspectype] is unsupported in blacklist -- ignoring blacklist item" ++ ;; ++ esac ++ fi + if [ ` expr match "$DEVNAME" "$line" ` -gt 0 ]; + then + logger "udev/mount.sh" "[$DEVNAME] is blacklisted, ignoring" +@@ -49,6 +72,10 @@ [ -d "/run/media/$name" ] || mkdir -p "/run/media/$name" + if [ "$name" = mmcblk0p1 ] ; then -+ ln -sf /run/media/$name -+ /run/media/card ++ ln -sf /run/media/$name /run/media/card + fi + MOUNT="$MOUNT -o silent" # If filesystemtype is vfat, change the ownership group to 'disk', and -@@ -78,7 +83,11 @@ +@@ -78,7 +105,11 @@ if [ -x "$PMOUNT" ]; then $PMOUNT $DEVNAME 2> /dev/null elif [ -x $MOUNT ]; then -- cgit v1.2.3 From f04b798b59480f1bb7edac39acd300ade248f8e8 Mon Sep 17 00:00:00 2001 From: Andrii Pientsov Date: Thu, 21 May 2020 22:23:50 +0300 Subject: Remove duplicate udev --- eudev/cellular_radios.rules | 82 --------------------- eudev/init | 138 ----------------------------------- eudev/mtcap/mtcap.rules | 8 -- eudev/mtcdt/accessory_ethernet.rules | 21 ------ eudev/mtcdt/mtcdt.rules | 14 ---- eudev/mtr/mtr.rules | 13 ---- eudev/mtrv1/mtrv1.rules | 13 ---- eudev/udev-cache.default | 5 -- eudev_%.bbappend | 21 ------ udev-extraconf/automount.rules | 24 ------ udev-extraconf/mount.patch | 81 -------------------- udev-extraconf_%.bbappend | 5 -- 12 files changed, 425 deletions(-) delete mode 100644 eudev/cellular_radios.rules delete mode 100644 eudev/init delete mode 100644 eudev/mtcap/mtcap.rules delete mode 100644 eudev/mtcdt/accessory_ethernet.rules delete mode 100644 eudev/mtcdt/mtcdt.rules delete mode 100644 eudev/mtr/mtr.rules delete mode 100644 eudev/mtrv1/mtrv1.rules delete mode 100644 eudev/udev-cache.default delete mode 100644 eudev_%.bbappend delete mode 100644 udev-extraconf/automount.rules delete mode 100644 udev-extraconf/mount.patch delete mode 100644 udev-extraconf_%.bbappend diff --git a/eudev/cellular_radios.rules b/eudev/cellular_radios.rules deleted file mode 100644 index 078f710..0000000 --- a/eudev/cellular_radios.rules +++ /dev/null @@ -1,82 +0,0 @@ -ACTION=="remove", GOTO="mlinux_end" -SUBSYSTEM!="tty", GOTO="mlinux_end" -KERNEL!="ttyUSB[0-9]*|ttyACM[0-9]*", GOTO="mlinux_end" - -SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}" -ENV{ID_IFACE}=="", GOTO="mlinux_end" - -# All modem ports -# H5 -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="00", SYMLINK+="modem0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="02", SYMLINK+="modem1" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="04", SYMLINK+="modem2" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="06", SYMLINK+="modem3" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="08", SYMLINK+="modem4" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="0a", SYMLINK+="modem5" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="0c", SYMLINK+="modem6" -# LAT3, LVW3 and LEU3 -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="00", SYMLINK+="modem0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="02", SYMLINK+="modem1" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="04", SYMLINK+="modem2" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="06", SYMLINK+="modem3" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="08", SYMLINK+="modem4" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="0a", SYMLINK+="modem5" -# EV3 -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="00", SYMLINK+="modem0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="01", SYMLINK+="modem1" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="02", SYMLINK+="modem2" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="03", SYMLINK+="modem3" -# H4 -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="00", SYMLINK+="modem0" -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="01", SYMLINK+="modem1" -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="02", SYMLINK+="modem2" -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="03", SYMLINK+="modem3" -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="04", SYMLINK+="modem4" -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="05", SYMLINK+="modem5" -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="06", SYMLINK+="modem6" -# EV2 -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="0028", SYMLINK+="modem$env{ID_PORT}" - -# AT Command ports -# H5: ttyACM0, ttyACM3 -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="06", SYMLINK+="modem_at1" -# LAT3, LVW3 and LEU3 -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="06", SYMLINK+="modem_at1" -# EV3: ttyUSB2, ttyUSB3 -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="02", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="03", SYMLINK+="modem_at1" -# H4: ttyUSB3, ttyUSB4, ttyUSB5 -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="03", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="04", SYMLINK+="modem_at1" -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="05", SYMLINK+="modem_at2" -# EV2: ttyUSB0 -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="0028", ENV{ID_PORT}=="0", SYMLINK+="modem_at0" -# LAT1, LEU1, LVW2: ttyUSB2, ttyUSB3 (port 04 and port 05) -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1201", ENV{ID_IFACE}=="04", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1201", ENV{ID_IFACE}=="05", SYMLINK+="modem_at1" -# LJP1(LE910-JN1), LNA3(LE910-NA1): ttyACM0, ttyACM3 (port 00 and port 03) -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="06", SYMLINK+="modem_at1" -# LJP1(LE866) ttyACM0, ttyACM2 -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="2300", ENV{ID_IFACE}=="02", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="2300", ENV{ID_IFACE}=="06", SYMLINK+="modem_at1" -# G3: ttyACM0, ttyACM1 -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0022", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0022", ENV{ID_IFACE}=="02", SYMLINK+="modem_at1" -# C2: ttyUSB0, ttyUSB1 (Telit Documentation: Modem Port = USB1, Aux Port = USB0) -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1011", ENV{ID_IFACE}=="01", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1011", ENV{ID_IFACE}=="00", SYMLINK+="modem_at1" -# CATM Telit ME910 -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1100", ENV{ID_IFACE}=="01", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1100", ENV{ID_IFACE}=="02", SYMLINK+="modem_at1" -# CATM Telit ME910 dual USB -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1101", ENV{ID_IFACE}=="01", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1101", ENV{ID_IFACE}=="02", SYMLINK+="modem_at1" - -# Quectel EG-95 -ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0195", ENV{ID_IFACE}=="02", SYMLINK+="modem_at0" -ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0195", ENV{ID_IFACE}=="03", SYMLINK+="modem_at1" - -LABEL="mlinux_end" diff --git a/eudev/init b/eudev/init deleted file mode 100644 index bd716b0..0000000 --- a/eudev/init +++ /dev/null @@ -1,138 +0,0 @@ -#!/bin/sh - -### BEGIN INIT INFO -# Provides: udev -# Required-Start: mountvirtfs -# Required-Stop: -# Default-Start: S -# Default-Stop: -# Short-Description: Start udevd, populate /dev and load drivers. -### END INIT INFO - -export TZ=/etc/localtime - -[ -d /sys/class ] || exit 1 -[ -r /proc/mounts ] || exit 1 -[ -x @UDEVD@ ] || exit 1 -[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache -[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf -[ -f /etc/default/rcS ] && . /etc/default/rcS - -readfiles () { - READDATA="" - for filename in $@; do - if [ -r $filename ]; then - while read line; do - READDATA="$READDATA$line" - done < $filename - fi - done -} - -kill_udevd () { - pid=`pidof -x udevd` - [ -n "$pid" ] && kill $pid -} - -case "$1" in - start) - export ACTION=add - # propagate /dev from /sys - echo "Starting udev" - - # Check for requireed devtmpfs before trying to start udev and - # mount a no-existant fs. - if ! grep -q devtmpfs /proc/filesystems - then - echo "Missing devtmpfs, which is required for udev to run"; - echo "Halting..." - halt - fi - # mount the devtmpfs on /dev, if not already done - LANG=C awk '$2 == "/dev" && ($3 == "devtmpfs") { exit 1 }' /proc/mounts && { - mount -n -o mode=0755 -t devtmpfs none "/dev" - } - [ -e /dev/pts ] || mkdir -m 0755 /dev/pts - [ -e /dev/shm ] || mkdir -m 1777 /dev/shm - # the automount rule for udev needs /tmp directory available, as /tmp is a symlink - # to /var/tmp which in turn is a symlink to /var/volatile/tmp, we need to make sure - # /var/volatile/tmp directory to be available. - mkdir -p /var/volatile/tmp - - # Cache handling. - # A list of files which are used as a criteria to judge whether the udev cache could be reused. - CMP_FILE_LIST="/proc/version /proc/cmdline /proc/devices /proc/atags" - if [ "$DEVCACHE" != "" ]; then - if [ -e $DEVCACHE ]; then - readfiles $CMP_FILE_LIST - NEWDATA="$READDATA" - readfiles /etc/udev/cache.data - OLDDATA="$READDATA" - if [ "$OLDDATA" = "$NEWDATA" ]; then - (cd /; tar xf $DEVCACHE > /dev/null 2>&1) - not_first_boot=1 - [ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE" - [ -e /dev/shm/udev.cache ] && rm -f /dev/shm/udev.cache - else - # Output detailed reason why the cached /dev is not used - if [ "$VERBOSE" != "no" ]; then - echo "udev: udev cache not used" - echo "udev: we use $CMP_FILE_LIST as criteria to judge whether the cache /dev could be resued" - echo "udev: olddata: $OLDDATA" - echo "udev: newdata: $NEWDATA" - fi - echo "$NEWDATA" > /dev/shm/udev.cache - fi - else - if [ "$ROOTFS_READ_ONLY" != "yes" ]; then - # If rootfs is not read-only, it's possible that a new udev cache would be generated; - # otherwise, we do not bother to read files. - readfiles $CMP_FILE_LIST - echo "$READDATA" > /dev/shm/udev.cache - fi - fi - fi - - # make_extra_nodes - kill_udevd > "/dev/null" 2>&1 - - # trigger the sorted events - echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug - @UDEVD@ -d - - udevadm control --env=STARTUP=1 - if [ "$not_first_boot" != "" ];then - if [ "$PROBE_PLATFORM_BUS" != "yes" ]; then - PLATFORM_BUS_NOMATCH="--subsystem-nomatch=platform" - else - PLATFORM_BUS_NOMATCH="" - fi - udevadm trigger --action=add --subsystem-nomatch=tty --subsystem-nomatch=mem --subsystem-nomatch=vc --subsystem-nomatch=vtconsole --subsystem-nomatch=misc --subsystem-nomatch=dcon --subsystem-nomatch=pci_bus --subsystem-nomatch=graphics --subsystem-nomatch=backlight --subsystem-nomatch=video4linux $PLATFORM_BUS_NOMATCH - (udevadm settle --timeout=10; udevadm control --env=STARTUP=)& - else - udevadm trigger --action=add - udevadm settle - fi - ;; - stop) - echo "Stopping udevd" - start-stop-daemon --stop --name udevd --quiet - ;; - restart) - $0 stop - sleep 1 - $0 start - ;; - status) - pid=`pidof -x udevd` - if [ -n "$pid" ]; then - echo "udevd (pid $pid) is running ..." - else - echo "udevd is stopped" - fi - ;; - *) - echo "Usage: $0 {start|stop|status|restart}" - exit 1 -esac -exit 0 diff --git a/eudev/mtcap/mtcap.rules b/eudev/mtcap/mtcap.rules deleted file mode 100644 index a0dc9fb..0000000 --- a/eudev/mtcap/mtcap.rules +++ /dev/null @@ -1,8 +0,0 @@ -ACTION=="remove", GOTO="mlinux_end" -SUBSYSTEM!="tty", GOTO="mlinux_end" -KERNEL!="ttyXRUSB[0-9]*", GOTO="mlinux_end" - -SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}" -ENV{ID_IFACE}=="", GOTO="mlinux_end" - -LABEL="mlinux_end" diff --git a/eudev/mtcdt/accessory_ethernet.rules b/eudev/mtcdt/accessory_ethernet.rules deleted file mode 100644 index 376486b..0000000 --- a/eudev/mtcdt/accessory_ethernet.rules +++ /dev/null @@ -1,21 +0,0 @@ -#To add new rule for new device you have to run (in case if you want to add eth1 interface) -#admin@mtcdt:~# udevadm info --attribute-walk --path=/sys/class/net/eth1 -# looking at device '/devices/ahb.0/700000.ehci/usb1/1-2/1-2.1/1-2.1.1/1-2.1.1:1.0/net/eth1': -# KERNEL=="eth1" -# SUBSYSTEM=="net" -# DRIVER=="" -# ATTR{mtu}=="1500" -# ATTR{type}=="1" -# ........... -# ........... - -# looking at parent device '/devices/ahb.0/700000.ehci/usb1/1-2/1-2.1/1-2.1.1/1-2.1.1:1.0': -# KERNELS=="1-2.1.1:1.0" <------------------- extract this record to add to the rule -# SUBSYSTEMS=="usb" -# DRIVERS=="smsc75xx" -# ATTRS{bInterfaceClass}=="ff" -# ATTRS{bInterfaceSubClass}=="00" -# ........... - -KERNELS=="1-2.1.1:1.0", SUBSYSTEMS=="usb", DRIVERS=="smsc75xx", NAME="eth1" -KERNELS=="1-2.1.2:1.0", SUBSYSTEMS=="usb", DRIVERS=="smsc75xx", NAME="eth2" diff --git a/eudev/mtcdt/mtcdt.rules b/eudev/mtcdt/mtcdt.rules deleted file mode 100644 index 5d528e6..0000000 --- a/eudev/mtcdt/mtcdt.rules +++ /dev/null @@ -1,14 +0,0 @@ -ACTION=="remove", GOTO="mlinux_end" -SUBSYSTEM!="tty", GOTO="mlinux_end" -KERNEL!="ttyXRUSB[0-9]*", GOTO="mlinux_end" - -SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}" -ENV{ID_IFACE}=="", GOTO="mlinux_end" - -# Accessory Ports -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="00", SYMLINK+="ttyAP1" -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="00", SYMLINK+="ttyAP1" -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="02", SYMLINK+="ttyAP2" -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1414", ENV{ID_IFACE}=="02", SYMLINK+="ttyAP2" - -LABEL="mlinux_end" diff --git a/eudev/mtr/mtr.rules b/eudev/mtr/mtr.rules deleted file mode 100644 index 239a846..0000000 --- a/eudev/mtr/mtr.rules +++ /dev/null @@ -1,13 +0,0 @@ -ACTION=="remove", GOTO="mlinux_end" -SUBSYSTEM!="tty", GOTO="mlinux_end" -KERNEL!="ttyUSB[0-9]*|ttyACM[0-9]*|ttyXRUSB[0-9]*|ttyS*", GOTO="mlinux_end" - -SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}" -ENV{ID_IFACE}=="", GOTO="mlinux_end" - -# mtr revA: bluetooth on exar chip (ACM0, iface 0) -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="00", SYMLINK+="bt" -# mtr revA: external serial on exar chip (ACM1, iface 2) -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="02", SYMLINK+="ext_serial" - -LABEL="mlinux_end" diff --git a/eudev/mtrv1/mtrv1.rules b/eudev/mtrv1/mtrv1.rules deleted file mode 100644 index 239a846..0000000 --- a/eudev/mtrv1/mtrv1.rules +++ /dev/null @@ -1,13 +0,0 @@ -ACTION=="remove", GOTO="mlinux_end" -SUBSYSTEM!="tty", GOTO="mlinux_end" -KERNEL!="ttyUSB[0-9]*|ttyACM[0-9]*|ttyXRUSB[0-9]*|ttyS*", GOTO="mlinux_end" - -SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}" -ENV{ID_IFACE}=="", GOTO="mlinux_end" - -# mtr revA: bluetooth on exar chip (ACM0, iface 0) -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="00", SYMLINK+="bt" -# mtr revA: external serial on exar chip (ACM1, iface 2) -ATTRS{idVendor}=="04e2", ATTRS{idProduct}=="1412", ENV{ID_IFACE}=="02", SYMLINK+="ext_serial" - -LABEL="mlinux_end" diff --git a/eudev/udev-cache.default b/eudev/udev-cache.default deleted file mode 100644 index b1aa63f..0000000 --- a/eudev/udev-cache.default +++ /dev/null @@ -1,5 +0,0 @@ -# Default for /etc/init.d/udev - -# Comment this out to disable device cache -#DEVCACHE="/etc/dev.tar" -PROBE_PLATFORM_BUS="yes" diff --git a/eudev_%.bbappend b/eudev_%.bbappend deleted file mode 100644 index cde2f10..0000000 --- a/eudev_%.bbappend +++ /dev/null @@ -1,21 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:" - -PR .= ".mlinux4" - -# add custom rules for persistent modem device names -SRC_URI += " file://cellular_radios.rules \ - file://${MACHINE}.rules \ - " -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" - -SRC_URI_append_mtcdt = " file://accessory_ethernet.rules \ - " - -do_install_append() { - install -m 644 ${WORKDIR}/cellular_radios.rules ${D}${sysconfdir}/udev/rules.d/ - install -m 644 ${WORKDIR}/${MACHINE}.rules ${D}${sysconfdir}/udev/rules.d/ -} - -do_install_append_mtcdt() { - install -m 644 ${WORKDIR}/accessory_ethernet.rules ${D}${sysconfdir}/udev/rules.d/ -} diff --git a/udev-extraconf/automount.rules b/udev-extraconf/automount.rules deleted file mode 100644 index b4a8f22..0000000 --- a/udev-extraconf/automount.rules +++ /dev/null @@ -1,24 +0,0 @@ -# There are a number of modifiers that are allowed to be used in some -# of the different fields. They provide the following subsitutions: -# -# %n the "kernel number" of the device. -# For example, 'sda3' has a "kernel number" of '3' -# %e the smallest number for that name which does not matches an existing node -# %k the kernel name for the device -# %M the kernel major number for the device -# %m the kernel minor number for the device -# %b the bus id for the device -# %c the string returned by the PROGRAM -# %s{filename} the content of a sysfs attribute -# %% the '%' char itself -# - -SUBSYSTEM!="block", GOTO="automount_end" -# only mount SD cards and mass storage devices -KERNEL!="sd[a-z][0-9]*|mmcblk[0-9]p[0-9]*", GOTO="automount_end" - -# Media automounting -SUBSYSTEM=="block", ACTION=="add" RUN+="/etc/udev/scripts/mount.sh" -SUBSYSTEM=="block", ACTION=="remove" RUN+="/etc/udev/scripts/mount.sh" - -LABEL="automount_end" diff --git a/udev-extraconf/mount.patch b/udev-extraconf/mount.patch deleted file mode 100644 index 1b475f3..0000000 --- a/udev-extraconf/mount.patch +++ /dev/null @@ -1,81 +0,0 @@ -diff -Naru orig/mount.blacklist new/mount.blacklist ---- orig/mount.blacklist 2019-10-24 17:08:59.796796272 -0500 -+++ new/mount.blacklist 2019-10-24 17:16:31.768782892 -0500 -@@ -3,3 +3,16 @@ - /dev/mtdblock - /dev/md - /dev/dm-* -+# These should all be mounted in fstab or not at all. -+[PARTLABEL=uboot] -+[PARTLABEL=root] -+[PARTLABEL=root1] -+[PARTLABEL=root2] -+[PARTLABEL=uboot] -+[PARTLABEL=oem] -+[PARTLABEL=oem1] -+[PARTLABEL=oem2] -+[PARTLABEL=config] -+[PARTLABEL=config1] -+[PARTLABEL=config2] -+[PARTLABEL=user_data] -diff -Naru orig/mount.sh new/mount.sh ---- orig/mount.sh 2019-10-24 17:09:11.344795931 -0500 -+++ new/mount.sh 2019-10-24 18:11:38.612684994 -0500 -@@ -25,9 +25,32 @@ - fi - - PMOUNT="/usr/bin/pmount" -- --for line in `grep -h -v ^# /etc/udev/mount.blacklist /etc/udev/mount.blacklist.d/*` -+for line in `grep -h -v '^#$' /etc/udev/mount.blacklist /etc/udev/mount.blacklist.d/* 2>/dev/null` - do -+ if [[ $line =~ ^\[([^=]*)=([^\]]*)\] ]] ; then -+ fsspectype=${BASH_REMATCH[1]} -+ tmp="$(lsblk -o $fsspectype $DEVNAME | sed -e '1d')" -+ case $fsspectype in -+ PARTLABEL) -+ if [[ ${BASH_REMATCH[2]} == $tmp ]] ; then -+ logger "udev/mount.sh $DEVNAME is blacklisted, ignoring" -+ logger "$line" -+ exit 0 -+ fi -+ ;; -+ -+ PARTUUID) -+ if [[ ${BASH_REMATCH[2]^^} == $tmp ]] ; then -+ logger "udev/mount.sh $DEVNAME is blacklisted, ignoring" -+ logger "$line" -+ exit 0 -+ fi -+ ;; -+ *) -+ logger "[$fsspectype] is unsupported in blacklist -- ignoring blacklist item" -+ ;; -+ esac -+ fi - if [ ` expr match "$DEVNAME" "$line" ` -gt 0 ]; - then - logger "udev/mount.sh" "[$DEVNAME] is blacklisted, ignoring" -@@ -49,6 +72,10 @@ - - [ -d "/run/media/$name" ] || mkdir -p "/run/media/$name" - -+ if [ "$name" = mmcblk0p1 ] ; then -+ ln -sf /run/media/$name /run/media/card -+ fi -+ - MOUNT="$MOUNT -o silent" - - # If filesystemtype is vfat, change the ownership group to 'disk', and -@@ -78,7 +105,11 @@ - if [ -x "$PMOUNT" ]; then - $PMOUNT $DEVNAME 2> /dev/null - elif [ -x $MOUNT ]; then -+ if [[ $ID_FS_TYPE =~ fat ]] ; then -+ $MOUNT -o umask=002,gid=disk $DEVNAME 2> /dev/null -+ else - $MOUNT $DEVNAME 2> /dev/null -+ fi - fi - - # If the device isn't mounted at this point, it isn't diff --git a/udev-extraconf_%.bbappend b/udev-extraconf_%.bbappend deleted file mode 100644 index 708a07c..0000000 --- a/udev-extraconf_%.bbappend +++ /dev/null @@ -1,5 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" - -PR = "m1" - -SRC_URI += "file://mount.patch" -- cgit v1.2.3 From ba4838783d5d2fc0d499652ef58bf25f8c41d84b Mon Sep 17 00:00:00 2001 From: Andrii Pientsov Date: Mon, 15 Jun 2020 16:41:27 +0300 Subject: Refactoring udev rules. --- eudev/cellular_radios.rules | 82 ++++++++++++++++++++++++ eudev/init | 138 +++++++++++++++++++++++++++++++++++++++++ eudev/udev-cache.default | 5 ++ eudev_%.bbappend | 14 +++++ udev-extraconf/automount.rules | 24 +++++++ udev-extraconf/mount.patch | 81 ++++++++++++++++++++++++ udev-extraconf_%.bbappend | 5 ++ 7 files changed, 349 insertions(+) create mode 100644 eudev/cellular_radios.rules create mode 100644 eudev/init create mode 100644 eudev/udev-cache.default create mode 100644 eudev_%.bbappend create mode 100644 udev-extraconf/automount.rules create mode 100644 udev-extraconf/mount.patch create mode 100644 udev-extraconf_%.bbappend diff --git a/eudev/cellular_radios.rules b/eudev/cellular_radios.rules new file mode 100644 index 0000000..078f710 --- /dev/null +++ b/eudev/cellular_radios.rules @@ -0,0 +1,82 @@ +ACTION=="remove", GOTO="mlinux_end" +SUBSYSTEM!="tty", GOTO="mlinux_end" +KERNEL!="ttyUSB[0-9]*|ttyACM[0-9]*", GOTO="mlinux_end" + +SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}" +ENV{ID_IFACE}=="", GOTO="mlinux_end" + +# All modem ports +# H5 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="00", SYMLINK+="modem0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="02", SYMLINK+="modem1" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="04", SYMLINK+="modem2" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="06", SYMLINK+="modem3" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="08", SYMLINK+="modem4" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="0a", SYMLINK+="modem5" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="0c", SYMLINK+="modem6" +# LAT3, LVW3 and LEU3 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="00", SYMLINK+="modem0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="02", SYMLINK+="modem1" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="04", SYMLINK+="modem2" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="06", SYMLINK+="modem3" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="08", SYMLINK+="modem4" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="0a", SYMLINK+="modem5" +# EV3 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="00", SYMLINK+="modem0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="01", SYMLINK+="modem1" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="02", SYMLINK+="modem2" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="03", SYMLINK+="modem3" +# H4 +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="00", SYMLINK+="modem0" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="01", SYMLINK+="modem1" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="02", SYMLINK+="modem2" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="03", SYMLINK+="modem3" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="04", SYMLINK+="modem4" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="05", SYMLINK+="modem5" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="06", SYMLINK+="modem6" +# EV2 +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="0028", SYMLINK+="modem$env{ID_PORT}" + +# AT Command ports +# H5: ttyACM0, ttyACM3 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="06", SYMLINK+="modem_at1" +# LAT3, LVW3 and LEU3 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="06", SYMLINK+="modem_at1" +# EV3: ttyUSB2, ttyUSB3 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="02", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="03", SYMLINK+="modem_at1" +# H4: ttyUSB3, ttyUSB4, ttyUSB5 +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="03", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="04", SYMLINK+="modem_at1" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="05", SYMLINK+="modem_at2" +# EV2: ttyUSB0 +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="0028", ENV{ID_PORT}=="0", SYMLINK+="modem_at0" +# LAT1, LEU1, LVW2: ttyUSB2, ttyUSB3 (port 04 and port 05) +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1201", ENV{ID_IFACE}=="04", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1201", ENV{ID_IFACE}=="05", SYMLINK+="modem_at1" +# LJP1(LE910-JN1), LNA3(LE910-NA1): ttyACM0, ttyACM3 (port 00 and port 03) +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="06", SYMLINK+="modem_at1" +# LJP1(LE866) ttyACM0, ttyACM2 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="2300", ENV{ID_IFACE}=="02", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="2300", ENV{ID_IFACE}=="06", SYMLINK+="modem_at1" +# G3: ttyACM0, ttyACM1 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0022", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0022", ENV{ID_IFACE}=="02", SYMLINK+="modem_at1" +# C2: ttyUSB0, ttyUSB1 (Telit Documentation: Modem Port = USB1, Aux Port = USB0) +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1011", ENV{ID_IFACE}=="01", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1011", ENV{ID_IFACE}=="00", SYMLINK+="modem_at1" +# CATM Telit ME910 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1100", ENV{ID_IFACE}=="01", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1100", ENV{ID_IFACE}=="02", SYMLINK+="modem_at1" +# CATM Telit ME910 dual USB +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1101", ENV{ID_IFACE}=="01", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1101", ENV{ID_IFACE}=="02", SYMLINK+="modem_at1" + +# Quectel EG-95 +ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0195", ENV{ID_IFACE}=="02", SYMLINK+="modem_at0" +ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0195", ENV{ID_IFACE}=="03", SYMLINK+="modem_at1" + +LABEL="mlinux_end" diff --git a/eudev/init b/eudev/init new file mode 100644 index 0000000..bd716b0 --- /dev/null +++ b/eudev/init @@ -0,0 +1,138 @@ +#!/bin/sh + +### BEGIN INIT INFO +# Provides: udev +# Required-Start: mountvirtfs +# Required-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Start udevd, populate /dev and load drivers. +### END INIT INFO + +export TZ=/etc/localtime + +[ -d /sys/class ] || exit 1 +[ -r /proc/mounts ] || exit 1 +[ -x @UDEVD@ ] || exit 1 +[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache +[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf +[ -f /etc/default/rcS ] && . /etc/default/rcS + +readfiles () { + READDATA="" + for filename in $@; do + if [ -r $filename ]; then + while read line; do + READDATA="$READDATA$line" + done < $filename + fi + done +} + +kill_udevd () { + pid=`pidof -x udevd` + [ -n "$pid" ] && kill $pid +} + +case "$1" in + start) + export ACTION=add + # propagate /dev from /sys + echo "Starting udev" + + # Check for requireed devtmpfs before trying to start udev and + # mount a no-existant fs. + if ! grep -q devtmpfs /proc/filesystems + then + echo "Missing devtmpfs, which is required for udev to run"; + echo "Halting..." + halt + fi + # mount the devtmpfs on /dev, if not already done + LANG=C awk '$2 == "/dev" && ($3 == "devtmpfs") { exit 1 }' /proc/mounts && { + mount -n -o mode=0755 -t devtmpfs none "/dev" + } + [ -e /dev/pts ] || mkdir -m 0755 /dev/pts + [ -e /dev/shm ] || mkdir -m 1777 /dev/shm + # the automount rule for udev needs /tmp directory available, as /tmp is a symlink + # to /var/tmp which in turn is a symlink to /var/volatile/tmp, we need to make sure + # /var/volatile/tmp directory to be available. + mkdir -p /var/volatile/tmp + + # Cache handling. + # A list of files which are used as a criteria to judge whether the udev cache could be reused. + CMP_FILE_LIST="/proc/version /proc/cmdline /proc/devices /proc/atags" + if [ "$DEVCACHE" != "" ]; then + if [ -e $DEVCACHE ]; then + readfiles $CMP_FILE_LIST + NEWDATA="$READDATA" + readfiles /etc/udev/cache.data + OLDDATA="$READDATA" + if [ "$OLDDATA" = "$NEWDATA" ]; then + (cd /; tar xf $DEVCACHE > /dev/null 2>&1) + not_first_boot=1 + [ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE" + [ -e /dev/shm/udev.cache ] && rm -f /dev/shm/udev.cache + else + # Output detailed reason why the cached /dev is not used + if [ "$VERBOSE" != "no" ]; then + echo "udev: udev cache not used" + echo "udev: we use $CMP_FILE_LIST as criteria to judge whether the cache /dev could be resued" + echo "udev: olddata: $OLDDATA" + echo "udev: newdata: $NEWDATA" + fi + echo "$NEWDATA" > /dev/shm/udev.cache + fi + else + if [ "$ROOTFS_READ_ONLY" != "yes" ]; then + # If rootfs is not read-only, it's possible that a new udev cache would be generated; + # otherwise, we do not bother to read files. + readfiles $CMP_FILE_LIST + echo "$READDATA" > /dev/shm/udev.cache + fi + fi + fi + + # make_extra_nodes + kill_udevd > "/dev/null" 2>&1 + + # trigger the sorted events + echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug + @UDEVD@ -d + + udevadm control --env=STARTUP=1 + if [ "$not_first_boot" != "" ];then + if [ "$PROBE_PLATFORM_BUS" != "yes" ]; then + PLATFORM_BUS_NOMATCH="--subsystem-nomatch=platform" + else + PLATFORM_BUS_NOMATCH="" + fi + udevadm trigger --action=add --subsystem-nomatch=tty --subsystem-nomatch=mem --subsystem-nomatch=vc --subsystem-nomatch=vtconsole --subsystem-nomatch=misc --subsystem-nomatch=dcon --subsystem-nomatch=pci_bus --subsystem-nomatch=graphics --subsystem-nomatch=backlight --subsystem-nomatch=video4linux $PLATFORM_BUS_NOMATCH + (udevadm settle --timeout=10; udevadm control --env=STARTUP=)& + else + udevadm trigger --action=add + udevadm settle + fi + ;; + stop) + echo "Stopping udevd" + start-stop-daemon --stop --name udevd --quiet + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + status) + pid=`pidof -x udevd` + if [ -n "$pid" ]; then + echo "udevd (pid $pid) is running ..." + else + echo "udevd is stopped" + fi + ;; + *) + echo "Usage: $0 {start|stop|status|restart}" + exit 1 +esac +exit 0 diff --git a/eudev/udev-cache.default b/eudev/udev-cache.default new file mode 100644 index 0000000..b1aa63f --- /dev/null +++ b/eudev/udev-cache.default @@ -0,0 +1,5 @@ +# Default for /etc/init.d/udev + +# Comment this out to disable device cache +#DEVCACHE="/etc/dev.tar" +PROBE_PLATFORM_BUS="yes" diff --git a/eudev_%.bbappend b/eudev_%.bbappend new file mode 100644 index 0000000..26bcceb --- /dev/null +++ b/eudev_%.bbappend @@ -0,0 +1,14 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +PR .= ".mlinux6" + +# add custom rules for persistent modem device names +SRC_URI += "file://cellular_radios.rules \ + file://${MACHINE}.rules" + +do_install_append() { + install -m 644 ${WORKDIR}/cellular_radios.rules ${D}${sysconfdir}/udev/rules.d/ + install -m 644 ${WORKDIR}/${MACHINE}.rules ${D}${sysconfdir}/udev/rules.d/ +} + + diff --git a/udev-extraconf/automount.rules b/udev-extraconf/automount.rules new file mode 100644 index 0000000..b4a8f22 --- /dev/null +++ b/udev-extraconf/automount.rules @@ -0,0 +1,24 @@ +# There are a number of modifiers that are allowed to be used in some +# of the different fields. They provide the following subsitutions: +# +# %n the "kernel number" of the device. +# For example, 'sda3' has a "kernel number" of '3' +# %e the smallest number for that name which does not matches an existing node +# %k the kernel name for the device +# %M the kernel major number for the device +# %m the kernel minor number for the device +# %b the bus id for the device +# %c the string returned by the PROGRAM +# %s{filename} the content of a sysfs attribute +# %% the '%' char itself +# + +SUBSYSTEM!="block", GOTO="automount_end" +# only mount SD cards and mass storage devices +KERNEL!="sd[a-z][0-9]*|mmcblk[0-9]p[0-9]*", GOTO="automount_end" + +# Media automounting +SUBSYSTEM=="block", ACTION=="add" RUN+="/etc/udev/scripts/mount.sh" +SUBSYSTEM=="block", ACTION=="remove" RUN+="/etc/udev/scripts/mount.sh" + +LABEL="automount_end" diff --git a/udev-extraconf/mount.patch b/udev-extraconf/mount.patch new file mode 100644 index 0000000..1b475f3 --- /dev/null +++ b/udev-extraconf/mount.patch @@ -0,0 +1,81 @@ +diff -Naru orig/mount.blacklist new/mount.blacklist +--- orig/mount.blacklist 2019-10-24 17:08:59.796796272 -0500 ++++ new/mount.blacklist 2019-10-24 17:16:31.768782892 -0500 +@@ -3,3 +3,16 @@ + /dev/mtdblock + /dev/md + /dev/dm-* ++# These should all be mounted in fstab or not at all. ++[PARTLABEL=uboot] ++[PARTLABEL=root] ++[PARTLABEL=root1] ++[PARTLABEL=root2] ++[PARTLABEL=uboot] ++[PARTLABEL=oem] ++[PARTLABEL=oem1] ++[PARTLABEL=oem2] ++[PARTLABEL=config] ++[PARTLABEL=config1] ++[PARTLABEL=config2] ++[PARTLABEL=user_data] +diff -Naru orig/mount.sh new/mount.sh +--- orig/mount.sh 2019-10-24 17:09:11.344795931 -0500 ++++ new/mount.sh 2019-10-24 18:11:38.612684994 -0500 +@@ -25,9 +25,32 @@ + fi + + PMOUNT="/usr/bin/pmount" +- +-for line in `grep -h -v ^# /etc/udev/mount.blacklist /etc/udev/mount.blacklist.d/*` ++for line in `grep -h -v '^#$' /etc/udev/mount.blacklist /etc/udev/mount.blacklist.d/* 2>/dev/null` + do ++ if [[ $line =~ ^\[([^=]*)=([^\]]*)\] ]] ; then ++ fsspectype=${BASH_REMATCH[1]} ++ tmp="$(lsblk -o $fsspectype $DEVNAME | sed -e '1d')" ++ case $fsspectype in ++ PARTLABEL) ++ if [[ ${BASH_REMATCH[2]} == $tmp ]] ; then ++ logger "udev/mount.sh $DEVNAME is blacklisted, ignoring" ++ logger "$line" ++ exit 0 ++ fi ++ ;; ++ ++ PARTUUID) ++ if [[ ${BASH_REMATCH[2]^^} == $tmp ]] ; then ++ logger "udev/mount.sh $DEVNAME is blacklisted, ignoring" ++ logger "$line" ++ exit 0 ++ fi ++ ;; ++ *) ++ logger "[$fsspectype] is unsupported in blacklist -- ignoring blacklist item" ++ ;; ++ esac ++ fi + if [ ` expr match "$DEVNAME" "$line" ` -gt 0 ]; + then + logger "udev/mount.sh" "[$DEVNAME] is blacklisted, ignoring" +@@ -49,6 +72,10 @@ + + [ -d "/run/media/$name" ] || mkdir -p "/run/media/$name" + ++ if [ "$name" = mmcblk0p1 ] ; then ++ ln -sf /run/media/$name /run/media/card ++ fi ++ + MOUNT="$MOUNT -o silent" + + # If filesystemtype is vfat, change the ownership group to 'disk', and +@@ -78,7 +105,11 @@ + if [ -x "$PMOUNT" ]; then + $PMOUNT $DEVNAME 2> /dev/null + elif [ -x $MOUNT ]; then ++ if [[ $ID_FS_TYPE =~ fat ]] ; then ++ $MOUNT -o umask=002,gid=disk $DEVNAME 2> /dev/null ++ else + $MOUNT $DEVNAME 2> /dev/null ++ fi + fi + + # If the device isn't mounted at this point, it isn't diff --git a/udev-extraconf_%.bbappend b/udev-extraconf_%.bbappend new file mode 100644 index 0000000..708a07c --- /dev/null +++ b/udev-extraconf_%.bbappend @@ -0,0 +1,5 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +PR = "m1" + +SRC_URI += "file://mount.patch" -- cgit v1.2.3 From 516489c29582dcdc0915507f078686ef6fe6172b Mon Sep 17 00:00:00 2001 From: Andrii Pientsov Date: Mon, 15 Jun 2020 16:56:18 +0300 Subject: Refactoring udev rules. --- eudev/cellular_radios.rules | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eudev/cellular_radios.rules b/eudev/cellular_radios.rules index 078f710..d7c0521 100644 --- a/eudev/cellular_radios.rules +++ b/eudev/cellular_radios.rules @@ -79,4 +79,8 @@ ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1101", ENV{ID_IFACE}=="02", SYMLINK+ ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0195", ENV{ID_IFACE}=="02", SYMLINK+="modem_at0" ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0195", ENV{ID_IFACE}=="03", SYMLINK+="modem_at1" +# Quectel EG-25 +ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", ENV{ID_IFACE}=="02", SYMLINK+="modem_at0" +ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", ENV{ID_IFACE}=="03", SYMLINK+="modem_at1" + LABEL="mlinux_end" -- cgit v1.2.3 From 5d805ae34e4039a94ba4a0ab888960a257d5a151 Mon Sep 17 00:00:00 2001 From: John Klug Date: Wed, 9 Sep 2020 15:10:57 -0500 Subject: Fix umountfs /media/card link and mounting flash with errors --- udev-extraconf/mount.patch | 69 +++++++++++++++++++++++++++++++++++++++++----- udev-extraconf_%.bbappend | 2 +- 2 files changed, 63 insertions(+), 8 deletions(-) diff --git a/udev-extraconf/mount.patch b/udev-extraconf/mount.patch index 1b475f3..4ed3bfd 100644 --- a/udev-extraconf/mount.patch +++ b/udev-extraconf/mount.patch @@ -19,10 +19,27 @@ diff -Naru orig/mount.blacklist new/mount.blacklist +[PARTLABEL=config2] +[PARTLABEL=user_data] diff -Naru orig/mount.sh new/mount.sh ---- orig/mount.sh 2019-10-24 17:09:11.344795931 -0500 -+++ new/mount.sh 2019-10-24 18:11:38.612684994 -0500 -@@ -25,9 +25,32 @@ +--- orig/mount.sh 2020-09-09 13:57:23.196157483 -0500 ++++ new/mount.sh 2020-09-09 14:59:40.344046845 -0500 +@@ -4,8 +4,8 @@ + # + # Attempt to mount any added block devices and umount any removed devices + +-BASE_INIT="`readlink -f "@base_sbindir@/init"`" +-INIT_SYSTEMD="@systemd_unitdir@/systemd" ++BASE_INIT="`readlink -f "/sbin/init"`" ++INIT_SYSTEMD="/lib/systemd/systemd" + + if [ "x$BASE_INIT" = "x$INIT_SYSTEMD" ];then + # systemd as init uses systemd-mount to mount block devices +@@ -23,11 +23,38 @@ + MOUNT="/bin/mount" + UMOUNT="/bin/umount" fi ++LSBLK=$(type -p lsblk) ++if ((${#LSBLK} == 0)) ; then ++ LSBLK=true ++fi PMOUNT="/usr/bin/pmount" - @@ -31,7 +48,7 @@ diff -Naru orig/mount.sh new/mount.sh do + if [[ $line =~ ^\[([^=]*)=([^\]]*)\] ]] ; then + fsspectype=${BASH_REMATCH[1]} -+ tmp="$(lsblk -o $fsspectype $DEVNAME | sed -e '1d')" ++ tmp="$(${LSBLK} -o $fsspectype $DEVNAME | sed -e '1d')" + case $fsspectype in + PARTLABEL) + if [[ ${BASH_REMATCH[2]} == $tmp ]] ; then @@ -56,18 +73,35 @@ diff -Naru orig/mount.sh new/mount.sh if [ ` expr match "$DEVNAME" "$line" ` -gt 0 ]; then logger "udev/mount.sh" "[$DEVNAME] is blacklisted, ignoring" -@@ -49,6 +72,10 @@ +@@ -41,7 +68,7 @@ + # Skip the partition which are already in /etc/fstab + grep "^[[:space:]]*$DEVNAME" /etc/fstab && return + for n in LABEL PARTLABEL UUID PARTUUID; do +- tmp="$(lsblk -o $n $DEVNAME | sed -e '1d')" ++ tmp="$($LSBLK -o $n $DEVNAME | sed -e '1d')" + test -z "$tmp" && continue + tmp="$n=$tmp" + grep "^[[:space:]]*$tmp" /etc/fstab && return +@@ -49,13 +76,17 @@ [ -d "/run/media/$name" ] || mkdir -p "/run/media/$name" + if [ "$name" = mmcblk0p1 ] ; then + ln -sf /run/media/$name /run/media/card + fi -+ ++ MOUNT="$MOUNT -o silent" # If filesystemtype is vfat, change the ownership group to 'disk', and -@@ -78,7 +105,11 @@ + # grant it with w/r/x permissions. + case $ID_FS_TYPE in + vfat|fat) +- MOUNT="$MOUNT -o umask=007,gid=`awk -F':' '/^disk/{print $3}' /etc/group`" ++ MOUNT="$MOUNT -o errors=continue -o umask=007,gid=`awk -F':' '/^disk/{print $3}' /etc/group`" + ;; + # TODO + *) +@@ -78,7 +109,11 @@ if [ -x "$PMOUNT" ]; then $PMOUNT $DEVNAME 2> /dev/null elif [ -x $MOUNT ]; then @@ -79,3 +113,24 @@ diff -Naru orig/mount.sh new/mount.sh fi # If the device isn't mounted at this point, it isn't +@@ -86,6 +121,11 @@ + grep -q "^$DEVNAME " /proc/mounts && return + + ! test -d "/run/media/$name" && mkdir -p "/run/media/$name" ++ ++ if [ "$name" = mmcblk0p1 ] ; then ++ ln -sf /run/media/$name /run/media/card ++ fi ++ + # Silent util-linux's version of mounting auto + if [ "x`readlink $MOUNT`" = "x/bin/mount.util-linux" ] ; + then +@@ -96,7 +136,7 @@ + # grant it with w/r/x permissions. + case $ID_FS_TYPE in + vfat|fat) +- MOUNT="$MOUNT -o umask=007,gid=`awk -F':' '/^disk/{print $3}' /etc/group`" ++ MOUNT="$MOUNT -o errors=continue -o umask=007,gid=`awk -F':' '/^disk/{print $3}' /etc/group`" + ;; + # TODO + *) diff --git a/udev-extraconf_%.bbappend b/udev-extraconf_%.bbappend index 708a07c..3a39025 100644 --- a/udev-extraconf_%.bbappend +++ b/udev-extraconf_%.bbappend @@ -1,5 +1,5 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" -PR = "m1" +PR = "m2" SRC_URI += "file://mount.patch" -- cgit v1.2.3 From 9988876415698d5677eb9a2dc3ed934d8e3d3033 Mon Sep 17 00:00:00 2001 From: Vyacheslav Pedash Date: Tue, 26 Jan 2021 23:37:37 +0200 Subject: MTX-3787 Create /var/volatile/tmp direrctory with proper permissions --- eudev/init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eudev/init b/eudev/init index bd716b0..d941401 100644 --- a/eudev/init +++ b/eudev/init @@ -57,7 +57,7 @@ case "$1" in # the automount rule for udev needs /tmp directory available, as /tmp is a symlink # to /var/tmp which in turn is a symlink to /var/volatile/tmp, we need to make sure # /var/volatile/tmp directory to be available. - mkdir -p /var/volatile/tmp + mkdir -m 1777 -p /var/volatile/tmp # Cache handling. # A list of files which are used as a criteria to judge whether the udev cache could be reused. -- cgit v1.2.3 From 44f023414408ce4aaa0bdc8cd0b4ed23d4d65e77 Mon Sep 17 00:00:00 2001 From: John Klug Date: Thu, 15 Jul 2021 14:39:10 -0500 Subject: Clone eudev from meta-mlinux --- eudev/cellular_radios.rules | 86 -------------- eudev/init | 138 ----------------------- eudev/udev-cache.default | 5 - eudev_%.bbappend | 14 --- recipes-core/udev/eudev/cellular_radios.rules | 86 ++++++++++++++ recipes-core/udev/eudev/init | 138 +++++++++++++++++++++++ recipes-core/udev/eudev/udev-cache.default | 5 + recipes-core/udev/eudev_%.bbappend | 14 +++ recipes-core/udev/udev-extraconf/automount.rules | 24 ++++ recipes-core/udev/udev-extraconf/mount.patch | 136 ++++++++++++++++++++++ recipes-core/udev/udev-extraconf_%.bbappend | 5 + udev-extraconf/automount.rules | 24 ---- udev-extraconf/mount.patch | 136 ---------------------- udev-extraconf_%.bbappend | 5 - 14 files changed, 408 insertions(+), 408 deletions(-) delete mode 100644 eudev/cellular_radios.rules delete mode 100644 eudev/init delete mode 100644 eudev/udev-cache.default delete mode 100644 eudev_%.bbappend create mode 100644 recipes-core/udev/eudev/cellular_radios.rules create mode 100644 recipes-core/udev/eudev/init create mode 100644 recipes-core/udev/eudev/udev-cache.default create mode 100644 recipes-core/udev/eudev_%.bbappend create mode 100644 recipes-core/udev/udev-extraconf/automount.rules create mode 100644 recipes-core/udev/udev-extraconf/mount.patch create mode 100644 recipes-core/udev/udev-extraconf_%.bbappend delete mode 100644 udev-extraconf/automount.rules delete mode 100644 udev-extraconf/mount.patch delete mode 100644 udev-extraconf_%.bbappend diff --git a/eudev/cellular_radios.rules b/eudev/cellular_radios.rules deleted file mode 100644 index d7c0521..0000000 --- a/eudev/cellular_radios.rules +++ /dev/null @@ -1,86 +0,0 @@ -ACTION=="remove", GOTO="mlinux_end" -SUBSYSTEM!="tty", GOTO="mlinux_end" -KERNEL!="ttyUSB[0-9]*|ttyACM[0-9]*", GOTO="mlinux_end" - -SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}" -ENV{ID_IFACE}=="", GOTO="mlinux_end" - -# All modem ports -# H5 -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="00", SYMLINK+="modem0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="02", SYMLINK+="modem1" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="04", SYMLINK+="modem2" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="06", SYMLINK+="modem3" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="08", SYMLINK+="modem4" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="0a", SYMLINK+="modem5" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="0c", SYMLINK+="modem6" -# LAT3, LVW3 and LEU3 -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="00", SYMLINK+="modem0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="02", SYMLINK+="modem1" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="04", SYMLINK+="modem2" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="06", SYMLINK+="modem3" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="08", SYMLINK+="modem4" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="0a", SYMLINK+="modem5" -# EV3 -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="00", SYMLINK+="modem0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="01", SYMLINK+="modem1" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="02", SYMLINK+="modem2" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="03", SYMLINK+="modem3" -# H4 -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="00", SYMLINK+="modem0" -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="01", SYMLINK+="modem1" -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="02", SYMLINK+="modem2" -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="03", SYMLINK+="modem3" -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="04", SYMLINK+="modem4" -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="05", SYMLINK+="modem5" -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="06", SYMLINK+="modem6" -# EV2 -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="0028", SYMLINK+="modem$env{ID_PORT}" - -# AT Command ports -# H5: ttyACM0, ttyACM3 -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="06", SYMLINK+="modem_at1" -# LAT3, LVW3 and LEU3 -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="06", SYMLINK+="modem_at1" -# EV3: ttyUSB2, ttyUSB3 -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="02", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="03", SYMLINK+="modem_at1" -# H4: ttyUSB3, ttyUSB4, ttyUSB5 -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="03", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="04", SYMLINK+="modem_at1" -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="05", SYMLINK+="modem_at2" -# EV2: ttyUSB0 -ATTRS{idVendor}=="1199", ATTRS{idProduct}=="0028", ENV{ID_PORT}=="0", SYMLINK+="modem_at0" -# LAT1, LEU1, LVW2: ttyUSB2, ttyUSB3 (port 04 and port 05) -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1201", ENV{ID_IFACE}=="04", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1201", ENV{ID_IFACE}=="05", SYMLINK+="modem_at1" -# LJP1(LE910-JN1), LNA3(LE910-NA1): ttyACM0, ttyACM3 (port 00 and port 03) -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="06", SYMLINK+="modem_at1" -# LJP1(LE866) ttyACM0, ttyACM2 -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="2300", ENV{ID_IFACE}=="02", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="2300", ENV{ID_IFACE}=="06", SYMLINK+="modem_at1" -# G3: ttyACM0, ttyACM1 -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0022", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0022", ENV{ID_IFACE}=="02", SYMLINK+="modem_at1" -# C2: ttyUSB0, ttyUSB1 (Telit Documentation: Modem Port = USB1, Aux Port = USB0) -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1011", ENV{ID_IFACE}=="01", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1011", ENV{ID_IFACE}=="00", SYMLINK+="modem_at1" -# CATM Telit ME910 -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1100", ENV{ID_IFACE}=="01", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1100", ENV{ID_IFACE}=="02", SYMLINK+="modem_at1" -# CATM Telit ME910 dual USB -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1101", ENV{ID_IFACE}=="01", SYMLINK+="modem_at0" -ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1101", ENV{ID_IFACE}=="02", SYMLINK+="modem_at1" - -# Quectel EG-95 -ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0195", ENV{ID_IFACE}=="02", SYMLINK+="modem_at0" -ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0195", ENV{ID_IFACE}=="03", SYMLINK+="modem_at1" - -# Quectel EG-25 -ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", ENV{ID_IFACE}=="02", SYMLINK+="modem_at0" -ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", ENV{ID_IFACE}=="03", SYMLINK+="modem_at1" - -LABEL="mlinux_end" diff --git a/eudev/init b/eudev/init deleted file mode 100644 index d941401..0000000 --- a/eudev/init +++ /dev/null @@ -1,138 +0,0 @@ -#!/bin/sh - -### BEGIN INIT INFO -# Provides: udev -# Required-Start: mountvirtfs -# Required-Stop: -# Default-Start: S -# Default-Stop: -# Short-Description: Start udevd, populate /dev and load drivers. -### END INIT INFO - -export TZ=/etc/localtime - -[ -d /sys/class ] || exit 1 -[ -r /proc/mounts ] || exit 1 -[ -x @UDEVD@ ] || exit 1 -[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache -[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf -[ -f /etc/default/rcS ] && . /etc/default/rcS - -readfiles () { - READDATA="" - for filename in $@; do - if [ -r $filename ]; then - while read line; do - READDATA="$READDATA$line" - done < $filename - fi - done -} - -kill_udevd () { - pid=`pidof -x udevd` - [ -n "$pid" ] && kill $pid -} - -case "$1" in - start) - export ACTION=add - # propagate /dev from /sys - echo "Starting udev" - - # Check for requireed devtmpfs before trying to start udev and - # mount a no-existant fs. - if ! grep -q devtmpfs /proc/filesystems - then - echo "Missing devtmpfs, which is required for udev to run"; - echo "Halting..." - halt - fi - # mount the devtmpfs on /dev, if not already done - LANG=C awk '$2 == "/dev" && ($3 == "devtmpfs") { exit 1 }' /proc/mounts && { - mount -n -o mode=0755 -t devtmpfs none "/dev" - } - [ -e /dev/pts ] || mkdir -m 0755 /dev/pts - [ -e /dev/shm ] || mkdir -m 1777 /dev/shm - # the automount rule for udev needs /tmp directory available, as /tmp is a symlink - # to /var/tmp which in turn is a symlink to /var/volatile/tmp, we need to make sure - # /var/volatile/tmp directory to be available. - mkdir -m 1777 -p /var/volatile/tmp - - # Cache handling. - # A list of files which are used as a criteria to judge whether the udev cache could be reused. - CMP_FILE_LIST="/proc/version /proc/cmdline /proc/devices /proc/atags" - if [ "$DEVCACHE" != "" ]; then - if [ -e $DEVCACHE ]; then - readfiles $CMP_FILE_LIST - NEWDATA="$READDATA" - readfiles /etc/udev/cache.data - OLDDATA="$READDATA" - if [ "$OLDDATA" = "$NEWDATA" ]; then - (cd /; tar xf $DEVCACHE > /dev/null 2>&1) - not_first_boot=1 - [ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE" - [ -e /dev/shm/udev.cache ] && rm -f /dev/shm/udev.cache - else - # Output detailed reason why the cached /dev is not used - if [ "$VERBOSE" != "no" ]; then - echo "udev: udev cache not used" - echo "udev: we use $CMP_FILE_LIST as criteria to judge whether the cache /dev could be resued" - echo "udev: olddata: $OLDDATA" - echo "udev: newdata: $NEWDATA" - fi - echo "$NEWDATA" > /dev/shm/udev.cache - fi - else - if [ "$ROOTFS_READ_ONLY" != "yes" ]; then - # If rootfs is not read-only, it's possible that a new udev cache would be generated; - # otherwise, we do not bother to read files. - readfiles $CMP_FILE_LIST - echo "$READDATA" > /dev/shm/udev.cache - fi - fi - fi - - # make_extra_nodes - kill_udevd > "/dev/null" 2>&1 - - # trigger the sorted events - echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug - @UDEVD@ -d - - udevadm control --env=STARTUP=1 - if [ "$not_first_boot" != "" ];then - if [ "$PROBE_PLATFORM_BUS" != "yes" ]; then - PLATFORM_BUS_NOMATCH="--subsystem-nomatch=platform" - else - PLATFORM_BUS_NOMATCH="" - fi - udevadm trigger --action=add --subsystem-nomatch=tty --subsystem-nomatch=mem --subsystem-nomatch=vc --subsystem-nomatch=vtconsole --subsystem-nomatch=misc --subsystem-nomatch=dcon --subsystem-nomatch=pci_bus --subsystem-nomatch=graphics --subsystem-nomatch=backlight --subsystem-nomatch=video4linux $PLATFORM_BUS_NOMATCH - (udevadm settle --timeout=10; udevadm control --env=STARTUP=)& - else - udevadm trigger --action=add - udevadm settle - fi - ;; - stop) - echo "Stopping udevd" - start-stop-daemon --stop --name udevd --quiet - ;; - restart) - $0 stop - sleep 1 - $0 start - ;; - status) - pid=`pidof -x udevd` - if [ -n "$pid" ]; then - echo "udevd (pid $pid) is running ..." - else - echo "udevd is stopped" - fi - ;; - *) - echo "Usage: $0 {start|stop|status|restart}" - exit 1 -esac -exit 0 diff --git a/eudev/udev-cache.default b/eudev/udev-cache.default deleted file mode 100644 index b1aa63f..0000000 --- a/eudev/udev-cache.default +++ /dev/null @@ -1,5 +0,0 @@ -# Default for /etc/init.d/udev - -# Comment this out to disable device cache -#DEVCACHE="/etc/dev.tar" -PROBE_PLATFORM_BUS="yes" diff --git a/eudev_%.bbappend b/eudev_%.bbappend deleted file mode 100644 index 26bcceb..0000000 --- a/eudev_%.bbappend +++ /dev/null @@ -1,14 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" - -PR .= ".mlinux6" - -# add custom rules for persistent modem device names -SRC_URI += "file://cellular_radios.rules \ - file://${MACHINE}.rules" - -do_install_append() { - install -m 644 ${WORKDIR}/cellular_radios.rules ${D}${sysconfdir}/udev/rules.d/ - install -m 644 ${WORKDIR}/${MACHINE}.rules ${D}${sysconfdir}/udev/rules.d/ -} - - diff --git a/recipes-core/udev/eudev/cellular_radios.rules b/recipes-core/udev/eudev/cellular_radios.rules new file mode 100644 index 0000000..d7c0521 --- /dev/null +++ b/recipes-core/udev/eudev/cellular_radios.rules @@ -0,0 +1,86 @@ +ACTION=="remove", GOTO="mlinux_end" +SUBSYSTEM!="tty", GOTO="mlinux_end" +KERNEL!="ttyUSB[0-9]*|ttyACM[0-9]*", GOTO="mlinux_end" + +SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}" +ENV{ID_IFACE}=="", GOTO="mlinux_end" + +# All modem ports +# H5 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="00", SYMLINK+="modem0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="02", SYMLINK+="modem1" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="04", SYMLINK+="modem2" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="06", SYMLINK+="modem3" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="08", SYMLINK+="modem4" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="0a", SYMLINK+="modem5" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="0c", SYMLINK+="modem6" +# LAT3, LVW3 and LEU3 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="00", SYMLINK+="modem0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="02", SYMLINK+="modem1" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="04", SYMLINK+="modem2" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="06", SYMLINK+="modem3" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="08", SYMLINK+="modem4" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="0a", SYMLINK+="modem5" +# EV3 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="00", SYMLINK+="modem0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="01", SYMLINK+="modem1" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="02", SYMLINK+="modem2" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="03", SYMLINK+="modem3" +# H4 +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="00", SYMLINK+="modem0" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="01", SYMLINK+="modem1" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="02", SYMLINK+="modem2" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="03", SYMLINK+="modem3" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="04", SYMLINK+="modem4" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="05", SYMLINK+="modem5" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="06", SYMLINK+="modem6" +# EV2 +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="0028", SYMLINK+="modem$env{ID_PORT}" + +# AT Command ports +# H5: ttyACM0, ttyACM3 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_IFACE}=="06", SYMLINK+="modem_at1" +# LAT3, LVW3 and LEU3 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="06", SYMLINK+="modem_at1" +# EV3: ttyUSB2, ttyUSB3 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="02", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1010", ENV{ID_IFACE}=="03", SYMLINK+="modem_at1" +# H4: ttyUSB3, ttyUSB4, ttyUSB5 +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="03", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="04", SYMLINK+="modem_at1" +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="683c", ENV{ID_IFACE}=="05", SYMLINK+="modem_at2" +# EV2: ttyUSB0 +ATTRS{idVendor}=="1199", ATTRS{idProduct}=="0028", ENV{ID_PORT}=="0", SYMLINK+="modem_at0" +# LAT1, LEU1, LVW2: ttyUSB2, ttyUSB3 (port 04 and port 05) +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1201", ENV{ID_IFACE}=="04", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1201", ENV{ID_IFACE}=="05", SYMLINK+="modem_at1" +# LJP1(LE910-JN1), LNA3(LE910-NA1): ttyACM0, ttyACM3 (port 00 and port 03) +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_IFACE}=="06", SYMLINK+="modem_at1" +# LJP1(LE866) ttyACM0, ttyACM2 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="2300", ENV{ID_IFACE}=="02", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="2300", ENV{ID_IFACE}=="06", SYMLINK+="modem_at1" +# G3: ttyACM0, ttyACM1 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0022", ENV{ID_IFACE}=="00", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0022", ENV{ID_IFACE}=="02", SYMLINK+="modem_at1" +# C2: ttyUSB0, ttyUSB1 (Telit Documentation: Modem Port = USB1, Aux Port = USB0) +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1011", ENV{ID_IFACE}=="01", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1011", ENV{ID_IFACE}=="00", SYMLINK+="modem_at1" +# CATM Telit ME910 +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1100", ENV{ID_IFACE}=="01", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1100", ENV{ID_IFACE}=="02", SYMLINK+="modem_at1" +# CATM Telit ME910 dual USB +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1101", ENV{ID_IFACE}=="01", SYMLINK+="modem_at0" +ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1101", ENV{ID_IFACE}=="02", SYMLINK+="modem_at1" + +# Quectel EG-95 +ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0195", ENV{ID_IFACE}=="02", SYMLINK+="modem_at0" +ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0195", ENV{ID_IFACE}=="03", SYMLINK+="modem_at1" + +# Quectel EG-25 +ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", ENV{ID_IFACE}=="02", SYMLINK+="modem_at0" +ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", ENV{ID_IFACE}=="03", SYMLINK+="modem_at1" + +LABEL="mlinux_end" diff --git a/recipes-core/udev/eudev/init b/recipes-core/udev/eudev/init new file mode 100644 index 0000000..d941401 --- /dev/null +++ b/recipes-core/udev/eudev/init @@ -0,0 +1,138 @@ +#!/bin/sh + +### BEGIN INIT INFO +# Provides: udev +# Required-Start: mountvirtfs +# Required-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Start udevd, populate /dev and load drivers. +### END INIT INFO + +export TZ=/etc/localtime + +[ -d /sys/class ] || exit 1 +[ -r /proc/mounts ] || exit 1 +[ -x @UDEVD@ ] || exit 1 +[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache +[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf +[ -f /etc/default/rcS ] && . /etc/default/rcS + +readfiles () { + READDATA="" + for filename in $@; do + if [ -r $filename ]; then + while read line; do + READDATA="$READDATA$line" + done < $filename + fi + done +} + +kill_udevd () { + pid=`pidof -x udevd` + [ -n "$pid" ] && kill $pid +} + +case "$1" in + start) + export ACTION=add + # propagate /dev from /sys + echo "Starting udev" + + # Check for requireed devtmpfs before trying to start udev and + # mount a no-existant fs. + if ! grep -q devtmpfs /proc/filesystems + then + echo "Missing devtmpfs, which is required for udev to run"; + echo "Halting..." + halt + fi + # mount the devtmpfs on /dev, if not already done + LANG=C awk '$2 == "/dev" && ($3 == "devtmpfs") { exit 1 }' /proc/mounts && { + mount -n -o mode=0755 -t devtmpfs none "/dev" + } + [ -e /dev/pts ] || mkdir -m 0755 /dev/pts + [ -e /dev/shm ] || mkdir -m 1777 /dev/shm + # the automount rule for udev needs /tmp directory available, as /tmp is a symlink + # to /var/tmp which in turn is a symlink to /var/volatile/tmp, we need to make sure + # /var/volatile/tmp directory to be available. + mkdir -m 1777 -p /var/volatile/tmp + + # Cache handling. + # A list of files which are used as a criteria to judge whether the udev cache could be reused. + CMP_FILE_LIST="/proc/version /proc/cmdline /proc/devices /proc/atags" + if [ "$DEVCACHE" != "" ]; then + if [ -e $DEVCACHE ]; then + readfiles $CMP_FILE_LIST + NEWDATA="$READDATA" + readfiles /etc/udev/cache.data + OLDDATA="$READDATA" + if [ "$OLDDATA" = "$NEWDATA" ]; then + (cd /; tar xf $DEVCACHE > /dev/null 2>&1) + not_first_boot=1 + [ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE" + [ -e /dev/shm/udev.cache ] && rm -f /dev/shm/udev.cache + else + # Output detailed reason why the cached /dev is not used + if [ "$VERBOSE" != "no" ]; then + echo "udev: udev cache not used" + echo "udev: we use $CMP_FILE_LIST as criteria to judge whether the cache /dev could be resued" + echo "udev: olddata: $OLDDATA" + echo "udev: newdata: $NEWDATA" + fi + echo "$NEWDATA" > /dev/shm/udev.cache + fi + else + if [ "$ROOTFS_READ_ONLY" != "yes" ]; then + # If rootfs is not read-only, it's possible that a new udev cache would be generated; + # otherwise, we do not bother to read files. + readfiles $CMP_FILE_LIST + echo "$READDATA" > /dev/shm/udev.cache + fi + fi + fi + + # make_extra_nodes + kill_udevd > "/dev/null" 2>&1 + + # trigger the sorted events + echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug + @UDEVD@ -d + + udevadm control --env=STARTUP=1 + if [ "$not_first_boot" != "" ];then + if [ "$PROBE_PLATFORM_BUS" != "yes" ]; then + PLATFORM_BUS_NOMATCH="--subsystem-nomatch=platform" + else + PLATFORM_BUS_NOMATCH="" + fi + udevadm trigger --action=add --subsystem-nomatch=tty --subsystem-nomatch=mem --subsystem-nomatch=vc --subsystem-nomatch=vtconsole --subsystem-nomatch=misc --subsystem-nomatch=dcon --subsystem-nomatch=pci_bus --subsystem-nomatch=graphics --subsystem-nomatch=backlight --subsystem-nomatch=video4linux $PLATFORM_BUS_NOMATCH + (udevadm settle --timeout=10; udevadm control --env=STARTUP=)& + else + udevadm trigger --action=add + udevadm settle + fi + ;; + stop) + echo "Stopping udevd" + start-stop-daemon --stop --name udevd --quiet + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + status) + pid=`pidof -x udevd` + if [ -n "$pid" ]; then + echo "udevd (pid $pid) is running ..." + else + echo "udevd is stopped" + fi + ;; + *) + echo "Usage: $0 {start|stop|status|restart}" + exit 1 +esac +exit 0 diff --git a/recipes-core/udev/eudev/udev-cache.default b/recipes-core/udev/eudev/udev-cache.default new file mode 100644 index 0000000..b1aa63f --- /dev/null +++ b/recipes-core/udev/eudev/udev-cache.default @@ -0,0 +1,5 @@ +# Default for /etc/init.d/udev + +# Comment this out to disable device cache +#DEVCACHE="/etc/dev.tar" +PROBE_PLATFORM_BUS="yes" diff --git a/recipes-core/udev/eudev_%.bbappend b/recipes-core/udev/eudev_%.bbappend new file mode 100644 index 0000000..26bcceb --- /dev/null +++ b/recipes-core/udev/eudev_%.bbappend @@ -0,0 +1,14 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +PR .= ".mlinux6" + +# add custom rules for persistent modem device names +SRC_URI += "file://cellular_radios.rules \ + file://${MACHINE}.rules" + +do_install_append() { + install -m 644 ${WORKDIR}/cellular_radios.rules ${D}${sysconfdir}/udev/rules.d/ + install -m 644 ${WORKDIR}/${MACHINE}.rules ${D}${sysconfdir}/udev/rules.d/ +} + + diff --git a/recipes-core/udev/udev-extraconf/automount.rules b/recipes-core/udev/udev-extraconf/automount.rules new file mode 100644 index 0000000..b4a8f22 --- /dev/null +++ b/recipes-core/udev/udev-extraconf/automount.rules @@ -0,0 +1,24 @@ +# There are a number of modifiers that are allowed to be used in some +# of the different fields. They provide the following subsitutions: +# +# %n the "kernel number" of the device. +# For example, 'sda3' has a "kernel number" of '3' +# %e the smallest number for that name which does not matches an existing node +# %k the kernel name for the device +# %M the kernel major number for the device +# %m the kernel minor number for the device +# %b the bus id for the device +# %c the string returned by the PROGRAM +# %s{filename} the content of a sysfs attribute +# %% the '%' char itself +# + +SUBSYSTEM!="block", GOTO="automount_end" +# only mount SD cards and mass storage devices +KERNEL!="sd[a-z][0-9]*|mmcblk[0-9]p[0-9]*", GOTO="automount_end" + +# Media automounting +SUBSYSTEM=="block", ACTION=="add" RUN+="/etc/udev/scripts/mount.sh" +SUBSYSTEM=="block", ACTION=="remove" RUN+="/etc/udev/scripts/mount.sh" + +LABEL="automount_end" diff --git a/recipes-core/udev/udev-extraconf/mount.patch b/recipes-core/udev/udev-extraconf/mount.patch new file mode 100644 index 0000000..4ed3bfd --- /dev/null +++ b/recipes-core/udev/udev-extraconf/mount.patch @@ -0,0 +1,136 @@ +diff -Naru orig/mount.blacklist new/mount.blacklist +--- orig/mount.blacklist 2019-10-24 17:08:59.796796272 -0500 ++++ new/mount.blacklist 2019-10-24 17:16:31.768782892 -0500 +@@ -3,3 +3,16 @@ + /dev/mtdblock + /dev/md + /dev/dm-* ++# These should all be mounted in fstab or not at all. ++[PARTLABEL=uboot] ++[PARTLABEL=root] ++[PARTLABEL=root1] ++[PARTLABEL=root2] ++[PARTLABEL=uboot] ++[PARTLABEL=oem] ++[PARTLABEL=oem1] ++[PARTLABEL=oem2] ++[PARTLABEL=config] ++[PARTLABEL=config1] ++[PARTLABEL=config2] ++[PARTLABEL=user_data] +diff -Naru orig/mount.sh new/mount.sh +--- orig/mount.sh 2020-09-09 13:57:23.196157483 -0500 ++++ new/mount.sh 2020-09-09 14:59:40.344046845 -0500 +@@ -4,8 +4,8 @@ + # + # Attempt to mount any added block devices and umount any removed devices + +-BASE_INIT="`readlink -f "@base_sbindir@/init"`" +-INIT_SYSTEMD="@systemd_unitdir@/systemd" ++BASE_INIT="`readlink -f "/sbin/init"`" ++INIT_SYSTEMD="/lib/systemd/systemd" + + if [ "x$BASE_INIT" = "x$INIT_SYSTEMD" ];then + # systemd as init uses systemd-mount to mount block devices +@@ -23,11 +23,38 @@ + MOUNT="/bin/mount" + UMOUNT="/bin/umount" + fi ++LSBLK=$(type -p lsblk) ++if ((${#LSBLK} == 0)) ; then ++ LSBLK=true ++fi + + PMOUNT="/usr/bin/pmount" +- +-for line in `grep -h -v ^# /etc/udev/mount.blacklist /etc/udev/mount.blacklist.d/*` ++for line in `grep -h -v '^#$' /etc/udev/mount.blacklist /etc/udev/mount.blacklist.d/* 2>/dev/null` + do ++ if [[ $line =~ ^\[([^=]*)=([^\]]*)\] ]] ; then ++ fsspectype=${BASH_REMATCH[1]} ++ tmp="$(${LSBLK} -o $fsspectype $DEVNAME | sed -e '1d')" ++ case $fsspectype in ++ PARTLABEL) ++ if [[ ${BASH_REMATCH[2]} == $tmp ]] ; then ++ logger "udev/mount.sh $DEVNAME is blacklisted, ignoring" ++ logger "$line" ++ exit 0 ++ fi ++ ;; ++ ++ PARTUUID) ++ if [[ ${BASH_REMATCH[2]^^} == $tmp ]] ; then ++ logger "udev/mount.sh $DEVNAME is blacklisted, ignoring" ++ logger "$line" ++ exit 0 ++ fi ++ ;; ++ *) ++ logger "[$fsspectype] is unsupported in blacklist -- ignoring blacklist item" ++ ;; ++ esac ++ fi + if [ ` expr match "$DEVNAME" "$line" ` -gt 0 ]; + then + logger "udev/mount.sh" "[$DEVNAME] is blacklisted, ignoring" +@@ -41,7 +68,7 @@ + # Skip the partition which are already in /etc/fstab + grep "^[[:space:]]*$DEVNAME" /etc/fstab && return + for n in LABEL PARTLABEL UUID PARTUUID; do +- tmp="$(lsblk -o $n $DEVNAME | sed -e '1d')" ++ tmp="$($LSBLK -o $n $DEVNAME | sed -e '1d')" + test -z "$tmp" && continue + tmp="$n=$tmp" + grep "^[[:space:]]*$tmp" /etc/fstab && return +@@ -49,13 +76,17 @@ + + [ -d "/run/media/$name" ] || mkdir -p "/run/media/$name" + ++ if [ "$name" = mmcblk0p1 ] ; then ++ ln -sf /run/media/$name /run/media/card ++ fi ++ + MOUNT="$MOUNT -o silent" + + # If filesystemtype is vfat, change the ownership group to 'disk', and + # grant it with w/r/x permissions. + case $ID_FS_TYPE in + vfat|fat) +- MOUNT="$MOUNT -o umask=007,gid=`awk -F':' '/^disk/{print $3}' /etc/group`" ++ MOUNT="$MOUNT -o errors=continue -o umask=007,gid=`awk -F':' '/^disk/{print $3}' /etc/group`" + ;; + # TODO + *) +@@ -78,7 +109,11 @@ + if [ -x "$PMOUNT" ]; then + $PMOUNT $DEVNAME 2> /dev/null + elif [ -x $MOUNT ]; then ++ if [[ $ID_FS_TYPE =~ fat ]] ; then ++ $MOUNT -o umask=002,gid=disk $DEVNAME 2> /dev/null ++ else + $MOUNT $DEVNAME 2> /dev/null ++ fi + fi + + # If the device isn't mounted at this point, it isn't +@@ -86,6 +121,11 @@ + grep -q "^$DEVNAME " /proc/mounts && return + + ! test -d "/run/media/$name" && mkdir -p "/run/media/$name" ++ ++ if [ "$name" = mmcblk0p1 ] ; then ++ ln -sf /run/media/$name /run/media/card ++ fi ++ + # Silent util-linux's version of mounting auto + if [ "x`readlink $MOUNT`" = "x/bin/mount.util-linux" ] ; + then +@@ -96,7 +136,7 @@ + # grant it with w/r/x permissions. + case $ID_FS_TYPE in + vfat|fat) +- MOUNT="$MOUNT -o umask=007,gid=`awk -F':' '/^disk/{print $3}' /etc/group`" ++ MOUNT="$MOUNT -o errors=continue -o umask=007,gid=`awk -F':' '/^disk/{print $3}' /etc/group`" + ;; + # TODO + *) diff --git a/recipes-core/udev/udev-extraconf_%.bbappend b/recipes-core/udev/udev-extraconf_%.bbappend new file mode 100644 index 0000000..3a39025 --- /dev/null +++ b/recipes-core/udev/udev-extraconf_%.bbappend @@ -0,0 +1,5 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +PR = "m2" + +SRC_URI += "file://mount.patch" diff --git a/udev-extraconf/automount.rules b/udev-extraconf/automount.rules deleted file mode 100644 index b4a8f22..0000000 --- a/udev-extraconf/automount.rules +++ /dev/null @@ -1,24 +0,0 @@ -# There are a number of modifiers that are allowed to be used in some -# of the different fields. They provide the following subsitutions: -# -# %n the "kernel number" of the device. -# For example, 'sda3' has a "kernel number" of '3' -# %e the smallest number for that name which does not matches an existing node -# %k the kernel name for the device -# %M the kernel major number for the device -# %m the kernel minor number for the device -# %b the bus id for the device -# %c the string returned by the PROGRAM -# %s{filename} the content of a sysfs attribute -# %% the '%' char itself -# - -SUBSYSTEM!="block", GOTO="automount_end" -# only mount SD cards and mass storage devices -KERNEL!="sd[a-z][0-9]*|mmcblk[0-9]p[0-9]*", GOTO="automount_end" - -# Media automounting -SUBSYSTEM=="block", ACTION=="add" RUN+="/etc/udev/scripts/mount.sh" -SUBSYSTEM=="block", ACTION=="remove" RUN+="/etc/udev/scripts/mount.sh" - -LABEL="automount_end" diff --git a/udev-extraconf/mount.patch b/udev-extraconf/mount.patch deleted file mode 100644 index 4ed3bfd..0000000 --- a/udev-extraconf/mount.patch +++ /dev/null @@ -1,136 +0,0 @@ -diff -Naru orig/mount.blacklist new/mount.blacklist ---- orig/mount.blacklist 2019-10-24 17:08:59.796796272 -0500 -+++ new/mount.blacklist 2019-10-24 17:16:31.768782892 -0500 -@@ -3,3 +3,16 @@ - /dev/mtdblock - /dev/md - /dev/dm-* -+# These should all be mounted in fstab or not at all. -+[PARTLABEL=uboot] -+[PARTLABEL=root] -+[PARTLABEL=root1] -+[PARTLABEL=root2] -+[PARTLABEL=uboot] -+[PARTLABEL=oem] -+[PARTLABEL=oem1] -+[PARTLABEL=oem2] -+[PARTLABEL=config] -+[PARTLABEL=config1] -+[PARTLABEL=config2] -+[PARTLABEL=user_data] -diff -Naru orig/mount.sh new/mount.sh ---- orig/mount.sh 2020-09-09 13:57:23.196157483 -0500 -+++ new/mount.sh 2020-09-09 14:59:40.344046845 -0500 -@@ -4,8 +4,8 @@ - # - # Attempt to mount any added block devices and umount any removed devices - --BASE_INIT="`readlink -f "@base_sbindir@/init"`" --INIT_SYSTEMD="@systemd_unitdir@/systemd" -+BASE_INIT="`readlink -f "/sbin/init"`" -+INIT_SYSTEMD="/lib/systemd/systemd" - - if [ "x$BASE_INIT" = "x$INIT_SYSTEMD" ];then - # systemd as init uses systemd-mount to mount block devices -@@ -23,11 +23,38 @@ - MOUNT="/bin/mount" - UMOUNT="/bin/umount" - fi -+LSBLK=$(type -p lsblk) -+if ((${#LSBLK} == 0)) ; then -+ LSBLK=true -+fi - - PMOUNT="/usr/bin/pmount" -- --for line in `grep -h -v ^# /etc/udev/mount.blacklist /etc/udev/mount.blacklist.d/*` -+for line in `grep -h -v '^#$' /etc/udev/mount.blacklist /etc/udev/mount.blacklist.d/* 2>/dev/null` - do -+ if [[ $line =~ ^\[([^=]*)=([^\]]*)\] ]] ; then -+ fsspectype=${BASH_REMATCH[1]} -+ tmp="$(${LSBLK} -o $fsspectype $DEVNAME | sed -e '1d')" -+ case $fsspectype in -+ PARTLABEL) -+ if [[ ${BASH_REMATCH[2]} == $tmp ]] ; then -+ logger "udev/mount.sh $DEVNAME is blacklisted, ignoring" -+ logger "$line" -+ exit 0 -+ fi -+ ;; -+ -+ PARTUUID) -+ if [[ ${BASH_REMATCH[2]^^} == $tmp ]] ; then -+ logger "udev/mount.sh $DEVNAME is blacklisted, ignoring" -+ logger "$line" -+ exit 0 -+ fi -+ ;; -+ *) -+ logger "[$fsspectype] is unsupported in blacklist -- ignoring blacklist item" -+ ;; -+ esac -+ fi - if [ ` expr match "$DEVNAME" "$line" ` -gt 0 ]; - then - logger "udev/mount.sh" "[$DEVNAME] is blacklisted, ignoring" -@@ -41,7 +68,7 @@ - # Skip the partition which are already in /etc/fstab - grep "^[[:space:]]*$DEVNAME" /etc/fstab && return - for n in LABEL PARTLABEL UUID PARTUUID; do -- tmp="$(lsblk -o $n $DEVNAME | sed -e '1d')" -+ tmp="$($LSBLK -o $n $DEVNAME | sed -e '1d')" - test -z "$tmp" && continue - tmp="$n=$tmp" - grep "^[[:space:]]*$tmp" /etc/fstab && return -@@ -49,13 +76,17 @@ - - [ -d "/run/media/$name" ] || mkdir -p "/run/media/$name" - -+ if [ "$name" = mmcblk0p1 ] ; then -+ ln -sf /run/media/$name /run/media/card -+ fi -+ - MOUNT="$MOUNT -o silent" - - # If filesystemtype is vfat, change the ownership group to 'disk', and - # grant it with w/r/x permissions. - case $ID_FS_TYPE in - vfat|fat) -- MOUNT="$MOUNT -o umask=007,gid=`awk -F':' '/^disk/{print $3}' /etc/group`" -+ MOUNT="$MOUNT -o errors=continue -o umask=007,gid=`awk -F':' '/^disk/{print $3}' /etc/group`" - ;; - # TODO - *) -@@ -78,7 +109,11 @@ - if [ -x "$PMOUNT" ]; then - $PMOUNT $DEVNAME 2> /dev/null - elif [ -x $MOUNT ]; then -+ if [[ $ID_FS_TYPE =~ fat ]] ; then -+ $MOUNT -o umask=002,gid=disk $DEVNAME 2> /dev/null -+ else - $MOUNT $DEVNAME 2> /dev/null -+ fi - fi - - # If the device isn't mounted at this point, it isn't -@@ -86,6 +121,11 @@ - grep -q "^$DEVNAME " /proc/mounts && return - - ! test -d "/run/media/$name" && mkdir -p "/run/media/$name" -+ -+ if [ "$name" = mmcblk0p1 ] ; then -+ ln -sf /run/media/$name /run/media/card -+ fi -+ - # Silent util-linux's version of mounting auto - if [ "x`readlink $MOUNT`" = "x/bin/mount.util-linux" ] ; - then -@@ -96,7 +136,7 @@ - # grant it with w/r/x permissions. - case $ID_FS_TYPE in - vfat|fat) -- MOUNT="$MOUNT -o umask=007,gid=`awk -F':' '/^disk/{print $3}' /etc/group`" -+ MOUNT="$MOUNT -o errors=continue -o umask=007,gid=`awk -F':' '/^disk/{print $3}' /etc/group`" - ;; - # TODO - *) diff --git a/udev-extraconf_%.bbappend b/udev-extraconf_%.bbappend deleted file mode 100644 index 3a39025..0000000 --- a/udev-extraconf_%.bbappend +++ /dev/null @@ -1,5 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" - -PR = "m2" - -SRC_URI += "file://mount.patch" -- cgit v1.2.3