Tiny Core Linux
Tiny Core Base => TCB Q&A Forum => Topic started by: Onyarian on February 14, 2009, 03:03:19 PM
-
The AAO has two storage expansion drives.
To access both I load at boot the mmc-2.6.26.tcem extension, who is located in the /tce directory, and in bootlocal.sh I have added modprobe sdhci.
All works ok.
They appear as /mnt/mmcblk0p1 and /mn/mmcblk1p1, but I have to mount both as root (with emelfm2 from the menu entry is possible to run as root).
My question is if it is possible to appear both entries in the mount tool of the control panel.
Now, with tc and the madwifi-hal, Xorg, OSS and the mmc extensions my AAO hardware is working near 100%.
Wow!
-
You can modify the mnttool fltk app and recompile it, ie add a call that does "cd /mnt && ls -1d mmcblk* >> /mnt/mountables; sync" or similar
If you don't prefer to do that, you can do something of a hack-ish workaround, such as the following:
mnttool &
sleep 1
killall mnttool
cd /mnt
ls -1d mmcblk* >> /tmp/mountables
chmod -w /tmp/mountables
mnttool 2> /dev/null &
Please note that these ideas are untested.
[revised code]
-
You can modify the mnttool fltk app and recompile it, ie add a call that does "cd /mnt && ls -1d mmcblk* >> /mnt/mountables; sync" or similar
If you don't prefer to do that, you can do something of a hack-ish workaround, such as the following:
mnttool &
sleep 1
killall mnttool
cd /mnt
ls -1d mmcblk* >> /mnt/mountables
chmod -w /mnt/mountables
mnttool 2> /dev/null &
Please note that these ideas are untested.
It's interesting how chmod -w works differently than chmod -x or chmod -r. If you're in root, it only negates write privileges in root, leaving them for the owner or others. Chmod -x or chmod -r would negate privileges across root, owner and others.
-
Hats,
thanks, but I have created monta.sh with
mnttool &
sleep 1
killall mnttool
cd /mnt
ls -1d mmcblk* >> /mnt/mountables
chmod -w /mnt/mountables
mnttool 2> /dev/null &
I execute it as root with sudo, because as user it says
./monta.sh: line 5: can't create /mnt/mountables: Permission denied
chmod: /mnt/mountables: Operation not permitted
and it creates /mnt/mountables file with
mmcblk0
mmcblk0p1
mmcblk1
mmcblk1p1
then appears the mount tool but without this two mountpoints
What else can I do?
-
The mounttool overwrites that file on start, so the only way would be to edit the source.
But since the sd/mmc driver is not yet in the base, I don't see how mnttool should have built-in support for it either. But if there are no objections, once .29 is out mmc will be included in base, and then the mount tool could be updated too.
-
Now, to mount it easier I have changed the mount command in the setup of Emelfm2 to sudo mount.
Goes like a charm
But I really would like to have the mount tool working.
-
There was a mistake in my first post. Here's a revised one:
mnttool &
sleep 1
killall mnttool
cd /mnt
ls -1d mmcblk* >> /tmp/mountables
chmod -w /tmp/mountables
mnttool 2> /dev/null &
This should be able to run without root privileges.
-
Bingo hats! :D
now as user and appears in mount tool!
Thanks!
-
Onyarian, could you post your /proc/partitions? I wonder if the mmc* devices are mentioned there.
-
Curaga, the file /proc/partitions is empty:
Item: /proc/partitions
Type: ASCII text
Size: 0 bytes
User: root
Group: root
Permissions: r-- r-- r--
Accessed: Mon 16 Feb 2009 04:34 PM
Modified: Mon 16 Feb 2009 04:34 PM
Changed: Mon 16 Feb 2009 04:34 PM
there is a symbolic link /proc/mounts to /proc/self/mounts but is empty too
Item: /proc/self/mounts
Type: ASCII text
Size: 0 bytes
User: root
Group: root
Permissions: r-- r-- r--
Accessed: Mon 16 Feb 2009 04:30 PM
Modified: Mon 16 Feb 2009 04:30 PM
Changed: Mon 16 Feb 2009 04:30 PM
Helps?
-
You would need to cat /proc/partitions to see the contents.
But they also appear in /etc/fstab as they should.
When I was writing mnttool, the sd card on the eeepc works as expected.
Now that I have a Dell Mini 9, I can see the issue.
Since mnttool dynamically scans upon each cycle, I can improve the parsing to pick up such devices.
-
Hats,
I have made a little change in
ls -1d mmcblk* >> /tmp/mountables
to
ls -1d mmcblk?p* >> /tmp/mountables
so in the mount tool there is only mmcblk0p1, and not both mmcblk0 and mmcblk0p1
like there is sda1, and not sda1 and sda
Curaga,
this is the result of cat /proc/partitions:
major minor #blocks name
7 0 3924 loop0
7 1 26848 loop1
7 2 108 loop2
7 3 1022 loop3
7 4 532 loop4
7 5 68 loop5
7 6 372 loop6
7 7 112 loop7
22 0 7880544 hdc
22 1 6827593 hdc1
22 2 1052257 hdc2
8 0 1024000 sda
8 1 1020096 sda1
7 8 668 loop8
7 9 600 loop9
7 10 772 loop10
7 11 3384 loop11
7 12 120 loop12
7 13 584 loop13
7 14 1032 loop14
7 15 714 loop15
7 16 1382 loop16
7 17 444 loop17
179 0 15694336 mmcblk0
179 1 15690240 mmcblk0p1
Roberts,
When I see the mount tool before exec monta.sh there are two drives: hdc1 and sda1
if I put a new usb-pendrive, in a few moments appear in the mount tool: hdc1, sda1 and sdb1, but is not incorporated the mmcblk. Only when I exec the monta.sh it appears.
-
Now I have access to mmcblk0p1 but this access is only for read. the owner and group is root (I can't change this root permission even registered as root)
I see in fstab that tc creates access to sda1 with umask=000
# /etc/fstab
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
devpts /dev/pts devpts defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
/dev/hdc /mnt/hdc auto noauto,users,exec 0 0 # Added by TC
/dev/hdc1 /mnt/hdc1 ext2 noauto,users,exec,relatime 0 0 # Added by TC
/dev/hdc2 none swap defaults 0 0 # Added by TC
/dev/sda /mnt/sda auto noauto,users,exec 0 0 # Added by TC
/dev/sda1 /mnt/sda1 vfat noauto,users,exec,umask=000 0 0 # Added by TC
/dev/mmcblk0 /mnt/mmcblk0 auto noauto,users,exec 0 0 # Added by TC
/dev/mmcblk0p1 /mnt/mmcblk0p1 auto noauto,users,exec 0 0 # Added by TC
the result of cat /etc/mtab:
rootfs / rootfs rw 0 0
/proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
devpts /dev/pts devpts rw,mode=600 0 0
tmpfs /dev/shm tmpfs rw 0 0
/dev/sda1 /mnt/sda1 vfat rw,nosuid,nodev,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=iso8859-1 0 0
/dev/loop0 /tmp/tcloop/OSS iso9660 ro 0 0
/dev/loop1 /tmp/tcloop/Xorg-7.4 iso9660 ro 0 0
/dev/loop2 /tmp/tcloop/conky cramfs ro 0 0
/dev/loop3 /tmp/tcloop/dbus_glib iso9660 ro 0 0
/dev/loop4 /tmp/tcloop/emelfm2 cramfs ro 0 0
/dev/loop5 /tmp/tcloop/expat2 cramfs ro 0 0
/dev/loop6 /tmp/tcloop/file cramfs ro 0 0
/dev/loop7 /tmp/tcloop/fontconfig cramfs ro 0 0
/dev/loop8 /tmp/tcloop/glib2 cramfs ro 0 0
/dev/loop9 /tmp/tcloop/graphics-2.6.26 iso9660 ro 0 0
/dev/loop10 /tmp/tcloop/graphics-libs-1 cramfs ro 0 0
/dev/loop11 /tmp/tcloop/gtk+-2 cramfs ro 0 0
/dev/loop12 /tmp/tcloop/leafpad-0.8.16-le cramfs ro 0 0
/dev/loop13 /tmp/tcloop/libxml2 cramfs ro 0 0
/dev/loop14 /tmp/tcloop/openssl-0.9.8h cramfs ro 0 0
/dev/loop15 /tmp/tcloop/ttf-bitstream-vera iso9660 ro 0 0
/dev/loop16 /tmp/tcloop/wireless-2.6.26 iso9660 ro 0 0
/dev/loop17 /tmp/tcloop/wireless_tools iso9660 ro 0 0
/dev/mmcblk0p1 /mnt/mmcblk0p1 vfat rw,nosuid,nodev,fmask=0022,dmask=0022,allow_utime=177777,codepage=cp437,iocharset=iso8859-1 0 0
How can I put the umask=000 to the mmcblk0p1 or have write access to mmcblk0p1 every time I mount it?
edited 2009/2/18:
How can I put the umask=000 to the mmcblk0p1 or have write access to mmcblk0p1 every time I mount it with mount tool?
I know manually with
mount -t vfat -o users,exec,umask=000 /dev/mmcblk0p1 /mnt/mmcblk0p1
-
The mount tool uses fstab options, so add it to the relevant line:
/dev/mmcblk0p1 /mnt/mmcblk0p1 auto noauto,users,exec,umask=000 0 0 # Added by TC
-
Thanks Curaga,
but seems that it is not so easy.
If I simply add this to fstab it is not restored in a new boot
Then if I put the modified fstab in .filetool.lst then in a new boot it stay but is not created the entries /mnt/mmcblk0 and /mnt/mmcblk0p1 in /mnt and monta.sh gives error.
Then if I copy the modified fstab to /home/tc, delete the entry in .filetools.lst and in the new boot I exec this modified monta.sh:
sudo cp fstab /etc/fstab
mnttool &
sleep 1
killall mnttool
cd /mnt
ls -1d mmcblk?p* >> /tmp/mountables
chmod -w /tmp/mountables
mnttool 2> /dev/null &
in the mount tool I found the entry mmcblk0p1 but It can't be mounted because seems that it is not in mtab
so seems that the only possibility is to mount it manually with
mount -t vfat -o users,exec,umask=000 /dev/mmcblk0p1 /mnt/mmcblk0p1
and forget the mount tool
-
The issue you are now facing is not really a mnttool concern but fstab instead.
mnttool uses fstab for mount options.
fstab does not "see" your mmc device as vfat and therefore uses "auto" as the fstype and hence no umask=000
What does fdisk -l show for your mmc device?
-
Those dirs are probably not created if the modules weren't loaded yet.
afaik mtab shows mounted stuff, so there's no use looking in there.
You could test it out first after replacing the line in fstab, i.e. with `mount /mnt/mmcblk0p1 `
-
After boot and mmc.tce loaded during boot, and with /mnt/mmcblk0p1 created, the fdisk -l don't detect mmc drive:
tc@box:~$ fdisk -l
Disk /dev/hdc: 8069 MB, 8069677056 bytes
255 heads, 63 sectors/track, 981 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hdc1 * 1 850 6827593+ 83 Linux
/dev/hdc2 851 981 1052257+ 82 Linux swap
Disk /dev/sda: 1048 MB, 1048576000 bytes
255 heads, 63 sectors/track, 127 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 127 1020096 b Win95 FAT32
But now seems to work when I substitute in fstab
/dev/mmcblk0p1 /mnt/mmcblk0p1 auto noauto,users,exec,umask=000 0 0 # Added by TC
with
/dev/mmcblk0p1 /mnt/mmcblk0p1 vfat noauto,users,exec,umask=000 0 0 # Added by TC
Thanks to both!