I have serveral WD my-book-lives. These little boxes are small, power efficient, and have an old debian preinstalled. I found it a better NAS solution than SBC + USB disk.
The origin firmware, although based on debian, is pretty outdated, however, with the community’s great work, linux kernel 4.x and debian 8 could be installed. (More at github/KL-Yang/mbl-linux-4.0 and github/ewaldc/My-Book-Live/, thanks you! KL-Yang and Ewald).
Unfortunately, Debian and many other linux distros are quickly phasing out support for 32bit ppc processors, leaving debian 8 the last release that could be install on mybook live, moreover, all powerpc debs are already moved to archive.debian.org.
There are only a few (linux) distros will support 32bit ppc for next several years, what i’ve found are openwrt and gentoo. (Could any BSD be installed on mybooklive? )OpenWrt has official support for mybooklive, but I think gentoo is more generic and has more packages. So I tried to install gentoo on mybooklive.
WARNING! Open the case and install 3rd party os may void your warranty, you are on your own, YOU HAVE BEEN WARNED.
Mybooklive (single disk version) technical specs:
- CPU: Applied Micro APM82181 runs at 800MHz, powerpc 464fp architecture
- RAM: 256MB DDR2
- Gigabit-lan, sata port, No USB ports
- Howto open case: ifixit/Teardown/Western+Digital+My+Book+Live+Teardown/26942
The plan:
The uboot of mybooklive only boot kernel from ext2/3 partition, so first install debian on ext2/3 to bootstrap gentoo on ext4, after gentoo is ready, debian partition will act as a boot partition and a backup system.
The process:
- prepare disk
Make sure the data on the disk is backed up or can be discarded, attach the disk to a linux box, use fdisk or parted to create a gpt table, then format the partitions like this:
/dev/sde1 2G ext3 debian boot
/dev/sde2 20G format later in debian as gentoo partition
/dev/sde3 512M format later in gentoo as swap
/dev/sde4 format later in gentoo as data partition
- install debian
- decompress the tarball, github/ewaldc/My-Book-Live/tree/master/debian/debian%208%20(Jessie)
root# mkdir /mnt/debian
root# mount /dev/sde1 /mnt/debian
root# cd /mnt/debian
root# tar xzf /path/to/DebianJessie8.11.tgz
- delete unneed fstab entries otherwise will block boot
root# cat /mnt/debian/etc/fstab
tmpfs /tmp tmpfs rw,size=100M 0 defaults,noexec,nosuid,nodev,mode=0755,size=100M 0 0
/dev/sda1 / ext3 defaults,noatime 0 0
- umount and unplug the disk
root# cd /
root# umount /mnt/debian
- bootstrap gentoo
- install the disk to the circuit board and boot, ssh into it(default root password is welc0me)
ssh root@<device ip found in router>
*** Attention! now in the debian ***
- format gentoo partition, 16k blocksize, mount it, download ppc stage3 tarball, extract. following the gentoo handbook: wiki.gentoo.org/wiki/Handbook:PPC/Installation/Stage
ETNas# mkfs.ext4 -b 16384 /dev/sda2
ETNas# mkdir /mnt/gentoo
ETNas# mount /dev/sda2 /mnt/gentoo
ETNas# cd /mnt/gentoo
ETNas# wget /url/to/stage3
ETNas# tar xpvf stage3.tar.name --xattrs-include='*.*' --numeric-owner
for make.conf, I use -mcpu=464fp -mtune=464fp according to gcc doc
for USE flag, i add “minimal” to reduce dependencies, (compile on a 800m single core processor would be very slooow), configure the mirror for gentoo and portage and ready to chroot:
ETNas# cp --dereference /etc/resolv.conf /mnt/gentoo/etc/
ETNas# mount --types proc /proc /mnt/gentoo/proc
ETNas# mount --rbind /sys /mnt/gentoo/sys
ETNas# mount --make-rslave /mnt/gentoo/sys
ETNas# mount --rbind /dev /mnt/gentoo/dev
ETNas# mount --make-rslave /mnt/gentoo/dev
ETNas# chroot /mnt/gentoo /bin/bash
*** Attention now in gentoo chroot ***
ETNas# source /etc/profile
ETNas# export PS1="(chroot) ${PS1}"
- bootstrap portage
(chroot) ETNas# emerge-webrsync
(chroot) ETNas# eselect profile list
- install dropbear to enable ssh service (dropbear is more slim compare to sshd)
(chroot) ETNas# emerge --ask net-misc/dropbear
(chroot) ETNas# rc-update add dropbear
- config network
(chroot) ETNas# ln -s /etc/init.d/net.lo /etc/init.d/net.eth0
(chroot) ETNas# cat /etc/conf.d/net
config_eth0="dhcp"
(chroot) ETNas# rc-update add net.eth0
- swap and fstab
(chroot) ETNas# mkswap /dev/sda3
(chroot) ETNas# swapon /dev/sda3
(chroot) ETNas# cat /etc/fstab
/dev/sda2 / ext4 defaults,noatime 0 1
/dev/sda3 none swap defaults 0 0
- finally don’t forget to set password (which I forgot for the first time :-P) and back to debian
(chroot) ETNas# passwd
(chroot) ETNas# exit
- install kernel lib and boot file
- copy kernel lib from debian partition to gentoo partition
ETNas# cp -r /lib/modules/ /mnt/gentoo/lib/
- build boot file: github/ewaldc/My-Book-Live/tree/master/uboot
ETNas# cd
ETNas# cat boot.txt
setenv md0_args 'setenv bootargs root=/dev/sda2 rw rootfstype=ext4'
setenv load_sata 'sata init; ext2load sata 1:1 ${kernel_addr_r} /boot/uImage; ext2load sata 1:1 ${fdt_addr_r} /boot/apollo3g.dtb'
setenv boot_sata 'run load_sata; run md0_args addtty; bootm ${kernel_addr_r} - ${fdt_addr_r}'
echo ==== Loading Linux kernel, Device tree, Root filesystem ====
run boot_sata
ETNas# mkimage -A powerpc -O linux -T script -C none -a 0 -e 0 -n 'Execute uImage' -d boot.txt boot.scr
ETNas# cd /boot
ETNas# mv boot.scr boot.scr.bak
ETNas# cp ~/boot.scr ./
ETNas# reboot
reboot and try to ssh to gentoo
if everything goes well, now a (very) basic gentoo environment is ready. you can follow gentoo handbook for detail configurations and emerge various packages or even compile kernel. Enjoy