1521 Commits

Author SHA1 Message Date
Catherine Redfield
e4fa9ef18d feat(apparmor): Add kernel apparmor check to snap validation (LP: #2052789)
For jammy and later, snap validation verifies that the kernel
version matches the livecd-rootfs version, if available.  This
change bring focal in line with that paradigm.  This is necessary
due to the linux-$CLOUD-5.15 kernels requiring a different
apparmor feature set that generic.

(cherry picked from commit b2f25256707373537ce6c6f37fa5d456f1958edc)
2024-02-09 10:17:58 +00:00
Catherine Redfield
2c3cab4f9d feat: add 5.15 apparmor directory (LP: #2052789)
After the kernel roll to linux-gcp-5.15-5.15.0-1051.59_20.04.1,
basic_ubuntu::test_snap_preseed_optimized began failuring due to
a preseed mismatch.  This change adds a 5.15 apparmor configuration
to the focal branch.

(cherry picked from commit 76628691f5e584bde009f71d05c2057a624445d5)
2024-02-09 10:17:58 +00:00
Thomas Bechtold
85fa04c107 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.

(cherry picked from commit 434b21e2023c3c3e5261fbd78e2eefee9aac5b1e)
2024-01-19 15:48:46 +01:00
Steve Langasek
908042dbc9 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-19 18:17:46 +01:00
Thomas Bechtold
84c182ac44 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-28 13:18:25 +02:00
John Chittum
0f4c895b95
fix: GRUB_DISTRIBUTOR and grub install rectification
LP: 2034253 and LP: 2027686 both deal with buildd vm images failing to
boot when removing `--removable` and the stanzas copying EFI around. We
need to remove those stanzas for launchpad builder compatibility. even
though focal and jammy weren't failing, keeping everything aligned is
important. LP: 2034253 further showed that GRUB_DISTRIBUTOR being set by
default in grub requires lsb_release, which isn't in buildd images.
That's the root of why removing the stanzas failed. Since the only image
we know of where this bug is hit with grub is buildd (because everything
else has lsb_release), rather than adding a new dependency into buildd,
or backporting grub if we don't need to, setting GRUB_DISTRIBUTOR in the
buildd hook solves the immediate issue
2023-09-08 08:36:14 -05:00
Steve Langasek
83667afe02 Revert "Drop use of --removable flag to grub-install from buildd/hooks"
This reverts commit e55a349683cb140e6a4437149db31bd28c42e5cb.
2023-07-14 09:31:52 -07:00
Steve Langasek
e55a349683 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-19 00:06:20 -07:00
Simon Poirier
9fd491886e fix: Bump armhf to 3.5G in disk-image-uefi (LP: #2011739)
This increase should cover the growth of packages, notably linux-firmware.
2023-03-21 09:26:49 -04:00
Łukasz 'sil2100' Zemczak
9d18e5d2e3 Backport hack from jammy for fixing offline installs. 2023-03-16 14:04:25 +01:00
Utkarsh Gupta
8be7e4ff50 Clean up whitespaces 2022-12-12 15:34:38 +05:30
Samir Akarioh
aa1c6d9e19 feat: Add metadata on ubuntu-oci image
Add a file build.info on etc/cloud
with the serial information

Signed-off-by: Samir Akarioh <samir.akarioh@canonical.com>
(cherry picked from commit 105acdebc783291f740294b5c317f3e6d2da9de4)
2022-11-22 12:21:40 +01:00
Michał Sawicz
0b01d8451c
Add arm64 buildd bootable image
(cherry picked from commit 997fd08e628219a277c0e67a9af5bf7dc0031c7f)
2022-07-18 10:23:53 -05:00
Utkarsh Gupta
fded2787e5 Merge remote-tracking branch 'ikapelyukhin/focal-backport-arm64-secureboot' into ubuntu/focal
* ikapelyukhin/focal-backport-arm64-secureboot:
  Update debian/changelog
  disk-image-uefi.binary: enable secureboot on the arm64 image.
2022-07-04 13:50:09 +05:30
Dimitri John Ledkov
c8dd849261
disk-image-uefi.binary: enable secureboot on the arm64 image.
(cherry picked from commit 122364df65ad4ecf768b6a488058bf37a023ab55)
2022-06-29 07:22:22 +02:00
Łukasz 'sil2100' Zemczak
e1d51ec263 Adjust the PROJECT name in the live-server hooks for SUBARCH. 2022-06-10 17:53:21 +02:00
Łukasz 'sil2100' Zemczak
7410fc4a3e Additional changes were needed for the server-live hooks, since those were exiting early for SUBARCH images. 2022-06-10 16:46:10 +02:00
Łukasz 'sil2100' Zemczak
f59dad4ce9 Some missing pieces. 2022-06-10 12:18:42 +02:00
Łukasz 'sil2100' Zemczak
8b0cd96803 Add intel-iot server images, build intel-iot with the 5.15 kernel. 2022-06-09 16:52:08 +02:00
Utkarsh Gupta
55dad01adc Merge remote-tracking branch 'toabctl/focal-backport-optional-allow-core-snaps' into ubuntu/focal
* toabctl/focal-backport-optional-allow-core-snaps:
  Update debian/changelog
  Allow to install core snap optionally
2022-03-10 14:51:51 +05:30
Thomas Bechtold
edc244249a Allow to install core snap optionally
Commit 245f7772bdb74 added code to abort the build if a snap wants to
install "core" (the 16.04 runtime). That's great but there are still
some CPC maintained image builds that use snaps based on "core". So
make it possible to continue the build if the "ALLOW_CORE_SNAP" env
variable is set.

(cherry picked from commit 34735684d5208981b2413047f67ee4c363d718d8)
2022-03-09 10:48:08 +01:00
Ivan Kapelyukhin
e64406f4f8
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.

(cherry picked from commit b40ce74fd67bbaa7f9ec94463d8da759724f9fec)
2022-03-03 15:57:11 +01:00
Ivan Kapelyukhin
9eb9d89a60
fix: unset initrdless_boot_fallback_triggered instead of setting it to 0
This fixes GCE shielded VM instances integrity monitoring failures on
focal and later. Our images are built with an empty /boot/grub/grubenv
file, however after the first boot `initrdless_boot_fallback_triggered`
is set to 0. This change in `grubenv` results in integrity monitoring
`lateBootReportEvent` error.

It seems that the only thing that's checking for this `grubenv` variable
is `grub-common.service`, and it is looking specifically for a `1`
value:

  if grub-editenv /boot/grub/grubenv list | grep -q
  initrdless_boot_fallback_triggered=1; then echo "grub:
  GRUB_FORCE_PARTUUID set, initrdless boot paniced, fallback triggered.";
  fi

Unsetting this variable instead of setting it to 0 would prevent issues
with integrity monitoring.
2022-02-22 07:06:07 +01:00
Łukasz 'sil2100' Zemczak
fe5576194e Use the classic gadget for raspi images 2022-02-15 19:43:50 +01:00
John Chittum
0fbafa9dbe Add sleep to workaround e2fsck errors
LP: 1960537 illustrates an issue where the calls to e2fsck in the
umount_partition call are failing due to an open file handle. At this
time, we are unable to find a root cause, and it's causing many builds
to fail for CPC. Adding a sleep 30 as a workaround as the file handle
releases within  that timeframe. This does not address root cause.
2022-02-10 15:39:25 -08:00
Steve Langasek
bf889e33e4 Treat it as a fatal error if we are asked to install a snap that would pull in the core snap. Ubuntu 20.04 and Ubuntu 22.04 official images should never require snaps that depend on an Ubuntu 16.04 runtime, this indicates a misconfiguration that will bloat the install. 2022-01-11 19:26:38 -08:00
Steve Langasek
83953bd041 We don't pipe grep to awk in this house, young man 2022-01-11 19:26:31 -08:00
Steve Langasek
dc629f4114 Do not look for a base snap on snaps of type base, because recursive dependencies are not allowed for snaps. LP: #1957123. 2022-01-11 19:26:27 -08:00
Michael Hudson-Doyle
f274748101 live-build/ubuntu-server/hooks/032-installer-squashfs.binary: be more careful in deleting snaps that snap-preseed has copied up into the live installer layer. (LP: #1952093) 2021-11-25 13:28:52 +13:00
Brian Murray
8288552dea Add the capability to build an ISO image for the Intel IoT project. Additionally, stop using universe with the project given that the kernel is now in main. 2021-11-16 17:17:54 -08:00
Łukasz 'sil2100' Zemczak
d9f7f2ec38 Whitespace fix 2021-10-29 17:13:15 +02:00
Łukasz 'sil2100' Zemczak
4131dad0da Fix rootfs resize and a grub2 font warning. 2021-10-29 15:34:53 +02:00
Brian Murray
6872371dc6 fix a typo in 099-ubuntu-image-customization.chroot 2021-10-28 11:11:45 -07:00
Łukasz 'sil2100' Zemczak
60ade114c4 Sneak in a small fix for a (currently) unused use-case. 2021-10-28 18:11:44 +02:00
Łukasz 'sil2100' Zemczak
498b83fe59 Add the 099-ubuntu-image-customization.chroot hook for desktop-preinstalled similarly to what we have in groovy+ for the pi desktop, but improved for amd64 platforms. We use it to generate a valid grub.cfg on the rootfs (similar to ubuntu-cpc) 2021-10-28 17:21:39 +02:00
Dimitri John Ledkov
efd0641f6c magic-proxy: replace http.client with urllib calls
Initialize passwords from sources.list.
Use urllib everywhere.
This way authentication is added to all the required requests.
And incoming headers, are passed to the outgoing requests.
And all the response headers, are passed to the original client.
And all the TCP & HTTP errors are passed back to the client.
Thus should avoiding hanging requests upon failure.
Also rewrite the URI when requesting things.
This allows to use private-ppa.buildd outside of launchpad.

Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
(cherry picked from commit dc2a472871907bbed3ab89d2a46d924ece80d514)
2021-09-28 13:48:45 +02:00
Dimitri John Ledkov
3d65dbb767 Change iptables calls, to query rules and quickly check that connectivity works after transparent proxy has been installed. LP: #1917920
(cherry picked from commit 1cd8fe14b70e98220c519d679217737672ee9019)
2021-09-28 13:48:41 +02:00
Jason C. McDonald
1c66b45338 Generate manifest for HyperV desktop images
Manifests are necessary for candidate checking in the
CPC automated workflow for building and publishing
HyperV desktop images. (#1940136)
2021-08-20 09:14:22 -07:00
Łukasz 'sil2100' Zemczak
4cf38c5151 Some more changes needed for enabling official intel-iot image builds. 2021-08-16 13:04:25 +02:00
Łukasz 'sil2100' Zemczak
44148c60a5 One more fix for intel-iot. 2021-08-12 13:45:35 +02:00
Łukasz 'sil2100' Zemczak
977c1cf74b A small fix for intel-iot 2021-08-04 17:35:11 +02:00
Łukasz 'sil2100' Zemczak
0b56fd53fe Revert /dev sharing improvements. 2021-08-02 22:13:43 +02:00
Łukasz 'sil2100' Zemczak
c3ebdc6f66 Backport fix for LP: #1938414 2021-07-29 11:06:53 +02:00
Łukasz 'sil2100' Zemczak
6568c5fa29 Merge branch 'ubuntu/focal' of git+ssh://git.launchpad.net/livecd-rootfs into bdmurray/focal-intel-iot 2021-07-29 10:31:38 +02:00
Brian Murray
6fac135f23 fix an extraneous || 2021-07-28 14:34:54 -07:00
Brian Murray
4b3f3c52dc add missing semicolons 2021-07-28 13:48:09 -07:00
Brian Murray
69afe8fd5d Add support for creating images (ubuntu-core and classic) with a kernel optimized for Intel IoT devices. (LP: #1938338) 2021-07-28 13:37:31 -07:00
Michael Hudson-Doyle
c27dbda4ca backport some system unit & cloud-init config changes from devel:
* Simplify how the subiquity client is run on the serial console in the live
  server environment, breaking a unit cycle that sometimes prevents
  subiquity from starting up at all. (LP: #1888497)
* Do not set the password for the installer user via cloud-init as subiquity
  can now do this itself. (LP: #1933523)
2021-07-23 12:07:26 +12:00
Dimitri John Ledkov
acb4de3be0 Cherry-pick 4428dbbf8f998c138093e3208bc7a0e7034714be
riscv64: generalise slightly how preinstalled server images are built, to allow using subarch to pick u-boot binaries to install.
2021-06-15 13:30:29 +02:00
Jean-Baptiste Lallement
fee8ba22f4 Added hook for AD support
Adding dependencies for Active Directory support to workaround LP: #1921862

Co-authored-by: Didier Roche <didrocks@ubuntu.com>
2021-05-21 16:56:38 +02:00