|
|
@ -15,6 +15,8 @@ if [ -z "${PROJECT:-}" ]; then
|
|
|
|
exit 1
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
. config/functions
|
|
|
|
|
|
|
|
|
|
|
|
# Link output files somewhere BuildLiveCD will be able to find them.
|
|
|
|
# Link output files somewhere BuildLiveCD will be able to find them.
|
|
|
|
PREFIX="livecd.$PROJECT${SUBARCH:+-$SUBARCH}"
|
|
|
|
PREFIX="livecd.$PROJECT${SUBARCH:+-$SUBARCH}"
|
|
|
|
|
|
|
|
|
|
|
@ -35,45 +37,12 @@ Setup_cleanup
|
|
|
|
|
|
|
|
|
|
|
|
preinstall_snaps() {
|
|
|
|
preinstall_snaps() {
|
|
|
|
lb chroot_resolv install
|
|
|
|
lb chroot_resolv install
|
|
|
|
snap_channel="stable/ubuntu-$(distro-info --series="$LB_DISTRIBUTION" \
|
|
|
|
snap_prepare chroot
|
|
|
|
-r | awk '{ print $1 }')"
|
|
|
|
|
|
|
|
chroot chroot sh -c '
|
|
|
|
|
|
|
|
set -x;
|
|
|
|
|
|
|
|
cd /var/lib/snapd/seed;
|
|
|
|
|
|
|
|
SNAPPY_STORE_NO_CDN=1 snap download core'
|
|
|
|
|
|
|
|
for snap in "$@"; do
|
|
|
|
|
|
|
|
chroot chroot sh -c "
|
|
|
|
|
|
|
|
set -x;
|
|
|
|
|
|
|
|
cd /var/lib/snapd/seed;
|
|
|
|
|
|
|
|
SNAPPY_STORE_NO_CDN=1 snap download --channel=$snap_channel \"${snap%/*}\""
|
|
|
|
|
|
|
|
done
|
|
|
|
|
|
|
|
lb chroot_resolv remove
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CORE_SNAP=$(cd chroot/var/lib/snapd/seed; ls -1 core_*.snap)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cat <<EOF > chroot/var/lib/snapd/seed/seed.yaml
|
|
|
|
|
|
|
|
snaps:
|
|
|
|
|
|
|
|
- name: core
|
|
|
|
|
|
|
|
channel: stable
|
|
|
|
|
|
|
|
file: ${CORE_SNAP}
|
|
|
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
for snap in "$@"; do
|
|
|
|
for snap in "$@"; do
|
|
|
|
snap_name=${snap%/*}
|
|
|
|
snap_preseed chroot "${snap}"
|
|
|
|
cat <<EOF >> chroot/var/lib/snapd/seed/seed.yaml
|
|
|
|
|
|
|
|
- name: ${snap_name}
|
|
|
|
|
|
|
|
channel: $snap_channel
|
|
|
|
|
|
|
|
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_name}_*.snap) \
|
|
|
|
|
|
|
|
>> chroot/var/lib/snapd/seed/seed.yaml
|
|
|
|
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
lb chroot_resolv remove
|
|
|
|
mkdir -p chroot/var/lib/snapd/seed/snaps \
|
|
|
|
|
|
|
|
chroot/var/lib/snapd/seed/assertions
|
|
|
|
|
|
|
|
mv chroot/var/lib/snapd/seed/*.assert \
|
|
|
|
|
|
|
|
chroot/var/lib/snapd/seed/assertions/
|
|
|
|
|
|
|
|
mv chroot/var/lib/snapd/seed/*.snap chroot/var/lib/snapd/seed/snaps/
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
rm -f binary.success
|
|
|
|
rm -f binary.success
|
|
|
@ -94,6 +63,16 @@ Expire-Date: 0
|
|
|
|
|
|
|
|
|
|
|
|
lb bootstrap "$@"
|
|
|
|
lb bootstrap "$@"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case $PROJECT in
|
|
|
|
|
|
|
|
ubuntu-server|ubuntu-cpc)
|
|
|
|
|
|
|
|
# Set locale to C.UTF-8 by default. We should
|
|
|
|
|
|
|
|
# probably do this for all images early in the
|
|
|
|
|
|
|
|
# 18.10 cycle but for now just do it for
|
|
|
|
|
|
|
|
# server and cpc products.
|
|
|
|
|
|
|
|
echo "LANG=C.UTF-8" > chroot/etc/default/locale
|
|
|
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
|
|
if [ "${SUBPROJECT:-}" = minimized ] \
|
|
|
|
if [ "${SUBPROJECT:-}" = minimized ] \
|
|
|
|
&& ! Chroot chroot dpkg -l tzdata 2>&1 |grep -q ^ii; then
|
|
|
|
&& ! Chroot chroot dpkg -l tzdata 2>&1 |grep -q ^ii; then
|
|
|
|
# workaround for tzdata purge not removing these files
|
|
|
|
# workaround for tzdata purge not removing these files
|
|
|
@ -374,26 +353,6 @@ deb file:/var/lib/preinstalled-pool/ $LB_DISTRIBUTION $LB_PARENT_ARCHIVE_AREAS
|
|
|
|
case $PROJECT:$SUBPROJECT in
|
|
|
|
case $PROJECT:$SUBPROJECT in
|
|
|
|
*)
|
|
|
|
*)
|
|
|
|
if [ -e "config/seeded-snaps" ]; then
|
|
|
|
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)
|
|
|
|
snap_list=$(cat config/seeded-snaps)
|
|
|
|
preinstall_snaps $snap_list
|
|
|
|
preinstall_snaps $snap_list
|
|
|
|
fi
|
|
|
|
fi
|
|
|
@ -409,8 +368,13 @@ deb file:/var/lib/preinstalled-pool/ $LB_DISTRIBUTION $LB_PARENT_ARCHIVE_AREAS
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [ "$PROJECT" = "ubuntu-cpc" ]; then
|
|
|
|
if [ "$PROJECT" = "ubuntu-cpc" ]; then
|
|
|
|
|
|
|
|
if [ "${SUBPROJECT:-}" = minimized ]; then
|
|
|
|
|
|
|
|
BUILD_NAME=minimal
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
BUILD_NAME=server
|
|
|
|
|
|
|
|
fi
|
|
|
|
cat > chroot/etc/cloud/build.info << EOF
|
|
|
|
cat > chroot/etc/cloud/build.info << EOF
|
|
|
|
build_name: server
|
|
|
|
build_name: $BUILD_NAME
|
|
|
|
serial: $BUILDSTAMP
|
|
|
|
serial: $BUILDSTAMP
|
|
|
|
EOF
|
|
|
|
EOF
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|