133 Commits

Author SHA1 Message Date
Heinrich Schuchardt
b6701e556f riscv64: ensure reasonable partition alignment
Currently the RISC-V preinstalled server images come with partitions that
are only 1 KiB aligned. Ext4 may use 4 KiB block size. The existing
misalignment leads to decreased performance.

Decrease the size of the loader2 partition by 34 512-byte blocks. This
results in 1 MiB alignment of the EFI and root partitions.

The remaining loader2 partition size of close to 4 MiB is still large
enough for U-Boot or a future EDK II.

Fixes: a808b28d47ec ("riscv64: build preinstalled riscv64 image with uboot SPL and CIDATA.")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-12-01 18:22:02 +01:00
Thomas Bechtold
1a7e9ca8c9 Bump UEFI disk image size for armhf to 3.5 GB
Current jammy builds fail with:
dpkg: error processing archive /var/cache/\
  apt/archives/grub-common_2.04-1ubuntu48_armhf.deb (--unpack):
cannot copy extracted data for './usr/share/grub/unicode.pf2' \
  to '/usr/share/grub/unicode.pf2.dpkg-new': \
  failed to write (No space left on device)
2021-11-23 11:30:47 +01:00
Jess Jang
a97e98c968 Change serial0 allocation as false (LP:#1895104)
It hangs during booting when upgrading hardware
version ESXi after deploying image in groovy.
(Current default version is 10)
It could be resolved by adding serial port in VM
when vm version is larger than 10.

Seriaol port1 has been configured as default so
we need to change setting serial0 as false.
2021-11-17 07:50:19 -06:00
Didier Roche
6a05e7fa22 Install desired already seeded snap in wsl.
As wsl is an image target of ubuntu-cpc, the base seed is hardcoded to
ubuntu-server instead of wsl one. For now, add it, as for the other
cpc images, in hooks.
2021-11-05 17:51:52 +01:00
Chloé Smith
ffab8ceac4
Add a serial port to OVF template (LP: #1895104)
groovy hangs during boot on ESXi when the version is greater than
10. Adding a serial port by default fixes this specific bug - increasing
the HW version will be for another branch.

This is because more investigation is needed into whether it is possible to
increment ddb.virtualHWVersion without disrupting Oracle VirtualBox images.
2021-06-21 21:29:47 +01:00
Dimitri John Ledkov
20f76e7cf8
Merge branch 'preinstalled' of git+ssh://git.launchpad.net/~xnox/livecd-rootfs into ubuntu/master 2021-04-30 17:46:20 +01:00
Dimitri John Ledkov
d5a8116428
Add support for generic preinstalled images. LP: #1923832 2021-04-26 11:04:37 +01:00
Dimitri John Ledkov
41fd537bc2
999-cpc-fixes: enable more code on grub2 armhf & arm64
armhf & arm64 images use grub. And despite disk-image &
disk-image-uefi installing all the grubs, some of the configuration is
done in the 999-cpc-fixes. Specifically removal of "quiet splash" is
done there, but not active on armhf & arm64. This results in arm
images to boot with "quiet splash".

Enable running the later portions of 999-cpc-fixes on armhf & arm64.

Drop duplicate call to update-grub, as update-grub2 is simply a
symlink to update-grub.

Add a guard around the call to reconfigure grub-pc, to only do that
when it is installed.

This makes armhf & arm64 uefi images consistent with amd64 uefi
images.

LP: #1925780
2021-04-23 12:47:18 +01:00
Dimitri John Ledkov
4428dbbf8f
riscv64: generalise slightly how preinstalled server images are built, to allow using subarch to pick u-boot binaries to install. 2021-03-11 17:08:15 +00:00
Gauthier Jolly
76330897dc ubuntu-cpc: make /etc/fstab consistent with other ubuntu images
Modify the mount options in fstab to make the Cloud images consistent
with the default we have elsewhere.

LP: #1902103
LP: #1881006
2021-03-02 14:21:36 +00:00
Łukasz 'sil2100' Zemczak
1b0212a76c Use the full name of the 'boot' flag in parted calls 2021-02-24 12:58:08 +01:00
Dimitri John Ledkov
33b7272a23
Perform fsck on all rootfs.
LP: #1912835
2021-02-01 14:45:42 +00:00
Dimitri John Ledkov
53b28d5f58
esp: perform fsck.
LP: #1912835
2021-01-22 19:16:47 +00:00
Dimitri John Ledkov
7c760864fd
esp: install grub in ubuntu bootloader id path, instead of removable.
Do not use removable uefi bootloader path in the cloud-images by
default, as that prevents upgrades of the bootloader.

LP: #1912830
2021-01-22 19:09:25 +00:00
Dimitri John Ledkov
6746d9fbd9
disk-image-uefi: fix riscv64 subarch user-data. 2020-12-08 09:15:09 +00:00
Dimitri John Ledkov
4881f5260a
qcow2-image: unbreak builds without subarch. 2020-12-05 15:17:16 +00:00
Dimitri John Ledkov
3e1e76b94a
riscv64: fixup subarch build, unbound variable 2020-12-03 16:17:32 +00:00
Dimitri John Ledkov
a808b28d47
riscv64: build preinstalled riscv64 image with uboot SPL and CIDATA. 2020-12-01 17:14:40 +00:00
Dimitri John Ledkov
3962f4ac23
disk-image-uefi: riscv64 add ubuntu:ubuntu login, without expiry. 2020-11-24 18:40:40 +00:00
Dimitri John Ledkov
da578b2c6b
disk-image-uefi: riscv64 add u-boot spl
LP: #1905274
2020-11-24 18:40:34 +00:00
Dimitri John Ledkov
914997827d
disk-image-uefi.binary: build riscv64 image without a bootloader.
We want GPT image with ESP, however there is no bootloader for it
yet. Build without it.
2020-11-19 15:47:12 +00:00
Dimitri John Ledkov
122364df65
disk-image-uefi.binary: enable secureboot on the arm64 image. 2020-11-19 15:47:09 +00:00
Dimitri John Ledkov
e8f53aabdf
disk-image.binary: however still build MBR image on amd64.
It is used to derive vagrant and ec2 images. I do wonder, if those
could be converted to derive from uefi one.
2020-11-18 00:09:08 +00:00
Dimitri John Ledkov
8e548f37d9
disk-image.binary: skip building MBR image on riscv64. 2020-11-17 23:40:53 +00:00
Dimitri John Ledkov
ff175e3f4a
disk-image.binary: actually skip building MBR image on EFI platforms.
The case is for arch:subarch combo, not just arch alone even if
subarch is empty. Thus currently on adm64/arm64/armhf ubuntu-cpc
builds mbr image is created and then ignored, as the convert to qcow2
hook prefers the uefi image whenever available.

Skipping building these correctly, should speed up the build a little
bit and use slightly less disk space.
2020-11-17 23:37:52 +00:00
Dimitri John Ledkov
e2fd168f50
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.

LP: #1901906
2020-10-28 22:56:31 +00:00
Joshua Powers
b0c8b628b2
ubuntu-cpc: only install shim-signed, run autoremove
The CPC build hooks for amd64 incorrectly attempt to install shim-signed
in addition to grub-efi-amd64 and grub-pc. These latter two packages
conflict with each other. Instead shim-signed should install whatever
packages are required.

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.
2020-10-26 11:48:24 -07:00
John Chittum
1abc43a2d0
Remove virtualbox-guest-utils (LP: #1895862)
virtualbox-guest-utils kernel modules is included in linux-modules
starting in kernel 5.4.0-33 in focal-updates. The vagrant hook also
explicit installed virtualbox-guest-utils. An error occurred with the
version installed from the archives, however, with the inclusion in
linux-modules, there's no need to explicitly install
virtualbox-guest-utils. Removes the code for the explicit install.
2020-09-29 11:41:05 -05:00
Robert C Jennings
2be2a168ee
ubuntu-cpc: Fix spelling in vagrant file 2020-09-16 08:48:28 -05:00
John Chittum
fb33fe9026
Minor fixes to Vagrantfile comments 2020-08-27 15:46:36 -05:00
John Chittum
cfd43992a8
Reorder comments to ensure clarity
Long history comment moved to the end with short clarifying comments
before the relevant code. Update changelog with proper attribution
2020-08-27 15:11:15 -05:00
John Chittum
c92e885303
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-08-27 14:37:40 -05:00
Stanislav German-Evtushenko
b0144d3018
vagrant: Use dummy file for the console output
Links:
- https://bugs.launchpad.net/cloud-images/+bug/1874453
2020-08-27 14:36:22 -05:00
Steve Langasek
37f5f8881f Revert "Revert "Remove fstab from squashfs images""
This reverts commit d9de2701897608710ed97e206ee29f28af8cc82a.
2020-08-27 12:17:22 -07:00
Robert C Jennings
2844aa530d
Revert ubuntu-cpc: Disable boot splash
These introduced a regression for ppc64el and needs more time to bake.
This reverts commits 1deb0c68e8be6b06190402e32292c3c55134eee2 &
6dbb30f53bd3f2086021abdecaee04645c9ccda0.

 * "ubuntu-cpc: Fix ppc64el grub console update"
 * "ubuntu-cpc: Disable boot splash in all cloud images (LP: #1725358)"
2020-08-12 16:49:41 -05:00
Robert C Jennings
1deb0c68e8
ubuntu-cpc: Fix ppc64el grub console update
The commit 6dbb30f5 (2.682) which disabled boot splash for all cloud
images introduced an error in the ppc64el hook.  This patch corrects the
name of the variable that contains grub console overrides.  The error
seen during testing was
 'disk-image-ppc64el.binary: line 44: CONSOLES: unbound variable'
and this was due to a typo.
2020-08-12 13:48:03 -05:00
Steve Langasek
d9de270189 Revert "Remove fstab from squashfs images"
This reverts commit f96e874ed12e7e080111d27aa14c4f97aa6bec87.
2020-08-12 11:35:06 -07:00
Robert C Jennings
6dbb30f53b
ubuntu-cpc: Disable boot splash in all cloud images (LP: #1725358)
When trying to debug an issue on ARM64 it was reported that it was
quite difficult to debug because of control codes on the console from
the splash.

For cloud image there is a chroot customization the drops 'quiet splash'
but this is only applied to amd64.  It hasn't made it into other
architectures because they don't have grub by default in the chroot.
However, when we get into binary hook for the uefi disk image and it's
derivatives grub is installed and this includes architectures that were
skipped in the chroot hook.

This patch changes the cpc-fixes chroot hook to add a cloud-images
grub config with basic overrides, including dropping the boot splash,
for all architectures.  For images that never get grub installed this
addition is harmless and small while ensuring that the grub experience
is consistent for images that have grub.  The configuration of console
devices as hard-coded remains arch specific.
2020-08-12 04:50:36 -05:00
David Krauser
83499f1a95 Add mechanism to detect initrdless boot fallback
In v2.672 the default boot behavior of cloud images changed:

- Prior to v2.672, cloud images with the linux-generic kernel attempt
  to boot without an initramfs, would fail, and then retry with an
  initramfs.

- After v2.672, cloud images with the linux-generic kernel boot with
  an initramfs on the first try.

While the behavior is different between the two, they both result in
an instance that has booted with an initramfs. To ensure the changes
in v2.672 do not regress, we need an automated way to check if we are
attempting to boot without an initramfs and failing.

With this change, when we attempt to boot with an initramfs and fail,
initrdless_boot_fallback_triggered is set to non-zero in the grubenv.
This value can be checked after boot by looking in /boot/grub/grubenv
or by using the grub-editenv list command.
2020-07-22 16:41:10 -04:00
David Krauser
4c504f6781 Fix broken minimal cloud image boot on amd64
I recently pulled initramfs logic out of the base build hook, and
dropped that into the `replace_kernel` function. Any cloud image that
does not leverage the generic virtual kernel was expected to call
`replace_kernel` to pull in a custom kernel. That function will
disable initramfs boot for images that use a custom kernel.

Minimal cloud images on amd64 use the linux-kvm kernel, but the build
hook does not utilize the `replace_kernel` function. Instead, the
kernel flavor is set in `auto/config`. I pulled that logic out of
`auto/config` and am now calling `replace_kernel` in the build hook.

I also moved a call to generate the package list so that it will pick
up the change to the linux-kvm kernel.
2020-07-16 17:25:46 -04:00
David Krauser
e8e3e6760f Drop hack in kvm image that forces initramfs-less boot
Since the kvm image now boots without an initramfs by default, we
don't need to force it in the build hook.
2020-07-08 17:29:15 -04:00
David Krauser
1ca1330eae Boot with an initramfs by default in cloud images
Generic cloud images with the linux-generic kernel are not able to
boot without an initramfs. Previously, these images attempted to boot
without an initramfs, would fail, and then retry with an initramfs.
This slows the boot and is confusing behavior.
2020-07-08 17:13:49 -04:00
Dimitri John Ledkov
1ff35cf438 chroot: disable amd64 codepath on riscv64 2020-06-24 16:08:31 +01:00
Balint Reczey
f96e874ed1 Remove fstab from squashfs images
The default fstab is not valid, since squashfs does not support labels.

LP: #1877078
2020-06-16 22:14:59 +02:00
Philip Roche
60665a434b Revert of initramfs package removal in KVM image (LP: #1875400)
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: #1875400
2020-05-18 17:08:30 +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