Install Debian etch on a DS-101g+

Introduction

The Synology DS-101g+ can run Debian quite well. However the installation is a bit cumbersome, since a patched Kernel is needed.

Basically a Debian-Installer initrd must be modified and then, together with the kernel image, uploaded over the serial connection to the DS-101g+'s bootloader.

Prerequisites

For the installation a serial connection to the DS-101g+ is required. To compile PowerPC binaries you probably need a Cross compiler (see emdebian).

mkimage

mkimage makes the PPCBoot images for the PPCBoot bootloader of the DS-101g+. Install it ( [Binary] [.sig] [Source] ) in /usr/local/bin. It is also available from my Debian etch repository.

initrd

Get the Debian-Installer initrd. Unpack it with:
sudo gunzip -c initrd.gz | cpio -i PATH_TO_INITRD/
Remove the kernel modules in PATH_TO_INITRD/lib/modules.

Kernel

Apply this patch to the Debian 2.6.18 kernel. Make sure you get the current Kernel with all security patches.

You may want to change the hardcoded ethernet address at line 975 of the patch. Set CONFIG_CMDLINE to the root device you want to boot from after the installation. [sample config]

Do not enable MPC10x store gathering, it will cause mysterious SATA failures.

To configure and compile the kernel, execute:
export CROSS_COMPILE=powerpc-linux-gnu-
export ARCH=ppc
make menuconfig
make
in its directory.

uImage

The kernel PPCBoot image is now in:

./arch/ppc/boot/images/uImage

Modules

Install the modules in the unpacked initrd:
sudo INSTALL_MOD_PATH=PATH_TO_INITRD make modules_install

initrd

Install ethtool

Copy ethtool into the initrd directory. [Binary powerpc] [.sig] [Source]

initrd Image

In the initrd directory, repack the Debian-Installer initrd with:
sudo find ./ | cpio -H newc -o | gzip > ../initrd_new.gz
Now make a PPCBoot image:
mkimage -A ppc -O linux -T ramdisk -C gzip -d initrd_new.gz initrd-diskstation-di

Install

You can use the kermit script to upload and boot the kernel and initrd PPCBoot images. The kermit script installs the PPCBoot images in the RAM, leaving the flash untouched. It's gone after the next reboot; or should be. Anyway: use at your on risk.

If your serial connection is not on /dev/ttyS0 you have to change it in the script. To upload; run the script with
./image.ksc uImage initrd-diskstation-di
and while it waits for the PPCBoot prompt, power cycle the DS-101g+. The upload takes about 10 minutes, afterwards the kernel is booted.

skge

It appears that TCP will not work if you don't run:
ethtool -K eth0 tx off
ethtool -K eth0 rx off
as root. To do this, interrupt the Debian-Installer and execute a shell.

The command disables offload for checksumming, i.e. the CPU now has to do the work.

Prepare For Reboot

The cmdline CONFIG_CMDLINE is set in the kernel config. You may need to adjust the root=/dev/FOO part. Recompile the kernel if necessary.

Just before the installation completes, execute a shell.

Copy the kernel modules from the initrd or e.g. get them with wget to /target/lib/modules.

Chroot in the root file system:
mount -t proc proc /target/proc
chroot /target
Install ethtool and add this pre-up line
iface eth0 inet dhcp
  pre-up ethtool -K eth0 tx off; ethtool -K eth0 rx off
to /etc/network/interfaces.

initrd

If you want a initrd, e.g. because the root file system is on a LVM, you have to create it now in the chroot.

Install initramfs-tools and create the initrd with

update-initramfs -ck all

Now get the initrd (/boot/initrd.img-2.6.18-diskstation1) onto your computer and make an image with mkimage.

mkimage -A ppc -O linux -T ramdisk -C gzip -d initrd.img-2.6.18-diskstation1 initrd-diskstation1

Boot

The reboot will not work; prepare to upload or flash the kernel and optionally the new initrd image (uImage and initrd-diskstation1), then power cycle the DS-101g+. The installed Debian should boot.

Bugs

Please send comments to <mail@tobias.rautenkranz.ch>