Creating a Scientific Linux 4 Root File System

This section describes how to create an SL4 root file system for the SBC. In the examples a root file system is created on the SBC boot/nfs server under /sbcroot/pixelsbc1. The server needs to run SL4.

In the example the root file system is created in /sbcroot/pixelsbc1 on the file server. The following instructions are for csh.

Set installation and create directory

> setenv INSTDIR /sbcroot/pixelsbc1
> mkdir -p $INSTDIR

Create the following directories for yum and rpm

> mkdir -p $INSTDIR/root/cache
> mkdir -p $INSTDIR/var/lock/rpm
> mkdir -p $INSTDIR/var/lib/rpm

Set a new home directory for root

> setenv HOME $INSTDIR/root

Create the rpm macro file $HOME/.rpmmacros

%_dbpath           /var/lib/rpm
%_rpmlock_path  /var/lock/rpm/transaction

Create the yum configuration file $HOME/yum-slc4.conf pointing to the SLC4 repository at CERN

[slc4]
name=slc4
baseurl=http://linuxsoft.cern.ch/cern/slc4X/i386/SL/RPMS
enabled=1
gpgcheck=0
[slc4updates]
name=slc4updates
baseurl=http://linuxsoft.cern.ch/cern/slc4X/updates/i386/RPMS
enabled=1
gpgcheck=0

Create a new rpm database with

> rpm --initdb --root $INSTDIR

Install a minimum linux system with

> yum -c $HOME/yum-slc4.conf --installroot=$INSTDIR install coreutils bash

Additional packages can be installed/updated using the above method. Maintenance of the SBC root file system can be exclusively done on the nfs server.

Additional configuration steps

Create devices

a useful script to create linux devices can be found here:

* makedev.sh: shell script to create devices

> cd $INSTDIR/dev
> sh makedev.sh

Enable serial console:

Edit the gettys section in $INSTDIR/etc/inittab. Add the line

s0:2345:respawn:/sbin/mingetty --noclear ttyS0

Add nfs mounts to $INSTDIR/etc/fstab. For example:

192.168.0.1:/sbcroot/pixelsbc  /                    nfs           bg,hard,rsize=16384,wsize=16384,vers=3,proto=tcp
192.168.0.1:/sbcroot/atlpdaq   /atlpdaq         nfs           bg,hard,rsize=16384,wsize=16384,vers=3,proto=tcp
192.168.0.1:/atlas                   /atlas             nfs           bg,hard,rsize=16384,wsize=16384,vers=3,proto=tcp
none                           /dev/pts         devpts  gid=5,mode=620  0 0
none                           /proc            proc    defaults        0 0
none                           /dev/shm         tmpfs   defaults        0 0

Configure kernel parameters.This is optional. Edit $INSTDIR/etc/rc.local and add

echo 1 >> /proc/sys/kernel/sysrq                      
# enable system request ; send brk + b from serial line reboots
echo 0 >> /proc/sys/vm/overcommit_memory    
# no overcommit of memory
echo /tmp/core > /proc/sys/kernel/core_pattern
# where of dump core files

Creating a network bootable kernel image for the SBC

The SBC VME driver requires a kernel with big physical memory area support, which is already patched into the CERN SL4 kernel. This sections describes how to obtain a network bootable kernel image, that works with the VME drivers shipping with tdaq-01-09-00. The kernel version currently used at SLAC is 2.6.9-67.0.7.EL.cern.

Download the kernel source from CERN and install it

> mkdir -p $INSTDIR/usr/src/redhat/SOURCES
> wget http://linuxsoft.cern.ch/cern/slc4X/updates/i386/SRPMS/kernel-2.6.9-67.0.7.EL.cern.src.rpm
> rpm --root $INSTDIR -i kernel-2.6.9-67.0.7.EL.cern.src.rpm

Unpack the source and install patches

> yum -c $HOME/yum-slc4.conf --installroot=$INSTDIR install openssh-server openssh emacs patch perl make gnupg gcc kernel-utils redhat-rpm-config m4 bzip2 gcc binutils rpm-build
> mkdir -p $INSTDIR/usr/src/redhat/BUILD
> mkdir -p $INSTDIR/usr/src/redhat/SPECS
> chroot $INSTDIR rpmbuild  -bp /usr/src/redhat/SPECS/kernel-2.6.9-67.0.7.EL.cern.spec --target=i686 
Change to the kernel source directory
cd $INSTDIR/usr/src/redhat/BUILD/kernel-2.6.9/linux-2.6.9

To boot the SBC from the network the kernel needs to be recompiled with kernel autoconfiguration and NFS root file system support. The e100 drivers needs to be included into the kernel.

Enable the kernel autoconfiguration support in the kernel configuration file. Edit the file .config

CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
CONFIG_IP_PNP_BOOTP=y
CONFIG_IP_PNP_RARP=y

Enable Built-in kernel support for e100 network interface

CONFIG_MII=y
...
CONFIG_E100=y

Built-in nfs client and nfs root support

CONFIG_NFS_FS=y
CONFIG_ROOT_NFS=y
CONFIG_LOCKD=y
...
CONFIG_NFS_ACL_SUPPORT=y
...
CONFIG_SUNRPC=y
CONFIG_SUNRPC_GSS=y
CONFIG_RPCSEC_GSS_KRB5=y
...
CONFIG_CRYPTO_MD5=y
...
CONFIG_CRYPTO_DES=y

Edit the first lines in Makefile to

VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 9
EXTRAVERSION = -55.0.12.EL.cern

Now build the kernel with

> make oldconfig; make bzImage; make modules

To install the kernel modules

> setenv INST_MOD_PATH $INSTDIR
> gmake modules_install

Next step is to create and insttall a bootable NBI kernel image. The required mkbni tool can be found here:

> mkelf-linux --append="console=ttyS0,9600  bigphysarea=16384" --ip=dhcp --rootdir=$INSTDIR arch/i386/boot/bzImage  --output=kernel.nbi
> cp kernel.nbi /tftpboot

An example dhcp configuration file can be found here:

After editing dhcpd.conf, configure and start the dhcp server with
chkconfig dhcpd on
service dhcpd start

The NFS root filesystems needs to be exported. Check /etc/exports on the file server. For example add

/sbcroot/pixelsbc1 192.168.0.2(rw,no_root_squash)

To allow root login add the line ttyS0 to $INSTDIR/etc/securetty

Create the file $INSTDIR/etc/etc/sysconfig/network with

NETWORKING=yes
FORWARD_IPV4=false
HOSTNAME=pixelsbc

The SBC should boot now.

Installation of TDAQ

This is in detail described here http://pcatd12.cern.ch/releases/download/tdaq-01-09-01

Installation scripts

To simplify the installation process a set of shell scripts is provided.

  • configuration: install configuration (required by the other scripts)

  • remote-yum: script to run yum on the target root filesystem

Edit configuration and set the directory to install TDAQ, the SBC root filesystem, SBC hostname and boot server IP. For example for tdaq-01-09-00

INSTDIR="/sbcroot/pixelsbc1"
HOSTNAME=pixelsbc
SERVER=192.168.0.1
TDAQ_DIR="/atlas/tdaq"
TDAQ_VERSION="01-09-00"
TDAQ_TAG="i686_slc4_gcc34_opt"
KERNELVERSION=2.6.9
EXTRAVERSION=67.0.7.EL.cern
Next step is to install the SBC root filesystem. Simply run
> install-slc4
This will create a bootable .nbi kernel image. The SBC should boot with ssh already enabled. Login to the SBC as root (empty password) from the serial console and change the root password. The TDAQ directory should also be already mounted. To install TDAQ run
> install-tdaq
To install additional packages on the SBC run (Important: this needs to run on the boot server not the SBC)
 
> remote-yum install <packages>
All the scripts above run on the boot server. The only script that needs to be executed on the SBC is the script to install the VME drivers. To install the VME drivers run
> install-vme
Now configure the VME (select option 15 for defaults)
> cd /lib/modules/daq
> vmeconfig -i vmetab
> reboot

-- MatthiasWittgen - 16 Jul 2008

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatext configuration r1 manage 0.2 K 2008-07-16 - 20:19 MatthiasWittgen install configuration
Unknown file formatconf dhcpd.conf r1 manage 0.8 K 2008-05-20 - 03:04 MatthiasWittgen dhcpd.conf
Unknown file formatext install-slc4 r2 r1 manage 11.5 K 2008-07-16 - 21:35 MatthiasWittgen script to install SLC4
Unknown file formatext install-tdaq r1 manage 1.0 K 2008-07-16 - 20:19 MatthiasWittgen script to install TDAQ
Unknown file formatext install-vme r1 manage 0.7 K 2008-07-16 - 20:20 MatthiasWittgen script to install VME kernel drivers
Unix shell scriptsh makedev.sh r1 manage 5.4 K 2008-05-20 - 02:13 MatthiasWittgen shell script to create devices
Unknown file formatrpm mknbi-1.4.4-1.noarch.rpm r1 manage 121.9 K 2008-05-20 - 01:09 MatthiasWittgen mknbi rpm
Unknown file formatext remote-yum r1 manage 0.2 K 2008-07-16 - 20:21 MatthiasWittgen script to run yum on the target root filesystem
Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r7 - 2008-07-16 - MatthiasWittgen
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback