Changes between Initial Version and Version 1 of Software/fImages/cBaseline


Ignore:
Timestamp:
Jun 20, 2014, 6:36:54 PM (10 years ago)
Author:
ssugrim
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Software/fImages/cBaseline

    v1 v1  
     1=== Base Line Image ===
     2
     3==== Common Build Instructions ====
     4
     5''' Requirements Building a Baseline Image '''
     6
     7Our images are primarily derived from a stock distribution of the Linux OS. Currently we're following the Ubuntu distribution line. The only core service required during installation is the ssh server. The partition size should be kept small to simplify the image gathering process. Due to limitations with the Frisbee tools '''''we can only use ext2/ext3''''' file systems.
     8
     9The major modifications that will be required are:
     10 * Configuring partitions and mount tables
     11  * We expect a '''15G ext3''' root partition (/dev/sda1) and no other partitions. Swap will be handled via a file in the file system.
     12 * Setting up serial console
     13  * Grub serial / Boot Fail config (including kernel flags)
     14  * Getty serial config (for login in from the serial console, other wise it looks like it hangs)
     15 * Modify fstab/rcS to avoid file system checks
     16 * Setting Root user to have password less login (and dropping all other user records/directories)
     17  * Modifying console logins (for serial console)
     18  * Modifying ssh logins (the two are coupled)
     19 * Installing necessary omf/oml packages
     20 * Blacklisting modules of wireless interfaces
     21 * adding the ntp package and then touch a file named /etc/ntp.conf.dhcp
     22 * Remove the file /etc/udev/rules.d/70-persistent-net.rules
     23  * prepare.sh usually handles this
     24 * Removing unnecessary packages and docs to minimize image size
     25  * prepare.sh usually handles this
     26 * Get hostname from dhcp
     27
     28----
     29
     30''' Base OS configuration '''
     31 1. Install base OS with a single 15GB partition. It should have no Swap. Openssh Server service should be installed.
     32 1. To configure grub/kernel messages to goto serial and prevent grub from looking for user input add/modify the following lines in /etc/default/grub and run update-grub(* see version notes):
     33    {{{
     34    GRUB_DEFAULT=0
     35    GRUB_HIDDEN_TIMEOUT=0
     36    GRUB_HIDDEN_TIMEOUT_QUIET=true
     37    GRUB_TIMEOUT=10
     38    GRUB_RECORDFAIL_TIMEOUT=0
     39    GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
     40    GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8"
     41    GRUB_TERMINAL=serial
     42    GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"
     43    }}}
     44 1. To configure the serial console for login create a file named /etc/init/ttyS0.conf and give it the following contents:
     45    {{{
     46    # ttyS0 - getty
     47    #
     48    # This service maintains a getty on ttyS0 from the point the system is
     49    # started until it is shut down again.
     50
     51    start on stopped rc or RUNLEVEL=[2345]
     52    stop on runlevel [!2345]
     53   
     54    respawn
     55    exec /sbin/getty -L 115200 ttyS0 vt102
     56    }}}
     57    then start it with up start:
     58    {{{
     59    sudo start ttyS0
     60    }}}
     61 1. Edit /etc/default/rcS and change the value of FSCKFIX
     62    {{{
     63    FSCKFIX=yes
     64    }}}
     65 1. Edit /etc/fstab to have the single disk (/dev/sda1) mount point
     66    {{{
     67    proc      /proc           proc    nodev,noexec,nosuid 0       0
     68    /dev/sda1 /               ext3    errors=continue 0       1
     69    }}}
     70 1. To configure root with no password edit /etc/shadow, the first line should look like:
     71    {{{
     72    root:!:15363:0:99999:7:::
     73    }}}
     74    remove the ! that follows the root. This will make the root account active and set the password to nil. Console logins for root will now
     75    not require a password. [[BR]]
     76    [[BR]]
     77    To get ssh to accept the changes we need to modify /etc/ssh/sshd_config make sure a couple of lines have specific values. They are:
     78    {{{
     79    PermitRootLogin yes
     80    StrictModes no
     81    PermitEmptyPasswords yes
     82    UsePAM no
     83    }}}
     84 1. Copy the modules blacklist tar [attachment:modprobe.d.tar file] directory into the /etc/modprobe.d directory. The contents should look like:
     85    {{{
     86root@node1-1:/etc/modprobe.d# ls -al
     87total 52
     88drwxr-xr-x  2 root root 4096 2011-06-05 23:03 .
     89drwxr-xr-x 80 root root 4096 2012-02-28 12:22 ..
     90-rw-r--r--  1 root root  323 2011-03-02 16:29 blacklist-ath5k.conf
     91-rw-r--r--  1 root root   16 2011-03-02 16:30 blacklist-ath9k.conf
     92-rw-r--r--  1 root root  325 2010-10-01 11:33 blacklist-ath_pci.conf
     93-rw-r--r--  1 root root 1603 2010-10-01 11:33 blacklist.conf
     94-rw-r--r--  1 root root  210 2010-10-01 11:33 blacklist-firewire.conf
     95-rw-r--r--  1 root root  660 2010-10-01 11:33 blacklist-framebuffer.conf
     96-rw-r--r--  1 root root   44 2011-06-05 23:03 blacklist-i2400m_usb.conf
     97-rw-r--r--  1 root root   36 2011-06-05 23:03 blacklist-iwlagn.conf
     98-rw-r--r--  1 root root  583 2011-04-01 10:05 blacklist-rare-network.conf
     99-rw-r--r--  1 root root 1077 2010-10-01 11:33 blacklist-watchdog.conf
     100-rw-r--r--  1 root root   29 2010-10-01 11:33 intel-5300-iwlagn-disable11n.conf
     101    }}}
     102 1. Setup NTP
     103    {{{
     104apt-get install ntp
     105touch /etc/ntp.conf.dhcp.
     106    }}}
     107 1. In order to get dhcp to set the hostname we'll need to make a link for the the /var/lib/dhcp directory and remove the send hostname line
     108    of the dhclient config. First run
     109    {{{
     110ln -s /var/lib/dhcp /var/lib/dhcp3
     111    }}}
     112    and in /etc/dhcp/dhclient.conf comment this line
     113    {{{
     114#send host-name "<hostname>";
     115    }}}
     116    then delete /etc/hostname.
     117 1. Add a symbolic link for lsusb
     118    {{{
     119    ln -s /usr/bin/lsusb /sbin/lsusb
     120    }}}
     121 1. Add the making a swap file [attachment:mkswap.sh script] to /etc/init.d
     122    {{{
     123cd /etc/init.d/
     124wget http://www.orbit-lab.org/raw-attachment/wiki/Documentation/SupportedImages/BuildingBaselineImage/mkswap.sh
     125chmod +x mkswap.sh
     126update-rc.d mkswap.sh defaults 99
     127cd /
     128    }}}
     129 1. You may need to edit /etc/fstab to make sure that the mount point for / is /dev/sda1 (instead of the uuid), and edit
     130    /etc/default/grub to set the do not use UUID flag to true. There were some issues with image saves and uuids.
     131
     132''' OMF configuration '''
     133
     134 13. To install the necessary packages from the mytestbed.net repository we need to first configure /etc/apt/sources.list . We will need only the precise repository. Edit the /etc/apt/sources.list
     135add the following line.
     136    {{{
     137deb http://pkg.mytestbed.net/ubuntu precise/
     138    }}}
     139 14. Add the following packages and files
     140    {{{
     141apt-get install omf-resctl-5.4 oml2-apps iperf-oml2
     142gem install oml4r
     143cd /usr/local/bin; wget http://witestlab.poly.edu/repos/misc/wmxstat
     144cd /etc/omf-resctl-5.4/;
     145wget http://www.orbit-lab.org/raw-attachment/wiki/Documentation/SupportedImages/BuildingBaselineImage/omf-resctl.yaml
     146cd /root;
     147    }}}
     148
     149''' Final Steps '''
     150 1. Run the prepare [attachment:prepare.sh file]
     151    {{{
     152cd /root
     153wget http://www.orbit-lab.org/raw-attachment/wiki/Documentation/SupportedImages/BuildingBaselineImage/prepare.sh
     154chmod +x prepare.sh
     155./prepare.sh
     156    }}}
     157
     158----
     159
     160==== Version Specific Notes ====
     161 * Ubuntu 12.10 (and 13.04)
     162  * This version of ubuntu enumerates the devices with a new naming scheme. It breaks many of our instrumentation scripts. To rectify the problem make this adjustment to /etc/default/grub:
     163    {{{
     164    GRUB_CMDLINE_LINUX_DEFAULT="biosdevname=0"
     165    GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8 biosdevname=0"
     166    }}}
     167    '''Note''': When you do this you will also have to '''fix /etc/network/interfaces''' as it will have the wrong device name.
     168
     169==== non-PAE kernels ====
     170
     171Older nodes require a kernel that does not require PAE as these kernels won't boot on the existing. The last version of ubunut to support this was 12.04 alternate install.