summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS12
-rwxr-xr-xbin/vmdebootstrap8
-rw-r--r--debian/NEWS11
-rw-r--r--debian/changelog263
-rw-r--r--debian/compat1
-rw-r--r--debian/control36
-rw-r--r--debian/copyright30
-rw-r--r--debian/docs2
-rw-r--r--debian/gbp.conf2
-rw-r--r--debian/pydist-overrides2
-rwxr-xr-xdebian/rules42
-rw-r--r--debian/source/format1
-rw-r--r--debian/tests/control4
-rw-r--r--debian/tests/testsuite6
-rw-r--r--debian/vmdebootstrap.doc-base11
-rw-r--r--debian/vmdebootstrap.install5
-rw-r--r--debian/vmdebootstrap.manpages1
-rw-r--r--debian/watch2
-rw-r--r--doc/overview.rst20
-rw-r--r--setup.py5
-rw-r--r--vmdebootstrap/__init__.py1
-rw-r--r--vmdebootstrap/network.py2
-rw-r--r--vmdebootstrap/version.py3
-rw-r--r--yarns/300-slow-build-tests.yarn4
-rw-r--r--yarns/shell.lib2
25 files changed, 463 insertions, 13 deletions
diff --git a/NEWS b/NEWS
index c1ac34d..1453571 100644
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,17 @@
NEWS for vmdebootstrap
======================
-Version 0.3, unreleased
+Version 1.6+git, not yet released
+---------------------------------
+
+* New maintainer: Lars Wirzenius replaces Neil Williams.
+
+A lot of history missing from NEWS
+----------------------------------
+
+It's in git logs and debian/changelog, but wasn't included here.
+
+Version 0.3
-----------------------
* Add example customisation scripts to complement the support
diff --git a/bin/vmdebootstrap b/bin/vmdebootstrap
index 7571e7f..d9a697d 100755
--- a/bin/vmdebootstrap
+++ b/bin/vmdebootstrap
@@ -323,11 +323,7 @@ class VmDebootstrap(cliapp.Application): # pylint: disable=too-many-public-meth
else:
if self.settings['systemd-networkd']:
network.systemd_support(rootdir)
- if not distro.was_stable(datetime.date(2015, 4, 26)):
- network.enable_systemd_resolved(rootdir)
- else:
- # /etc/network/interfaces.d/
- network.setup_networking(rootdir)
+ network.enable_systemd_resolved(rootdir)
else:
# /etc/network/interfaces.d/
network.setup_networking(rootdir)
@@ -545,7 +541,7 @@ class VmDebootstrap(cliapp.Application): # pylint: disable=too-many-public-meth
logging.debug('stdout:\n%s', out)
logging.debug('stderr:\n%s', err)
out = runcmd(['chroot', rootdir,
- 'apt-get', '-f', '--no-remove', 'install'])
+ 'apt-get', '-y', '-f', '--no-remove', 'install'])
logging.debug('stdout:\n%s', out)
shutil.rmtree(tmp)
diff --git a/debian/NEWS b/debian/NEWS
new file mode 100644
index 0000000..c727770
--- /dev/null
+++ b/debian/NEWS
@@ -0,0 +1,11 @@
+vmdebootstrap (1.6-1) unstable; urgency=medium
+
+ * extlinux support is now deprecated. Grub to become default.
+
+ extlinux relies on external components to install the bootloader
+ inside the image which prevents vmdebootstap building the same image
+ on different systems. For this reason, extlinux is deprecated and
+ the default will change in a future release to disabling extlinux
+ and using grub by default.
+
+ -- Neil Williams <codehelp@debian.org> Sun, 31 Jul 2016 15:05:58 +0100
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..b904427
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,263 @@
+vmdebootstrap (1.6+git-1) UNRELEASED; urgency=medium
+
+ * New maintainer: Lars Wirzenius replaces Neil Williams.
+
+ -- Lars Wirzenius <liw@liw.fi> Sat, 10 Sep 2016 20:48:58 +0300
+
+vmdebootstrap (1.6-1) unstable; urgency=medium
+
+ * Deprecating extlinux as default - to switch to grub in a
+ future release.
+ * Fix customisation support for alternative mirrors.
+ * Switch to --no-systemd-networkd in man page (Closes: #831025)
+ * Enable systemd-resolved together with systemd-networkd to
+ ensure the final image has working DNS. (Closes: #831439)
+ * Reset umask before creating files and restore. (Closes: #822180)
+ * Disable ext4 with wheezy image (Closes: #822452)
+ * Update documentation for --customize. (Closes: #826275)
+ * Umount before doing the qcow2 conversion. (Closes: #831029)
+ * Ensure chown is called after the qcow2 conversion. (Closes: #831030)
+ * Exclude metadata_csum when building ext4 jessie images
+ (Closes: #827130)
+ * Support dependencies of custom packages. (Closes: #833398)
+
+ -- Neil Williams <codehelp@debian.org> Sun, 17 Jul 2016 15:29:01 +0100
+
+vmdebootstrap (1.5-1) unstable; urgency=medium
+
+ * Improve documentation of SIZE setting. (Closes: #812727)
+ * Set boot partition type based on boottype.
+ (Closes: #815256)
+ * Fix issue with fstab entry for boot partition.
+ (Closes: #815255)
+ * Catch typos where the requested size is too small for a
+ bootstrap. (Closes: #811464)
+
+ -- Neil Williams <codehelp@debian.org> Sun, 13 Mar 2016 14:44:53 +0000
+
+vmdebootstrap (1.4-1) unstable; urgency=medium
+
+ * New upstream release.
+ * Add support for root on btrfs with grub. (Closes: #741223)
+ * Add support for ppc64el kernel. (Closes: #809457)
+
+ -- Neil Williams <codehelp@debian.org> Sat, 23 Jan 2016 17:38:14 +0000
+
+vmdebootstrap (1.3-1~bpo8+1) jessie-backports; urgency=medium
+
+ * Rebuild for jessie-backports.
+ * cmdtest from backports is needed for the yarns tests.
+
+ -- Neil Williams <codehelp@debian.org> Wed, 20 Jan 2016 15:52:15 +0000
+
+vmdebootstrap (1.3-1) unstable; urgency=medium
+
+ * Add autopkgtest support for simple internal tests.
+ * Add tests on the package include functions and ensure that
+ no-kernel option works. (Closes: #808358)
+ * Disallow --apt-mirror without using --configure-apt as
+ well. (Closes: #806820)
+ * Adds support for converting final raw image to qcow2 format.
+ * Make update-initramfs call optional. (Closes: #801214)
+
+ -- Neil Williams <codehelp@debian.org> Sun, 20 Dec 2015 15:15:47 +0000
+
+vmdebootstrap (1.2-1~bpo8+1) jessie-backports; urgency=medium
+
+ * Rebuild for jessie-backports.
+
+ -- Neil Williams <codehelp@debian.org> Tue, 17 Nov 2015 17:42:37 +0000
+
+vmdebootstrap (1.2-1) unstable; urgency=medium
+
+ * New upstream release, migrating from experimental.
+ * Skip serial-console support except on Wheezy. (Closes: #800910)
+ * Add support for mounting and umounting /dev/pts
+ (Closes: #802752)
+ * Add Iain R. Learmonth as uploader
+ * Update VCS locations for alioth.
+ * Add cmdtest to Suggests for yarn tests.
+
+ -- Neil Williams <codehelp@debian.org> Thu, 05 Nov 2015 16:49:48 +0000
+
+vmdebootstrap (1.1-1) experimental; urgency=medium
+
+ * New upstream release for experimental
+
+ -- Neil Williams <codehelp@debian.org> Sun, 25 Oct 2015 18:10:19 +0000
+
+vmdebootstrap (1.0-1) experimental; urgency=medium
+
+ * New upstream release for experimental.
+
+ -- Neil Williams <codehelp@debian.org> Sun, 13 Sep 2015 21:37:00 +0100
+
+vmdebootstrap (0.11-1) unstable; urgency=medium
+
+ * New upstream release - handle efi options for wheezy support.
+ (Closes: #798225)
+ * Add debootstrapopts support to pass debootstrap options unchanged,
+ deprecate variant support which this replaces. (Closes: #770722)
+ * Reinstate headless supporti. (Closes: #798723)
+
+ -- Neil Williams <codehelp@debian.org> Sun, 13 Sep 2015 11:15:03 +0100
+
+vmdebootstrap (0.10-1) unstable; urgency=medium
+
+ * New upstream release - handle efi lookup of other
+ architectures. (Closes: #797445)
+
+ -- Neil Williams <codehelp@debian.org> Mon, 31 Aug 2015 18:25:56 +0100
+
+vmdebootstrap (0.9-1) unstable; urgency=medium
+
+ * New upstream release
+ * Add UEFI support using grub-efi
+ * Ensure that the /etc/network/interfaces.d/ directory
+ is created (Closes: #792182)
+
+ -- Neil Williams <codehelp@debian.org> Sat, 15 Aug 2015 18:13:01 +0200
+
+vmdebootstrap (0.8-1) unstable; urgency=medium
+
+ * New upstream release
+ * Use distro-info to handle change in the i386 arch kernel package
+ name (Closes: #786767)
+ * Change setup_networking to check for /etc/network/interfaces but
+ populate /etc/network/interfaces.d/setup (Closes: #788792)
+ * Add no-acpid option. (Closes: #784638)
+ * Add python-distro-info for release and codename support.
+
+ -- Neil Williams <codehelp@debian.org> Sun, 28 Jun 2015 11:03:50 +0100
+
+vmdebootstrap (0.7-1) unstable; urgency=medium
+
+ * New upstream release for unstable.
+ * Default to armmp kernel variant on armhf. Patches
+ from: Vagrant Cascadian <vagrant@debian.org>
+ (Closes: #776975)
+ * Add vmextract helper.
+ * Avoid adding extlinux config when using grub2
+ from Jan Gerber <j@mailb.org> (Closes: #742267)
+ * Installing grub with boot partition requires an offset
+ before the first partition. (Closes: #782307)
+ * Only configure console if serial-console is set
+ from Jan Gerber <j@mailb.org> (Closes: #782304)
+
+ -- Neil Williams <codehelp@debian.org> Sat, 02 May 2015 20:23:36 +0100
+
+vmdebootstrap (0.6-1) experimental; urgency=medium
+
+ * New upstream release
+ * Implement support for bootoffset to allow space
+ ahead of the first partition.
+ * Prints which distribution (and which variant) is
+ being debootstrapped (Closes: #767806)
+ * Add notes on the types of images supported on ARM.
+ * Add option to create swap space inside the KVM, minimum
+ size 256Mb. (Closes: #764337)
+ * Update manpage to current mirror default. (Closes: #774477)
+ * Allow builds under buildbot where there is no tty. Patch
+ from Nick Daly <nick.m.daly@gmail.com> (Closes: #747373)
+
+ -- Neil Williams <codehelp@debian.org> Tue, 23 Dec 2014 16:55:31 +0000
+
+vmdebootstrap (0.5-2) unstable; urgency=medium
+
+ * Backport patches from upstream master branch to fix creation of images
+ larger than 1GB that use extlinux (the default). Closes: #774588
+ . In debian/patches/:
+ - 0001-fix-creation-of-extlinux-configuration.patch
+ - 0002-add-mbr-back-to-support-extlinux-and-check-for-insta.patch
+
+ -- Antonio Terceiro <terceiro@debian.org> Mon, 02 Feb 2015 18:38:22 -0200
+
+vmdebootstrap (0.5-1) unstable; urgency=medium
+
+ * New upstream bug fix release for Jessie.
+ * Allow parted to reserve space for grub2 on disk when
+ also using --bootsize option. (Closes: #767913)
+ * Move grub2-common to Recommends. (Closes: #767196)
+ * Add section on bootloaders to manpage.
+
+ -- Neil Williams <codehelp@debian.org> Sun, 16 Nov 2014 15:11:34 +0000
+
+vmdebootstrap (0.4-3) unstable; urgency=medium
+
+ * Fix syntax for excluding grub2-common on mips and s390x
+
+ -- Neil Williams <codehelp@debian.org> Tue, 21 Oct 2014 08:49:03 +0100
+
+vmdebootstrap (0.4-2) unstable; urgency=medium
+
+ * Avoid grub2-common on mips and s390x, falls back
+ to extlinux with a warning message.
+
+ -- Neil Williams <codehelp@debian.org> Mon, 20 Oct 2014 18:38:13 +0100
+
+vmdebootstrap (0.4-1) unstable; urgency=medium
+
+ * Change Default mirror URL to use http://http.debian.net/debian/
+ (Closes: #765610)
+ * Run update-initramfs -u when installing a kernel package.
+ (Closes: #764596)
+ * Add devel mailing list as maintainer
+ * Add grub2-common as a dependency for grub install support.
+ * Set a noninteractive debconf environment for secondstage.
+
+ -- Neil Williams <codehelp@debian.org> Sat, 18 Oct 2014 20:22:23 +0100
+
+vmdebootstrap (0.3-1) unstable; urgency=medium
+
+ * New upstream release
+ * Allows images to not always be owned by root. Thanks to Nick Daly
+ <nick.m.daly@gmail.com> (Closes: #748477)
+ * Drop manpage patch, included upstream
+ * Drop kpartx patch, included upstream
+ * Add example customisation scripts for armhf targets.
+ * Recommend qemu to test built images and add notes about bootloaders
+ to control file. Drop need for mbr, not used by default
+
+ -- Neil Williams <codehelp@debian.org> Wed, 27 Aug 2014 23:21:10 -0700
+
+vmdebootstrap (0.2-3) unstable; urgency=medium
+
+ * Drop (<< 3:6.00~) from extlinux dependency (Closes: #748650). I was able
+ to generate an image and boot it with kvm just fine with extlinux
+ 3:6.03~pre1+dfsg-4
+ * debian/control: point Vcs-* at collab-maint repository
+
+ -- Antonio Terceiro <terceiro@debian.org> Tue, 20 May 2014 10:07:15 -0300
+
+vmdebootstrap (0.2-2) unstable; urgency=medium
+
+ * Make kpartx wait whilst the partitions are created.
+ (Closes: #741407)
+ * Update homepage location.
+ * Add a check on the cleanup umount and re-try if
+ unable to complete. (Closes: #740310)
+
+ -- Neil Williams <codehelp@debian.org> Sat, 15 Mar 2014 13:25:21 +0000
+
+vmdebootstrap (0.2-1) unstable; urgency=medium
+
+ * Update for new upstream location and new
+ upstream release. (Closes: #728138)
+ * Adapt copyright and watch file to new upstream location.
+
+ -- Neil Williams <codehelp@debian.org> Thu, 21 Nov 2013 22:49:12 +0000
+
+vmdebootstrap (0.1.0-2) unstable; urgency=low
+
+ * Restrict the package to the usable architectures,
+ amd64 and i386 only. (Closes: #722921)
+ * Fix problem with the orig.tar.gz differing from the
+ 0.1.0 upstream tag. (Closes: #721668)
+
+ -- Neil Williams <codehelp@debian.org> Sun, 15 Sep 2013 20:27:32 +0100
+
+vmdebootstrap (0.1.0-1) unstable; urgency=low
+
+ * Initial release (Closes: #711794)
+
+ -- Neil Williams <codehelp@debian.org> Tue, 23 Jul 2013 13:16:41 +0100
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..45a4fb7
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+8
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..21dc3b2
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,36 @@
+Source: vmdebootstrap
+Section: admin
+Priority: extra
+Maintainer: VMDebootstrap List <vmdebootstrap-devel@lists.alioth.debian.org>
+Uploaders: Lars Wirzenius <liw@liw.fi>,
+ Iain R. Learmonth <irl@debian.org>,
+ Antonio Terceiro <terceiro@debian.org>
+Build-Depends: debhelper (>= 8.0.0), dh-python,
+ python-sphinx (>= 1.0.7+dfsg) | python3-sphinx,
+ python | python-all | python-dev | python-all-dev,
+ python-setuptools (>= 3)
+Testsuite: autopkgtest
+X-Python-Version: 2.7
+Standards-Version: 3.9.8
+Homepage: https://vmdebootstrap.alioth.debian.org/
+Vcs-Git: https://anonscm.debian.org/git/vmdebootstrap/vmdebootstrap.git
+Vcs-Browser: https://anonscm.debian.org/cgit/vmdebootstrap/vmdebootstrap.git/
+
+Package: vmdebootstrap
+Architecture: linux-any
+Depends: debootstrap, qemu-utils, kpartx, parted,
+ ${sphinxdoc:Depends}, ${python:Depends}, ${misc:Depends}
+Recommends: dosfstools, grub2-common [!mips !s390x],
+ extlinux [amd64 i386],
+ squashfs-tools, python-guestfs, qemu-system, qemu-user-static
+Suggests: cmdtest, mbr, pandoc, u-boot:armhf
+Description: Bootstrap Debian into a (virtual machine) disk image
+ vmdebootstrap is a wrapper around debootstrap to install Debian
+ into a disk image, which can be used with a virtual machine (such as KVM).
+ .
+ syslinux and grub2 bootloaders can be supported, depending on the
+ distribution and the architecture. An example of setting up u-boot
+ for armhf on a beaglebone-black is included.
+ .
+ This package also includes documentation on using vmdebootstrap
+ to create installation images and live images.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..a915f76
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,30 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: vmdebootstrap
+Source: git://git.liw.fi/vmdebootstrap
+
+Files: *
+Copyright: 2011, 2012 Lars Wirzenius
+ 2012 Codethink Limited
+License: GPL-3.0+
+
+Files: debian/*
+Copyright: 2013 Neil Williams <codehelp@debian.org>
+License: GPL-3.0+
+
+License: GPL-3.0+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
+
diff --git a/debian/docs b/debian/docs
new file mode 100644
index 0000000..9eafbe1
--- /dev/null
+++ b/debian/docs
@@ -0,0 +1,2 @@
+README
+NEWS
diff --git a/debian/gbp.conf b/debian/gbp.conf
new file mode 100644
index 0000000..24bc746
--- /dev/null
+++ b/debian/gbp.conf
@@ -0,0 +1,2 @@
+[DEFAULT]
+overlay = True
diff --git a/debian/pydist-overrides b/debian/pydist-overrides
new file mode 100644
index 0000000..f01b9d5
--- /dev/null
+++ b/debian/pydist-overrides
@@ -0,0 +1,2 @@
+cliapp python-cliapp; PEP386
+distro-info python-distro-info; PEP386
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..b4086cd
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,42 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# Prevent setuptools/distribute from accessing the internet.
+export http_proxy = http://127.0.9.1:9
+
+export LAST_CHANGE=$(shell dpkg-parsechangelog -S Date)
+export BUILD_DATE=$(shell LC_ALL=C date -u "+%B %d, %Y" -d "$(LAST_CHANGE)")
+
+# This has to be exported to make some magic below work.
+export DH_OPTIONS
+
+%:
+ dh $@ --with sphinxdoc,python2
+
+override_dh_auto_build:
+ dh_auto_build
+ python setup.py build
+ make -C doc/ html SPHINXOPTS="-D today=\"$(BUILD_DATE)\""
+ make -C man/ man SPHINXOPTS="-D today=\"$(BUILD_DATE)\""
+
+override_dh_auto_install:
+ dh_auto_install
+ dh_lintian
+ python setup.py install --root=$(CURDIR)/debian/vmdebootstrap/ --install-layout=deb
+ # move vmdebootstrap to /usr/sbin
+ mkdir debian/vmdebootstrap/usr/sbin/
+ mv debian/vmdebootstrap/usr/bin/vmdebootstrap debian/vmdebootstrap/usr/sbin/
+
+override_dh_auto_clean:
+ dh_auto_clean
+ $(RM) -r vmdebootstrap.egg-info doc/_build dist/
+ [ ! -f doc/Makefile ] || make -C doc/ clean
+ [ ! -f doc/Makefile ] || make -C man/ clean
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..e6e153e
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,4 @@
+Tests: testsuite
+Depends: cmdtest, vmdebootstrap
+Restrictions: allow-stderr
+
diff --git a/debian/tests/testsuite b/debian/tests/testsuite
new file mode 100644
index 0000000..881b4cb
--- /dev/null
+++ b/debian/tests/testsuite
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+set -e
+
+yarns/run-tests --env TESTS=fast
+
diff --git a/debian/vmdebootstrap.doc-base b/debian/vmdebootstrap.doc-base
new file mode 100644
index 0000000..142b4b2
--- /dev/null
+++ b/debian/vmdebootstrap.doc-base
@@ -0,0 +1,11 @@
+Document: vmdebootstrap
+Title: Debian Vmdebootstrap Manual
+Author: Neil Williams <codehelp@debian.org>
+Abstract: This manual describes what vmdebootstap is
+ and how it can be used to create virtual machine
+ images, installation images and live images.
+Section: Debian
+
+Format: HTML
+Index: /usr/share/doc/vmdebootstrap/html/index.html
+Files: /usr/share/doc/vmdebootstrap/html/*.html
diff --git a/debian/vmdebootstrap.install b/debian/vmdebootstrap.install
new file mode 100644
index 0000000..96d5945
--- /dev/null
+++ b/debian/vmdebootstrap.install
@@ -0,0 +1,5 @@
+examples ./usr/share/vmdebootstrap/
+vmextract.py ./usr/share/vmdebootstrap/
+common ./usr/share/vmdebootstrap/
+doc/_build/html/ ./usr/share/doc/vmdebootstrap/
+bin/qemu-wrapper.sh ./usr/share/vmdebootstrap/
diff --git a/debian/vmdebootstrap.manpages b/debian/vmdebootstrap.manpages
new file mode 100644
index 0000000..6bb8251
--- /dev/null
+++ b/debian/vmdebootstrap.manpages
@@ -0,0 +1 @@
+man/_build/man/vmdebootstrap.8
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..e2e9879
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,2 @@
+version=3
+http://git.liw.fi/cgi-bin/cgit/cgit.cgi/vmdebootstrap/refs/ /cgi-bin/cgit/cgit.cgi/vmdebootstrap/snapshot/vmdebootstrap-(.+)\.tar\.gz
diff --git a/doc/overview.rst b/doc/overview.rst
index 9cea2e7..43693f2 100644
--- a/doc/overview.rst
+++ b/doc/overview.rst
@@ -38,6 +38,7 @@ Options
--output=FILE write output to FILE, instead of standard output
--verbose report what is going on
+ --no-verbose opposite of --verbose
--image=FILE put created disk image in FILE
--size=SIZE create a disk image of size SIZE (1000000000)
in bytes. Suffixes k,K,M,G,T are supported,
@@ -61,7 +62,8 @@ Options
set the directory containing debootstrap scripts.
--package=PACKAGE install PACKAGE onto system
--custom-package=DEB install package in DEB file onto system (not
- from mirror)
+ from mirror) - all dependencies must be available
+ in the specified distribution.
--no-kernel do not install a linux package
--kernel-package=PACKAGE
If ``--no-kernel`` is not used and the auto-selection
@@ -71,6 +73,7 @@ Options
--enable-dhcp enable DHCP on eth0
--root-password=PASSWORD
set root password
+ --lock-root-password lock root account so they cannot login?
--customize=SCRIPT run SCRIPT after setting up system. If the script
does not exist in the current working directory,
:file:`/usr/share/vmdebootstrap/examples/` will be
@@ -103,7 +106,10 @@ Options
installed kernel.
--boottype=FSTYPE Filesystem to use for the /boot partition. (default ext2)
--bootflag=FLAG Flag to set on the first partition. (default none)
+ --bootoffset=SIZE Space to leave at start of the image for bootloader
--roottype=FSTYPE Filesystem to use for the / (root) partition. (default ext4)
+ --part-type=PART-TYPE
+ Partition type to use for this image. (default msdos)
--swap=SWAPSIZE If specified, create a swap partition of the given
size within the image. Debootstrapping will fail
if this results in a root partition which is too
@@ -116,10 +122,17 @@ Options
Note: foreign debootstraps may take a significant
amount of time to complete and debootstrap will
retry five times if packages fail to install by default.
+ --use-uefi Setup image for UEFI boot
+ --no-use-uefi opposite of --use-uefi
+ --esp-size=SIZE Size of EFI System Partition - requires use-uefi
+ --extlinux install extlinux (deprecated: default will change in a
+ future release to use grub)
--no-extlinux Skip installation of extlinux. Needs grub, a customize script
or alternative bootloader to make the image bootable.
extlinux is deprecated and this will become the default
in a future release.
+ --mbr Run install-mbr (default if extlinux used)
+ --no-mbr opposite of --mbr
--squash=DIRECTORY Run mksquashfs against the rootfs using xz
compression --- requires ``squashfs-tools`` to be installed.
The squashfs and other files needed to use the squashfs
@@ -148,6 +161,7 @@ Options
--no-acpid Disable installation of acpid if not required, otherwise
acpid will be installed if ``--foreign`` is not used.
--sparse Skip optimizing image for compression and keep a sparse image.
+ --no-sparse opposite of --sparse
--pkglist Output a list of package names installed inside the image.
Useful if you need to track the relevant source packages
used inside the image for licence compliance.
@@ -156,6 +170,7 @@ Options
Skip the call to ``update-initramfs`` for reasons of
speed or practicality.
--convert-qcow2 Convert the final raw image to qcow2 format.
+ --systemd-networkd Use Predictable Network Interface Names
--no-systemd-networkd
Do not use Predictable Network Interface Names using
systemd-networkd.
@@ -551,6 +566,9 @@ to be specified separately::
$ sudo yarns/run-tests --env TESTS=build --env MIRROR=http://mirror/debian
+To run a single test, use the ``--run`` option to specify the name of the
+scenario (option can be repeated).
+
pre-commit
----------
diff --git a/setup.py b/setup.py
index eb08b27..76f9f0b 100644
--- a/setup.py
+++ b/setup.py
@@ -22,9 +22,12 @@
from setuptools import setup, find_packages
+import vmdebootstrap
+
+
setup(
name='vmdebootstrap',
- version='1.6',
+ version=vmdebootstrap.__version__,
description='Bootstrap Debian into a (virtual machine) disk image',
author='Neil Williams',
author_email='codehelp@debian.org',
diff --git a/vmdebootstrap/__init__.py b/vmdebootstrap/__init__.py
index e69de29..03a5053 100644
--- a/vmdebootstrap/__init__.py
+++ b/vmdebootstrap/__init__.py
@@ -0,0 +1 @@
+from .version import __version__, __version_info__
diff --git a/vmdebootstrap/network.py b/vmdebootstrap/network.py
index bed5134..25f3155 100644
--- a/vmdebootstrap/network.py
+++ b/vmdebootstrap/network.py
@@ -95,7 +95,7 @@ class Networking(Base):
ethpath = os.path.join(rootdir, 'etc', 'systemd', 'network', '99-dhcp.network')
with open(ethpath, 'w') as eth:
eth.write('[Match]\n')
- eth.write('Name=en*\n')
+ eth.write('Name=e*\n') # jessie uses eth*, stretch uses ens*
eth.write('\n[Network]\n')
eth.write('DHCP=yes\n')
runcmd(['chroot', rootdir, 'systemctl', 'enable', 'systemd-networkd'])
diff --git a/vmdebootstrap/version.py b/vmdebootstrap/version.py
new file mode 100644
index 0000000..86deea3
--- /dev/null
+++ b/vmdebootstrap/version.py
@@ -0,0 +1,3 @@
+__version__ = "1.6+git"
+__version_info__ = (1, 6, '+git')
+
diff --git a/yarns/300-slow-build-tests.yarn b/yarns/300-slow-build-tests.yarn
index 8137943..cf6f7c0 100644
--- a/yarns/300-slow-build-tests.yarn
+++ b/yarns/300-slow-build-tests.yarn
@@ -24,7 +24,7 @@ These tests are slow, since building images is slow.
ASSUMING build tests are requested
GIVEN user wants to build an image FOO.img that is 2GiB in size
WHEN the user runs vmdebootstrap --sparse --extlinux
- ... --roottype ext3 --enable-dhcp --configure-apt
+ ... --roottype ext3 --enable-dhcp --configure-apt --distribution stable
THEN the image has the correct size
AND the partition count of the image is 1
AND partition 1 has the boot flag set
@@ -32,7 +32,6 @@ These tests are slow, since building images is slow.
AND partition 1 has file /etc/debian_version matching ^8\..*$
AND partition 1 has filename ldlinux.sys
AND partition 1 has filename extlinux.conf
- AND partition 1 has file /etc/apt/sources.list.d/base.list matching jessie
SCENARIO build a Debian 8 image with grub
ASSUMING build tests are requested
@@ -67,7 +66,6 @@ These tests are slow, since building images is slow.
AND partition 1 has the boot flag set
AND partition 1 has an ext4 filesystem
AND partition 1 has symlink /sbin/init
- AND partition 1 has file /etc/apt/sources.list.d/setup matching jessie
SCENARIO build a Debian 8 image with uefi
ASSUMING build tests are requested
diff --git a/yarns/shell.lib b/yarns/shell.lib
index 69b7b06..1f8432e 100644
--- a/yarns/shell.lib
+++ b/yarns/shell.lib
@@ -85,6 +85,8 @@ kpartx_image_partition()
unkpartx_image()
{
+ dmsetup remove /dev/mapper/$(dmsetup ls|awk -F' ' '{print $1}')
+ losetup -d $(losetup -a | grep "$1" | awk -F':' '{print $1}')
kpartx -d "$1"
}