mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-06-01 13:13:39 +00:00
snap: Alternate fix for snap pre-seeding (LP: #1775710)
* Backport: Refactor functions out of ubuntu-cpc and ubuntu-server hooks. * Backport: Add dependency on distro-info for snap preseeding
This commit is contained in:
parent
c7878bdc76
commit
8e53c77a11
4
debian/changelog
vendored
4
debian/changelog
vendored
@ -1,8 +1,8 @@
|
|||||||
livecd-rootfs (2.408.32) xenial; urgency=medium
|
livecd-rootfs (2.408.32) xenial; urgency=medium
|
||||||
|
|
||||||
* snaps: Fixes for snap pre-seeding (LP: #1775710)
|
* snaps: Fixes for snap pre-seeding (LP: #1775710)
|
||||||
* Add dependency on distro-info for snap preseeding
|
* Backport: Refactor functions out of ubuntu-cpc and ubuntu-server hooks.
|
||||||
* Move snap-related functions to avoid conflicts with ubuntu-cpc functions
|
* Add dependency on distro-info for snap preseeding
|
||||||
|
|
||||||
-- Robert C Jennings <robert.jennings@canonical.com> Thu, 07 Jun 2018 14:12:26 -0700
|
-- Robert C Jennings <robert.jennings@canonical.com> Thu, 07 Jun 2018 14:12:26 -0700
|
||||||
|
|
||||||
|
@ -33,8 +33,10 @@ if [ -z "$MIRROR" ]; then
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
mkdir -p config
|
||||||
|
cp -af /usr/share/livecd-rootfs/live-build/functions config/functions
|
||||||
|
|
||||||
mkdir -p config/package-lists
|
mkdir -p config/package-lists
|
||||||
cp -af /usr/share/livecd-rootfs/live-build/functions.snaps config/functions.snaps
|
|
||||||
|
|
||||||
add_task ()
|
add_task ()
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
# vi: ts=4 expandtab syntax=sh
|
# vi: ts=4 expandtab syntax=sh
|
||||||
|
|
||||||
CLOUD_IMG_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process"
|
#imagesize=${IMAGE_SIZE:-$((2252*1024**2))} # 2.2G (the current size we ship)
|
||||||
IMAGE_SIZE=$((2252*1024**2)) # 2.2G (the current size we ship)
|
imagesize=${IMAGE_SIZE:-2361393152} # 2.2G (the current size we ship)
|
||||||
|
fs_label="${FS_LABEL:-rootfs}"
|
||||||
|
|
||||||
rootfs_dev_mapper=
|
rootfs_dev_mapper=
|
||||||
loop_device=
|
loop_device=
|
||||||
@ -39,13 +40,13 @@ clean_loops() {
|
|||||||
|
|
||||||
create_empty_disk_image() {
|
create_empty_disk_image() {
|
||||||
# Prepare an empty disk image
|
# Prepare an empty disk image
|
||||||
dd if=/dev/zero of="$1" bs=1 count=0 seek="${IMAGE_SIZE}"
|
dd if=/dev/zero of="$1" bs=1 count=0 seek="${imagesize}"
|
||||||
}
|
}
|
||||||
|
|
||||||
make_ext4_partition() {
|
make_ext4_partition() {
|
||||||
device="$1"
|
device="$1"
|
||||||
|
label=${fs_label:+-L "${fs_label}"}
|
||||||
mkfs.ext4 -F -b 4096 -i 8192 -m 0 -L cloudimg-rootfs -E resize=536870912 "$device"
|
mkfs.ext4 -F -b 4096 -i 8192 -m 0 ${label} -E resize=536870912 "$device"
|
||||||
}
|
}
|
||||||
|
|
||||||
mount_image() {
|
mount_image() {
|
||||||
@ -56,7 +57,7 @@ mount_image() {
|
|||||||
|
|
||||||
# Find the loop device
|
# Find the loop device
|
||||||
loop_p1="$(echo -e ${kpartx_mapping} | head -n1 | awk '{print$3}')"
|
loop_p1="$(echo -e ${kpartx_mapping} | head -n1 | awk '{print$3}')"
|
||||||
loop_device="/dev/loop$(echo ${loop_p1} | cut -b5)"
|
loop_device="/dev/${loop_p1%p[0-9]*}"
|
||||||
if [ ! -b ${loop_device} ]; then
|
if [ ! -b ${loop_device} ]; then
|
||||||
echo "unable to find loop device for ${backing_img}"
|
echo "unable to find loop device for ${backing_img}"
|
||||||
exit 1
|
exit 1
|
||||||
@ -129,7 +130,7 @@ mount_disk_image() {
|
|||||||
# such as updating grub and installing software
|
# such as updating grub and installing software
|
||||||
cat > $mountpoint/usr/sbin/policy-rc.d << EOF
|
cat > $mountpoint/usr/sbin/policy-rc.d << EOF
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# ${CLOUD_IMG_STR}
|
# ${IMAGE_STR}
|
||||||
echo "All runlevel operations denied by policy" >&2
|
echo "All runlevel operations denied by policy" >&2
|
||||||
exit 101
|
exit 101
|
||||||
EOF
|
EOF
|
||||||
@ -264,7 +265,7 @@ convert_to_qcow2() {
|
|||||||
|
|
||||||
replace_grub_root_with_label() {
|
replace_grub_root_with_label() {
|
||||||
# When update-grub is run, it will detect the disks in the build system.
|
# When update-grub is run, it will detect the disks in the build system.
|
||||||
# Instead, we want grub to use the cloudimg-rootfs labelled disk
|
# Instead, we want grub to use the right labelled disk
|
||||||
CHROOT_ROOT="$1"
|
CHROOT_ROOT="$1"
|
||||||
|
|
||||||
# If boot by partuuid has been requested, don't override.
|
# If boot by partuuid has been requested, don't override.
|
||||||
@ -273,7 +274,7 @@ replace_grub_root_with_label() {
|
|||||||
then
|
then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
sed -i -e "s,root=[^ ]*,root=LABEL=cloudimg-rootfs," \
|
sed -i -e "s,root=[^ ]*,root=LABEL=${fs_label}," \
|
||||||
"$CHROOT_ROOT/boot/grub/grub.cfg"
|
"$CHROOT_ROOT/boot/grub/grub.cfg"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -318,3 +319,125 @@ undivert_grub() {
|
|||||||
chroot "$CHROOT_ROOT" dpkg-divert --remove --local \
|
chroot "$CHROOT_ROOT" dpkg-divert --remove --local \
|
||||||
--rename /usr/bin/systemd-detect-virt
|
--rename /usr/bin/systemd-detect-virt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
release_ver() {
|
||||||
|
# Return the release version number
|
||||||
|
distro-info --series="$LB_DISTRIBUTION" -r | awk '{ print $1 }'
|
||||||
|
}
|
||||||
|
|
||||||
|
_snap_preseed() {
|
||||||
|
# Download the snap/assertion and add to the preseed
|
||||||
|
local CHROOT_ROOT=$1
|
||||||
|
local SNAP=$2
|
||||||
|
local SNAP_NAME=${SNAP%/*}
|
||||||
|
local CHANNEL=${3:?Snap channel must be specified}
|
||||||
|
|
||||||
|
local seed_dir="$CHROOT_ROOT/var/lib/snapd/seed"
|
||||||
|
local snaps_dir="$seed_dir/snaps"
|
||||||
|
local seed_yaml="$seed_dir/seed.yaml"
|
||||||
|
local assertions_dir="$seed_dir/assertions"
|
||||||
|
|
||||||
|
# Download the snap & assertion
|
||||||
|
local snap_download_failed=0
|
||||||
|
chroot $CHROOT_ROOT sh -c "
|
||||||
|
set -x;
|
||||||
|
cd /var/lib/snapd/seed;
|
||||||
|
SNAPPY_STORE_NO_CDN=1 snap download \
|
||||||
|
--channel=$CHANNEL \"$SNAP_NAME\"" || snap_download_failed=1
|
||||||
|
if [ $snap_download_failed = 1 ] ; then
|
||||||
|
echo "If the channel ($CHANNEL) includes '*/ubuntu-##.##' track per "
|
||||||
|
echo "Ubuntu policy (ex. stable/ubuntu-18.04) the publisher will need "
|
||||||
|
echo "to temporarily create the channel/track to allow fallback during"
|
||||||
|
echo "download (ex. stable/ubuntu-18.04 falls back to stable if the"
|
||||||
|
echo "prior had been created in the past)."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
mv -v $seed_dir/*.assert $assertions_dir
|
||||||
|
mv -v $seed_dir/*.snap $snaps_dir
|
||||||
|
|
||||||
|
# Add the snap to the seed.yaml
|
||||||
|
! [ -e $seed_yaml ] && echo "snaps:" > $seed_yaml
|
||||||
|
cat <<EOF >> $seed_yaml
|
||||||
|
-
|
||||||
|
name: ${SNAP_NAME}
|
||||||
|
channel: ${CHANNEL}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
case ${SNAP} in */classic) echo " classic: true" >> $seed_yaml;; esac
|
||||||
|
|
||||||
|
echo -n " file: " >> $seed_yaml
|
||||||
|
(cd $snaps_dir; ls -1 ${SNAP_NAME}_*.snap) >> $seed_yaml
|
||||||
|
}
|
||||||
|
|
||||||
|
snap_prepare_assertions() {
|
||||||
|
# Configure basic snapd assertions
|
||||||
|
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 snaps_dir="$seed_dir/snaps"
|
||||||
|
local assertions_dir="$seed_dir/assertions"
|
||||||
|
local model_assertion="$assertions_dir/model"
|
||||||
|
local account_key_assertion="$assertions_dir/account-key"
|
||||||
|
local account_assertion="$assertions_dir/account"
|
||||||
|
|
||||||
|
mkdir -p "$assertions_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
|
||||||
|
snap known --remote model series=16 \
|
||||||
|
model=$model brand-id=$brand \
|
||||||
|
> "$model_assertion"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! [ -e "$account_key_assertion" ] ; then
|
||||||
|
local 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"
|
||||||
|
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 \
|
||||||
|
> "$account_assertion"
|
||||||
|
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
|
||||||
|
if ! [ -f $snaps_dir/core_[0-9]*.snap ] ; then
|
||||||
|
_snap_preseed $CHROOT_ROOT core stable
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
snap_preseed() {
|
||||||
|
# Preseed a snap in the image
|
||||||
|
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
|
||||||
|
_snap_preseed $CHROOT_ROOT $SNAP $CHANNEL
|
||||||
|
}
|
@ -1,126 +0,0 @@
|
|||||||
# vi: ts=4 expandtab syntax=sh
|
|
||||||
|
|
||||||
#imagesize=${IMAGE_SIZE:-$((2252*1024**2))} # 2.2G (the current size we ship)
|
|
||||||
imagesize=${IMAGE_SIZE:-2361393152} # 2.2G (the current size we ship)
|
|
||||||
|
|
||||||
release_ver() {
|
|
||||||
# Return the release version number
|
|
||||||
distro-info --series="$LB_DISTRIBUTION" -r | awk '{ print $1 }'
|
|
||||||
}
|
|
||||||
|
|
||||||
_snap_preseed() {
|
|
||||||
# Download the snap/assertion and add to the preseed
|
|
||||||
local CHROOT_ROOT=$1
|
|
||||||
local SNAP=$2
|
|
||||||
local SNAP_NAME=${SNAP%/*}
|
|
||||||
local CHANNEL=${3:?Snap channel must be specified}
|
|
||||||
|
|
||||||
local seed_dir="$CHROOT_ROOT/var/lib/snapd/seed"
|
|
||||||
local snaps_dir="$seed_dir/snaps"
|
|
||||||
local seed_yaml="$seed_dir/seed.yaml"
|
|
||||||
local assertions_dir="$seed_dir/assertions"
|
|
||||||
|
|
||||||
# Download the snap & assertion
|
|
||||||
local snap_download_failed=0
|
|
||||||
chroot $CHROOT_ROOT sh -c "
|
|
||||||
set -x;
|
|
||||||
cd /var/lib/snapd/seed;
|
|
||||||
SNAPPY_STORE_NO_CDN=1 snap download \
|
|
||||||
--channel=$CHANNEL \"$SNAP_NAME\"" || snap_download_failed=1
|
|
||||||
if [ $snap_download_failed = 1 ] ; then
|
|
||||||
echo "If the channel ($CHANNEL) includes '*/ubuntu-##.##' track per "
|
|
||||||
echo "Ubuntu policy (ex. stable/ubuntu-18.04) the publisher will need "
|
|
||||||
echo "to temporarily create the channel/track to allow fallback during"
|
|
||||||
echo "download (ex. stable/ubuntu-18.04 falls back to stable if the"
|
|
||||||
echo "prior had been created in the past)."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
mv -v $seed_dir/*.assert $assertions_dir
|
|
||||||
mv -v $seed_dir/*.snap $snaps_dir
|
|
||||||
|
|
||||||
# Add the snap to the seed.yaml
|
|
||||||
! [ -e $seed_yaml ] && echo "snaps:" > $seed_yaml
|
|
||||||
cat <<EOF >> $seed_yaml
|
|
||||||
-
|
|
||||||
name: ${SNAP_NAME}
|
|
||||||
channel: ${CHANNEL}
|
|
||||||
EOF
|
|
||||||
|
|
||||||
case ${SNAP} in */classic) echo " classic: true" >> $seed_yaml;; esac
|
|
||||||
|
|
||||||
echo -n " file: " >> $seed_yaml
|
|
||||||
(cd $snaps_dir; ls -1 ${SNAP_NAME}_*.snap) >> $seed_yaml
|
|
||||||
}
|
|
||||||
|
|
||||||
snap_prepare_assertions() {
|
|
||||||
# Configure basic snapd assertions
|
|
||||||
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 snaps_dir="$seed_dir/snaps"
|
|
||||||
local assertions_dir="$seed_dir/assertions"
|
|
||||||
local model_assertion="$assertions_dir/model"
|
|
||||||
local account_key_assertion="$assertions_dir/account-key"
|
|
||||||
local account_assertion="$assertions_dir/account"
|
|
||||||
|
|
||||||
mkdir -p "$assertions_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
|
|
||||||
snap known --remote model series=16 \
|
|
||||||
model=$model brand-id=$brand \
|
|
||||||
> "$model_assertion"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! [ -e "$account_key_assertion" ] ; then
|
|
||||||
local 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"
|
|
||||||
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 \
|
|
||||||
> "$account_assertion"
|
|
||||||
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
|
|
||||||
if ! [ -f $snaps_dir/core_[0-9]*.snap ] ; then
|
|
||||||
_snap_preseed $CHROOT_ROOT core stable
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
snap_preseed() {
|
|
||||||
# Preseed a snap in the image
|
|
||||||
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
|
|
||||||
_snap_preseed $CHROOT_ROOT $SNAP $CHANNEL
|
|
||||||
}
|
|
@ -1,9 +1,12 @@
|
|||||||
#!/bin/bash -ex
|
#!/bin/bash -ex
|
||||||
|
|
||||||
. config/functions
|
IMAGE_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process"
|
||||||
|
FS_LABEL="cloudimg-rootfs"
|
||||||
|
|
||||||
. config/binary
|
. config/binary
|
||||||
|
|
||||||
|
. config/functions
|
||||||
|
|
||||||
BOOTPART_START=
|
BOOTPART_START=
|
||||||
BOOTPART_END=
|
BOOTPART_END=
|
||||||
BOOT_MOUNTPOINT=
|
BOOT_MOUNTPOINT=
|
||||||
|
@ -9,6 +9,11 @@ case $ARCH in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
IMAGE_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process"
|
||||||
|
FS_LABEL="cloudimg-rootfs"
|
||||||
|
|
||||||
|
. config/binary
|
||||||
|
|
||||||
. config/functions
|
. config/functions
|
||||||
|
|
||||||
create_partitions() {
|
create_partitions() {
|
||||||
@ -88,7 +93,7 @@ install_grub() {
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
cat << EOF >> mountpoint/etc/default/grub.d/50-cloudimg-settings.cfg
|
cat << EOF >> mountpoint/etc/default/grub.d/50-cloudimg-settings.cfg
|
||||||
${CLOUD_IMG_STR}
|
${IMAGE_STR}
|
||||||
# For Cloud Image compatability
|
# For Cloud Image compatability
|
||||||
GRUB_PRELOAD_MODULES="${GRUB_PRELOAD_MODULES:-$grub_modules}"
|
GRUB_PRELOAD_MODULES="${GRUB_PRELOAD_MODULES:-$grub_modules}"
|
||||||
EOF
|
EOF
|
||||||
@ -104,7 +109,7 @@ EOF
|
|||||||
|
|
||||||
if [ -f mountpoint/boot/efi/EFI/BOOT/grub.cfg ]; then
|
if [ -f mountpoint/boot/efi/EFI/BOOT/grub.cfg ]; then
|
||||||
sed -i "s| root| root hd0,gpt1|" mountpoint/boot/efi/EFI/BOOT/grub.cfg
|
sed -i "s| root| root hd0,gpt1|" mountpoint/boot/efi/EFI/BOOT/grub.cfg
|
||||||
sed -i "1i${CLOUD_IMG_STR}" mountpoint/boot/efi/EFI/BOOT/grub.cfg
|
sed -i "1i${IMAGE_STR}" mountpoint/boot/efi/EFI/BOOT/grub.cfg
|
||||||
# For some reason the grub disk is looking for /boot/grub/grub.cfg on
|
# For some reason the grub disk is looking for /boot/grub/grub.cfg on
|
||||||
# part 15....
|
# part 15....
|
||||||
chroot mountpoint mkdir -p /boot/efi/boot/grub
|
chroot mountpoint mkdir -p /boot/efi/boot/grub
|
||||||
|
@ -7,6 +7,11 @@ case $ARCH in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
IMAGE_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process"
|
||||||
|
FS_LABEL="cloudimg-rootfs"
|
||||||
|
|
||||||
|
. config/binary
|
||||||
|
|
||||||
. config/functions
|
. config/functions
|
||||||
|
|
||||||
create_partitions() {
|
create_partitions() {
|
||||||
@ -32,7 +37,7 @@ install_grub() {
|
|||||||
# set the kernel commandline to use hvc0
|
# set the kernel commandline to use hvc0
|
||||||
mkdir -p mountpoint/etc/default/grub.d
|
mkdir -p mountpoint/etc/default/grub.d
|
||||||
cat << EOF > mountpoint/etc/default/grub.d/50-cloudimg-settings.cfg
|
cat << EOF > mountpoint/etc/default/grub.d/50-cloudimg-settings.cfg
|
||||||
${CLOUD_IMG_STR}
|
${IMAGE_STR}
|
||||||
|
|
||||||
# Set the recordfail timeout
|
# Set the recordfail timeout
|
||||||
GRUB_RECORDFAIL_TIMEOUT=0
|
GRUB_RECORDFAIL_TIMEOUT=0
|
||||||
|
@ -44,6 +44,8 @@ case $ARCH in
|
|||||||
exit 0;;
|
exit 0;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
IMAGE_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process"
|
||||||
|
|
||||||
. config/functions
|
. config/functions
|
||||||
|
|
||||||
# Lets be safe about this
|
# Lets be safe about this
|
||||||
|
@ -47,7 +47,7 @@ respawn
|
|||||||
script
|
script
|
||||||
exec /sbin/getty -L CONDEV 115200 vt102
|
exec /sbin/getty -L CONDEV 115200 vt102
|
||||||
end script
|
end script
|
||||||
${CLOUD_IMG_STR}
|
${IMAGE_STR}
|
||||||
EOF
|
EOF
|
||||||
sed -i "s/CONDEV/${condev}/g" "$idir/${condev}.conf"
|
sed -i "s/CONDEV/${condev}/g" "$idir/${condev}.conf"
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,10 @@ if [ ! -d ${my_dir}/extra ]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
export IMAGE_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process"
|
||||||
|
export CLOUD_IMG_STR="$IMAGE_STR"
|
||||||
|
export FS_LABEL="cloudimg-rootfs"
|
||||||
|
|
||||||
# Export the common functions to the extras
|
# Export the common functions to the extras
|
||||||
. config/functions
|
. config/functions
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user