Code Monkey home page Code Monkey logo

qemu-sbuild-utils's Introduction

sbuild using QEMU

These are a set of scripts that facilitate building Debian packages in a QEMU instance using sbuild's --chroot-mode=autopkgtest.

While it may seem like overkill to launch a QEMU instance just to build a package, the overhead in relation to total build time is negligible, and there are numerous advantages:

  • Diverse environments. You can build on any architecture for which a bootable image can be created (although you might not be able to use acceleration, for example when booting an arm64 image on an amd64 host). You can use any distribution by debootstrap.
  • Isolation. You can go crazy within the instance without affecting the host on which it is launched (barring security vulnerabilities in QEMU, of course). Test suites that modify the system can be run without concern.
  • Snapshots. You can save and reload the state of any running instance. This is especially useful when attempting to reproduce something: you don't need to recreate a particular environment, you can just save it.

As one might have guessed by the mode name, the very same images can also be used to run autopkgtest tests, for the build result, including those with the breaks-testbed or isolation-machine restrictions.

Work for architectures other than amd64 and i386 is still in progress, although I expect it will be added soon.

Utilities

qemu-sbuild

A light-weight wrapper around sbuild. It understands a few VM-specific arguments (CPUs, RAM, etc.), and passes all remaining arguments through to sbuild. Images are used in snapshot mode, so changes are not persisted. This not only makes the VMs fast, the image can also be used concurrently by multiple processes.

Note that some sbuild options don't work in autopkgtest mode yet. For example, it is not yet possible to drop into a shell after a failed build (the bridge code does not support this yet).

See qemu-sbuild -h for more info.

qemu-sbuild-update

An sbuild-update analog. Launches an image, and runs apt-get update, upgrade, clean, an autoremove.

Expects only the image name as argument.

qemu-sbuild-create

A light-weight wrapper around autopkgtest-build-qemu that simplifies setting some of the options, and also generated the desired sources.list. Ships with a script modscript that is used by autopkgtest-build-qemu to implement some of the modifications.

See qemu-sbuild-create -h for more info.

Acceleration

By adding the build user to the kvm group, qemu-sbuild can operate with near-native performance on systems where KVM is supported:

$ sudo gpasswd -a <build-user> kvm
# Logout, and login

qemu-sbuild-utils's People

Contributors

ckastner avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.