]> code.ossystems Code Review - openembedded-core.git/commitdiff
udev-extraconf: allow users in disk group to write vfat filesystem
authorHongxu Jia <hongxu.jia@windriver.com>
Tue, 16 Jul 2013 07:33:35 +0000 (15:33 +0800)
committerSaul Wold <sgw@linux.intel.com>
Thu, 18 Jul 2013 14:14:41 +0000 (07:14 -0700)
If filesystem type is vfat, change the ownership group to 'disk', and grant it
with  w/r/x permissions.

The user which belongs to 'disk' group could write the storage.

[YOCTO #4004]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
meta/recipes-core/udev/udev-extraconf/mount.sh

index d1419ed09c8302079aca36f488c171b4b8735057..327cfc6477bc0a10a337f440d50a5a2b695f53e0 100644 (file)
@@ -27,6 +27,17 @@ automount() {
                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`"
+               ;;
+       # TODO
+       *)
+               ;;
+       esac
+
        if ! $MOUNT -t auto $DEVNAME "/media/$name"
        then
                #logger "mount.sh/automount" "$MOUNT -t auto $DEVNAME \"/media/$name\" failed!"