Console boot initrd for PocketPC-based ARM Linux machines ========================================================= This is initrd (initial ramdisk) for PocketPC-based ARM Linux machines, providing comfortable console environment for system reserach and hacking. By the idea, it corresponds to "rescue disks" of desktop Linux installation: you get core tools to investigate your system, loaded into ramdisk. It was developed for and tested with iPaq 4150 (this means you likely will need trivial tweaks to bootloader script to use it on another device, but the initrd itself should be machine-independent). It is based on http://handhelds.org/~joshua/h1910%20Stuff/initrd.ssh, with the following software added/replaced: - Dropbear SSH 0.46 - Busybox 1.1.0-pre1 - Midnight Commander 4.6.0 So, it supports SSH/SCP to handheld, many standard POSIX and extended commands, and console interactive file manager with built-in editor. How to boot ----------- WARNING: Booting Linux on your handheld is equivalent of HARD RESET: all you data will be LOST. You MUST BACKUP your complete handheld state beforehand. (Your handheld may include builtin backup utility, for example, iPaq Backup works nice.) This initrd intended to be booted with bootloader like Haret http://handhelds.org/moin/moin.cgi/HaRET . Put all the following in the same directory on your handheld (putting on storage card is strongly recommended): 1. Haret executable (haret.exe) 2. Kernel image (like zImage-2.6.13-hh1-h4100-20051202) 3. Initrd image (like initrd.mc-20051206.gz) 4. Boot script (startup.txt) After this, just start Haret for this directory. For Haret & h4150, use following startup.txt: ------------- pfw 0x40e0005c 1 0x600a9558 pfw 0x0c000008 1 0x0040 set mtype 459 set kernel "zImage" set initrd "initrd.mc-20060614.gz" set cmdline "root=/dev/ram0 rw ip=192.168.2.202:192.168.2.200:192.168.2.200:255.255.255.0:ipaq:usb0 console=ttyS0,115200n8 console=tty0 ramdisk_size=8192 init=/linuxrc" bootlinux ------------- Detailed description what each line means: pfw 0x40e0005c 1 0x600a9558 pfw 0x0c000008 1 0x0040 Enable serial port on h4150 for kernel messages. These are erquired only if you want to connect to handheld via serial to debug early stages of kernel boot (you don't need to). You may need other lines for another handheld. set mtype 459 Set machine type for h4150. You will need another number for another handheld model. set kernel "zImage" Set kernel image file. Kernels are handheld-specific (mostly; there can be chance that one kernel will boot on close handheld models from one vendor (like h4150 & h4350), or even models from different vendors having close hardware (like h4150 & loox420); even more, it would be possible to build many machine-dependent features as modules - but for now and for this initrd, you better have kernel for your handheld, period). set initrd "initrd-mc.20060614.gz" Set this initrd file name. set cmdline Set command line to pass to kernel. Paramteres to tweak are: ip=192.168.2.202:192.168.2.200:192.168.2.200:255.255.255.0:ipaq:usb0 The first IP address is the address of handheld The second address is gateway address (i.e. address of desktop computer) console=ttyS0,115200n8 Use serial console (in addition to device screen). Useful for debugging and for those who have serial cable. If you have non-PXA (Intel xScale) device, you may need to change "ttyS0" to processor-specific serial device name. bootlinux Boot linux with parameters specified above. Common problems with booting using Haret: P: After starting Haret, it shows dialog instead of booting (possibly, after showing boot logo and indicator) S: Make sure you have all files specified above in the same directory as Haret executable. If you have them, possibly you have not enough memory or some other resource problem. Hard-reset (you already have backup, right?) and retry. P: Boot process goes, but then logo changes to strange colors and gradually fades, leaving handheld hanging. S: There likely was environment problem during boot, for example, unexpected interrupt which could not be handled properly. 'pww' lines in startup.txt are supposed to setup detereminitic environment, but even those 2 above appear not to do it completely (and on another handheld it will be differently). Retry after hard reset (that's why you better have all files on storage card). This issue soe not really happend often, but, per Murphy law, it usually happens on your first try to boot Linux. Don't be scared away ;-). P: Boot process goes, finally device screen clears and small tux logo is shown in the upper part, but below it is small ever-changing square looking like progress indicator, but it hangs there. A: Saw this once with the old kernel (note: new kernel may be compiled without framebuffer logo support). See previous problem. What to expect after boot ------------------------- While kernel boots, you'll see various interesting (I mean that) messages quickly scrolling off, and eventually dropbear sshd will be started, and after that, busybox shell. You can now check that your key driver is working - pressing different app keys on your device should enter '~' chars in command line (that all will be seen on device screen of course), cursor keys should navigate within command line (or within history for up/down), and action key should act as Enter key. Now connect handheld via standard USB cable to desktop Linux machine. On handheld's screen, you should see something like: usb0: full speed config #1: 100 mA, Ethernet Gadget, using CDC Ethernet Subset On desktop machine, youe handheld should be recognized either as Ethernet Gadget and usbnet module loaded (usally automatically via hotplug): /var/log/messages: kernel: hub.c: new USB device 00:03.2-1, assigned address 2 kernel: usb.c: USB device 2 (vend/prod 0x49f/0x505a) is not claimed by any active driver. /etc/hotplug/usb.agent: Setup usbnet for USB product 49f/505a/203 kernel: usb.c: registered new driver usbnet kernel: usb0: register usbnet usb-00:03.2-1, PXA-250 Linux Device /etc/hotplug/net.agent: invoke ifup usb0 If usbnet module is not being loaded, you can try to load it manually: "modprobe usbnet". if usb0 network interface is not configured automatically, you can do it manually: "ifconfig usb0 192.168.2.200". If you just cam't get usb0 to show up in your system, that means your system is too old and require patching of usbnet module to recognize USB CDC gadget. Once you have usb0 up (you should make sure it has the same address as specified in kernel command line for handheld), you can ping the handheld, and then ssh to it: ssh root@192.168.2.202 (password: rootme) Use usual commands then (like dmesg to get to kernel boot log, etc). Place to investigate for interesting bits are: /proc , /sys. You can suspend device using: echo "mem" > /sys/power/state (That's the only way to suspend device, power button won't work). You can check that the touchscreen driver at least somehow works using: hexdump /dev/input/ts0 Buttons: hexdump /dev/input/event0 or /dev/input/event1 Paul Sokolovsky