NSLU as IPV6 Sixxs Gateway & Prolific 2303 Serial Cable with OpenWRT

For USB 1.1, try installing the UHCI drivers first and test them:
opkg install kmod-usb-uhci
insmod usbcore
insmod uhci

If you see the message uhci: No such device then your hardware is not an UHCI device. Remove the package and try installing OHCI.
opkg install kmod-usb-ohci
insmod usb-ohci

Modules for USB 2.0

This package includes the modules for USB 2.0.
opkg install kmod-usb2
insmod ehci-hcd

If you see messages like unresolved symbol usb_calc_bus_time try loading usbcore and then try ehci-hcd again:
load usbcore
insmod usbcore
insmod ehci-hcd

Install the kernel module to support the USB to RJ45 Prolific Cable from Current Cost to support reading from the Envi
opk install kmod-usb-serial-pl2303
This installs also installs other modules i think (usbserial…)
You can check if the module is correctly loaded by running
lsmod|grep pl2303

For troubleshooting is recommended installing usbutils
opkg install usbutils

With this you could list all USB devices connected to you device as for example:
root@OpenWrt:~# lsusb
Bus 002 Device 002: ID 0457:0151 Silicon Integrated Systems Corp. Super Flash 1GB / GXT 64MB Flash Drive
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Now you want to boot from a USB pen your device, since NSLU hasn’t enough space in it: (http://www.nslu2-linux.org/wiki/OpenWRT/BootFromUsbDevice)
First of all make sure you have all the modules required:

ipkg update
ipkg install kmod-usb-core kmod-usb-uhci kmod-scsi-core kmod-usb-storage kmod-fs-ext2 kmod-fs-ext3

Then load these modules:

insmod ext2
insmod jbd
insmod ext3

Install e2fsprogs and fdisk

ipkg install e2fsprogs fdisk
Partition your disk. I have a 1GB Verbatim StoreNGo and used 700 MB for ext2 and 300 MB for swap

fdisk /dev/sda <- change this to your device

(Help to configure partitions: http://wiki.openwrt.org/inbox/howto/configure-external-storage-overlay)

Then format your partition:

mke2fs /dev/sda1
Mount it and copy the filesystem to your USB-device

mount -t ext2 /dev/sda1 /mnt
mkdir /tmp/root
mount -o bind /rom /tmp/root
cp /tmp/root/* /mnt -a
umount /tmp/root
umount /mnt

vi /etc/init.d/pivotroot
copy and paste this into /etc/init.d/pivotroot

This is my file with RC4. Changed somethings i think

# change this to your boot device
/sbin/hotplug2 –override –persistent –max-children 1 –no-coldplug &
for module in usbcore uhci scsi_mod sd_mod usb-storage jbd ext2 ext3 ; do {
insmod $module
}; done

# this may need to be higher if your disk is slow to initialize
sleep 20s
# mount the usb stick
mount “$boot_dev” /mnt
# if everything looks ok, do the pivot root
killall hotplug2
[ -x /mnt/sbin/init ] && {
mount -o move /proc /mnt/proc && \
pivot_root /mnt /mnt/mnt && {
mount -o move /mnt/dev /dev
mount -o move /mnt/tmp /tmp
mount -o move /mnt/jffs2 /jffs2 2>&-
mount -o move /mnt/sys /sys 2>&-

Then make it executable

chmod a+x /etc/init.d/pivotroot

Now, make the symlink so it will start at boot time

ln -s /etc/init.d/pivotroot /etc/rc.d/S10pivotroot

replace everything in /etc/init.d/rcS with this

vi /etc/init.d/rcS

This is my file with RC4. Changed somethings i think

# Copyright (C) 2006 OpenWrt.org
if [ “$2” == “boot” ] ; then
echo /etc/init.d/pivotroot
for i in /etc/rc.d/$1*; do
$i $2 2>&1
} | logger -s -p 6 -t ” &

Now reboot and telnet to your slug
Use ‘passwd’ to set your new root password

Log in with ssh
To make sure it works type ‘df -h’
Which will give you something like this

root@OpenWrt:/# df -h
Filesystem Size Used Available Use% Mounted on
/dev/sda1 1.0M 1.0M 0 100% /mnt/rom
/dev/mtdblock5 5.4M 752.0k 4.6M 14% /mnt/jffs
mini_fo:/jffs 1.0M 1.0M 0 100% /mnt
/dev/sda1 656.1M 19.0M 603.7M 3% /

Fixup resolv.conf symlink

rm /etc/resolv.conf
ln -s /tmp/resolv.conf.auto /etc/resolv.conf

If you created a swap partition you may want to use it

ipkg update
ipkg install swap-utils
mkswap /dev/sda2
swapon /dev/sda2

Make it start at boot time

echo “#!/bin/sh” >> /etc/init.d/swapspace
echo “swapon /dev/sda2” >> /etc/init.d/swapspace
chmod a+x /etc/init.d/swapspace
ln -s /etc/init.d/swapspace /etc/rc.d/S99swapspace

Use free to see if it worked

root@OpenWrt:/etc# free
total used free shared buffers
Mem: 30472 11628 18844 0 960
Swap: 297192 0 297192
Total: 327664 11628 316036

All done…

IPV6(see for details http://www.sixxs.net/wiki/Aiccu/Installing_on_OpenWRT)

opkg update
opkg install kmod-ipv6
opkg install kmod-ip6tables
opkg install ip6tables
opkg install ip
opkg install kmod-tun
opkg install aiccu
opkg install radvd
opkg install ntpclient
im my case had to do "insmod ipv6" to load the ipv6 module, as aiccu is complainting about no ipv6 stack, and lsmod didn't reveal it installed

Leave a Reply

Your email address will not be published. Required fields are marked *