[Vmdebootstrap-devel] Bug#800910: vmdebootstrap: creates /etc/inittab even if sysvinit is not installed

Christian Seiler christian at iwakd.de
Sun Oct 4 21:19:15 UTC 2015


Package: vmdebootstrap
Version: 0.11-1
Severity: normal
Tags: patch upstream

Dear Maintainers,

while using vmdebootstrap to create VM images for the use with
autopkgtest, I've stumbled upon the following problem:

 - I want to do integration testing, and part of that is to test the
   package with different init systems.

 - The default test is run with the default init system, systemd. That
   works fine.

 - For testing sysvinit, I run
     apt-get -y --purge --install sysvinit-core
   inside the VM, then reboot the VM.

 - After that, I would run that test again with sysvinit as the init
   system.

Problem:

vmdebootstrap appends the serial console to /etc/inittab when creating
the VM - but sysvinit is not installed, so /etc/inittab doesn't exist.
That causes it to create an empty /etc/inittab with JUST a serial
console. (And no entries that start the rcscripts etc.)

When sysvinit is then installed later on, since /etc/inittab is a
conffile, the default inittab will never be installed.

When rebooting the VM, sysvinit will then hang asking for the runlevel
to boot into on the main kernel console (since no default is defined in
the configuration).

Trivial fix that doesn't hurt /etc/inittab would be to just not modify
the file if it's not present. Doesn't help though, because then the
scenario I'm looking at (want to use sysvinit inside the VM executing
the autopkgtest tests) won't work, because autopkgtest expects a serial
console to be available for communication with the VM.

I've attached a patch that does the following:

 - if /etc/inittab exists, nothing changes

 - if /etc/inittab doesn't exist, /etc/inittab.tail is created instead,
   and an init script is installed that will update /etc/inittab
   and append the /etc/inittab.tail file once it's booted under
   sysvinit for the first time (will do nothing under systemd)

I've successfully tested it on my system.

Thanks,
Christian

For reference, the command execute to create the image (according to
recommendations from the autopkgtest package):

vmdebootstrap --verbose --serial-console --distribution=sid \
              --customize=/usr/share/autopkgtest/adt-setup-vm \
              --user=adt/adt --size=10000000000 --grub \
              --image=adt-sid.raw
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Defer-modification-of-etc-inittab-until-sysvinit-is-.patch
Type: text/x-diff
Size: 3059 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/vmdebootstrap-devel/attachments/20151004/64ffb353/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/vmdebootstrap-devel/attachments/20151004/64ffb353/attachment.sig>


More information about the Vmdebootstrap-devel mailing list