mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-05-12 03:11:40 +00:00
Import patches-unapplied version 2.524 to ubuntu/bionic-proposed
Imported using git-ubuntu import. Changelog parent: 5b1c30868244098db3b6ec8ab7ea7598d005accd New changelog entries: * Ensure MAAS squashfsi are clean of passwords. LP: #1764991. * Allow the configuration of model assertions independent of preseeding snaps. * Allow non-generic model assertions to be configured. * Don't include the name of the model assertion in the path we write it out to (LP: #1764541).
This commit is contained in:
parent
5b1c308682
commit
547df52eeb
16
debian/changelog
vendored
16
debian/changelog
vendored
@ -1,3 +1,19 @@
|
|||||||
|
livecd-rootfs (2.524) bionic; urgency=medium
|
||||||
|
|
||||||
|
* Ensure MAAS squashfsi are clean of passwords. LP: #1764991.
|
||||||
|
|
||||||
|
-- Dimitri John Ledkov <xnox@ubuntu.com> Thu, 19 Apr 2018 21:23:30 +0100
|
||||||
|
|
||||||
|
livecd-rootfs (2.523) bionic; urgency=medium
|
||||||
|
|
||||||
|
* Allow the configuration of model assertions independent of preseeding
|
||||||
|
snaps.
|
||||||
|
* Allow non-generic model assertions to be configured.
|
||||||
|
* Don't include the name of the model assertion in the path we write it out
|
||||||
|
to (LP: #1764541).
|
||||||
|
|
||||||
|
-- Daniel Watkins <daniel.watkins@canonical.com> Thu, 19 Apr 2018 11:44:38 -0400
|
||||||
|
|
||||||
livecd-rootfs (2.522) bionic; urgency=medium
|
livecd-rootfs (2.522) bionic; urgency=medium
|
||||||
|
|
||||||
* Remove landscape-common from minimal image, and handle restoring it in
|
* Remove landscape-common from minimal image, and handle restoring it in
|
||||||
|
@ -412,23 +412,29 @@ EOF
|
|||||||
(cd $snaps_dir; ls -1 ${SNAP_NAME}_*.snap) >> $seed_yaml
|
(cd $snaps_dir; ls -1 ${SNAP_NAME}_*.snap) >> $seed_yaml
|
||||||
}
|
}
|
||||||
|
|
||||||
snap_prepare() {
|
snap_prepare_assertions() {
|
||||||
# Configure basic snapd assertions and pre-seeds the 'core' snap
|
# Configure basic snapd assertions
|
||||||
local CHROOT_ROOT=$1
|
local CHROOT_ROOT=$1
|
||||||
|
# A colon-separated string of brand:model to be used for the image's model
|
||||||
|
# assertion
|
||||||
|
local CUSTOM_BRAND_MODEL=$2
|
||||||
|
|
||||||
local seed_dir="$CHROOT_ROOT/var/lib/snapd/seed"
|
local seed_dir="$CHROOT_ROOT/var/lib/snapd/seed"
|
||||||
local snaps_dir="$seed_dir/snaps"
|
local snaps_dir="$seed_dir/snaps"
|
||||||
local assertions_dir="$seed_dir/assertions"
|
local assertions_dir="$seed_dir/assertions"
|
||||||
local model_assertion="$assertions_dir/generic-classic.model"
|
local model_assertion="$assertions_dir/model"
|
||||||
local account_key_assertion="$assertions_dir/generic.account-key"
|
local account_key_assertion="$assertions_dir/account-key"
|
||||||
local account_assertion="$assertions_dir/generic.account"
|
local account_assertion="$assertions_dir/account"
|
||||||
|
|
||||||
mkdir -p "$assertions_dir"
|
mkdir -p "$assertions_dir"
|
||||||
mkdir -p "$snaps_dir"
|
mkdir -p "$snaps_dir"
|
||||||
|
|
||||||
|
local brand="$(echo $CUSTOM_BRAND_MODEL | cut -d: -f 1)"
|
||||||
|
local model="$(echo $CUSTOM_BRAND_MODEL | cut -d: -f 2)"
|
||||||
|
|
||||||
if ! [ -e "$model_assertion" ] ; then
|
if ! [ -e "$model_assertion" ] ; then
|
||||||
snap known --remote model series=16 \
|
snap known --remote model series=16 \
|
||||||
model=generic-classic brand-id=generic \
|
model=$model brand-id=$brand \
|
||||||
> "$model_assertion"
|
> "$model_assertion"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -446,6 +452,19 @@ snap_prepare() {
|
|||||||
snap known --remote account account-id=$account \
|
snap known --remote account account-id=$account \
|
||||||
> "$account_assertion"
|
> "$account_assertion"
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
snap_prepare() {
|
||||||
|
# Configure basic snapd assertions and pre-seeds the 'core' snap
|
||||||
|
local CHROOT_ROOT=$1
|
||||||
|
# Optional. If set, should be a colon-separated string of brand:model to be
|
||||||
|
# used for the image's model assertion
|
||||||
|
local CUSTOM_BRAND_MODEL=${2:-generic:generic-classic}
|
||||||
|
|
||||||
|
local seed_dir="$CHROOT_ROOT/var/lib/snapd/seed"
|
||||||
|
local snaps_dir="$seed_dir/snaps"
|
||||||
|
|
||||||
|
snap_prepare_assertions "$CHROOT_ROOT" "$CUSTOM_BRAND_MODEL"
|
||||||
|
|
||||||
# Download the core snap
|
# Download the core snap
|
||||||
if ! [ -f $snaps_dir/core_[0-9]*.snap ] ; then
|
if ! [ -f $snaps_dir/core_[0-9]*.snap ] ; then
|
||||||
|
@ -44,6 +44,10 @@ mount_overlay "$SQUASH_ROOT/" "$OVERLAY_RACK_ROOT/" "$RACK_ROOT/" "RACK"
|
|||||||
|
|
||||||
setup_mountpoint $RACK_ROOT
|
setup_mountpoint $RACK_ROOT
|
||||||
env DEBIAN_FRONTEND=noninteractive chroot $RACK_ROOT apt-get -y install maas-rack-controller
|
env DEBIAN_FRONTEND=noninteractive chroot $RACK_ROOT apt-get -y install maas-rack-controller
|
||||||
|
rm -f $RACK_ROOT/etc/maas/rackd.conf
|
||||||
|
chroot $RACK_ROOT sh -c 'echo RESET maas/default-maas-url | debconf-communicate maas-common'
|
||||||
|
chroot $RACK_ROOT sh -c 'echo RESET maas-rack-controller/maas-url | debconf-communicate maas-common'
|
||||||
|
chroot $RACK_ROOT sh -c 'echo RESET maas-rack-controller/maas-url | debconf-communicate maas-rack-controller'
|
||||||
teardown_mountpoint $RACK_ROOT
|
teardown_mountpoint $RACK_ROOT
|
||||||
|
|
||||||
umount "$RACK_ROOT"
|
umount "$RACK_ROOT"
|
||||||
@ -53,8 +57,23 @@ umount "$RACK_ROOT"
|
|||||||
mount_overlay "$OVERLAY_RACK_ROOT/:$SQUASH_ROOT/" "$OVERLAY_REGION_ROOT/" "$REGION_ROOT/" "REGION"
|
mount_overlay "$OVERLAY_RACK_ROOT/:$SQUASH_ROOT/" "$OVERLAY_REGION_ROOT/" "$REGION_ROOT/" "REGION"
|
||||||
|
|
||||||
setup_mountpoint $REGION_ROOT
|
setup_mountpoint $REGION_ROOT
|
||||||
|
|
||||||
env DEBIAN_FRONTEND=noninteractive chroot $REGION_ROOT apt-get -y install maas
|
env DEBIAN_FRONTEND=noninteractive chroot $REGION_ROOT apt-get -y install maas
|
||||||
chroot $REGION_ROOT pg_ctlcluster 10 main stop
|
|
||||||
|
# Forget how things had to be configured
|
||||||
|
chroot $REGION_ROOT debconf -fnoninteractive -omaas-region-controller /var/lib/dpkg/info/maas-region-controller.prerm remove
|
||||||
|
chroot $REGION_ROOT debconf -fnoninteractive -omaas-region-controller /var/lib/dpkg/info/maas-region-controller.postrm remove
|
||||||
|
chroot $REGION_ROOT debconf -fnoninteractive -omaas-region-controller /var/lib/dpkg/info/maas-region-controller.postrm purge
|
||||||
|
chroot $REGION_ROOT sh -c 'echo RESET maas/default-maas-url | debconf-communicate maas-common'
|
||||||
|
chroot $REGION_ROOT sudo -u postgres psql -c 'alter role maas password null;'
|
||||||
|
rm -f $REGION_ROOT/etc/maas/rackd.conf
|
||||||
|
rm -f $REGION_ROOT/etc/maas/regiond.conf
|
||||||
|
chroot $REGION_ROOT pg_ctlcluster $(/bin/ls $REGION_ROOT/var/lib/postgresql/) main stop || :
|
||||||
|
|
||||||
|
# After the install, one may call the below to "reconfigure" maas-region-controller
|
||||||
|
## debconf -fnoninteractive -omaas-region-controller /var/lib/dpkg/info/maas-region-controller.config configure
|
||||||
|
## debconf -fnoninteractive -omaas-region-controller /var/lib/dpkg/info/maas-region-controller.postinst configure
|
||||||
|
|
||||||
teardown_mountpoint "$REGION_ROOT"
|
teardown_mountpoint "$REGION_ROOT"
|
||||||
|
|
||||||
umount "$REGION_ROOT"
|
umount "$REGION_ROOT"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user