wiki:Documentation/SupportedImages/BuildingBaselineImage

Version 22 (modified by seskar, 12 years ago) ( diff )

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

Ubuntu 11.10

  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
    
  2. 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.

    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
    
  3. To install the necessary packages from the mytestbed.net repository we need to first configure /etc/apt/sources.list . We will need the repository for natty since the oneiric repository doesn't containt packages from omf-5.3.
    deb http://pkg.mytestbed.net/ubuntu natty/
    
    The current oneiric repository doesn't have a version of libxmpp4r-ruby which was part of the natty(and older) universe repositories. Instead we will have to manually download the debs and install them. I used the follow commands to retrieve and install them from an ubuntu mirror. You may have to install ruby first other wise the dependencies will not be met for these packages. When I did this initially on (11.04) apt complained, but was able to rectify the problem with an apt-get -f install
    wget http://ubuntu.media.mit.edu/ubuntu//pool/universe/libx/libxmpp4r-ruby/libxmpp4r-ruby1.8_0.5-1_all.deb
    dpkg -i libxmpp4r-ruby1.8_0.5-1_all.deb
    wget http://ubuntu.media.mit.edu/ubuntu//pool/universe/libx/libxmpp4r-ruby/libxmpp4r-ruby_0.5-1_all.deb
    dpkg -i libxmpp4r-ruby_0.5-1_all.deb
    
    The first is the actual package, the second is a container. Apt will refuse to install OMF-5.3 if the container package is not installed. From here we simply need to update and install the two omf-5.3 packages
    apt-get install omf-common-5.3 omf-expctl-5.3
    
    Finally we install OML2. The meta package seems broken, but is unnecessary any way. We can simply install all the oml2 packages (except for oml2-apps-all)
    apt-get install oml2-nmetrics liboml2-0 oml2-gpslogger oml2-proxy-server oml2-iperf oml2-otg2 oml2-wlanconfig oml2-proxycon oml2-trace liboml2-dev oml2-server
    
  4. Copy the modules blacklist 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
    
  5. apt-get install ntp, and then touch /etc/ntp.conf.dhcp.
  6. In order to get dhcp to set the hostname we'll need to rename the /var/lib/dhcp directory and remove the send hostname line of the dhclient config. First run
    mv /var/lib/dhcp /var/lib/dhcp3
    
    and in /etc/dhcp/dhclient.conf comment this line
    #send host-name "<hostname>";
    
    then delete /etc/hostname.
  7. Add a symbolic link for lsusb
    ln -s /usr/bin/lsusb /sbin/lsusb
    
  8. Add deb http://pkg.mytestbed.net/ubuntu oneiric/ to /etc/apt/sources.list (aslo check for deb http://pkg.mytestbed.net/ubuntu natty/)
  9. Install omf-resctl-5.4 and omf-resctl-5.3
    apt-get install omf-resctl-5.4
    apt-get install omf-resctl-5.3
    
  10. Copy the example winlab yaml file from /usr/share/doc/omf-resctl-5.3/examples/ to /etc/omf-resctl-5.3 and modifiy it to include the lines.
    control_if: 'eth1'
    pubsub_gateway: 'xmpp'
    name: '%hostname%'
    resizefs: true
    
  11. Switch to a swap file instead of swap partition:
    1. Make the file:
      dd if=/dev/zero of=/swapfile bs=1G count=2
      mkswap /swapfile
      chown root.root /swapfile
      chmod 0600 swapfile
      
    2. Edit the fstab to make /swapfile the mounted swap device: Add this line:
      /swapfile none            swap    sw              0       0
      
  12. 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.
  13. Run the prepare file

Ubuntu 12.04

Installing Ubuntu 12.04 with the default installation media fails because the prepackaged kernel requires PAE suppport. PAE is an memory addressing scheme that allows 32 CPUs to access more than 4GB of ram. The Via C3 processors don't support this feature. Documented here. To resolve this a work around is documented here and here. The crux of their recommendation is to use the netbook mini.iso (Downloadable here) installer (Which actually has nothing to do with netbooks as it is entirely capable of download the full desktop install) to do the installation. This installer uses the non-pae kernel (vmlinuz-3.2.0-27-generic) and does successfully install. The default install sets the quiet and splash kernel flags which may make it seem like the install failed.

Mostly I've followed the directions for 11.10, however:

  1. When installing the oml libraries, I ran into this error:
    The following packages have unmet dependencies:
     oml2-gpslogger : Depends: libgps19 (>= 2.90~svn6694) but it is not installable
    E: Unable to correct problems, you have held broken packages.
    
    For now, I'm just going to skip that package.
  2. For now I'm also skipping the
    mv /var/lib/dhcp /var/lib/dhcp3
    
    step, just in case it's no longer needed. If it is I will make a symlink instead. Still commented the send host name line however.

FIX ME

  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;

Attachments (5)

  • modprobe.d.tar (20.0 KB ) - added by ssugrim 13 years ago. Collection of module black list conf files.
  • omf-resctl.yaml (2.3 KB ) - added by seskar 12 years ago. OMF Resource Controller 5.4 configuration file
  • mkswap.sh (918 bytes ) - added by ssugrim 12 years ago. Start up script to make swap files
  • prepare.sh (1.2 KB ) - added by ssugrim 10 years ago. Updated prepare file to deal with hostnames
  • blacklist.tar (10.0 KB ) - added by seskar 10 years ago. Blacklisted drivers

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.