1738 Commits

Author SHA1 Message Date
Łukasz 'sil2100' Zemczak
66d8622dc0 Another attempt to get images building. 2024-09-10 12:28:10 +02:00
Łukasz 'sil2100' Zemczak
bd2839a928 Attempt manual removal. 2024-09-06 14:54:53 +02:00
Łukasz 'sil2100' Zemczak
c9829dd5c7 First attempt on a workaround. 2024-09-06 10:51:44 +02:00
Utkarsh Gupta
9228877e03 Merge remote-tracking branch 'ankushpathak/feat/apparmor_6_8_features' into ubuntu/jammy
* ankushpathak/feat/apparmor_6_8_features:
  d/changelog
  feat(apparmor): Add 6.8 kernel apparmor features' preseed
2024-08-06 21:06:41 +05:30
Chris Peterson
b94a944e80 ubuntu-server: remove openssh-server (LP: #1974483)
ssh-import-id is part of the server-minimal task, which means it and
openssh-server are always installed by Subiquity regardless of user
choice. Since we can't update the Task headers post release,
ensure that openssh-server, openssh-sftp-server, and ssh-import-id
are not included in the minimal and full layers by purging them
in a dedicated hook.
2024-07-31 15:24:12 -07:00
Ankush Pathak
da5880bf86 feat(apparmor): Add 6.8 kernel apparmor features' preseed
Failing CPC tests show that preseeded apparmor features for the 6.8
kernel are missing. This change adds the required preseeds.
(LP: #2074204)
2024-07-26 19:55:25 +05:30
Loïc Minier
42281654ae Backport support for building tegra-igx Core
Backport support for building tegra-igx Server and Core images;
LP: #2070070.

From https://code.launchpad.net/~rmartin013/livecd-rootfs/+git/livecd-rootfs/+merge/466187
2024-06-21 18:43:43 +00:00
Simon Poirier
236e1d68c4 Add udev to buildd/disk-image-uefi hook to satisfy grub-probe. (LP: #2064175) 2024-06-07 12:26:26 -04:00
Loïc Minier
a692ec8549
Add support for tegra-igx (similar to tegra) 2024-05-21 18:36:59 +02:00
Ankush Pathak
9b088d458f feat(apparmor): Add policy:unconfined_restrictions feature to 6.5 kernel
Failing CPC tests show that the preseeded apparmor features don't
include policy:unconfined_restrictions for the 6.5 kernel. This change
adds the feature preseed.
Fixes LP: #2062929
2024-04-19 15:48:23 -05:00
Jess Jang
ba397a0e02 fix: Missing apparmor feature for generic kernel (LP: #2052789)
ipc has been added to apparmor feature in generic (5.15)
kernel and this feature should be seeded during image
build[0].

[0] https://bugs.launchpad.net/ubuntu/+source/livecd-rootfs/+bug/2052789

(cherry picked from commit 4833221e4b5b3af1e76e6cd8818ef85565358ade)
2024-02-21 11:34:28 +00:00
Łukasz 'sil2100' Zemczak
ef87b2b2d5 Handle the allwinner kernel in the same way as we handle generic 2024-02-20 09:54:14 +01:00
Michael Hudson-Doyle
11b5162b14 Use flock to avoid races with systemd-udevd that cause loop device partitions to briefly disappear. (LP: #2045586) 2024-02-19 06:55:19 +13:00
Łukasz 'sil2100' Zemczak
071611b708 Merge branch 'jammy-64k' of git+ssh://git.launchpad.net/livecd-rootfs into ubuntu/jammy 2024-01-25 12:06:16 +01:00
Łukasz 'sil2100' Zemczak
7d5a370ffe Add a largemem subarch that ships a 64k kernel variant by default. 2024-01-22 16:46:37 +01:00
Philip Roche
8f8415e1dc fix: Always use dpkg-divert instead of altering files maintained by packages
Altering a file maintained by a package can lead to unexpected behaviou expecially in
this case where packages are being removed and added.

Instead use `dpkg-divert` to allow us to mock `lxd` to `true` to allow `unminimize` to work
without error and to avoid installing of the `lxd` snap.
2024-01-22 13:27:12 +00:00
Philip Roche
6ad70d64a5 fix: When using rm do not use --force when not required
`--force` implies that we wish not to fail `rm` even if the file is not present.

This was not our intention and as such can be removed.

Also use short option `-v` for verbose output as per the test of the code base.
2024-01-22 13:27:12 +00:00
Philip Roche
d97514cba0 fix: Improve comments for case when lxd-installer package is not installed
Improve confusing comments for case when lxd-installer package is not installed.

This was worded confusingly
2024-01-22 13:27:12 +00:00
Philip Roche
c09d4c1652 fix: Only use single brackets for if statements
Double brackets are not required and do not follow the uses elsewhere in this code base
2024-01-22 13:27:12 +00:00
Philip Roche
34dea62ef0 fix: Fix calls to unminimize if lxd-installer package not present (LP: #2049723)
The unminimize script will try to install the lxd snap using the shim script
`/usr/sbin/lxd` from the lxd-installer package.

Previously `unminimize` was using `snap`
to install `lxd` directly which was being diverted by diverting the `snap` command.

This is no longer the case so we can remove `/usr/sbin/lxd` from the lxd-installer package
if it exists and then redirect any calls to `/usr/sbin/lxd` to `/bin/true`.
2024-01-22 13:27:12 +00:00
Thomas Bechtold
434b21e202 fix: use correct sshd_config.d/ ordering
Commit 3b2eeb017153cbb wrongly backported a change to not modify
/etc/ssh/sshd_config . The correct fix from ubuntu/master is
3b2eeb017153c where the file is named 60-cloudimg-settings.conf
instead of 10-cloudimg-settings.conf.

This fixes problems with cloud-init which does write
50-cloud-init.conf which should have higher priority than the provided
file from the image.
2024-01-19 09:29:52 +01:00
Łukasz 'sil2100' Zemczak
33362993d1 For raspi preinstalled builds, use a per-series dedicated gadget branch. 2024-01-15 11:39:33 +01:00
Utkarsh Gupta
1a05e8298a unminimize: Use lxd-installer to install LXD itself (LP: 2036725)
By invoking LXD, lxd-installer will install LXD from the right
place, thereby make it simpler for us to not hardcode the
channel and manually snap install it.

(cherry picked from commit 795927c48cf2e763e8f222e8c27c63e71d966a5f)
2024-01-11 16:50:20 +05:30
Steve Langasek
74cdef3a14 Merge branch 'no-kpartx-on-jammy' into ubuntu/jammy 2023-12-06 23:55:41 -08:00
Brian Murray
c70fbe0a15 arm: fix console parameter for ARM cloud-images (LP: #2036730) 2023-12-06 11:02:58 -08: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
Steve Langasek
ea630ac812 Merge remote-tracking branch 'jchittum/backport-apparmor65-lp2037567' into ubuntu/jammy 2023-12-03 21:50:08 -08:00
Philip Roche
11d1063be4 fix: Enable snap preseeding with ppc64el images where /boot/vmlinux is used instead of /boot/vmlinuz. (LP: #2038957)
ppc64el still uses /boot/vmlinux so we need to determine the boot file name as non ppc64el use /boot/vmlinuz. This
is then used to determine the kernel major minor version installed so that the correct apparmor features can be used
during snap preseeding. This preseeding was failing for ppc64el for the mantic 6.5 kernel as the /boot/vmlinuz
being checked did not exist.

(cherry picked from commit 089646a32f927f32e9e8961e231391f0bcb6f66b)

# Conflicts:
#	debian/changelog
#	live-build/functions
2023-10-27 12:51:48 +01:00
Steve Langasek
40a3b73b5e The chroot tmpfs mount should only be /var/lib/apt/lists, not /var/lib/apt; the latter breaks changes to /var/lib/apt/extended_states. LP: #2036195.
(cherry picked from commit 1deccc2edd7f139b84a6cb3d0a4dfe5ebaff50c7)

# Conflicts:
#	debian/changelog
2023-10-26 16:42:22 +01:00
John Chittum
025a8a6de6
fix: Add 6.5 kernel apparmor feats
lp: #2037567. starting in kernel 6.5.0.1006, there's been an update to
apparmor features. Creates the 6.5 kernel directory, fully populates
with feats checked from a machine running 6.5.0.1006 installed from
proposed (as of 20230927).

(cherry picked from commit 5427e5ad6c02b2d7c203cc6597aff5518d5b344c)
2023-10-19 07:06:45 -05:00
Utkarsh Gupta
4ba66ac0d1 fix: install LXD snap from stable/ubuntu-<version> channel (LP: #2036725)
In the past, we'd directly snap install lxd which defaults to
the latest/stable channel. However, whilst working on enhancing
unminimize, it was observed that we install this snap from
the stable/ubuntu-<version> channel instead.

This was also noted as a failure when running the CTF tests:
`lxd installed from latest/stable, not stable/ubuntu-23.10`

(cherry picked from commit 12a2109c223e261214747d5f98d4b8d7ee9625e3)
2023-10-04 13:48:50 +05:30
Utkarsh Gupta
67dd334c25 Fix unminimize to correctly list packages (LP: #1996489)
Prior to dpkg/1.21.0, there was a bug where dpkg -V/--verify
couldn't list all the correct packages correctly but with
that being fix and in archive since Jammy, this works perfectly
but the syntax to report the missing files have changed. It
just prints 'missing' now. With that new format, we can now
fix the regex to simply list the packages.

With this patch, the unminimize script works flawlessly
on a minimized image.

(cherry picked from commit 78a98c683573a1f7983afae54e2f187eeae127c7)
2023-10-04 13:48:40 +05:30
Thomas Bechtold
3b2eeb0171 fix: don't modify ssh_config for ubuntu-cpc projects (LP:1968873)
Modifying directly /etc/ssh/sshd_config creates "problems" when
upgrading eg. from Focal to Jammy because the upgrade will ask the
user what to do with the modified config. To avoid that, put the
custom configuration into /etc/ssh/sshd_config.d/ so the upgrade of
openssh-server can just replace /etc/ssh/sshd_config without asking
the user.

(cherry picked from commit b54d24ff3310f7ace00ab08e0dacfdc89e026f1c)
2023-09-19 13:55:30 +02:00
John Chittum
1184af06b0
fix: GRUB_DISTRIBUTION for buildd
LP: #2034253 Grub is found to use lsb_release or default to Debian.
buildd does not have lsb_release, so Debian was the GRUB_DISTRIBUTION.
that ends up with issues with the EFI path
2023-09-07 14:40:28 -05:00
Michael Hudson-Doyle
59732bc789 Remove additional dependencies from subiquity units as they are now interfering with the boot process. (LP: #2028862)
(cherry picked from commit 4f6f63dd6b53cc9eb44dfa09b2507e9406c8c923)
2023-08-28 14:15:58 -06:00
Utkarsh Gupta
9ff66d60d9 Merge remote-tracking branch 'jessica-youjeong/062223-jammy-snap-preseeding' into ubuntu/jammy
* jessica-youjeong/062223-jammy-snap-preseeding:
  fix: bind correct apparmor feature for validating snap seed
2023-08-19 03:24:28 +05:30
John Chittum
41df4f5c92
fix: 6.2 kernel missing feature
LP: 2031943

Same issue as affected 5.19. 6.2 apparmor featureset differs from 5.15.
Identified the same feature as 5.19, so copied over.

populated 6.2 with all of generic directory as well. Compatibility mode for
possible future change
2023-08-18 14:04:34 -05:00
Jess Jang
6b54faa6be fix: bind correct apparmor feature for validating snap seed
During Realtime kernel image build, there was an error during
validating snap seed which derivative images copied 5.19
apparmor feature and can't validate when Realtime kernel (5.15)
installed [0].

To prevent this, bind correct apparmor feature with kernel
version.

[0] https://bugs.launchpad.net/ubuntu/+source/livecd-rootfs/+bug/2024639
2023-08-02 22:37:22 -05:00
Łukasz 'sil2100' Zemczak
32d9a1b82e Merge branch 'jammy-add-tegra-live-server' of git+ssh://git.launchpad.net/~lool/livecd-rootfs/+git/jammy-add-tegra-live-server into ubuntu/jammy 2023-05-23 16:37:15 +02:00
Steve Langasek
5ac4df3a1a Drop use of --removable flag to grub-install from buildd/hooks
This now matches the cloud images (7c760864fdcb278ca37396f06f5e3f297428d63d)
fixing bootloader updates in the buildd images, but also fixing
compatibility with using devtmpfs for losetup.
2023-05-18 15:16:29 -07:00
Loïc Minier
35fef6becf Initial support for NVIDIA Tegra
live-build/auto/config:
- for Ubuntu Server live images and the arm64+tegra full arch, build a
  tegra variant with linux-nvidia-tegra as the flavor and
  linux-nvidia-tegra as the kernel meta-package
- default to nvidia-$SUBARCH as the kernel flavor and enable all
  components for all images using arm64+tegra as full arch

hooks/03-kernel-metapkg.chroot_early:
- use linux-nvidia-tegra as kernel meta-package for the nvidia-tegra
  flavor
2023-04-08 18:23:38 +00:00
John Chittum
e1fca53deb
feat: add 5.19 kernel apparmor features
the 5.19 kernel added ipc posix_mqueue apparmor features. the generic
set of apparmor features for the 5.15 LTS jammy kernel does not have
this feature. Along with the commit "support kernel with different
apparmor feats", this ensures that the HWE kernel for 5.19 has a
matching set.

note that on the next HWE roll, another directory will need to be added.
For each new HWE kernel roll, checking capabilities, creating the
directory, and adding the correct features will be required.
2023-04-07 09:36:30 -05:00
John Chittum
bd1690bd16
feat: support kernel with different apparmor feats
Jammy HWE is rolling to 5.19. the 5.19 kernel introduced more apparmor
features, specifically ipc. due to the roll, we now must support builds
with 2 different feature sets.

This specifically affects snap-preseeding, where if a snap_preseed is
run with a mismatched apparmor feature set, snap will require a restart
to match the running kernel's feature set. in the clouds, this can add
somehwere between 5-10s (as of checks on 20230404). This is a large boot
time performance hit.

Implementation is done at the `snap_validate_seed` function level. This
function is called in snap scenarios. It checks for an installed kernel
in the chroot, gets the major.min version, and checks for
apparmor/$KERN. If found, it will do a copy of the directory, providing
a naive override mechanism.

For CPC builds, we are adding a call to `snap_validate_seed` at the end
of affected hooks as well. This is a safe procedure to call, as it
reruns the snap_preseed for all snaps. By running at the end of build
processes, it ensures that any kernel changes done during the build are
taken into account.
2023-04-07 09:30:38 -05:00
Łukasz 'sil2100' Zemczak
2075062139 Enable building intel-iot live-server images. 2023-03-17 12:34:42 +01:00
Dimitri John Ledkov
632753aa7c
auto/config: Add support for ubuntu core arm64 generic images
LP: #2009067

Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
2023-03-02 18:14:12 +00:00
Łukasz 'sil2100' Zemczak
5bd8a465a6 Typo fix. 2023-02-23 00:30:40 +01:00
Łukasz 'sil2100' Zemczak
cccc04e0c1 Fix path. 2023-02-23 00:27:02 +01:00
Łukasz 'sil2100' Zemczak
5b99af28d0 Terrible workaround 2023-02-22 23:59:40 +01:00
Łukasz 'sil2100' Zemczak
87dcf0de62 Do not offer the hwe kernel for RISC-V server-live images 2023-02-20 17:30:01 +01:00
Łukasz 'sil2100' Zemczak
06fd5dacc3 Missed one place for handling lowlatency kernels flavours. 2023-02-16 14:23:53 +01:00