Compare commits

...

51 Commits

Author SHA1 Message Date
Utkarsh Gupta
de15c55ef0 Update d/ch for 24.04.84 release 2025-02-13 03:16:44 +05:30
Utkarsh Gupta
d02ab9bc0e Bump HWE kernel track to 24.04 for ubuntu-core-desktop 2025-02-13 03:16:44 +05:30
Florent 'Skia' Jacquet
ddfb468b42 Enable the HWE stack for 24.04.2
This change was overlooked, thanks to a combination of Jira
checklist items + inexperienced team members + quite late
landing of the HWE stack.

LP: #2098105
2025-02-13 03:16:14 +05:30
Florent 'Skia' Jacquet
2af06de671 kylin: indentation fix 2025-02-12 15:17:28 +01:00
Didier Roche
5545bf057e
releasing package livecd-rootfs version 24.04.83 2025-01-23 15:37:42 +01:00
Didier Roche
4e52b33e45
Update reference to wsl-setup now in /usr/lib/wsl/
Microsoft expects this binary to be under that path.
2025-01-23 14:22:43 +01:00
Didier Roche
48338fc76a
Create wsl-distribution.conf for WSL images
This file is required in the new Microsoft WSL package format.

Co-authored-by: Carlos Nihelton <carlos.santanadeoliveira@canonical.com>
2025-01-23 14:13:36 +01:00
Didier Roche
c1e2deee9f
Create livecd-roots tarball as a .wsl extension
Co-authored-by: Carlos Nihelton <carlos.santanadeoliveira@canonical.com>
2025-01-23 14:13:36 +01:00
Didier Roche
c954240293
Keep a single wsl rootfs upgrade policy
We are removing our different variants of wsl rootfs with the new
Microsoft format. We only keep one following the distribution policy:
- lts to lts
- intermediate release to next one

Co-authored-by: Carlos Nihelton <carlos.santanadeoliveira@canonical.com>
2025-01-23 14:13:31 +01:00
Loïc Minier
a81a1c20c7 Add support for arm64+tegra-jetson flavor. (LP: #2091392) 2024-12-13 17:54:01 +00:00
Utkarsh Gupta
a2058724c4 Update d/ch for 24.04.81 release 2024-11-20 15:44:45 +05:30
Utkarsh Gupta
6047e22319 Introduce unminimize as a package in OCI images (LP: #2078583)
With having unminimize split out from livecd-rootfs, we should
re-introduce it as a package for, at least, Noble so that it's
not seen as a regression. From 24.10 and onward, we're going to
drop it altogether.
2024-11-20 15:43:41 +05:30
John Chittum
9a970b2ca2
changelog 2024-11-07 08:12:50 -05:00
John Chittum
b7c2cf45b1
fix(buildd): create buildd homedir
LP:2083240

starting in noble, adduser no longer creates a homedir for system users.
The buildd user then does not have a home directory, causing snaps to be
unable to run, as well as possibly other issues from a missing assumed
homedir. Explicitly create /home/buildd
2024-11-06 07:33:51 -05:00
Thomas Bechtold
70d7c43d6a
Add debian/changelog entry 2024-10-18 13:55:39 +02:00
Thomas Bechtold
d1ca48bdc4
feat(apparmor): Add policy:permstable32 feature to 6.8 kernel (LP: #2084698)
Failing CPC tests show that the preseeded apparmor features don't
include policy:permstable32 for the 6.8 kernel. This change adds the
feature preseed with values based on a successfully booted instance.
2024-10-18 13:53:20 +02:00
John Chittum
0b2af5aa60 add changelog entry 2024-09-26 17:04:57 +12:00
John Chittum
377617b946 feat(ubuntu-cpc): sbom generation everywhere
patch create_manifest to produce an sbom when called by an ubuntu-cpc
project. Patch all the ubuntu-cpc hooks and series files to include the
newly generated manifests, filelists, and sboms. Generates a number of
new artifacts in the builds. the snap utilized, cpc-sbom, is an open
source repo and a provided via a hidden snap. there is no intention of
publisizing the snap or how we generate sboms, however partners require
the ability to audit if required.

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

(cherry picked from commit 7c7b7df89dc96169db1f255d6bba901ebb63a43c)
2024-09-26 17:04:35 +12:00
Michael Hudson-Doyle
d3ef751279 commit hotfix upload 2024-09-26 17:04:12 +12:00
Utkarsh Gupta
9ffb24c8f7 Add SRU bug in d/ch entry 2024-08-23 11:03:33 +05:30
Utkarsh Gupta
aa3481c960 Update d/ch for 24.04.77 release 2024-08-21 12:09:45 +05:30
Utkarsh Gupta
c8ee3dddba Use packaged unminimize in the ubuntu-server images
unminimize is currently present at /usr/local/sbin/unminimize,
which is spit out by livecd-rootfs currently. We'd like to switch
that to use the packaged unminimize, which will be at
/usr/bin/unminimize instead.

(cherry picked from commit 7535bf7bc729b52d28a0a5a44b3aa8362ca9397d)
2024-08-21 12:06:39 +05:30
Utkarsh Gupta
0f837b9431 Drop unminimize spit out by livecd-rootfs
And prefer the one that is packaged separately as
src:unminimize, which installs the package in
/usr/bin/unminimize

(cherry picked from commit 34482819f0d0078f834b052c308b371bedd621d0)
2024-08-21 12:06:20 +05:30
Michael Hudson-Doyle
47c1a539d6 releasing package livecd-rootfs version 24.04.76 2024-08-21 16:14:10 +12:00
Michael Hudson-Doyle
9441bbdfb5 Force latest/stable/ubuntu-24.10 subiquity onto the ubuntu-core-installer ISO for now. 2024-08-21 15:58:08 +12:00
Michael Hudson-Doyle
5a4991ade3 add reference to SRU bug to changelog 2024-08-08 16:50:13 +12:00
Michael Hudson-Doyle
a99b788ebc releasing package livecd-rootfs version 24.04.75 2024-07-30 16:35:50 +12:00
Michael Hudson-Doyle
0df4234c28 Add 'ubuntu-core-installer' project.
The ubuntu-core-installer image is an installer that installs ubuntu
core. The environment the installer runs in is similar to the server
installer but it has a source catalog entry that points to the model
created in ubuntu-core-installer/hooks/05-prepare-image.binary, which
subiquity knows how to install.
2024-07-25 17:26:22 +12:00
Łukasz 'sil2100' Zemczak
2215660a7d releasing package livecd-rootfs version 24.04.74 2024-07-24 16:17:29 +01:00
Heinrich Schuchardt
1da6867784 riscv64: preinstalled server image for Microchip PIC64GX Curiosity Kit
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-07-24 11:26:05 +02:00
Łukasz 'sil2100' Zemczak
69b47ce2fe releasing package livecd-rootfs version 24.04.73 2024-07-11 13:17:09 +02:00
Łukasz 'sil2100' Zemczak
bb44f093c9 Backport the qcow2 ubuntu-core image generation for LXD support. 2024-07-11 13:16:40 +02:00
Philip Roche
a0dea8f6e2
d/ch change to upload 24.04.72 noble 2024-06-25 12:23:43 +01:00
Philip Roche
d9e444988d
Merge bugfix/LP-2069828-restore-unminimize-during-server-build-noble into ubuntu/noble [a=philroche] [r=gjolly,utkarsh]
fix: Revert removal of unminimize call in server builds (LP: #2069828)

There was a change made by me in https://code.launchpad.net/~philroche/livecd-rootfs/+git/livecd-rootfs/+merge/466388
as part of LP: #2066905 to remove references to LXD in the unminimize scripts
but I also removed the calls to `unminimize` in error.

This still needs to run but without any references to LXD which no longer
needs to be `unminimized` via snap installation.

(cherry picked from commit f574fc8200d8a4c7837288c5d2aa1e515137bb55)

MP: https://code.launchpad.net/~philroche/livecd-rootfs/+git/livecd-rootfs/+merge/468088
2024-06-25 12:19:00 +01:00
Philip Roche
62a80ac00a
fix: Revert removal of unminimize call in server builds (LP: #2069828)
There was a change made by me in https://code.launchpad.net/~philroche/livecd-rootfs/+git/livecd-rootfs/+merge/466388
as part of LP: #2066905 to remove references to LXD in the unminimize scripts
but I also removed the calls to `unminimize` in error.

This still needs to run but without any references to LXD which no longer
needs to be `unminimized` via snap installation.

(cherry picked from commit f574fc8200d8a4c7837288c5d2aa1e515137bb55)
2024-06-24 17:26:07 +01:00
Heinrich Schuchardt
05933ff83f riscv64: use earlycon=sbi on command line
With current kernel we need to specify the SBI driver
for the early console to work.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-06-07 16:21:32 +02:00
Philip Roche
10d4a04d14
Merge bugfix/noble-remove-files-added-during-incorect-merge-conflict-resolution into ubuntu/noble [a=philroche] [r=brian-murray]
fix: Remove .patch files and livecd-rootfs symlink committed in error as part of merge commit.

Apologies. Trying to do too many things at once

This reverts changes added in error in commit 639f04b7

MP: https://code.launchpad.net/~philroche/livecd-rootfs/+git/livecd-rootfs/+merge/466885
2024-06-04 18:42:12 +01:00
Philip Roche
d72ae0de70
fix: Remove .patch files and livecd-rootfs symlink committed in error as part of merge commit.
Apologies. Trying to do too many things at once

This reverts changes added in error in commit 639f04b7
2024-06-04 18:33:45 +01:00
Philip Roche
bfb829c64d fix: Remove .idea pycharm directories and files committed in error as part of merge commit.
Apologies. Trying to do too many things at once
2024-05-27 12:40:56 +01:00
Philip Roche
13ec478feb d/ch change to upload 24.04.71 noble 2024-05-27 12:06:44 +01:00
Philip Roche
639f04b7b9 Merge feature/re-enable-noble-hyperv-desktop-builds-noble into ubuntu/noble [a=philroche] [r=mwhudson,utkarsh]
feat: Re-enable ability to build HyperV desktop images (LP: #2064280)

We have not built Hyperv desktop images since Jammy and with the re-introduction of
HyperV for Noble we have encountered build issues caused by refactoring and removals
of code assumed to be redundant but the HyperV desktop images were actually using
these code paths.

This is a backport/SRU from oracular.

MP: https://code.launchpad.net/~philroche/livecd-rootfs/+git/livecd-rootfs/+merge/466385

# Conflicts:
#	debian/changelog
2024-05-27 12:06:31 +01:00
Philip Roche
073d7e0404 d/ch change to upload 24.04.70 noble 2024-05-27 11:11:12 +01:00
Philip Roche
1f40b60606 Merge bugfix/lxd-no-longer-seeded-unminimize-noble into ubuntu/noble [a=philroche] [r=sdeziel,utkarsh,vorlon]
fix: No longer install LXD snap in unminimize script (LP: #2066905)

The LXD snap is no longer seeded in any images since Noble+ so the LXD related unminimize logic in
./live-build/auto/build?h=ubuntu/noble and ./live-build/ubuntu-server/hooks/01-unminimize.chroot_early
 is no longer required.

lxd-installer can remain installed.

This is a backport/SRU from oracular

(cherry picked from commit 46c19dfa913c133042d62e0caa2d2d526cd9bb7f)

MP: https://code.launchpad.net/~philroche/livecd-rootfs/+git/livecd-rootfs/+merge/466388
2024-05-27 11:10:05 +01:00
Philip Roche
5507ca8d83 fix: No longer install LXD snap in unminimize script (LP: #2066905)
The LXD snap is no longer seeded in any images since Noble+ so the LXD related unminimize logic in
./live-build/auto/build?h=ubuntu/noble and ./live-build/ubuntu-server/hooks/01-unminimize.chroot_early
 is no longer required.

lxd-installer can remain installed.

(cherry picked from commit 46c19dfa913c133042d62e0caa2d2d526cd9bb7f)
2024-05-24 15:48:21 +01:00
Philip Roche
49a14274d1 d/ch update for 24.04.70 to re-enable ability to build HyperV desktop images (LP: #2064280) 2024-05-24 15:34:40 +01:00
Philip Roche
5f59eec085 fix(Hyperv Desktop): remove redundant case statement match ubuntu
`ubuntu` will never match `${PROJECT:-}:${SUBPROJECT:-}` cases statement and can be safely removed.

(cherry picked from commit 0945c40fb2bb067d86d496b7b40bdae89123124c)
2024-05-24 15:31:21 +01:00
Philip Roche
8cc079fe50 fix(Hyperv Desktop): as we are using oem-config we do not need ubiquity-slideshow-ubuntu
As we are only using oem-config, oem-config-slideshow-ubuntu will suffice

(cherry picked from commit 8fe26586cc1b65621e74121b03c912dcee0e6cf8)
2024-05-24 15:31:16 +01:00
Philip Roche
34edbb9a1c fix(Hyperv Desktop): ubiquity-frontend-gtk is a dependency of the oem-config-gtk package so does not need to be added explicitly
(cherry picked from commit dc2d1318d2d2183f6d80673a1daf5dc8794cd3ed)
2024-05-24 15:31:11 +01:00
Philip Roche
40c7eac14d feat(Hyperv Desktop): Disable cloud-init for Hyperv Desktop images (LP: #2064280)
For Ubuntu 24.04 and later cloud-init is included in desktop images. This is not applicable for Hyperv images so
we can disable cloud-init. This leaves the cloud-init package installed but disabled so users can still
use it if they want.

This is a documented way to disable cloud-init. See https://cloudinit.readthedocs.io/en/latest/howto/disable_cloud_init.html

(cherry picked from commit ff47664d8c646ebae72c40145ee1fd8098185de6)
2024-05-24 15:30:50 +01:00
Phil Roche
b12e271417 fix(HyperV desktop): Ensure removed hyperv dependencies are present in HyperV builds (LP: #2064280)
A change in 8fb21808 also removed many of the dependencies that the hyperv images require.
This removal has been restored in this commit by adding them expliciltly in the hyperv hook.

(cherry picked from commit c459e5e5af0371c0228bd4e5ddec57b8954d39df)
2024-05-24 15:30:45 +01:00
Phil Roche
fa351ac77b fix(HyperV desktop): Re-enable ability to build HyperV desktop images (LP: #2064280)
We have not built Hyperv desktop images since Jammy and with the re-introduction of HyperV for Noble we have encountered build issues caused by refactoring and removals of code assumed to be redundant but the HyperV desktop images were actually using these code paths.

In bbedffe6 we split the building of cloud images and non cloud to using an ddisk-image-uefi.binary and disk-image-uefi-non-cloud.binary respectively. In e38264ca there was a change which meant that any attempt to build hyperv images would result in incorrect disk size and incorrect disk label.

This has been fixed by ensuring that the ubuntu:desktop-preinstalled $PROJECT:$SUBPROJECT matches and sets the correct disk size and correct disk label.

A change in 76d79466 changed the logic of how the image size for amd64 images were being set. This overrode the sizes set for the desktop images incorrectly.

This commit ensures that any desktop image being created uses the correct image size.

(cherry picked from commit 48aed401949637ac314e59de996ccab19d5eefcd)
2024-05-24 15:30:38 +01:00
56 changed files with 626 additions and 328 deletions

116
debian/changelog vendored
View File

@ -1,9 +1,121 @@
livecd-rootfs (24.04.70) UNRELEASED; urgency=medium livecd-rootfs (24.04.84) noble; urgency=medium
[ Florent 'Skia' Jacquet ]
* Enable the HWE stack for 24.04.2. (LP: #2098105)
[ Utkarsh Gupta ]
* Bump HWE kernel track to 24.04 for ubuntu-core-desktop.
-- Utkarsh Gupta <utkarsh@ubuntu.com> Thu, 13 Feb 2025 03:15:12 +0530
livecd-rootfs (24.04.83) noble; urgency=medium
[ Carlos Nihelton ]
[ Didier Roche-Tolomelli ]
* Adapt to new Microsoft package format: (LP: #2091293)
- Keep a single wsl rootfs upgrade policy
- Create livecd-roots tarball as a .wsl extension
- Create wsl-distribution.conf for WSL images
-- Didier Roche-Tolomelli <didrocks@ubuntu.com> Thu, 23 Jan 2025 14:22:54 +0100
livecd-rootfs (24.04.82) noble; urgency=medium
* Add support for arm64+tegra-jetson flavor. (LP: #2091392)
-- Remy Martin <remy.martin@canonical.com> Fri, 13 Dec 2024 11:53:08 +0100
livecd-rootfs (24.04.81) noble; urgency=medium
* Introduce unminimize as a package in OCI images. (LP: #2078583)
-- Utkarsh Gupta <utkarsh@ubuntu.com> Wed, 20 Nov 2024 15:43:55 +0530
livecd-rootfs (24.04.80) noble; urgency=medium
* Explicitly create home directory for buildd system user to avoid issues
with installing and running snaps. (LP: #2083240)
-- jchittum <john.chittum@canonical.com> Wed, 06 Nov 2024 07:43:40 -0500
livecd-rootfs (24.04.79) noble; urgency=medium
* Add apparmor policy permstable32 missing component (LP: #2084698)
-- Thomas Bechtold <thomas.bechtold@canonical.com> Fri, 18 Oct 2024 13:54:51 +0200
livecd-rootfs (24.04.78) noble; urgency=medium
* add cpc-sbom to create_manifest calls to generate sboms (LP: #2077105)
-- jchittum <john.chittum@canonical.com> Mon, 26 Aug 2024 14:15:05 -0400
livecd-rootfs (24.04.77.1) noble; urgency=medium
* Hotfix upload outside of git history, real change from 24.04.79.
* Update ubuntu-classic-2404-amd64 model in ubuntu hooks. (LP: #2077899)
-- Chris Peterson <chris.peterson@canonical.com> Mon, 26 Aug 2024 16:57:12 -0700
livecd-rootfs (24.04.77) noble; urgency=medium
* Drop unminimize spit out by livecd-rootfs. (LP: #2077695)
* Use packaged unminimize in the ubuntu-server images.
-- Utkarsh Gupta <utkarsh@ubuntu.com> Wed, 21 Aug 2024 12:08:44 +0530
livecd-rootfs (24.04.76) noble; urgency=medium
* Force latest/stable/ubuntu-24.10 subiquity onto the ubuntu-core-installer
ISO for now. (LP: #2077495)
-- Michael Hudson-Doyle <michael.hudson@ubuntu.com> Wed, 21 Aug 2024 16:13:58 +1200
livecd-rootfs (24.04.75) noble; urgency=medium
* Add 'ubuntu-core-installer' project. (LP: #2076307)
-- Michael Hudson-Doyle <michael.hudson@ubuntu.com> Tue, 30 Jul 2024 16:35:31 +1200
livecd-rootfs (24.04.74) noble; urgency=medium
* riscv64: preinstalled server image for Microchip PIC64GX Curiosity Kit
(LP: #2072956)
-- Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Mon, 08 Jul 2024 17:51:25 +0200
livecd-rootfs (24.04.73) noble; urgency=medium
* Build qcow2 images for ubuntu-core LXD support (LP: #2072759).
-- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Thu, 11 Jul 2024 13:15:43 +0200
livecd-rootfs (24.04.72) noble; urgency=medium
[ Heinrich Schuchardt ]
* riscv64: use earlycon=sbi on command line (LP: #2068739)
[ Philip Roche ]
* Revert removal of unminimize call in server builds (LP: #2069828)
-- Philip Roche <phil.roche@canonical.com> Mon, 24 Jun 2024 14:24:52 +0100
livecd-rootfs (24.04.71) noble; urgency=medium
* Re-enable ability to build HyperV desktop images (LP: #2064280)
-- Philip Roche <phil.roche@canonical.com> Mon, 27 May 2024 12:05:33 +0100
livecd-rootfs (24.04.70) noble; urgency=medium
[ Łukasz 'sil2100' Zemczak ]
* Add experimental support for building ubuntu-core-desktop installer images * Add experimental support for building ubuntu-core-desktop installer images
(LP: #2063203) (LP: #2063203)
-- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Wed, 24 Apr 2024 10:53:27 +0100 [ Philip Roche ]
* No longer install LXD snap in unminimize script (LP: #2066905)
-- Philip Roche <phil.roche@canonical.com> Fri, 24 May 2024 15:47:48 +0100
livecd-rootfs (24.04.69) noble; urgency=medium livecd-rootfs (24.04.69) noble; urgency=medium

View File

@ -0,0 +1 @@
allow deny subtree cond kill complain prompt audit quiet hide xindex tag label

View File

@ -37,6 +37,11 @@ if [ "${IMAGEFORMAT:-}" = "ubuntu-image" ] \
# we should be supporting more than one for models that # we should be supporting more than one for models that
# define those. # define those.
mv output/*.img "$PREFIX".img mv output/*.img "$PREFIX".img
# For standard, non-platform-specific core images, prepare a
# qcow2 image as well for LXD consumption.
if [ -z "${SUBARCH:-}" ]; then
convert_to_qcow2 "$PREFIX".img "$PREFIX".qcow2
fi
xz -0 -T4 "$PREFIX".img xz -0 -T4 "$PREFIX".img
mv output/seed.manifest "$PREFIX".manifest mv output/seed.manifest "$PREFIX".manifest
@ -180,128 +185,6 @@ EOF
# Remove docs installed by bootstrap # Remove docs installed by bootstrap
Chroot chroot dpkg-query -f '${binary:Package}\n' -W | Chroot chroot xargs -L1 apt-get install --reinstall Chroot chroot dpkg-query -f '${binary:Package}\n' -W | Chroot chroot xargs -L1 apt-get install --reinstall
# Add unminimizer script which restores default image behavior
mkdir -p chroot/usr/local/sbin
cat > chroot/usr/local/sbin/unminimize <<'EOF'
#!/bin/sh
set -e
echo "This system has been minimized by removing packages and content that are"
echo "not required on a system that users do not log into."
echo ""
echo "This script restores content and packages that are found on a default"
echo "Ubuntu server system in order to make this system more suitable for"
echo "interactive use."
echo ""
echo "Reinstallation of packages may fail due to changes to the system"
echo "configuration, the presence of third-party packages, or for other"
echo "reasons."
echo ""
echo "This operation may take some time."
echo ""
read -p "Would you like to continue? [y/N] " REPLY
echo # (optional) move to a new line
if [ "$REPLY" != "y" ] && [ "$REPLY" != "Y" ]
then
exit 1
fi
if [ -f /etc/dpkg/dpkg.cfg.d/excludes ] || [ -f /etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp ]; then
echo "Re-enabling installation of all documentation in dpkg..."
if [ -f /etc/dpkg/dpkg.cfg.d/excludes ]; then
mv /etc/dpkg/dpkg.cfg.d/excludes /etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp
fi
echo "Updating package list and upgrading packages..."
apt-get update
# apt-get upgrade asks for confirmation before upgrading packages to let the user stop here
apt-get upgrade
echo "Restoring system documentation..."
echo "Reinstalling packages with files in /usr/share/man/ ..."
# Reinstallation takes place in two steps because a single dpkg --verified
# command generates very long parameter list for "xargs dpkg -S" and may go
# over ARG_MAX. Since many packages have man pages the second download
# handles a much smaller amount of packages.
dpkg -S /usr/share/man/ |sed 's|, |\n|g;s|: [^:]*$||' | DEBIAN_FRONTEND=noninteractive xargs apt-get install --reinstall -y
echo "Reinstalling packages with system documentation in /usr/share/doc/ .."
# This step processes the packages which still have missing documentation
dpkg --verify --verify-format rpm | awk '$2 ~ /\/usr\/share\/doc/ {print $2}' | sed 's|/[^/]*$||' | sort | uniq \
| xargs dpkg -S | sed 's|, |\n|g;s|: [^:]*$||' | uniq | DEBIAN_FRONTEND=noninteractive xargs apt-get install --reinstall -y
echo "Restoring system translations..."
# This step processes the packages which still have missing translations
dpkg --verify --verify-format rpm | awk '$2 ~ /\/usr\/share\/locale/ {print $2}' | sed 's|/[^/]*$||' | sort | uniq \
| xargs dpkg -S | sed 's|, |\n|g;s|: [^:]*$||' | uniq | DEBIAN_FRONTEND=noninteractive xargs apt-get install --reinstall -y
if dpkg --verify --verify-format rpm | awk '$2 ~ /\/usr\/share\/doc/ {exit 1}'; then
echo "Documentation has been restored successfully."
rm /etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp
else
echo "There are still files missing from /usr/share/doc/:"
dpkg --verify --verify-format rpm | awk '$2 ~ /\/usr\/share\/doc/ {print " " $2}'
echo "You may want to try running this script again or you can remove"
echo "/etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp and restore the files manually."
fi
fi
if [ "$(dpkg-divert --truename /usr/bin/man)" = "/usr/bin/man.REAL" ]; then
# Remove diverted man binary
rm -f /usr/bin/man
dpkg-divert --quiet --remove --rename /usr/bin/man
fi
EOF
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'
if ! dpkg-query --show --showformat='${db:Status-Status}\n' ubuntu-minimal 2> /dev/null | grep -q '^installed$'; then
echo "Installing ubuntu-minimal package to provide the familiar Ubuntu minimal system..."
DEBIAN_FRONTEND=noninteractive apt-get install -y ubuntu-minimal ubuntu-standard
fi
if dpkg-query --show --showformat='${db:Status-Status}\n' ubuntu-server 2> /dev/null | grep -q '^installed$' \
&& ! dpkg-query --show --showformat='${db:Status-Status}\n' landscape-common 2> /dev/null | grep -q '^installed$'; then
echo "Installing ubuntu-server recommends..."
DEBIAN_FRONTEND=noninteractive apt-get install -y landscape-common
fi
EOF
fi
if [ "$PROJECT" = "ubuntu-cpc" ]; then
# we'd like to transform a minimized image to a base image
# when unminimize is run.
cat >> chroot/usr/local/sbin/unminimize <<'EOF'
# even if ubuntu-server is installed, we should re-install it with --fix-policy --install-recommends
# to ensure all the Recommends of dependencies of ubuntu-server are installed, which aids in transforming
# this minimized image to an equivalent base image.
DEBIAN_FRONTEND=noninteractive apt-get --reinstall --fix-policy --install-recommends install -y ubuntu-server
if dpkg-query --show --showformat='${db:Status-Status}\n' linux-image-virtual 2> /dev/null | grep -q '^installed$'; then
echo "Installing linux-virtual for installing the headers which were stripped in a minimized image"
DEBIAN_FRONTEND=noninteractive apt-get install -y linux-virtual
fi
EOF
fi
if [ "$PROJECT" = "ubuntu-cpc" ] || [ "$PROJECT" = "ubuntu-server" ]; then
cat >> chroot/usr/local/sbin/unminimize <<'EOF'
# installing LXD using the lxd-installer by simply invoking it
echo "Invoking LXD so that it can be installed by the lxd-installer's script.."
lxd --version
echo "Removing lxd installer package..."
apt-get purge -y lxd-installer
EOF
fi
cat >> chroot/usr/local/sbin/unminimize <<'EOF'
# unminimization succeeded, there is no need to mention it in motd
rm -f /etc/update-motd.d/60-unminimize
EOF
chmod +x chroot/usr/local/sbin/unminimize
# inform users about the unminimize script # inform users about the unminimize script
cat > "chroot/etc/update-motd.d/60-unminimize" << EOF cat > "chroot/etc/update-motd.d/60-unminimize" << EOF

View File

@ -4,13 +4,14 @@ set -e
case $ARCH:$SUBARCH in case $ARCH:$SUBARCH in
amd64:|amd64:generic|amd64:intel-iot|\ amd64:|amd64:generic|amd64:intel-iot|\
arm64:|arm64:generic|arm64:raspi|arm64:snapdragon|\ arm64:|arm64:generic|arm64:raspi|arm64:snapdragon|\
arm64:tegra|arm64:tegra-igx|arm64:x13s|arm64:largemem|\ arm64:tegra|arm64:tegra-igx|arm64:tegra-jetson|\
arm64:x13s|arm64:largemem|\
armhf:|\ armhf:|\
i386:|\ i386:|\
ppc64el:|\ ppc64el:|\
riscv64:|riscv64:generic|riscv64:icicle|riscv64:licheerv|\ riscv64:|riscv64:generic|riscv64:icicle|riscv64:licheerv|\
riscv64:milkvmars|riscv64:nezha|riscv64:unmatched|riscv64:visionfive|\ riscv64:milkvmars|riscv64:nezha|riscv64:pic64gx|riscv64:unmatched|\
riscv64:visionfive2|\ riscv64:visionfive|riscv64:visionfive2|\
s390x:|\ s390x:|\
*appliance*) *appliance*)
;; ;;
@ -372,7 +373,7 @@ if [ -z "${IMAGEFORMAT:-}" ]; then
# All raspi images use ubuntu-image. # All raspi images use ubuntu-image.
IMAGEFORMAT=ubuntu-image IMAGEFORMAT=ubuntu-image
;; ;;
arm64+tegra|arm64+tegra-igx) arm64+tegra|arm64+tegra-igx|arm64+tegra-jetson)
# Pre-installed Tegra images use # Pre-installed Tegra images use
# ubuntu-image # ubuntu-image
IMAGEFORMAT=ubuntu-image IMAGEFORMAT=ubuntu-image
@ -382,7 +383,7 @@ if [ -z "${IMAGEFORMAT:-}" ]; then
;; ;;
esac esac
;; ;;
ubuntu-server:live|ubuntu-mini-iso:) ubuntu-server:live|ubuntu-mini-iso:|ubuntu-core-installer:)
IMAGEFORMAT=plain IMAGEFORMAT=plain
;; ;;
esac esac
@ -396,6 +397,7 @@ if [ "$IMAGEFORMAT" = "ext4" ] && [ "$PROJECT" = "ubuntu-cpc" ]; then
riscv64:licheerv | \ riscv64:licheerv | \
riscv64:milkvmars | \ riscv64:milkvmars | \
riscv64:nezha | \ riscv64:nezha | \
riscv64:pic64gx | \
riscv64:unmatched | \ riscv64:unmatched | \
riscv64:visionfive | \ riscv64:visionfive | \
riscv64:visionfive2 | \ riscv64:visionfive2 | \
@ -421,7 +423,7 @@ case $IMAGEFORMAT in
;; ;;
plain) plain)
case $PROJECT:${SUBPROJECT:-} in case $PROJECT:${SUBPROJECT:-} in
ubuntu-server:live) ubuntu-server:live|ubuntu-core-installer:)
touch config/universe-enabled touch config/universe-enabled
;; ;;
ubuntu-mini-iso:) ubuntu-mini-iso:)
@ -450,6 +452,8 @@ case $IMAGEFORMAT in
MODEL=tegra ;; MODEL=tegra ;;
arm64+tegra-igx) arm64+tegra-igx)
MODEL=tegra-igx ;; MODEL=tegra-igx ;;
arm64+tegra-jetson)
MODEL=tegra-jetson ;;
arm64+*) arm64+*)
MODEL=pc-arm64 ;; MODEL=pc-arm64 ;;
*) *)
@ -841,7 +845,7 @@ case $PROJECT in
ubuntu-core-desktop) ubuntu-core-desktop)
touch config/universe-enabled touch config/universe-enabled
KERNEL_FLAVOURS='generic-hwe-22.04' KERNEL_FLAVOURS='generic-hwe-24.04'
PASSES_TO_LAYERS="true" PASSES_TO_LAYERS="true"
# the minimal layer, for minimal installs # the minimal layer, for minimal installs
@ -876,6 +880,7 @@ case $PROJECT in
add_task install minimal standard add_task install minimal standard
add_task install kubuntu-desktop add_task install kubuntu-desktop
LIVE_TASK='kubuntu-live' LIVE_TASK='kubuntu-live'
KERNEL_FLAVOURS='generic-hwe-24.04'
add_chroot_hook remove-gnome-icon-cache add_chroot_hook remove-gnome-icon-cache
;; ;;
@ -885,7 +890,7 @@ case $PROJECT in
MINIMAL_TASKS=edubuntu-desktop-gnome-minimal MINIMAL_TASKS=edubuntu-desktop-gnome-minimal
MINIMAL_DESC="A minimal installation of the Edubuntu Desktop." MINIMAL_DESC="A minimal installation of the Edubuntu Desktop."
STANDARD_TASKS=edubuntu-desktop-gnome STANDARD_TASKS=edubuntu-desktop-gnome
KERNEL_FLAVOURS=generic KERNEL_FLAVOURS='generic-hwe-24.04'
do_layered_desktop_image do_layered_desktop_image
;; ;;
@ -894,20 +899,21 @@ case $PROJECT in
UCFLAVOUR="Ubuntu Cinnamon" UCFLAVOUR="Ubuntu Cinnamon"
HAS_MINIMAL=yes HAS_MINIMAL=yes
MINIMAL_DESC="A minimal installation of the $UCFLAVOUR Desktop." MINIMAL_DESC="A minimal installation of the $UCFLAVOUR Desktop."
KERNEL_FLAVOURS=generic KERNEL_FLAVOURS='generic-hwe-24.04'
do_layered_desktop_image do_layered_desktop_image
;; ;;
lubuntu|ubuntu-unity) lubuntu|ubuntu-unity)
add_task install minimal standard ${PROJECT}-desktop add_task install minimal standard ${PROJECT}-desktop
LIVE_TASK=${PROJECT}-live LIVE_TASK=${PROJECT}-live
KERNEL_FLAVOURS='generic-hwe-24.04'
;; ;;
ubuntukylin) ubuntukylin)
# Ubuntu Kylin now ships the new installer. # Ubuntu Kylin now ships the new installer.
UCFLAVOUR="Ubuntu Kylin" UCFLAVOUR="Ubuntu Kylin"
HAS_MINIMAL=yes HAS_MINIMAL=yes
MINIMAL_DESC="A minimal installation of the $UCFLAVOUR Desktop." MINIMAL_DESC="A minimal installation of the $UCFLAVOUR Desktop."
KERNEL_FLAVOURS=generic KERNEL_FLAVOURS='generic-hwe-24.04'
do_layered_desktop_image do_layered_desktop_image
;; ;;
@ -917,7 +923,7 @@ case $PROJECT in
MINIMAL_TASKS=xubuntu-minimal MINIMAL_TASKS=xubuntu-minimal
MINIMAL_NAME="Xubuntu Minimal" MINIMAL_NAME="Xubuntu Minimal"
MINIMAL_DESC="A minimal installation of the Xubuntu Desktop." MINIMAL_DESC="A minimal installation of the Xubuntu Desktop."
KERNEL_FLAVOURS=generic KERNEL_FLAVOURS='generic-hwe-24.04'
case ${SUBPROJECT:-} in case ${SUBPROJECT:-} in
minimal) minimal)
HAS_STANDARD=no HAS_STANDARD=no
@ -943,7 +949,7 @@ case $PROJECT in
HAS_MINIMAL=yes HAS_MINIMAL=yes
MINIMAL_TASKS=ubuntu-mate-core MINIMAL_TASKS=ubuntu-mate-core
MINIMAL_DESC="A minimal installation of the $UCFLAVOUR Desktop." MINIMAL_DESC="A minimal installation of the $UCFLAVOUR Desktop."
KERNEL_FLAVOURS=generic KERNEL_FLAVOURS='generic-hwe-24.04'
do_layered_desktop_image do_layered_desktop_image
;; ;;
@ -952,7 +958,7 @@ case $PROJECT in
UCFLAVOUR="Ubuntu Studio" UCFLAVOUR="Ubuntu Studio"
STANDARD_TASKS="ubuntustudio-desktop ubuntustudio-audio ubuntustudio-graphics ubuntustudio-video ubuntustudio-photography" STANDARD_TASKS="ubuntustudio-desktop ubuntustudio-audio ubuntustudio-graphics ubuntustudio-video ubuntustudio-photography"
LIVE_TASK=ubuntustudio-dvd-live LIVE_TASK=ubuntustudio-dvd-live
KERNEL_FLAVOURS=lowlatency KERNEL_FLAVOURS='lowlatency-hwe-24.04'
do_layered_desktop_image do_layered_desktop_image
;; ;;
@ -982,13 +988,14 @@ case $PROJECT in
tegra-igx) tegra-igx)
variants='tegra-igx' variants='tegra-igx'
;; ;;
tegra-jetson)
variants='tegra-jetson'
;;
largemem) largemem)
# variants='ga-64k hwe-64k' variants='ga-64k hwe-64k'
variants='ga-64k'
;; ;;
*) *)
# variants='ga hwe' variants='ga hwe'
variants='ga'
;; ;;
esac esac
@ -1014,6 +1021,9 @@ case $PROJECT in
elif [ "$variant" = "tegra-igx" ]; then elif [ "$variant" = "tegra-igx" ]; then
kernel_metapkg=linux-nvidia-tegra-igx kernel_metapkg=linux-nvidia-tegra-igx
flavor=nvidia-tegra-igx flavor=nvidia-tegra-igx
elif [ "$variant" = "tegra-jetson" ]; then
kernel_metapkg=linux-nvidia-tegra-jetson
flavor=nvidia-tegra-jetson
else else
echo "bogus variant: $variant" echo "bogus variant: $variant"
exit 1 exit 1
@ -1046,6 +1056,22 @@ case $PROJECT in
PREINSTALL_POOL_SEEDS='server-ship' PREINSTALL_POOL_SEEDS='server-ship'
;; ;;
ubuntu-core-installer)
# The ubuntu-core-installer image is an installer that installs ubuntu
# core. The environment the installer runs in is similar to the server
# installer but it has a source catalog entry that points to the model
# created in ubuntu-core-installer/hooks/05-prepare-image.binary, which
# subiquity knows how to install.
OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal"
PASSES_TO_LAYERS=true
add_task base server-minimal server
add_task base.live server-live
add_package base.live linux-image-generic
/usr/share/livecd-rootfs/checkout-translations-branch \
https://git.launchpad.net/subiquity po config/catalog-translations
;;
ubuntu-mini-iso) ubuntu-mini-iso)
OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal" OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal"
@ -1065,10 +1091,21 @@ case $PROJECT in
esac esac
;; ;;
ubuntu-base|ubuntu-oci) ubuntu-base)
OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal" OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal"
;; ;;
ubuntu-oci)
OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal"
if [ "${SUBPROJECT:-}" = minimized ]; then
# As unminimize has been spit out from livecd-rootfs into a new
# separate pacakge, users have been reporting this as a regression for
# Noble. So we'd like to add the unminimize package; cf: LP: #2078583.
APT_OPTIONS="${APT_OPTIONS:+$APT_OPTIONS }--no-install-recommends"
add_package install unminimize
fi
;;
ubuntu-wsl) ubuntu-wsl)
add_task install minimal ubuntu-wsl add_task install minimal ubuntu-wsl
OPTS="${OPTS:+$OPTS }--linux-packages=none --initramfs=none" OPTS="${OPTS:+$OPTS }--linux-packages=none --initramfs=none"
@ -1229,7 +1266,7 @@ case "$ARCH${SUBARCH:++$SUBARCH}" in
add_package install linux-firmware-raspi pi-bluetooth u-boot-rpi u-boot-tools add_package install linux-firmware-raspi pi-bluetooth u-boot-rpi u-boot-tools
BINARY_REMOVE_LINUX=false BINARY_REMOVE_LINUX=false
;; ;;
arm64+tegra|arm64+tegra-igx) arm64+tegra|arm64+tegra-igx|arm64+tegra-jetson)
# Common configuration for all NVIDIA Tegra image variants # Common configuration for all NVIDIA Tegra image variants
# (server, desktop etc.) # (server, desktop etc.)
KERNEL_FLAVOURS="nvidia-$SUBARCH" KERNEL_FLAVOURS="nvidia-$SUBARCH"
@ -1241,7 +1278,7 @@ case "$ARCH${SUBARCH:++$SUBARCH}" in
esac esac
case $PROJECT:${SUBPROJECT:-} in case $PROJECT:${SUBPROJECT:-} in
ubuntu-server:*|ubuntu-base:*|ubuntu-oci:*) ubuntu-server:*|ubuntu-base:*|ubuntu-oci:*|ubuntu-core-installer:*)
OPTS="${OPTS:+$OPTS }--linux-packages=none --initramfs=none" OPTS="${OPTS:+$OPTS }--linux-packages=none --initramfs=none"
KERNEL_FLAVOURS=none KERNEL_FLAVOURS=none
BINARY_REMOVE_LINUX=false BINARY_REMOVE_LINUX=false
@ -1438,7 +1475,7 @@ case $PROJECT:${SUBPROJECT:-} in
ubuntu-cpc:*|ubuntu-server:live|ubuntu:desktop-preinstalled| \ ubuntu-cpc:*|ubuntu-server:live|ubuntu:desktop-preinstalled| \
ubuntu-wsl:*|ubuntu-mini-iso:*|ubuntu:|ubuntu-oem:*| \ ubuntu-wsl:*|ubuntu-mini-iso:*|ubuntu:|ubuntu-oem:*| \
ubuntustudio-dvd:*|edubuntu:*|ubuntu-budgie:*|ubuntucinnamon:*|xubuntu:*| \ ubuntustudio-dvd:*|edubuntu:*|ubuntu-budgie:*|ubuntucinnamon:*|xubuntu:*| \
ubuntukylin:*|ubuntu-mate:*|ubuntu-core-desktop:*) ubuntukylin:*|ubuntu-mate:*|ubuntu-core-desktop:*|ubuntu-core-installer:*)
# Ensure that most things e.g. includes.chroot are copied as is # Ensure that most things e.g. includes.chroot are copied as is
for entry in /usr/share/livecd-rootfs/live-build/${PROJECT}/*; do for entry in /usr/share/livecd-rootfs/live-build/${PROJECT}/*; do
case $entry in case $entry in

View File

@ -4,6 +4,7 @@ set -e
# Create the buildd user and group. # Create the buildd user and group.
addgroup --gid 2501 buildd addgroup --gid 2501 buildd
adduser --system --disabled-password --gecos 'Build Daemon user' \ adduser --system --disabled-password --gecos 'Build Daemon user' \
--ingroup buildd --uid 2001 --shell /bin/bash buildd --ingroup buildd --uid 2001 --shell /bin/bash --home /home/buildd \
buildd
mkdir -p /build/buildd mkdir -p /build/buildd
chown buildd:buildd /build/buildd chown buildd:buildd /build/buildd

View File

@ -39,6 +39,10 @@ create_empty_disk_image() {
create_manifest() { create_manifest() {
local chroot_root=${1} local chroot_root=${1}
local target_file=${2} local target_file=${2}
local base_default_sbom_name="ubuntu-cloud-image-$(grep "VERSION_ID" $chroot_root/etc/os-release | cut --delimiter "=" --field 2 | tr -d '"')-${ARCH}-$(date +%Y%m%dT%H:%M:%S)"
local sbom_file_name=${3:-"${base_default_sbom_name}.spdx"}
local sbom_document_name=${4:-"${base_default_sbom_name}"}
local sbom_log=${sbom_document_name}.log
echo "create_manifest chroot_root: ${chroot_root}" echo "create_manifest chroot_root: ${chroot_root}"
dpkg-query --show --admindir="${chroot_root}/var/lib/dpkg" > ${target_file} dpkg-query --show --admindir="${chroot_root}/var/lib/dpkg" > ${target_file}
echo "create_manifest call to dpkg-query finished." echo "create_manifest call to dpkg-query finished."
@ -48,6 +52,22 @@ create_manifest() {
echo "create_manifest creating file listing." echo "create_manifest creating file listing."
local target_filelist=${2%.manifest}.filelist local target_filelist=${2%.manifest}.filelist
(cd "${chroot_root}" && find -xdev) | sort > "${target_filelist}" (cd "${chroot_root}" && find -xdev) | sort > "${target_filelist}"
# only creating sboms for CPC project at this time
if [[ ! $(which cpc-sbom) ]]; then
# ensure the tool is installed
sudo snap install --classic --edge cpc-sbom
fi
# generate the SBOM
cpc-sbom --rootdir ${chroot_root} --ignore-copyright-parsing-errors --ignore-copyright-file-not-found-errors --document-name ${sbom_document_name} >"${sbom_file_name}" 2>"${sbom_log}"
SBOM_GENERATION_EXIT_CODE=$?
if [[ ${SBOM_GENERATION_EXIT_CODE} != "0" ]]; then
# check for failure and print log
echo "ERROR: SBOM generation failed. See ${sbom_log}"
cat "$sbom_log"
exit 1
else
echo "SBOM generation succeeded. see ${sbom_log} for details"
fi
fi fi
echo "create_manifest finished" echo "create_manifest finished"
} }
@ -778,6 +798,12 @@ snap_preseed() {
exit 1 exit 1
fi fi
if [ $PROJECT = ubuntu-core-installer ] && [ $SNAP_NAME = subiquity ]; then
# The ubuntu-core-installer project requires features not yet
# present in the latest/ubuntu/stable-24.04 or stable branches.
CHANNEL=latest/ubuntu/stable-24.10
fi
_snap_preseed $CHROOT_ROOT $SNAP $CHANNEL _snap_preseed $CHROOT_ROOT $SNAP $CHANNEL
# Mark this image as having snapd installed explicitly. # Mark this image as having snapd installed explicitly.

View File

@ -0,0 +1,5 @@
#!/bin/sh -x
set -e
mkdir -p /lib/modules

View File

@ -0,0 +1,17 @@
#!/bin/bash -ex
# vi: ts=4 noexpandtab
if [ "${PASS}" != "base.live" ]; then
exit 0
fi
# Make sure NoCloud is last
values=$(echo get cloud-init/datasources | debconf-communicate | sed 's/^0 //;s/NoCloud, //;s/None/NoCloud, None/')
printf "%s\t%s\t%s\t%s\n" \
cloud-init cloud-init/datasources multiselect "$values" | debconf-set-selections
dpkg-reconfigure --frontend=noninteractive cloud-init
if [ `dpkg --print-architecture` = s390x ]; then
# because z/VM x3270 is just ttyS0
cp -r /usr/lib/systemd/system/serial-getty@sclp_line0.service.d /usr/lib/systemd/system/serial-getty@ttyS0.service.d
fi

View File

@ -0,0 +1,19 @@
#!/bin/bash -ex
# vi: ts=4 noexpandtab
case $PASS in
base.live)
;;
*)
exit 0
;;
esac
cat <<EOF > /etc/initramfs-tools/conf.d/casperize.conf
export CASPER_GENERATE_UUID=1
EOF
cat <<EOF > /etc/initramfs-tools/conf.d/default-layer.conf
LAYERFS_PATH=${PASS}.squashfs
EOF

View File

@ -0,0 +1,17 @@
#!/bin/bash -eux
# vi: ts=4 noexpandtab
case $PASS in
base.live)
;;
*)
exit 0
;;
esac
PROJECT=$PROJECT${SUBARCH:+-$SUBARCH}
# Fish out generated kernel image and initrd
mv chroot/boot/initrd.img-* ${PWD}/livecd.${PROJECT}.initrd-generic
mv chroot/boot/vmlinu?-* ${PWD}/livecd.${PROJECT}.kernel-generic
chmod a+r ${PWD}/livecd.${PROJECT}.initrd-generic ${PWD}/livecd.${PROJECT}.kernel-generic

View File

@ -0,0 +1,38 @@
#!/bin/bash
set -eux
case ${PASS:-} in
base.live)
;;
*)
exit 0
;;
esac
. config/binary
. config/functions
env SNAPPY_STORE_NO_CDN=1 snap known --remote model series=16 brand-id=canonical model=ubuntu-core-24-amd64 > config/ubuntu-core-24-amd64.model
env SNAPPY_STORE_NO_CDN=1 snap prepare-image \
config/ubuntu-core-24-amd64.model --snap console-conf chroot
mv chroot/system-seed/systems/* chroot/system-seed/systems/ubuntu-core-24-amd64
rsync -av chroot/system-seed/{systems,snaps} chroot/var/lib/snapd/seed
rm -rf chroot/system-seed
cat <<-EOF > config/edge.catalog-in.yaml
name: "Ubuntu Core 24"
description: >-
Ubuntu Core.
id: ubuntu-core
type: null
variant: core
locale_support: none
snapd_system_label: ubuntu-core-24-amd64
EOF
PROJECT_FULL=$PROJECT${SUBARCH:+-$SUBARCH}
usc_opts="--output livecd.${PROJECT_FULL}.install-sources.yaml \
--template config/edge.catalog-in.yaml \
--size 0"
/usr/share/livecd-rootfs/update-source-catalog $usc_opts

View File

@ -0,0 +1,117 @@
# The top level settings are used as module
# and system configuration.
# A set of users which may be applied and/or used by various modules
# when a 'default' entry is found it will reference the 'default_user'
# from the distro configuration specified below
users:
- default
# If this is set, 'root' will not be able to ssh in and they
# will get a message to login instead as the default $user
disable_root: true
# This will cause the set+update hostname module to not operate (if true)
preserve_hostname: true
ssh_pwauth: yes
chpasswd:
expire: false
# This is the initial network config.
# It can be overwritten by cloud-init or subiquity.
network:
version: 2
ethernets:
zz-all-en:
match:
name: "en*"
dhcp4: true
zz-all-eth:
match:
name: "eth*"
dhcp4: true
# We used to have a custom final_message here. Just use the default instead.
# Example datasource config
# datasource:
# Ec2:
# metadata_urls: [ 'blah.com' ]
# timeout: 5 # (defaults to 50 seconds)
# max_wait: 10 # (defaults to 120 seconds)
# The modules that run in the 'init' stage
cloud_init_modules:
- bootcmd
- write-files
- ca-certs
- rsyslog
- users-groups
- ssh
# The modules that run in the 'config' stage
cloud_config_modules:
# Emit the cloud config ready event
# this can be used by upstart jobs for 'start on cloud-config'.
- ssh-import-id
- set-passwords
- timezone
- disable-ec2-metadata
- runcmd
# The modules that run in the 'final' stage
cloud_final_modules:
- scripts-per-once
- scripts-user
- ssh-authkey-fingerprints
- keys-to-console
- phone-home
- final-message
# System and/or distro specific settings
# (not accessible to handlers/transforms)
system_info:
# This will affect which distro class gets used
distro: ubuntu
# Default user name + that default users groups (if added/used)
default_user:
name: installer
lock_passwd: false
gecos: Ubuntu
groups: [adm, audio, cdrom, dialout, dip, floppy, lxd, netdev, plugdev, sudo, video]
sudo: ["ALL=(ALL) NOPASSWD:ALL"]
shell: /usr/bin/subiquity-shell
# Automatically discover the best ntp_client
ntp_client: auto
# Other config here will be given to the distro class and/or path classes
paths:
cloud_dir: /var/lib/cloud/
templates_dir: /etc/cloud/templates/
upstart_dir: /etc/init/
package_mirrors:
- arches: [i386, amd64]
failsafe:
primary: http://archive.ubuntu.com/ubuntu
security: http://security.ubuntu.com/ubuntu
search:
primary:
- http://%(ec2_region)s.ec2.archive.ubuntu.com/ubuntu/
- http://%(availability_zone)s.clouds.archive.ubuntu.com/ubuntu/
- http://%(region)s.clouds.archive.ubuntu.com/ubuntu/
security: []
- arches: [arm64, armel, armhf]
failsafe:
primary: http://ports.ubuntu.com/ubuntu-ports
security: http://ports.ubuntu.com/ubuntu-ports
search:
primary:
- http://%(ec2_region)s.ec2.ports.ubuntu.com/ubuntu-ports/
- http://%(availability_zone)s.clouds.ports.ubuntu.com/ubuntu-ports/
- http://%(region)s.clouds.ports.ubuntu.com/ubuntu-ports/
security: []
- arches: [default]
failsafe:
primary: http://ports.ubuntu.com/ubuntu-ports
security: http://ports.ubuntu.com/ubuntu-ports
ssh_svcname: ssh

View File

@ -0,0 +1,4 @@
output: {all: '>> /var/log/cloud-init-output.log'}
no_ssh_fingerprints: true
ssh:
emit_keys_to_console: false

View File

@ -0,0 +1,2 @@
[Journal]
RateLimitIntervalSec=0

View File

@ -0,0 +1,4 @@
# systemd in 23.04+ uses a newer "compact" format by default which is not
# understood by the systemd libraries from jammy used in the subiquity snap.
[Service]
Environment="SYSTEMD_JOURNAL_COMPACT=0"

View File

@ -0,0 +1,4 @@
# systemd in 22.04+ uses "hash table hardening" by default which is not
# understood by the systemd libraries from focal used in the subiquity snap.
[Service]
Environment="SYSTEMD_JOURNAL_KEYED_HASH=0"

View File

@ -0,0 +1,3 @@
#!/bin/sh
exec sudo snap run subiquity

View File

@ -0,0 +1,3 @@
[Service]
ExecStart=
ExecStart=-/sbin/agetty --noclear -n --autologin ubuntu-core-installer %I $TERM

View File

@ -0,0 +1,8 @@
[Unit]
Description=Subiquity, the installer for Ubuntu Server %I
StartLimitInterval=0
[Service]
Environment=SNAP_REEXEC=0
ExecStart=
ExecStart=/usr/bin/snap run subiquity.subiquity-service %I

View File

@ -0,0 +1,4 @@
[Service]
StandardOutput=tty
ExecStart=
ExecStart=/usr/bin/snap run subiquity --ssh

View File

@ -0,0 +1,13 @@
[Unit]
IgnoreOnIsolate=yes
[Service]
Environment=SNAP_REEXEC=0
UtmpIdentifier=tty1
TTYPath=/dev/tty1
TTYReset=yes
TTYVHangup=yes
TTYVTDisallocate=yes
KillMode=process
IgnoreSIGPIPE=no
SendSIGHUP=yes

View File

@ -0,0 +1,2 @@
[Service]
Environment=SNAP_REEXEC=0

View File

@ -0,0 +1 @@
/lib/systemd/system/systemd-networkd.service

View File

@ -0,0 +1 @@
/lib/systemd/system/systemd-networkd-wait-online.service

View File

@ -0,0 +1 @@
/lib/systemd/system/systemd-networkd.socket

View File

@ -24,6 +24,6 @@ rm -rf $rootfs_dir/boot/grub
# Keep this as some derivatives mount a tempfs here # Keep this as some derivatives mount a tempfs here
mkdir -p $rootfs_dir/lib/modules mkdir -p $rootfs_dir/lib/modules
teardown_mountpoint $rootfs_dir create_manifest $rootfs_dir "livecd.ubuntu-cpc.rootfs.manifest" "livecd.ubuntu-cpc.rootfs.spdx" "cloud-image-rootfs-$ARCH-$(date +%Y%m%dT%H:%M:%S)"
create_manifest "${rootfs_dir}" "${rootfs_dir}.manifest" teardown_mountpoint $rootfs_dir

View File

@ -80,6 +80,8 @@ cp -a chroot/* mountpoint/
chroot mountpoint dpkg-query -W > binary/boot/filesystem.packages chroot mountpoint dpkg-query -W > binary/boot/filesystem.packages
(cd mountpoint && find -xdev) | sort > binary/boot/filesystem.filelist (cd mountpoint && find -xdev) | sort > binary/boot/filesystem.filelist
create_manifest "mountpoint/" "$PWD/livecd.ubuntu-cpc.disk-image.manifest" "$PWD/livecd.ubuntu-cpc.disk-image.spdx" "cloud-image-$ARCH-$(date +Y%m%dT%H:%M:%S)"
umount mountpoint umount mountpoint
rmdir mountpoint rmdir mountpoint

View File

@ -9,21 +9,6 @@ case $ARCH in
;; ;;
esac esac
case ${PROJECT:-}:${SUBPROJECT:-} in
ubuntu:)
echo "We don't create EFI images for Ubuntu Desktop."
exit 0
;;
ubuntu)
IMAGE_STR="# DESKTOP_IMG: This file was created/modified by the Desktop Image build process"
FS_LABEL="desktop-rootfs"
IMAGE_SIZE=12884901888 # 12G
;;
*)
IMAGE_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process"
FS_LABEL="cloudimg-rootfs"
;;
esac
if [ "$ARCH" = "amd64" ]; then if [ "$ARCH" = "amd64" ]; then
IMAGE_SIZE=3758096384 # bump to 3.5G (3584*1024**2); Since Kinetic amd64 need more then the default 2.2G IMAGE_SIZE=3758096384 # bump to 3.5G (3584*1024**2); Since Kinetic amd64 need more then the default 2.2G
@ -44,6 +29,22 @@ if [ "$ARCH" = "riscv64" ]; then
IMAGE_SIZE=4831838208 # bump to 4.5G (4608*1024**2); initrd creation fails with "No space left" with 3.5G IMAGE_SIZE=4831838208 # bump to 4.5G (4608*1024**2); initrd creation fails with "No space left" with 3.5G
fi fi
case ${PROJECT:-}:${SUBPROJECT:-} in
ubuntu:)
echo "We don't create EFI images for Ubuntu Desktop."
exit 0
;;
ubuntu:desktop-preinstalled)
IMAGE_STR="# DESKTOP_IMG: This file was created/modified by the Desktop Image build process"
FS_LABEL="desktop-rootfs"
IMAGE_SIZE=12884901888 # 12G
;;
*)
IMAGE_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process"
FS_LABEL="cloudimg-rootfs"
;;
esac
. config/binary . config/binary
. config/functions . config/functions
@ -104,7 +105,7 @@ create_partitions() {
--change-name=12:CIDATA \ --change-name=12:CIDATA \
--new=1:: \ --new=1:: \
--attributes=1:set:2 --attributes=1:set:2
elif [ "${SUBARCH:-}" = "icicle" ]; then elif [ "${SUBARCH:-}" = "icicle" ] || [ "${SUBARCH:-}" = "pic64gx" ]; then
# Microchip Icicle Kit # Microchip Icicle Kit
sgdisk "${disk_image}" \ sgdisk "${disk_image}" \
--set-alignment=2 \ --set-alignment=2 \
@ -327,6 +328,17 @@ install_grub() {
loader1="${loop_device}p13" loader1="${loop_device}p13"
dd if=mountpoint/usr/lib/u-boot/${SUBARCH}/u-boot-sunxi-with-spl.bin of=$loader1 dd if=mountpoint/usr/lib/u-boot/${SUBARCH}/u-boot-sunxi-with-spl.bin of=$loader1
;; ;;
"pic64gx")
cp ${my_d}/riscv64/grub/90_watchdog-thresh.cfg mountpoint/etc/default/grub.d/
# flash-kernel is needed to install the dtb for update-grub: it uses the
# /proc/device-tree/model value to pick the correct dtb and as we are in a chroot,
# the model value is wrong and we need to use /etc/flash-kernel/machine instead.
chroot mountpoint bash -c "echo 'Microchip PIC64GX Curiosity Kit' > /etc/flash-kernel/machine"
# u-boot-pic64gx contains the vendor U-Boot
chroot mountpoint apt-get install -qqy u-boot-pic64gx
loader="${loop_device}p13"
dd if=mountpoint/usr/lib/u-boot-pic64gx/u-boot.payload of=$loader
;;
"visionfive") "visionfive")
# flash-kernel is needed to install the dtb for update-grub: it uses the # flash-kernel is needed to install the dtb for update-grub: it uses the
# /proc/device-tree/model value to pick the correct dtb and as we are in a chroot, # /proc/device-tree/model value to pick the correct dtb and as we are in a chroot,

View File

@ -184,7 +184,8 @@ install_grub() {
mount mount
# create sorted filelist as the very last step before unmounting # create sorted filelist as the very last step before unmounting
(cd mountpoint && find -xdev) | sort > binary/boot/filesystem.filelist # explicitly generate manifest and sbom
create_manifest "mountpoint/" "$PWD/livecd.ubuntu-cpc.disk-uefi.manifest" "$PWD/livecd.ubuntu-cpc.disk-uefi.spdx" "cloud-image-$ARCH-$(date +%Y%m%dT%H:%M:%S)"
umount_partition mountpoint umount_partition mountpoint
rmdir mountpoint rmdir mountpoint
@ -201,6 +202,7 @@ make_ext4_partition "${rootfs_dev_mapper}"
mkdir mountpoint mkdir mountpoint
mount "${rootfs_dev_mapper}" mountpoint mount "${rootfs_dev_mapper}" mountpoint
cp -a chroot/* mountpoint/ cp -a chroot/* mountpoint/
umount mountpoint umount mountpoint
rmdir mountpoint rmdir mountpoint

View File

@ -158,6 +158,8 @@ EOF
$ZIPL_EXTRA_PARAMS $ZIPL_EXTRA_PARAMS
fi fi
create_manifest "mountpoint/" "$PWD/livecd.ubuntu-cpc.disk-image.manifest" "$PWD/livecd.ubuntu-cpc.disk-image.spdx" "cloud-image-$ARCH-$(date +%Y%m%dT%H:%M:%S)"
if [ -n "$BOOT_MOUNTPOINT" ]; then if [ -n "$BOOT_MOUNTPOINT" ]; then
umount "mountpoint/$BOOT_MOUNTPOINT" umount "mountpoint/$BOOT_MOUNTPOINT"
fi fi

View File

@ -2,8 +2,17 @@
. config/functions . config/functions
qcow_file=${PWD}/livecd.ubuntu-cpc.qcow
if [ -f binary/boot/disk-uefi.ext4 ]; then if [ -f binary/boot/disk-uefi.ext4 ]; then
convert_to_qcow2 binary/boot/disk-uefi.ext4 livecd.ubuntu-cpc.img convert_to_qcow2 binary/boot/disk-uefi.ext4 livecd.ubuntu-cpc.img
uefi_file="livecd.ubuntu-cpc.disk-uefi"
cp ${uefi_file}.manifest ${qcow_file}.manifest
cp ${uefi_file}.filelist ${qcow_file}.filelist
cp ${uefi_file}.spdx ${qcow_file}.spdx
elif [ -f binary/boot/disk.ext4 ]; then elif [ -f binary/boot/disk.ext4 ]; then
convert_to_qcow2 binary/boot/disk.ext4 livecd.ubuntu-cpc.img convert_to_qcow2 binary/boot/disk.ext4 livecd.ubuntu-cpc.img
disk_file="livecd.ubuntu-cpc.disk-image"
cp ${disk_file}.manifest ${qcow_file}.manifest
cp ${disk_file}.filelist ${qcow_file}.filelist
cp ${disk_file}.spdx ${qcow_file}.spdx
fi fi

View File

@ -1,4 +1,4 @@
# Booting on many riscv64 systems is slow. Let the user view progress. # Booting on many riscv64 systems is slow. Let the user view progress.
# For minimum output use # For minimum output use
# GRUB_CMDLINE_LINUX_DEFAULT="quiet" # GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX_DEFAULT="efi=debug earlycon" GRUB_CMDLINE_LINUX_DEFAULT="efi=debug earlycon=sbi"

View File

@ -1 +1 @@
U_BOOT_PARAMETERS="ro efi=debug earlycon" U_BOOT_PARAMETERS="ro efi=debug earlycon=sbi"

View File

@ -15,8 +15,11 @@ rootfs_dir=rootfs.dir
squashfs_f="$PWD/livecd.ubuntu-cpc.squashfs" squashfs_f="$PWD/livecd.ubuntu-cpc.squashfs"
cp $rootfs_dir.manifest $squashfs_f.manifest cp livecd.ubuntu-cpc.rootfs.manifest ${squashfs_f}.manifest
cp livecd.ubuntu-cpc.rootfs.filelist ${squashfs_f}.filelist
cp livecd.ubuntu-cpc.rootfs.spdx ${squashfs_f}.spdx
# fstab is omitted from the squashfs # fstab is omitted from the squashfs
grep -v '^/etc/fstab$' $rootfs_dir.filelist >$squashfs_f.filelist grep -v '^/etc/fstab$' livecd.ubuntu-cpc.rootfs.filelist >$squashfs_f.filelist
create_squashfs $rootfs_dir $squashfs_f create_squashfs $rootfs_dir $squashfs_f

View File

@ -11,6 +11,4 @@ fi
# This is the directory created by create-root-dir.binary # This is the directory created by create-root-dir.binary
rootfs_dir=rootfs.dir rootfs_dir=rootfs.dir
cp $rootfs_dir.manifest livecd.ubuntu-cpc.rootfs.manifest
cp $rootfs_dir.filelist livecd.ubuntu-cpc.rootfs.filelist
(cd $rootfs_dir/ && tar -c --sort=name --xattrs *) | xz > livecd.ubuntu-cpc.rootfs.tar.xz (cd $rootfs_dir/ && tar -c --sort=name --xattrs *) | xz > livecd.ubuntu-cpc.rootfs.tar.xz

View File

@ -6,3 +6,6 @@ provides livecd.ubuntu-cpc.initrd-generic
provides livecd.ubuntu-cpc.kernel-generic provides livecd.ubuntu-cpc.kernel-generic
provides livecd.ubuntu-cpc.manifest provides livecd.ubuntu-cpc.manifest
provides livecd.ubuntu-cpc.filelist provides livecd.ubuntu-cpc.filelist
provides livecd.ubuntu-cpc.disk-image.manifest
provides livecd.ubuntu-cpc.disk-image.filelist
provides livecd.ubuntu-cpc.disk-image.spdx

View File

@ -4,3 +4,6 @@ provides livecd.ubuntu-cpc.initrd-generic
provides livecd.ubuntu-cpc.kernel-generic provides livecd.ubuntu-cpc.kernel-generic
provides livecd.ubuntu-cpc.manifest provides livecd.ubuntu-cpc.manifest
provides livecd.ubuntu-cpc.filelist provides livecd.ubuntu-cpc.filelist
provides livecd.ubuntu-cpc.disk-uefi.manifest
provides livecd.ubuntu-cpc.disk-uefi.filelist
provides livecd.ubuntu-cpc.disk-uefi.spdx

View File

@ -1,3 +1,6 @@
depends disk-image depends disk-image
base/qcow2-image.binary base/qcow2-image.binary
provides livecd.ubuntu-cpc.img provides livecd.ubuntu-cpc.img
provides livecd.ubuntu-cpc.qcow.manifest
provides livecd.ubuntu-cpc.qcow.filelist
provides livecd.ubuntu-cpc.qcow.spdx

View File

@ -3,3 +3,4 @@ base/root-squashfs.binary
provides livecd.ubuntu-cpc.squashfs provides livecd.ubuntu-cpc.squashfs
provides livecd.ubuntu-cpc.squashfs.manifest provides livecd.ubuntu-cpc.squashfs.manifest
provides livecd.ubuntu-cpc.squashfs.filelist provides livecd.ubuntu-cpc.squashfs.filelist
provides livecd.ubuntu-cpc.squashfs.spdx

View File

@ -3,3 +3,4 @@ base/root-xz.binary
provides livecd.ubuntu-cpc.rootfs.tar.xz provides livecd.ubuntu-cpc.rootfs.tar.xz
provides livecd.ubuntu-cpc.rootfs.manifest provides livecd.ubuntu-cpc.rootfs.manifest
provides livecd.ubuntu-cpc.rootfs.filelist provides livecd.ubuntu-cpc.rootfs.filelist
provides livecd.ubuntu-cpc.rootfs.spdx

View File

@ -1,3 +1,6 @@
depends disk-image depends disk-image
base/vagrant.binary base/vagrant.binary
provides livecd.ubuntu-cpc.vagrant.box provides livecd.ubuntu-cpc.vagrant.box
provides livecd.ubuntu-cpc.vagrant.manifest
provides livecd.ubuntu-cpc.vagrant.filelist
provides livecd.ubuntu-cpc.vagrant.spdx

View File

@ -3,3 +3,6 @@ base/vmdk-image.binary
base/vmdk-ova-image.binary base/vmdk-ova-image.binary
provides livecd.ubuntu-cpc.vmdk provides livecd.ubuntu-cpc.vmdk
provides livecd.ubuntu-cpc.ova provides livecd.ubuntu-cpc.ova
provides livecd.ubuntu-cpc.vmdk.manifest
provides livecd.ubuntu-cpc.vmdk.filelist
provides livecd.ubuntu-cpc.vmdk.spdx

View File

@ -93,6 +93,8 @@ EOF
chroot ${mount_d} chown -R vagrant:vagrant /home/vagrant/.ssh chroot ${mount_d} chown -R vagrant:vagrant /home/vagrant/.ssh
chroot ${mount_d} chmod 700 /home/vagrant/.ssh chroot ${mount_d} chmod 700 /home/vagrant/.ssh
create_manifest $mount_d "livecd.ubuntu-cpc.vagrant.manifest" "livecd.ubuntu-cpc.vagrant.spdx" "cloud-image-vagrant-$ARCH-$(date +%Y%m%dT%H:%M:%S)"
umount_disk_image "$mount_d" umount_disk_image "$mount_d"
rmdir "$mount_d" rmdir "$mount_d"

View File

@ -20,8 +20,18 @@ esac
. config/functions . config/functions
vmdk_file="$PWD/livecd.ubuntu-cpc.vmdk"
if [ -e binary/boot/disk-uefi.ext4 ]; then if [ -e binary/boot/disk-uefi.ext4 ]; then
create_vmdk binary/boot/disk-uefi.ext4 livecd.ubuntu-cpc.vmdk create_vmdk binary/boot/disk-uefi.ext4 livecd.ubuntu-cpc.vmdk
uefi_file="livecd.ubuntu-cpc.disk-uefi"
cp ${uefi_file}.manifest ${vmdk_file}.manifest
cp ${uefi_file}.filelist ${vmdk_file}.filelist
cp ${uefi_file}.spdx ${vmdk_file}.spdx
elif [ -f binary/boot/disk.ext4 ]; then elif [ -f binary/boot/disk.ext4 ]; then
create_vmdk binary/boot/disk.ext4 livecd.ubuntu-cpc.vmdk create_vmdk binary/boot/disk.ext4 livecd.ubuntu-cpc.vmdk
disk_file="livecd.ubuntu-cpc.disk-image"
cp ${disk_file}.manifest ${vmdk_file}.manifest
cp ${disk_file}.filelist ${vmdk_file}.filelist
cp ${disk_file}.spdx ${vmdk_file}.spdx
fi fi

View File

@ -10,30 +10,9 @@ case ${PASS} in
;; ;;
esac esac
# The unminimize script will try to install the lxd snap using the shim script # Run the unminimize script to re-install packages with all dpkg filters removed and install packages
# /usr/sbin/lxd from the lxd-installer package. # removed as part of minimization
# We can't do that at this stage so just neuter the lxd command (the snap yes | /usr/bin/unminimize
# will get properly seeded by generic machinery).
if [ -f "/usr/sbin/lxd" ]; then
dpkg-divert --add --divert /usr/sbin/lxd.REAL --rename /usr/sbin/lxd
ln -s /bin/true /usr/sbin/lxd
yes | /usr/local/sbin/unminimize
# unminimize also uninstalls lxd-installer package
# and also removed `/usr/sbin/lxd` as a result, so we don't need to restore, but
# we do need to remove the mock we used as part of dpkg-divert
# first we need to remove the diversion
dpkg-divert --remove --no-rename /usr/sbin/lxd
# now remove the renamed file that we originally diverted to
rm -v /usr/sbin/lxd.REAL
else
# if /usr/sbin/lxd doesn't exist then lxd-installer package isn't installed.
# Instead, we can mock the command to avoid the unminimize script failing
ln -s /bin/true /usr/sbin/lxd
yes | /usr/local/sbin/unminimize
# as the lxd-installer package was not installed and thus not removed by `unminimize`
# the mock /usr/sbin/lxd will still be present, so we need to remove it
rm -v /usr/sbin/lxd
fi
# Fix up missing recommends. Other non-layered flavors handle this in # Fix up missing recommends. Other non-layered flavors handle this in
# live-build/auto/build, but we need to do it here. Also, there are # live-build/auto/build, but we need to do it here. Also, there are

View File

@ -21,6 +21,8 @@ case $PASS in
kernel_metapkg=linux-nvidia-tegra kernel_metapkg=linux-nvidia-tegra
elif [ "$flavor" = "nvidia-tegra-igx" ]; then elif [ "$flavor" = "nvidia-tegra-igx" ]; then
kernel_metapkg=linux-nvidia-tegra-igx kernel_metapkg=linux-nvidia-tegra-igx
elif [ "$flavor" = "nvidia-tegra-jetson" ]; then
kernel_metapkg=linux-nvidia-tegra-jetson
else else
echo "bogus flavor: $flavor" echo "bogus flavor: $flavor"
exit 1 exit 1

View File

@ -0,0 +1,20 @@
#!/bin/bash -eu
# vi: ts=4 expandtab
#
# Create wsl-distribution.conf for WSL setup
#
source /etc/os-release
cat <<EOF >/etc/wsl-distribution.conf
[oobe]
command = /usr/lib/wsl/wsl-setup
defaultUid = 1000
defaultName = ${NAME}-${VERSION_ID}
[shortcut]
icon = /usr/share/wsl/ubuntu.ico
[windowsterminal]
ProfileTemplate = /usr/share/wsl/terminal-profile.json
EOF

View File

@ -16,102 +16,10 @@ esac
setfattr -x system.posix_acl_access chroot/var/log/journal setfattr -x system.posix_acl_access chroot/var/log/journal
setfattr -x system.posix_acl_default chroot/var/log/journal setfattr -x system.posix_acl_default chroot/var/log/journal
# is_lts returns true if the given release is a LTS. # Create the rootfs as a .wsl extension
is_lts() { cd chroot
release_version="$1" tar --xattrs --sort=name -czf ../livecd.$PROJECT${SUBARCH:+-$SUBARCH}.wsl *
year=$(echo "${release_version}" | cut -d'.' -f1) cd ..
month=$(echo "${release_version}" | cut -d'.' -f2)
if [ "${month}" != "04" ]; then
echo "false"
return
fi
last_year_digit="${year: -1}"
if [ $((last_year_digit % 2)) -ne 0 ]; then
echo "false"
return
fi
echo "true"
}
# is_current_lts_release returns for a given lts release is we are in the year preceeding or 2 years succeeding a release.
# Note that it will mark as "current" a lts release zeven if there is a next one released until the end of the +2 year.
is_current_lts_release() {
release_version="$1"
current_year="$2"
year=$(echo "$release_version" | cut -d'.' -f1)
if [ $(is_lts "${version}") != "true" ]; then
echo "false"
return
fi
if [ "$((year - 1))" -le "${current_year}" ] && [ "${current_year}" -le "$((year + 2))" ]; then
echo "true"
return
fi
echo "false"
}
# Function to check if a version is a development release
is_development_release() {
local version=$1
local current_year=$2
local current_month=$3
local year=$(echo $version | cut -d. -f1)
local month=$(echo $version | cut -d. -f2)
if [ "${year}" -gt "${current_year}" ] || ([ "${year}" -eq "${current_year}" ] && [ "${month}" -gt "${current_month}" ]); then
echo "true"
return
fi
echo "false"
}
# create_archive_with_upgrade_policy modifies the prompting upgrade policy
# and create a separate rootfs for this upgrade policy, named after app_id.
# The reason not using just tar .. -C chroot . is that using '.' was found
# not working once and checking if using the simpler command is safe needs
# verification of the app installation on all Windows 10 builds we support
# with WSL.
create_archive_with_upgrade_policy() {
upgrade_policy=$1
app_id=$2
cd chroot
sed -i "s#Prompt=.*#Prompt=${upgrade_policy}#" ./etc/update-manager/release-upgrades
tar --xattrs --sort=name -czf ../livecd.ubuntu-wsl.${app_id}.rootfs.tar.gz *
cd ..
}
# release-upgrader configuration, 3 cases:
# Ubuntu-Version: never
# ubuntu (latest LTS): lts
# preview (current dev): normal
# We produce the following tar with this policy:
# Any XY.04, where Y is pair: upgrade-never
# Any XY.04, where Y is pair and current year is between XY-1 to XY+2 (included): upgrade-lts
# Any releases, where XY.04, where current date is comprised within 6 months.
version=$(chroot chroot lsb_release --release --short)
if [ $(is_lts "${version}") = "true" ]; then
create_archive_with_upgrade_policy "never" "ubuntu${version}lts"
fi
if [ $(is_current_lts_release "${version}" $(date +"%y")) = "true" ]; then
create_archive_with_upgrade_policy "lts" "ubuntu"
fi
if [ $(is_development_release "${version}" $(date +"%y") $(date +"%m")) = "true" ]; then
create_archive_with_upgrade_policy "normal" "ubuntupreview"
fi
# Remove initial ext4-formatted fs # Remove initial ext4-formatted fs
rm -f binary/boot/filesystem.ext4 rm -f binary/boot/filesystem.ext4

View File

@ -24,7 +24,7 @@ fi
cat <<EOF > config/classic-model.model cat <<EOF > config/classic-model.model
type: model type: model
authority-id: canonical authority-id: canonical
revision: 2 revision: 3
series: 16 series: 16
brand-id: canonical brand-id: canonical
model: ubuntu-classic-2404-amd64 model: ubuntu-classic-2404-amd64
@ -75,7 +75,7 @@ snaps:
name: gtk-common-themes name: gtk-common-themes
type: app type: app
- -
default-channel: latest/stable/ubuntu-24.04 default-channel: 2/stable/ubuntu-24.04
id: gjf3IPXoRiipCu9K0kVu52f0H56fIksg id: gjf3IPXoRiipCu9K0kVu52f0H56fIksg
name: snap-store name: snap-store
type: app type: app
@ -85,23 +85,23 @@ snaps:
name: snapd-desktop-integration name: snapd-desktop-integration
type: app type: app
- -
default-channel: latest/stable/ubuntu-24.04 default-channel: 1/stable/ubuntu-24.04
id: EI0D1KHjP8XiwMZKqSjuh6W8zvcowUVP id: EI0D1KHjP8XiwMZKqSjuh6W8zvcowUVP
name: firmware-updater name: firmware-updater
type: app type: app
timestamp: 2024-04-21T12:00:00.0Z timestamp: 2024-08-26T12:00:00.0Z
sign-key-sha3-384: 9tydnLa6MTJ-jaQTFUXEwHl1yRx7ZS4K5cyFDhYDcPzhS7uyEkDxdUjg9g08BtNn sign-key-sha3-384: 9tydnLa6MTJ-jaQTFUXEwHl1yRx7ZS4K5cyFDhYDcPzhS7uyEkDxdUjg9g08BtNn
AcLBXAQAAQoABgUCZiZYsgAKCRDgT5vottzAEir/EACXgxl3zMAplZZDP33gyk7dENrDD3VaindS AcLBXAQAAQoABgUCZsyysAAKCRDgT5vottzAEilHEACwNTjGEIAfePAkgYeaWvNvQXTIHRqa/fc8
sL91VFtNzrDQiK0ovuPUTuxg4N0XqDcGxIxBQUDggHA36n4+B+EP68Uu4kTS8PzJAeVfK2NzpleL G7BJZQJjvE8I7DMQn5QHqUHpLTvyKQCch780R43NbNmcEWBSvYe7vdfSGwF4acyP6MBk7rO1s366
1tgXjGCvb2JmRZIZozJ8x3DVIMeBByPcEKv+nULhnAcOIpZfBvbv/fs/pF5QKqsWQIlMPk23X5aF lBjvKEkhk1yfcpx3cGUy+LWsLvJkRYvAC31vMCcVnyXZGzAFT0qDlHOH5J3UHc7JBmuo9rdHueKN
ZmcaOAT8S+d73i/SWJxAEjcS9SeKf+iHxDQ6niuOhGgM20+hvCiWT0YLefG9fYsu5FjNaT0o9p0Y KmjgozFp6NAPFFGEA4yqIqBRUtZyu9r27SvI2AqY+TKZClzUvaxxUOpCMTZmF8nMC9ucLRstSHbf
hbYKb0SaILWrXrip209yciweVgUfRBDqYMnGWVojjW+dpS/IqLYvFL0y0hm5gQI4QmALXY+9p3Qc BGUvaIo97xY0ycG8QHFXEG1iOsIhUq2pGgIIajCxL+A1uwvGuGRDHscb0g63MvfqJB3lIsKy/oTU
97YCbPsj0rOSGcPDUkLKu+vkVdIkIsYg44QMtJEhGs9dBBj5nt7welli5sjuQBUzRECWOlH1dJgd 8KgAIOG2Qy9AhwkP1kMuBh5Txw4XMp4lNmPpBToOIQK+LAmDup82+czcvTdDRVAmzq3gGMeSwzc8
7PJi9Hl/6X3/CNUruK5t342B70BJ1IWp49dIKf9zfSvoJzDiBlRx6pl6/F54XU4Xef4Nl7+2Cc7z hwq6uMLbI+jl67tHhhItOAMF5UzqWetecA81OEvyLxNSYcLIJ2zbXwRaOTummnIFgg6RDPBwd0tl
45FpV16tft9KhufXKksvTIaHDEWY5E4fbAL4YjCEf5TD2JZDI16cc8lrrGKO1R+hWjA943JgK1Ac K8EVLVIakCQtKs/2tmBMWXuv2HStqoUsn+8I5ofzVv/gJnu0cD1xvLTJ0xbK4TnTmCYDP8b357Jg
kio/LUlP0oYPq9hxzdRQq4vynRt+MYro+/0yNzaX3IBODQ+7uX3KIakbaI6y/d6nCz8Z94PoJC2/ MXOLyKFuNLcaf1mR7vwsE3570jsFUQtwq8CYWZD5WCCVv1QXb2MKD3A1fEgAHMqRfHSa+HoPzsWY
9OnsJlX1QIsavtl5ct0Buqzk8AdLFwCHGM8xlT81Jw== +KDM/aLgtd0I8R7pQdz1GO2vkxz5BAv7jG5kvwhuYg==
EOF EOF
channel="" channel=""

View File

@ -39,8 +39,14 @@ trap cleanup_hyperv EXIT
# Perform customisations # Perform customisations
# For Ubuntu 24.04 and later cloud-init is included in desktop images. This is not applicable for Hyperv images so
# we can disable cloud-init. This leaves the cloud-init package installed but disabled so users can still
# use it if they want.
touch "${scratch_d}/etc/cloud/cloud-init.disabled"
chroot "${scratch_d}" apt-get update -y chroot "${scratch_d}" apt-get update -y
chroot "${scratch_d}" apt-get -y install xrdp linux-azure linux-tools-azure linux-cloud-tools-azure chroot "${scratch_d}" apt-get -y install xrdp linux-azure linux-tools-azure linux-cloud-tools-azure polkitd-pkla oem-config-gtk language-pack-en-base oem-config-slideshow-ubuntu
cat > ${scratch_d}/etc/modules-load.d/hyperv.conf << EOF cat > ${scratch_d}/etc/modules-load.d/hyperv.conf << EOF
${IMAGE_STR} ${IMAGE_STR}
@ -124,20 +130,19 @@ touch "${scratch_d}/var/lib/oem-config/run"
chroot "${scratch_d}" apt-get clean chroot "${scratch_d}" apt-get clean
raw_img=binary/boot/disk-hyperv-uefi.ext4
vhd_img=livecd.ubuntu-desktop-hyperv.vhdx
create_manifest "${scratch_d}" "$vhd_img.zip.manifest"
# End customisations # End customisations
cleanup_hyperv cleanup_hyperv
trap - EXIT trap - EXIT
raw_img=binary/boot/disk-hyperv-uefi.ext4
vhd_img=livecd.ubuntu-desktop-hyperv.vhdx
qemu-img convert -O vhdx "$raw_img" "$vhd_img" qemu-img convert -O vhdx "$raw_img" "$vhd_img"
rm "$raw_img" rm "$raw_img"
apt-get install -y zip apt-get install -y zip
create_manifest chroot "$vhd_img.zip.manifest"
zip "$vhd_img.zip" "$vhd_img" zip "$vhd_img.zip" "$vhd_img"
rm "$vhd_img" rm "$vhd_img"

View File

@ -10,9 +10,9 @@ import yaml
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument('--output', required=True) parser.add_argument('--output', required=True)
parser.add_argument('--size', required=True) parser.add_argument('--size', required=True)
parser.add_argument('--squashfs', required=True) parser.add_argument('--squashfs', default='')
parser.add_argument('--translations', required=True) parser.add_argument('--translations')
parser.add_argument('--template', required=True) parser.add_argument('--template')
parser.add_argument('--langs', default=None) parser.add_argument('--langs', default=None)
opts = parser.parse_args(sys.argv[1:]) opts = parser.parse_args(sys.argv[1:])
@ -58,6 +58,7 @@ else:
template['name'] = {'en': en_name} template['name'] = {'en': en_name}
template['description'] = {'en': en_description} template['description'] = {'en': en_description}
if opts.translations:
for mo in glob.glob(os.path.join(opts.translations, '*.mo')): for mo in glob.glob(os.path.join(opts.translations, '*.mo')):
with open(mo, 'rb') as fp: with open(mo, 'rb') as fp:
t = gettext.GNUTranslations(fp=fp) t = gettext.GNUTranslations(fp=fp)