Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
meta-elphel393
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
meta-elphel393
Commits
366f21d7
Commit
366f21d7
authored
May 31, 2016
by
Mikhail Karpenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add recipe for disks automounting
parent
c42f6208
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
0 deletions
+54
-0
core-image-elphel393.bb
recipes-core/images/core-image-elphel393.bb
+1
-0
90-elphel-automount.rules
recipes-core/udev-rules/files/90-elphel-automount.rules
+26
-0
udev-rules_1.0.bb
recipes-core/udev-rules/udev-rules_1.0.bb
+27
-0
No files found.
recipes-core/images/core-image-elphel393.bb
View file @
366f21d7
...
@@ -41,6 +41,7 @@ IMAGE_INSTALL_append += " python-core \
...
@@ -41,6 +41,7 @@ IMAGE_INSTALL_append += " python-core \
init-elphel393 \
init-elphel393 \
init-tempmon \
init-tempmon \
ahci-blacklist \
ahci-blacklist \
udev-rules \
"
"
#kernel-modules
#kernel-modules
...
...
recipes-core/udev-rules/files/90-elphel-automount.rules
0 → 100644
View file @
366f21d7
KERNEL!="sd[a-z][0-9]", GOTO="quit_automount"
# Import file system parameters; these parameters can be obtained with 'udevadm monitor --environment' command
IMPORT{program}="/sbin/blkid -o udev -p %N"
# Device has a label
ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}"
# Device has no file system, do not mount it
ENV{ID_FS_LABEL}=="", ENV{ID_FS_USAGE}=="", GOTO="quit_automount"
# Device has no label, but has a file system
ENV{ID_FS_LABEL}=="", ENV{ID_FS_USAGE}=="filesystem", ENV{dir_name}="%k"
# Mount device to /media if it is not SSD
ACTION=="add", ENV{ID_ATA_SATA}!="1", RUN+="/bin/mkdir -p /media/%E{dir_name}", RUN+="/bin/mount /dev/%k /media/%E{dir_name}"
# Mound device to /mnt if it is SSD
ACTION=="add", ENV{ID_ATA_SATA}=="1", RUN+="/bin/mkdir -p /mnt/%E{dir_name}", RUN+="/bin/mount /dev/%k /mnt/%E{dir_name}"
# Delete directory after removal
ACTION=="remove", ENV{ID_ATA_SATA}!="1", ENV{dir_name}!="", RUN+="/bin/rmdir /media/%E{dir_name}"
ACTION=="remove", ENV{ID_ATA_SATA}=="1", ENV{dir_name}!="", RUN+="/bin/rmdir /mnt/%E{dir_name}"
# Exit point
LABEL="quit_automount"
recipes-core/udev-rules/udev-rules_1.0.bb
0 → 100644
View file @
366f21d7
SUMMARY = "Extra initscripts for the Elphel 10393 board"
DESCRIPTION = "udev rules for automounting disk drives to /mnt or /media directories"
AUTHOR = "Elphel Inc."
HOMEPAGE = "http://www3.elphel.com/"
PRIORITY = "optional"
LICENSE = "GPLv3"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-3.0;md5=c79ff39f19dfec6d293b95dea7b07891"
PV = "${SRCDATE}"
PR = "r0"
SRC_URI = "file://90-elphel-automount.rules \
"
RDEPENDS_${PN} = "udev"
PACKAGES = "udev-rules"
UDEV_RULES_DIR = "${sysconfdir}/udev/rules.d"
FILES_${PN} += "${UDEV_RULES_DIR}/90-elphel-automount.rules"
do_install() {
install -d ${D}${UDEV_RULES_DIR}
install -m 644 ${WORKDIR}/90-elphel-automount.rules ${D}${UDEV_RULES_DIR}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment