From e453f965481001e11b84d6bcd163d7d9a0927ced Mon Sep 17 00:00:00 2001 From: CloudBuilder Date: Mon, 1 Oct 2018 20:06:07 +0000 Subject: [PATCH] Imported 2.541 No reason for CPC update specified. --- debian/changelog | 11 +++++++++++ live-build/auto/build | 5 +++++ live-build/auto/config | 3 +++ live-build/functions | 18 +++++++++++++++--- 4 files changed, 34 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index e9695751..0c1e3411 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +livecd-rootfs (2.541) cosmic; urgency=medium + + [ Michael Hudson-Doyle ] + * Remove device nodes from Docker images. (LP: #1645468) + + [ Robert C Jennings ] + * Add the server snap seed to the ubuntu-cpc project + * Allow hooks to replace generic snap assertion + + -- Steve Langasek Thu, 27 Sep 2018 15:21:49 -0700 + livecd-rootfs (2.540) cosmic; urgency=medium * Ensure /lib/modules exists in root tarballs and sqashfs. diff --git a/live-build/auto/build b/live-build/auto/build index 70088cf1..4b6fdc2e 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -266,6 +266,11 @@ EOF # Save even more size by removing apt lists (that are currently removed # downstream anyway) rm -rf chroot/var/lib/apt/lists/* + # Having device notes in the docker image can cause problems + # (https://github.com/tianon/docker-brew-ubuntu-core/issues/62) + # so remove them. We only do this for docker out of an + # abundance of caution. + rm -rf chroot/dev/* fi if [ -f config/universe-enabled ]; then diff --git a/live-build/auto/config b/live-build/auto/config index fd2ce64d..5ab67fac 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -696,6 +696,9 @@ case $PROJECT:${SUBPROJECT:-} in ubuntu:*|kubuntu*:*|lubuntu*:*|xubuntu*:*|ubuntu-mate*:*|ubuntustudio*:*|ubuntukylin*:*|ubuntu-budgie*:*) BASE_SEED='desktop' ;; + ubuntu-cpc:*) + BASE_SEED='server' + ;; ubuntu-server:live) BASE_SEED='server' # subiquity is seeded but in a separate squashfs via hooks; set HOOK_SNAPS and ALL_SNAPS. diff --git a/live-build/functions b/live-build/functions index 4441f2b1..cf68ba16 100644 --- a/live-build/functions +++ b/live-build/functions @@ -427,6 +427,16 @@ snap_prepare_assertions() { local brand="$(echo $CUSTOM_BRAND_MODEL | cut -d: -f 1)" local model="$(echo $CUSTOM_BRAND_MODEL | cut -d: -f 2)" + # Clear the assertions if they already exist + if [ -e "$model_assertion" ] ; then + existing_model=$(awk '/^model: / {print $2}' $model_assertion) + existing_brand=$(awk '/^brand-id: / {print $2}' $model_assertion) + echo "snap_prepare_assertions: replacing $existing_brand:$existing_model with $brand:$model" + rm "$model_assertion" + rm "$account_key_assertion" + rm "$account_assertion" + fi + if ! [ -e "$model_assertion" ] ; then snap known --remote model series=16 \ model=$model brand-id=$brand \ @@ -441,7 +451,6 @@ snap_prepare_assertions() { > "$account_key_assertion" fi - if ! [ -e "$account_assertion" ] ; then local account=$(sed -n -e's/account-id: //p' < "$account_key_assertion") snap known --remote account account-id=$account \ @@ -468,13 +477,16 @@ snap_prepare() { } snap_preseed() { - # Preseed a snap in the image + # Preseed a snap in the image (snap_prepare must be called once prior) local CHROOT_ROOT=$1 local SNAP=$2 # Per Ubuntu policy, all seeded snaps (with the exception of the core # snap) must pull from stable/ubuntu-$(release_ver) as their channel. local CHANNEL=${3:-"stable/ubuntu-$(release_ver)"} - snap_prepare $CHROOT_ROOT + if [ ! -e "$CHROOT_ROOT/var/lib/snapd/seed/assertions/model" ]; then + echo "ERROR: Snap model assertion not present, snap_prepare must be called" + exit 1 + fi _snap_preseed $CHROOT_ROOT $SNAP $CHANNEL }