Skip to content
No description, website, or topics provided.
Shell Awk Makefile Other
Branch: master
Clone or download
Latest commit 9246ef9 Jan 23, 2020
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
conf
doc doc: update create-release for tag different than version Oct 10, 2017
lxd-meta
patches-buildroot Remove unneeded patches. May 16, 2019
src
.gitignore
.travis.yml travis: skip cleanup and set file_glob. Jan 23, 2020
ChangeLog Change the password in /etc/shadow to gocubsgo. Nov 3, 2016
Makefile Move cache outside of build-dYYMMDD directory so it can be cached Jan 22, 2020
README
TODO add TODO Oct 20, 2011
fixup-fs make fixup-fs idempotent Jan 14, 2013
makedevs.list

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"
You can’t perform that action at this time.