90 Commits

Author SHA1 Message Date
Cody Shepherd
681ff948be
fix: add packge list and manifest creation in early break stanza
this fixes missing manifests for riscv64, which
causes problems subsequent hooks that expect the uefi manifest to exist
2024-11-21 09:10:12 -08:00
John Chittum
2db8a8fce8
feat(ubuntu-cpc): sbom generation everywhere
patch create_manifest to produce an sbom when called by an ubuntu-cpc
project. Patch all the ubuntu-cpc hooks and series files to include the
newly generated manifests, filelists, and sboms. Generates a number of
new artifacts in the builds. the snap utilized, cpc-sbom, is an open
source repo and a provided via a hidden snap. there is no intention of
publisizing the snap or how we generate sboms, however partners require
the ability to audit if required.

defensively checks if the snap is already installed, in the case of
multiple hooks being called in a single build (thus sharing a build
host), and only if called in an ubuntu-cpc project.

(cherry picked from commit 7c7b7df89dc96169db1f255d6bba901ebb63a43c)
2024-08-27 08:10:40 -04:00
Steve Langasek
582c081675 Use losetup instead of kpartx to resolve race conditions in riscv64 image builds. 2023-12-03 22:07:08 -08:00
Heinrich Schuchardt
591b0a3432 riscv64: use efi=debug earlycon
RISC-V boards tend to boot slowly.
We should provide progress information when booting.

Use 'efi=debug earlycon' on the Linux command line via new file
/etc/default/grub.d/cmdline.cfg.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-11-17 11:21:59 +01:00
Łukasz 'sil2100' Zemczak
0fa7ab23ed Add an additional subdir. 2022-11-17 11:21:59 +01:00
Heinrich Schuchardt
0016cada16 riscv: reduce initrd size for Nezha and LicheeRV boards
The Nezha and the LicheeRV boards do not have enough memory for an initrd
with most modules. Therefore the number of included modules has to be
reduced.

Create file /etc/initramfs-tools/conf.d/modules_list.conf
to set MODULES=list.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-11-17 11:21:59 +01:00
Heinrich Schuchardt
c4dc7bce4c riscv: remove invalid redirections
Remove redirections of type

    command &1>2

Executing the command in the background and creating and empty file '2'
was never intended.

As the messages are information only redirecting to stderr would not make
sense either.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-11-17 11:21:59 +01:00
Alexandre Ghiti
8ba2493a80 riscv: LicheeRV must use u-boot-nezha package
Signed-off-by: Alexandre Ghiti <alexandre.ghiti@canonical.com>
2022-11-17 11:21:59 +01:00
Alexandre Ghiti
0940dd3cd8 riscv: Add support to build Microchip Icicle Kit image
Signed-off-by: Alexandre Ghiti <alexandre.ghiti@canonical.com>

Replace FK_FORCE_CONTAINER by FK_FORCE (LP: #1989194)
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-11-17 11:21:59 +01:00
Alexandre Ghiti
e9004e6273 riscv: Add support to build LicheeRV Dock images
The LicheeRV Dock board comes with only 512MB of DRAM so the only difference
with a Nezha image is the fact that we have to remove
cryptsetup-initramfs package which makes the initrd too big for the
board to boot.

Signed-off-by: Alexandre Ghiti <alexandre.ghiti@canonical.com>
2022-11-17 11:21:59 +01:00
William Wilson
6939cb42d5 Rename FK_FORCE_CONTAINER to FK_FORCE 2022-10-19 10:03:04 -05:00
Łukasz 'sil2100' Zemczak
80cb6a4a1e Backport fix for cloud RISC-V images from kinetic. 2022-08-04 17:24:12 +02:00
Łukasz 'sil2100' Zemczak
84e7e03bf2 Cherry pick fix for unmatched boot image build fix from kinetic. 2022-07-25 10:25:06 +02:00
Alexandre Ghiti
bbcf3c5714 riscv: Use FK_FORCE_CONTAINER to force flash-kernel to run in a container
As explained in LP: #1980929, we need this in order to build RISC-V
images.

Signed-off-by: Alexandre Ghiti <alexandre.ghiti@canonical.com>
2022-07-13 16:04:21 +02:00
Alexandre Ghiti
6f9d5b7ff2 disk-image-uefi.binary: Fix wrong parenthesis
Signed-off-by: Alexandre Ghiti <alexandre.ghiti@canonical.com>
2022-07-13 16:04:21 +02:00
Alexandre Ghiti
81614c6992 riscv: Bump image size to 4.5G
3.5G is not enough for riscv64 preinstalled as the creation of the initrd fails
with the following error:

Creating config file /etc/default/grub with new version
Processing triggers for initramfs-tools (0.140ubuntu13) ...
update-initramfs: Generating /boot/initrd.img-5.15.0-1011-generic
zstd: error 25 : Write error : No space left on device (cannot write compressed block)
E: mkinitramfs failure zstd -q -1 -T0 25
update-initramfs: failed for /boot/initrd.img-5.15.0-1011-generic with 1.
dpkg: error processing package initramfs-tools (--configure):
 installed initramfs-tools package post-installation script subprocess returned error exit status 1

Signed-off-by: Alexandre Ghiti <alexandre.ghiti@canonical.com>
2022-07-13 16:03:26 +02:00
Alexandre Ghiti
b9873fbed5 riscv: Use UEFI bootflow for the Nezha Board
Signed-off-by: Alexandre Ghiti <alexandre.ghiti@canonical.com>
2022-07-13 16:03:26 +02:00
Alexandre Ghiti
ce9f5cacca riscv: Add support for StarFive VisionFive
The image created uses a UEFI bootflow, so we install grub for this board
only. We also need flash-kernel to install the dtb where grub can find
it.

This image is specifically architectured so that it can be installed on
a "factory" board, meaning using the u-boot firmware which was
originally implemented for Fedora, so we need the p3 partition that
embeds a uEnv.txt file to tell u-boot what/where to load next stage.

Signed-off-by: Alexandre Ghiti <alexandre.ghiti@canonical.com>
2022-07-13 16:03:26 +02:00
Alexandre Ghiti
1527ac2b4e RISC-V: enable building for Nezha board
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-07-13 16:03:26 +02:00
Heinrich Schuchardt
312d9221ee riscv: define partitioning scheme for Nezha board
Define the image layout for the Nezha board.

The U-Boot SPL based boot0 may be installed starting in sector 16 or 256.
As sector 16 is incompatible with GPT partitioning use sector 256.

The primary U-Boot image is expected to start at sector 32800 and its
backup in sector 24576.

Cf. https://linux-sunxi.org/index.php?title=Allwinner_Nezha&oldid=24469

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-07-13 16:03:26 +02:00
Simon Poirier
8eb4f2d447 fix: VMware cdrom OVF import requires to be on IDE
This reverts part of a change causing regression with vmware import due to the
cdrom getting moved to SCSI while shifting controller IDs. (LP: #1970795)

(cherry picked from commit 3da8e81bf27f3770f3664a332d8767fa62fd4771)

Conflicts:
        debian/changelog

Conflict solved by copying the debian/changelog entry from the archive.
2022-06-29 12:53:27 +02:00
Jean-Baptiste Lallement
c4cb3570a5 Readd ubuntu-cpc/wsl.binary hook
Readding this file per reviewer's request until CPC splits the
pipelines. Removing this file would make CPC image builds fail.

Co-authored-by: Didier Roche <didrocks@ubuntu.com>
2022-03-21 12:19:30 +01:00
Jean-Baptiste Lallement
80ccea8d63 Separate WSL from CPC
Create a separate WSL image than CPC so it can be managed independently.

Co-authored-by: Didier Roche <didrocks@ubuntu.com>
2022-03-17 10:11:39 +01:00
Ivan Kapelyukhin
b40ce74fd6
perf(cpc): split disk-image-uefi out of disk-image series file
Due to how `disk-image` file is structured, it builds BIOS and UEFI
images at the same time. However, certain images (e.g., GCE images)
require only UEFI image to be built, BIOS image is being simply
discarded. This results in longer build times.

Splitting out `disk-image-uefi` would allow images to use it instead of
`disk-image` and thus avoid building unused BIOS images.

`disk-image` now depends on `disk-image-uefi` for backward
compatibility.
2022-03-03 15:44:01 +01:00
Łukasz 'sil2100' Zemczak
32b54e6242 Merge branch 'partalign' of https://git.launchpad.net/~xypron/livecd-rootfs into ubuntu/master 2021-12-16 12:25:05 +01:00
Brian Murray
fe662c5c8a Merge remote-tracking branch 'jessica-youjeong/111721-ubuntu-master-ova' into ubuntu/master 2021-12-15 10:06:54 -08:00
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
d5a8116428
Add support for generic preinstalled images. LP: #1923832 2021-04-26 11:04:37 +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
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