parseerror.com > ~pizza > soekris_linux.html
Wed Feb 2 20:28:04 PST 2005

Running Linux on a Soekris Box

by pizza

Status

This doc is very incomplete; don't try to use it as your main guide. Use Running Linux on Soekris ... System as your main doc and if you have any questions or problems perhaps check here... he leaves a lot of things unanswered.

Basics

What is a soekris box?
Soekris Engineering is a company that makes cool little x86-based mini-computers. There are several models of popular soekris machines, I happen to have a net4526 , although this should theoretically work on any of the 'net' series
What's a good way to find out more about soekris stuff?
Check out their 'support' section on soekris.com and sign up for their -announce and -tech mailing lists
What is Linux?
Sheesh, you haven't heard of Linux?
Which distro?
Debian.
Debian {is the best linux distro ever, sucks}!
I know.
Haven't people already done this and documented it better than you?
Yes!

Here We Go

I found a good guide, as well as a mini linux distro all prepared at: Running Linux on Soekris ... System. While this was a great guide, it was a little light on some details (I'm not intimately familiar with many of the pieces that fit into this puzzle, so I decided to outline what I did, using Running Linux... as a guide.

steps i took:

  1. establish a serial console to the soekris:
    • you need a null modem cable to connect between your pc and the soekris. a null modem cable, btw, is just a serial cable with the input and output reversed on one side, so 2 machines can talk directly to another using normal serial ports. you should be able to find one at any local computer shop or on the web for a few dollars.
    • once you have the null modem cable you now need software to use it. minicom seems to be the choice for linux... on gentoo: emerge minicom
    • minicom -o as root
    • Ctrl-A O to configure
      • Serial port setup
        • Serial Device: set to your serial port /dev entry. likely /dev/ttyS0; if you're not sure then dmesg | grep tty
        • Bps/Par/Bits Current: 9600 8N1
        • Hardware Flow Control: Yes
        • Software Flow Control: No
    • Ctrl-A M to initialize the modem
    • this didn't work for me at first... i tried hard-rebooting the soekris, and that seemed to do the trick :/
  2. nfs
    • the hardest thing to install if you don't have it. requires a kernel recompile, but it's really not too bad. took me about 10 minutes, including compile and reboot. Gentoo NFS Howto
    • /etc/init.d/nfs start as root
  3. dhcpd
    • emerge dhcp
    • ...config...
    • /etc/init.d/dhcp start as root
  4. tftpd
    • emerge tftp-hpa
    • mkdir /tftproot
    • moved System.map, pxelinux.0, pxelinux.cfg, vmlinuz into /tftproot as per "Running Linux..."
    • /etc/init.d/in.tftp start as root
    Problems:
    • tftp timed out... start server...
    • comBIOS Monitor.   Press ? for help.
      
      > boot f0
      
      BootManage UNDI, PXE-2.0 (build 082)
      BootManage PXE-2.0 PROM 1.0, NATSEC 1.0, SDK 3.0/082 (OEM52)
      Copyright (C) 1989,2000 bootix Technology GmbH, D-41466 Neuss.
      PXE Software Copyright (C) 1997, 1998, 1999, 2000 Intel Corporation.
      Licensed to National Semiconductor
      
      CLIENT MAC ADDR: 00 00 24 C2 B2 58
      CLIENT IP: 192.168.1.169  MASK: 255.255.255.0  DHCP IP: 192.168.1.103
      3;01H3;97HP3;01HX3;01HE3;01HL3;01HI3;01HN3;01HU3;01HX3;01H 3;01H13;01H.3
      
      ... this means the serial output is being mangled... get a better pxelinux.0! (someone posted this version of pxelinux.0 which has been tweaked to work properly on serial consoles and it worked for me; i think i got it from here...
    • could not find vmlinuz... put it in /tftproot/, dumbass
    • filesystem permissions denied... make sure no_root_squash is in /etc/exports
    • nfs: RPC call returned error 101
      RPC: sendmsg call returned error 101
      
      solution: add "exit;" line to the top of /nfsroot/debian/etc/init.d/rcS.d/S40networking. we don't need this anyways because our ifaces have already been initialized before we used nfs to mount / this actually runs /sbin/ifup -a which, afaict must cause the ifaces to drop and be brought back up, which is fatal to our filesystem because / needs the network! this was a bit tricky to figure out.
    This went anything but smoothly, but I got it done... here's what a "successful" boot sequence looks like

    NOTE: all the *** /etc/rcS.d/... *** lines are from me, i threw them into /nfsroot/debian/etc/init.d/rcS so i could figure out in which init script errors were occuring

    Welcome to minicom 2.1
    
    OPTIONS: History Buffer, F-key Macros, Search History Buffer, I18n
    Compiled on Dec  6 2004, 16:19:57.
    
    Press CTRL-A Z for help on special keys
    
    
    
    > AT S7=45 S0=0 L1 V1 X4 &c1 E1 Q0
    Invalid Command.
    
    > ?
    comBIOS Monitor Commands
    
    boot [drive][:partition] INT19 Boot
    reboot                   cold boot
    download                 download a file using XMODEM/CRC
    flashupdate              update flash BIOS with downloaded file
    time [HH:MM:SS]          show or set time
    date [YYYY/MM/DD]        show or set date
    d[b|w|d] [adr]           dump memory bytes/words/dwords
    e[b|w|d] adr value [...] enter bytes/words/dwords
    i[b|w|d] port            input from 8/16/32-bit port
    o[b|w|d] port value      output to 8/16/32-bit port
    cmosread [adr]           read CMOS RAM data
    cmoswrite adr byte [...] write CMOS RAM data
    cmoschecksum             update CMOS RAM Checksum
    set parameter=value      set system parameter to value
    show [parameter]         show one or all system parameters
    ?/help                   show this help
    
    > boot f0
    
    BootManage UNDI, PXE-2.0 (build 082)
    BootManage PXE-2.0 PROM 1.0, NATSEC 1.0, SDK 3.0/082 (OEM52)
    Copyright (C) 1989,2000 bootix Technology GmbH, D-41466 Neuss.
    PXE Software Copyright (C) 1997, 1998, 1999, 2000 Intel Corporation.
    Licensed to National Semiconductor
    
    CLIENT MAC ADDR: 00 00 24 C2 B2 58
    CLIENT IP: 192.168.1.169  MASK: 255.255.255.0  DHCP IP: 192.168.1.103
    
    PXELINUX 2.06 0x3fb30aea  Copyright (C) 1994-2003 H. Peter Anvin
    Loading vmlinuz..................Ready.
    Linux version 2.4.18 (root@rocket) (gcc version 2.95.4 20011002 (Debian prerele2
    BIOS-provided physical RAM map:
     BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
     BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
     BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
     BIOS-e820: 0000000000100000 - 0000000004000000 (usable)
     BIOS-e820: 00000000fff00000 - 0000000100000000 (reserved)
    On node 0 totalpages: 16384
    zone(0): 4096 pages.
    zone(1): 12288 pages.
    zone(2): 0 pages.
    Kernel command line: BOOT_IMAGE=vmlinuz ip=192.168.1.169:192.168.1.103:0.0.0.0:
    Initializing CPU#0
    Calibrating delay loop... 66.56 BogoMIPS
    Memory: 61980k/65536k available (1321k kernel code, 3168k reserved, 329k data, )
    Checking if this processor honours the WP bit even in supervisor mode... Ok.
    Dentry-cache hash table entries: 8192 (order: 4, 65536 bytes)
    Inode-cache hash table entries: 4096 (order: 3, 32768 bytes)
    Mount-cache hash table entries: 1024 (order: 1, 8192 bytes)
    Buffer-cache hash table entries: 4096 (order: 2, 16384 bytes)
    Page-cache hash table entries: 16384 (order: 4, 65536 bytes)
    CPU: AMD Am5x86-WB stepping 04
    Checking 'hlt' instruction... OK.
    POSIX conformance testing by UNIFIX
    PCI: PCI BIOS revision 2.00 entry at 0xf7861, last bus=0
    PCI: Using configuration type 1
    PCI: Probing PCI hardware
    Linux NET4.0 for Linux 2.4
    Based upon Swansea University Computer Society NET3.039
    Initializing RT netlink socket
    Starting kswapd
    Journalled Block Device driver loaded
    JFFS2 version 2.1. (C) 2001 Red Hat, Inc., designed by Axis Communications AB.
    pty: 256 Unix98 ptys configured
    keyboard: Timeout - AT keyboard not present?(ed)
    keyboard: Timeout - AT keyboard not present?(f4)
    Serial driver version 5.05c (2001-07-08) with MANY_PORTS SHARE_IRQ SERIAL_PCI ed
    ttyS00 at 0x03f8 (irq = 4) is a 16550A
    ttyS01 at 0x02f8 (irq = 3) is a 16550A
    Real Time Clock Driver v1.10e
    block: 128 slots per queue, batch=32
    RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
    Uniform Multi-Platform E-IDE driver Revision: 6.31
    ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
    hda: 064MB ATA Flash Disk, ATA DISK drive
    ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
    hda: 125056 sectors (64 MB) w/1KiB Cache, CHS=977/4/32
    Partition check:
     hda: hda1
    floppy0: no floppy controllers found
    loop: loaded (max 8 devices)
    natsemi.c:v1.07 1/9/2001  Written by Donald Becker 
      http://www.scyld.com/network/natsemi.html
      (unofficial 2.4.x kernel port, version 1.07+LK1.0.14, Nov 27, 2001  Jeff Garz)
    eth0: NatSemi DP8381[56] at 0xc4800000, 00:00:24:c2:b2:58, IRQ 11.
    blkmtd: error, missing `device' name
    NET4: Linux TCP/IP 1.0 for NET4.0
    IP Protocols: ICMP, UDP, TCP, IGMP
    IP: routing cache hash table of 512 buckets, 4Kbytes
    TCP: Hash tables configured (established 4096 bind 4096)
    eth0: link up.
    eth0: Setting full-duplex based on negotiated link capability.
    IP-Config: Complete:
          device=eth0, addr=192.168.1.169, mask=255.255.255.0, gw=192.168.1.69,
         host=soekris, domain=, nis-domain=(none),
         bootserver=192.168.1.103, rootserver=192.168.1.103, rootpath=
    NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
    Looking up port of RPC 100003/2 on 192.168.1.103
    Looking up port of RPC 100005/1 on 192.168.1.103
    VFS: Mounted root (nfs filesystem).
    Freeing unused kernel memory: 200k freed
    INIT: version 2.84 booting
    *** /etc/rcS.d/S05keymap.sh ***
    *** /etc/rcS.d/S10checkroot.sh ***
    Activating swap.
    *** /etc/rcS.d/S18hwclockfirst.sh ***
    System time was Thu Feb  3 01:14:36 UTC 2005.
    Setting the System Clock using the Hardware Clock as reference...
    System Clock set. System local time is now Thu Feb  3 01:14:39 UTC 2005.
    *** /etc/rcS.d/S20modutils ***
    Calculating module dependencies... eth0: increased Tx theshold, txcfg 0xd0f0100.
    eth0: increased Tx theshold, txcfg 0xd0f01006.
    eth0: increased Tx theshold, txcfg 0xd0f01008.
    done.
    Loading modules:
    *** /etc/rcS.d/S30checkfs.sh ***
    Checking all file systems...
    fsck 1.27 (8-Mar-2002)
    *** /etc/rcS.d/S30etc-setserial ***
    *** /etc/rcS.d/S30procps.sh ***
    Setting kernel variables.
    *** /etc/rcS.d/S35devpts.sh ***
    *** /etc/rcS.d/S35mountall.sh ***
    Mounting local filesystems...
    nothing was mounted
    *** /etc/rcS.d/S39ifupdown ***
    Cleaning: /etc/network/ifstate.
    *** /etc/rcS.d/S40hostname.sh ***
    *** /etc/rcS.d/S40networking ***
    *** /etc/rcS.d/S41portmap ***
    *** /etc/rcS.d/S45mountnfs.sh ***
    Mounting remote filesystems...
    *** /etc/rcS.d/S46setserial ***
    Loading the saved-state of the serial devices...
    /dev/ttyS0 at 0x03f8 (irq = 4) is a 16550A
    /dev/ttyS1 at 0x02f8 (irq = 3) is a 16550A
    *** /etc/rcS.d/S48console-screen.sh ***
    *** /etc/rcS.d/S50hwclock.sh ***
    
    Setting the System Clock using the Hardware Clock as reference...
    System Clock set. Local time: Wed Feb  2 17:14:53 PST 2005
    
    *** /etc/rcS.d/S51ntpdate ***
    Running ntpdate to synchronize clock.
    *** /etc/rcS.d/S55bootmisc.sh ***
    Cleaning: /tmp /var/lock /var/run.
    *** /etc/rcS.d/S55urandom ***
    Initializing random number generator... done.
    INIT: Entering runlevel: 2
    Starting system log daemon: syslogd.
    Starting kernel log daemon: klogd.
    Starting DHCP server: dhcpd3.
    Starting internet superserver: inetd.
    Starting PCMCIA services: Linux Kernel Card Services 3.1.22
      options:  [pci] [cardbus]
    Hint: insmod errors can be caused by incorrect module parameters, including invs
    ds: no socket drivers loaded!
    /lib/modules/2.4.18/kernel/drivers/pcmcia/ds.o: init_module: Operation not permd
    Hint: insmod errors can be caused by incorrect module parameters, including invs
    /lib/modules/2.4.18/kernel/drivers/pcmcia/ds.o: insmod /lib/modules/2.4.18/kernd
    /lib/modules/2.4.18/kernel/drivers/pcmcia/ds.o: insmod ds failed
    cardmgr[162]: no pcmcia driver in /proc/devices
    done.
    Starting network management services: snmpd snmptrapd.
    Starting OpenBSD Secure Shell server: sshd.
    b.Åä$.GæÄ....§|.Ä.bbåäÅ.æÅçô
    
    it still doesn't quite look there, but its services are up and i can telnet into port 13 and get the daytime, so it's a start!
$Id$