Provides linux disk and kernel/initramfs images.
Go to file
Dr. Jens Harbott 56003ee555 Fix boottest for the arm image
Since focal is using a newer qemu than bionic, we need to adopt the qemu
parameter for the boot test, otherwise there is an issue with the pci
initialization and the VM ends up without a network device. [0]

[0] https://bugs.launchpad.net/qemu/+bug/1790975

Signed-off-by: Dr. Jens Harbott <harbott@osism.tech>
Change-Id: I03f77189d670f5b5e3cd9c74e97263af41855575
2022-05-29 11:39:03 +02:00
bin Fix boottest for the arm image 2022-05-29 11:39:03 +02: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 Backport Busybox fix to 'ip' command- closes #54 2020-03-06 17:50:55 +01:00
playbooks Add build jobs for all arches 2022-05-15 16:45:08 +02:00
src Add ahci module - closes #64 2021-02-17 14:06:50 +00:00
.gitignore Replace .bzrignore with .gitignore 2016-09-19 10:43:54 -04:00
.gitreview Initial patch for opendev import 2022-02-04 16:24:23 +01:00
.zuul.yaml Fix boottest for the arm image 2022-05-29 11:39:03 +02: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.md Add build jobs for all arches 2022-05-15 16:45:08 +02:00
TODO add TODO 2011-10-20 11:44:14 -04:00
bindep.txt Add build jobs for all arches 2022-05-15 16:45:08 +02: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.md

The CirrOS project provides linux disk and kernel/initramfs images. The images are well suited for testing as they are small and boot quickly. Please note that:

  • Images are provided for test only. They should not be used in production.
  • Images have well known login information. Users can log in with 'cirros:letsgocubs' locally or remotely and have passwordless sudo access to root.

CirrOS images have useful tools and function for debugging or developing cloud infrastructure. Supported architectures are:

  • aarch64 (64-bit Armv8 often called arm64)
  • arm (32-bit Armv7)
  • i386 (32-bit x86)
  • powerpc (32-bit PowerPC)
  • ppc64 (64-bit Power big endian)
  • ppc64le (64-bit Power little endian)
  • x86_64 (64-bit x86 often called amd64)

Resulting images can be booted using QEMU. Several ways of booting are provided:

  • UEFI (aarch64, arm, i386, x86_64)
  • BIOS (i386, x86_64)
  • OpenFirmware (powerpc, ppc64, ppc64le)
  • direct kernel + initrd (all architectures)

Build instructions

The following works on Ubuntu 18.04 LTS, running on x86_64. Native building for other architectures is not recommended. Support for building under other distributions is limited and not tested.

Clone sources

Install required software

To get build going we need some packages installed. If you use Ubuntu 18.04 LTS then all you need to do is:

  • cd cirros

  • get the build dependencies:

   $ ./bin/system-setup

If you use other distribution then please check what script does and install required components using methods preferred by your distribution.

Short version

Once you fetched source code all you have to do something like:

  • cd cirros
  • bin/build-release daily

If you want to build for only subset of supported architectures when use ARCHES variable like:

  • ARCHES=aarch64,x86_64,arm bin/build-release daily

Resulting images will be present in ../build-dYYMMDD/release directory.

Long, detailed version

To use it, you would do something like:

  • 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 file. 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. Version can be taken from https://launchpad.net/ubuntu/+source/linux page.
   $ kver="4.4.0-148.174"
   $ ./bin/grab-kernels "$kver" $ARCH
   $ 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

testing images

We provide simple script to test resulting image. You run it this way:

   $ RELEASE_DIR=$PWD/../build-*/release IMG=$PWD/../build-*/release/cirros-*-x86_64-disk.img bin/test-boot

Note: "RELEASE_DIR" variable is required only for aarch64 and arm images.

Once image boots you can login with 'cirros' user using 'gocubsgo' as password. Root access is granted with 'sudo' call.