Forum Discussion
Altera_Forum
Honored Contributor
20 years agoproblem with usb driver
hi, I have boot uclinux kernel successful,then i plug a usb disk on my board,that's ok.But it show errors when i run the follow code: [/CODE]fdisk -l /dev/sda fdisk:Bad command or file name [...
Altera_Forum
Honored Contributor
20 years agoI wrote a little shell script to mount the USB stick, but I dont know if this is the best solution. I wanted to port autofs first but it was to heavyweight.
For the shell script I use /proc/partitions and /proc/mounts to automount. # !/bin/sh while true do grep sda /proc/partitions > /dev/zero if test $? -eq 0; then grep sda /proc/mounts > /dev/zero if test $? -eq 1; then echo "*** mount usbdisk ***" mount -n -t vfat /dev/sda /mnt/usb fi else grep sda /proc/mounts > /dev/zero if test $? -eq 0; then echo "*** unmount usbdisk ***" umount -n /mnt/usb fi fi sleep 1 done