Skip to contentSkip to conversation

Update SD card auto-mounting

PATCH In review Tom Rini 2 participants 7 messages Oct 23, 2013

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

cover Update SD card auto-mounting

The following short series gets SD card auto-mounting working again. I don't know if we want to try and push this new method upstream or if it's been decided to be distro policy (I assume the latter). This enables 'stat' on our busybox config which as the commit message explains is quite hard to replicate in just shell and avoids requiring coreutils and is a re-sync with openembedded-core. This is needed since /etc/udev/scripts/mount.sh requires 'stat' to exist and work for auto-mounting of things not in /etc/fstab. The next change adds a udev rule for mounting (and cleaning up) on SD card insertion (technically all mmcblk devices, so eMMC too, which is helpful). Finally, we drop the mount-sdcard package and initscript as we don't need it anymore.

Signature · 1 line
Tom
author
#1 lore raw

PATCH 1/3 busybox: add /usr/bin/stat applet

From: Andy Ross <[email protected]>

The busybox defconfig lacks a stat tool, the functionality of which cannot be reproduced in a way accessible to a shell script running in a minimal configuration. Enable, and modify the installation path to /usr/bin/stat to match the coreutils tool for proper alternatives handling.

[trini: Import ef7e123 from openembedded-core, so just a defconfig change]

---
 .../recipes-core/busybox/busybox/defconfig         |    4 ++--
 .../recipes-core/busybox/busybox_1.20.2.bbappend   |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
meta-arago-distro/recipes-core/busybox/busybox/defconfig +2 -2
index adafe0b..a54c32d 100644
@@ -264,8 +264,8 @@ CONFIG_SORT=y
 CONFIG_FEATURE_SORT_BIG=y
 # CONFIG_SPLIT is not set
 # CONFIG_FEATURE_SPLIT_FANCY is not set
-# CONFIG_STAT is not set
-# CONFIG_FEATURE_STAT_FORMAT is not set
+CONFIG_STAT=y
+CONFIG_FEATURE_STAT_FORMAT=y
 CONFIG_STTY=y
 # CONFIG_SUM is not set
 CONFIG_SYNC=y
meta-arago-distro/recipes-core/busybox/busybox_1.20.2.bbappend +1 -1
index be174ef..d3ff409 100644
@@ -1,7 +1,7 @@
 # look for files in this layer first
 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
 
-PR_append = "-arago9"
+PR_append = "-arago10"
 
 SRC_URI += " \
 	file://inetd \
Signature · 1 line
1.7.9.5
author
#2 lore raw

PATCH 2/3 udev: Add rule for automount (and handle removal of) SD cards

In reply to Tom Rini

Add rules to local.rules to call /etc/udev/scripts/mount.sh on insertion and removal of SD cards, to mount to /media/mmcblkXpY

---
 .../recipes-core/udev/udev/local.rules             |    3 +++
 1 file changed, 3 insertions(+)
meta-arago-distro/recipes-core/udev/udev/local.rules +3 -0
index d0b0216..45c3a46 100644
@@ -19,3 +19,6 @@ ACTION=="add", DEVPATH=="/devices/*", ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe
 # Create a symlink to any touchscreen input device
 SUBSYSTEM=="input", KERNEL=="event[0-9]*", ENV{ID_INPUT_TOUCHSCREEN}=="1", SYMLINK+="input/touchscreen0"
 
+# Auto-mount any SD cards
+ACTION=="add", KERNEL=="mmcblk[0-9]p[0-9]", SUBSYSTEM=="block", RUN+="/etc/udev/scripts/mount.sh"
+ACTION=="remove", KERNEL=="mmcblk[0-9]p[0-9]", SUBSYSTEM=="block", RUN+="/etc/udev/scripts/mount.sh"
Signature · 1 line
1.7.9.5
#3 lore raw

Re: [PATCH 2/3] udev: Add rule for automount (and handle removal of) SD cards

Forgot the PR bump

Quoted 40 lines

-----Original Message-----
From: [email protected] [mailto:meta-arago- [email protected]] On Behalf Of Rini, Tom
Sent: Wednesday, October 23, 2013 1:26 PM
To: [email protected]
Subject: [meta-arago] [PATCH 2/3] udev: Add rule for automount (and handle removal of) SD cards

Add rules to local.rules to call /etc/udev/scripts/mount.sh on insertion
and removal of SD cards, to mount to /media/mmcblkXpY

---
.../recipes-core/udev/udev/local.rules | 3 +++

1 file changed, 3 insertions(+)
meta-arago-distro/recipes-core/udev/udev/local.rules +0 -0
index d0b0216..45c3a46 100644
@@ -19,3 +19,6 @@ ACTION=="add", DEVPATH=="/devices/*",

ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe
# Create a symlink to any touchscreen input device SUBSYSTEM=="input", KERNEL=="event[0-9]*", ENV{ID_INPUT_TOUCHSCREEN}=="1", SYMLINK+="input/touchscreen0"

meta-arago-distro/recipes-core/udev/udev/local.rules +2 -0
+# Auto-mount any SD cards
+ACTION=="add", KERNEL=="mmcblk[0-9]p[0-9]", SUBSYSTEM=="block",

RUN+="/etc/udev/scripts/mount.sh" +ACTION=="remove", KERNEL=="mmcblk[0-9]p[0-9]", SUBSYSTEM=="block", RUN+="/etc/udev/scripts/mount.sh" --
1.7.9.5

_______________________________________________
meta-arago mailing list
[email protected]
http://arago-project.org/cgi-bin/mailman/listinfo/meta-arago

author
#4 lore raw

PATCH v2 2/3 udev: Add rule for automount (and handle removal of) SD cards

In reply to Tom Rini

Add rules to local.rules to call /etc/udev/scripts/mount.sh on insertion and removal of SD cards, to mount to /media/mmcblkXpY

---
 .../recipes-core/udev/udev/local.rules             |    3 +++
 .../recipes-core/udev/udev_182.bbappend            |    2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
meta-arago-distro/recipes-core/udev/udev/local.rules +3 -0
index d0b0216..45c3a46 100644
@@ -19,3 +19,6 @@ ACTION=="add", DEVPATH=="/devices/*", ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe
 # Create a symlink to any touchscreen input device
 SUBSYSTEM=="input", KERNEL=="event[0-9]*", ENV{ID_INPUT_TOUCHSCREEN}=="1", SYMLINK+="input/touchscreen0"
 
+# Auto-mount any SD cards
+ACTION=="add", KERNEL=="mmcblk[0-9]p[0-9]", SUBSYSTEM=="block", RUN+="/etc/udev/scripts/mount.sh"
+ACTION=="remove", KERNEL=="mmcblk[0-9]p[0-9]", SUBSYSTEM=="block", RUN+="/etc/udev/scripts/mount.sh"
meta-arago-distro/recipes-core/udev/udev_182.bbappend +1 -1
index 852620e..838cce8 100644
@@ -5,4 +5,4 @@
 # look for files in this layer first
 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
 
-PR_append = "-arago1"
+PR_append = "-arago2"
Signature · 1 line
1.7.9.5
author
#5 lore raw

PATCH 3/3 packagegroup-arago-tisdk-amsdk.bb, mount-sdcard: Remove mount-sdcard

In reply to Tom Rini

With a udev rule to invoke /etc/udev/scripts/mount.sh we no longer need the mount-sdcard package to handle this for us, so remove it.

---
 .../packagegroup-arago-tisdk-amsdk.bb              |    3 +-
 .../recipes-tisdk/mount-sdcard/mount-sdcard.bb     |   30 --------------------
 .../recipes-tisdk/mount-sdcard/mount-sdcard/init   |   20 -------------
 3 files changed, 1 insertion(+), 52 deletions(-)
 delete mode 100644 meta-arago-distro/recipes-tisdk/mount-sdcard/mount-sdcard.bb
 delete mode 100644 meta-arago-distro/recipes-tisdk/mount-sdcard/mount-sdcard/init
meta-arago-distro/recipes-core/packagegroups/packagegroup-arago-tisdk-amsdk.bb +1 -2
index ad32656..c2eb72b 100644
@@ -1,6 +1,6 @@
 DESCRIPTION = "Task to install additional packages only used in the Arago SDK"
 LICENSE = "MIT"
-PR = "r8"
+PR = "r9"
 
 inherit packagegroup
 
@@ -23,7 +23,6 @@ EXTRA_APPLICATIONS = "\
 "
 
 RDEPENDS_${PN} = "\
-    mount-sdcard \
     ${OOBE} \
     ${EXTRA_APPLICATIONS} \
 "
meta-arago-distro/recipes-tisdk/mount-sdcard/mount-sdcard.bb deleted +0 -30
deleted file mode 100644
index 29ff489..0000000
@@ -1,30 +0,0 @@
-# This recipe is meant to be a temporary fix until we can figure out why
-# the SD card partitions are not automounted anymore.
-
-DESCRIPTION = "Script to mount SD card partitions when available"
-
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
-
-# RDEPEND on udev since we re-use the mount.sh script
-RDEPENDS_${PN} += "udev"
-
-PACKAGE_ARCH = "all"
-
-inherit update-rc.d
-
-PR = "r0"
-
-SRC_URI = "file://init"
-
-INITSCRIPT_NAME = "mount-sdcard"
-
-# Mount it early enough that other scripts can find the partitions.
-INITSCRIPT_PARAMS = "defaults 90"
-
-do_install() {
-    install -d ${D}${sysconfdir}/init.d
-    install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/mount-sdcard
-}
-
-FILES_${PN} = "${sysconfdir} ${bindir}"
meta-arago-distro/recipes-tisdk/mount-sdcard/mount-sdcard/init deleted +0 -20
deleted file mode 100644
index 61200b5..0000000
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-devices="/dev/mmcblk0p1 /dev/mmcblk0p2 /dev/mmcblk0p3"
-
-case "$1" in
-    start )
-        for d in $devices
-        do
-            DEVNAME=$d ACTION=add /etc/udev/scripts/mount.sh > /dev/null 2>&1
-        done
-    ;;
-    stop )
-        for d in $devices
-        do
-            DEVNAME=$d ACTION=remove /etc/udev/scripts/mount.sh > /dev/null 2>&1
-        done
-    ;;
-esac
-
-exit 0;
Signature · 1 line
1.7.9.5
#6 lore raw
In reply to Tom Rini

Series Acked-by: Chase Maupin <[email protected]>

Quoted 34 lines

-----Original Message-----
From: [email protected] [mailto:meta-arago- [email protected]] On Behalf Of Rini, Tom
Sent: Wednesday, October 23, 2013 1:26 PM
To: [email protected]
Subject: [meta-arago] [PATCH 0/3] Update SD card auto-mounting

The following short series gets SD card auto-mounting working again. I
don't know if we want to try and push this new method upstream or if
it's been decided to be distro policy (I assume the latter). This enables 'stat' on our busybox config which as the commit message explains is quite hard to replicate in just shell and avoids requiring
coreutils and is a re-sync with openembedded-core. This is needed since
/etc/udev/scripts/mount.sh requires 'stat' to exist and work for auto-mounting of things not in /etc/fstab. The next change adds a udev
rule for mounting (and cleaning up) on SD card insertion (technically
all mmcblk devices, so eMMC too, which is helpful). Finally, we drop
the mount-sdcard package and initscript as we don't need it anymore.

--
Tom

_______________________________________________
meta-arago mailing list
[email protected]
http://arago-project.org/cgi-bin/mailman/listinfo/meta-arago