summaryrefslogtreecommitdiff
path: root/recipes-core/udev
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2019-10-24 18:49:50 -0500
committerSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2020-05-20 19:50:21 +0300
commit878a633a80e67dde0f790cac010fd1fd9dfa9e6c (patch)
tree23736c8ab51c466fe6b86ed708109e071111952c /recipes-core/udev
parent978059a76730c55d25f860b1e426e491a922f41b (diff)
downloadmeta-mlinux-878a633a80e67dde0f790cac010fd1fd9dfa9e6c.tar.gz
meta-mlinux-878a633a80e67dde0f790cac010fd1fd9dfa9e6c.tar.bz2
meta-mlinux-878a633a80e67dde0f790cac010fd1fd9dfa9e6c.zip
udev mount patch to add to blacklist capability
Diffstat (limited to 'recipes-core/udev')
-rw-r--r--recipes-core/udev/udev-extraconf/mount.patch68
1 files changed, 61 insertions, 7 deletions
diff --git a/recipes-core/udev/udev-extraconf/mount.patch b/recipes-core/udev/udev-extraconf/mount.patch
index 0c62873..1b475f3 100644
--- a/recipes-core/udev/udev-extraconf/mount.patch
+++ b/recipes-core/udev/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