Bug#845925: autopkgtest boostrap qemu

SZALAY Attila sasa at debian.org
Sun Aug 13 13:19:10 UTC 2017


Hi,

I run through this at DebConf when I tried to set up my new laptop for
debian work. The problem is, that vmdebootsrap is actually just create
a file, mount it through a loop device and after bootsrapping it it
will run the customizer script in the HOST environment. And if we think
about it, it is logical, because this allows the customizer script to
copy any file from the host os to the disk image if it want.

The mentioned customizer script (/usr/share/autopkgtest/setup-
commands/setup-testbed) also uses this feature when, for example, tries
to detect the used apt proxy.

So, all commands (especially installing packages) which the script want
to run inside the new image is run by/through the chroot command. For
example:

# install some necessary packages
# some tests use a lot of /dev/random, avoid hangs; eatmydata for fast
dpkg, a
# lot of tests expect a logind session
chroot "$root" apt-get install -y eatmydata dbus < /dev/null

And yes, the problem is, that in some cases the /etc/resolv.conf just a
symlink and point to a file which does not exists until the qemu guest
is booted up.

I'm not 100% sure, but I have the feeling that this depends on your
host environment. Because, I think, the debootstrap copies the
/etc/resolv.cong file as-is to the chroot environment.

My first idea was to use the AUTOPKGTEST_APT_PROXY environment
variable, but that did not work because the proxy only set at the end
of the customization script and all the apt-get install command already
 run.

So, my solution was, as a dirty hack, to copy the content of the
/etc/resolv.conf into the chroot. Something like this what is attached
to this email.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: autopkgtest_qemu_setup-testbed.diff
Type: text/x-patch
Size: 753 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/autopkgtest-devel/attachments/20170813/a3e94c2d/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.alioth.debian.org/pipermail/autopkgtest-devel/attachments/20170813/a3e94c2d/attachment.sig>


More information about the autopkgtest-devel mailing list