[Bug 1799736] Re: Restore the ability to produce core16 images
Robert C Jennings
1799736 at bugs.launchpad.net
Mon Dec 10 18:12:23 UTC 2018
I have tested on amd64 with livecd-rootfs 2.408.41 from -proposed
following the test case in the description. My testing diverged from
the test plan in that I am driving livecd-rootfs with ubuntu-old-
fashioned[1] which builds with launchpad-buildd tools in a lxd container
to replicate the buildd environment. In this environment the build
fails due to the lack of 'sudo':
[2018-12-10 18:06:08] lb_build
P: Executing auto/build script.
Fetching core
Fetching pc-kernel
Fetching pc
Warning: for backwards compatibility, `ubuntu-image` falls back to `ubuntu-image snap` if no subcommand is given
-o/--output is deprecated; use -O/--output-dir instead
Crash in state machine
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/ubuntu_image/__main__.py", line 341, in main
list(state_machine)
File "/usr/lib/python3/dist-packages/ubuntu_image/state.py", line 82, in __next__
step()
File "/usr/lib/python3/dist-packages/ubuntu_image/common_builder.py", line 337, in populate_filesystems
self._populate_one_volume(name, volume)
File "/usr/lib/python3/dist-packages/ubuntu_image/common_builder.py", line 290, in _populate_one_volume
preserve_ownership=True)
File "/usr/lib/python3/dist-packages/ubuntu_image/helpers.py", line 233, in mkfs_ext4
with mount(img_file) as mountpoint:
File "/usr/lib/python3.5/contextlib.py", line 59, in __enter__
return next(self.gen)
File "/usr/lib/python3/dist-packages/ubuntu_image/helpers.py", line 207, in mount
run('sudo mount -oloop {} {}'.format(img, mountpoint))
File "/usr/lib/python3/dist-packages/ubuntu_image/helpers.py", line 115, in run
**args)
File "/usr/lib/python3.5/subprocess.py", line 693, in run
with Popen(*popenargs, **kwargs) as process:
File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'sudo'
Build failed
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/lpbuildd/target/build_livefs.py", line 161, in run
self.build()
File "/usr/lib/python2.7/dist-packages/lpbuildd/target/build_livefs.py", line 152, in build
self.run_build_command(["lb", "build"], env=base_lb_env)
File "/usr/lib/python2.7/dist-packages/lpbuildd/target/build_livefs.py", line 79, in run_build_command
return self.backend.run(args, cwd="/build", **kwargs)
File "/usr/lib/python2.7/dist-packages/lpbuildd/target/lxd.py", line 490, in run
subprocess.check_call(cmd, **kwargs)
File "/usr/lib/python2.7/subprocess.py", line 541, in check_call
raise CalledProcessError(retcode, cmd)
CalledProcessError: Command '['lxc', 'exec', 'lp-xenial-amd64', '--env', 'PROJECT=ubuntu-core', '--env', 'ARCH=amd64', '--', '/bin/sh', '-c', 'cd /build && linux64 lb build']' returned non-zero exit status 1
The rootfs used by the builders does not have 'sudo' installed, it
should be a package dependency for livecd-rootfs based on this testing.
I'm going to mark this as verification-failed-xenial. However, I did
install 'sudo' manually in the build environment and this resulted in a
successful build with output in /build of livecd.ubuntu-core.img.xz,
livecd.ubuntu-core.manifest, livecd.ubuntu-core.model-assertion, and
snaps.manifest.
[1] https://github.com/chrisglass/ubuntu-old-fashioned/blob/master/old-
fashioned-image-build
** Tags removed: verification-needed verification-needed-xenial
** Tags added: verification-failed verification-failed-xenial
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to livecd-rootfs in Ubuntu.
https://bugs.launchpad.net/bugs/1799736
Title:
Restore the ability to produce core16 images
Status in livecd-rootfs package in Ubuntu:
Fix Released
Status in livecd-rootfs source package in Xenial:
Fix Committed
Status in livecd-rootfs source package in Bionic:
Confirmed
Bug description:
[Impact]
Ubuntu Core is an all-snap Ubuntu variant that we are building through
cdimage. In the past there was only one core series, 16, and all the
images we were building were based on that series. Thanks to that all
the support for building ubuntu-core images in livecd-rootfs through
ubuntu-image was only needed in later series, as all were build using
devel. Currently we have two different ubuntu-core image sets based of
different bases: core16 and core18 images. As a convention, we have
decided that cdimage (and or other components) will be building
ubuntu-core images based of the suite that the build is being run for.
Since core16 is based on xenial and core18 on bionic, we have decided
the following scheme:
* Suite: xenial -> ubuntu-core 16 image
* Suite: bionic or later -> ubuntu-core 18 image
For this to work, we need to have all the needed changes in xenial and
bionic. livecd-rootfs on xenial is missing all the ubuntu-image build-
enablement changes, so these need to be backported. Besides that, both
xenial and bionic need to get backports of the per-distro-series core-
series selection.
Without these fixes in xenial, no ubuntu-core 16 images can be built
anymore. This is needed in case we'd have need for any security-
vulnerability fix image re-releases.
[Test Case]
For xenial:
* On a xenial system install latest xenial-proposed livecd-rootfs
* Create a temporary directory and cd into it
* Copy the /usr/share/livecd-rootfs/live-build/auto directory into the current directory
* sudo PROJECT=ubuntu-core SUITE=xenial ARCH=amd64 PROPOSED=0 IMAGEFORMAT="ubuntu-image" lb config
-> Make sure that the configured model assertion is for core16
* sudo PROJECT=ubuntu-core SUITE=xenial ARCH=amd64 PROPOSED=0 IMAGEFORMAT="ubuntu-image" lb build
-> Make sure the build runs and finishes correctly
* Boot test the newly created image with kvm
-> Make sure the image is still bootable
Also, since we are basically starting to use ubuntu-image with this
xenial upload of livecd-rootfs (which was in universe for this
series), we need to make sure the package is still installable with
just main enabled.
* On a clean chroot (without livecd-rootfs or any of its dependencies installed)
* Modify sources.list to only have main enabled
* sudo apt update
* sudo apt install livecd-rootfs
-> Make sure the package and its dependencies install correctly
[Regression Potential]
As part of the backport only new code is added - code that is executed
in certain code paths only. Most regressions might appear in the
ubuntu-core image generation, which was not available for xenial. But
in case the code has been added in the wrong way, potentially this
might result in livecd-rootfs not being able to generate proper
classic images anymore. A run of lb config and lb build for a non
ubuntu-image project is recommended.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/livecd-rootfs/+bug/1799736/+subscriptions
More information about the foundations-bugs
mailing list