Compare commits

...

204 Commits

Author SHA1 Message Date
Philip Roche
2edc2591a3 Merge bugfix/add_apparmor515_validate_seed into ubuntu/focal [a=philroche] [r=catred,jchittum]
fix: Update d/ch for 2.664.53 to include references to seed validation (LP: #2059730)

Add missing references to LP: #2059730.

MP: https://code.launchpad.net/~philroche/livecd-rootfs/+git/livecd-rootfs/+merge/463488
2024-04-02 15:57:07 +01:00
Philip Roche
dfee24d1e4 fix: Update d/ch for 2.664.53 to include references to seed validation (LP: #2059730)
Add missing references to LP: #2059730.
2024-04-02 11:11:56 +01:00
Philip Roche
57bdb9f6bd Update d/ch for 2.664.53 release
* Marking 2.664.53 unlreleased->focal as it has now been uploaded
* Fixing chanelog entry line too long
2024-02-13 18:07:13 +00:00
Philip Roche
081a251efd Merge bugfix/add_apparmor515_focal into ubuntu/focal [a=philroche] [r=ankushpathak,jessica-youjeong,vorlon]
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.

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.

MP: https://code.launchpad.net/~philroche/livecd-rootfs/+git/livecd-rootfs/+merge/460323
2024-02-13 16:41:23 +00:00
Philip Roche
e51e89423d Update d/ch for 2.664.53 release 2024-02-09 10:17:58 +00:00
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
Utkarsh Gupta
83d1496ca8 Update d/ch for 2.664.52 release 2024-01-30 20:59:56 +05:30
Utkarsh Gupta
bcf11eaff6 Fix the LP bug 2024-01-22 17:12:39 +05:30
Utkarsh Gupta
36a30189c4 Update d/ch for 2.664.52 -- UNRELEASED 2024-01-22 17:09:41 +05:30
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
Philip Roche
31730b7f6c Fix d/ch formatting for 2.664.51 2023-10-27 12:04:31 +01:00
Philip Roche
05e4d0bec0 Merge bugfix/ubuntu-cpc-LP-2036195-auto-installed-packages-focal into ubuntu/focal [a=philroche] [r=andrew-cloke,vorlon]
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.

MP: https://code.launchpad.net/~philroche/livecd-rootfs/+git/livecd-rootfs/+merge/454066
2023-10-26 16:57:56 +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
Utkarsh Gupta
9a2056d7cb Update d/ch for 2.664.50 release 2023-10-09 16:03:30 +01:00
Thomas Bechtold
02c759d3bc Add debian/changelog 2023-09-28 13:19:50 +02: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
Steve Langasek
2203488f7e releasing package livecd-rootfs version 2.664.49 2023-09-13 09:15:06 -07:00
Steve Langasek
c367959d58 squash the changelog, instead of detailing revert-revert-revert history 2023-09-13 09:15:05 -07:00
John Chittum
d598b12ad5
doc: Changelog entry 2023-09-08 08:40:20 -05: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
eb66cea8ba Revert previous change; the image builds did not fail in focal, and this change introduced a regression (LP #2027686). 2023-07-14 09:32:23 -07: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
b94cc086a1 releasing package livecd-rootfs version 2.664.48 2023-05-19 00:09:04 -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
561ce5b633 Changelog entry 2023-03-21 09:27:15 -04: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
f86653ccd9 releasing package livecd-rootfs version 2.664.46 2023-03-16 14:04:44 +01:00
Łukasz 'sil2100' Zemczak
9d18e5d2e3 Backport hack from jammy for fixing offline installs. 2023-03-16 14:04:25 +01:00
Utkarsh Gupta
0c08fc269d Update d/ch for 2.664.45 release 2022-12-12 15:34:59 +05:30
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
Michael Hudson-Doyle
901a79fcca releasing package livecd-rootfs version 2.664.44 2022-07-29 09:58:05 +12:00
Michael Hudson-Doyle
66e9dc03d9 fix changelog whitespace 2022-07-29 09:57:54 +12:00
John Chittum
796554befe
open 2.664.44 release 2022-07-18 10:32:16 -05:00
Michał Sawicz
0b01d8451c
Add arm64 buildd bootable image
(cherry picked from commit 997fd08e628219a277c0e67a9af5bf7dc0031c7f)
2022-07-18 10:23:53 -05:00
Utkarsh Gupta
60dc192e42 Update d/ch for 2.664.43 release 2022-07-04 13:51:47 +05:30
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
Łukasz 'sil2100' Zemczak
37663a7d89 releasing package livecd-rootfs version 2.664.42 2022-06-30 17:30:16 +02:00
Ivan Kapelyukhin
0c9dd96849
Update debian/changelog 2022-06-30 16:27:19 +02:00
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
9b7111ac6a Add bug numbers 2022-06-28 10:40:38 +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
b9dfc7dec7 Update d/ch for 2.664.41 release 2022-03-10 14:52:14 +05:30
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
4ec6cefabe Update debian/changelog 2022-03-09 10:49:17 +01:00
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
d45d1544f4
Update changelog 2022-03-03 15:57:39 +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
Utkarsh Gupta
febe9e3f8b Update d/ch for 2.664.40 release 2022-02-23 14:14:29 +05:30
Ivan Kapelyukhin
442dbd4af4
Update changelog 2022-02-22 07:08:33 +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
fed7c9d481 releasing package livecd-rootfs version 2.664.39 2022-02-15 19:44:15 +01:00
Łukasz 'sil2100' Zemczak
fe5576194e Use the classic gadget for raspi images 2022-02-15 19:43:50 +01:00
Brian Murray
1b96055b31 releasing package livecd-rootfs version 2.664.38 2022-02-10 15:42:04 -08: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
14c13d16b2 releasing package livecd-rootfs version 2.664.37 2022-01-18 16:16:22 -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
3fba8bfff9 releasing package livecd-rootfs version 2.664.36 2021-12-02 12:05:14 +13: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
2b933a24fa releasing package livecd-rootfs version 2.664.35 2021-11-18 15:42:57 -08:00
Brian Murray
fd6b62637b magic-proxy: fix exception handling for URLError (LP: #1946520) 2021-11-18 15:42:44 -08:00
Brian Murray
3592e1d5e3 releasing package livecd-rootfs version 2.664.34 2021-11-16 17:19:06 -08: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
Brian Murray
f191c439c4 releasing package livecd-rootfs version 2.664.33 2021-10-29 11:06:57 -07: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
81407a4aa8 releasing package livecd-rootfs version 2.664.32 2021-10-28 11:12:49 -07:00
Brian Murray
f9ce7e67fb Add a changelog entry 2021-10-28 11:12:29 -07:00
Brian Murray
6872371dc6 fix a typo in 099-ubuntu-image-customization.chroot 2021-10-28 11:11:45 -07:00
Łukasz 'sil2100' Zemczak
a53b1bcf9a releasing package livecd-rootfs version 2.664.31 2021-10-28 18:12:42 +02: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
f62113fa9d Changelog entry. 2021-10-28 17:44:04 +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
Brian Murray
cfe9c86b4c fix release in the changelog 2021-10-21 12:27:33 -07:00
Brian Murray
becc507a20 releasing package livecd-rootfs version 2.664.30 2021-10-21 11:55:43 -07:00
Brian Murray
1ed399cc23 magic-proxy: Replace http.client with urllib calls. live-build/auto/build: change iptables calls to query rules and quickly check that connectivity works after transparent proxy has been installed. (LP: #1917920)
* magic-proxy: Replace http.client with urllib calls. live-build/auto/build:
  change iptables calls to query rules and quickly check that connectivity
  works after transparent proxy has been installed. (LP: #1917920)
* magic-proxy: fix TypeError when trying to call get_uri() (LP: #1944906)
2021-10-21 11:55:19 -07:00
Thomas Bechtold
da3c71a791 magic-proxy: fix TypeError when trying to call get_uri() LP:#1944906
Currently the uri that is passed into urllib.parse.urlparse() is not
prefixed with "http(s)://" which leads urlparse() to return a wrong
scheme/netloc/path. Currently it looks like:

ParseResult(scheme='', netloc='',
  path='de.archive.ubuntu.com/ubuntu/dists/impish-backports/InRelease'
 , params='', query='', fragment='')

That's wrong. The path should look like
'ubuntu/dists/impish-backports/InRelease'.
Prefixing the 'host' header with 'http://' in case it's not there does
fix the problem.

This fixes:

Traceback (most recent call last):
  File "/usr/lib/python3.9/socketserver.py", line 683, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python3.9/socketserver.py", line 360, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python3.9/socketserver.py", line 747, in __init__
    self.handle()
  File "/usr/lib/python3.9/http/server.py", line 427, in handle
    self.handle_one_request()
  File "/usr/lib/python3.9/http/server.py", line 415, in handle_one_request
    method()
  File "/home/tom/devel/livecd-rootfs/./magic-proxy", line 787, in do_GET
  File "/home/tom/devel/livecd-rootfs/./magic-proxy", line 838, in __get_request
  File "/home/tom/devel/livecd-rootfs/./magic-proxy", line 84, in get_uri
TypeError: can only concatenate str (not "NoneType") to str

(cherry picked from commit 3559153c7d91dfb25e6aaf1d18152e945411d503)
2021-09-28 13:48:47 +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
Michael Hudson-Doyle
8cb5a7d79c releasing package livecd-rootfs version 2.664.29 2021-09-15 23:41:43 +12:00
Michael Hudson-Doyle
1cef501f69 adjust changelog 2021-09-15 23:40:33 +12: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
d8932157d3 releasing package livecd-rootfs version 2.664.28 2021-08-16 13:49:50 +02: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
fd3b94a785 releasing package livecd-rootfs version 2.664.27 2021-08-04 17:35:34 +02:00
Łukasz 'sil2100' Zemczak
977c1cf74b A small fix for intel-iot 2021-08-04 17:35:11 +02:00
Łukasz 'sil2100' Zemczak
41bd6c18a9 releasing package livecd-rootfs version 2.664.26 2021-08-02 22:14:07 +02:00
Łukasz 'sil2100' Zemczak
0b56fd53fe Revert /dev sharing improvements. 2021-08-02 22:13:43 +02:00
Łukasz 'sil2100' Zemczak
ac02535a5e releasing package livecd-rootfs version 2.664.25 2021-07-29 15:50:03 +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
Łukasz 'sil2100' Zemczak
d95cb8b344 releasing package livecd-rootfs version 2.664.24 2021-06-18 10:11:33 +02:00
Łukasz 'sil2100' Zemczak
44d443b63f Fix typo in changelog. 2021-06-16 09:52:02 +02:00
Łukasz 'sil2100' Zemczak
1a4312bea7 Add changelog. 2021-06-15 13:55:19 +02: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
f91d09f6b6 releasing package livecd-rootfs version 2.664.23 2021-05-21 16:56:50 +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
Steve Langasek
26cadb7cfe releasing package livecd-rootfs version 2.664.22 2021-05-20 17:07:13 -07:00
Steve Langasek
b558c86764 Merge remote-tracking branch 'codyshepherd/buildd/hide-grub-menu-ff' into ubuntu/focal 2021-05-20 17:06:44 -07:00
Michael Hudson-Doyle
134169ec94 releasing package livecd-rootfs version 2.664.21 2021-05-11 11:38:29 +12:00
Michael Hudson-Doyle
511d78a4fd Merge remote-tracking branch 'toabctl/sru-focal-lp1926732' into ubuntu/focal 2021-05-11 11:38:12 +12:00
Thomas Bechtold
790219907f
add debian/changelog entry 2021-04-30 14:04:19 +02:00
Thomas Bechtold
99add26dc3
add configure_oci function and use it in ubuntu-oci
With that, the Dockerfile modifications[0] currently done externally
are done now here. That means that the created rootfs tarball can be
directly used within a Dockerfile to create a container from scratch:

FROM scratch
ADD livecd.ubuntu-oci.rootfs.tar.gz /
CMD ["/bin/bash"]

[0]
https://github.com/tianon/docker-brew-ubuntu-core/blob/master/update.sh

(cherry picked from commit a81972a58b004897bf3e5c14ff371bc2f6b5e4b8)
2021-04-30 14:02:59 +02:00
Thomas Bechtold
9e15d88f4c
Add new ubuntu-oci project
This is a copy of the ubuntu-base project.
Currently ubuntu-base is used as a base for the docker/OCI container
images. The rootfs tarball that is created with ubuntu-base is
published under [0]. That tarball is used in the FROM statement of the
Dockerfile as base and then a couple of modifications are done inside
of the Dockerfile[1].
The ubuntu-oci project will include the changes that are currently
done in the Dockerfile. With that:

1) a Dockerfile using that tarball will be just a 2 line thing:

   FROM scratch
   ADD ubuntu-hirsute-core-cloudimg-amd64-root.tar.gz /
   CMD ["/bin/bash"]

2) Ubuntu has the full control about the build process of the
docker/OCI container. No external sources (like [1]) need to be
modified anymore.
3) Ubuntu can publish containers without depending on the official
dockerhub containers[2]. Currently the containers for the AWS ECR
registry[3] use as a base[4] the official dockerhub containers. That's
no longer needed because a container just needs a Dockerfile described
in 1)

When the ubuntu-oci project has the modifications from [1] included,
we'll also update [1] to use the ubuntu-oci rootfs tarball as a base
and drop the modifications done at [1].

Note: Creating a new ubuntu-oci project instead of using ubuntu-base
will make sure that we don't break users who are currently using
ubuntu-base rootfs tarballs for doing their own thing.

[0] https://partner-images.canonical.com/core/
[1]
https://github.com/tianon/docker-brew-ubuntu-core/blob/master/update.sh
[2] https://hub.docker.com/_/ubuntu
[3] https://gallery.ecr.aws/ubuntu/ubuntu
[4]
https://launchpad.net/~ubuntu-docker-images/ubuntu-docker-images/+oci/ubuntu/+recipe/ubuntu-20.04

(cherry picked from commit ac4a95b9314cf1f8ce01f42016c271c0a6078372)
2021-04-30 14:02:59 +02:00
Robert C Jennings
3a78492327
releasing package livecd-rootfs version 2.664.20 2021-04-10 05:20:52 -05:00
Robert C Jennings
1a43fa5937
Merge remote-tracking branch 'gjolly/consistent_fstab-focal' into ubuntu/focal 2021-04-10 05:19:52 -05:00
Robert C Jennings
29c00d23a9
Fix release hirsute to focal 2021-03-22 11:04:37 -05:00
Robert C Jennings
9e58629c89
releasing package livecd-rootfs version 2.664.19 2021-03-22 11:00:47 -05:00
David Krauser
597d678e17
Fix broken minimal cloud image boot on amd64 (LP: #1920043)
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.
2021-03-22 10:26:06 -05:00
Gauthier Jolly
330720f686
ubuntu-cpc: secure esp mountpoint (LP: #1881006)
Change mount option for ubuntu-cpc images from "defaults" to
"umask=0077". ESP partitions might contain sensitive data and
non-root users shouldn't have read access on it.
2021-03-18 10:10:43 +00:00
Cody Shepherd
7e0f6453f7
Update changelog 2021-03-01 09:05:14 -08:00
Cody Shepherd
69bb7fc4a1
Install lxd-agent-loader in bootable buildd image to improve user
experience with lxd vms
2021-03-01 09:04:26 -08:00
Cody Shepherd
61a422f553
Set grub configs to hide boot menu and enable output on ttyS0 2021-03-01 09:04:26 -08:00
Robert C Jennings
82f69612c7
releasing package livecd-rootfs version 2.664.18 2021-02-23 14:45:48 -06:00
Pat Viafore
0775862a25
Add mechanism to detect initrdless boot fallback
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.

Addresses LP: #1870189
2021-02-18 15:47:20 -06:00
David Krauser
4030c8bc5a
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.
2021-02-18 15:40:46 -06:00
David Krauser
c81f4ca2e3
Boot without an initramfs by default if running a custom kernel
Initramfs-less boot, which is a boot optimization, should only be
applied where we know it could work for users and provide an improved
boot boot experience; images with custom kernels are candidates for
that.
2021-02-18 15:40:45 -06:00
David Krauser
6a37833973
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.
2021-02-18 15:40:42 -06:00
Dimitri John Ledkov
d059742988
releasing package livecd-rootfs version 2.664.17 2021-02-09 00:52:25 +00:00
Dimitri John Ledkov
6b32cd5fb1
functions: stop removing systemd-detect-virt unconditionally in undivert_grub
One can call divert_grub; replace_kernel; undivert_grub. And
replace_kernel will call into force_boot_without_initramfs, which
under certain conditions can call divert_grub &
undivert_grub. Resulting in undivert_grub called twice in a row.

When undivert_grub is called twice in a row it wipes
systemd-detect-virt binary from disk, as the rm call is unguarded to
check that there is something to divert if systemd package is
installed. And if the systemd package is not installed, it does not
check that systemd-detect-virt file is in-fact what divert_grub has
created.

Add a guard to check that systemd-detect-virt is the placeholder one,
before removing it.

LP: #1902260
(cherry picked from commit 096a00f40459187719840ccad99e86c7ade2ec12)
2021-02-09 00:51:00 +00:00
Dimitri John Ledkov
e1bea4d00e
Perform fsck on all rootfs.
LP: #1912835
(cherry picked from commit 33b7272a2331279b4c7aa8de73ed8a9069d0bd39)
2021-02-09 00:50:52 +00:00
Dimitri John Ledkov
5c802316f2
esp: perform fsck.
LP: #1912835
(cherry picked from commit 53b28d5f58284657ee8efd08a633d557af1fcd97)
2021-02-09 00:50:46 +00:00
Dimitri John Ledkov
2646b9c459
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
(cherry picked from commit 7c760864fdcb278ca37396f06f5e3f297428d63d)
2021-02-09 00:50:38 +00:00
Dimitri John Ledkov
cc13644b6a
Merge branch 'dk/focal-buildd-unpack-kernel-initrd' of git+ssh://git.launchpad.net/~davidkrauser/livecd-rootfs/+git/livecd-rootfs into ubuntu/focal
(Cherry-pick commit 065c82314464fa78337d5122e1d4826a7d6edbb0)
2021-02-09 00:50:00 +00:00
Robert C Jennings
94778745f4
releasing package livecd-rootfs version 2.664.16 2021-02-05 15:06:13 -06:00
Cody Shepherd
d1c83f0ab4
Update changelog 2021-02-03 07:46:17 -08:00
Cody Shepherd
ff91fd7da4
Omit file type exensions in manifest names 2021-02-03 07:27:40 -08:00
Cody Shepherd
7af37be61a
Create manifests for buildd tarballs 2021-02-03 07:27:30 -08:00
Łukasz 'sil2100' Zemczak
47bf29b619 releasing package livecd-rootfs version 2.664.15 2021-02-02 11:51:38 +01:00
Łukasz 'sil2100' Zemczak
befad641dc Support the lowlatency-hwe-* when handling kernel flavours. 2021-02-02 11:51:21 +01:00
Łukasz 'sil2100' Zemczak
3b0ebedf8a releasing package livecd-rootfs version 2.664.14 2021-02-01 22:34:05 +01:00
Łukasz 'sil2100' Zemczak
e22a16b068 Enable the HWE kernel for all flavours. 2021-02-01 22:25:00 +01:00
Łukasz 'sil2100' Zemczak
02c011ab8e releasing package livecd-rootfs version 2.664.13 2021-01-26 15:53:32 +01:00
Łukasz 'sil2100' Zemczak
eaf9ca8b17 Changelog entry. 2021-01-26 15:50:44 +01:00
Łukasz 'sil2100' Zemczak
e88f07a6e8 enable hwe variant 2021-01-26 15:46:11 +01:00
Dimitri John Ledkov
3e56c4c82e
releasing package livecd-rootfs version 2.664.12 2021-01-15 17:22:31 +00:00
Dimitri John Ledkov
4be305fedc
chroot: disable amd64 codepath on riscv64 2021-01-15 17:22:01 +00:00
Dimitri John Ledkov
bf0b1401ff
releasing package livecd-rootfs version 2.664.11 2021-01-15 17:08:41 +00:00
Dimitri John Ledkov
7680ece7b0
riscv64: backport HiFive unleashed & cloud-image building support
All commits are cherrypicks from hirsute, and includes:

make-lxd-metadata: add riscv64 lxd architecture tag
control: install qemu-utils & snapd on riscv64.
disk-image.binary: actually skip building MBR image on EFI platforms.
disk-image.binary: skip building MBR image on riscv64.
disk-image.binary: however still build MBR image on amd64.
disk-image-uefi.binary: build riscv64 image without a bootloader.
disk-image-uefi: riscv64 add u-boot spl
disk-image-uefi: riscv64 add ubuntu:ubuntu login, without expiry.
riscv64: build preinstalled riscv64 image with uboot SPL and CIDATA.
riscv64: fixup subarch build, unbound variable
qcow2-image: unbreak builds without subarch.
disk-image-uefi: fix riscv64 subarch user-data.

LP: #1903034
2021-01-15 17:06:44 +00:00
David Krauser
689631931e Produce buildd kernel and initrd as separate artifacts
Multipass on Mac OS X requires standalone kernel and initrd artifacts
to boot.

Also call update-initramfs on all installed kernels. We only have one
kernel installed, so we don't need to specify an explicit version.
2021-01-08 14:51:18 -05:00
Łukasz 'sil2100' Zemczak
4e8e1fed07 Ok, last commit didn't remove enough lines, sorry for that. 2020-12-03 18:21:57 +01:00
Łukasz 'sil2100' Zemczak
2620aacd6a releasing package livecd-rootfs version 2.664.10 2020-12-03 12:22:54 +01:00
Łukasz 'sil2100' Zemczak
2029f49fe6 Still hardcode UC20 amd64 image size, but to the same value as for UC16 and UC18. 2020-12-03 12:22:31 +01:00
Łukasz 'sil2100' Zemczak
a4838e3245 Merge branch 'uc20-no-fixed-size' of git+ssh://git.launchpad.net/livecd-rootfs into ubuntu/focal 2020-11-27 17:59:08 +01:00
Robert C Jennings
5d11633c6c
releasing package livecd-rootfs version 2.664.9 2020-11-20 14:41:10 -06:00
Robert C Jennings
172b217128
Merge focal-open-vm-tools-update into ubuntu/focal [a=jchittum] [r=rcj]
Backport vmtools version in vmdk (LP: #1893898)

Backport
LP: #1893898 describes missing vmtools version from the vmdk headers.
The version should be added as ddb.toolsVersion = "2147483647" however
the sed was no longer replacing a ddb.comment field with the tools
version. Rather than subbing ddb.comment with toolsVersion, this commit
deletes ddb.comment (which the comment mentions could cause errors),
and adds the correct value. There was no visibility into the descriptor
during hook creation, so debug statements were added. This allows us to
quickly verify in the logs that bad statements are removed (the possibly
offending comments), as well as ensuring that the toolsVersion is added

MP: https://code.launchpad.net/~jchittum/livecd-rootfs/+git/livecd-rootfs/+merge/394142
2020-11-20 14:35:25 -06:00
Robert C Jennings
c5e80d80b7
Merge focal-sru-grub into ubuntu/focal [a=powersj] [r=patviafore,rcj]
SRU always install grub-pc with shim-signed (LP: #1901906), and ensure to autoremove packages

MP: https://code.launchpad.net/~powersj/livecd-rootfs/+git/livecd-rootfs-1/+merge/393735
2020-11-20 14:30:23 -06:00
John Chittum
c5cea219f4
re-add sed command
Older version of vmdk-stream-converter has an incorrect header. The
original sed command replaced the incorrect "Description File" comment
with the correct "Disk DescriptorFile".
2020-11-17 15:40:45 -06:00
John Chittum
c56c2475e4
Update changelog
Open release and add information
2020-11-16 09:18:14 -06:00
Joshua Powers
6ee6e4c599
releasing package livecd-rootfs version 2.664.9 2020-11-13 09:10:27 -08:00
Joshua Powers
ef950f5214
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.

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.

LP: #1901906
2020-11-13 09:07:12 -08:00
John Chittum
56862cd9b8
Backport vmtools version in vmdk (LP: #1893898)
Backport
LP: #1893898 describes missing vmtools version from the vmdk headers.
The version should be added as ddb.toolsVersion = "2147483647" however
the sed was no longer replacing a ddb.comment field with the tools
version. Rather than subbing ddb.comment with toolsVersion, this commit
deletes ddb.comment (which the comment mentions could cause errors),
and adds the correct value. There was no visibility into the descriptor
during hook creation, so debug statements were added. This allows us to
quickly verify in the logs that bad statements are removed (the possibly
offending comments), as well as ensuring that the toolsVersion is added
2020-11-10 12:50:32 -06:00
Łukasz 'sil2100' Zemczak
433c2363d8 Do not hard-code the UC20 amd64 image size anymore 2020-11-03 11:30:23 +01:00
Dimitri John Ledkov
430a6f2ae8
releasing package livecd-rootfs version 2.664.8 2020-10-22 16:01:34 +01:00
Dimitri John Ledkov
558bcbc47e
functions: provide nss_systemd-less nsswitch.conf in chroots.
(cherry picked from commit 4d4f113f42d6c3a58a484582af4d2c02f96a42bf)
2020-10-05 10:32:16 +01:00
Dimitri John Ledkov
2be2852ee0
auto/build: use setup|teardown_mountpoint to reduce duplication
(cherry picked from commit 109e6c6613aae4cbd4e8793709ab52c3cbce214c)
2020-10-05 10:32:15 +01:00
Robert C Jennings
e2ae9c245d
Avoid rbind /sys for chroot snap pre-seeding (cgroups fail to unmount)
Builds in LP with the Xenial kernel were happy with the recursive mount of
/sys inside the chroot while performing snap-preseeding but autopkgtests
with the groovy kernel failed.  With the groovy kernel the build was
unable to unmount sys/kernel/slab/*/cgroup/* (Operation not permitted).

This patch mounts /sys and /sys/kernel/security in the chroot in the
same way we've added for binary hooks.  This provides the paths under
/sys needed for snap-preseed while avoiding issues unmounting other
paths.

(cherry picked from commit 84397b50989670c2cfff01de23a5a73e67cd4088)
2020-10-05 10:32:14 +01:00
Dimitri John Ledkov
260c051032
apparmor: compile all profiles
(cherry picked from commit b14f79ce2e9a18b5832c5488146dbdd7edcd65dd)
2020-10-05 10:32:13 +01:00
Dimitri John Ledkov
ce5a138c79
seccomp: mount more up-to-date seccomp features
(cherry picked from commit 31861fd40dabd62e789aeb6d9e64b1ada7b908d8)
2020-10-05 10:32:12 +01:00
Dimitri John Ledkov
c95652e47d
seccomp: add more up-to-date seccomp actions
(cherry picked from commit bc4d32a422c4558656576cb0d3a1e4f3d0c42f76)
2020-10-05 10:32:11 +01:00
Dimitri John Ledkov
acc7e97f38
apparmor: mount more up-to-date apparmor features in the chroot.
(cherry picked from commit a14a31b7514e3f602f29f9af61e6b7bc97662dc2)
2020-10-05 10:32:10 +01:00
Dimitri John Ledkov
d724069fab
apparmor: Add generic v5.4 kernel apparmor features
(cherry picked from commit 37be000f39a1713c095d6758b41d9dc087079ddb)
2020-10-05 10:32:09 +01:00
Dimitri John Ledkov
56a7169ebe
live-server: remove duplicate snaps, due to overlayfs vs snap-preseed.
(cherry picked from commit 6e6ab16bf268c038392e9f4aa7b8398a53af65d5)
2020-10-05 10:32:08 +01:00
Robert C Jennings
39ebdf6902
Apply snap-preseed optimizations after seeding snaps
The snap-preseed command can do a number of things during the build
that are currently performed at first boot (apparmor profiles, systemd
unit generation, etc).  This patch adds a call to reset the seeding and
apply these optimizations when adding a seeded snap.  As a prerequisite
to calling snap-preseed we need to make /dev/mem available as well as
mounts from the host to perform this work, so those are also added here.

(cherry picked from commit 1ca11c979505ae1b8c4621f034d28070a2715293)
2020-10-05 10:32:07 +01:00
Robert C Jennings
bac2570518
releasing package livecd-rootfs version 2.664.7 2020-09-23 13:33:37 -05:00
John Chittum
3241df930b
Update changelog for SRU 2020-09-22 15:58:17 -05:00
John Chittum
05bba4cbbd
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-09-22 15:57:52 -05:00
Steve Langasek
f400d7f718 Changelog update for revert of azure change 2020-09-01 15:04:15 -07:00
Jinming Wu, Patrick
a58b91da5f
Revert azure kernel change 2020-09-02 05:48:42 +08:00
Jinming Wu, Patrick
750d52b504 Merge remote-tracking branch 'upstream/ubuntu/focal' into ubuntu/focal 2020-09-02 05:39:18 +08:00
Jinming Wu, Patrick
3b0439208e xRDP fixes for Hyper-V build
- xRDP configuration changes due to the config changes in this version
compared to 18.04.
- 46-allow-update-repo.pkla inclusion to aviod "Authentication required
to refresh system repositories" bug in xRDP
2020-09-02 05:36:26 +08:00
Steve Langasek
ab20f18c2e releasing package livecd-rootfs version 2.664.6 2020-08-26 14:06:35 -07:00
Steve Langasek
9b804b02e9 * Fix xrdp support in hyper-v images.
* Use the linux-azure kernel in hyper-v images instead of linux-virtual.
* LP: #1890980.
2020-08-26 14:06:01 -07:00
Jinming Wu, Patrick
419a21205c Fix a mistake on the location of policy file 2020-08-26 14:06:01 -07:00
Jinming Wu, Patrick
5a0e23fefe Update linux-tools/linux-cloud-tools to use Azure 2020-08-26 14:06:01 -07:00
Jinming Wu, Patrick
92dd127d83 xRDP fixes for Hyper-V build
- use of linux-azure, which is the optimized kernel for Hyper-V by
Microsoft
- xRDP configuration changes due to the config changes in this version
compared to 18.04.
- 46-allow-update-repo.pkla inclusion to aviod "Authentication required
to refresh system repositories" bug in xRDP
2020-08-26 14:06:01 -07:00
Steve Langasek
4e3289d0b8 Add SRU bug link 2020-08-10 12:58:37 -07:00
Steve Langasek
2404d27f5b Merge remote-tracking branch 'codyshepherd/bootable-buildd/dist-upgrade/focal' into ubuntu/focal 2020-08-04 12:40:29 -07:00
Robert C Jennings
136562b837
Handle seeded lxd snap with channel name for ubuntu-cpc:minimized (LP: #1889470)
The seed now specifies the lxd snap in focal as
'lxd=4.0/stable/ubuntu-20.04' which doesn't match the expectations of
the code with looks for lxd as the only snap in the seed for minimized
images.  This patch updates the pattern to accept 'lxd' or 'lxd=*'.
2020-07-29 14:55:19 -05:00
Dimitri John Ledkov
e9f4e97155
releasing package livecd-rootfs version 2.664.4 2020-07-23 19:12:30 +01:00
Dimitri John Ledkov
896b5962db
snap_preseed: support channel specification with snap name
snap_name[/classic]=track/risk/branch is now the supported snap name
specification, which allows to specify the full default track and
optional classic confinemnt.

Supporting such specification in the seedtext allows one to specify a
better default channel. For example, this will allow lxd to switch
from latest/stable/ubuntu-20.04 to 4.0/stable/ubuntu-20.04 as 4.0 is
the LTS track matching 20.04 support timeframe.

LP: #1882374

(cherry picked from commit 7bae9201d20822d6875bcf5949e1fff839b8774c)
(cherry picked from commit 2976a99f292c500f39aace25ad08de21b37d7b31)
(cherry picked from commit d542e8e4a08467ef9b6237b9fcbd9166c8c99e8b)
2020-07-23 19:06:57 +01:00
Łukasz 'sil2100' Zemczak
e39a40e2a5 releasing package livecd-rootfs version 2.664.3 2020-07-23 14:02:40 +02:00
Łukasz 'sil2100' Zemczak
8284a1c680 Sync changelog 2020-07-23 14:02:07 +02:00
Iain Lane
54508e6583
Hack seeding of linux kernel in ubuntustudio/focal
ubuntustudio-default-settings in focal release has a Recommends to this
kernel, which makes it impossible to update the kernel later on, since
we would install the -updates and release kernel, which isn't allowed
and causes FTBFS. Hack out the focal-release kernel and let the rest of
the build process pull in the right one.

LP: #1884915
2020-07-21 16:23:39 +01:00
Cody Shepherd
690522e89b
Remove explicit install of grub-efi-* package as it is not necessary,
and potentially overexplicit
2020-07-13 09:10:05 -07:00
Cody Shepherd
315a453ba6
Perform a dist-upgrade prior to installing packages for bootable-buildd
image in order to pull in package updates
2020-07-08 14:03:56 -07:00
Łukasz 'sil2100' Zemczak
e611dfc1c4 Enable overrides of UC20 grade dangerous channels 2020-05-25 18:44:08 +02:00
Philip Roche
cd098e7c41 Revert of initramfs package removal in KVM image (LP: #1880170)
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: #1880170
2020-05-22 13:38:22 +01:00
Łukasz 'sil2100' Zemczak
225f2fe504 Fix indentation. 2020-05-07 10:48:51 +02:00
Dimitri John Ledkov
0a2fbb8b99 releasing package livecd-rootfs version 2.664.1 2020-05-01 20:09:06 +01:00
Dimitri John Ledkov
54b8e73a15 ubuntu-image: drop ubuntu-image dep on riscv64, as not installable yet.
LP: #1876359
(cherry picked from commit 282c5a5bd50f9844cc077823b39550c663a013c3)
2020-05-01 20:08:14 +01:00
Dimitri John Ledkov
2d5f9581db ubuntu-image: fix focal+ pi images for armhf to use pi-armhf model name.
LP: #1876358
(cherry picked from commit 6e8b5b94c4a9f8db4afbaf566ebdb36110f08592)
2020-05-01 20:07:58 +01:00
Dimitri John Ledkov
dc456c240d Bump only the UC20 pc image to 8GB, and keep Pi images as small as possible.
LP: #1875430
(cherry picked from commit 668898d92c1a48ac4901661d0e5d7e4b117b09c0)
2020-05-01 20:07:46 +01:00
101 changed files with 1708 additions and 217 deletions

468
debian/changelog vendored
View File

@ -1,3 +1,471 @@
livecd-rootfs (2.664.53) focal; urgency=medium
[Catherine Redfield]
* add 5.15 apparmor directory for snap preseeding with 5.15 kernel
(LP: #2052789)
* bind correct apparmor feature for validating snap seed
(LP: #2059730)
-- Phil Roche <phil.roche@canonical.com> Fri, 09 Feb 2024 09:41:18 +0000
livecd-rootfs (2.664.52) focal; urgency=medium
* fix: use correct sshd_config.d/ ordering. (LP: #2049860)
-- Thomas Bechtold <thomas.bechtold@canonical.com> Mon, 22 Jan 2024 17:08:05 +0530
livecd-rootfs (2.664.51) focal; urgency=medium
[ Steve Langasek ]
* 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).
-- Phil Roche <phil.roche@canonical.com> Thu, 19 Oct 2023 18:17:20 +0100
livecd-rootfs (2.664.50) focal; urgency=medium
* Do not modify /etc/ssh/sshd_config for ubuntu-cpc
project builds. (LP: #1968873)
-- Thomas Bechtold <thomas.bechtold@canonical.com> Thu, 28 Sep 2023 13:16:46 +0200
livecd-rootfs (2.664.49) focal; urgency=medium
* Address the missing GRUB_DISTRIBUTOR issue. LP: #2034253
-- jchittum <john.chittum@canonical.com> Fri, 08 Sep 2023 08:35:15 -0500
livecd-rootfs (2.664.48) focal; urgency=medium
* Drop use of --removable flag to grub-install from
live-build/buildd/hooks/02-disk-image-uefi.binary, to match the cloud
images (7c760864fdcb278ca37396f06f5e3f297428d63d). This fixes
bootloader updates in the buildd images, but also fixes compatibility
with using devtmpfs for losetup.
-- Steve Langasek <steve.langasek@ubuntu.com> Fri, 19 May 2023 00:09:01 -0700
livecd-rootfs (2.664.47) focal; urgency=medium
* disk-image-uefi: bump armhf size. (LP: #2011739)
-- Simon Poirier <simon.poirier@canonical.com> Mon, 20 Mar 2023 19:19:05 -0400
livecd-rootfs (2.664.46) focal; urgency=medium
* Terrible hack workaround for clearing out the non-offline apt cache for
desktop related images. Backported from jammy.
-- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Thu, 16 Mar 2023 14:03:18 +0100
livecd-rootfs (2.664.45) focal; urgency=medium
[ Samir Akarioh ]
* feat: Add metadata on ubuntu-oci image. (LP: #1998229)
-- Utkarsh Gupta <utkarsh@ubuntu.com> Mon, 12 Dec 2022 15:33:48 +0530
livecd-rootfs (2.664.44) focal; urgency=medium
[ Michał Sawicz ]
* ubuntu-buildd: Add arm64 buildd bootable image. (LP: #1966636)
-- jchittum <john.chittum@canonical.com> Fri, 29 Jul 2022 09:57:57 +1200
livecd-rootfs (2.664.43) focal; urgency=medium
* ubuntu-cpc: Install `shim-signed` and `grub-efi-arm64-signed` to
enable secureboot on ARM64 images (LP: #1980358)
-- Ivan Kapelyukhin <ivan.kapelyukhin@canonical.com> Thu, 30 Jun 2022 14:06:30 +0200
livecd-rootfs (2.664.42) focal; urgency=medium
* Switch intel-iot to use intel-iotg-edge, the 5.15 based IOTG kernel
(LP: #1980065)
- While at it, build using the main kernel meta, not just with
linux-image-*
* Add support for building live-server images for intel-iot (LP: #1980067)
-- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Thu, 09 Jun 2022 16:46:37 +0200
livecd-rootfs (2.664.41) focal; urgency=medium
[ Ivan Kapelyukhin ]
* Split UEFI image out of `disk-image` series file into
`disk-image-uefi`. (LP: #1961760)
[ Thomas Bechtold ]
* Optionally (when ALLOW_CORE_SNAP env var is set) allow to install
core snap. Still needed by some CPC projects. (LP: #1964303)
-- Thomas Bechtold <thomas.bechtold@canonical.com> Fri, 04 Mar 2022 14:00:16 +0100
livecd-rootfs (2.664.40) focal; urgency=medium
* Unset `initrdless_boot_fallback_triggered` in /boot/grub/grubenv instead
of setting it to 0 when the fallback is not triggered to prevent integrity
monitoring errors on GCE. (LP: #1960564)
-- Ivan Kapelyukhin <ivan.kapelyukhin@canonical.com> Mon, 14 Feb 2022 21:32:01 +0100
livecd-rootfs (2.664.39) focal; urgency=medium
* Switch to building raspi classic images using the 'classic' branch instead
of '18'. This is needed for proper Pi Zero 2 support (LP: #1960950).
-- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Tue, 15 Feb 2022 18:59:05 +0100
livecd-rootfs (2.664.38) focal; urgency=medium
* Add sleep due to e2fsck error in umount_partition. LP: #1960537
-- Brian Murray <brian@ubuntu.com> Thu, 10 Feb 2022 15:41:28 -0800
livecd-rootfs (2.664.37) focal; urgency=medium
* Do not look for a base snap on snaps of type base, because recursive
dependencies are not allowed for snaps. LP: #1957123.
* 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.
-- Steve Langasek <steve.langasek@ubuntu.com> Tue, 18 Jan 2022 16:16:18 -0800
livecd-rootfs (2.664.36) focal; urgency=medium
* 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)
-- Michael Hudson-Doyle <michael.hudson@ubuntu.com> Thu, 02 Dec 2021 12:05:00 +1300
livecd-rootfs (2.664.35) focal; urgency=medium
[ Thomas Bechtold ]
* magic-proxy: fix exception handling for URLError (LP: #1946520)
-- Brian Murray <brian@ubuntu.com> Thu, 18 Nov 2021 15:42:45 -0800
livecd-rootfs (2.664.34) focal; urgency=medium
* 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. (LP: #1951173)
-- Brian Murray <brian@ubuntu.com> Tue, 16 Nov 2021 17:18:59 -0800
livecd-rootfs (2.664.33) focal; urgency=medium
* Install cloud-initramfs-growroot to actually enable rootfs resize.
* Fix a grub error by making sure the unicode.pf2 font is installed in the
right path for preinstalled amd64 desktop images.
-- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Fri, 29 Oct 2021 15:33:34 +0200
livecd-rootfs (2.664.32) focal; urgency=medium
* 099-ubuntu-image-customization.chroot: fix a typo in it.
-- Brian Murray <brian@ubuntu.com> Thu, 28 Oct 2021 11:12:32 -0700
livecd-rootfs (2.664.31) focal; urgency=medium
[ Łukasz 'sil2100' Zemczak ]
* Add the 099-ubuntu-image-customization.chroot for
desktop-preinstalled images similar to what we have in groovy+ (for the pi
desktop), but improved for amd64 platforms. We need it to generate a valid
grub.cfg on the rootfs (similar to ubuntu-cpc) and then use that instead
of a static configuration locked on the boot partition (LP: #1949102).
[ Brian Murray ]
* Properly check ARCH when setting the intel-iot model.
-- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Thu, 28 Oct 2021 17:35:12 +0200
livecd-rootfs (2.664.30) focal; urgency=medium
[ Thomas Bechtold ]
* magic-proxy: Replace http.client with urllib calls. live-build/auto/build:
change iptables calls to query rules and quickly check that connectivity
works after transparent proxy has been installed. (LP: #1917920)
* magic-proxy: fix TypeError when trying to call get_uri() (LP: #1944906)
-- Brian Murray <brian@ubuntu.com> Thu, 21 Oct 2021 11:55:24 -0700
livecd-rootfs (2.664.29) focal; urgency=medium
* Generate manifest for HyperV desktop image (LP: #1940136)
-- Jason C. McDonald <codemouse92@outlook.com> Wed, 15 Sep 2021 23:41:39 +1200
livecd-rootfs (2.664.28) focal; urgency=medium
[ Brian Murray ]
* Make sure we're using the 'classic' branch for the intel-iot gadget.
(LP: #1938338)
[ Łukasz 'sil2100' Zemczak ]
* Add support for passing SUBPROJECT to classic ubuntu-image calls. This
should fix running desktop-preinstalled builds. (LP: #1938338)
-- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Mon, 16 Aug 2021 13:02:23 +0200
livecd-rootfs (2.664.27) focal; urgency=medium
* And whoops, we missed adding ARCH in the SUBARCH ubuntu-image handling for
intel-iot.
-- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Wed, 04 Aug 2021 17:32:37 +0200
livecd-rootfs (2.664.26) focal; urgency=medium
* Revert previous change of fixing /dev sharing - this causes weird
autopkgtest issues.
-- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Mon, 02 Aug 2021 22:13:03 +0200
livecd-rootfs (2.664.25) focal; urgency=medium
[ Brian Murray ]
* Add support for creating images (ubuntu-core and classic) with a kernel
optimized for Intel IoT devices. (LP: #1938338)
[ Michael Hudson-Doyle ]
* 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)
[ Łukasz 'sil2100' Zemczak ]
* Fix sharing of the /dev tree to make sure we can safely umount the chroot
when needed. This fixes local non-livefs-builder image builds.
(LP: #1938414)
-- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Thu, 29 Jul 2021 11:05:58 +0200
livecd-rootfs (2.664.24) focal; urgency=medium
* Backport generalising of the riscv64 images from hirsute to support
building separate unmatched and unleashed images in focal (LP: #1932014)
-- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Tue, 15 Jun 2021 13:33:33 +0200
livecd-rootfs (2.664.23) focal; urgency=medium
* Adding dependencies for Active Directory support (LP: #1921374)
-- Jean-Baptiste Lallement <jean-baptiste.lallement@ubuntu.com> Thu, 20 May 2021 17:52:20 +0200
livecd-rootfs (2.664.22) focal; urgency=medium
* Add grub config to produce console output and install lxd-agent loader
to allow buildd vm images to work in lxd without requirement for manual
installation (LP: #1915571)
-- Cody Shepherd <cody.shepherd@canonical.com> Thu, 20 May 2021 17:07:01 -0700
livecd-rootfs (2.664.21) focal; urgency=medium
[ Thomas Bechtold ]
* Add a new ubuntu-oci project that contains the customizations currently
performed downstream for the official Ubuntu images on dockerhub.
(LP: #1926732)
-- Michael Hudson-Doyle <michael.hudson@ubuntu.com> Tue, 11 May 2021 11:38:16 +1200
livecd-rootfs (2.664.20) focal; urgency=medium
[ Gauthier Jolly ]
* ubuntu-cpc: secure esp mountpoint (LP: #1881006)
Change mount option for ubuntu-cpc images from "defaults" to "umask=0077"
ESP partitions might contain sensitive data and non-root users shouldn't
have read access on it.
-- Robert C Jennings <robert.jennings@canonical.com> Sat, 10 Apr 2021 05:20:11 -0500
livecd-rootfs (2.664.19) focal; urgency=medium
[ Patrick Viafore ]
* Fix broken minimal cloud image boot on amd64 LP: #1920043
-- Robert C Jennings <robert.jennings@canonical.com> Mon, 22 Mar 2021 10:57:50 -0500
livecd-rootfs (2.664.18) focal; urgency=medium
[ Patrick Viafore ]
* Only try without initrd-less on replaced kernels, not all kernels
* Provide a mechanism to detect initrd-less fallback (LP: #1870189)
-- Robert C Jennings <robert.jennings@canonical.com> Tue, 23 Feb 2021 14:45:23 -0600
livecd-rootfs (2.664.17) focal; urgency=medium
[ David Krauser ]
* buildd: produce kernel and initrd as separate artifacts LP: #1910557
* buildd: call update-initramfs for all installed kernels
We only have one kernel installed, so we don't need to
specify an explicit version. LP: #1910557
[ Dimitri John Ledkov ]
* esp: install grub in ubuntu bootloader id path, instead of removable.
(LP: #1912830)
* esp: perform fsck. (LP: #1912835)
* Perform fsck on all rootfs. (LP: #1912835)
* functions: stop removing systemd-detect-virt unconditionally in undivert_grub
(LP: #1902260)
-- Dimitri John Ledkov <xnox@ubuntu.com> Tue, 09 Feb 2021 00:52:00 +0000
livecd-rootfs (2.664.16) focal; urgency=medium
[ Cody Shepherd ]
* Produce manifests for buildd tarball images (LP: #1914445)
-- Robert C Jennings <robert.jennings@canonical.com> Fri, 05 Feb 2021 14:57:56 -0600
livecd-rootfs (2.664.15) focal; urgency=medium
* Properly handle lowlatency-hwe-* (LP: #1914217)
-- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Tue, 02 Feb 2021 11:39:11 +0100
livecd-rootfs (2.664.14) focal; urgency=medium
* Actually also enable the hwe kernel for all flavours for 20.04.2
(LP: #1914119)
-- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Mon, 01 Feb 2021 22:17:01 +0100
livecd-rootfs (2.664.13) focal; urgency=medium
* Enable the hwe variant for ubuntu-server-live (LP: #1913314)
-- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Tue, 26 Jan 2021 15:47:43 +0100
livecd-rootfs (2.664.12) focal; urgency=medium
* riscv64: backport HiFive unleashed & cloud-image building support
(LP: #1903034)
-- Dimitri John Ledkov <xnox@ubuntu.com> Fri, 15 Jan 2021 17:07:20 +0000
livecd-rootfs (2.664.10) focal; urgency=medium
* Do not hard-code the UC20 amd64 image size to 8GB as now ubuntu-image
should be able to properly calculate the needed size itself.
* But per discussion, we might want to keep the UC20 images a bit bigger than
what's defined via the gadget/rootfs contents, to make sure writable is
comfortably big enough. Use the same hard-coded value as for UC16 and UC18.
(LP: #1905990)
-- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Fri, 27 Nov 2020 17:58:38 +0100
livecd-rootfs (2.664.9) focal; urgency=medium
[ John Chittum]
* Backport Ensure toolsVersion set in vmdk header (LP: #1893898)
[ Dimitri John Ledkov & Joshua Powers ]
* amd64: always install grub-pc with shim-signed (LP: #1901906), and
ensure to autoremove packages
-- Robert C Jennings <robert.jennings@canonical.com> Fri, 20 Nov 2020 14:35:51 -0600
livecd-rootfs (2.664.8) focal; urgency=medium
Backport snap-preseed work from groovy to focal LP: #1896755
[ Robert C Jennings ]
* Apply snap-preseed optimizations after seeding snaps
[ Dimitri John Ledkov ]
* live-server: remove duplicate snaps, due to overlayfs vs snap-preseed.
* apparmor: Add generic v5.4 kernel apparmor features
* apparmor: mount more up-to-date apparmor features in the chroot.
* seccomp: add more up-to-date seccomp actions
* seccomp: mount more up-to-date seccomp features
* apparmor: compile all profiles
[ Robert C Jennings ]
* Avoid rbind /sys for chroot snap pre-seeding (cgroups fail to unmount)
[ Dimitri John Ledkov ]
* auto/build: use setup|teardown_mountpoint to reduce duplication
* functions: provide nss_systemd-less nsswitch.conf in chroots.
-- Dimitri John Ledkov <xnox@ubuntu.com> Mon, 05 Oct 2020 10:33:02 +0100
livecd-rootfs (2.664.7) focal; urgency=medium
[ Stanislav German-Evtushenko <giner> / John Chittum ]
* Send Vagrant serial connection to NULL. (LP: #1874453)
-- Robert C Jennings <robert.jennings@canonical.com> Wed, 23 Sep 2020 13:32:32 -0500
livecd-rootfs (2.664.6) focal; urgency=medium
[ Patrick Wu ]
* Fix xrdp support in hyper-v images. LP: #1890980.
-- Steve Langasek <steve.langasek@ubuntu.com> Wed, 26 Aug 2020 14:06:31 -0700
livecd-rootfs (2.664.5) focal; urgency=medium
[ Robert C Jennings ]
* Handle seeded lxd snap with channel name for ubuntu-cpc:minimized
(LP: #1889470)
[ Cody Shepherd ]
* Add dist-upgrade to bootable-buildd hook to ensure the built image
doesn't contain vulnerable kernels or other packages. LP: #1891061.
* Don't explicitly install grub-efi-amd64-signed, it's a dependency of
shim-signed.
-- Steve Langasek <steve.langasek@ubuntu.com> Tue, 04 Aug 2020 12:39:27 -0700
livecd-rootfs (2.664.4) focal; urgency=medium
* snap_preseed: support channel specification with snap name (LP: #1882374)
-- Dimitri John Ledkov <xnox@ubuntu.com> Thu, 23 Jul 2020 19:12:10 +0100
livecd-rootfs (2.664.3) focal; urgency=medium
[ Łukasz 'sil2100' Zemczak ]
* Enable overrides of UC20 grade dangerous channels - as this is possible.
(LP: #1879350)
[ Iain Lane ]
* Hack seeding of linux kernel in ubuntustudio/focal
ubuntustudio-default-settings in focal release has a Recommends to this
kernel, which makes it impossible to update the kernel later on, since we
would install the -updates and release kernel, which isn't allowed and
causes FTBFS. Hack out the focal-release kernel and let the rest of the
build process pull in the right one. (LP: #1884915)
-- Iain Lane <iain.lane@canonical.com> Tue, 21 Jul 2020 16:25:18 +0100
livecd-rootfs (2.664.2) focal; urgency=medium
* Revert of initramfs package removal in KVM image (LP: #1880170)
-- Phil Roche <phil.roche@canonical.com> Fri, 22 May 2020 13:03:20 +0100
livecd-rootfs (2.664.1) focal; urgency=medium
* Bump only the UC20 pc image to 8GB, and keep Pi images as small as possible.
(LP: #1875430)
* ubuntu-image: fix focal+ pi images for armhf to use pi-armhf model name.
(LP: #1876358)
* ubuntu-image: drop ubuntu-image dep on riscv64, as not installable yet.
(LP: #1876359)
-- Dimitri John Ledkov <xnox@ubuntu.com> Fri, 01 May 2020 20:08:23 +0100
livecd-rootfs (2.664) focal; urgency=medium
[ Patrick Viafore ]

6
debian/control vendored
View File

@ -32,13 +32,13 @@ Depends: ${misc:Depends},
python3-apt,
python3-software-properties,
python3-yaml,
qemu-utils [!i386 !riscv64],
qemu-utils [!i386],
rsync,
snapd (>= 2.39) [!i386 !riscv64],
snapd (>= 2.39) [!i386],
squashfs-tools (>= 1:3.3-1),
sudo,
u-boot-tools [armhf arm64],
ubuntu-image [!i386],
ubuntu-image [!i386 !riscv64],
python3-vmdkstream [amd64 i386],
xz-utils,
zerofree

View File

@ -0,0 +1 @@
0xffffff

View File

@ -0,0 +1 @@
chown dac_override dac_read_search fowner fsetid kill setgid setuid setpcap linux_immutable net_bind_service net_broadcast net_admin net_raw ipc_lock ipc_owner sys_module sys_rawio sys_chroot sys_ptrace sys_pacct sys_admin sys_boot sys_nice sys_resource sys_time sys_tty_config mknod lease audit_write audit_control setfcap mac_override mac_admin syslog wake_alarm block_suspend audit_read

View File

@ -0,0 +1 @@
acquire send receive

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
1.2

View File

@ -0,0 +1 @@
create read write exec append mmap_exec link lock

View File

@ -0,0 +1 @@
create read write open delete setattr getattr

View File

@ -0,0 +1 @@
mount umount pivot_root

View File

@ -0,0 +1 @@
no

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
unspec unix inet ax25 ipx appletalk netrom bridge atmpvc x25 inet6 rose netbeui security key netlink packet ash econet atmsvc rds sna irda pppox wanpipe llc ib mpls can tipc bluetooth iucv rxrpc isdn phonet ieee802154 caif alg nfc vsock kcm qipcrtr smc xdp

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
unspec unix inet ax25 ipx appletalk netrom bridge atmpvc x25 inet6 rose netbeui security key netlink packet ash econet atmsvc rds sna irda pppox wanpipe llc ib mpls can tipc bluetooth iucv rxrpc isdn phonet ieee802154 caif alg nfc vsock kcm qipcrtr smc xdp

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
read trace

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
allow deny audit quiet

View File

@ -0,0 +1 @@
cpu fsize data stack core rss nproc nofile memlock as locks sigpending msgqueue nice rtprio rttime

View File

@ -0,0 +1 @@
hup int quit ill trap abrt bus fpe kill usr1 segv usr2 pipe alrm term stkflt chld cont stop stp ttin ttou urg xcpu xfsz vtalrm prof winch io pwr sys emt lost

View File

@ -0,0 +1,78 @@
query {label {multi_transaction {yes
}
data {yes
}
perms {allow deny audit quiet
}
}
}
dbus {mask {acquire send receive
}
}
signal {mask {hup int quit ill trap abrt bus fpe kill usr1 segv usr2 pipe alrm term stkflt chld cont stop stp ttin ttou urg xcpu xfsz vtalrm prof winch io pwr sys emt lost
}
}
ptrace {mask {read trace
}
}
caps {mask {chown dac_override dac_read_search fowner fsetid kill setgid setuid setpcap linux_immutable net_bind_service net_broadcast net_admin net_raw ipc_lock ipc_owner sys_module sys_rawio sys_chroot sys_ptrace sys_pacct sys_admin sys_boot sys_nice sys_resource sys_time sys_tty_config mknod lease audit_write audit_control setfcap mac_override mac_admin syslog wake_alarm block_suspend audit_read
}
}
rlimit {mask {cpu fsize data stack core rss nproc nofile memlock as locks sigpending msgqueue nice rtprio rttime
}
}
capability {0xffffff
}
namespaces {pivot_root {no
}
profile {yes
}
}
mount {mask {mount umount pivot_root
}
}
network {af_unix {yes
}
af_mask {unspec unix inet ax25 ipx appletalk netrom bridge atmpvc x25 inet6 rose netbeui security key netlink packet ash econet atmsvc rds sna irda pppox wanpipe llc ib mpls can tipc bluetooth iucv rxrpc isdn phonet ieee802154 caif alg nfc vsock kcm qipcrtr smc xdp
}
}
network_v8 {af_mask {unspec unix inet ax25 ipx appletalk netrom bridge atmpvc x25 inet6 rose netbeui security key netlink packet ash econet atmsvc rds sna irda pppox wanpipe llc ib mpls can tipc bluetooth iucv rxrpc isdn phonet ieee802154 caif alg nfc vsock kcm qipcrtr smc xdp
}
}
file {mask {create read write exec append mmap_exec link lock
}
}
domain {version {1.2
}
attach_conditions {xattr {yes
}
}
computed_longest_left {yes
}
post_nnp_subset {yes
}
fix_binfmt_elf_mmap {yes
}
stack {yes
}
change_profile {yes
}
change_onexec {yes
}
change_hatv {yes
}
change_hat {yes
}
}
policy {set_load {yes
}
versions {v8 {yes
}
v7 {yes
}
v6 {yes
}
v5 {yes
}
}
}

View File

@ -0,0 +1 @@
0xffffff

View File

@ -0,0 +1 @@
chown dac_override dac_read_search fowner fsetid kill setgid setuid setpcap linux_immutable net_bind_service net_broadcast net_admin net_raw ipc_lock ipc_owner sys_module sys_rawio sys_chroot sys_ptrace sys_pacct sys_admin sys_boot sys_nice sys_resource sys_time sys_tty_config mknod lease audit_write audit_control setfcap mac_override mac_admin syslog wake_alarm block_suspend audit_read

View File

@ -0,0 +1 @@
acquire send receive

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
1.2

View File

@ -0,0 +1 @@
create read write exec append mmap_exec link lock

View File

@ -0,0 +1 @@
mount umount pivot_root

View File

@ -0,0 +1 @@
no

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
unspec unix inet ax25 ipx appletalk netrom bridge atmpvc x25 inet6 rose netbeui security key netlink packet ash econet atmsvc rds sna irda pppox wanpipe llc ib mpls can tipc bluetooth iucv rxrpc isdn phonet ieee802154 caif alg nfc vsock kcm qipcrtr smc xdp

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
unspec unix inet ax25 ipx appletalk netrom bridge atmpvc x25 inet6 rose netbeui security key netlink packet ash econet atmsvc rds sna irda pppox wanpipe llc ib mpls can tipc bluetooth iucv rxrpc isdn phonet ieee802154 caif alg nfc vsock kcm qipcrtr smc xdp

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
read trace

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
yes

View File

@ -0,0 +1 @@
allow deny audit quiet

View File

@ -0,0 +1 @@
cpu fsize data stack core rss nproc nofile memlock as locks sigpending msgqueue nice rtprio rttime

View File

@ -0,0 +1 @@
hup int quit ill trap abrt bus fpe kill usr1 segv usr2 pipe alrm term stkflt chld cont stop stp ttin ttou urg xcpu xfsz vtalrm prof winch io pwr sys emt lost

View File

@ -35,6 +35,18 @@ run_iptables () {
kver="${kver#*.}"
kver_minor="${kver%%.*}"
# LP: #1917920
# I'm seeing issues after iptables got upgraded from 1.8.5 to
# 1.8.7 Somehow installing our nat rule doesn't get activated, and
# no networking is happening at all.
# But somehow calling both iptables -S makes things start working.
# Maybe no default chains are installed in our network namespace?!
# Or 1.8.7 is somehow broken?
iptables -v -t nat -S
iptables-legacy -v -t nat -S
if [ "$kver_major" -lt 4 ] || \
([ "$kver_major" = 4 ] && [ "$kver_minor" -lt 15 ]); then
iptables-legacy "$@"
@ -52,10 +64,11 @@ if [ -n "$REPO_SNAPSHOT_STAMP" ]; then
apt-get -qyy install iptables
# Redirect all outgoing traffic to port 80 to proxy instead.
run_iptables -t nat -A OUTPUT -p tcp --dport 80 \
run_iptables -v -t nat -A OUTPUT -p tcp --dport 80 \
-m owner ! --uid-owner daemon -j REDIRECT --to 8080
# Run proxy as "daemon" to avoid infinite loop.
LB_PARENT_MIRROR_BOOTSTRAP=$LB_PARENT_MIRROR_BOOTSTRAP \
/usr/share/livecd-rootfs/magic-proxy \
--address="127.0.0.1" \
--port=8080 \
@ -65,6 +78,9 @@ if [ -n "$REPO_SNAPSHOT_STAMP" ]; then
--pid-file=config/magic-proxy.pid \
--background \
--setsid
# Quick check that magic proxy & iptables chains are working
timeout 3m apt-get update
fi
# Link output files somewhere launchpad-buildd will be able to find them.
@ -106,14 +122,17 @@ fi
Setup_cleanup
preinstall_snaps() {
lb chroot_resolv install
setup_mountpoint chroot
snap_prepare chroot
for snap in "$@"; do
SNAP_NO_VALIDATE_SEED=1 snap_preseed chroot "${snap}"
done
snap_validate_seed chroot
lb chroot_resolv remove
teardown_mountpoint chroot
}
rm -f binary.success
@ -242,7 +261,7 @@ if [ "$(dpkg-divert --truename /usr/bin/man)" = "/usr/bin/man.REAL" ]; then
fi
EOF
if [ "$PROJECT" != "ubuntu-base" ]; then
if [ "$PROJECT" != "ubuntu-base" ] && [ "$PROJECT" != "ubuntu-oci" ]; then
# ubuntu-minimal is too much for a docker container (it contains
# systemd and other things)
cat >> chroot/usr/local/sbin/unminimize <<'EOF'
@ -438,6 +457,15 @@ serial: $BUILDSTAMP
EOF
fi
if [ "$PROJECT" = "ubuntu-oci" ]; then
if [ -n "$BUILDSTAMP" ]; then
configure_oci chroot "$BUILDSTAMP"
else
echo "The \$BUILDSTAMP variable is empty"
exit 1
fi
fi
configure_network_manager
echo "===== Checking size of /usr/share/doc ====="
@ -450,6 +478,18 @@ EOF
clean_debian_chroot
fi
# XXX: Terrible last-minute hack to work-around issue LP: #2008082 !
# This basically needs to be done better, we simply need to make sure
# that we don't update the cache after lb cleans up. Since identifying
# that might take a moment, for now, for flavors that are generally
# affected by this, we manually clear out the archive-related Packages
# files in the cache.
case $PROJECT in
ubuntu|xubuntu|kubuntu|ubuntu-budgie|ubuntukylin|ubuntu-mate|ubuntustudio)
rm -f chroot/var/lib/apt/lists/*ubuntu.com*_Packages
;;
esac
if [ -n "${PASSES}" ]; then
PATH="config/:$PATH" lb binary_layered "$@"
else
@ -823,9 +863,18 @@ for FLAVOUR in $LB_LINUX_FLAVOURS; do
virtual|generic-hwe-*)
FLAVOUR="generic"
;;
lowlatency-hwe-*)
FLAVOUR="lowlatency"
;;
oem-*)
FLAVOUR="oem"
;;
image-intel)
FLAVOUR="intel"
;;
intel-iotg*)
FLAVOUR="intel-iotg"
;;
esac
KVERS="$( (cd "binary/$INITFS"; ls vmlinu?-* 2>/dev/null || true) | (fgrep -v .efi || true) | sed -n "s/^vmlinu.-\\([^-]*-[^-]*-$FLAVOUR\\)$/\\1/p" )"
if [ -z "$KVERS" ]; then

View File

@ -280,7 +280,7 @@ if [ -z "${IMAGEFORMAT:-}" ]; then
case $PROJECT:${SUBPROJECT:-} in
ubuntu-cpc:*|ubuntu:desktop-preinstalled)
case $SUBARCH in
raspi|imx6)
raspi|imx6|intel-iot)
IMAGEFORMAT=ubuntu-image
;;
*)
@ -320,6 +320,8 @@ case $IMAGEFORMAT in
ubuntu-image)
UBUNTU_IMAGE_ARGS=""
case "$ARCH+${SUBARCH:-}" in
amd64+intel-iot)
MODEL=intel-iot ;;
amd64+*)
MODEL=pc-amd64 ;;
i386+*)
@ -359,8 +361,10 @@ case $IMAGEFORMAT in
CHANNEL="${CHANNEL:-edge}"
case $MODEL in
pc-amd64|pc-i386)
[ -z "${SUBARCH:-}" ] \
&& UBUNTU_IMAGE_ARGS="$UBUNTU_IMAGE_ARGS --image-size 3700M"
if [ -z "${SUBARCH:-}" ]; then
# This is to make sure there's enough writable space
UBUNTU_IMAGE_ARGS="$UBUNTU_IMAGE_ARGS --image-size 3700M"
fi
;;
*) ;;
esac
@ -375,7 +379,9 @@ case $IMAGEFORMAT in
UBUNTU_IMAGE_ARGS="$UBUNTU_IMAGE_ARGS -c $CHANNEL"
;;
*)
UBUNTU_IMAGE_ARGS="--image-size 10G"
if [ "${MODEL}" = "pi" ]; then
MODEL=pi-armhf
fi
# Ubuntu Core 20
# Currently uc20 assertions do not support global
# channel overrides, instead we have per-channel models
@ -386,6 +392,15 @@ case $IMAGEFORMAT in
candidate|beta|edge|dangerous)
MODEL="ubuntu-core-20-${MODEL#pc-}-${CHANNEL}"
;;
dangerous-*)
# That being said, the dangerous grade *does*
# support channel overrides, so we can use the
# dangerous model assertion and override the channel
# freely.
MODEL="ubuntu-core-20-${MODEL#pc-}-dangerous"
CHANNEL=${CHANNEL#dangerous-}
UBUNTU_IMAGE_ARGS="$UBUNTU_IMAGE_ARGS -c $CHANNEL"
;;
*)
echo "Unknown CHANNEL ${CHANNEL} specification for ${SUITE}"
exit 1
@ -414,24 +429,24 @@ case $IMAGEFORMAT in
# classic images
# Certain models have different names but are built from the same source gadget tree
BRANCH=18
BRANCH=classic
case $MODEL in
pi-arm64|pi3-arm64)
MODEL=pi
BRANCH=18-arm64
;;
pi)
BRANCH=18-armhf
intel-iot)
MODEL=pc
;;
esac
UBUNTU_IMAGE_ARGS="$UBUNTU_IMAGE_ARGS${SUBPROJECT:+ --subproject \"$SUBPROJECT\"}"
UBUNTU_IMAGE_ARGS="$UBUNTU_IMAGE_ARGS${PROPOSED:+ --with-proposed}"
UBUNTU_IMAGE_ARGS="$UBUNTU_IMAGE_ARGS${EXTRA_PPAS:+ --extra-ppas \"$EXTRA_PPAS\"}"
# We need to look in two places for the gadget tree:
# - Launchpad hosted gadgets will be in the snap-gadget repo
# - Github hosted gadgets are mirrored into a github-mirror repo
git clone git://git.launchpad.net/~canonical-foundations/snap-$MODEL/+git/snap-$MODEL -b $BRANCH config/$PREFIX-gadget || git clone git://git.launchpad.net/~canonical-foundations/snap-$MODEL/+git/github-mirror -b $BRANCH config/$PREFIX-gadget
git clone git://git.launchpad.net/~canonical-foundations/snap-$MODEL/+git/snap-$MODEL -b $BRANCH config/$PREFIX-gadget || git clone git://git.launchpad.net/~canonical-foundations/snap-$MODEL/+git/github-mirror -b $BRANCH config/$PREFIX-gadget || git clone git://git.launchpad.net/~canonical-foundations/snap-$MODEL/+git/github-mirror-$ARCH -b $BRANCH config/$PREFIX-gadget
echo "IMAGEFORMAT=$IMAGEFORMAT" >> config/common
echo "SUITE=$SUITE" >> config/common
@ -493,7 +508,7 @@ if [ "$PREINSTALLED" = "true" ]; then
ubuntu-server)
add_package live oem-config-debconf ubiquity-frontend-debconf
;;
ubuntu-core|ubuntu-base|base|ubuntu-cpc)
ubuntu-core|ubuntu-base|ubuntu-oci|base|ubuntu-cpc)
;;
ubuntu)
add_package live oem-config-gtk ubiquity-frontend-gtk
@ -577,11 +592,31 @@ case $PROJECT in
remove_packages_from_seed_regexp minimal.standard desktop-default-languages '^desktop-(?!default-languages|minimal|common)[^.]+$'
remove_packages_from_seed_regexp minimal.standard desktop-default-languages '' # none (if no default langpack is selected)
;;
desktop-preinstalled)
add_task install minimal standard ubuntu-desktop
if [ "$SUBARCH" = "intel-iot" ]; then
# Since for non-pi we don't have any seeds yet but we want to be able to
# grow the rootfs, manually install cloud-initramfs-growroot during build
add_package install cloud-initramfs-growroot
KERNEL_FLAVOURS='intel-iotg-edge'
COMPONENTS='main restricted'
OPTS="${OPTS:+$OPTS }--initramfs=none"
OPTS="${OPTS:+$OPTS }--system=normal"
OPTS="${OPTS:+$OPTS }--hdd-label=cloudimg-rootfs"
OPTS="${OPTS:+$OPTS }--ext-resize-blocks=536870912 --ext-block-size=4096"
OPTS="${OPTS:+$OPTS }--ext-fudge-factor=15"
fi
;;
*)
LIVE_TASK='ubuntu-live'
add_task install minimal standard ubuntu-desktop
add_task live ubuntu-desktop-minimal-default-languages ubuntu-desktop-default-languages
KERNEL_FLAVOURS='generic-hwe-20.04'
if [ "$SUBARCH" = "intel-iot" ]; then
KERNEL_FLAVOURS='intel-iotg-edge'
COMPONENTS='main restricted'
fi
;;
esac
;;
@ -592,6 +627,7 @@ case $PROJECT in
LIVE_TASK='kubuntu-live'
COMPONENTS='main restricted universe'
add_chroot_hook remove-gnome-icon-cache
KERNEL_FLAVOURS='generic-hwe-20.04'
;;
kubuntu-active)
@ -624,9 +660,7 @@ case $PROJECT in
add_package install xterm
LIVE_TASK='xubuntu-live'
COMPONENTS='main restricted universe multiverse'
case $ARCH in
amd64|i386) KERNEL_FLAVOURS=generic ;;
esac
KERNEL_FLAVOURS='generic-hwe-20.04'
;;
ubuntu-netbook)
@ -644,9 +678,7 @@ case $PROJECT in
add_task install minimal standard lubuntu-desktop
LIVE_TASK='lubuntu-live'
COMPONENTS='main restricted universe multiverse'
case $ARCH in
amd64|i386) KERNEL_FLAVOURS=generic ;;
esac
KERNEL_FLAVOURS='generic-hwe-20.04'
;;
ubuntu-gnome)
@ -659,20 +691,37 @@ case $PROJECT in
add_task install minimal standard ubuntu-budgie-desktop
LIVE_TASK='ubuntu-budgie-live'
COMPONENTS='main restricted universe'
KERNEL_FLAVOURS='generic-hwe-20.04'
;;
ubuntu-mate)
add_task install minimal standard ubuntu-mate-core ubuntu-mate-desktop
LIVE_TASK='ubuntu-mate-live'
COMPONENTS='main restricted universe multiverse'
KERNEL_FLAVOURS='generic-hwe-20.04'
;;
ubuntustudio-dvd)
add_task install minimal standard ubuntustudio-desktop ubuntustudio-audio ubuntustudio-fonts ubuntustudio-graphics ubuntustudio-video ubuntustudio-publishing ubuntustudio-photography
COMPONENTS='main restricted universe multiverse'
case $ARCH in
amd64|i386) KERNEL_FLAVOURS=lowlatency ;;
case $SUITE in
focal)
# ubuntustudio-default-settings in focal
# release has a Recommends to this kernel,
# which makes it impossible to update the
# kernel later on, since we would install the
# -updates and release kernel, which isn't
# allowed and causes the squashfs to fail to
# build. Hack out the focal-release kernel and
# let the rest of the build process pull in the
# right one. (See right below.)
for package in linux-lowlatency linux-image-lowlatency linux-headers-lowlatency linux-image-5.4.0-26-lowlatency linux-headers-5.4.0-26-lowlatency; do
sed -i "s/$/ -a --not -XFPackage ${package}/" \
"config/package-lists/livecd-rootfs.list.chroot_install"
done
;;
esac
COMPONENTS='main restricted universe multiverse'
KERNEL_FLAVOURS='lowlatency-hwe-20.04'
;;
ubuntukylin)
@ -680,6 +729,7 @@ case $PROJECT in
add_package install ubuntukylin-default-settings
LIVE_TASK='ubuntukylin-live'
COMPONENTS='main restricted universe'
KERNEL_FLAVOURS='generic-hwe-20.04'
;;
base)
@ -696,6 +746,10 @@ case $PROJECT in
;;
esac
COMPONENTS='main'
if [ "$SUBARCH" = "intel-iot" ]; then
KERNEL_FLAVOURS='intel-iotg-edge'
COMPONENTS='main restricted'
fi
PREINSTALL_POOL_SEEDS='server-ship'
;;
@ -739,8 +793,7 @@ case $PROJECT in
add_package install grub-pc
;;
amd64)
add_package install grub-pc-bin
add_package install grub-efi-amd64-signed
add_package install grub-pc
add_package install shim-signed
;;
esac
@ -758,21 +811,19 @@ case $PROJECT in
OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal"
;;
ubuntu-oci)
OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal"
;;
ubuntu-cpc)
KERNEL_FLAVOURS=virtual
if [ "${SUBPROJECT:-}" = minimized ]; then
add_task install cloud-image
add_package install sudo lxd-installer
# linux-kvm currently only exists for amd64, so fall back to the
# virtual flavour for other architectures
if [ "$ARCH" = "amd64" ]; then
KERNEL_FLAVOURS=kvm
else
KERNEL_FLAVOURS=virtual
fi
else
add_task install minimal standard cloud-image
add_package install ubuntu-minimal
KERNEL_FLAVOURS=virtual
case $ARCH in
armhf|arm64|ppc64el|powerpc)
add_task install server
@ -790,6 +841,18 @@ case $PROJECT in
arm64)
add_package install flash-kernel
;;
amd64*)
if [ "${SUBARCH:-}" = "intel-iot" ]; then
KERNEL_FLAVOURS=intel-iotg-edge
COMPONENTS='main restricted'
OPTS="${OPTS:+$OPTS }--initramfs=none"
fi
;;
riscv64)
if [ -n "$SUBARCH" ]; then
KERNEL_FLAVOURS=generic
fi
;;
esac
OPTS="${OPTS:+$OPTS }--system=normal"
OPTS="${OPTS:+$OPTS }--hdd-label=cloudimg-rootfs"
@ -858,7 +921,7 @@ if [ "$PROJECT:${SUBPROJECT:-}" = ubuntu-cpc:minimized ]; then
# build if we see such a snap.
for snap in `cat config/seeded-snaps`; do
case $snap in
lxd)
lxd | lxd=*)
;;
*)
echo "Unexpected seeded snap for ubuntu-cpc:minimized build: $snap"
@ -925,7 +988,7 @@ case $ARCH in
esac
case $PROJECT:${SUBPROJECT:-} in
ubuntu-server:*|ubuntu-base:*)
ubuntu-server:*|ubuntu-base:*|ubuntu-oci:*)
OPTS="${OPTS:+$OPTS }--linux-packages=none --initramfs=none"
KERNEL_FLAVOURS=none
BINARY_REMOVE_LINUX=false
@ -944,6 +1007,15 @@ case $PROJECT in
_)
add_chroot_hook remove-python-py
;;
amd64)
KERNEL_FLAVOURS="${SUBARCH:-$KERNEL_FLAVOURS}"
case $SUBARCH in
intel-iot)
COMPONENTS='main restricted'
KERNEL_FLAVOURS='intel-iotg-edge'
;;
esac
;;
esac
lb config noauto \
@ -992,7 +1064,7 @@ echo "SUBPROJECT=\"${SUBPROJECT:-}\"" >> config/binary
echo "LB_DISTRIBUTION=\"$SUITE\"" >> config/binary
case $PROJECT in
ubuntu-cpc|ubuntu-core|ubuntu-base|base)
ubuntu-cpc|ubuntu-core|ubuntu-base|ubuntu-oci|base)
# ubuntu-cpc gets this added in 025-create-groups.chroot, and we do
# not want this group in projects that are effectively just chroots
;;
@ -1086,6 +1158,26 @@ EOF
;;
esac
if [ $PROJECT = ubuntu ]; then
cat > config/hooks/001-active-directory.chroot <<EOF
#!/bin/sh
set -e
echo "I: Adding dependencies for Active Directory support (Workaround LP: #1921862)"
apt-get -y update
apt-get -y install sssd realmd adcli krb5-config
echo "I: Removing /var/lib/apt/lists/*"
find /var/lib/apt/lists/ -type f | xargs rm -f
echo "I: Removing /var/cache/apt/*.bin"
rm -f /var/cache/apt/*.bin/
EOF
fi
if [ $PROJECT = ubuntu-server ] && [ "${SUBPROJECT:-}" != live ]; then
cat > config/hooks/100-remove-fstab.chroot <<EOF
#! /bin/sh

View File

@ -1,7 +1,7 @@
#!/bin/bash -eux
case $ARCH in
amd64)
amd64|arm64)
;;
*)
echo "We don't create EFI images for $ARCH."
@ -49,7 +49,7 @@ create_and_mount_uefi_partition() {
mount "${uefi_dev}" "$mountpoint"/boot/efi
cat << EOF >> "mountpoint/etc/fstab"
LABEL=UEFI /boot/efi vfat defaults 0 0
LABEL=UEFI /boot/efi vfat defaults 0 1
EOF
}
@ -84,8 +84,7 @@ install_grub() {
efi_target=arm-efi
;;
amd64)
chroot mountpoint apt-get install -qqy grub-pc
chroot mountpoint apt-get install -qqy grub-efi-amd64-signed shim-signed
chroot mountpoint apt-get install -qqy grub-pc shim-signed
efi_target=x86_64-efi
;;
esac
@ -99,23 +98,24 @@ install_grub() {
# snap listings)
chroot mountpoint dpkg-query -W > binary/boot/filesystem.packages
cat > mountpoint/etc/default/grub.d/50-builddimg-settings.cfg << EOF
GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0.1
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=0.1
GRUB_CMDLINE_LINUX_DEFAULT="console=ttyS0"
GRUB_RECORDFAIL_TIMEOUT=0
GRUB_TERMINAL=console
GRUB_DISTRIBUTOR=Ubuntu
EOF
chroot mountpoint grub-install "${loop_device}" \
--boot-directory=/boot \
--efi-directory=/boot/efi \
--target=${efi_target} \
--removable \
--uefi-secure-boot \
--no-nvram
if [ -f mountpoint/boot/efi/EFI/BOOT/grub.cfg ]; then
sed -i "s| root| root hd0,gpt1|" mountpoint/boot/efi/EFI/BOOT/grub.cfg
sed -i "1i${IMAGE_STR}" mountpoint/boot/efi/EFI/BOOT/grub.cfg
# For some reason the grub disk is looking for /boot/grub/grub.cfg on
# part 15....
chroot mountpoint mkdir -p /boot/efi/boot/grub
chroot mountpoint cp /boot/efi/EFI/BOOT/grub.cfg /boot/efi/boot/grub
fi
if [ "$ARCH" = "amd64" ]; then
# Install the BIOS/GPT bits. Since GPT boots from the ESP partition,
# it means that we just run this simple command and we're done

View File

@ -4,6 +4,10 @@
# ourselves.
set -e
. config/functions
create_manifest chroot "livecd.$PROJECT.rootfs.manifest"
# gzip was chosen for fastest decompression speed: it decompresses buildd
# chroots about twice as fast as xz and about five times as fast as bzip2.
tar --transform='s,^chroot,chroot-autobuild,' --sort=name --numeric-owner \

View File

@ -3,12 +3,16 @@
set -e
. config/bootstrap
. config/functions
TMPDIR="$(mktemp -d)"
config/make-lxd-metadata "${LB_DISTRIBUTION%-*}" "$ARCH" \
>"$TMPDIR/metadata.yaml"
tar --numeric-owner -cf "livecd.$PROJECT.lxd.tar" -C "$TMPDIR" metadata.yaml
rm -rf "$TMPDIR"
create_manifest chroot "livecd.$PROJECT.lxd.manifest"
# When using the combined metadata/rootfs form, the rootfs must be under
# rootfs/ rather than under chroot-autobuild/.
tar --transform='s,^chroot,rootfs,' --sort=name --numeric-owner \

View File

@ -5,7 +5,7 @@
#
case $ARCH in
amd64)
amd64|arm64)
;;
*)
echo "We don't build bootable Buildd images for $ARCH."
@ -39,9 +39,13 @@ trap cleanup_linux_virtual EXIT
# Install dependencies
env DEBIAN_FRONTEND=noninteractive chroot "$mount_d" apt-get \
update --assume-yes
# Perform a dist-upgrade to pull in package updates
env DEBIAN_FRONTEND=noninteractive chroot "$mount_d" apt-get \
dist-upgrade --assume-yes
env DEBIAN_FRONTEND=noninteractive chroot "$mount_d" apt-get \
install -y lsb-release locales initramfs-tools busybox-initramfs \
udev dbus netplan.io cloud-init openssh-server sudo snapd
udev dbus netplan.io cloud-init openssh-server sudo snapd \
lxd-agent-loader
# Install a kernel
divert_grub "$mount_d"
@ -53,8 +57,11 @@ chroot "$mount_d" update-grub
undivert_grub "$mount_d"
# Update initramfs image
chroot "$mount_d" \
sh -c 'update-initramfs -c -v -k $(ls /boot/vmlinuz*generic | sed 1q | cut -d- -f2-3)'
chroot "$mount_d" update-initramfs -c -v -k all
# extract kernel and initrd
cp $mount_d/boot/initrd.img-* livecd.$PROJECT.initrd-generic
cp $mount_d/boot/vmlinuz-* livecd.$PROJECT.vmlinuz-generic
# Cleanup
env DEBIAN_FRONTEND=noninteractive chroot "$mount_d" apt-get \

View File

@ -0,0 +1,8 @@
# NB! This is a sample, copy to "meta-data" and modify to take effect
# NB! Also see user-data.sample and network-config.sample
# This is the meta-data configuration file for cloud-init. Typically this just
# contains the instance_id. Please refer to the cloud-init documentation for
# more information:
#
# https://cloudinit.readthedocs.io/

View File

@ -0,0 +1,52 @@
# NB! This is a sample, copy to "network-config" and mofiy to take effect
# NB! Also see user-data.sample and meta-data.sample
# This file contains a netplan-compatible configuration which cloud-init will
# apply on first-boot (note: it will *not* update the config after the first
# boot). Please refer to the cloud-init documentation and the netplan reference
# for full details:
#
# https://cloudinit.readthedocs.io/en/latest/topics/network-config.html
# https://cloudinit.readthedocs.io/en/latest/topics/network-config-format-v2.html
# https://netplan.io/reference
#
# Please note that the YAML format employed by this file is sensitive to
# differences in whitespace; if you are editing this file in an editor (like
# Notepad) which uses literal tabs, take care to only use spaces for
# indentation. See the following link for more details:
#
# https://en.wikipedia.org/wiki/YAML
#
#
# The image has stock nocloud-net configuration that will attemp dhcp
# v4 on all ethernet devices, similar to zz-all-en / zz-all-eth
# stanzas below. Hence this file is optional.
#
#version: 2
#ethernets:
# zz-all-en:
# match:
# name: "en*"
# dhcp4: true
# optional: true
# zz-all-eth:
# match:
# name: "eth*"
# dhcp4: true
# optional: true
#wifis:
# wlan0:
# dhcp4: true
# optional: true
# access-points:
# myhomewifi:
# password: "S3kr1t"
# myworkwifi:
# password: "correct battery horse staple"
# workssid:
# auth:
# key-management: eap
# method: peap
# identity: "me@example.com"
# password: "passw0rd"
# ca-certificate: /etc/my_ca.pem

View File

@ -0,0 +1,84 @@
#cloud-config
# NB! This is a sample, copy to "user-data" and modify to take effect
# NB! meta-data is required too! See "meta-data.sample"
# NB! For networking see "network-config.sample"
# This is the user-data configuration file for cloud-init. This image
# has a default nocloud-net metadata available on the first
# partition. By default it sets up an initial user called "ubuntu"
# with password "ubuntu", which must be changed at first
# login. However, one can override and provide many additional actions
# to be initiated on first boot from this file. The cloud-init
# documentation has more details: https://cloudinit.readthedocs.io/
# Some additional examples are provided in comments below the default
# configuration.
# On first boot, set the (default) ubuntu user's password to "ubuntu" and
# expire user passwords
#chpasswd:
# expire: true
# list:
# - ubuntu:ubuntu
# Enable password authentication with the SSH daemon
#ssh_pwauth: true
## On first boot, use ssh-import-id to give the specific users SSH access to
## the default user
#ssh_import_id:
#- lp:my_launchpad_username
#- gh:my_github_username
## Add users and groups to the system, and import keys with the ssh-import-id
## utility
#groups:
#- robot: [robot]
#- robotics: [robot]
#
#users:
#- default
#- name: robot
# gecos: Mr. Robot
# primary_group: robot
# groups: users
# ssh_import_id: foobar
# lock_passwd: false
# passwd: $5$hkui88$nvZgIle31cNpryjRfO9uArF7DYiBcWEnjqq7L1AQNN3
## Update apt database and upgrade packages on first boot
#package_update: true
#package_upgrade: true
## Install additional packages on first boot
#packages:
#- pwgen
#- pastebinit
#- [libpython2.7, 2.7.3-0ubuntu3.1]
## Write arbitrary files to the file-system (including binaries!)
#write_files:
#- path: /etc/default/keyboard
# content: |
# # KEYBOARD configuration file
# # Consult the keyboard(5) manual page.
# XKBMODEL="pc105"
# XKBLAYOUT="gb"
# XKBVARIANT=""
# XKBOPTIONS="ctrl: nocaps"
# permissions: '0644'
# owner: root:root
#- encoding: gzip
# path: /usr/bin/hello
# content: !!binary |
# H4sIAIDb/U8C/1NW1E/KzNMvzuBKTc7IV8hIzcnJVyjPL8pJ4QIA6N+MVxsAAAA=
# owner: root:root
# permissions: '0755'
## Run arbitrary commands at rc.local like time
#runcmd:
#- [ ls, -l, / ]
#- [ sh, -xc, "echo $(date) ': hello world!'" ]
#- [ wget, "http://ubuntu.com", -O, /run/mydir/index.html ]

View File

@ -96,14 +96,25 @@ mount_image() {
setup_mountpoint() {
local mountpoint="$1"
if [ ! -c /dev/mem ]; then
mknod -m 660 /dev/mem c 1 1
chown root:kmem /dev/mem
fi
mount --rbind /dev "$mountpoint/dev"
mount proc-live -t proc "$mountpoint/proc"
mount sysfs-live -t sysfs "$mountpoint/sys"
mount securityfs -t securityfs "$mountpoint/sys/kernel/security"
# Provide more up to date apparmor features, matching target kernel
mount -o bind /usr/share/livecd-rootfs/live-build/apparmor/generic "$mountpoint/sys/kernel/security/apparmor/features/"
mount -o bind /usr/share/livecd-rootfs/live-build/seccomp/generic.actions_avail "$mountpoint/proc/sys/kernel/seccomp/actions_avail"
mount -t tmpfs none "$mountpoint/tmp"
mount -t tmpfs none "$mountpoint/var/lib/apt"
mount -t tmpfs none "$mountpoint/var/lib/apt/lists"
mount -t tmpfs none "$mountpoint/var/cache/apt"
mv "$mountpoint/etc/resolv.conf" resolv.conf.tmp
cp /etc/resolv.conf "$mountpoint/etc/resolv.conf"
mv "$mountpoint/etc/nsswitch.conf" nsswitch.conf.tmp
sed 's/systemd//g' nsswitch.conf.tmp > "$mountpoint/etc/nsswitch.conf"
chroot "$mountpoint" apt-get update
}
@ -121,6 +132,7 @@ teardown_mountpoint() {
umount $submount
done
mv resolv.conf.tmp "$mountpoint/etc/resolv.conf"
mv nsswitch.conf.tmp "$mountpoint/etc/nsswitch.conf"
}
mount_partition() {
@ -188,6 +200,8 @@ umount_partition() {
mount --make-private $mountpoint
umount $mountpoint
udevadm settle
# workaround for LP: 1960537
sleep 30
if [ -n "${rootfs_dev_mapper}" -a -b "${rootfs_dev_mapper}" ]; then
# buildd's don't have /etc/mtab symlinked
@ -230,28 +244,46 @@ modify_vmdk_header() {
# Extract the vmdk header for manipulation
dd if="${vmdk_name}" of="${descriptor}" bs=1 skip=512 count=1024
echo "Cat'ing original vmdk disk descriptor to console for debugging."
# cat header so we are aware of the original descriptor for debugging
cat $descriptor
# trim null bytes to treat as standard text file
tr -d '\000' < $descriptor > $newdescriptor
# The sed lines below is where the magic is. Specifically:
# ddb.toolsVersion: sets the open-vm-tools so that VMware shows
# the tooling as current
# ddb.virtualHWVersion: set the version to 7, which covers most
# current versions of VMware
# createType: make sure its set to stream Optimized
# remove the vmdk-stream-converter comment and replace with
# # Disk DescriptorFile. This is needed for Virtualbox
# remove the comments from vmdk-stream-converter which causes
# VirtualBox and others to fail VMDK validation
sed -e 's|# Description file.*|# Disk DescriptorFile|' \
sed -i -e 's|# Description file.*|# Disk DescriptorFile|' \
-e '/# Believe this is random*/d' \
-e '/# Indicates no parent/d' \
-e '/# The Disk Data Base/d' \
-e 's|ddb.comment.*|ddb.toolsVersion = "2147483647"|' \
"${descriptor}" > "${newdescriptor}"
${newdescriptor}
# The header is cannot be bigger than 1024
expr $(stat --format=%s ${newdescriptor}) \< 1024 > /dev/null 2>&1 || {
echo "descriptor is too large, VMDK will be invalid!"; exit 1; }
# add newline to newdescriptor
echo "" >> $newdescriptor
# add required tools version
echo -n 'ddb.toolsVersion = "2147483647"' >> $newdescriptor
echo "Cat'ing modified descriptor for debugging."
cat $newdescriptor
# diff original descriptor and new descriptor for debugging
# diff exits 1 if difference. pipefail not set so piping diff
# to cat prints diff and swallows exit 1
echo "Printing diff of original and new descriptors."
diff --text $descriptor $newdescriptor | cat
# The header must be 1024 or less before padding
if ! expr $(stat --format=%s ${newdescriptor}) \< 1025 > /dev/null 2>&1; then
echo "descriptor is too large, VMDK will be invalid!";
exit 1
fi
# reset newdescriptor to be 1024
truncate --no-create --size=1K $newdescriptor
# Overwrite the vmdk header with our new, modified one
dd conv=notrunc,nocreat \
@ -356,7 +388,9 @@ undivert_grub() {
--divert /etc/grub.d/30_os-prober.dpkg-divert \
--rename /etc/grub.d/30_os-prober
rm "$CHROOT_ROOT"/usr/bin/systemd-detect-virt
if grep -q "^exit 1$" "$CHROOT_ROOT"/usr/bin/systemd-detect-virt; then
rm "$CHROOT_ROOT"/usr/bin/systemd-detect-virt
fi
chroot "$CHROOT_ROOT" dpkg-divert --remove --local \
--rename /usr/bin/systemd-detect-virt
}
@ -520,12 +554,25 @@ _snap_preseed() {
exit 1
fi
local core_snap=$(echo "$snap_info" | grep '^base:' | awk '{print $2}')
local snap_type=$(echo "$snap_info" | awk '/^type:/ { print $2 }')
# If snap info does not list a base use 'core'
core_snap=${core_snap:-core}
if [ "$snap_type" != base ]; then
local core_snap=$(echo "$snap_info" | awk '/^base:/ {print $2}')
_snap_preseed $CHROOT_ROOT $core_snap stable
# If snap info does not list a base the default is 'core'
# which is now an error to use.
if [ -z "$core_snap" ]; then
if [ -z "$ALLOW_CORE_SNAP" ]; then
echo "Legacy snap with no base declaration found, refusing to install 'core' snap"
exit 1
else
echo "Legacy snap with no base declaration found, but \$ALLOW_CORE_SNAP set. continue (but FIX YOUR SNAPS!)"
core_snap=${core_snap:-core}
fi
fi
_snap_preseed $CHROOT_ROOT $core_snap stable
fi
;;
esac
@ -626,11 +673,31 @@ snap_prepare() {
snap_preseed() {
# Preseed a snap in the image (snap_prepare must be called once prior)
local CHROOT_ROOT=$1
# $2 can be in the form of snap_name/classic=track/risk/branch
local SNAP=$2
# strip CHANNEL specification
SNAP=${SNAP%=*}
# strip /classic confinement
local SNAP_NAME=${SNAP%/*}
# Per Ubuntu policy, all seeded snaps (with the exception of the core
# snap) must pull from stable/ubuntu-$(release_ver) as their channel.
local CHANNEL=${3:-"stable/ubuntu-$(release_ver)"}
# Seed from the specified channel (e.g. core18 latest/stable)
# Or Channel endcoded in the snap name (e.g. lxd=4.0/stable/ubuntu-20.04)
# Or Ubuntu policy default channel latest/stable/ubuntu-$(release_ver)
local CHANNEL=${3:-}
if [ -z "$CHANNEL" ]; then
case $2 in
*=*)
CHANNEL=${2#*=}
;;
*)
CHANNEL="stable/ubuntu-$(release_ver)"
;;
esac
fi
# At this point:
# SNAP_NAME is just the snap name
# SNAP is either $SNAP_NAME or $SNAP_NAME/classic for classic confined
# CHANNEL is the channel
if [ ! -e "$CHROOT_ROOT/var/lib/snapd/seed/assertions/model" ]; then
echo "ERROR: Snap model assertion not present, snap_prepare must be called"
@ -659,9 +726,43 @@ snap_preseed() {
snap_validate_seed() {
local CHROOT_ROOT=$1
local kern_major_min=undefined
local boot_filename=undefined
# ppc64el still uses /boot/vmlinux so we need to determine the boot file name as non ppc64el use /boot/vmlinuz
# We don't need to query the arch as we can use existence of the file to determine the boot file name. Both
# will never be present at the same time.
if [ -e ${CHROOT_ROOT}/boot/vmlinuz ]; then
boot_filename=vmlinuz
elif [ -e ${CHROOT_ROOT}/boot/vmlinux ]; then
boot_filename=vmlinux
fi
if [ ${boot_filename} != undefined ]; then # we have a known boot file so we can proceed with checking for features to mount
kern_major_min=$(readlink --canonicalize --no-newline ${CHROOT_ROOT}/boot/${boot_filename} | grep --extended-regexp --only-matching --max-count 1 '[0-9]+\.[0-9]+')
if [ -d /usr/share/livecd-rootfs/live-build/apparmor/${kern_major_min} ]; then
# if an Ubuntu version has different kernel apparmor features between LTS and HWE kernels
# a snap pre-seeding issue can occur, where the incorrect apparmor features are reported
# basic copy of a directory structure overriding the "generic" feature set
# which is tied to the LTS kernel
# Bind kernel apparmor directory to feature directory for snap preseeding
umount "${CHROOT_ROOT}/sys/kernel/security/apparmor/features/"
mount --bind /usr/share/livecd-rootfs/live-build/apparmor/${kern_major_min} "${CHROOT_ROOT}/sys/kernel/security/apparmor/features/"
fi
fi
if [ -e "${CHROOT_ROOT}/var/lib/snapd/seed/seed.yaml" ]; then
snap debug validate-seed "${CHROOT_ROOT}/var/lib/snapd/seed/seed.yaml"
/usr/lib/snapd/snap-preseed --reset $(realpath "${CHROOT_ROOT}")
/usr/lib/snapd/snap-preseed $(realpath "${CHROOT_ROOT}")
chroot "${CHROOT_ROOT}" apparmor_parser --skip-read-cache --write-cache --skip-kernel-load --verbose -j `nproc` /etc/apparmor.d
fi
# Unmount kernel specific apparmor feature
# mount generic apparmor feature again (cleanup)
if [ -d /build/config/hooks.d/extra/apparmor/${kern_major_min} ]; then
umount "${CHROOT_ROOT}/sys/kernel/security/apparmor/features/"
mount -o bind /usr/share/livecd-rootfs/live-build/apparmor/generic "${CHROOT_ROOT}/sys/kernel/security/apparmor/features/"
fi
}
@ -747,7 +848,7 @@ clean_debian_chroot() {
rm -f chroot/var/cache/debconf/*-old chroot/var/lib/dpkg/*-old
Chroot chroot apt clean
# For the docker images we remove even more stuff.
if [ "${PROJECT}:${SUBPROJECT:-}" = "ubuntu-base:minimized" ]; then
if [ "${PROJECT}:${SUBPROJECT:-}" = "ubuntu-base:minimized" ] || [ "${PROJECT}:${SUBPROJECT:-}" = "ubuntu-oci:minimized" ]; then
# Remove apt lists (that are currently removed downstream
# anyway)
rm -rf chroot/var/lib/apt/lists/*
@ -820,6 +921,76 @@ EOF
fi
}
configure_oci() {
# configure a chroot to be a OCI/docker container
# theses changes are taken from the current Dockerfile modifications done
# at https://github.com/tianon/docker-brew-ubuntu-core/blob/master/update.sh
local chroot=$1
local serial=$2
if [ ! -d "${chroot}" ]; then
echo "The chroot does not exist"
exit 1
fi
echo "==== Configuring OCI ===="
# https://github.com/docker/docker/blob/9a9fc01af8fb5d98b8eec0740716226fadb3735c/contrib/mkimage/debootstrap#L40-L48
echo '#!/bin/sh' > ${chroot}/usr/sbin/policy-rc.d
echo 'exit 101' >> ${chroot}/usr/sbin/policy-rc.d
Chroot ${chroot} "chmod +x /usr/sbin/policy-rc.d"
# Inject a build stamp into the image
mkdir -p ${chroot}/etc/cloud
cat > ${chroot}/etc/cloud/build.info << EOF
serial: $serial
EOF
# https://github.com/docker/docker/blob/9a9fc01af8fb5d98b8eec0740716226fadb3735c/contrib/mkimage/debootstrap#L54-L56
Chroot ${chroot} "dpkg-divert --local --rename --add /sbin/initctl"
cp -a ${chroot}/usr/sbin/policy-rc.d ${chroot}/sbin/initctl
sed -i 's/^exit.*/exit 0/' ${chroot}/sbin/initctl
# https://github.com/docker/docker/blob/9a9fc01af8fb5d98b8eec0740716226fadb3735c/contrib/mkimage/debootstrap#L71-L78
echo 'force-unsafe-io' > ${chroot}/etc/dpkg/dpkg.cfg.d/docker-apt-speedup
# https://github.com/docker/docker/blob/9a9fc01af8fb5d98b8eec0740716226fadb3735c/contrib/mkimage/debootstrap#L85-L105
echo 'DPkg::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };' > ${chroot}/etc/apt/apt.conf.d/docker-clean
echo 'APT::Update::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };' >> ${chroot}/etc/apt/apt.conf.d/docker-clean
echo 'Dir::Cache::pkgcache ""; Dir::Cache::srcpkgcache "";' >> ${chroot}/etc/apt/apt.conf.d/docker-clean
# https://github.com/docker/docker/blob/9a9fc01af8fb5d98b8eec0740716226fadb3735c/contrib/mkimage/debootstrap#L109-L115
echo 'Acquire::Languages "none";' > ${chroot}/etc/apt/apt.conf.d/docker-no-languages
# https://github.com/docker/docker/blob/9a9fc01af8fb5d98b8eec0740716226fadb3735c/contrib/mkimage/debootstrap#L118-L130
echo 'Acquire::GzipIndexes "true"; Acquire::CompressionTypes::Order:: "gz";' > ${chroot}/etc/apt/apt.conf.d/docker-gzip-indexes
# https://github.com/docker/docker/blob/9a9fc01af8fb5d98b8eec0740716226fadb3735c/contrib/mkimage/debootstrap#L134-L151
echo 'Apt::AutoRemove::SuggestsImportant "false";' > ${chroot}/etc/apt/apt.conf.d/docker-autoremove-suggests
# delete all the apt list files since they're big and get stale quickly
rm -rf ${chroot}/var/lib/apt/lists/*
# verify that the APT lists files do not exist
Chroot chroot "apt-get indextargets" > indextargets.out
[ ! -s indextargets.out ]
rm indextargets.out
# (see https://bugs.launchpad.net/cloud-images/+bug/1699913)
# make systemd-detect-virt return "docker"
# See: https://github.com/systemd/systemd/blob/aa0c34279ee40bce2f9681b496922dedbadfca19/src/basic/virt.c#L434
mkdir -p ${chroot}/run/systemd
echo 'docker' > ${chroot}/run/systemd/container
rm -rf ${chroot}/var/cache/apt/*.bin
echo "==== Configuring OCI done ===="
}
configure_network_manager() {
# If the image pre-installs network-manager, let it manage all devices by
# default. Installing NM on an existing system only manages wifi and wwan via
@ -905,6 +1076,19 @@ is_live_layer () {
return 1
}
setup_cidata() {
local cidata_dev=$1
local mountpoint=$(mktemp -d)
mkfs.vfat -F 32 -n CIDATA ${cidata_dev}
mount ${cidata_dev} ${mountpoint}
cp /usr/share/livecd-rootfs/live-build/cidata/* ${mountpoint}
cat >>${mountpoint}/meta-data.sample <<END
#instance-id: iid-$(openssl rand -hex 8)
END
umount ${mountpoint}
}
replace_kernel () {
mountpoint=$1
new_kernel=$2
@ -919,4 +1103,52 @@ replace_kernel () {
install --assume-yes "${new_kernel}"
env DEBIAN_FRONTEND=noninteractive chroot "${mountpoint}" apt-get \
autoremove --purge --assume-yes
# If running a custom kernel, we should try to boot without an initramfs
# We do this by setting GRUB_FORCE_PARTUUID, which forces initramfs-less boot
force_boot_without_initramfs ${mountpoint}
}
track_initramfs_boot_fallback() {
mountpoint=$1
cat <<END > "${mountpoint}/etc/grub.d/01_track_initrdless_boot_fallback"
#! /bin/sh
# ${IMAGE_STR}
# This will detect if we attempt to boot with an initramfs and fail.
# In the case of a failure, initrdless_boot_fallback_triggered is set to
# a non-zero value in the grubenv. This value can be checked after boot
# by looking in /boot/grub/grubenv or by using the grub-editenv list command.
set -e
END
cat <<"END" >> "${mountpoint}/etc/grub.d/01_track_initrdless_boot_fallback"
cat <<"EOF"
if [ -n "${have_grubenv}" ]; then
if [ -n "${initrdfail}" ]; then
set initrdless_boot_fallback_triggered="${initrdfail}"
else
unset initrdless_boot_fallback_triggered
fi
save_env initrdless_boot_fallback_triggered
fi
EOF
END
chmod +x "${mountpoint}/etc/grub.d/01_track_initrdless_boot_fallback"
}
force_boot_without_initramfs() {
mountpoint=$1
partuuid=$(blkid -s PARTUUID -o value $(findmnt -n -o SOURCE --target "${mountpoint}"))
if [ -n "${partuuid}" ]; then
echo "Force booting without an initramfs..."
mkdir -p "${mountpoint}/etc/default/grub.d"
cat << EOF >> "${mountpoint}/etc/default/grub.d/40-force-partuuid.cfg"
# Force boot without an initramfs by setting GRUB_FORCE_PARTUUID
# Remove this line to enable boot with an initramfs
GRUB_FORCE_PARTUUID=${partuuid}
EOF
divert_grub "${mountpoint}"
chroot "${mountpoint}" update-grub
undivert_grub "${mountpoint}"
fi
}

View File

@ -17,6 +17,7 @@ lxd_arches = {
"powerpc": "ppc",
"ppc64el": "ppc64le",
"s390x": "s390x",
"riscv64": "riscv64",
}

View File

@ -0,0 +1 @@
kill_process kill_thread trap errno user_notif trace log allow

View File

@ -2,5 +2,5 @@
cat >>/etc/fstab<<EOT
# Minimal setup required for systemd to provide a r/w FS
/dev/root / rootfs defaults 0 0
/dev/root / rootfs defaults 0 1
EOT

View File

@ -33,6 +33,7 @@ install_grub() {
chroot mountpoint apt-get -qqy update
chroot mountpoint apt-get -qqy install grub-ieee1275
chroot mountpoint apt-get -qqy remove --purge grub-legacy-ec2
chroot mountpoint apt-get autoremove --purge --assume-yes
# set the kernel commandline to use hvc0
mkdir -p mountpoint/etc/default/grub.d

View File

@ -1,7 +1,7 @@
#!/bin/bash -eux
case $ARCH in
amd64|arm64|armhf)
amd64|arm64|armhf|riscv64)
;;
*)
echo "We don't create EFI images for $ARCH."
@ -21,6 +21,12 @@ case ${PROJECT:-} in
;;
esac
if [ "$ARCH" = "riscv64" ] && [ -n "${SUBARCH:-}" ]; then
IMAGE_SIZE=3758096384 # bump to 3.5G (3584*1024**2), due to linux-generic instead of virtual
elif [ "$ARCH" = "armhf" ]; then
IMAGE_SIZE=3758096384 # bump to 3.5G (3584*1024**2), due to linux-generic instead of virtual
fi
. config/binary
. config/functions
@ -35,6 +41,38 @@ create_partitions() {
--typecode=15:ef00 \
--new=1:
;;
riscv64)
# same as arm64/armhf, but set bit 2 legacy bios bootable
# on the first partition for uboot
# and have two loader partitions of uboot SPL & real one
# and have CIDATA partition for preinstalled image
if [ -z "${SUBARCH:-}" ]; then
# cloud-image
sgdisk "${disk_image}" \
--set-alignment=2 \
--new=15::+106M \
--typecode=15:ef00 \
--new=1:: \
--attributes=1:set:2
else
# preinstalled server, currently FU540
# FU740 too in the future
sgdisk "${disk_image}" \
--set-alignment=2 \
--new=13:34:2081 \
--change-name=13:loader1 \
--typecode=13:5B193300-FC78-40CD-8002-E86C45580B47 \
--new=14:2082:10273 \
--change-name=14:loader2 \
--typecode=14:2E54B353-1271-4842-806F-E436D6AF6985 \
--new=15::+106M \
--typecode=15:ef00 \
--new=12::+4M \
--change-name=12:CIDATA \
--new=1:: \
--attributes=1:set:2
fi
;;
amd64)
sgdisk "${disk_image}" \
--new=14::+4M \
@ -58,7 +96,7 @@ create_and_mount_uefi_partition() {
mount "${uefi_dev}" "$mountpoint"/boot/efi
cat << EOF >> "mountpoint/etc/fstab"
LABEL=UEFI /boot/efi vfat defaults 0 0
LABEL=UEFI /boot/efi vfat umask=0077 0 1
EOF
}
@ -73,14 +111,6 @@ install_grub() {
efi_boot_dir="/boot/efi/EFI/BOOT"
chroot mountpoint mkdir -p "${efi_boot_dir}"
if [ -n "$partuuid" ]; then
# FIXME: code duplicated between disk-image.binary
# and disk-image-uefi.binary. We want to fix this to not
# have initramfs-tools installed at all on these images.
echo "partuuid found for root device; omitting initrd"
echo "GRUB_FORCE_PARTUUID=$partuuid" >> mountpoint/etc/default/grub.d/40-force-partuuid.cfg
fi
chroot mountpoint apt-get -y update
# UEFI GRUB modules are meant to be used equally by Secure Boot and
@ -89,7 +119,7 @@ install_grub() {
# please file a bug against grub2 to include the affected module.
case $ARCH in
arm64)
chroot mountpoint apt-get -qqy install --no-install-recommends grub-efi-arm64 grub-efi-arm64-bin
chroot mountpoint apt-get -qqy install --no-install-recommends shim-signed grub-efi-arm64-signed
efi_target=arm64-efi
;;
armhf)
@ -97,11 +127,95 @@ install_grub() {
efi_target=arm-efi
;;
amd64)
chroot mountpoint apt-get install -qqy grub-efi-amd64-signed shim-signed
chroot mountpoint apt-get install -qqy grub-pc shim-signed
efi_target=x86_64-efi
;;
riscv64)
# TODO grub-efi-riscv64 does not exist yet on riscv64
chroot mountpoint apt-get install -qqy u-boot-menu #grub-efi-riscv64
efi_target=riscv64-efi
chroot mountpoint u-boot-update
if [ -n "${SUBARCH:-}" ]; then
u_boot_arch="${SUBARCH}"
if [ "${u_boot_arch}" = "hifive" ]; then
u_boot_arch=sifive_fu540
fi
chroot mountpoint apt-get install -qqy u-boot-sifive
# FSBL, which gets U-Boot SPL
loader1="/dev/mapper${loop_device///dev/}p13"
# The real U-Boot
loader2="/dev/mapper${loop_device///dev/}p14"
dd if=mountpoint/usr/lib/u-boot/${u_boot_arch}/u-boot-spl.bin of=$loader1
dd if=mountpoint/usr/lib/u-boot/${u_boot_arch}/u-boot.itb of=$loader2
# Provide end-user modifyable CIDATA
cidata_dev="/dev/mapper${loop_device///dev/}p12"
setup_cidata "${cidata_dev}"
# Provide stock nocloud datasource
# Allow interactive login on baremetal SiFive board,
# without a cloud datasource.
mkdir -p mountpoint/var/lib/cloud/seed/nocloud-net
cat <<EOF >mountpoint/var/lib/cloud/seed/nocloud-net/meta-data
instance-id: iid-$(openssl rand -hex 8)
EOF
cat <<EOF >mountpoint/var/lib/cloud/seed/nocloud-net/user-data
#cloud-config
chpasswd:
expire: True
list:
- ubuntu:ubuntu
ssh_pwauth: True
EOF
cat <<EOF >mountpoint/var/lib/cloud/seed/nocloud-net/network-config
# This is the initial network config.
# It can be overwritten by cloud-init.
version: 2
ethernets:
zz-all-en:
match:
name: "en*"
dhcp4: true
optional: true
zz-all-eth:
match:
name: "eth*"
dhcp4: true
optional: true
EOF
fi
## TODO remove below once we have grub-efi-riscv64
rm mountpoint/tmp/device.map
umount mountpoint/boot/efi
mount
umount_partition mountpoint
rmdir mountpoint
return
##
;;
esac
chroot mountpoint apt-get autoremove --purge --assume-yes
chroot mountpoint grub-install "${loop_device}" \
--boot-directory=/boot \
--efi-directory=/boot/efi \
--target=${efi_target} \
--uefi-secure-boot \
--no-nvram
if [ "$ARCH" = "amd64" ]; then
# Install the BIOS/GPT bits. Since GPT boots from the ESP partition,
# it means that we just run this simple command and we're done
chroot mountpoint grub-install --target=i386-pc "${loop_device}"
fi
# Use the linux-kvm kernel for minimal images where available
# linux-kvm currently only exists for amd64
if [ "${SUBPROJECT:-}" = "minimized" ] && [ "$ARCH" = "amd64" ]; then
replace_kernel mountpoint linux-kvm
fi
# This call to rewrite the debian package manifest is added here to capture
# grub-efi packages that otherwise would not make it into the base
# manifest. filesystem.packages is moved into place via symlinking to
@ -111,30 +225,8 @@ install_grub() {
# snap listings)
chroot mountpoint dpkg-query -W > binary/boot/filesystem.packages
chroot mountpoint grub-install "${loop_device}" \
--boot-directory=/boot \
--efi-directory=/boot/efi \
--target=${efi_target} \
--removable \
--uefi-secure-boot \
--no-nvram
if [ -f mountpoint/boot/efi/EFI/BOOT/grub.cfg ]; then
sed -i "s| root| root hd0,gpt1|" mountpoint/boot/efi/EFI/BOOT/grub.cfg
sed -i "1i${IMAGE_STR}" mountpoint/boot/efi/EFI/BOOT/grub.cfg
# For some reason the grub disk is looking for /boot/grub/grub.cfg on
# part 15....
chroot mountpoint mkdir -p /boot/efi/boot/grub
chroot mountpoint cp /boot/efi/EFI/BOOT/grub.cfg /boot/efi/boot/grub
fi
if [ "$ARCH" = "amd64" ]; then
# Install the BIOS/GPT bits. Since GPT boots from the ESP partition,
# it means that we just run this simple command and we're done
chroot mountpoint grub-install --target=i386-pc "${loop_device}"
fi
divert_grub mountpoint
track_initramfs_boot_fallback mountpoint
chroot mountpoint update-grub
replace_grub_root_with_label mountpoint
undivert_grub mountpoint
@ -154,8 +246,6 @@ create_empty_disk_image "${disk_image}"
create_partitions "${disk_image}"
mount_image "${disk_image}" 1
partuuid=$(blkid -s PARTUUID -o value "$rootfs_dev_mapper")
# Copy the chroot in to the disk
make_ext4_partition "${rootfs_dev_mapper}"
mkdir mountpoint

View File

@ -19,10 +19,6 @@ case $ARCH:$SUBARCH in
echo "POWER disk images are handled separately"
exit 0
;;
amd64|arm64|armhf)
echo "We only create EFI images for $ARCH."
exit 0
;;
armhf:raspi2)
# matches the size of the snappy image
IMAGE_SIZE=$((4*1000*1000*1000))
@ -31,6 +27,10 @@ case $ARCH:$SUBARCH in
BOOTPART_END=138M
BOOT_MOUNTPOINT=/boot/firmware
;;
arm64:*|armhf:*|riscv64:*)
echo "We only create EFI images for $ARCH."
exit 0
;;
*)
;;
esac
@ -73,8 +73,6 @@ create_empty_partition "${disk_image}" "$ROOTPART" "$ROOTPART_START" -1 ext2 "$R
mount_image "${disk_image}" "$ROOTPART"
partuuid=$(blkid -s PARTUUID -o value "$rootfs_dev_mapper")
# Copy the chroot in to the disk
make_ext4_partition "${rootfs_dev_mapper}"
mkdir mountpoint
@ -121,21 +119,24 @@ if [ "${should_install_grub}" -eq 1 ]; then
--device-map=/tmp/device.map \
${loop_device}
rm mountpoint/tmp/device.map
divert_grub mountpoint
track_initramfs_boot_fallback mountpoint
chroot mountpoint update-grub
undivert_grub mountpoint
if [ -n "$partuuid" ]; then
echo "partuuid found for root device; forcing it in Grub"
mkdir -p mountpoint/etc/default/grub.d
echo "GRUB_FORCE_PARTUUID=$partuuid" >> mountpoint/etc/default/grub.d/40-force-partuuid.cfg
divert_grub mountpoint
chroot mountpoint update-grub
undivert_grub mountpoint
fi
rm mountpoint/tmp/device.map
fi
# Use the linux-kvm kernel for minimal images where available
# linux-kvm currently only exists for amd64
if [ "${SUBPROJECT:-}" = "minimized" ] && [ "$ARCH" = "amd64" ]; then
replace_kernel mountpoint linux-kvm
fi
if [ "$ARCH" = "s390x" ]; then
# Do ZIPL install bits
chroot mountpoint apt-get -qqy install s390-tools sysconfig-hardware
chroot mountpoint apt-get autoremove --purge --assume-yes
# Write out cloudy zipl.conf for future kernel updates
cat << EOF > mountpoint/etc/zipl.conf

View File

@ -49,13 +49,6 @@ replace_kernel ${mount_d} "linux-kvm"
chroot "${mount_d}" update-grub
undivert_grub "${mount_d}"
# Remove initramfs for kvm image
env DEBIAN_FRONTEND=noninteractive chroot "${mount_d}" apt-get \
purge -y initramfs-tools busybox-initramfs
env DEBIAN_FRONTEND=noninteractive chroot "${mount_d}" rm \
-rf /boot/initrd.img-* /boot/initrd.img
# Remove indices
env DEBIAN_FRONTEND=noninteractive chroot "${mount_d}" apt-get \
clean

View File

@ -7,6 +7,10 @@ case $ARCH:$SUBARCH in
xz -T4 -c binary/boot/disk.ext4 > livecd.ubuntu-cpc.disk1.img.xz
exit 0
;;
riscv64:hifive|riscv64:sifive_*)
xz -T4 -c binary/boot/disk-uefi.ext4 > livecd.ubuntu-cpc.disk1.img.xz
exit 0
;;
esac
. config/functions

View File

@ -1,5 +1,5 @@
depends disk-image-uefi
base/disk-image.binary
base/disk-image-uefi.binary
base/disk-image-ppc64el.binary
provides livecd.ubuntu-cpc.ext4
provides livecd.ubuntu-cpc.initrd-generic

View File

@ -0,0 +1,8 @@
base/disk-image-uefi.binary
provides livecd.ubuntu-cpc.ext4
provides livecd.ubuntu-cpc.initrd-generic
provides livecd.ubuntu-cpc.initrd-generic-lpae
provides livecd.ubuntu-cpc.kernel-generic
provides livecd.ubuntu-cpc.kernel-generic-lpae
provides livecd.ubuntu-cpc.manifest
provides livecd.ubuntu-cpc.filelist

View File

@ -153,9 +153,17 @@ Vagrant.configure("2") do |config|
config.vm.base_mac = "${macaddr}"
config.vm.provider "virtualbox" do |vb|
vb.customize [ "modifyvm", :id, "--uart1", "0x3F8", "4" ]
# Creating a console log file is not an expected behavior for vagrant boxes. LP #1777827
# vb.customize [ "modifyvm", :id, "--uartmode1", "file", File.join(Dir.pwd, "${prefix}-console.log") ]
vb.customize [ "modifyvm", :id, "--uart1", "0x3F8", "4" ]
# Create a NULL serial port to skip console logging by default
vb.customize [ "modifyvm", :id, "--uartmode1", "file", File::NULL ]
# If console logging is desired, uncomment this line and remove prior
# vb.customize [ "modifyvm", :id, "--uartmode1", "file", File.join(Dir.pwd, "${prefix}-console.log") ]
# Ubuntu cloud images, by default, enable console=ttyS0. This enables serial consoles to
# connect to the images. With the change related to LP #1777827, removing a serial
# file logger, Vagrant image boot times increased and now run greater than 5 minutes
# Creating a console log file is not an expected default behavior for vagrant boxes.
# As a workaround, we create a console connection to File:NULL. LP #1874453
# This is overrideable in user files to write to a local file
end
end
EOF

View File

@ -35,6 +35,7 @@ cp -a rootfs.dir $rootfs_dir
setup_mountpoint $rootfs_dir
env DEBIAN_FRONTEND=noninteractive chroot $rootfs_dir apt-get -y -qq install ubuntu-wsl
env DEBIAN_FRONTEND=noninteractive chroot $rootfs_dir apt-get autoremove --purge --assume-yes
create_manifest $rootfs_dir livecd.ubuntu-cpc.wsl.rootfs.manifest
teardown_mountpoint $rootfs_dir

View File

@ -1,3 +1,8 @@
#!/bin/bash
sed -i "s|#PasswordAuthentication yes|PasswordAuthentication no|g" /etc/ssh/sshd_config
# NOTE: the file number needs to be **higher** than the one
# cloud-init writes (cloud-init uses 50-cloud-init.conf) so
# the cloud-init file takes precedence
cat << EOF >> "/etc/ssh/sshd_config.d/60-cloudimg-settings.conf"
PasswordAuthentication no
EOF

View File

@ -72,7 +72,7 @@ if [ -n "${root_fs_label}" ]; then
sed -i "s,^[^#${bl}]*\([${bl}]*/[${bl}].*\),${lstr}\1," "${rootd}/etc/fstab"
fi
cat > /etc/fstab << EOM
LABEL=cloudimg-rootfs / ext4 defaults 0 0
LABEL=cloudimg-rootfs / ext4 defaults 0 1
EOM
# for quantal and newer, add /etc/overlayroot.local.conf
@ -116,8 +116,8 @@ fi
case $arch in
# ARM, ppc and s390 images are special
armhf|arm64|powerpc|ppc64el|s390x)
# ARM, ppc, riscv64 and s390x images are special
armhf|arm64|powerpc|ppc64el|s390x|riscv64)
exit 0
;;
esac

View File

@ -15,13 +15,15 @@ case $IMAGE_TARGETS in
;;
esac
if [ -n "$SUBARCH" ]; then
if [ -n "$SUBARCH" && "$SUBARCH" != "intel-iot" ]; then
echo "Skipping rootfs build for subarch flavor build"
exit 0
fi
. config/functions
PROJECT=$PROJECT${SUBARCH:+-$SUBARCH}
mkdir binary/boot/squashfs.dir
cp -a chroot/* binary/boot/squashfs.dir

View File

@ -16,20 +16,21 @@ case $IMAGE_TARGETS in
;;
esac
if [ -n "$SUBARCH" ]; then
if [ -n "$SUBARCH" && "$SUBARCH" != "intel-iot" ]; then
echo "Skipping rootfs build for subarch flavor build"
exit 0
fi
. config/binary
. config/functions
. config/common
# somehow i don't have LB_DISTRIBUTION set ?!
. config/bootstrap
FILESYSTEM_ROOT=binary/boot/squashfs.dir
INSTALLER_ROOT=binary/boot/installer.squashfs.dir
OVERLAY_ROOT=binary/overlay
PROJECT=$PROJECT${SUBARCH:+-$SUBARCH}
mkdir -p "$INSTALLER_ROOT" "$OVERLAY_ROOT"
# Create an installer squashfs layer
@ -84,6 +85,14 @@ sed -i -e'N;/name: lxd/,+2d' $INSTALLER_ROOT/var/lib/snapd/seed/seed.yaml
teardown_mountpoint "$INSTALLER_ROOT"
# Drop snaps that got copied up from base layer, due to snap-preseed
# tool doing --reset & speedup
for snap in $(cd $OVERLAY_ROOT; find var/lib/snapd/ -name '*.snap'); do
if [ -f $FILESYSTEM_ROOT/$snap ]; then
rm $OVERLAY_ROOT/$snap;
fi
done
squashfs_f="${PWD}/livecd.${PROJECT}.installer.squashfs"
(cd "$OVERLAY_ROOT/" &&

View File

@ -14,7 +14,7 @@ case ${IMAGE_TARGETS-} in
;;
esac
if [ -n "${SUBARCH-}" ]; then
if [ -n "${SUBARCH-}" && "$SUBARCH" != "intel-iot" ]; then
echo "Skipping rootfs build for subarch flavor build"
exit 0
fi
@ -27,8 +27,16 @@ INSTALLER_ROOT=binary/boot/installer.squashfs.dir
KERNEL_BITS_ROOT=binary/boot/kernel-bits.dir
KERNEL_BITS_OVERLAY=binary/boot/overlay-kernel-bits
#variants='ga hwe'
variants='ga'
PROJECT=$PROJECT${SUBARCH:+-$SUBARCH}
case ${SUBARCH-} in
intel-iot)
variants='intel'
;;
*)
variants='ga hwe'
;;
esac
for variant in $variants; do
if [ "$variant" = "ga" ]; then
@ -37,6 +45,9 @@ for variant in $variants; do
elif [ "$variant" = "hwe" ]; then
kernel_metapkg=linux-generic-hwe-$(lsb_release -sr)
flavor=generic-hwe
elif [ "$variant" = "intel" ]; then
kernel_metapkg=linux-intel-iotg-edge
flavor=intel-iotg
else
echo "bogus variant: $variant"
exit 1

View File

@ -17,8 +17,6 @@ preserve_hostname: true
ssh_pwauth: yes
chpasswd:
expire: false
list:
- installer:RANDOM
# This is the initial network config.
# It can be overwritten by cloud-init or subiquity.
@ -34,7 +32,7 @@ network:
name: "eth*"
dhcp4: true
final_message: "## template: jinja\nCloud-init v. {{version}} finished at {{timestamp}}. Datasource {{datasource}}. Up {{uptime}} seconds\n\n\nWelcome to Ubuntu Server Installer!\n\nAbove you will find SSH host keys and a random password set for the `installer` user. You can use these credentials to ssh-in and complete the installation. If you provided SSH keys in the cloud-init datasource, they were also provisioned to the installer user.\n\nIf you have access to the graphical console, like TTY1 or HMC ASCII terminal you can complete the installation there too."
# We used to have a custom final_message here. Just use the default instead.
# Example datasource config
# datasource:

View File

@ -1,2 +1,9 @@
[Unit]
Description=Subiquity, the installer for Ubuntu Server %I
After=snapd.seeded.service
StartLimitInterval=0
[Service]
ExecStartPre=/bin/systemctl start serial-subiquity@%i.service
Environment=SNAP_REEXEC=0
ExecStart=
ExecStart=/usr/bin/snap run subiquity.subiquity-service %I

View File

@ -1,6 +1,4 @@
[Unit]
After=cloud-final.service snapd.seeded.service
[Service]
StandardOutput=tty
ExecStartPre=
ExecStartPre=/usr/bin/snap run subiquity --ssh
ExecStart=
ExecStart=/usr/bin/snap run subiquity --ssh

View File

@ -1,7 +1,6 @@
[Unit]
IgnoreOnIsolate=yes
After=systemd-user-sessions.service plymouth-quit-wait.service snap.seeded.service
ConditionPathExists=!/run/subiquity/complete
[Service]
Environment=SNAP_REEXEC=0

View File

@ -48,15 +48,15 @@ hv_sock
EOF
cat << EOF >> "${scratch_d}/etc/fstab"
LABEL=$FS_LABEL / ext4 defaults 0 0
LABEL=$FS_LABEL / ext4 defaults 0 1
EOF
# Customise xrdp
CHANGED_FILE_SUFFIX=.replaced-by-desktop-img-build
# use vsock transport.
sed -i${CHANGED_FILE_SUFFIX} -e 's/use_vsock=false/use_vsock=true/g' "${scratch_d}/etc/xrdp/xrdp.ini"
# use vsock transport
sed -i${CHANGED_FILE_SUFFIX} -e 's/port=3389/port=vsock:\/\/-1:3389/g' "${scratch_d}/etc/xrdp/xrdp.ini"
# use rdp security.
sed -i${CHANGED_FILE_SUFFIX} -e 's/security_layer=negotiate/security_layer=rdp/g' "${scratch_d}/etc/xrdp/xrdp.ini"
# remove encryption validation.
@ -74,6 +74,9 @@ exec /etc/xrdp/startwm.sh
EOF
chmod a+x "${scratch_d}/etc/xrdp/startubuntu.sh"
# set to use the system Window manager
sed -i${CHANGED_FILE_SUFFIX} -e 's/EnableUserWindowManager=true/EnableUserWindowManager=0/g' "${scratch_d}/etc/xrdp/sesman.ini"
# use the script to setup the ubuntu session
sed -i${CHANGED_FILE_SUFFIX} -e 's/startwm/startubuntu/g' "${scratch_d}/etc/xrdp/sesman.ini"
@ -100,6 +103,15 @@ ResultInactive=no
ResultActive=yes
EOF
cat >${scratch_d}/etc/polkit-1/localauthority/50-local.d/46-allow-update-repo.pkla <<EOF
[Allow Package Management all Users]
Identity=unix-user:*
Action=org.freedesktop.packagekit.system-sources-refresh
ResultAny=yes
ResultInactive=yes
ResultActive=yes
EOF
sed -i${CHANGED_FILE_SUFFIX} -e 's|After=|ConditionPathExists=!/var/lib/oem-config/run\nAfter=|g' "${scratch_d}/lib/systemd/system/xrdp.service"
# End xrdp customisation
@ -125,4 +137,7 @@ rm "$raw_img"
apt-get install -y zip
zip "$vhd_img.zip" "$vhd_img"
create_manifest chroot "$vhd_img.zip.manifest"
rm "$vhd_img"

View File

@ -0,0 +1,122 @@
#!/bin/bash -ex
. /root/config/chroot
# Specific ubuntu-image chroot configuration goes here.
if [ "$IMAGEFORMAT" == "none" ]; then
if [ "$SUBPROJECT" == "desktop-preinstalled" ]; then
# Create files/dirs Ubiquity requires
mkdir -p /var/log/installer
touch /var/log/installer/debug
touch /var/log/syslog
chown syslog:adm /var/log/syslog
# Create the oem user account
if [ -e "/usr/sbin/oem-config-prepare" ]; then
/usr/sbin/useradd -d /home/oem -G adm,sudo -m -N -u 29999 oem
/usr/sbin/oem-config-prepare --quiet
touch "/var/lib/oem-config/run"
fi
# Make the writable partition grow
echo "LABEL=writable / ext4 defaults,x-systemd.growfs 0 0" >>/etc/fstab
# Create a 1GB swapfile
dd if=/dev/zero of=/swapfile bs=1M count=1024
chmod 0600 /swapfile
mkswap /swapfile
echo "/swapfile none swap sw 0 0" >>/etc/fstab
if [ $(dpkg --print-architecture) == "amd64" ]; then
# We need to get a grub.cfg generated for our image
# This is copy-pasted from 999-cpc-fixes.chroot
# TODO: Make this better. One idea would be to have this exported
# in functions or something, and then reused by both the cpc-fixes
# and here. Another possibility is to actually trim down the
# pseudo_grub_probe to only work for a regular preinstalled
# desktop.
# But short term it's safer to use a known code-base.
psuedo_grub_probe() {
cat <<"PSUEDO_GRUB_PROBE"
#!/bin/sh
Usage() {
cat <<EOF
Usage: euca-psuedo-grub-probe
this is a wrapper around grub-probe to provide the answers for an ec2 guest
EOF
}
bad_Usage() { Usage 1>&2; fail "$@"; }
short_opts=""
long_opts="device-map:,target:,device"
getopt_out=$(getopt --name "${0##*/}" \
--options "${short_opts}" --long "${long_opts}" -- "$@") &&
eval set -- "${getopt_out}" ||
bad_Usage
device_map=""
target=""
device=0
arg=""
while [ $# -ne 0 ]; do
cur=${1}; next=${2};
case "$cur" in
--device-map) device_map=${next}; shift;;
--device) device=1;;
--target) target=${next}; shift;;
--) shift; break;;
esac
shift;
done
arg=${1}
case "${target}:${device}:${arg}" in
device:*:/*) echo "/dev/sda1"; exit 0;;
fs:*:*) echo "ext2"; exit 0;;
partmap:*:*)
# older versions of grub (lucid) want 'part_msdos' written
# rather than 'msdos'
legacy_pre=""
grubver=$(dpkg-query --show --showformat '${Version}\n' grub-pc 2>/dev/null) &&
dpkg --compare-versions "${grubver}" lt 1.98+20100804-5ubuntu3 &&
legacy_pre="part_"
echo "${legacy_pre}msdos";
exit 0;;
abstraction:*:*) echo ""; exit 0;;
drive:*:/dev/sda) echo "(hd0)";;
drive:*:/dev/sda*) echo "(hd0,1)";;
fs_uuid:*:*) exit 1;;
esac
PSUEDO_GRUB_PROBE
}
gprobe="/usr/sbin/grub-probe"
moved=0
if [ -f "${gprobe}" ]; then
mv "${gprobe}" "${gprobe}.dist"
moved=1
fi
psuedo_grub_probe > "${gprobe}"
chmod 755 "${gprobe}"
# Generate grub.cfg
/usr/sbin/update-grub2
# Somehow grub doesn't copy unicode.pf2 to the right fonts
# directory.
if [ ! -e "/boot/grub/fonts/unicode.pf2" ]; then
mkdir -p /boot/grub/fonts
ln /boot/grub/unicode.pf2 /boot/grub/fonts/unicode.pf2
fi
grub2cfg="/boot/grub/grub.cfg"
[ ! -f "${grub2cfg}" ] ||
sed -i -e "s,root=/dev/[hs]da1,root=LABEL=writable," "${grub2cfg}"
[ ${moved} -eq 0 ] || mv "${gprobe}.dist" "${gprobe}"
fi
fi
fi

Some files were not shown because too many files have changed in this diff Show More