[ARMedslack] A step by step guide to ARMed Slack on NFS root;)

Andrzej Telszewski atelszewski at gmail.com
Tue Apr 26 12:16:56 UTC 2011


Hi,

The guide is here;)

Directories/locations:
a) ARMed Slack packages series:
    /home/soft/cross/armedslack/armedslack-13.1/slackware

b) installer (unpacked initrd):
   /home/soft/cross/bf-210/rootfs-installer

c) initrd:
 
/home/soft/cross/armedslack/armedslack-13.1/slackware/isolinux/uinitrd-kirkwood.img

d) kernel common to both installer and installed system:
   /home/soft/cross/bf-210/rootfs/boot/uImage

IP addresses:
   10.7.11.0 - subnet address
   255.255.255.0 - subnet mask
   10.7.11.1 - gateway
   10.7.11.2 - server/host
   10.7.11.10 - board/target


A. Host
-------

1. Installer preparation
$ cd /home/soft/cross/bf-210/rootfs-installer
$ dd 
if=/home/soft/cross/armedslack/armedslack-13.1/isolinux/uinitrd-kirkwood.img 
bs=64 skip=1 | gzip -dc | cpio -div

2. NFS server
/etc/exports:
   /home/soft/cross/bf-210/rootfs-installer 
10.7.11.0/255.255.255.0(rw,no_root_squash,sync,no_subtree_check)
   /home/soft/cross/armedslack/armedslack-13.1/slackware 
10.7.11.0/255.255.255.0(rw,no_root_squash,sync,no_subtree_check)
   /home/soft/cross/bf-210/rootfs 
10.7.11.0/255.255.255.0(rw,no_root_squash,sync,no_subtree_check)

$ sh /etc/rc.d/rc.rpc start
$ sh /etc/rc.d/rc.nfsd start

(probably the permissions in exports could be fine grained).

3. Kernel
Prepare and compile your kernel and copy it to:
   /home/soft/cross/bf-210/rootfs/boot/uImage

The target kernel should have at least the followings compiled-in:
   CONFIG_IP_PNP
   CONFIG_NFS_FS
   CONFIG_ROOT_NFS


B. Target
---------

1. My U-Boot environment
This is environment I use to boot installed system:
boff> printenv
bootdelay=3
baudrate=115200
ethaddr=00:17:09:00:04:11
loadaddr=0x21000000
gatewayip=10.7.11.1
netmask=255.255.255.0
bootcmd=nfs; bootm
rootpath=/home/soft/cross/bf-210/rootfs
bootfile=/home/soft/cross/bf-210/rootfs/boot/uImage
ipaddr=10.7.11.10
serverip=10.7.11.2
bootargs=mem=32M console=ttyS0,115200n8 rootdelay=1 ro root=/dev/nfs 
nfsroot=10.7.11.2:/home/soft/cross/bf-210/rootfs 
ip=10.7.11.10:10.7.11.2:10.7.11.1:255.255.255.0::eth0:
stdin=serial
stdout=serial
stderr=serial

Environment size: 478/508 bytes

Be aware, that nfsroot and ip are part of the bootargs environment 
variable (they might seem to separate because of e-mail's line breaking).

For the installation, the following should be changed:
   rootpath should point to /home/soft/cross/bf-210/rootfs-installer
   bootrgs - ro flag should be changed to rw flag

After changes, you should reload bootargs environment variable, e.g.:
setenv bootargs mem=32M console=ttyS0,115200n8 rootdelay=1 ro 
root=/dev/nfs nfsroot=${serverip}:${rootpath} 
ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}::eth0:

I guess the options in bootargs are self-explanatory, if not, refer to 
Documentation/filesystems/nfs/nfsroot.txt

Now you can issue 'boot' command.

When you are at the installer prompt, mount the NFS location the system 
is going to be installed to:
$ rpc.portmap
$ rpc.statd
$ mount -t nfs -o vers=3 10.7.11.2:/home/soft/cross/bf-210/rootfs /mnt

Remember, that at this time, you need at least one partition of type Linux.

Run 'setup' and do the thing you have done for at least one billion 
times already;) But first, in TARGET submenu just hit 'Continue' without 
selecting any target partition.

After installation is complete, change the U-Boot environment to its 
previous state so it can boot freshly installed system.
Before loading the just installed system, it is worth to do some setup 
on the HOST:
- in /home/soft/cross/bf-210/rootfs/etc/fstab add the line for the rootfs:
   10.7.11.2:/home/soft/cross/bf-210/rootfs / nfs noauto 0 0
- in /home/soft/cross/bf-210/rootfs/etc/securetty and 
/home/soft/cross/bf-210/rootfs/etc/inittab:
   configure the serial console if you use one

Now you can 'boot'.

I know that there are some things that can be done better (especially 
when it comes to the NFS configuration parameters), but this just works 
and I needed it very quickly.


Any questions/comments are welcome.

-- 
Pozdrawiam,
Best regards,
Andrzej Telszewski


More information about the ARMedslack mailing list