1) Compilation OpenWrt On récupère le trunk d'OpenWrt : $ svn co svn://svn.openwrt.org/openwrt/trunk/ Sélection de l'architecture : Target System (Marvell Kirkwood) ---> Target Profile (Globalscale Sheevaplug) ---> Target Images ---> [ ] ramdisk ---> --- Root filesystem archives [ ] cpio.gz [ ] tar.gz --- Root filesystem images [ ] ext4 [*] jffs2 [ ] squashfs --- Image Options Ajout du support USB : Kernel modules ---> USB Support ---> <*> kmod-usb-core Une fois que vous avez ajouté les modules ou autres outils voulus, lancer un make .A la fin de la compilation, vous devez trouver dans le répertoire bin/kirkwood le kernel et le rootfs : $ ls -1 bin/kirkwood/ md5sums openwrt-kirkwood-Sheevaplug-jffs2-128k.img openwrt-kirkwood-Sheevaplug-jffs2-64k.img openwrt-kirkwood-uImage packages Le partitionnement du Pogoplug à la réception se décompose comme ceci : #: name size offset mask_flags 0: u-boot 0x00100000 0x00000000 0 1: uImage 0x00400000 0x00100000 0 2: rootfs 0x02000000 0x00500000 0 3: data 0x05b00000 0x02500000 0 uImage contiendra le kernel : openwrt-kirkwood-uImage rootfs aura comme il indique le rootfs : openwrt-kirkwood-Sheevaplug-jffs2-128k.img data (qui sera renommé en rootfs_data) contiendra toutes les modifications du système (/overlay) Vu que la partition rootfs ne grandira jamais, car toute modification sera sur la partition rootfs_data, nous allons redéfinir les tailles. Récupérez la taille de votre rootfs : $ du -h bin/kirkwood/openwrt-kirkwood-Sheevaplug-jffs2-128k.img 4,1M bin/kirkwood/openwrt-kirkwood-Sheevaplug-jffs2-128k.img Editer le fichier build_dir/linux-kirkwood/linux-2.6.37.6/arch/arm/mach-kirkwood/sheevaplug-setup.c. Nous allons modifier la taille de rootfs, et rajouter une section pour rootfs_data. J'ai fixé une taille de 6mo (SZ_6M n'existe pas dans size.h) pour rootfs : }, { .name = "rootfs", .offset = MTDPART_OFS_NXTBLK, .size = 0x00600000 }, { .name = "rootfs_data", .offset = MTDPART_OFS_NXTBLK, .size = MTDPART_SIZ_FULL }, Une fois modifié, relancer la compilation avec la commande make .2) Pogoplug - Port rs232 La configuration du port rs232 est 115200 8N1. 3) Partitionnement Au boot, appuyer sur une touche pour avoir accès à uboot. Pour lister la table de partition, lancer la commande mtdparts Marvell>> mtdparts device nand0 <orion_nand>, # parts = 4 #: name size offset mask_flags 0: u-boot 0x00100000 0x00000000 0 1: uImage 0x00400000 0x00100000 0 2: rootfs 0x02000000 0x00500000 0 3: data 0x05b00000 0x02500000 0 Suppression des partitions rootfs et data : mtdparts del rootfs mtdparts del data Création de deux nouvelles partitions, rootfs de 6mo, rootfs_data avec la taille restante. La taille totale de la nand est de 0x8000000. > Nous allons créer rootfs à l'offset 0x00500000 (taille de uboot+uImage) avec une taille de 0x00600000 (6mo) > Puis rootfs_data à l'offset 0x00B00000 (0x00500000+0x00600000) avec un taille de 0x07500000 (0x8000000-(0x00100000+0x00400000+0x00600000)). mtdparts add nand0 0x00600000@0x00500000 rootfs mtdparts add nand0 0x07500000@0x00B00000 rootfs_data On vérifie avec mtdparts : Marvell>> mtdparts device nand0 <orion_nand>, # parts = 4 #: name size offset mask_flags 0: u-boot 0x00100000 0x00000000 0 1: uImage 0x00400000 0x00100000 0 2: rootfs 0x00600000 0x00500000 0 3: rootfs_data 0x07500000 0x00b00000 0 On sauvegarde le tout et on reboot : Marvell>> save Saving Environment to NAND... Erasing Nand... Erasing at 0xc0000 -- 100% complete. Writing to Nand... done Marvell>> reset 4) Installation OpenWrt : /!\ Ne lancez jamais la commande "nand erase" sans option, celle ci effacera toute votre nand, uboot y compris /!\ Toujours sur uboot, on modifie plusieurs variables : setenv bootargs console=ttyS0,115200 root=/dev/mtdblock2 rootfstype=jffs2 panic=10 setenv bootcmd 'nand read.e 0x2000000 0x100000 0x400000 ; bootm 0x2000000' setenv mainlineLinux yes setenv arcNumber 2097 setenv serverip 10.0.0.10 setenv ipaddr 10.0.0.1 saveenv reset On installe le kernel : tftp 0x2000000 openwrt-kirkwood-uImage nand erase 0x00100000 0x00400000 nand write 0x2000000 0x00100000 0x00400000 Puis le rootfs tftp 0x2000000 openwrt-kirkwood-Sheevaplug-jffs2-128k.img nand erase 0x00500000 0x00600000 nand write 0x2000000 0x00500000 0x0060000 On vide rootfs_data qui va devenir /overlay au boot : nand erase 0x00b00000 0x07500000 Et on reboot : Marvell>> reset Vous devriez avoir U-Boot 2010.09 (Oct 23 2010 - 11:51:16) Marvell-PinkPogo by Jeff Doozan SoC: Kirkwood 88F6281_A0 DRAM: 256 MiB NAND: 128 MiB In: serial Out: serial Err: serial Net: egiga0 88E1116 Initialized on egiga0 Hit any key to stop autoboot: 0 NAND read: device 0 offset 0x100000, size 0x400000 4194304 bytes read: OK ## Booting kernel from Legacy Image at 02000000 ... Image Name: Linux-2.6.37.6 Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 1132148 Bytes = 1.1 MiB Load Address: 00008000 Entry Point: 00008000 Verifying Checksum ... OK Loading Kernel Image ... OK OK Starting kernel ... Uncompressing Linux... done, booting the kernel. Linux version 2.6.37.6 (nicolas@itx) (gcc version 4.5.4 20110505 (prerelease) (Linaro GCC 4.5-2011.05-0) ) #19 Sun Jun 12 00:34:20 CEST 2011 CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=00053977 CPU: VIVT data cache, VIVT instruction cache Machine: Marvell SheevaPlug Reference Board ... |