0
votes

My rootfs is squashfs and I am trying to mount three JFFS2 partition on my flash device. But I want to set permissions for those partitions/directories.

The requirement is /readerconfig is only accessible by user with id 1001. /platform is only accessible by user with id 1001 /apps is only accessible (read,write and execute) by user with id 1000.

Below is my fstab entry.

rootfs               /                    squashfs   defaults              0  0 
proc                 /proc                proc       defaults              0  0
/dev/mtdblock12      /readerconfig        jffs2      rw,umask=0077,uid=1000,gid=1000,exec,noatime      0  0 
/dev/mtdblock13      /platform            jffs2      rw,umask=0077,uid=1000,gid=1000,exec,noatime      0  0 
/dev/mtdblock15      /apps                jffs2      rw,umask=0077,uid=1001,gid=1001,exec,noatime      0  0 
tmpfs                /var                 tmpfs      mode=0777                              0  0
tmpfs                /tmp                 tmpfs      mode=0777                              0  0
sysfs                /sys                 sysfs      nosuid,noexec,nodev                    0  0
/dev/mtdblock14      /etc                 jffs2      rw,mode=0777,uid=0,gid=0,noatime       0  0

Upon implementing, I found that the mount options like uid and gid are not set for JFFS2 file system mount points.

Here is the output of mount command on the target board.

> root@ti-omap3-am3517-evm:~# mount 
 >rootfs on / type rootfs (rw)
> /dev/root on / type squashfs (ro,relatime)
> devtmpfs on /dev type devtmpfs (rw,relatime,size=127428k,nr_inodes=31857,mode=755) 
> proc on  > /proc type proc (rw,relatime)
> /dev/mtdblock15 on /apps type jffs2  (rw,noatime)
> tmpfs on /var type tmpfs (rw,relatime,mode=777) 
> tmpfs on /tmp type tmpfs (rw,relatime,mode=777) 
> sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
> /dev/mtdblock12 on /readerconfig type jffs2 (rw,noatime) 
> /dev/mtdblock13 on /platform type jffs2 (rw,noatime)

How do I set permissions for the directories /readerconfig, /platform and /apps directory? Is it limitation of JFFS2 / mount command? or I can do it from rcS script? All alternatives are invited.

1
Jffs2 based mount point cannot be set with permissions. One has to change ownership using 'chown' command and/or set permissions using 'chmod' command.user1867459

1 Answers

0
votes

Jffs2 based mount point cannot be set with permissions. One has to change ownership using 'chown' command and/or set permissions using 'chmod' command.