Compilation du firmware
Pour débuter, il faut télécharger le firmware sur le site d'OpenWRT ou le compiler soit même:
mkdir openwrt cd openwrt wget http://downloads.openwrt.org/kamikaze/7.09/kamikaze_7.09.tar.bz2 tar -xjf kamikaze_7.09.tar.bz2 cd kamikaze_7.09 mkdir dl
Télécharger IPL_ixp400NpeLibrary-2_4.zip sur le site d'Intel et le placé dans le répertoire dl
Pour la configuration du firmware, choisir le type d'architecture (Target System (Intel XScale IXP4xx [2.6])) et le profile pour le slug (Target Profile (Linksys NSLU2)] ) en tappant make menuconfig. Sauver la configuration et tapper make pour compiler le tout
Si tout se passe bien dans le répertoire bin, il devrait y avoir le fichier openwrt-nslu2-2.6-squashfs.bin qui sera utilisé pour flasher le NSLU2.
Flasher
Mettre le NSLU2 en mode upgrade et taper la commande suivante :
upslug2 -i bin/openwrt-nslu2-2.6-squashfs.bin
NSLU2 00:13:10:d8:9f:ab Product ID: 1 Protocol ID: 0 Firmware Version: R23V63 [0x2363]
Upgrading LKGD8F9ED 00:13:10:d8:9f:ab
. original flash contents * packet timed out
! being erased - erased
u being upgraded U upgraded
v being verified V verified
Display:
<status> <address completed>+<bytes transmitted but not completed>
Status:
* timeout occured + sequence error detected
7fffff+000000 ...VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
Rebooting... done
Voici l'affichage de la console du NSLU2 pendant le démarrage. J'ai fait un CRTL+C pour demeurer dans le RedBoot et le mettre en mode upgrade. La suite de l'affichage se déroule pendant l'envoie du firmware avec upslug2 et le démarrage d'OpenWRT par la suite.
+Ethernet eth0: MAC address 00:13:10:d8:f9:ed
IP: 192.168.0.1/255.255.255.0, Gateway: 192.168.0.1
Default server: 0.0.0.0, DNS server IP: 0.0.0.0
RedBoot(tm) bootstrap and debug environment [ROMRAM]
Red Hat certified release, version 1.92 - built 15:16:07, Feb 3 2004
Platform: IXDP425 Development Platform (XScale)
Copyright (C) 2000, 2001, 2002, Red Hat, Inc.
RAM: 0x00000000-0x02000000, 0x000723a0-0x01ff3000 available
FLASH: 0x50000000 - 0x50800000, 64 blocks of 0x00020000 bytes each.
== Executing boot script in 2.000 seconds - enter ^C to abort
^C
RedBoot>
RedBoot> upgrade
Entry to download
download: GET_VERSION_INFO
download: GET_VERSION_INFO
download: DOWN_REQUEST normal
... Erase from 0x50060000-0x50800000: .............................................................
download: DOWN_RESET
... Resetting.+Ethernet eth0: MAC address 00:13:10:d8:f9:ed
IP: 192.168.0.1/255.255.255.0, Gateway: 192.168.0.1
Default server: 0.0.0.0, DNS server IP: 0.0.0.0
RedBoot(tm) bootstrap and debug environment [ROMRAM]
Red Hat certified release, version 1.92 - built 15:16:07, Feb 3 2004
Platform: IXDP425 Development Platform (XScale)
Copyright (C) 2000, 2001, 2002, Red Hat, Inc.
RAM: 0x00000000-0x02000000, 0x000723a0-0x01ff3000 available
FLASH: 0x50000000 - 0x50800000, 64 blocks of 0x00020000 bytes each.
== Executing boot script in 2.000 seconds - enter ^C to abort
RedBoot> boot;exec 0x01d00000
have eRcOmM
copy kernel code from flash to RAM
copy ramdisk file from flash to RAM
run kernel
Using base address 0x01d00000 and length 0x0000b834
Ans
APEX Boot Loader 1.5.8 -- Copyright (c) 2004,2005,2006,2007 Marc Singer
compiled for OpenWRT NSLU2 (bigendian)
APEX comes with ABSOLUTELY NO WARRANTY. It is free software and
you are welcome to redistribute it under certain circumstances.
For details, refer to the file COPYING in the program source.
apex => mem:0x00200000+0xb834 (47156 bytes)
env => nor:0x7f8000+16k (empty)
Use the command 'help help' to get started.
# copy $kernelsrc $bootaddr
# copy fis://kernel 0x00008000
1048544 bytes transferred
# wait 10 Type ^C key to cancel autoboot.
Type ^C key to cancel autoboot.
# boot
ATAG_HEADER
ATAG_MEM: start 0x00000000 size 0x02000000
ATAG_CMDLINE: (94 bytes) 'root=/dev/mtdblock4 rootfstype=squashfs,jffs2 console=ttyS0,115200 init=/etc/preinit noinitrd'
ATAG_END
Booting kernel at 0x00008000...
Uncompressing Linux................................................................. done, booting the kernel.
Linux version 2.6.21.6 (plec@cen3no) (gcc version 4.1.2) #1 Sun Jul 20 00:28:34 EDT 2008
CPU: XScale-IXP42x Family [690541f1] revision 1 (ARMv5TE), cr=000039ff
Machine: Linksys NSLU2
Memory policy: ECC disabled, Data cache writeback
CPU0: D VIVT undefined 5 cache
CPU0: I cache: 32768 bytes, associativity 32, 32 byte lines, 32 sets
CPU0: D cache: 32768 bytes, associativity 32, 32 byte lines, 32 sets
Built 1 zonelists. Total pages: 8128
Kernel command line: rtc-x1205.probe=0,0x6f root=/dev/mtdblock4 rootfstype=squashfs,jffs2 console=ttyS0,115200 init=/etc/preinit noinitrd
PID hash table entries: 128 (order: 7, 512 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 32MB = 32MB total
Memory: 30416KB available (1788K code, 167K data, 76K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
IXP4xx: Using 16MiB expansion bus window size
PCI: IXP4xx is host
PCI: IXP4xx Using direct access for memory space
PCI: bus0: Fast back to back transfers disabled
dmabounce: registered device 0000:00:01.0 on pci bus
dmabounce: registered device 0000:00:01.1 on pci bus
dmabounce: registered device 0000:00:01.2 on pci bus
NET: Registered protocol family 2
Time: OSTS clocksource has been installed.
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
NetWinder Floating Point Emulator V0.97 (double precision)
squashfs: version 3.0 (2006/03/15) Phillip Lougher
Registering mini_fo version $Id$
JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler deadline registered (default)
IXP4xx Watchdog Timer: heartbeat 60 sec
Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0xc8000000 (irq = 15) is a XScale
serial8250.0: ttyS1 at MMIO 0xc8001000 (irq = 13) is a XScale
IXP4XX Q Manager 0.2.1 initialized.
IXP4XX NPE driver Version 0.3.0 initialized
ixp_crypto: No HW crypto available
IXP4XX-Flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
Intel/Sharp Extended Query Table at 0x0031
Using buffer write method
cfi_cmdset_0001: Erase suspend on write enabled
Searching for RedBoot partition table in IXP4XX-Flash.0 at offset 0x7e0000
6 RedBoot partitions found on MTD device IXP4XX-Flash.0
Creating 6 MTD partitions on "IXP4XX-Flash.0":
0x00000000-0x00040000 : "RedBoot"
nslu2 mac: 00:13:10:d8:f9:ed
0x00040000-0x00060000 : "SysConf"
0x00060000-0x00080000 : "Loader"
0x00080000-0x00180000 : "Kernel"
0x00180000-0x007e0000 : "rootfs"
0x00260000-0x007e0000 : "rootfs_data"
0x007e0000-0x00800000 : "FIS directory"
npe: searching for firmware...
npe: found at 0x1c010, IXP425/NPE-B func: 00, rev: 2.1, size: 11964, id: 01000201
Image loaded to NPE-B Func:0, Rel: 2:1, Status: 80c00000
i2c /dev entries driver
x1205 0-006f: chip found, driver version 1.0.7
x1205 0-006f: rtc core: registered x1205 as rtc0
Registered led device: ready
Registered led device: status
Registered led device: disk-1
Registered led device: disk-2
nf_conntrack version 0.5.0 (256 buckets, 2048 max)
ip_tables: (C) 2000-2006 Netfilter Core Team
TCP westwood registered
NET: Registered protocol family 1
NET: Registered protocol family 17
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
XScale DSP coprocessor detected.
ixp4xx_mac driver 0.3.1: eth0 on NPE-B with PHY[1] initialized
x1205 0-006f: setting the system clock to 2008-07-20 22:48:36 (1216594116)
VFS: Mounted root (squashfs filesystem) readonly.
Freeing init memory: 76K
Warning: unable to open an initial console.
- preinit -
jffs2 not ready yet; using ramdisk
mini_fo: using base directory: /
mini_fo: using storage directory: /tmp/root
- init -
init started: BusyBox v1.4.2 (2008-07-20 00:17:27 EDT) multi-call binary
Please press Enter to activate this console. eth0: link up, 10Mbps, half-duplex, lpa 0x0021
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
PPP generic driver version 2.4.2
PCI: enabling device 0000:00:01.0 (0140 -> 0142)
ohci_hcd 0000:00:01.0: OHCI Host Controller
ohci_hcd 0000:00:01.0: new USB bus registered, assigned bus number 1
ohci_hcd 0000:00:01.0: irq 28, io mem 0x48000000
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 3 ports detected
PCI: enabling device 0000:00:01.1 (0140 -> 0142)
ohci_hcd 0000:00:01.1: OHCI Host Controller
ohci_hcd 0000:00:01.1: new USB bus registered, assigned bus number 2
ohci_hcd 0000:00:01.1: irq 27, io mem 0x48001000
usb usb2: configuration #1 chosen from 1 choice
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 2 ports detected
PCI: enabling device 0000:00:01.2 (0140 -> 0142)
ehci_hcd 0000:00:01.2: EHCI Host Controller
ehci_hcd 0000:00:01.2: new USB bus registered, assigned bus number 3
ehci_hcd 0000:00:01.2: irq 26, io mem 0x48002000
ehci_hcd 0000:00:01.2: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004
usb usb3: configuration #1 chosen from 1 choice
hub 3-0:1.0: USB hub found
hub 3-0:1.0: 5 ports detected
SCSI subsystem initialized
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
jffs2_build_filesystem(): unlocking the mtd device... done.
jffs2_build_filesystem(): erasing all blocks after the end marker... done.
mini_fo: using base directory: /
mini_fo: using storage directory: /jffs
Configuration de base
Interface réseau
Par défaut, l'adresse IP 192.168.1.77 est configuré.
Editer '''/etc/config/network et modifier
#config interface lan
option ifname eth0
option proto static
option ipaddr 192.168.1.77
option netmask 255.255.255.0
option gateway 192.168.1.1
option dns 192.168.1.1
option hostname nslu2
Pour :
config interface lan
option ifname eth0
option proto dhcp
option hostname nslu2
root@OpenWrt:~# cat /etc/ipkg.conf src release http://downloads.openwrt.org/kamikaze/7.09/ixp4xx-2.6/packages src packages http://downloads.openwrt.org/kamikaze/packages/armeb src nslu2 http://ipkg.nslu2-linux.org/feeds/openwrt/kamikaze-7.09 src optware http://ipkg.nslu2-linux.org/feeds/optware/openwrt-ixp4xx/cross/unstable src X-Wrt http://downloads.x-wrt.org/xwrt/kamikaze/snapshots/ixp4xx-2.6/packages dest root / dest ram /tmp
root@OpenWrt:~# ipkg update Downloading http://downloads.openwrt.org/kamikaze/7.09/ixp4xx-2.6/packages/Packages Updated list of available packages in /usr/lib/ipkg/lists/release Downloading http://downloads.openwrt.org/kamikaze/packages/armeb/Packages Updated list of available packages in /usr/lib/ipkg/lists/packages Downloading http://ipkg.nslu2-linux.org/feeds/openwrt/kamikaze-7.09/Packages Updated list of available packages in /usr/lib/ipkg/lists/nslu2 Downloading http://ipkg.nslu2-linux.org/feeds/optware/openwrt-ixp4xx/cross/unstable/Packages Updated list of available packages in /usr/lib/ipkg/lists/optware Downloading http://downloads.x-wrt.org/xwrt/kamikaze/snapshots/ixp4xx-2.6/packages/Packages Updated list of available packages in /usr/lib/ipkg/lists/X-Wrt
Références
- http://www.nslu2-linux.org/wiki/OpenWrt/HomePage
- http://www.nslu2-linux.org/wiki/OpenWrt/BuildInstructions
- http://www.nslu2-linux.org/wiki/HowTo/CompletelyBackupTheNSLU2
Misc
root@OpenWrt:/# df -k Filesystem 1k-blocks Used Available Use% Mounted on /dev/mtdblock5 5632 392 5240 7% /jffs mini_fo:/jffs 896 896 0 100% /

