33 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
David Krauser
0e3b1e206b
Add support for HyperV Gallery images 2019-06-11 23:26:07 -04:00
Robert C Jennings
0bfc5c4290
ubuntu-cpc: Fixup comment references to file names post-parallelization 2019-05-02 15:50:21 -05: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
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