@ -42,7 +42,7 @@ preinstall_snaps() {
chroot chroot sh -c "
set -x;
cd /var/lib/snapd/seed;
SNAPPY_STORE_NO_CDN=1 snap download \"$snap\""
SNAPPY_STORE_NO_CDN=1 snap download \"${ snap%/*} \""
done
lb chroot_resolv remove
@ -55,12 +55,14 @@ snaps:
file: ${CORE_SNAP}
EOF
for snap in "$@"; do
snap_name=${snap%/*}
cat <<EOF >> chroot/var/lib/snapd/seed/seed.yaml
- name: $snap
- name: ${ snap_name}
channel: stable
EOF
case ${snap} in */classic) echo " classic: true" >> chroot/var/lib/snapd/seed/seed.yaml;; esac
echo -n " file: " >> chroot/var/lib/snapd/seed/seed.yaml
(cd chroot/var/lib/snapd/seed; ls -1 ${snap}_*.snap) \
(cd chroot/var/lib/snapd/seed; ls -1 ${snap_name }_*.snap) \
>> chroot/var/lib/snapd/seed/seed.yaml
done
@ -367,40 +369,33 @@ deb file:/var/lib/preinstalled-pool/ $LB_DISTRIBUTION $LB_PARENT_ARCHIVE_AREAS
rm chroot/etc/apt/sources.list.preinstall chroot/etc/apt/sources.list.orig
fi
case $PROJECT:$SUBPROJECT in
ubuntu-server:live|ubuntu-mate:*)
assertions_dir="chroot/var/lib/snapd/seed/assertions"
model_assertion="$assertions_dir/generic-classic.model"
account_key_assertion="$assertions_dir/generic.account-key"
account_assertion="$assertions_dir/generic.account"
mkdir -p "$assertions_dir"
snap known --remote model series=16 \
model=generic-classic brand-id=generic \
> "$model_assertion"
account_key=$(sed -n -e's/sign-key-sha3-384: //p' \
< "$model_assertion")
snap known --remote account-key \
public-key-sha3-384="$account_key" \
> "$account_key_assertion"
account=$(sed -n -e's/account-id: //p' \
< "$account_key_assertion")
snap known --remote account account-id=generic \
> "$account_assertion"
;;
esac
# FIXME: this should not be a hard-coded list in this script; this
# is an interim solution for 17.10.
case $PROJECT:$SUBPROJECT in
ubuntu-mate:*)
SNAP_LIST=pulsemixer
*)
if [ -e "config/seeded-snaps" ]; then
assertions_dir="chroot/var/lib/snapd/seed/assertions"
model_assertion="$assertions_dir/generic-classic.model"
account_key_assertion="$assertions_dir/generic.account-key"
account_assertion="$assertions_dir/generic.account"
mkdir -p "$assertions_dir"
snap known --remote model series=16 \
model=generic-classic brand-id=generic \
> "$model_assertion"
account_key=$(sed -n -e's/sign-key-sha3-384: //p' \
< "$model_assertion")
snap known --remote account-key \
public-key-sha3-384="$account_key" \
> "$account_key_assertion"
account=$(sed -n -e's/account-id: //p' \
< "$account_key_assertion")
snap known --remote account account-id=generic \
> "$account_assertion"
snap_list=$(cat config/seeded-snaps)
preinstall_snaps $snap_list
fi
;;
esac
if [ -n "$SNAP_LIST" ]; then
preinstall_snaps $SNAP_LIST
fi
if [ "$PROJECT" = "ubuntu-touch" ] || [ "$PROJECT" = "ubuntu-touch-custom" ]; then
if [ "$ARCH" = "armhf" ]; then