notes-computer-oqo-installingDebian

Introduction

I successfully installed Debian on my OQO 01+ without using an external CD, DVD, or hard drive. I did it this way because the OQO doesn't come with an optical drive and I didn't have an external one that uses USB or firewire. However, it was a pain, so it may be easier for you to borrow a suitable external optical drive and boot a standard Debian installation CD off of that. This procedure does require another computer running Debian GNU/Linux nearby (although it doesn't have to if someone would premake some disk images and put them on the web).

I used the preinstalled Windows XP to download and install the Grub bootloader, along with some small images of a Debian installation system (I used the "netboot" version, which is really small).

The kicker is getting the network card working. You have to use a kernel module that is not included with the Debian installation system {{at least, not with the tiny "netboot" one that I used}}. Kernel modules must be compiled with a kernel of the same version and configuration as the kernel that will run them. So, you can either

Compile the Atmel module on another computer with a kernel that matches the version and configuration as the Debian installation system's kernel, and then add the compiled module to the installation disk image

__or__

Modify the installation system to use the 2.6.10 kernel provided on Moshen's page, and then add Moshen's precompiled Atmel module to the installation disk image

I chose to do the latter, although in hindsight, I'd probably do it the former way if I had to do it again. Either way, this is a big pain, especially if you don't know much about the details of kernel compilation and the way that GNU/Linux installation systems typically work.

Read on for the details of what I did. Please note that I'm probably not recalling everything I did, and may even tell you to do the wrong thing -- I only have one OQO and I don't have time to reinstall everything, so I haven't actually gone through this set of instructions to make sure it works. So these instructions are UNTESTED. If you follow them, please drop me a line and let me know what the worked and what didn't. My email is on my home page.

General stuff to know

Grub

Grub is a bootloader (like "lilo", if you've heard of that). This is a little program that loads before the operating system, and often lets the user choose which operating system to boot, if there are multiple ones installed.

If you're familiar with Grub at all, you're probably used to it being installed from GNU/Linux. Luckily, there's a way to install Grub from Windows instead.

Grub reads a file called "menu.lst", often located at /boot/grub/menu.lst, which specifies a bunch of menu options to give the user upon boot. However, Grub also lets the user modify these options or enter whichever options s/he wishes at boot time, so if you find yourself wanting to change the boot options, you DON'T have to reboot back into Windows just to change menu.lst --- you can just change the option right there in Grub at boot time (I didn't know this and wasted tons of time rebooting, editing menu.lst, rebooting, trying the new options, etc). Just press the "e" key at the Grub boot menu.

How the Debian "netboot" installer works

The Debian netboot installer system is a ramdisk image that contains a small GNU/Linux system for running the installer program. So, there's a whole little GNU/Linux directory structure (with /bin, /usr, /etc, etc) contained in a little ramdisk image file. When you boot into the installer program, you'll be able to get to a shell, but the root filesystem will be this ramdisk image. You will be able to mount the WIndows XP NTFS filesystem from here (but it takes a few cryptic commands).

The netboot installer system first tries to autodetect and configure your hardware, including your network card, and then once it has the network card working it'll download other installation system programs, and then it'll download the Debian packages needed to actually install Debian.

General overview of what we're going to do

At the beginning, we have an OQO 01+ with Windows XP installed and running, connected to the internet. We also have another computer running GNU/Linux.

First, we'll fire up Windows XP on the OQO and download and install Grub from Windows.

Next, on the other computer, we'll download the Debian netboot kernel and ramdisk image. Then we'll modify the ramdisk image so that it includes the Atmel wireless ethernet card's kernel module driver {{well, what I did was different; I also replaced Debian netboot's Linux kernel with Moshen's 2.6.10 Linux kernel}}. Then we'll transfer the kernel and modified ramdisk image to the OQO.

On the OQO, we'll move the kernel and modified ramdisk image into place, and configure Grub to allow us to boot off it.

Next, we'll reboot the OQO, and tell it to boot off the kernel and modified ramdisk image. We'll end up in the Debian installer. We'll get to a shell, and we'll load the Atmel kernel module. Then we'll go back to the Debian installer, and let it partition the hard drive and install Debian. We'll tell it to install everything from here before rebooting (its usual behavior is to reboot and then do most of the install after the boot).

At this point we'll have a Debian system -- however, when we boot into it, the Debian system won't have network access because it won't have the Atmel kernel module on it! So, we'll boot into the installation system again, and we'll mount the new Debian partition. We'll copy the Atmel kernel module into it {{maybe we could just do this by mounting the Windows XP ntfs partition from the new system? I forgot why I didn't do that, maybe I just didn't think of it}}. Then we'll reboot into the new Debian system, and load the Atmel kernel module, and everything will be groovy (I hope).


UNFINISHED NOTES... todo: make these coherent


we're going to mix-and-match the official debian installer ramdisk image with the OQO prebuilt kernel

ON OQO:

download and install winSCP from the internet

ON A DEBIAN SYSTEM (you may have to be root for some of these steps):

mkdir ki cd ki wget ftp://ftp.oqo.com/unsupported/linux/kernel-image-2.6.10-oqo-5_1_i386.deb dpkg -x kernel-image-2.6.10-oqo-5_1_i386.deb .

[scp from oqo debian system using winscp (debian system must already be setup as an scp server), and copy ki/boot/vmlinuz-2.6.10-oqo-5 from debian system to c:\boot on the oqo]

cd ..

wget http://ftp.debian.org/debian/dists/sarge/main/installer-i386/current/images/netboot/debian-installer/i386/2.6/initrd.gz gunzip initrd.gz mkdir initrd-mount mount -o loop initrd initrd-mount cp -a initrd-mount initrd2-dir cp -r ki/lib/modules/2.6.10-oqo-5/ initrd2-dir/lib/modules/ rm -rf initrd2-dir/lib/modules/2.6.8-2-386/

wget ftp://ftp.oqo.com/unsupported/linux/atmelwlandriver-20041222-oqo.tgz tar -xovzf atmelwlandriver-20041222-oqo.tgz cp atmelwlandriver/objs/usbvnet5A/release/usbvnet5A.ko initrd2-dir/lib/modules/2.6.10-oqo-5/kernel/drivers/usb/

wget http://ftp.us.debian.org/debian/pool/main/l/linux-ntfs/ntfstools-udeb_1.12.1-1_i386.udeb mkdir initrd2-dir/ntfstools-1.12.1-1 mv ntfstools-udeb_1.12.1-1_i386.udeb initrd2-dir/ntfstools-1.12.1-1 cd initrd2-dir/ntfstools-1.12.1-1 dpkg -x ntfstools-udeb_1.12.1-1_i386.udeb .

mkcramfs initrd2-dir/ initrd2.cram

[scp from oqo to debian system using winscp (debian system must already be setup as an scp server), and copy initrd2.cram to c:\boot on the oqo]

[on the oqo, install grub for windows (grldr is the important file) and make appropriate changes to boot.ini. make appropriate menu.lst entry]

[now, reboot and select "grub" from the windows OS selector. Tell Grub where to find your menu.lst file (it's in boot/grub). then select the menu option that you created. The Debian installer should now run. However, it doesn't automatically detect the wireless card; as soon as you can, go the the option "go back" in the installer, which takes you to the main menu; then select "execute a shell". in the shell, type "insmod lib/modules/2.6.10-oqo-5/kernel/driver/usb/usvnet5A.ko" (you can tab complete here). now type "exit" to go back to the installer menu, and pick up where you left off (if you've already done "detect network hardware", then do that one again). pick "atml0", not "eth0", when you get the choice. when the installer tells you that it can't load kernel modules, and asks "continue the install without loading kernel modules?", then say "<Yes>" (the official Debian kernel modules don't match this kernel version)]

if you want to use the newer version of ntfsresize, wait until after the udebs are downloaded and installed, and then go back to the shell and move the binary (i think it's at ntfstools-1.12.1-1/usr/bin/ntfsresize) to /usr/bin/ (overwriting the older version).

if you want to use scp or ssh, go back to the "load installer components" menu item a second time, and one of the components you can load is openssh. then go to the shell and you can scp and ssh.

NOTE: you MUST stop the installation before rebooting (before "finishing the installation"); if it reboots, the new rebooted system won't have the wireless driver and it'll be a pain to get it (you'll have to boot into windows, get a version of the driver compiled for the bootable system's kernel, put it on the windows side, then boot into linux and mount the windows partition and copy it over).

so, what you do is you go back to the "load installer components" step, and the second time around you'll get a menu as to what additional components you want to load. there's one described as something like "lets you run bootconfig without rebooting", get that one (i think that should enable another menu option at the end of the menu called something like "start second stage config", but it didn't work for me; nevertheless, after the base system was installed on the HD, i went into the shell, did chroot /target (/target is where the HD is mounted, after you install the base system that is), and then did command "baseconfig". this let me install debian modules on the target system while i still had network access.

if you forget/screw up and you end up booting into a linux system without the network driver, and you want network access on the linux side, you can always (1) mount the windows partition, (2) copy over the installer kernel and ramdisk again, (3) edit the /etc/boot/grub/menu.lst file in the linux system the same way you did in the windows system, to tell it to give you an option to boot into the the installer system again. (that's what i did)

hints: i didn't (and don't) really know what i was doing, but in hundsight, i think the thing to do would have been to install the same kernel that the debian installer uses on another computer, and then to build the wireless ethernet driver on that system, and then to add that driver to the installer. this way you don't have to muck around with matching up Debian's installer with a different kernel.

menu.lst stanza:

title Debian_oqo_installer kernel (hd0,0)/boot/vmlinuz-2.6.10-oqo-5 root=/dev/ram0 ramdisk_size=128000 initrd (hd0,0)/boot/initrd2.cram