247 Commits

Author SHA1 Message Date
Dimitri John Ledkov
7680ece7b0
riscv64: backport HiFive unleashed & cloud-image building support
All commits are cherrypicks from hirsute, and includes:

make-lxd-metadata: add riscv64 lxd architecture tag
control: install qemu-utils & snapd on riscv64.
disk-image.binary: actually skip building MBR image on EFI platforms.
disk-image.binary: skip building MBR image on riscv64.
disk-image.binary: however still build MBR image on amd64.
disk-image-uefi.binary: build riscv64 image without a bootloader.
disk-image-uefi: riscv64 add u-boot spl
disk-image-uefi: riscv64 add ubuntu:ubuntu login, without expiry.
riscv64: build preinstalled riscv64 image with uboot SPL and CIDATA.
riscv64: fixup subarch build, unbound variable
qcow2-image: unbreak builds without subarch.
disk-image-uefi: fix riscv64 subarch user-data.

LP: #1903034
2021-01-15 17:06:44 +00:00
Joshua Powers
ef950f5214
amd64: always install grub-pc with shim-signed
shim-signed depends on grub-efi-amd64-signed, which in turn has
alternative depends on either `grub-efi-amd64 | grub-pc`. However to
support booting with either via shim&signed-grub and BIOS, the choice
must be made to install grub-pc, not grub-efi-amd64.

This makes images consistent with Ubuntu Deskop, Live Server, buildd
bootable images; all of which already do install grub-pc and
shim-signed.

Additionally, this will ensure that autoremove is run after installing
anything in the CPC build hooks. This is done to avoid shipping images
that include packages that are autoremovable. This will clean-up as
packages are installed and detect any breakage at build time.

LP: #1901906
2020-11-13 09:07:12 -08:00
John Chittum
05bba4cbbd
ubuntu-cpc:Vagrant Serial to Null (LP: #1874453)
Original fix proposed by Stanislav German-Evtushenko (giner)

CPC Ubuntu cloud images default to enabling a serial console connection
via the kernel commandline option `console=ttyS0`. Many clouds support
the serial connection, and utilize it for debugging purposes. Virtualbox
supports the serial connection as well. In Bionic and earlier images,
Vagrant boxes created a serial log file in the directory of the
Vagrantfile by default. However this is not standard behaviour for
Vagrant images, and so it was removed in Eoan onwards.

Starting in Eoan, there were reports of image booting slowdown (1874453
is a single example). After testing, it was determined that the serial
connection starting, without a device attached, was the cause of the
slow down. However, we did not want to revert to the old functionality
of creating a file. Much thanks to <giner> for providing the Ruby syntax
for sending to File::NULL.

This option will not create a local file, however, the default
Vagrantfile configuration is overwritable via a users Vagrantfile. The
original syntax for creating a file local to the users Vagrantfile has
been included as an example.
2020-09-22 15:57:52 -05:00
Philip Roche
cd098e7c41 Revert of initramfs package removal in KVM image (LP: #1880170)
It was reported and confirmed in LP bug #1875400
(https://bugs.launchpad.net/cloud-images/+bug/1875400) that on the public
KVM cloud image there exists a large list of packages marked for auto-removal.

This should never be the case on a released cloud image.

These packages are marked for auto-removal because in the KVM image binary hook
we removed both initramfs-tools and busybox-initramfs packages. Due to package
dependencies this also removed:

busybox-initramfs* cloud-initramfs-copymods* cloud-initramfs-dyn-netconf*
cryptsetup-initramfs* initramfs-tools* initramfs-tools-core* multipath-tools*
overlayroot* sg3-utils-udev* ubuntu-server*

But it did not remove all the packages that the above list depended on.
This resulted in all those packages being marked for auto-removal because they
were not manually installed nor did they have any manually installed packages
that depended on them.

The removal of initramfs-tools and busybox-initramfs was to avoid the
generation of initramfs in images that should boot initramfsless.

This requirement is obsolete now because the initramfsless boot handling
is now handled via setting GRUB_FORCE_PARTUUID in /etc/default/grub.d/40-force-partuuid.cfg.

In test images I have verified that GRUB_FORCE_PARTUUID is set and that
boot speeds have not regressed.

LP: #1880170
2020-05-22 13:38:22 +01:00
Pat Viafore
2c70ed158b
Make Ubuntu Vagrant box 40G. (LP: #1580596)
Vagrant images were previously put at 10G, but this was a regression
from Trusty, in which they were 40G.  This made it a tough sell for
users to upgrade if they were using a Ubuntu desktop experience.

This change does not impact disk usage as Vagrant with the virtualbox
provider dynamically allocates space with the VMDK.  On a test system,
the VMDK took up 1.1G of disk space according to df, and after
creating a 2G file in Vagrant, the VMDK grew to 3.1G.

Therefore, users who are running on a system with little free space will
not see adverse effects if they upgrade to a new vagrant image
2020-04-17 10:17:18 -05:00
Łukasz 'sil2100' Zemczak
95103e3d36 Ensure seed part. is mounted; wait for getty 2020-01-24 18:34:40 +01:00
Michael Hudson-Doyle
f27b432026 ubuntu-cpc hooks are Different 2019-12-13 13:16:34 +13:00
Michael Hudson-Doyle
741933942e copy the filelists for the root-xz and squashfs into place 2019-11-27 16:09:59 +13:00
Michael Hudson-Doyle
015d8bab65 add filelist files to all ubuntu-cpc series files 2019-11-25 11:51:51 +13:00
Michael Hudson-Doyle
c89806ba4d Do not create a hook manually for ubuntu-cpc builds, make-hooks does not like that. 2019-10-09 14:34:08 +13:00
Steve Langasek
0902ffefb3 002-add-foreign-kernel.chroot_early: enable amd64 as a foreign arch on i386 image builds, since this is where the kernel comes from henceforth. 2019-10-02 15:59:25 -07:00
Łukasz 'sil2100' Zemczak
1f8f86c17c Final fix to 999-ubuntu-image-customization.chroot, tested to be working. 2019-09-19 14:03:14 +02:00
Łukasz 'sil2100' Zemczak
c7f3374f9f Final changes to the 999-ubuntu-image-customization.chroot hook. 2019-09-16 14:46:04 +02:00
Łukasz 'sil2100' Zemczak
2341514fad Fix typo. 2019-09-10 17:35:46 +02:00
Łukasz 'sil2100' Zemczak
56234333f3 Add explaination to why ubuntu-image == device image. 2019-09-06 11:55:33 +02:00
Łukasz 'sil2100' Zemczak
f6cbbf01e1 Add a new u-i specific chroot hook, move the NoCloud system-boot cloud-init datasource configuration there to make sure all u-i built ship with it. 2019-08-08 12:22:33 +02:00
Dimitri John Ledkov
584ac368b0 Merge branch 'kvm-derives-uefi' of git+ssh://git.launchpad.net/~davidkrauser/livecd-rootfs/+git/livecd-rootfs into ubuntu/master 2019-07-26 14:35:16 -03:00
David Krauser
0eecd0c344 KVM disk images should derive from the uefi image. 2019-07-22 13:12:21 -04:00
Robert C Jennings
0afb887cb7
ubuntu-cpc: use sys.exit() rather than quit() 2019-07-22 11:29:04 -05:00
Robert C Jennings
5083d76835
ubuntu-cpc: remove unused final.binary hook support
Right now this is a solution looking for a problem as the implementation
no longer relies on it.
2019-07-22 11:29:04 -05:00
Robert C Jennings
cb535805d7
ubuntu-cpc: rework image artifact cleanup
The livecd.ubuntu-cpc.ext4 that is present in each build (plus kernel
and initrd) are not renamed from /build/binary/boot/filsystem.ext4
and friends until after the binary hooks are run, so this patch moves
from trying to perform this cleanup in a binary hook.  Now the cleanup
will be run at the end of live-build/binary for the ubuntu-cpc project.
2019-07-22 11:29:04 -05:00
Robert C Jennings
14b7f62b17
ubuntu-cpc: Only produce explicitly named artifacts (LP: #1837254)
In parallel builds where a list of image targets are provided the build
may produce binaries that are not part of the named set of targets but
are created by series dependencies.  These implicitly created binaries
may be generated by multiple builds but are unused as our convention for
the ubuntu-cpc project is to only consume binaries from the explicitly
named image targets; this avoid overwriting the same object by multiple
parallel builds.

This patch adds support for a 'provides' keyword for series files. It can
be specified multiple times per series file.  The field is used by the
make-hooks script to generate a list of output files created explicitly by
the named image targets.  The list is saved to the "explicit_provides"
file in the hooks output directory. In the case of the "all" target
this list would be empty.  This list is consumed by the "final.binary"
hook file.

This patch adds support for optional final.binary hooks in hooks.d/base
and/or hooks.d/extra.  These final.binary hooks are always included as
the last hook(s) if either exist with the hook in "extra" running last.

The base/final.binary hook includes logic to parse the "explicit_provides"
file generated by the make-hooks script and remove any binary output not
explicitly specified.

Some series files named unnecessary dependencies, specifically
disk-image, to keep output of implicit artifacts consistent between
parallel builds.  These unnecessary dependencies are removed in this
patch.
2019-07-22 11:29:04 -05:00
David Krauser
0e3b1e206b
Add support for HyperV Gallery images 2019-06-11 23:26:07 -04:00
Tiago Stürmer Daitx
f2bbe1fd85
Merge patviafore/linux_kvm_image: Add linux-kvm image
We are creating a derivative of disk-image, replacing the kernel with
linux-kvm, removing initramfs, and creating a qcow2 image.

Source: ~patviafore/livecd-rootfs/+git/livecd-rootfs:linux_kvm_image

Modifications: fixed conflict in debian/changelog entry and bumped
version.

Signed-off-by: Tiago Stürmer Daitx <tdaitx@gmail.com>
2019-06-11 22:17:20 -03:00
Łukasz 'sil2100' Zemczak
d830cfccee Merge Dave's changes: Use boot-partition for c-i seed on RPi
Configure cloud-init to look for its seed in the vFAT boot partition on
raspberry pi images; the corresponding gadget is configured to place the
user-data, meta-data, and network-config files there.

Source: ~waveform/ubuntu/+source/livecd-rootfs:cloud-init-boot
2019-06-07 14:31:57 +02:00
Pat Viafore
514a83b926
Unmount the image before we convert to qcow2 to avoid corruption 2019-06-06 08:21:22 -05:00
Pat Viafore
9bf4c7cb52
Adding apt-get autoremove and setting IMAGE_STR 2019-06-06 08:21:22 -05:00
Pat Viafore
975a620e59
Various fixes from code review.
Cleaning indices; removing superfluous apt-get update; adding debug
messages; adding better output name
2019-06-06 08:21:22 -05:00
Pat Viafore
afbda566eb
Adding hooks and making replace_kernel function 2019-06-06 08:20:45 -05:00
Pat Viafore
528b2ea57a
Add kvm image 2019-06-06 08:20:45 -05:00
Balint Reczey
76a57f37ef Merge lp:~rbalint -b ubuntu/master 2019-05-27 19:19:04 +02:00
Michael Hudson-Doyle
d35d115938 Merge branch 'ubuntu/master_parallel_cpc_fixes' into ubuntu/master 2019-05-21 09:26:42 +12:00
Balint Reczey
2bb15e03f4 wsl.binary: Add comment about tar usage 2019-05-17 16:41:21 +02:00
Balint Reczey
3ae9628528 Build WSL rootfs tarball
LP: #1827930
2019-05-16 18:16:44 +02:00
Robert C Jennings
bca9242474
ubuntu-cpc: Allow comments in series files and add comments
The addition of disk-image to series files in a prior commit required
some explanation.  Without comment support in series files that was
not possible.  This patch adds support for comments and adds those
comments as well.
2019-05-02 17:15:33 -05:00
Robert C Jennings
05850394d7
ubuntu-cpc: Ensure base disk image is the same between all build targets
The following targets have livecd.ubuntu-cpc.manifest (and
livecd.ubuntu-cpc.ext4) which differ in some way from the 'all'
target. They are all missing grub-efi and other modifications:

root-dir
squashfs
tarball

These targets do not depend on the 'disk-image' target. This means that
the ext4 produced will lack the uefi modifications (and any from the
disk-image target binary hooks).

Since the ext4 file is common to all builds there is a chance that a
parallel build from one of these targets could overwrite this artifact.
This patch ensures that all targets will produce consistent base output.
2019-05-02 16:04:10 -05:00
Robert C Jennings
0bfc5c4290
ubuntu-cpc: Fixup comment references to file names post-parallelization 2019-05-02 15:50:21 -05:00
Balint Reczey
2d162dd121 Pass --sort=name to tar to make tarballs more reproducible and rsync-friendly 2019-04-10 14:38:35 +02:00
Robert C Jennings
a45342f269
ubuntu-cpc: avoid duplicate snaps listed in qcow manifest
commit a993592 introduced an additional call to create_manifest
(and snap-seed-parse) to write binary/boot/filesystem.packages. This
caused duplicate snap lines in the qcow manifest. This is because the
live-build/auto/binary code assumes that after 'lb binary' is run the
filesystem.packages will only have debs and it calls snap-seed-parse to
add them to the file. The commit changed filesystem.packages in the
ubuntu-cpc uefi binary hook to include debs and snaps.

This patch keeps the intent of the prior patch, updating the
filesystem.packages file for the content of the uefi disk image, but
only writes a listing of debian packages to match the expected content
of filesystem.packages.  The snaps will still be added in generic code
in live-build/auto/build.
2019-03-29 15:39:47 -05:00
Steve Langasek
e5e1c8dc96 Also don't create the update-motd directory since we're not writing to it.
It will almost certainly be created at some point but we don't need to
create it here.
2019-03-12 12:25:30 -07:00
Steve Langasek
4ca92b04a7 Drop /etc/update-motd.d/51-cloudguest from cloud images; this is not consistent with current Ubuntu Advantage product language. Any future customizations to update-motd for cloud images should be done via a package instead. 2019-03-12 11:47:01 -07:00
Tobias Koch
cbd4eb5717 Use series files with dependency handling to generate hook symlinks dynamically
This patch currently only applies to the "ubuntu-cpc" project.
          
More and more logic has been going into the hook scripts to decide under which conditions they should run or not. As we are moving to parallelized builds of image sets, this will get even more complicated. Base hooks will have to know which image sets they belong to and modification of the dependency chain between scripts will become more complicated and prone to errors, as the number of image sets grows.
            
This patch introduces explicit ordering and dependency handling for scripts through the use of `series` files and an explicit syntax for dependency specification.
2018-12-10 09:18:02 +01:00
Steve Langasek
8f910aab4b Merge lp:~vorlon/livecd-rootfs/initramfsless-everywhere 2018-11-02 14:39:42 -07:00
Steve Langasek
41382692ba Merge lp:~codyshepherd/livecd-rootfs/uefi-manifests-cosmic 2018-10-29 10:48:42 -07:00
Cody Shepherd
a9935923f8 Changes to include grub efi packages and dependencies in uefi image manifests. 2018-10-29 09:28:50 -07:00
Steve Langasek
840015fbbe Merge lp:~aleks.bogdanov/livecd-rootfs/remove-vagrant-console-log 2018-10-26 13:47:18 -06:00
Cody Shepherd
5bee1ade70 Ensure pre-seeded snaps are now published in the image manifests. 2018-10-22 10:21:50 -07:00
Aleksandr Bogdanov
aba10dc702 vagrant: disabling automatic console log file 2018-10-11 12:01:48 +02:00
Steve Langasek
b6dedb62ce Unconditionally set GRUB_FORCE_PARTUUID in cloud images; as of version
2.02+dfsg1-5ubuntu5 grub will automatically fall back to booting with an
initrd if one is available, so we can now always attempt initramfsless
boot for cloud images which almost always works and causes only minimal
increase in boot speed for cases where it does not.
2018-10-03 17:21:56 -07:00
Dimitri John Ledkov
08c9c26e58 Ensure /lib/modules exists in root tarballs and sqashfs.
(LP: #1792905)
2018-09-20 13:37:25 +02:00