Complete Yocto mirror with license table for TQMa6UL (2038-compliance)
- 264 license table entries with exact download URLs (224/264 resolved) - Complete sources/ directory with all BitBake recipes - Build configuration: tqma6ul-multi-mba6ulx, spaetzle (musl) - Full traceability for Softwarefreigabeantrag - GCC 13.4.0, Linux 6.6.102, U-Boot 2023.04, musl 1.2.4 - License distribution: GPL-2.0 (24), MIT (23), GPL-2.0+ (18), BSD-3 (16)
This commit is contained in:
130
sources/poky/meta/recipes-core/udev/eudev/init
Normal file
130
sources/poky/meta/recipes-core/udev/eudev/init
Normal file
@@ -0,0 +1,130 @@
|
||||
#!/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/udev/udev.conf ] && . /etc/udev/udev.conf
|
||||
[ -f /etc/default/rcS ] && . /etc/default/rcS
|
||||
|
||||
kill_udevd () {
|
||||
pid=`pidof -x udevd`
|
||||
[ -n "$pid" ] && kill $pid
|
||||
}
|
||||
|
||||
make_static_nodes () {
|
||||
[ -e /lib/modules/$(uname -r)/modules.devname ] || return 0
|
||||
[ -x @KMOD@ ] || return 0
|
||||
|
||||
#output to /proc/self/fd/1 since /dev/stdout not created by udevd yet
|
||||
@KMOD@ static-nodes --format=tmpfiles --output=/proc/self/fd/1 |
|
||||
while read TTYPE TPATH TMODE TUSER TGROUP TAGE TARG; do
|
||||
case "${TTYPE}" in
|
||||
'd')
|
||||
test -d "${TPATH}" || mkdir -p -m "${TMODE}" "${TPATH}"
|
||||
;;
|
||||
|
||||
'c!')
|
||||
if [ ! -c "${TPATH}" ]; then
|
||||
old_ifs="${IFS}"
|
||||
IFS=:
|
||||
set -- ${TARG}
|
||||
IFS="${old_ifs}"
|
||||
mknod -m "${TMODE}" "${TPATH}" c "$@"
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unparseable line (${TTYPE} ${TPATH} ${TMODE} ${TUSER} ${TGROUP} ${TAGE} ${TARG})"
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
if [ "${TUSER}" != "-" ]; then
|
||||
chown "${TUSER}" "${TPATH}"
|
||||
fi
|
||||
if [ "${TGROUP}" != "-" ]; then
|
||||
chgrp "${TGROUP}" "${TPATH}"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
# make_extra_nodes
|
||||
kill_udevd > "/dev/null" 2>&1
|
||||
|
||||
make_static_nodes
|
||||
# trigger the sorted events
|
||||
[ -e /proc/sys/kernel/hotplug ] && printf '\0\n' >/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=3; 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
|
||||
19
sources/poky/meta/recipes-core/udev/eudev/local.rules
Normal file
19
sources/poky/meta/recipes-core/udev/eudev/local.rules
Normal file
@@ -0,0 +1,19 @@
|
||||
# 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
|
||||
#
|
||||
|
||||
# Create a symlink to any touchscreen input device
|
||||
# Trigger based on input type, that the evbit (-e) has EV_SYN and EV_ABS,
|
||||
# has an EV_ABS value (-a) which is used for touchscreen type devices.
|
||||
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ENV{ID_INPUT_TOUCHSCREEN}=="1", SYMLINK+="input/touchscreen0"
|
||||
17
sources/poky/meta/recipes-core/udev/eudev/netifnames.patch
Normal file
17
sources/poky/meta/recipes-core/udev/eudev/netifnames.patch
Normal file
@@ -0,0 +1,17 @@
|
||||
eudev: consider ID_NET_NAME_MAC as an interface name
|
||||
|
||||
eudev might not create names based on slot or path.
|
||||
|
||||
Upstream-Status: Backport [github.com/eudev-project/eudev/pull/274]
|
||||
|
||||
Signed-off-by: Joe Slater <joe.slater@windriver.com>
|
||||
|
||||
--- a/rules/80-net-name-slot.rules
|
||||
+++ b/rules/80-net-name-slot.rules
|
||||
@@ -10,5 +10,6 @@ ENV{net.ifnames}=="0", GOTO="net_name_sl
|
||||
NAME=="", ENV{ID_NET_NAME_ONBOARD}!="", NAME="$env{ID_NET_NAME_ONBOARD}"
|
||||
NAME=="", ENV{ID_NET_NAME_SLOT}!="", NAME="$env{ID_NET_NAME_SLOT}"
|
||||
NAME=="", ENV{ID_NET_NAME_PATH}!="", NAME="$env{ID_NET_NAME_PATH}"
|
||||
+NAME=="", ENV{ID_NET_NAME_MAC}!="", NAME="$env{ID_NET_NAME_MAC}"
|
||||
|
||||
LABEL="net_name_slot_end"
|
||||
90
sources/poky/meta/recipes-core/udev/eudev_3.2.14.bb
Normal file
90
sources/poky/meta/recipes-core/udev/eudev_3.2.14.bb
Normal file
@@ -0,0 +1,90 @@
|
||||
SUMMARY = "eudev is a fork of systemd's udev"
|
||||
HOMEPAGE = "https://github.com/eudev-project/eudev"
|
||||
DESCRIPTION = "eudev is Gentoo's fork of udev, systemd's device file manager for the Linux kernel. It manages device nodes in /dev and handles all user space actions when adding or removing devices."
|
||||
LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later"
|
||||
LICENSE:libudev = "LGPL-2.1-or-later"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
|
||||
|
||||
DEPENDS = "gperf-native"
|
||||
|
||||
PROVIDES = "udev"
|
||||
|
||||
SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/${BP}.tar.gz \
|
||||
file://netifnames.patch \
|
||||
file://init \
|
||||
file://local.rules \
|
||||
"
|
||||
|
||||
SRC_URI[sha256sum] = "8da4319102f24abbf7fff5ce9c416af848df163b29590e666d334cc1927f006f"
|
||||
|
||||
GITHUB_BASE_URI = "https://github.com/eudev-project/eudev/releases"
|
||||
|
||||
inherit autotools update-rc.d qemu pkgconfig features_check manpages github-releases
|
||||
|
||||
CONFLICT_DISTRO_FEATURES = "systemd"
|
||||
|
||||
EXTRA_OECONF = " \
|
||||
--sbindir=${base_sbindir} \
|
||||
--with-rootlibdir=${base_libdir} \
|
||||
--with-rootlibexecdir=${nonarch_base_libdir}/udev \
|
||||
--with-rootprefix= \
|
||||
"
|
||||
|
||||
PACKAGECONFIG ?= "blkid hwdb kmod \
|
||||
${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)} \
|
||||
"
|
||||
PACKAGECONFIG[blkid] = "--enable-blkid,--disable-blkid,util-linux"
|
||||
PACKAGECONFIG[hwdb] = "--enable-hwdb,--disable-hwdb"
|
||||
PACKAGECONFIG[kmod] = "--enable-kmod,--disable-kmod,kmod"
|
||||
PACKAGECONFIG[manpages] = "--enable-manpages,--disable-manpages"
|
||||
PACKAGECONFIG[rule-generator] = "--enable-rule-generator,--disable-rule-generator"
|
||||
PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux"
|
||||
|
||||
do_install:append() {
|
||||
install -d ${D}${sysconfdir}/init.d
|
||||
install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/udev
|
||||
sed -i s%@UDEVD@%${base_sbindir}/udevd% ${D}${sysconfdir}/init.d/udev
|
||||
sed -i s%@KMOD@%${base_bindir}/kmod% ${D}${sysconfdir}/init.d/udev
|
||||
|
||||
install -d ${D}${sysconfdir}/udev/rules.d
|
||||
install -m 0644 ${WORKDIR}/local.rules ${D}${sysconfdir}/udev/rules.d/local.rules
|
||||
|
||||
# Use classic network interface naming scheme if no 'pni-names' distro feature
|
||||
if ${@bb.utils.contains('DISTRO_FEATURES', 'pni-names', 'false', 'true', d)}; then
|
||||
touch ${D}${sysconfdir}/udev/rules.d/80-net-name-slot.rules
|
||||
fi
|
||||
}
|
||||
|
||||
do_install:prepend:class-target () {
|
||||
# Remove references to buildmachine
|
||||
sed -i -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
|
||||
${B}/src/udev/keyboard-keys-from-name.h
|
||||
}
|
||||
|
||||
INITSCRIPT_NAME = "udev"
|
||||
INITSCRIPT_PARAMS = "start 04 S ."
|
||||
|
||||
PACKAGE_BEFORE_PN = "libudev ${PN}-hwdb"
|
||||
|
||||
FILES:${PN} += "${nonarch_base_libdir}/udev"
|
||||
FILES:libudev = "${base_libdir}/libudev.so.*"
|
||||
FILES:${PN}-hwdb = "${sysconfdir}/udev/hwdb.d"
|
||||
|
||||
RDEPENDS:${PN}-hwdb += "eudev"
|
||||
RDEPENDS:${PN} += "kmod"
|
||||
|
||||
RPROVIDES:${PN} = "hotplug udev"
|
||||
RPROVIDES:${PN}-hwdb += "udev-hwdb"
|
||||
|
||||
PACKAGE_WRITE_DEPS += "qemu-native"
|
||||
pkg_postinst:${PN}-hwdb () {
|
||||
if test -n "$D"; then
|
||||
$INTERCEPT_DIR/postinst_intercept update_udev_hwdb ${PKG} mlprefix=${MLPREFIX} binprefix=${MLPREFIX}
|
||||
else
|
||||
udevadm hwdb --update
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_prerm:${PN}-hwdb () {
|
||||
rm -f $D${sysconfdir}/udev/hwdb.bin
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
# 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
|
||||
#
|
||||
|
||||
# Media automounting
|
||||
SUBSYSTEM=="block", ACTION=="add" RUN+="/etc/udev/scripts/mount.sh"
|
||||
SUBSYSTEM=="block", ACTION=="remove" RUN+="/etc/udev/scripts/mount.sh"
|
||||
SUBSYSTEM=="block", ACTION=="change", ENV{DISK_MEDIA_CHANGE}=="1" RUN+="/etc/udev/scripts/mount.sh"
|
||||
@@ -0,0 +1,19 @@
|
||||
# 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
|
||||
#
|
||||
|
||||
# Handle network interface setup
|
||||
SUBSYSTEM=="net", ACTION=="add" RUN+="/etc/udev/scripts/network.sh"
|
||||
SUBSYSTEM=="net", ACTION=="remove" RUN+="/etc/udev/scripts/network.sh"
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
# 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
|
||||
#
|
||||
|
||||
# The first rtc device is symlinked to /dev/rtc
|
||||
KERNEL=="rtc0", SYMLINK+="rtc"
|
||||
|
||||
#The first framebuffer is symlinked to /dev/fb
|
||||
KERNEL=="fb0", SYMLINK+="fb"
|
||||
|
||||
# Make all input devices read-write to the input group
|
||||
SUBSYSTEM=="input", GROUP="input", MODE="660"
|
||||
@@ -0,0 +1,5 @@
|
||||
/dev/loop
|
||||
/dev/ram
|
||||
/dev/mtdblock
|
||||
/dev/md
|
||||
/dev/dm-*
|
||||
222
sources/poky/meta/recipes-core/udev/udev-extraconf/mount.sh
Normal file
222
sources/poky/meta/recipes-core/udev/udev-extraconf/mount.sh
Normal file
@@ -0,0 +1,222 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Called from udev
|
||||
#
|
||||
# Attempt to mount any added block devices and umount any removed devices
|
||||
|
||||
BASE_INIT="`readlink -f "@base_sbindir@/init"`"
|
||||
INIT_SYSTEMD="@systemd_unitdir@/systemd"
|
||||
MOUNT_BASE="@MOUNT_BASE@"
|
||||
|
||||
if [ "x$BASE_INIT" = "x$INIT_SYSTEMD" ];then
|
||||
# systemd as init uses systemd-mount to mount block devices
|
||||
MOUNT="/usr/bin/systemd-mount"
|
||||
UMOUNT="/usr/bin/systemd-umount"
|
||||
|
||||
if [ -x $MOUNT ] && [ -x $UMOUNT ];
|
||||
then
|
||||
logger "Using systemd-mount to finish mount"
|
||||
else
|
||||
logger "Linux init is using systemd, so please install systemd-mount to finish mount"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
MOUNT="/bin/mount"
|
||||
UMOUNT="/bin/umount"
|
||||
fi
|
||||
|
||||
PMOUNT="/usr/bin/pmount"
|
||||
|
||||
for line in `grep -h -v ^# /etc/udev/mount.ignorelist /etc/udev/mount.ignorelist.d/*`
|
||||
do
|
||||
if [ ` expr match "$DEVNAME" "$line" ` -gt 0 ];
|
||||
then
|
||||
logger "udev/mount.sh" "[$DEVNAME] is marked to ignore"
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
|
||||
is_filesystem_supported() {
|
||||
while read -r fs; do
|
||||
if [ "${fs#nodev}" = "$1" ];
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
done < "/proc/filesystems"
|
||||
return 1
|
||||
}
|
||||
|
||||
automount_systemd() {
|
||||
name="`basename "$DEVNAME"`"
|
||||
|
||||
# Skip already mounted partitions
|
||||
if [ -f /run/systemd/transient/$(echo $MOUNT_BASE | cut -d '/' -f 2- | sed 's#/#-#g')-*$name.mount ]; then
|
||||
logger "mount.sh/automount" "$MOUNT_BASE/$name already mounted"
|
||||
return
|
||||
fi
|
||||
|
||||
# Get the unique name for mount point
|
||||
get_label_name "${DEVNAME}"
|
||||
|
||||
# Only go for auto-mounting when the device has been cleaned up in remove
|
||||
# or has not been identified yet
|
||||
if [ -e "/tmp/.automount-$name" ]; then
|
||||
logger "mount.sh/automount" "[$MOUNT_BASE/$name] is already cached"
|
||||
return
|
||||
fi
|
||||
|
||||
# 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')"
|
||||
test -z "$tmp" && continue
|
||||
tmp="$n=$tmp"
|
||||
grep "^[[:space:]]*$tmp" /etc/fstab && return
|
||||
done
|
||||
|
||||
if ! is_filesystem_supported $ID_FS_TYPE; then
|
||||
logger "mount.sh/automount" "Filesystem '$ID_FS_TYPE' on '${DEVNAME}' is unsupported"
|
||||
return
|
||||
fi
|
||||
|
||||
[ -d "$MOUNT_BASE/$name" ] || mkdir -p "$MOUNT_BASE/$name"
|
||||
|
||||
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`"
|
||||
;;
|
||||
swap)
|
||||
return ;;
|
||||
lvm*|LVM*)
|
||||
return ;;
|
||||
# TODO
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
if ! $MOUNT --collect --no-block -t auto $DEVNAME "$MOUNT_BASE/$name"
|
||||
then
|
||||
#logger "mount.sh/automount" "$MOUNT -t auto $DEVNAME \"$MOUNT_BASE/$name\" failed!"
|
||||
rm_dir "$MOUNT_BASE/$name"
|
||||
else
|
||||
logger "mount.sh/automount" "Auto-mount of [$MOUNT_BASE/$name] successful"
|
||||
echo "$name" > "/tmp/.automount-$name"
|
||||
fi
|
||||
}
|
||||
|
||||
automount() {
|
||||
name="`basename "$DEVNAME"`"
|
||||
|
||||
if [ -x "$PMOUNT" ]; then
|
||||
$PMOUNT $DEVNAME 2> /dev/null
|
||||
elif [ -x $MOUNT ]; then
|
||||
$MOUNT $DEVNAME 2> /dev/null
|
||||
fi
|
||||
|
||||
# If the device isn't mounted at this point, it isn't
|
||||
# configured in fstab
|
||||
grep -q "^$DEVNAME " /proc/mounts && return
|
||||
|
||||
# Get the unique name for mount point
|
||||
get_label_name "${DEVNAME}"
|
||||
|
||||
# Only go for auto-mounting when the device has been cleaned up in remove
|
||||
# or has not been identified yet
|
||||
if [ -e "/tmp/.automount-$name" ]; then
|
||||
logger "mount.sh/automount" "[$MOUNT_BASE/$name] is already cached"
|
||||
return
|
||||
fi
|
||||
|
||||
! test -d "$MOUNT_BASE/$name" && mkdir -p "$MOUNT_BASE/$name"
|
||||
# Silent util-linux's version of mounting auto
|
||||
if [ "x`readlink $MOUNT`" = "x/bin/mount.util-linux" ] ;
|
||||
then
|
||||
MOUNT="$MOUNT -o silent"
|
||||
fi
|
||||
|
||||
# If filesystem type 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`"
|
||||
;;
|
||||
swap)
|
||||
return ;;
|
||||
lvm*|LVM*)
|
||||
return ;;
|
||||
# TODO
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
if ! $MOUNT -t auto $DEVNAME "$MOUNT_BASE/$name"
|
||||
then
|
||||
#logger "mount.sh/automount" "$MOUNT -t auto $DEVNAME \"$MOUNT_BASE/$name\" failed!"
|
||||
rm_dir "$MOUNT_BASE/$name"
|
||||
else
|
||||
logger "mount.sh/automount" "Auto-mount of [$MOUNT_BASE/$name] successful"
|
||||
# The actual device might not be present in the remove event so blkid cannot
|
||||
# be used to calculate what name was generated here. Simply save the mount
|
||||
# name in our tmp file.
|
||||
echo "$name" > "/tmp/.automount-$name"
|
||||
fi
|
||||
}
|
||||
|
||||
rm_dir() {
|
||||
# We do not want to rm -r populated directories
|
||||
if test "`find "$1" | wc -l | tr -d " "`" -lt 2 -a -d "$1"
|
||||
then
|
||||
! test -z "$1" && rm -r "$1"
|
||||
else
|
||||
logger "mount.sh/automount" "Not removing non-empty directory [$1]"
|
||||
fi
|
||||
}
|
||||
|
||||
get_label_name() {
|
||||
# Get the LABEL or PARTLABEL
|
||||
LABEL=`/sbin/blkid | grep "$1:" | grep -o 'LABEL=".*"' | cut -d '"' -f2`
|
||||
# If the $DEVNAME has a LABEL or a PARTLABEL
|
||||
if [ -n "$LABEL" ]; then
|
||||
# Set the mount location dir name to LABEL appended
|
||||
# with $name e.g. label-sda. That would avoid overlapping
|
||||
# mounts in case two devices have same LABEL
|
||||
name="${LABEL}-${name}"
|
||||
fi
|
||||
}
|
||||
|
||||
# No ID_FS_TYPE for cdrom device, yet it should be mounted
|
||||
name="`basename "$DEVNAME"`"
|
||||
[ -e /sys/block/$name/device/media ] && media_type=`cat /sys/block/$name/device/media`
|
||||
|
||||
if [ "$ACTION" = "add" ] && [ -n "$DEVNAME" ] && [ -n "$ID_FS_TYPE" -o "$media_type" = "cdrom" ]; then
|
||||
# Note the root filesystem can show up as /dev/root in /proc/mounts,
|
||||
# so check the device number too
|
||||
if expr $MAJOR "*" 256 + $MINOR != `stat -c %d /`; then
|
||||
if [ "`basename $MOUNT`" = "systemd-mount" ];then
|
||||
automount_systemd
|
||||
else
|
||||
automount
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$ACTION" = "remove" ] || [ "$ACTION" = "change" ] && [ -x "$UMOUNT" ] && [ -n "$DEVNAME" ]; then
|
||||
name="`basename "$DEVNAME"`"
|
||||
tmpfile=`find /tmp | grep "\.automount-.*${name}$"`
|
||||
if [ ! -e "/sys/$DEVPATH" -a -e "$tmpfile" ]; then
|
||||
logger "mount.sh/remove" "cleaning up $DEVNAME, was mounted by the auto-mounter"
|
||||
for mnt in `cat /proc/mounts | grep "$DEVNAME" | cut -f 2 -d " " `
|
||||
do
|
||||
$UMOUNT "`printf $mnt`"
|
||||
done
|
||||
# Remove mount directory created by the auto-mounter
|
||||
# and clean up our tmp cache file
|
||||
mntdir=`cat "$tmpfile"`
|
||||
rm_dir "$MOUNT_BASE/$mntdir"
|
||||
rm "$tmpfile"
|
||||
fi
|
||||
fi
|
||||
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
# We get two "add" events for hostap cards due to wifi0
|
||||
echo "$INTERFACE" | grep -q wifi && exit 0
|
||||
|
||||
# udevd does clearenv(). Export shell PATH to children.
|
||||
export PATH
|
||||
|
||||
# if this interface has an entry in /etc/network/interfaces, let ifupdown
|
||||
# handle it
|
||||
if grep -q "iface \+$INTERFACE" /etc/network/interfaces; then
|
||||
case $ACTION in
|
||||
add)
|
||||
ifconfig | grep -q "^$INTERFACE" || ifup $INTERFACE
|
||||
;;
|
||||
remove)
|
||||
ifdown $INTERFACE
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
fi
|
||||
58
sources/poky/meta/recipes-core/udev/udev-extraconf_1.1.bb
Normal file
58
sources/poky/meta/recipes-core/udev/udev-extraconf_1.1.bb
Normal file
@@ -0,0 +1,58 @@
|
||||
SUMMARY = "Extra machine specific configuration files"
|
||||
HOMEPAGE = "https://wiki.gentoo.org/wiki/Eudev"
|
||||
DESCRIPTION = "Extra machine specific configuration files for udev, specifically information on devices to ignore."
|
||||
LICENSE = "MIT"
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
|
||||
|
||||
SRC_URI = " \
|
||||
file://automount.rules \
|
||||
file://mount.sh \
|
||||
file://mount.ignorelist \
|
||||
file://autonet.rules \
|
||||
file://network.sh \
|
||||
file://localextra.rules \
|
||||
"
|
||||
|
||||
S = "${WORKDIR}"
|
||||
|
||||
MOUNT_BASE = "/run/media"
|
||||
|
||||
do_install() {
|
||||
install -d ${D}${sysconfdir}/udev/rules.d
|
||||
|
||||
install -m 0644 ${WORKDIR}/automount.rules ${D}${sysconfdir}/udev/rules.d/automount.rules
|
||||
install -m 0644 ${WORKDIR}/autonet.rules ${D}${sysconfdir}/udev/rules.d/autonet.rules
|
||||
install -m 0644 ${WORKDIR}/localextra.rules ${D}${sysconfdir}/udev/rules.d/localextra.rules
|
||||
|
||||
install -d ${D}${sysconfdir}/udev/mount.ignorelist.d
|
||||
install -m 0644 ${WORKDIR}/mount.ignorelist ${D}${sysconfdir}/udev/
|
||||
|
||||
install -d ${D}${sysconfdir}/udev/scripts/
|
||||
|
||||
install -m 0755 ${WORKDIR}/mount.sh ${D}${sysconfdir}/udev/scripts/mount.sh
|
||||
sed -i 's|@systemd_unitdir@|${systemd_unitdir}|g' ${D}${sysconfdir}/udev/scripts/mount.sh
|
||||
sed -i 's|@base_sbindir@|${base_sbindir}|g' ${D}${sysconfdir}/udev/scripts/mount.sh
|
||||
sed -i 's|@MOUNT_BASE@|${MOUNT_BASE}|g' ${D}${sysconfdir}/udev/scripts/mount.sh
|
||||
|
||||
install -m 0755 ${WORKDIR}/network.sh ${D}${sysconfdir}/udev/scripts
|
||||
}
|
||||
|
||||
pkg_postinst:${PN} () {
|
||||
if [ -e $D${systemd_unitdir}/system/systemd-udevd.service ]; then
|
||||
sed -i "/\[Service\]/aMountFlags=shared" $D${systemd_unitdir}/system/systemd-udevd.service
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_postrm:${PN} () {
|
||||
if [ -e $D${systemd_unitdir}/system/systemd-udevd.service ]; then
|
||||
sed -i "/MountFlags=shared/d" $D${systemd_unitdir}/system/systemd-udevd.service
|
||||
fi
|
||||
}
|
||||
|
||||
RDEPENDS:${PN} = "udev util-linux-blkid ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'util-linux-lsblk', '', d)}"
|
||||
CONFFILES:${PN} = "${sysconfdir}/udev/mount.ignorelist"
|
||||
|
||||
# to replace udev-extra-rules from meta-oe
|
||||
RPROVIDES:${PN} = "udev-extra-rules"
|
||||
RREPLACES:${PN} = "udev-extra-rules"
|
||||
RCONFLICTS:${PN} = "udev-extra-rules"
|
||||
Reference in New Issue
Block a user