= Steps for Building a Baseline Image = Our images are primarily derived from a stock distributions 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. The major modifications that will be required are: * Setting up serial console * Grub serial config (including kernel flags) * Getty serial config (for loggin in from the serial console, other wise it looks like it hangs) * Setting Root user to have password less login (and dropping all other user records) * Modifying console logins (for serial console) * Modifying ssh logins (the two coupled) * installing necessary omf/oml packages * blacklisting modules of wireless interfaces * add the ntp package and then touch a file named /etc/ntp.conf.dhcp * remove the file /etc/udev/rules.d/70-persistent-net.rules * prepare.sh usually handles this * removing unnecessary packages and docs to minimize image size * prepare.sh usually handles this Other steps that may be required are: * Configuring partitions and mount tables * We expect a 10G root partition (/dev/sda1) and 4G swap partion (/dev/sda2). They should be sequential. * get hostname from dhcp ---- == !Version/Distributions specific Notes == === Base OS configuration === 1. To configure grub/kernel messages to goto serial add/modify the following lines in /etc/default/grub and run update-grub: {{{ GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8" GRUB_TERMINAL=serial GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1" }}} To configure the serial console for login create a file named /etc/init/ttyS0.conf and give it the following contents: {{{ # ttyS0 - getty # # This service maintains a getty on ttyS0 from the point the system is # started until it is shut down again. start on stopped rc or RUNLEVEL=[2345] stop on runlevel [!2345] respawn exec /sbin/getty -L 115200 ttyS0 vt102 }}} then start it with up start: {{{ sudo start ttyS0 }}} 1. To configure root with no password edit /etc/shadow, the first line should look like: {{{ root:!:15363:0:99999:7::: }}} 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 not require a password. [[BR]] [[BR]] 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: {{{ PermitRootLogin yes StrictModes no PermitEmptyPasswords yes UsePAM no }}} 1. Copy the modules blacklist tar [attachment:modprobe.d.tar file] directory into the /etc/modprobe.d directory. The contents should look like: {{{ root@node1-1:/etc/modprobe.d# ls -al total 52 drwxr-xr-x 2 root root 4096 2011-06-05 23:03 . drwxr-xr-x 80 root root 4096 2012-02-28 12:22 .. -rw-r--r-- 1 root root 323 2011-03-02 16:29 blacklist-ath5k.conf -rw-r--r-- 1 root root 16 2011-03-02 16:30 blacklist-ath9k.conf -rw-r--r-- 1 root root 325 2010-10-01 11:33 blacklist-ath_pci.conf -rw-r--r-- 1 root root 1603 2010-10-01 11:33 blacklist.conf -rw-r--r-- 1 root root 210 2010-10-01 11:33 blacklist-firewire.conf -rw-r--r-- 1 root root 660 2010-10-01 11:33 blacklist-framebuffer.conf -rw-r--r-- 1 root root 44 2011-06-05 23:03 blacklist-i2400m_usb.conf -rw-r--r-- 1 root root 36 2011-06-05 23:03 blacklist-iwlagn.conf -rw-r--r-- 1 root root 583 2011-04-01 10:05 blacklist-rare-network.conf -rw-r--r-- 1 root root 1077 2010-10-01 11:33 blacklist-watchdog.conf -rw-r--r-- 1 root root 29 2010-10-01 11:33 intel-5300-iwlagn-disable11n.conf }}} 1. Setup NTP {{{ apt-get install ntp touch /etc/ntp.conf.dhcp. }}} 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 of the dhclient config. First run {{{ ln -s /var/lib/dhcp /var/lib/dhcp3 }}} and in /etc/dhcp/dhclient.conf comment this line {{{ #send host-name ""; }}} then delete /etc/hostname. 1. Add a symbolic link for lsusb {{{ ln -s /usr/bin/lsusb /sbin/lsusb }}} 1. Add the making a swap file [attachment:mkswap.sh script] to /etc/init.d {{{ cd /etc/init.d/ wget http://www.orbit-lab.org/raw-attachment/wiki/Documentation/SupportedImages/BuildingBaselineImage/mkswap.sh chmod +x mkswap.sh update-rc.d mkswap.sh defaults 99 cd / }}} 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 /etc/default/grub to set the do not use UUID flag to true. There were some issues with image saves and uuids. === OMF configuration === 1. 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 add the following line. {{{ deb http://pkg.mytestbed.net/ubuntu precise/ }}} 1. Add the following packages and files {{{ apt-get install omf-resctl-5.4 oml2-apps iperf-oml2 gem install oml4r cd /usr/local/bin; wget http://witestlab.poly.edu/repos/misc/wmxstat cd /root; }}} === Final Steps === 1. Run the prepare [attachment:prepare.sh file] {{{ cd /root wget http://www.orbit-lab.org/raw-attachment/wiki/Documentation/SupportedImages/BuildingBaselineImage/prepare.sh chmod +x prepare.sh ./prepare.sh }}}