How to install Gentoo to WD My Book World edition (white light) The most recent version of this readme is at: http://devnull.samersoff.net/cgi-bin/forum/Blah.pl?m-1282935985/ Lasy guys see the end of this file for link to all the staff bundled together. Precaution: 1. Make sure you make a full (including a spare partitions) backup of virgin MyBook, becuase there is no way to restore original firmware if you will need it. 2. I strictly suggest to wire com console (personally I use Nokia DKU-5 cable as 3.3v com to USB converter) otherwise you couldn't determine what goes wrong if the system will not boot. 3. I don't know (yet?) how to deal with LEON copro and turn off it's support in kernel. So you could experience slowdown of your ipsec vpn or something like this. 4. Below I assume that HDD of MyBook is /dev/sdb, adjust it to fit your actual configuration 5. if you decide to use files from my installation notice: I use 100Gb XFS sda1 for gentoo, 1Gb sda2 for SWAP, and 900G sda3 is left for rest of the world. No raid support. ext2, ext3, usb etc compiled as modules. eth0 compiled in firmware-less (LEON-less) mode. 6. Notice link section at the end of this readme. General information: WD based on Osford smiconductors oxnas 810 board. It holds: LEON sprcv8 copro, oxnas SATA interface, Intel EHCI compatible USB host, Synopsis GMAC 1Gb NIC. It doesn't have RT clock chip despite the fact original firmware try to initialize it. Original kernel based on 2.6.24 linux kernel and built with eabi/ulibc. Boot loader consists of two stages - proprietary stage1 and u-boot. u-boot doesn't support Ethernet so tftp boot is not possible. First five cyllinders of hdd is reserved for boot and kernel image so first partition started from cyl 5. COM is 3.3v, console operates on 115200,8N1, xon/xoff and it's UART2 Pre-requirements: 1. GPL sources from WD site 2. Precompiled mbr, stage1, u-boot and kernel images, you can start from blank page, install one of cross development framework and build everything from scratch but this way is not covered here. 3. Gentoo stage3 for arm and portage archive Also you should have the way to access you HDD from host linux machine (e.g. SATA-to-USB adapter) Installation steps: 1. Clean your HDD (dd if=/dev/zero of=/dev/sdb bs=512 count=10000) 2. Install boot images dd if=./mbr of=/dev/sdb bs=512 seek=0 dd if=./stage1 of=/dev/sdb bs=512 seek=1 dd if=./u-boot.wrapped of=/dev/sdb bs=512 seek=3 3. Install pre-compiled kernel dd if=./uImage of=/dev/sdb bs=512 seek=336 4. Edit partition table as necessary 5. Make filesystem. Don't initialize swap. If your whant to use raid (md driver) make sure that version of md on your host much one usend on MyBook (0.90) 6. Mount sdb1 and extract stage3 and portage 7. Install additional software - you have to install ntpclient and mkimage also you may need vi, lrzsz and sysklogd 8. Setup console change /etc/inittab s0:12345:respawn:/sbin/agetty 115200 ttyS0 vt100 add to your .profile stty rows 40 9. Create /sdbin/rc0 to get clock from the network at early boot /bin/mount -t proc proc /proc /sbin/ifconfig eth0 inet 192.168.0.57 /sbin/route add default gw 192.168.0.1 /bin/ntpclient -c 1 -h ntp0.uk.uu.net and change /etc/inittab i0::sysinit:/sbin/rc0 i1::sysinit:/sbin/rc sysinit 10. edit /etc/fstab accroding to your partition layout 11. Edit /etc/shadow - remove * to have password less root account 12. Enable sshd i.e. link /etc/init.d/sshd to /etc/runlevels/default/ Change /etc/sshd_config - say yes to PermitRootLogin and PermitEmptyPasswords 13. Plug HDD back to MyBook and boot device 14. ssh to box and setup os as you like. Kernel re-compilation on device: 1. Have a good cup of cofee - it takes a while 2. Unpack kernel source obtained from wdc site 3. Create symlink /usr/src/linux -> kernel-source/kernel-0.4.6 4. Edit /usr/src/linux/Makefile, ARCH ?= $(SUBARCH) CROSS_COMPILE ?= 5. cd /usr/src/linux make oxnas_810_eabi_wd_prod_defconfig make menuconfig make Notice: disable LEON support, otherwise eth0 will not work. don't enable OXNAS i2c protocol - it's broken don't enable USB debugging - it's broken 6. Install new image: mkimage -A arm -a 48008000 -e 48008000 -C none -d /usr/src/linux/arch/arm/boot/zImage uImage dd if=./uImage of=/dev/sda bs=512 seek=336 You may try new kernel first, before installing it to main location: dd if=./uImage of=/dev/sda bs=512 seek=32478 interrupt u-boot and type run load2 boot Links: My MyBook: http://devnull.samersoff.net/pub/MyBook_me oxnas_boot_dms_20100827.bin.gz, oxnas_lib_modules_dms_20100827.bin.gz etc MyBook origin: http://support.wdc.com Com wiring: http://www.nslu2-linux.org/wiki/HowTo/AddASerialPort Gentoo Arm: http://distfiles.gentoo.org/releases/arm/autobuilds/current-stage3/armv5tel-softfloat-linux-gnueabi/ Bunch of staff: http://mybookworld.wikidot.com