Skip to content

Cirros is a minimal vm for OpenStack here forked from lp:cirros

Notifications You must be signed in to change notification settings

csabahenk/cirros

Repository files navigation

This is a project to build a small cloud image that has useful tools and
function for debugging or developing cloud infrastructure.

The following works on Ubuntu 10.04 or 12.04 LTS.

To use it, you would do something like:
 * get some build dependencies:
   $ sudo apt-get -y install bison flex texinfo build-essential gettext ncurses-dev unzip bzr qemu-kvm cvs quilt ruby1.9.1

 * get Cirros
   $ git clone -b manila-service-generic https://github.com/csabahenk/cirros
   $ cd cirros

 * download buildroot and setup environment
   $ git submodule init
   $ git submodule update

 * update ./bin/mkcabundle > src/etc/ssl/certs/ca-certificates.crt
   $ ./bin/mkcabundle > src/etc/ssl/certs/ca-certificates.crt

 * apply any local cirros patches to buildroot (note nfsv4 support is
   available in a patch)
   ( cd buildroot && QUILT_PATCHES=$PWD/../patches-buildroot quilt push -a )

 * download the buildroot sources
   $ make ARCH=x86_64 br-source

 * Build buildroot for a given arch
   # ARCH should be set to 'i386', 'x86_64' or 'arm'
   $ make ARCH=x86_64 OUT_D=$PWD/output/x86_64

   This will do a full buildroot build, which will take a while. The output
   that CirrOS is interested in is output/i386/rootfs.tar.
   That file is the full buildroot filesystem, and is used as input for
   subsequent steps here.

 * Download a kernel to use.
   The kernel input to bundle must be in deb format. The ubuntu '-virtual'
   kernel is used as a starting point.

   For example, to get the Ubuntu Saucy kernel for x86_64:

   # Following links to find deb archive from
   # https://launchpad.net/ubuntu/saucy/+package/linux-image
   $ (cd download &&
      wget http://launchpadlibrarian.net/164735055/linux-image-3.11.0-17-generic_3.11.0-17.31_amd64.deb)

 * build disk images using bin/bundle
   $ sudo ./bin/bundle -v output/$ARCH/rootfs.tar download/kernel-$ARCH.deb output/$ARCH/images

 * Then, test using the images
   $ kvm -drive file=disk.img,if=virtio -curses
   $ kvm file=blank.img,if=virtio -curses \
      -kernel kernel -initrd initrd -drive -append "debug-initrd"

To make changes in buildroot configuration:

 * Have an up-to-date buildroot checkout

 * Copy the conf file corresponding to your architecture
   to buildroot tree
   $ cp conf/buildroot-x86_64.config buildroot/.config

 * Perform config changes
   $ make -C buildroot menuconfig

 * Copy back the config file to Cirros project space
   to preserve it for further builds
   $ cp buildroot/.config conf/buildroot-x86_64.config

 * Commit to git
   $ git commit -a

To update buildroot or switch to another version:

 * Do the update and let git know of it

   $ cd buildroot
   $ git pull
     or
   $ git checkout <ref>
   $ cd ..
   $ git add buildroot

 * Update config
   $ cp conf/buildroot-x86_64.config buildroot/.config &&
     make -C buildroot olddefconfig &&
     cp buildroot/.config conf/buildroot-x86_64.config

 * Commit to git
   $ git commit -a

About

Cirros is a minimal vm for OpenStack here forked from lp:cirros

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published