How to make a minimal Debian EABI NFS root filesystem for an ARM host Martin Guy, , 8 June 2008 This is not a shell script. # 1. Make the root filesystem in a directory on a (Debian) host # Optional: Set http proxy to use for package downloads http_proxy="http://10.0.0.1:3128" export http_proxy # As root: debootstrap --verbose --arch armel --foreign lenny /tftpboot/armel-lenny \ http://ftp.uk.debian.org/debian cd /tftpboot/armel-lenny mknod dev/console c 5 1 # Set package sources (for armel port) echo 'deb http://ftp.uk.debian.org/debian lenny main' > etc/apt/sources.list # Optional: Set http proxy the new system should use for package downloads echo 'Acquire::http::Proxy "http://10.0.0.1:3128";' > etc/apt/apt.conf # 2. Boot the board with this as its root filesystem passing init=/bin/sh and on it go: date 060814232008 # Set the date (8 Jun 2008 14:23 UTC) mount none /proc -t proc export PATH # It's set but it's not in the environment, der! debootstrap/debootstrap --second-stage # I found /proc unmounted at this point. Check it (ls /proc) and mount it if not. rmdir debootstrap # An empty dir was left for me. rm -r if not empty cat /proc/mounts > /etc/fstab vi /etc/fstab # delete: rootfs / rootfs rw 0 0 # and append: none /proc proc defaults 0 0 # and if you have a local swap device (here a USB pendrive), something like: none /tmp tmpfs defaults 0 0 /dev/sda4 none swap defaults 0 0 # and in my case I have a shared /home 10.0.0.1:/home /home nfs defaults 0 0 Check /etc/resolv.conf is correct (it gets copied from the system you ran the initial debootstrap on) Edit /etc/hostname to whatever you want to call the host Edit /etc/passwd and /etc/group if you need to. Edit /etc/inittab, comment out the lines #1:2345:respawn:/sbin/getty 38400 tty1 #2:23:respawn:/sbin/getty 38400 tty2 #3:23:respawn:/sbin/getty 38400 tty3 #4:23:respawn:/sbin/getty 38400 tty4 #5:23:respawn:/sbin/getty 38400 tty5 #6:23:respawn:/sbin/getty 38400 tty6 and append # TS-7250's serial port S0:23:respawn:/sbin/getty 115200 ttyAM0 vt102 # Enable root logins on the serial port # (the device has a different name on ep93xx) vi /etc/securetty :/ttyS0/s//ttyAM0/ :wq # Set timezone ln -sf /usr/share/zoneinfo/Europe/London /etc/timezone # Install some extra software from the net apt-get install udev # Necessary for correct operation of /dev # and to mount NFS volumes apt-get install nfs-common # Necessary to be able to mount nfs volumes # (/home in my setup) apt-get install ssh procps # For network logins, "ps" command etc # Set the date from the network at boot time apt-get install ntpdate # To set the time&date precisely vi /etc/init.d/rc.local # and before the "exit 0", add the line: ntpdate pool.ntp.org sh /etc/init.d/rc.local # Finish sync exit # exits single-user shell, halting the machine. # Alternatively, exec /sbin/init, then log in and reboot from there