Difference between revisions of "Hammer How to Thumb Drive"

From eLinux.org
Jump to: navigation, search
m
Line 5: Line 5:
 
* USB Storage
 
* USB Storage
 
* SCSI, including generic support.
 
* SCSI, including generic support.
configured in your [[Hammer_How_to_build_Kernel|kernel]].
+
configured in your [[Hammer_How_to_build_Kernel|kernel]]. Also be sure to activate the Kernel Automounter so your Thumb Drive will be automatically mounted at bootup.
 +
 
 
One way to get the USB Thumb Drive recognized and mounted is:
 
One way to get the USB Thumb Drive recognized and mounted is:
  
 
Add the necessary commands to the '''inittab''' file:
 
Add the necessary commands to the '''inittab''' file:
* cd buildroot/target/device/Samsung/Hammer/target_skeleton
+
* cd buildroot/target/device/Samsung/Hammer/target_skeleton/etc
 
* edit the '''inittab'''.
 
* edit the '''inittab'''.
 
* Add these commands right ''below the jffs2'' line:
 
* Add these commands right ''below the jffs2'' line:

Revision as of 02:45, 21 January 2008

You can add a USB Thumb Drive to your Hammer pretty easily. There are a few things you have to have in your kernel. Your Thumb Drive will be recognized as a SCSI device, probably /dev/sda1, if it is the only SCSI type device you have. When the usb-storage module loads, it will show which SCSI device you Thumb Drive is.

You must have:

  • USB Core
  • USB Storage
  • SCSI, including generic support.

configured in your kernel. Also be sure to activate the Kernel Automounter so your Thumb Drive will be automatically mounted at bootup.

One way to get the USB Thumb Drive recognized and mounted is:

Add the necessary commands to the inittab file:

  • cd buildroot/target/device/Samsung/Hammer/target_skeleton/etc
  • edit the inittab.
  • Add these commands right below the jffs2 line:
 null::sysinit:/sbin/modprobe usb-storage
 null::sysinit:/bin/sleep 10

This will load the usb-storage module and wait for it to settle down.

Now you have to fix up the mount point where you want the Thumb Drive to appear. You can add a new mount point by editing the buildroot/target/device/Samsung/Hammer/device_table.txt file. If you want to mount your Thumb Drive at /opt (recommended for starters) then add the following line to device_table.txt:

/opt            d       755     0       0       -       -       -       -       -

Now it is time to add the Thumb Drive to your file system. When you build your rootfs, the /opt directory will be created for you with the permissions you set.

Now edit buildroot/target/device/Samsung/Hammer/target_skeleton/etc/fstab file to add your mount point as follows:

/dev/sda1       /opt            ext2    defaults                0       0

You can setup your Thumb drive for any mount point you want using this procedure. This allows the Thumb Drive to be automatically setup and mounted for use.