mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-02-23 11:21:12 +00:00
Merge branch 'ubuntu/master' of git+ssh://git.launchpad.net/livecd-rootfs into canary-as-default
This commit is contained in:
commit
9b33f085c1
116
debian/changelog
vendored
116
debian/changelog
vendored
@ -1,3 +1,119 @@
|
||||
livecd-rootfs (23.10.30) mantic; urgency=medium
|
||||
|
||||
* Fix unminimize to correctly list packages. (LP: #1996489)
|
||||
|
||||
-- Utkarsh Gupta <utkarsh@ubuntu.com> Sat, 02 Sep 2023 02:16:03 +0530
|
||||
|
||||
livecd-rootfs (23.10.29) mantic; urgency=medium
|
||||
|
||||
* canary: switch to use the live task, try to use KERNEL_FLAVOURS instead
|
||||
of a manual kernel add_package.
|
||||
|
||||
-- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Wed, 31 Aug 2023 11:57:11 +0200
|
||||
|
||||
livecd-rootfs (23.10.28) mantic; urgency=medium
|
||||
|
||||
* Allow stderr in the autopkgtest.
|
||||
|
||||
-- Steve Langasek <steve.langasek@ubuntu.com> Wed, 30 Aug 2023 08:28:57 -0700
|
||||
|
||||
livecd-rootfs (23.10.27) mantic; urgency=medium
|
||||
|
||||
* Add ubuntu to the list of targets we autopkgtest for on amd64, to ensure
|
||||
coverage of the lb_chroot_layered behavior.
|
||||
* lb_chroot_layered: if the unmount of the chroot mountpoint fails, dump
|
||||
mount information for debugging.
|
||||
|
||||
-- Steve Langasek <steve.langasek@ubuntu.com> Tue, 29 Aug 2023 10:39:23 -0700
|
||||
|
||||
livecd-rootfs (23.10.26) mantic; urgency=medium
|
||||
|
||||
[ Łukasz 'sil2100' Zemczak ]
|
||||
* Update the enhanced-sb layer model to not preinstall the printing snaps,
|
||||
per changes to seeds. Live layer model not changed as it will go away
|
||||
soon per our staged changes.
|
||||
|
||||
[ Michael Hudson-Doyle ]
|
||||
* Use a traditional seed.yaml style seed for the canary installer's live
|
||||
|
||||
-- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Mon, 28 Aug 2023 12:13:38 +0200
|
||||
|
||||
livecd-rootfs (23.10.25) mantic; urgency=medium
|
||||
|
||||
* snap-seed-parse.py: fix builds with no snaps.
|
||||
|
||||
-- Michael Hudson-Doyle <michael.hudson@ubuntu.com> Mon, 28 Aug 2023 14:02:56 +1200
|
||||
|
||||
livecd-rootfs (23.10.24) mantic; urgency=medium
|
||||
|
||||
* update-source-catalog: Fix case where a variaton does not point at the
|
||||
base layer (i.e. most builds) (LP: #2033168)
|
||||
* Configure universe sources in canary ISO. (LP: #2033109)
|
||||
* snap-seed-parse.py: Update to allow parsing uc20-style seeds.
|
||||
(LP: #2028984)
|
||||
|
||||
-- Michael Hudson-Doyle <michael.hudson@ubuntu.com> Mon, 28 Aug 2023 12:48:53 +1200
|
||||
|
||||
livecd-rootfs (23.10.23) mantic; urgency=medium
|
||||
|
||||
* i386 foreign-arch support was added for the canary image before 23.04
|
||||
released, but by mistake it was only added to the squashfs for the live
|
||||
session, and not the squashfs layer used as the source for installation.
|
||||
split the chroot hooks to add this to the standard.squashfs.
|
||||
LP: #2033170.
|
||||
* Drop mke2fs.conf override, no longer needed.
|
||||
|
||||
-- Steve Langasek <steve.langasek@ubuntu.com> Sat, 26 Aug 2023 16:34:27 -0700
|
||||
|
||||
livecd-rootfs (23.10.22) mantic; urgency=medium
|
||||
|
||||
* Undo preseeding in reset_snapd_state.
|
||||
* update-source-catalog: work better when we want a variation to point
|
||||
at the base layer.
|
||||
* Stop launching a gnome-terminal at startup of the canary live session.
|
||||
(LP: #2032647)
|
||||
|
||||
-- Michael Hudson-Doyle <michael.hudson@ubuntu.com> Fri, 25 Aug 2023 18:45:03 +1200
|
||||
|
||||
livecd-rootfs (23.10.21) mantic; urgency=medium
|
||||
|
||||
* Deduplicate the layers just before creating the squashfs, to enable
|
||||
deduplication of the result of binary hooks as well.
|
||||
|
||||
[ Steve Langasek ]
|
||||
* Deduplicate snaps between squashfs layers on classic:
|
||||
- Consolidate canary layers to merge 'classic' back into 'standard'
|
||||
- Reset /var/lib/snapd in the upper layers before calling snap
|
||||
prepare-image
|
||||
- No need to use rsync in hooks now to avoid file duplication since layer
|
||||
handling as a whole now uses rsync.
|
||||
|
||||
-- Steve Langasek <steve.langasek@ubuntu.com> Wed, 23 Aug 2023 10:31:42 -0700
|
||||
|
||||
livecd-rootfs (23.10.20) mantic; urgency=medium
|
||||
|
||||
* Update canary model assertions to include all the regular seeded snaps,
|
||||
using the right channels for all of them.
|
||||
|
||||
-- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Tue, 22 Aug 2023 17:14:38 +0200
|
||||
|
||||
livecd-rootfs (23.10.19) mantic; urgency=medium
|
||||
|
||||
* Add python3-systemd to CPC's minimized builds.
|
||||
|
||||
-- Utkarsh Gupta <utkarsh@ubuntu.com> Tue, 22 Aug 2023 14:54:57 +0530
|
||||
|
||||
livecd-rootfs (23.10.18) mantic; urgency=medium
|
||||
|
||||
* Refresh the canary model assertions. The live model now includes all the
|
||||
snaps of the standard installation (including firefox), as we want to offer
|
||||
the same experience in the livefs as in the target installation. We also
|
||||
track other, proper channels for the seeded snaps.
|
||||
* Fix the 020-canary-* hooks referencing the wrong layer names after changes
|
||||
introduced in 23.10.17.
|
||||
|
||||
-- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Fri, 18 Aug 2023 17:58:54 +0200
|
||||
|
||||
livecd-rootfs (23.10.17) mantic; urgency=medium
|
||||
|
||||
* Merge the minimal and standard layers on the Ubuntu Desktop images
|
||||
|
2
debian/tests/control
vendored
2
debian/tests/control
vendored
@ -1,6 +1,6 @@
|
||||
Tests: default-bootstraps
|
||||
Depends: @, lsb-release
|
||||
Restrictions: needs-root isolation-machine
|
||||
Restrictions: needs-root isolation-machine allow-stderr
|
||||
|
||||
Tests: minimized
|
||||
Depends: @, lsb-release
|
||||
|
7
debian/tests/default-bootstraps
vendored
7
debian/tests/default-bootstraps
vendored
@ -43,11 +43,17 @@ ALL_TRIPLETS="
|
||||
xubuntu::
|
||||
xubuntu:minimal:"
|
||||
|
||||
ARCH=$(dpkg --print-architecture)
|
||||
|
||||
if [ -z "$SELECTED_TRIPLETS" ]; then
|
||||
SELECTED_TRIPLETS="
|
||||
ubuntu-base::
|
||||
ubuntu-cpc::ubuntu-cpc
|
||||
"
|
||||
if [ "$ARCH" = amd64 ]; then
|
||||
SELECTED_TRIPLETS="$SELECTED_TRIPLETS
|
||||
ubuntu::"
|
||||
fi
|
||||
fi
|
||||
|
||||
live_build_rootfs() {
|
||||
@ -55,7 +61,6 @@ live_build_rootfs() {
|
||||
local SUBPROJECT_TMP=${1%:*}
|
||||
SUBPROJECT=${SUBPROJECT_TMP#*:}
|
||||
TEMPLATE=${1##*:}
|
||||
ARCH=$(dpkg --print-architecture)
|
||||
echo "Building rootfs for project: '$PROJECT' subproject: '$SUBPROJECT' template: '$TEMPLATE' in $PWD"
|
||||
cp -a /usr/share/livecd-rootfs/live-build/auto .
|
||||
if [ -n "$TEMPLATE" ]; then
|
||||
|
@ -252,18 +252,18 @@ if [ -f /etc/dpkg/dpkg.cfg.d/excludes ] || [ -f /etc/dpkg/dpkg.cfg.d/excludes.dp
|
||||
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 '/..5...... \/usr\/share\/doc/ {print $2}' | sed 's|/[^/]*$||' | sort |uniq \
|
||||
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 '/..5...... \/usr\/share\/locale/ {print $2}' | sed 's|/[^/]*$||' | sort |uniq \
|
||||
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 '/..5...... \/usr\/share\/doc/ {exit 1}'; then
|
||||
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 '/..5...... \/usr\/share\/doc/ {print " " $2}'
|
||||
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
|
||||
|
@ -722,27 +722,23 @@ case $PROJECT in
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
touch config/universe-enabled
|
||||
PASSES_TO_LAYERS="true"
|
||||
# the standard layer, contains all base common packages for later layers (we're splitting out the snaps)
|
||||
KERNEL_FLAVOURS='generic-hwe-22.04'
|
||||
# the standard layer, contains all base common packages for later layers
|
||||
add_task standard minimal standard ubuntu-desktop ubuntu-desktop-default-languages
|
||||
add_package standard cloud-init
|
||||
# the classic layer, basically only contains snaps from the standard and minimal tasks
|
||||
add_pass standard.classic
|
||||
if [ -e "config/package-lists/livecd-rootfs.snaplist.chroot_standard.full" ]; then
|
||||
cat config/package-lists/livecd-rootfs.snaplist.chroot_standard.full >>config/package-lists/livecd-rootfs.snaplist.chroot_standard.classic.full
|
||||
rm config/package-lists/livecd-rootfs.snaplist.chroot_standard.full
|
||||
fi
|
||||
# the live layer, contains all packages for the live session installer
|
||||
# TODO: we should probably add the kernel per KERNEL_FLAVOURS
|
||||
add_package standard.live linux-generic casper lvm2 mdadm cryptsetup dctrl-tools
|
||||
add_task standard.live ubuntu-live
|
||||
remove_package standard.live ubiquity-frontend-gtk
|
||||
add_snap standard.live ubuntu-desktop-installer/classic
|
||||
# the enhanced-secureboot layer, contains all packages for the enhanced secureboot install
|
||||
add_package standard.enhanced-secureboot cryptsetup boot-managed-by-snapd
|
||||
|
||||
# language support
|
||||
seeded_langs="$(get_seeded_languages desktop)"
|
||||
echo "$seeded_langs" | tr ' ' ',' > config/seeded-languages
|
||||
derive_language_layers standard.classic desktop desktop-default-languages "$seeded_langs"
|
||||
derive_language_layers standard desktop desktop-default-languages "$seeded_langs"
|
||||
derive_language_layers standard.enhanced-secureboot desktop desktop-default-languages "$seeded_langs"
|
||||
|
||||
# now let's create the neccessary catalog files
|
||||
@ -755,12 +751,9 @@ case $PROJECT in
|
||||
variant: desktop
|
||||
locale_support: langpack
|
||||
default: yes
|
||||
EOF
|
||||
cat <<-EOF > config/standard.classic.catalog-in.yaml
|
||||
id: ubuntu-desktop
|
||||
variations:
|
||||
classic:
|
||||
path: standard.classic.squashfs
|
||||
standard:
|
||||
path: standard.squashfs
|
||||
EOF
|
||||
cat <<-EOF > config/standard.enhanced-secureboot.catalog-in.yaml
|
||||
id: ubuntu-desktop
|
||||
@ -1076,8 +1069,15 @@ case $PROJECT in
|
||||
# or by passing --no-install-recommends to apt-get install.
|
||||
# Apt config is set using `APT_OPTIONS` variable in this script.
|
||||
# This fixes LP: #2031640
|
||||
#
|
||||
# We're also installing python3-systemd for now because it's needed by
|
||||
# ubuntu-advantage-tools. This will eventually be dropped in the next
|
||||
# release of u-a-t. This is being discussed and tracked at
|
||||
# https://github.com/canonical/ubuntu-pro-client/issues/2692.
|
||||
# Once python3-systemd is dropped from u-a-t, we can remove it
|
||||
# from here, too.
|
||||
APT_OPTIONS="${APT_OPTIONS:+$APT_OPTIONS }--no-install-recommends"
|
||||
add_package install ubuntu-cloud-minimal
|
||||
add_package install ubuntu-cloud-minimal python3-systemd
|
||||
else
|
||||
add_task install minimal standard cloud-image
|
||||
add_package install ubuntu-minimal
|
||||
@ -1272,7 +1272,7 @@ case "$ARCH${SUBARCH:++$SUBARCH}" in
|
||||
esac
|
||||
|
||||
case $PROJECT:${SUBPROJECT:-} in
|
||||
ubuntu-server:*|ubuntu-base:*|ubuntu-oci:*|ubuntu:)
|
||||
ubuntu-server:*|ubuntu-base:*|ubuntu-oci:*)
|
||||
OPTS="${OPTS:+$OPTS }--linux-packages=none --initramfs=none"
|
||||
KERNEL_FLAVOURS=none
|
||||
BINARY_REMOVE_LINUX=false
|
||||
|
@ -1230,3 +1230,15 @@ EOF
|
||||
undivert_grub "${mountpoint}"
|
||||
fi
|
||||
}
|
||||
|
||||
# find all files under /var/lib/snapd in the target directory that aren't
|
||||
# shipped by the snapd package itself, and remove them
|
||||
reset_snapd_state() {
|
||||
rootdir="$1"
|
||||
|
||||
/usr/lib/snapd/snap-preseed --reset $(realpath "$rootdir") || true
|
||||
rm -rf "$rootdir/var/lib/snapd"
|
||||
setup_mountpoint "$rootdir"
|
||||
chroot "$rootdir" apt-get install --reinstall -y snapd
|
||||
teardown_mountpoint "$rootdir"
|
||||
}
|
||||
|
@ -142,7 +142,39 @@ build_layered_squashfs () {
|
||||
cp "${squashfs_f_manifest}.full" "${prefix}.manifest"
|
||||
fi
|
||||
|
||||
create_squashfs "overlay.${pass}/" ${squashfs_f}
|
||||
if [ -n "$lowerdirs" ]; then
|
||||
# Although the current chroot was created as an overlay over
|
||||
# the previous layer, many operations can result in redundant
|
||||
# files in the upperdir. Rather than trying to minimize the
|
||||
# overlay by hand, we rsync the chroot into a fresh overlay,
|
||||
# rely on rsyncs ability to avoid redundant file operations,
|
||||
# and take _that_ overlay's upperdir as the content of the
|
||||
# layer.
|
||||
mkdir -p chroot-2 "$overlay_dir-2"
|
||||
mount_overlay "$lowerdirs" "$overlay_dir-2" chroot-2
|
||||
# rsync takes many, many options. The subset
|
||||
# we pass here is quite important:
|
||||
# -a is standard to operate in the basic way required here.
|
||||
# -X to preserve xattrs
|
||||
# -H to preserve hardlinks
|
||||
# -A to preserve ACLs
|
||||
# -S to preserve sparseness
|
||||
# --checksum to skip copies based on the content of the file
|
||||
# (rather than the default which is to skip copies based
|
||||
# on size + mtime)
|
||||
# --no-times to not copy mtimes from source to dest (we
|
||||
# don't care about mtime in the image and want to
|
||||
# deduplicate files that have indentical contents but
|
||||
# different mtimes)
|
||||
# --del because we want to remove files that have been
|
||||
# deleted in this layer.
|
||||
rsync -aXHAS --checksum --no-times --del chroot/ chroot-2/
|
||||
umount chroot-2
|
||||
rmdir chroot-2
|
||||
overlay_dir="$overlay_dir-2"
|
||||
fi
|
||||
|
||||
create_squashfs "${overlay_dir}" ${squashfs_f}
|
||||
|
||||
if [ -f config/$pass.catalog-in.yaml ]; then
|
||||
echo "Expanding catalog entry template for $pass"
|
||||
|
@ -131,8 +131,8 @@ create_chroot_pass () {
|
||||
mkdir -p "$overlay_dir/"
|
||||
lowerdirs=$(get_lowerdirs_for_pass $pass)
|
||||
if [ -n "$lowerdirs" ]; then
|
||||
mkdir -p chroot "${overlay_dir}-initial"
|
||||
mount_overlay "$lowerdirs" "${overlay_dir}-initial" chroot/
|
||||
mkdir -p chroot/
|
||||
mount_overlay "$lowerdirs" "$overlay_dir" chroot/
|
||||
else
|
||||
ln -s "$overlay_dir/" chroot
|
||||
fi
|
||||
@ -268,19 +268,14 @@ create_chroot_pass () {
|
||||
lb chroot_devpts remove ${*}
|
||||
|
||||
if [ -n "$lowerdirs" ]; then
|
||||
# Although the current chroot was created as an overlay over
|
||||
# the previous layer, many operations can result in redundant
|
||||
# files in the upperdir. Rather than trying to minimize the
|
||||
# overlay by hand, we rsync the chroot into a fresh overlay,
|
||||
# rely on rsyncs ability to avoid redundant file operations,
|
||||
# and take _that_ overlay's upperdir as the content of the
|
||||
# layer.
|
||||
mkdir chroot-2
|
||||
mount_overlay "$lowerdirs" "$overlay_dir" chroot-2/
|
||||
rsync -aXHAS --del chroot/ chroot-2/
|
||||
umount chroot chroot-2
|
||||
rmdir chroot chroot-2
|
||||
rm -rf ${overlay_dir}-initial
|
||||
res=0
|
||||
umount chroot || res=$?
|
||||
if [ $res -ne 0 ]; then
|
||||
Echo_message "Unmount failed, current mounts: "
|
||||
cat /proc/$$/mounts
|
||||
exit $res
|
||||
fi
|
||||
rmdir chroot
|
||||
else
|
||||
rm chroot
|
||||
fi
|
||||
|
@ -10,6 +10,7 @@ The $chroot_dir argument is optional and will default to the empty string.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import glob
|
||||
import os.path
|
||||
import re
|
||||
import yaml
|
||||
@ -32,37 +33,129 @@ CHROOT_ROOT = ARGS.chroot
|
||||
FNAME = ARGS.file
|
||||
|
||||
# Trim any trailing slashes for correct appending
|
||||
CHROOT_ROOT = CHROOT_ROOT.rstrip('/')
|
||||
log("CHROOT_ROOT: {}".format(CHROOT_ROOT))
|
||||
if len(CHROOT_ROOT) > 0 and CHROOT_ROOT[-1] == '/':
|
||||
CHROOT_ROOT = CHROOT_ROOT[:-1]
|
||||
|
||||
# This is where we expect to find the seed.yaml file
|
||||
YAML_PATH = CHROOT_ROOT + '/var/lib/snapd/seed/seed.yaml'
|
||||
|
||||
# Snaps are prepended with this string in the manifest
|
||||
LINE_PREFIX = 'snap:'
|
||||
|
||||
# This is where we expect to find the seed.yaml file
|
||||
YAML_PATH = CHROOT_ROOT + '/var/lib/snapd/seed/seed.yaml'
|
||||
|
||||
log("yaml path: {}".format(YAML_PATH))
|
||||
if not os.path.isfile(YAML_PATH):
|
||||
log("WARNING: yaml path not found; no seeded snaps found.")
|
||||
exit(0)
|
||||
|
||||
|
||||
def make_manifest_from_seed_yaml(path):
|
||||
with open(YAML_PATH, 'r') as fh:
|
||||
yaml_lines = yaml.safe_load(fh)['snaps']
|
||||
|
||||
log('Writing manifest to {}'.format(FNAME))
|
||||
|
||||
with open(FNAME, 'a+') as fh:
|
||||
for item in yaml_lines:
|
||||
filestring = item['file']
|
||||
# Pull the revision number off the file name
|
||||
revision = filestring[filestring.rindex('_')+1:]
|
||||
revision = re.sub(r'[^0-9]', '', revision)
|
||||
fh.write("{}{}\t{}\t{}\n".format(LINE_PREFIX,
|
||||
item['name'],
|
||||
item['channel'],
|
||||
revision,
|
||||
))
|
||||
|
||||
|
||||
def look_for_uc20_model(chroot):
|
||||
systems_dir = f"{chroot}/var/lib/snapd/seed/systems"
|
||||
if not os.path.isdir(systems_dir):
|
||||
log("no systems directory found")
|
||||
return None
|
||||
modeenv = f"{chroot}/var/lib/snapd/modeenv"
|
||||
system_name = None
|
||||
if os.path.isfile(modeenv):
|
||||
log(f"found modeenv file at {modeenv}")
|
||||
with open(modeenv) as fh:
|
||||
for line in fh:
|
||||
if line.startswith("recovery_system="):
|
||||
system_name = line.split('=', 1)[1].strip()
|
||||
log(f"read system name {system_name!r} from modeenv")
|
||||
break
|
||||
if system_name is None:
|
||||
system_names = os.listdir(systems_dir)
|
||||
if len(system_names) == 0:
|
||||
log("no systems found")
|
||||
return None
|
||||
elif len(system_names) > 1:
|
||||
log("multiple systems found, refusing to guess which to parse")
|
||||
return None
|
||||
else:
|
||||
system_name = system_names[0]
|
||||
log(f"parsing only system found {system_name}")
|
||||
system_dir = f"{chroot}/var/lib/snapd/seed/systems/{system_name}"
|
||||
if not os.path.isdir(system_dir):
|
||||
log(f"could not find system called {system_name}")
|
||||
return None
|
||||
return system_dir
|
||||
|
||||
|
||||
def parse_assertion_file(asserts, filename):
|
||||
# Parse the snapd assertions file 'filename' and store the
|
||||
# assertions found in 'asserts'.
|
||||
with open(filename) as fp:
|
||||
text = fp.read()
|
||||
|
||||
k = ''
|
||||
|
||||
for block in text.split('\n\n'):
|
||||
if block.startswith('type:'):
|
||||
this_assert = {}
|
||||
for line in block.split('\n'):
|
||||
if line.startswith(' '):
|
||||
this_assert[k.strip()] += '\n' + line
|
||||
continue
|
||||
k, v = line.split(':', 1)
|
||||
this_assert[k.strip()] = v.strip()
|
||||
asserts.setdefault(this_assert['type'], []).append(this_assert)
|
||||
|
||||
|
||||
def make_manifest_from_system(system_dir):
|
||||
files = [f"{system_dir}/model"] + glob.glob(f"{system_dir}/assertions/*")
|
||||
|
||||
asserts = {}
|
||||
for filename in files:
|
||||
parse_assertion_file(asserts, filename)
|
||||
|
||||
[model] = asserts['model']
|
||||
snaps = yaml.safe_load(model['snaps'])
|
||||
|
||||
snap_names = []
|
||||
for snap in snaps:
|
||||
snap_names.append(snap['name'])
|
||||
snap_names.sort()
|
||||
|
||||
snap_name_to_id = {}
|
||||
snap_id_to_rev = {}
|
||||
for decl in asserts['snap-declaration']:
|
||||
snap_name_to_id[decl['snap-name']] = decl['snap-id']
|
||||
for rev in asserts['snap-revision']:
|
||||
snap_id_to_rev[rev['snap-id']] = rev['snap-revision']
|
||||
|
||||
log('Writing manifest to {}'.format(FNAME))
|
||||
|
||||
with open(FNAME, 'a+') as fh:
|
||||
for snap_name in snap_names:
|
||||
channel = snap['default-channel']
|
||||
rev = snap_id_to_rev[snap_name_to_id[snap_name]]
|
||||
fh.write(f"{LINE_PREFIX}{snap_name}\t{channel}\t{rev}\n")
|
||||
|
||||
|
||||
if os.path.isfile(YAML_PATH):
|
||||
log(f"seed.yaml found at {YAML_PATH}")
|
||||
make_manifest_from_seed_yaml(YAML_PATH)
|
||||
else:
|
||||
log("yaml path found.")
|
||||
system_dir = look_for_uc20_model(CHROOT_ROOT)
|
||||
if system_dir is None:
|
||||
log("WARNING: could not find seed.yaml or uc20-style seed")
|
||||
exit(0)
|
||||
make_manifest_from_system(system_dir)
|
||||
|
||||
with open(YAML_PATH, 'r') as fh:
|
||||
yaml_lines = yaml.safe_load(fh)['snaps']
|
||||
|
||||
log('Writing manifest to {}'.format(FNAME))
|
||||
|
||||
with open(FNAME, 'a+') as fh:
|
||||
for item in yaml_lines:
|
||||
filestring = item['file']
|
||||
# Pull the revision number off the file name
|
||||
revision = filestring[filestring.rindex('_')+1:]
|
||||
revision = re.sub(r'[^0-9]', '', revision)
|
||||
fh.write("{}{}\t{}\t{}\n".format(LINE_PREFIX,
|
||||
item['name'],
|
||||
item['channel'],
|
||||
revision,
|
||||
))
|
||||
log('Manifest output finished.')
|
||||
|
18
live-build/ubuntu/hooks/020-foreign-arch.chroot_early
Executable file
18
live-build/ubuntu/hooks/020-foreign-arch.chroot_early
Executable file
@ -0,0 +1,18 @@
|
||||
#! /bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
case ${PASS:-} in
|
||||
standard)
|
||||
;;
|
||||
*)
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "$(dpkg --print-architecture)" = amd64 ]; then
|
||||
echo "I: Enabling amd64 multiarch support on amd64"
|
||||
dpkg --add-architecture i386
|
||||
|
||||
apt-get -y update
|
||||
fi
|
@ -3,7 +3,7 @@
|
||||
set -eux
|
||||
|
||||
case ${PASS:-} in
|
||||
minimal.standard.enhanced-secureboot)
|
||||
standard.enhanced-secureboot)
|
||||
;;
|
||||
*)
|
||||
exit 0
|
||||
@ -16,11 +16,13 @@ if [ -n "${SUBPROJECT:-}" ]; then
|
||||
fi
|
||||
|
||||
. config/binary
|
||||
. config/functions
|
||||
|
||||
# env SNAPPY_STORE_NO_CDN=1 snap known --remote model series=16 brand-id=canonical model=ubuntu-classic-2310-amd64 > config/classic-model.model
|
||||
cat <<EOF > config/classic-model.model
|
||||
type: model
|
||||
authority-id: canonical
|
||||
revision: 4
|
||||
series: 16
|
||||
brand-id: canonical
|
||||
model: ubuntu-classic-2310-amd64
|
||||
@ -36,7 +38,7 @@ snaps:
|
||||
name: pc
|
||||
type: gadget
|
||||
-
|
||||
default-channel: 24-hwe/stable
|
||||
default-channel: 23.10/stable
|
||||
id: pYVQrBcKmBa0mZ4CCN7ExT6jH8rY1hza
|
||||
name: pc-kernel
|
||||
type: kernel
|
||||
@ -50,67 +52,60 @@ snaps:
|
||||
id: PMrrV4ml8uWuEUDBT8dSGnKUYbevVhc4
|
||||
name: snapd
|
||||
type: snapd
|
||||
-
|
||||
default-channel: latest/stable
|
||||
id: DLqre5XGLbDqg9jPtiAhRRjDuPVa5X1q
|
||||
name: core20
|
||||
type: base
|
||||
-
|
||||
default-channel: latest/stable
|
||||
id: EISPgh06mRh1vordZY9OZ34QHdd7OrdR
|
||||
name: bare
|
||||
type: base
|
||||
-
|
||||
default-channel: latest/stable
|
||||
default-channel: latest/stable/ubuntu-23.10
|
||||
id: 3wdHCAVyZEmYsCMFDE9qt92UV8rC8Wdk
|
||||
name: firefox
|
||||
type: app
|
||||
-
|
||||
default-channel: latest/stable
|
||||
id: rw36mkAjdIKl13dzfwyxP87cejpyIcct
|
||||
name: gnome-3-38-2004
|
||||
type: app
|
||||
-
|
||||
default-channel: latest/stable
|
||||
default-channel: latest/stable/ubuntu-23.10
|
||||
id: lATO8HzwVvrAPrlZRAWpfyrJKlAJrZS3
|
||||
name: gnome-42-2204
|
||||
type: app
|
||||
-
|
||||
default-channel: latest/stable
|
||||
default-channel: latest/stable/ubuntu-23.10
|
||||
id: jZLfBRzf1cYlYysIjD2bwSzNtngY0qit
|
||||
name: gtk-common-themes
|
||||
type: app
|
||||
-
|
||||
default-channel: latest/stable
|
||||
default-channel: latest/stable/ubuntu-23.10
|
||||
id: gjf3IPXoRiipCu9K0kVu52f0H56fIksg
|
||||
name: snap-store
|
||||
type: app
|
||||
-
|
||||
default-channel: latest/stable
|
||||
default-channel: latest/stable/ubuntu-23.10
|
||||
id: IrwRHakqtzhFRHJOOPxKVPU0Kk7Erhcu
|
||||
name: snapd-desktop-integration
|
||||
type: app
|
||||
timestamp: 2023-07-18T12:00:00.0Z
|
||||
timestamp: 2023-08-24T12:00:00.0Z
|
||||
sign-key-sha3-384: 9tydnLa6MTJ-jaQTFUXEwHl1yRx7ZS4K5cyFDhYDcPzhS7uyEkDxdUjg9g08BtNn
|
||||
|
||||
AcLBXAQAAQoABgUCZLa6ewAKCRDgT5vottzAEu9jD/9dfuMX8kDWrEaaiv+3g6GB/xEuhHkVStOU
|
||||
5c+7M9wB19BQrIhKCbYnNNGLJrIJj1DDThwCK+/L43NiiuolEDaTAGbKPxw7BhCMitnX9i3fxkFm
|
||||
WaAsc667Fi9QVTb7XFKrzUiU7cwmqCI0ZjAn1fx8zXutRPISKw8fQaL8Acv80lNSWL5dyyJ1gtvC
|
||||
jMGVbD8R45pF+n8u5sNQaRweYayNv+TFAJDquGxP3Cuu0DYiO3SzsBpg8BV9siqByOshO+93DCaM
|
||||
8Vl3RFPGdY+M+kJsoI3GBHlZ3K+Hl1biVPpfm74T5DXQiLAxzs7iPgfqGC0QwRdzxHsNCETZrVAn
|
||||
PzRDiagJSQWgAB1/zUVDgHIOw52OmHrTavwK7/p983na/HhVfU0rV3vZ/Ve6XsTryoOZ6Z31ygc4
|
||||
NiAtm8z7rRSsehR3JdykrtJziaE26lph9gl3QgdSYnfOGB+IOUt/Y6jf9hcAEIXqCMVKoiL2ynlp
|
||||
G+nrcV25FfId+FDjezbfvPGe71fsjVZyL4ReQPCZRyCBujcASsn7sitZTuiZzYX8L9Uwl4baO6/a
|
||||
dRTqQ4onOgta0LnuGFoIg4ifs7OLcyZmuQUoVR8a8IwNvq9/acYZ/uoYBUwWpzkqF2i1Wc8t+zvx
|
||||
uqvrEaWLoj9oa4E+956QJLGfn+qwSNeURdfkjAoPnA==
|
||||
AcLBXAQAAQoABgUCZOjUagAKCRDgT5vottzAEgUCD/9ZjBDGZZv7cbIvPWUpqx42XeespLf6xJK6
|
||||
iadXGNJD910+RkzMPrxAtoo8tmYYIrrbw2Q9lbNOcMfl2akxV+TJzYez2J6V/6wvaPraCFbIdKhr
|
||||
d+bI3e1QTxdlejfc3Nu4ImhKlFEsYrYJZIwAcm7btvmoidoQBXSoUxc7lDt5vdv4mN+bVvVOhew9
|
||||
/FG7U+G5w4yZzkW5rH1lhBGIZX76D6+/3AVlC/R69mBUPDNDeGj48IUT8iV58cYYprchMbw4LIU6
|
||||
l92wqbhl3uQveoWUqirHbQYa8q7D85XnvlukaPb3LQL6rJzuAU1G1jmLPkMz5mqQsRBBuhC9skR4
|
||||
UWHK7TWsKSlWmCfZAVn9wZezPZ4M+dQv8QNb7JpCmVNZ4GL/uMOds213FTeNJhowVfqgT1sMv9LP
|
||||
H8mPIB1COn50+6XpZPUj49i2yiVN+BeuhRG9BDdstDie8gNOMvJgyvh0WmfgmIQcCuRgzheqj/co
|
||||
0a8WuqYLsmyQCERP1fhuR/27d5+Dxg7DuiwocZwgXjtRkhUJrCnNWJnY//03sVXilFitEdlLVPt7
|
||||
WVhBSGHlrIaayLiOmCshvLqKZN5Cum9hXZ+wxWI/liG27eXOwaMDKPg/KeyxsHWNrXyuT5ZrTL7w
|
||||
eAEuriz8mNgmJtzImEkhymjuAuSTL284F1WpeW/cIg==
|
||||
EOF
|
||||
|
||||
channel=""
|
||||
if [ -n "${CHANNEL:-}" ]; then
|
||||
channel="--channel $CHANNEL"
|
||||
fi
|
||||
|
||||
reset_snapd_state chroot
|
||||
|
||||
env SNAPPY_STORE_NO_CDN=1 snap prepare-image \
|
||||
--classic config/classic-model.model $channel chroot
|
||||
mv chroot/system-seed/systems/* chroot/system-seed/systems/enhanced-secureboot-desktop
|
||||
rsync -a chroot/system-seed/ chroot/var/lib/snapd/seed
|
||||
rm -rf chroot/system-seed/
|
||||
rm -rf chroot/var/lib/snapd/seed
|
||||
mv chroot/system-seed chroot/var/lib/snapd/seed
|
||||
|
@ -1,99 +0,0 @@
|
||||
#! /bin/sh
|
||||
|
||||
set -eux
|
||||
|
||||
case ${PASS:-} in
|
||||
minimal.standard.live)
|
||||
;;
|
||||
*)
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -n "${SUBPROJECT:-}" ]; then
|
||||
echo "We don't run Ubuntu Desktop hooks for this project."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
. config/binary
|
||||
|
||||
# env SNAPPY_STORE_NO_CDN=1 snap known --remote model series=16 brand-id=canonical model=ubuntu-installer-classic-2310-amd64 > config/classic-model-installer.model
|
||||
cat <<EOF > config/classic-model-installer.model
|
||||
type: model
|
||||
authority-id: canonical
|
||||
series: 16
|
||||
brand-id: canonical
|
||||
model: ubuntu-installer-classic-2310-amd64
|
||||
architecture: amd64
|
||||
base: core22
|
||||
classic: true
|
||||
distribution: ubuntu
|
||||
grade: signed
|
||||
snaps:
|
||||
-
|
||||
default-channel: latest/stable
|
||||
id: amcUKQILKXHHTlmSa7NMdnXSx02dNeeT
|
||||
name: core22
|
||||
type: base
|
||||
-
|
||||
default-channel: latest/stable
|
||||
id: PMrrV4ml8uWuEUDBT8dSGnKUYbevVhc4
|
||||
name: snapd
|
||||
type: snapd
|
||||
-
|
||||
classic: true
|
||||
default-channel: latest/stable/canary-23.10
|
||||
id: rQm0TtMOYOtEslvEXgxQDhgy1JNn38Wz
|
||||
name: ubuntu-desktop-installer
|
||||
type: app
|
||||
timestamp: 2023-07-18T12:00:00.0Z
|
||||
sign-key-sha3-384: 9tydnLa6MTJ-jaQTFUXEwHl1yRx7ZS4K5cyFDhYDcPzhS7uyEkDxdUjg9g08BtNn
|
||||
|
||||
AcLBXAQAAQoABgUCZLa6iQAKCRDgT5vottzAEh+hEACxb8nNg/2yznOanHsCY69miFDHvxLf2AGB
|
||||
qeE+XJ9pyN05/JkvrDhODL0DCknFuvgo5kl+FhrS+mPdviytc3Ppm3kHSnPuwfzuO4t8PM1mRMOZ
|
||||
8djtgzbStKAzwKyYiK/pon4/Wtu1+6/tTp8Ji/pH12aRoFBub6mtQD81hC/xVxdcKz8KvzGsD5co
|
||||
H1TLfhKACVQJHZp7ErShkB6Ka6nVQy1c8/4sDPadKb2mqraIVMJmmHlYAHMfGl6f1dElheAjWXmz
|
||||
0Roz4fh4lvjM0GmYTlsmhEj10F0pdwY/C2jB+6VFBJEZax65mRjs6Jaqxa150a26sOVFcMkS0ifO
|
||||
pkB+KHrnilJ0/PyXZCoQcL65wTBEnfI0X/nzhvuE+9dXz5EUlusWeMvEhJ4QNOacCPARSd76M7QB
|
||||
gUhMrz4Vf68V6tlfbXxgoEJFoVJo4i7gymMPnZDg0uAGQFYK+SSVEO/VtLDQvwRBU80IdA0kaIsn
|
||||
afaqwYP8ACNPWpTztVYd/X6mvpdDz8MsW9pAEmJ4EN6JWcEu4ii5qXlzLK3s3HaCS5XNj+TpPEU+
|
||||
9Nh9ePmCfE+KxR0cgfTbxP3KerYSd/xQHxgMLcMAGq20+1i/FmksKD6cSNYJRoqwTPwP+D9p42wF
|
||||
3qGR3KEYbIij4hk/fZMCNzUEWt41OLLUVKm81oOixg==
|
||||
EOF
|
||||
|
||||
channel=""
|
||||
if [ -n "${CHANNEL:-}" ]; then
|
||||
channel="--channel $CHANNEL"
|
||||
fi
|
||||
env SNAPPY_STORE_NO_CDN=1 snap prepare-image \
|
||||
--classic config/classic-model-installer.model $channel chroot
|
||||
mv chroot/system-seed/systems/* chroot/system-seed/systems/classic-installer
|
||||
rsync -a chroot/system-seed/ chroot/var/lib/snapd/seed
|
||||
rm -rf chroot/system-seed/
|
||||
|
||||
cat <<EOF > chroot/var/lib/snapd/modeenv
|
||||
mode=run
|
||||
recovery_system=classic-installer
|
||||
EOF
|
||||
|
||||
# Temporary while we still use the subiquity TUI for the live system
|
||||
cat > chroot/usr/lib/systemd/user/subiquity-tui.service << EOF
|
||||
[Unit]
|
||||
Description=subiquity tui
|
||||
PartOf=graphical-session.target
|
||||
After=graphical-session.target
|
||||
|
||||
# Never run in GDM
|
||||
Conflicts=gnome-session@gnome-login.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/gnome-terminal --wait -- sudo sh -c 'echo waiting for snapd; snap wait system seed.loaded; sleep 5; snap run subiquity'
|
||||
Restart=no
|
||||
EOF
|
||||
mkdir chroot/etc/systemd/user/graphical-session.target.wants/
|
||||
ln -vs /usr/lib/systemd/user/subiquity-tui.service chroot/etc/systemd/user/graphical-session.target.wants/
|
||||
|
||||
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
|
@ -3,18 +3,13 @@
|
||||
set -eu
|
||||
|
||||
case ${PASS:-} in
|
||||
minimal.standard.live)
|
||||
standard.live)
|
||||
;;
|
||||
*)
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
# As described in LP: #2025339, an initrd built from a jammy userspace
|
||||
# (which is what we use for Ubuntu Desktop builds currently) cannot fsck a
|
||||
# mantic root filesystem created with the default options.
|
||||
sed -i -e 's/,orphan_file//' /etc/mke2fs.conf
|
||||
|
||||
cat <<EOF > /etc/initramfs-tools/conf.d/casperize.conf
|
||||
export CASPER_GENERATE_UUID=1
|
||||
EOF
|
||||
@ -22,10 +17,3 @@ EOF
|
||||
cat <<EOF > /etc/initramfs-tools/conf.d/default-layer.conf
|
||||
LAYERFS_PATH=${PASS}.squashfs
|
||||
EOF
|
||||
|
||||
if [ "$(dpkg --print-architecture)" = amd64 ]; then
|
||||
echo "I: Enabling amd64 multiarch support on amd64"
|
||||
dpkg --add-architecture i386
|
||||
|
||||
apt-get -y update
|
||||
fi
|
||||
|
@ -37,12 +37,18 @@ for entry in output:
|
||||
if 'variations' not in template:
|
||||
print("Non unique id in source catalog but no variations!")
|
||||
sys.exit(1)
|
||||
for k, variation in template['variations'].items():
|
||||
for variation in template['variations'].values():
|
||||
variation['size'] = int(opts.size)
|
||||
entry.setdefault('variations', {}).update(template['variations'])
|
||||
break
|
||||
else:
|
||||
# No entry with this id found, so add a new one.
|
||||
|
||||
if 'variations' in template:
|
||||
for variation in template['variations'].values():
|
||||
if variation['path'] == opts.squashfs:
|
||||
variation['size'] = int(opts.size)
|
||||
|
||||
template['size'] = int(opts.size)
|
||||
template['path'] = opts.squashfs
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user