Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
ACTIVATING USB AND SETTING UP PRINTING AND MOUNTING AN EXTERNAL USB STORAGE DEVICE
The Tutorial is made using a ASUS WL-500G Deluxe (or WL-500GX and WL-500GD as it is sometimes called).
It should however apply to all "OpenWRT Com patible" devices, even though some details like hardware addresses,
storage locations and so on could differ if you use other hardware. Check out the General OpenWRT Tutorial Inform ation
page for more information.
This tutorial will provide you information on mounting external USB Storage devices on startup, and will also provide
you a working print server.
Tutorial Index
1. Prerequisites - What is needed to get started.
2. Installing and activating USB drivers
3. Configuring Storage for use
4. Configuring Printer for use as Netw orked Printer
Prerequisites
All you need is :
An OpenWRT compatible router
OpenWRT 1.0 WhiteRussian RC2 or later
USB ports on your router
The above w ill install support for USB1.1 and USB2.0 devices. Both drivers for storage and printers are installed.
Next add the follow ing to the bottom of the file /etc/modules
usbcore
ehci-hcd
uhci
scsi_mod
sd_mod
sg
usb-storage
printer
Now connect your USB Storage device (harddrive or usb memory stick or w hatever). When I connect my USB 2.0 harddrive that is split in 3 partitions to the USB 2.0
port that is closed to the LAN ports, I see this in the log :
jan 1 01:01:48 (none) kern.info kernel: hub.c: new USB device 01:02.2-1, assigned address 2
Jan 1 01:01:48 (none) kern.info kernel: scsi0 : SCSI emulation for USB Mass Storage devices
Jan 1 01:01:48 (none) kern.warn kernel: Vendor: USB 2.0 Model: Storage Device Rev: 0100
Jan 1 01:01:48 (none) kern.warn kernel: Type: Direct-Access ANSI SCSI revision: 02
Jan 1 01:01:48 (none) kern.warn kernel: Attached scsi disk sda at scsi0, channel 0, id 0, lun 0
Jan 1 01:01:48 (none) kern.warn kernel: SCSI device sda: 39070080 512-byte hdwr sectors (20004 MB)
Jan 1 01:01:48 (none) kern.info kernel: Partition check:
Jan 1 01:01:48 (none) kern.info kernel: p1 p2 p3
Jan 1 01:01:48 (none) kern.debug kernel: WARNING: USB Mass Storage data integrity not assured
Jan 1 01:01:48 (none) kern.debug kernel: USB Mass Storage device found at 2
When connecting my USB printer to the other USB port this appears in the syslog:
Jan 1 00:03:42 (none) kern.info kernel: hub.c: new USB device 01:02.0-2, assigned address 2
Jan 1 00:03:42 (none) kern.info kernel: printer.c: usblp0: USB Bidirectional printer dev 2 if 0 alt 1 proto 2 vid 0x03F0 pid 0x1E11
If you see something simular, the kernel has found your hardw are, and are now ready to use it.
{mosgoogle bot}
macsat.com/…/contentwindow.p… 1/2
21-04-2010 Content Preview
w indow s). To add support for theese filesystems you need to run
:
ipkg install kmod-ext2
ipkg install kmod-ext3
ipkg install kmod-vfat
Now you can mount your drive, in my case I mount partition 2 to /opt (w hich I have created w ith mkdir /opt beforehand)
mount /dev/scsi/host0/bus0/target0/lun0/part2 /opt/
Enabeling at boot-tim e
For making the device mount to /opt at boot time, I have made the script /etc/init.d/S11mount :
#!/bin/sh
#
# macsat.com mount script
#
i=0
# Wait 15 secs, mount when ready, and continue if it dosnt get ready within 15
secs.
while [ $i -le 15 ]
do
if [ -e $MOUNT_DEVICE0 ]
then
mount $MOUNT_DEVICE0 /opt/
echo "Success: $MOUNT_DEVICE0"
exit 0
fi
sleep 1
i=`expr $i + 1`
done
Be sure to change the MOUNT_DEVICE0 statement to w hatever your device might be (usb disk, usb flash memory, ide harddrive or w hatever!).
For help in setting up your computers for RAW printing, you could check out Olegs exellent printing guide
Close Print
macsat.com/…/contentwindow.p… 2/2