1 This is a project to build a small cloud image that has useful tools and
2 function for debugging or developing cloud infrastructure.
4 The following works on Ubuntu 14.04 LTS.
6 To use it, you would do something like:
7 * get the build dependencies:
10 * bzr branch lp:cirros
13 * download buildroot and setup environment
15 $ mkdir -p ../download
16 $ ln -snf ../download download
17 $ ( cd download && wget http://buildroot.uclibc.org/downloads/buildroot-${br_ver}.tar.gz )
18 $ tar -xvf download/buildroot-${br_ver}.tar.gz
19 $ ln -snf buildroot-${br_ver} buildroot
21 * optionally update src/etc/ssl/certs/ca-certificates.crt
22 This is not required, but can be done to make sure its up to date.
23 Doing so requires cvs.
24 # ./bin/mkcabundle > src/etc/ssl/certs/ca-certificates.crt
26 * apply any local cirros patches to buildroot
27 ( cd buildroot && QUILT_PATCHES=$PWD/../patches-buildroot quilt push -a )
29 * download the buildroot sources
30 $ make ARCH=i386 br-source
32 * Build buildroot for a given arch
33 # ARCH should be set to 'i386', 'x86_64' or 'arm'
34 $ make ARCH=i386 OUT_D=$PWD/output/i386
36 This will do a full buildroot build, which will take a while. The output
37 that CirrOS is interested in is output/i386/rootfs.tar.
38 That file is the full buildroot filesystem, and is used as input for
39 subsequent steps here.
41 * Download a kernel to use.
42 The kernel input to bundle must be in deb format. The ubuntu '-virtual'
43 kernel is used as a starting point.
45 # kver is newest -updates kernel from https://launchpad.net/ubuntu/+source/linux
46 $ kver="3.19.0-20.20~14.04.1"
47 $ ./bin/grab-kernels "$kver"
49 * build disk images using bin/bundle
50 $ sudo ./bin/bundle -v --arch=$ARCH output/$ARCH/rootfs.tar \
51 download/kernel-$ARCH.deb output/$ARCH/images
53 * Then, test using the images
54 $ kvm -drive file=disk.img,if=virtio -curses
55 $ kvm file=blank.img,if=virtio -curses \
56 -kernel kernel -initrd initrd -drive -append "debug-initrd"