Provides linux disk and kernel/initramfs images.
Go to file
Marcin Juszkiewicz e381395b2d Move cache outside of build-dYYMMDD directory so it can be cached
Travis allows us to cache directories between builds. Let make it
easier.
2020-01-22 21:23:59 +01:00
bin Move cache outside of build-dYYMMDD directory so it can be cached 2020-01-22 21:23:59 +01:00
conf buildroot 2019.02.1 ppc64le config, using musl and libtirpc 2019-05-16 11:04:44 -04:00
doc doc: update create-release for tag different than version 2017-10-10 12:44:35 -04:00
lxd-meta Add stream data and creation of metadata for lxd and -lxc.tar.xz. 2017-11-20 10:13:49 -05:00
patches-buildroot Remove unneeded patches. 2019-05-16 11:04:44 -04:00
src Merge pull request #2 from hrw/bug1852714 2020-01-22 10:48:39 -05:00
.gitignore Replace .bzrignore with .gitignore 2016-09-19 10:43:54 -04:00
.travis.yml Move cache outside of build-dYYMMDD directory so it can be cached 2020-01-22 21:23:59 +01:00
ChangeLog Change the password in /etc/shadow to gocubsgo. 2016-11-03 12:32:09 -04:00
Makefile Move cache outside of build-dYYMMDD directory so it can be cached 2020-01-22 21:23:59 +01:00
README README file updates. 2019-05-16 11:04:44 -04:00
TODO add TODO 2011-10-20 11:44:14 -04:00
fixup-fs make fixup-fs idempotent 2013-01-14 10:42:14 -05:00
makedevs.list makedevs.list: fix device type of /dev/random and /dev/urandom 2013-05-09 18:38:38 -07:00

README

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 18.04 LTS, running on x86_64.  Native building
for other architectures is not recommended.

To use it, you would do something like:
 * get the build dependencies:
   $ ./bin/system-setup

 * git clone https://git.launchpad.net/~cirros-dev/cirros
   or
   git clone git://git.launchpad.net/~cirros-dev/cirros
   or
   git clone git+ssh://git.launchpad.net/~cirros-dev/cirros

 * cd cirros

 * download buildroot and setup environment
   $ br_ver="2019.02.1"
   $ mkdir -p ../download
   $ ln -snf ../download download
   $ ( cd download && wget http://buildroot.uclibc.org/downloads/buildroot-${br_ver}.tar.gz )
   $ tar -xvf download/buildroot-${br_ver}.tar.gz
   $ ln -snf buildroot-${br_ver} buildroot

 * optionally update src/etc/ssl/certs/ca-certificates.crt
   This is not required, but can be done to make sure its up to date.
   # wget https://github.com/mozilla/gecko-dev/raw/master/security/nss/lib/ckfw/builtins/certdata.txt -O certdata.txt
   # ./bin/mkcabundle <certdata.txt > src/etc/ssl/certs/ca-certificates.crt

 * apply any local cirros patches to buildroot
   ( cd buildroot && QUILT_PATCHES=$PWD/../patches-buildroot quilt push -a )

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

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

   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.

   # kver is newest -updates kernel from https://launchpad.net/ubuntu/+source/linux
   $ kver="4.4.0-148.174"
   $ ./bin/grab-kernels "$kver" $ARCH

 * Download EFI grub to use.
   The grub-efi input to bundle will be in tar.gz format.

   # gver is newest from https://launchpad.net/ubuntu/+source/grub2
   $ gver="2.02~beta2-36ubuntu3.22"
   $ ./bin/grab-grub-efi "$gver" $ARCH

 * build disk images using bin/bundle
   $ sudo ./bin/bundle -v --arch=$ARCH output/$ARCH/rootfs.tar \
      download/kernel-$ARCH.deb download/grub-efi-$ARCH.tar.gz 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"