HOWTO Netvista 2200 with Linux OpenSuSE 10.3 This document describes how to install OpenSuSE 10.3 in IBM Netvista N2200 (8363). Requirements: - IBM Netvista N2200 with latest flash bios - RAM 32 builtin + 128 MB Dimm (at least this was the amount i tried with) - Compact flash >= 512MB (you must be able to mount it in your desktop computer with something like an USB card reader) - OpenSuSE 10.3 DVD - Vmware server installed on your computer - Linux kernel 2.6.22 or newer (from kernel.org) Summary: In order to boot the Netvista you will need a special kernel, and you won't be able to use initrd, so we will run a patched initrd as normal root filesystem, that also includes our custom kernel, and afterwards change to a new root under the flash using chroot command. ############################################################################### ## Create OpenSuSE 10.3 virtual machine with minimal installation ############################################################################### Install OpenSuse 10.3 in a vmware virtual machine - You probably want to have a virtual disk the same size you have for the flash in Netvista N2200; - I think it's possible to install directly to the flash; - Do not create a swap partition (we will try to avoid it); - Perform a text only minimal installation. However, the size of your flash rules this. Insert the flash memory into your computer Format your flash - Delete all partitions with fdisk - Create a single linux partition with fdisk - Format the partition with mke2fs - Mount the flash memory under /mnt/flash (or anywhere you want) Now you must copy everything to your flash memory. The locations of your flash memory and virtual machine mount points could differ. Issue (as root) # vmware-mount.pl /mnt/personal/virtual-machines/min-linux/min-linux.vmdk 1 /mnt/vmdisk/ It has been reported that this program does not work correctly with 2.4+ Linux kernels in some cases, and you are currently running such a kernel. Do you really want to continue? [N] y No Network Block Device detected. There is no Network Block Device defined on this machine. This script is about to create the /dev/nb0 Network Block Device. Continue? [Y] Creating the /dev/nb0 Network Block Device No Network Block Device driver detected. Trying to load the Network Block Device driver kernel module... Success. Client: The partition is now mapped on the /dev/nb0 Network Block Device. Using another terminal, you can now browse your Virtual Hard Disk partition in /mnt/vmdisk/. Hit Control-C in this terminal when done. ############################################################################### ## Compile a custom kernel ############################################################################### Kernel must be compiled with special options: Download vanilla kernel from kernel.org (must be greater that 2.6.21) Unpack kernel file into a directory. We used kernel 2.6.22-15. I will assume unpacking to /usr/src/linux-2.6.22-15 Copy the supplied .config to /usr/src/linux-2.6.22-15. You can also 'make xconfig' and enable all Geode GX1 features. You must also enable other things, so i recommend using the supplied .config. For Compact Flash memories bigger that 245MBytes, you should disable DMA under the kernel, otherwise your system won't boot. Make sure the following option is disabled under kernel configuration (xconfig) (thanks Gruesse Michael): DeviceDrivers -> ATA/ATAPI/MFM/RLL support -> Generic PCI bus-master DMA support Now it's the time to compile your custom kernel: ############### Edit drivers/video/geode/gx1fb_core.c Look for and change static char mode_option[32] = "640x480-16@60"; to static char mode_option[32] = "1024x768-16@60"; $ make bzImage Take the vmlinux-file form arch/i386/boot/compressed and patch the elf program-header-count to 1 (offset 0x2C). You can do it with 'ghex2 vmlinux', look for offset 2C and change the byte value to 1. Save changes under the same name (vmlinux). $ make modules $ make modules_install INSTALL_MOD_PATH=/usr/src/linux-2.6.22-15/modules Later on, you will copy new kernel and modules to compact flash root directory. ################################################################# ## Copy fresh openSUSE 10.3 virtual machine into the flash memory ################################################################# Format your flash memory - Delete all partitions with fdisk - Create a single linux partition with fdisk - Format the partition with mke2fs - Mount the CF flash under /mnt/flash (or anywhere you want) # cp -a /mnt/vmdisk/* /mnt/flash edit /mnt/flash/etc/fstab, and make sure that root filesystem is sda1. If not, change accordingly. The disk device where vmware installed your system could have been different, so you have to check that it now becomes /dev/sda. Note that noatime attribute is there to speed things up a little. /dev/sda1 / ext3 defaults,noatime 1 1 Also insert the lines bellow to turn those directories into RAM filesystems tmpfs /tmp tmpfs defaults 0 0 tmpfs /var/tmp tmpfs defaults 0 0 tmpfs /var/lock tmpfs defaults 0 0 Since you are not going to use the opensuse default kernel, and to free some space on the flash memory, you can delete the kernel and associated modules. kernel files from /mnt/flash/boot and modules from /mnt/flash/lib/modules. You can also do this later when running the netvista, issuing rpm -e kernel-default-2.6.22.5 (don't do this in your own computer!) If you want to free some additional disk space, remove contents of directory /mnt/flash/usr/share/doc. ############################################################################### ## Placing a custom kernel into new system ############################################################################### Copy the custom netvista kernel to the root of the flash as kernel.2x00 # cp /usr/src/linux-2.6.22-15/arch/i386/boot/compressed/vmlinux /mnt/flash/kernel.2x00 Now remove unneeded modules # rm -rf /mnt/flash/lib/modules/2.6.22.5-31-default And copy the new ones from the custom kernel # cp -r /usr/src/linux-2.6.22-15/modules/lib/modules/2.6.22.15-default /mnt/flash/lib/modules/ You can umount your vmware virtual disk. You can umount your flash card. ############################################################################### ## Testing the system ############################################################################### Now it's time to put the compact flash and in your Netvista and boot it. Hope it all goes right. Of course the network adapter is different from the one in the virtual machine, so you can now use yast to change this to the correct one. You can even install new software. ############################################################################### If you get the message 'error changing netif name eth0 to eth1 when starting the Netvista: Under your netvista: - Open /etc/udev/rules.d/70-persistent-net.rules, and find the lines referring to your card. # PCI device 0x14e4:0x4318 (bcm43xx) SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:14:a4:38:fd:34", NAME="eth1" - Change 'NAME="eth1"' to "'NAME="eth0" and reboot. ############################################################################### TODO: Talk about test -d /var/lock/subsys || mkdir -p -m 700 /var/lock/subsys in /etc/init.d/syslog Hope you enjoy! Antonio Cardoso Martins (digiplan.pt@gmail.com) Contributions: Sebastian Duell (wastel7@gmx.de) gave most of the information regarding the compilation of the Netvista custom kernel. Thank's to him. Also thanks to Gruesse Michael for providing the hints behind the DMA kernel bug http://www.selfservix.org/n2200.htm