+15055
-15037
File diff suppressed because it is too large
Load Diff
@@ -1 +1 @@
|
||||
48f3064573461efd3575e52600701f44e252833c
|
||||
393a6bbeb66b868d2a58cdfad6979c5fa7120bed
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
48e2053893607de612e30d240d1cb8ecd893c48a
|
||||
ef3b7951dcfaaae7a8ea036b7cc01fcbcb5f7276
|
||||
@@ -71,3 +71,6 @@ def install():
|
||||
pisitools.doman("man/*.5", "man/*.7", "man/*.8")
|
||||
|
||||
pisitools.dodoc("README*", "NOTES")
|
||||
|
||||
# Add rules for mount storage
|
||||
pisitools.insinto("/lib/udev/rules.d","rules/60-persistent-storage.rules")
|
||||
@@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
# start at sdb to ignore the system hard drive
|
||||
KERNEL!="sd[b-z]*", GOTO="exit"
|
||||
ACTION=="add", PROGRAM!="/sbin/blkid %N", GOTO="exit"
|
||||
|
||||
# import some useful filesystem info as variables
|
||||
IMPORT{program}="/sbin/blkid -o udev -p %N"
|
||||
|
||||
# get the label if present, otherwise assign one based on device/partition
|
||||
ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}"
|
||||
ENV{ID_FS_LABEL}=="", ENV{dir_name}="flash_drive_%k"
|
||||
|
||||
# create the dir in /media and symlink it to /mnt
|
||||
ACTION=="add", RUN+="/bin/mkdir -p '/media/%E{dir_name}'"
|
||||
|
||||
# global mount options
|
||||
#ACTION=="add", ENV{mount_options}="relatime"
|
||||
|
||||
# filesystem-specific mount options (777/666 dir/file perms for vfat)
|
||||
ACTION=="add",ENV{mount_options_vfat}="gid=100,dmask=000,fmask=111,utf8,flush,rw,noatime,users"
|
||||
|
||||
# add device to /etc/fstab
|
||||
#ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", RUN+="/bin/sed -i '$a\/dev/%k /media/%E{dir_name} vfat %E{mount_options_vfat} 0 0' /etc/fstab"
|
||||
|
||||
# mount device
|
||||
ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", RUN+="/bin/mount -t auto -o %E{mount_options_vfat} /dev/%k '/media/%E{dir_name}'"
|
||||
|
||||
# clean up after device removal
|
||||
ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/umount -l '/media/%E{dir_name}'", RUN+="/bin/rmdir '/media/%E{dir_name}'"
|
||||
ACTION=="remove", ENV{ID_FS_TYPE}!="", RUN+="/bin/sed -i '/\/dev\/%k /d' /etc/fstab"
|
||||
|
||||
# exit
|
||||
LABEL="exit"
|
||||
@@ -64,6 +64,7 @@
|
||||
</Files>
|
||||
<AdditionalFiles>
|
||||
<AdditionalFile owner="root" permission="0644" target="/usr/lib/tmpfiles.d/udev.conf">tmpfiles.conf</AdditionalFile>
|
||||
<AdditionalFile owner="root" permission="0644" target="/lib/udev/rules.d/10-flash-mounts.rules">10-flash-mounts.rules</AdditionalFile>
|
||||
</AdditionalFiles>
|
||||
<Provides>
|
||||
<COMAR script="package.py">System.Package</COMAR>
|
||||
@@ -119,6 +120,13 @@
|
||||
</Package>
|
||||
|
||||
<History>
|
||||
<Update release="5">
|
||||
<Date>2016-01-03</Date>
|
||||
<Version>3.1.2</Version>
|
||||
<Comment>Add rules for mount storage.</Comment>
|
||||
<Name>Ertuğrul Erata</Name>
|
||||
<Email>ertugrulerata@gmail.com</Email>
|
||||
</Update>
|
||||
<Update release="5">
|
||||
<Date>2015-06-20</Date>
|
||||
<Version>3.1.2</Version>
|
||||
|
||||
Reference in New Issue
Block a user