Compare commits

...

5 Commits

Author SHA1 Message Date
Olivier Gayot
383a1206cc releasing package livecd-rootfs version 26.04.12 2025-12-17 17:29:46 -07:00
Olivier Gayot
2f918331fb ubuntu: use the same for in construct when getting snap args
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2025-12-16 16:14:53 +01:00
Olivier Gayot
e6558e2541 ubuntu: add a filter for snaps too
We now filter snaps using jq rather than grep. The change has a slight impact
because snapd-desktop-integration was filtered out by "grep snapd" but isn't
filtered out anymore with jq.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2025-12-16 16:14:53 +01:00
Olivier Gayot
01c80d8d0a ubuntu: fix snap components pulled from the wrong model
We have a mechanism in place to override a snap when building an image.
Unfortunately, we didn't factor this in when forcing optional components to be
included in the image.

This was okay before because the stable model and the dangerous model had the
same components declared.

But now that pc-kernel has different components in the stable and the dangerous
model, things are broken.

Indeed, when building the stable image, we tried to include the pc-kernel from
the stable model with the pc-kernel components from the dangerous model. But
they are not compatible.

Fixed by including components from the right model. If we're overriding a snap
with a definition from a different model, then pull the components from that
same model.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2025-12-16 16:14:53 +01:00
Olivier Gayot
72511a0381 ubuntu: declare variables from stable & dangerous models
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2025-12-16 14:56:13 +01:00
3 changed files with 115 additions and 37 deletions

14
debian/changelog vendored
View File

@ -1,3 +1,17 @@
livecd-rootfs (26.04.12) resolute; urgency=medium
* desktop: add variables pointing to the different models (stable & dangerous).
* desktop: fix snap components taken from original model when overriding a
snap with another model.
- if we decide to override the definition of a snap (i.e., by taking in
from a different model), we also need to override the definition of its
components.
* desktop: refactor how we filter the snaps when overriding
* desktop: update the dangerous model so that it includes core26 and the 6.17
kernel and components.
-- Olivier Gayot <olivier.gayot@canonical.com> Tue, 16 Dec 2025 14:54:17 +0100
livecd-rootfs (26.04.11) resolute; urgency=medium livecd-rootfs (26.04.11) resolute; urgency=medium
[ Valentin Haudiquet ] [ Valentin Haudiquet ]

View File

@ -31,24 +31,46 @@ json.dump(yaml.safe_load(sys.stdin), sys.stdout, default=str)
# Use jq to retrieve a list of --snap options from a given *signed* model. # Use jq to retrieve a list of --snap options from a given *signed* model.
get_snaps_args() get_snaps_args_excluding()
{ {
local model=$1 local model=$1
local jq_filter='
# Find all snaps that are not filtered out.
# The filtered out snaps are passed as positional arguments so they end up in
# the $ARGS.positional array.
.snaps[] | select(.name | IN($ARGS.positional[]) | not)
# Then forge the --snap option.
| "--snap=" + .name + "=" + .["default-channel"]'
shift
# The model is signed and is not valid YAML unless we get rid of the # The model is signed and is not valid YAML unless we get rid of the
# signature. Here we assume the only blank line is before the signature. # signature. Here we assume the only blank line is before the signature.
sed '/^$/,$d' -- "$model" \ sed '/^$/,$d' -- "$model" \
| yaml_to_json \ | yaml_to_json \
| jq --raw-output '.snaps[] | "--snap=" + .name + "=" + .["default-channel"]' | jq --raw-output "$jq_filter" --args "$@"
} }
get_all_components() # Use jq to retrieve a list of --snap options from a given *signed* model.
get_snaps_args()
{ {
# Get list of all components in every snaps
local model=$1 local model=$1
get_snaps_args_excluding "$model"
}
_get_components_filtered()
{
local excluded=$1
local model=$2
local jq_filter=' local jq_filter='
# Find all snaps that have components # Find all snaps that are either filtered in or filtered out
.snaps[] | select(.components) # The filtered in (or out) snaps are passed as positional arguments so they end up in
# the $ARGS.positional array. The excluded variable is passed separately and
# tells if we want to filter in (i.e., excluded=false) or filter out (i.e.,
# excluded=true).
.snaps[] | select(.name | IN($ARGS.positional[]) | if $excluded then not else . end)
# and have components
| select(.components)
# Then save the name of each snap in a variable # Then save the name of each snap in a variable
| .name as $snap | .name as $snap
# Then for each entry that has "optional" # Then for each entry that has "optional"
@ -56,9 +78,35 @@ get_all_components()
# Output its name with the snap name prepended # Output its name with the snap name prepended
| "\($snap)" + "+" + .[].key' | "\($snap)" + "+" + .[].key'
shift 2
sed '/^$/,$d' -- "$model" \ sed '/^$/,$d' -- "$model" \
| yaml_to_json \ | yaml_to_json \
| jq --raw-output "$jq_filter" | jq --raw-output "$jq_filter" --argjson excluded "$excluded" --args "$@"
}
# Get list of all components for all snaps
get_all_components()
{
local model=$1
# Provide an exclusion list but empty
_get_components_filtered true "$model"
}
# Get list of all components for all snaps except the ones specified.
get_components_excluding()
{
local model=$1
shift
_get_components_filtered true "$model" "$@"
}
# Get list of all components for the snaps specified.
get_components()
{
local model=$1
shift
_get_components_filtered false "$model" "$@"
} }
# Generation of the model: # Generation of the model:
@ -78,38 +126,53 @@ get_all_components()
# env SNAPPY_STORE_NO_CDN=1 snap known --remote model series=16 brand-id=canonical model=ubuntu-classic-2410-amd64 > config/classic-model.model # env SNAPPY_STORE_NO_CDN=1 snap known --remote model series=16 brand-id=canonical model=ubuntu-classic-2410-amd64 > config/classic-model.model
# #
# model=/usr/share/livecd-rootfs/live-build/${PROJECT}/ubuntu-classic-amd64.model dangerous_model=/usr/share/livecd-rootfs/live-build/${PROJECT}/ubuntu-classic-amd64-dangerous.model
# Normally we use the non-dangerous model here. Use the dangerous one for now stable_model=/usr/share/livecd-rootfs/live-build/${PROJECT}/ubuntu-classic-amd64.model
# until we get snaps on stable 26.04 tracks and channels.
model=/usr/share/livecd-rootfs/live-build/${PROJECT}/ubuntu-classic-amd64-dangerous.model
prepare_args=() prepare_args=()
components=()
# for the dangerous subproject, we need the dangerous model! # for the dangerous subproject, we need the dangerous model!
if [ "$SUBPROJECT" = "dangerous" ]; then if [ "$SUBPROJECT" = "dangerous" ]; then
# As with the "classically" seeded snaps, snaps from the edge channel may # As with the "classically" seeded snaps, snaps from the edge channel may
# require different content snaps to be installed, so they must be # require different content snaps to be installed, so they must be
# included in the system as well. We just use the same list as was # included in the system as well. We just use the same list as was
# computed in snap_validate_seed. # computed in snap_validate_seed.
model=/usr/share/livecd-rootfs/live-build/${PROJECT}/ubuntu-classic-amd64-dangerous.model model="${dangerous_model}"
while read snap; do while read snap; do
prepare_args+=("--snap=${snap}=edge") prepare_args+=("--snap=${snap}=edge")
done < config/missing-providers done < config/missing-providers
else
# We're currently using the dangerous model for the non-dangerous ISO
# because it allows us to override snaps. But we don't want all snaps from
# edge like the dangerous model has, we want most of them from stable
# excluding:
# * snapd (for TPM/FDE)
# * firmware-updater (for TPM/FDE)
# * desktop-security-center (for TPM/FDE)
while read -r snap_arg; do
prepare_args+=("$snap_arg")
done < <(get_snaps_args /usr/share/livecd-rootfs/live-build/"${PROJECT}"/ubuntu-classic-amd64.model \
| grep -v -F -e snapd -e firmware-updater -e desktop-security-center)
fi
for comp in $(get_all_components "$model"); do for comp in $(get_all_components "$model"); do
components+=("$comp")
done
else
# Normally we use the stable model here. Use the dangerous one for now
# until we get snaps on stable 26.04 tracks and channels.
#model="${stable_model}"
model="${dangerous_model}"
# We're currently using the dangerous model for the stable image because it
# allows us to override snaps. But we don't want all snaps from edge like
# the dangerous model has, we want most of them from stable excluding:
# * snapd (for TPM/FDE)
# * snapd-desktop-integration (for TPM/FDE)
# * firmware-updater (for TPM/FDE)
# * desktop-security-center (for TPM/FDE)
snaps_from_dangerous=(snapd snapd-desktop-integration firmware-updater desktop-security-center)
for snap_arg in $(get_snaps_args_excluding "$stable_model" "${snaps_from_dangerous[@]}"); do
prepare_args+=("$snap_arg")
done
for comp in $(get_components_excluding "$stable_model" "${snaps_from_dangerous[@]}"); do
components+=("$comp")
done
for comp in $(get_components "$dangerous_model" "${snaps_from_dangerous[@]}"); do
components+=("$comp")
done
fi
for comp in "${components[@]}"; do
prepare_args+=(--comp "$comp") prepare_args+=(--comp "$comp")
done done

View File

@ -16,13 +16,9 @@ snaps:
type: gadget type: gadget
- -
components: components:
nvidia-550-erd-ko: nvidia-580-uda-ko:
presence: optional presence: optional
nvidia-550-erd-user: nvidia-580-uda-user:
presence: optional
nvidia-570-erd-ko:
presence: optional
nvidia-570-erd-user:
presence: optional presence: optional
default-channel: 26.04/beta default-channel: 26.04/beta
id: pYVQrBcKmBa0mZ4CCN7ExT6jH8rY1hza id: pYVQrBcKmBa0mZ4CCN7ExT6jH8rY1hza
@ -38,6 +34,11 @@ snaps:
id: dwTAh7MZZ01zyriOZErqd1JynQLiOGvM id: dwTAh7MZZ01zyriOZErqd1JynQLiOGvM
name: core24 name: core24
type: base type: base
-
default-channel: latest/edge
id: cUqM61hRuZAJYmIS898Ux66VY61gBbZf
name: core26
type: base
- -
default-channel: latest/edge default-channel: latest/edge
id: PMrrV4ml8uWuEUDBT8dSGnKUYbevVhc4 id: PMrrV4ml8uWuEUDBT8dSGnKUYbevVhc4
@ -93,16 +94,16 @@ snaps:
id: IrwRHakqtzhFRHJOOPxKVPU0Kk7Erhcu id: IrwRHakqtzhFRHJOOPxKVPU0Kk7Erhcu
name: snapd-desktop-integration name: snapd-desktop-integration
type: app type: app
timestamp: 2025-11-06T12:00:00.0Z timestamp: 2025-12-09T12:00:00.0Z
sign-key-sha3-384: 9tydnLa6MTJ-jaQTFUXEwHl1yRx7ZS4K5cyFDhYDcPzhS7uyEkDxdUjg9g08BtNn sign-key-sha3-384: 9tydnLa6MTJ-jaQTFUXEwHl1yRx7ZS4K5cyFDhYDcPzhS7uyEkDxdUjg9g08BtNn
AcLBXAQAAQoABgUCaSatwAAKCRDgT5vottzAEtItEACX3Ks4EJiFMUFAilxJNGL1SK02OdxOMJZ9 AcLBXAQAAQoABgUCaUFt7QAKCRDgT5vottzAEhdnD/92LBcQm3iw/kPao4KqGE0OhfXDFd7Z6+Qv
78FYP/pANI37Y+sPOrybHFkcbI21S6VaeFJTfJxE/tl7TbzYA9KBbi6MUKu7/r5mYIO/ylOFBGKI A1Dlzz6Cw0tuj0r5aZH7vJQCx4kC1Eaoi8apg3XhqAyhr74/MsIwMhPPL8qcSNv8ZWruoGwFp/rx
iqI0gFOl0KovUiG2PtgfJiy+qnFBsPy47z6rADGUJYya5sKyrjll9hCriqxrQhBCYIkVlryheryk M6NSBKc6hrYqACYfEkBwfq9SgmIDQKFeBVudwswLK2SN58wrDNJjuWz/eJ5hUIIe3ga5ScfzO4Jr
U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