parent
738ff116a5
commit
d5a6f5cbe3
@ -0,0 +1,271 @@
|
|||||||
|
# vi: ts=4 expandtab syntax=sh
|
||||||
|
|
||||||
|
CLOUD_IMG_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process"
|
||||||
|
IMAGE_SIZE=$((2252*1024**2)) # 2.2G (the current size we ship)
|
||||||
|
|
||||||
|
rootfs_dev_mapper=
|
||||||
|
loop_device=
|
||||||
|
loop_raw=
|
||||||
|
backing_img=
|
||||||
|
|
||||||
|
apt-get -qqy install dosfstools gdisk
|
||||||
|
|
||||||
|
clean_loops() {
|
||||||
|
|
||||||
|
if [ -n "${backing_img}" ]; then
|
||||||
|
kpartx -v -d "${backing_img}"
|
||||||
|
unset backing_img
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "${rootfs_dev_mapper}" ]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
unset loop_device
|
||||||
|
unset loop_raw
|
||||||
|
unset rootfs_dev_mapper
|
||||||
|
}
|
||||||
|
|
||||||
|
create_empty_disk_image() {
|
||||||
|
# Prepare an empty disk image
|
||||||
|
dd if=/dev/zero of="$1" bs=1 count=0 seek="${IMAGE_SIZE}"
|
||||||
|
}
|
||||||
|
|
||||||
|
make_ext4_partition() {
|
||||||
|
device="$1"
|
||||||
|
|
||||||
|
mkfs.ext4 -F -b 4096 -i 8192 -m 0 -L cloudimg-rootfs -E resize=536870912 "$device"
|
||||||
|
}
|
||||||
|
|
||||||
|
mount_image() {
|
||||||
|
apt-get install -qqy kpartx
|
||||||
|
trap clean_loops EXIT
|
||||||
|
backing_img="$1"
|
||||||
|
local rootpart="$2"
|
||||||
|
kpartx_mapping="$(kpartx -s -v -a ${backing_img})"
|
||||||
|
|
||||||
|
# Find the loop device
|
||||||
|
loop_p1="$(echo -e ${kpartx_mapping} | head -n1 | awk '{print$3}')"
|
||||||
|
loop_device="/dev/loop$(echo ${loop_p1} | cut -b5)"
|
||||||
|
if [ ! -b ${loop_device} ]; then
|
||||||
|
echo "unable to find loop device for ${backing_img}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Find the rootfs location
|
||||||
|
rootfs_dev_mapper="/dev/mapper/${loop_p1%%[0-9]}${rootpart}"
|
||||||
|
if [ ! -b "${rootfs_dev_mapper}" ]; then
|
||||||
|
echo "${rootfs_dev_mapper} is not a block device";
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Add some information to the debug logs
|
||||||
|
echo "Mounted disk image ${backing_img} to ${rootfs_dev_mapper}"
|
||||||
|
blkid ${rootfs_dev_mapper}
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
setup_mountpoint() {
|
||||||
|
local mountpoint="$1"
|
||||||
|
|
||||||
|
mount --bind /dev "$mountpoint/dev"
|
||||||
|
mount devpts-live -t proc "$mountpoint/dev/pts"
|
||||||
|
mount proc-live -t proc "$mountpoint/proc"
|
||||||
|
mount sysfs-live -t sysfs "$mountpoint/sys"
|
||||||
|
mount -t tmpfs none "$mountpoint/tmp"
|
||||||
|
mv "$mountpoint/etc/resolv.conf" resolv.conf.tmp
|
||||||
|
cp /etc/resolv.conf "$mountpoint/etc/resolv.conf"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
mount_partition() {
|
||||||
|
partition="$1"
|
||||||
|
mountpoint="$2"
|
||||||
|
|
||||||
|
mount "$partition" "$mountpoint"
|
||||||
|
setup_mountpoint "$mountpoint"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
mount_overlay() {
|
||||||
|
lower="$1"
|
||||||
|
upper="$2"
|
||||||
|
work="$2/../work"
|
||||||
|
path="$3"
|
||||||
|
|
||||||
|
mkdir -p "$work"
|
||||||
|
mount -t overlay overlay \
|
||||||
|
-olowerdir="$lower",upperdir="$upper",workdir="$work" \
|
||||||
|
"$path"
|
||||||
|
}
|
||||||
|
|
||||||
|
mount_disk_image() {
|
||||||
|
local disk_image=${1}
|
||||||
|
local mountpoint=${2}
|
||||||
|
mount_image ${disk_image} 1
|
||||||
|
mount_partition "${rootfs_dev_mapper}" $mountpoint
|
||||||
|
|
||||||
|
local uefi_dev="/dev/mapper${loop_device///dev/}p15"
|
||||||
|
if [ -b ${uefi_dev} -a -e $mountpoint/boot/efi ]; then
|
||||||
|
mount "${uefi_dev}" $mountpoint/boot/efi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# This is needed to allow for certain operations
|
||||||
|
# such as updating grub and installing software
|
||||||
|
cat > $mountpoint/usr/sbin/policy-rc.d << EOF
|
||||||
|
#!/bin/sh
|
||||||
|
# ${CLOUD_IMG_STR}
|
||||||
|
echo "All runlevel operations denied by policy" >&2
|
||||||
|
exit 101
|
||||||
|
EOF
|
||||||
|
chmod 0755 $mountpoint/usr/sbin/policy-rc.d
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
umount_settle() {
|
||||||
|
# Unmount device, and let it settle
|
||||||
|
umount $1
|
||||||
|
udevadm settle
|
||||||
|
}
|
||||||
|
|
||||||
|
umount_partition() {
|
||||||
|
local mountpoint=${1}
|
||||||
|
mv resolv.conf.tmp "$mountpoint/etc/resolv.conf"
|
||||||
|
for submnt in proc sys dev/pts dev tmp;
|
||||||
|
do
|
||||||
|
umount $mountpoint/$submnt
|
||||||
|
done
|
||||||
|
umount $mountpoint
|
||||||
|
udevadm settle
|
||||||
|
|
||||||
|
if [ -n "${rootfs_dev_mapper}" -a -b "${rootfs_dev_mapper}" ]; then
|
||||||
|
# buildd's don't have /etc/mtab symlinked
|
||||||
|
# /etc/mtab is needed in order zerofree space for ext4 filesystems
|
||||||
|
[ -e /etc/mtab ] || ln -s /proc/mounts /etc/mtab
|
||||||
|
|
||||||
|
# both of these are likely overkill, but it does result in slightly
|
||||||
|
# smaller ext4 filesystem
|
||||||
|
apt-get -qqy install zerofree
|
||||||
|
e2fsck -y -E discard ${rootfs_dev_mapper}
|
||||||
|
zerofree ${rootfs_dev_mapper}
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
umount_disk_image() {
|
||||||
|
mountpoint="$1"
|
||||||
|
|
||||||
|
local uefi_dev="/dev/mapper${loop_device///dev/}p15"
|
||||||
|
if [ -e "$mountpoint/boot/efi" -a -b "$uefi_dev" ]; then
|
||||||
|
umount --detach-loop "$mountpoint/boot/efi"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -e $mountpoint/usr/sbin/policy-rc.d ]; then
|
||||||
|
rm $mountpoint/usr/sbin/policy-rc.d
|
||||||
|
fi
|
||||||
|
umount_partition $mountpoint
|
||||||
|
clean_loops
|
||||||
|
}
|
||||||
|
|
||||||
|
modify_vmdk_header() {
|
||||||
|
# Modify the VMDK headers so that both VirtualBox _and_ VMware can
|
||||||
|
# read the vmdk and import them. The vodoo here is _not_ documented
|
||||||
|
# anywhere....so this will have to do. This is undocumented vodoo
|
||||||
|
# that has been learned by the Cloud Image team.
|
||||||
|
|
||||||
|
vmdk_name="${1}"
|
||||||
|
descriptor=$(mktemp)
|
||||||
|
newdescriptor=$(mktemp)
|
||||||
|
|
||||||
|
# Extract the vmdk header for manipulation
|
||||||
|
dd if="${vmdk_name}" of="${descriptor}" bs=1 skip=512 count=1024
|
||||||
|
|
||||||
|
# The sed lines below is where the magic is. Specifically:
|
||||||
|
# ddb.toolsVersion: sets the open-vm-tools so that VMware shows
|
||||||
|
# the tooling as current
|
||||||
|
# ddb.virtualHWVersion: set the version to 7, which covers most
|
||||||
|
# current versions of VMware
|
||||||
|
# createType: make sure its set to stream Optimized
|
||||||
|
# remove the vmdk-stream-converter comment and replace with
|
||||||
|
# # Disk DescriptorFile. This is needed for Virtualbox
|
||||||
|
# remove the comments from vmdk-stream-converter which causes
|
||||||
|
# VirtualBox and others to fail VMDK validation
|
||||||
|
|
||||||
|
sed -e 's|# Description file.*|# Disk DescriptorFile|' \
|
||||||
|
-e '/# Believe this is random*/d' \
|
||||||
|
-e '/# Indicates no parent/d' \
|
||||||
|
-e '/# The Disk Data Base/d' \
|
||||||
|
-e 's|ddb.comment.*|ddb.toolsVersion = "2147483647"|' \
|
||||||
|
"${descriptor}" > "${newdescriptor}"
|
||||||
|
|
||||||
|
# The header is cannot be bigger than 1024
|
||||||
|
expr $(stat --format=%s ${newdescriptor}) \< 1024 > /dev/null 2>&1 || {
|
||||||
|
echo "descriptor is too large, VMDK will be invalid!"; exit 1; }
|
||||||
|
|
||||||
|
# Overwrite the vmdk header with our new, modified one
|
||||||
|
dd conv=notrunc,nocreat \
|
||||||
|
if="${newdescriptor}" of="${vmdk_name}" \
|
||||||
|
bs=1 seek=512 count=1024
|
||||||
|
|
||||||
|
rm ${descriptor} ${newdescriptor}
|
||||||
|
}
|
||||||
|
|
||||||
|
create_vmdk() {
|
||||||
|
# There is no real good way to create a _compressed_ VMDK using open source
|
||||||
|
# tooling that works across multiple VMDK-capable platforms. This functions
|
||||||
|
# uses vmdk-stream-converter and then calls modify_vmdk_header to produce a
|
||||||
|
# compatible VMDK.
|
||||||
|
|
||||||
|
src="$1"
|
||||||
|
destination="$2"
|
||||||
|
size="${3:-10240}"
|
||||||
|
|
||||||
|
apt-get install -qqy qemu-utils vmdk-stream-converter
|
||||||
|
streamconverter="/usr/share/pyshared/VMDKstream.py"
|
||||||
|
scratch_d=$(mktemp -d)
|
||||||
|
cp ${src} ${scratch_d}/resize.img
|
||||||
|
|
||||||
|
truncate --size=${size}M ${scratch_d}/resize.img
|
||||||
|
python ${streamconverter} ${scratch_d}/resize.img ${destination}
|
||||||
|
modify_vmdk_header ${destination}
|
||||||
|
|
||||||
|
qemu-img info ${destination}
|
||||||
|
rm -rf ${scratch_d}
|
||||||
|
}
|
||||||
|
|
||||||
|
create_derivative() {
|
||||||
|
# arg1 is the disk type
|
||||||
|
# arg2 is the new name
|
||||||
|
unset derivative_img
|
||||||
|
case ${1} in
|
||||||
|
uefi) disk_image="binary/boot/disk-uefi.ext4";
|
||||||
|
dname="${disk_image//-uefi/-$2-uefi}";;
|
||||||
|
*) disk_image="binary/boot/disk.ext4";
|
||||||
|
dname="${disk_image//.ext4/-$2.ext4}";;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ ! -e ${disk_image} ]; then
|
||||||
|
echo "Did not find ${disk_image}!"; exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
cp ${disk_image} ${dname}
|
||||||
|
export derivative_img=${dname}
|
||||||
|
}
|
||||||
|
|
||||||
|
convert_to_qcow2() {
|
||||||
|
apt-get install -qqy qemu-utils
|
||||||
|
|
||||||
|
src="$1"
|
||||||
|
destination="$2"
|
||||||
|
qemu-img convert -c -O qcow2 -o compat=0.10 "$src" "$destination"
|
||||||
|
qemu-img info "$destination"
|
||||||
|
}
|
||||||
|
|
||||||
|
replace_grub_root_with_label() {
|
||||||
|
# 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
|
||||||
|
CHROOT_ROOT="$1"
|
||||||
|
|
||||||
|
sed -i -e "s,root=[^ ]\+,root=LABEL=cloudimg-rootfs," \
|
||||||
|
"$CHROOT_ROOT/boot/grub/grub.cfg"
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh -x
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
mkdir -p /lib/modules
|
@ -0,0 +1,37 @@
|
|||||||
|
#!/bin/bash -ex
|
||||||
|
# vi: ts=4 noexpandtab
|
||||||
|
#
|
||||||
|
# Generate a squashfs root and manifest
|
||||||
|
|
||||||
|
set -x
|
||||||
|
echo "030-root-squashfs.binary"
|
||||||
|
|
||||||
|
case $IMAGE_TARGETS in
|
||||||
|
""|*squashfs*)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Skipping squashfs build"
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -n "$SUBARCH" ]; then
|
||||||
|
echo "Skipping rootfs build for subarch flavor build"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
. /build/config/functions
|
||||||
|
|
||||||
|
mkdir binary/boot/squashfs.dir
|
||||||
|
cp -a chroot/* binary/boot/squashfs.dir
|
||||||
|
|
||||||
|
apt-get -qqy install squashfs-tools
|
||||||
|
|
||||||
|
squashfs_f="${PWD}/livecd.ubuntu-server-next.squashfs"
|
||||||
|
squashfs_f_manifest="${squashfs_f}.manifest"
|
||||||
|
|
||||||
|
dpkg-query --admindir=binary/boot/squashfs.dir/var/lib/dpkg -W > ${squashfs_f_manifest}
|
||||||
|
|
||||||
|
(cd "binary/boot/squashfs.dir/" &&
|
||||||
|
mksquashfs . ${squashfs_f} \
|
||||||
|
-no-progress -xattrs -comp xz )
|
@ -0,0 +1,164 @@
|
|||||||
|
#!/bin/bash -ex
|
||||||
|
# vi: ts=4 noexpandtab
|
||||||
|
#
|
||||||
|
# Generate a squashfs root and manifest
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
echo "032-installer-squashfs.binary"
|
||||||
|
|
||||||
|
case $IMAGE_TARGETS in
|
||||||
|
""|*squashfs*)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Skipping squashfs build"
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -n "$SUBARCH" ]; then
|
||||||
|
echo "Skipping rootfs build for subarch flavor build"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
. /build/config/functions
|
||||||
|
|
||||||
|
SQUASH_ROOT=binary/boot/squashfs.dir
|
||||||
|
OVERLAY_ROOT=binary/boot/overlay.dir
|
||||||
|
|
||||||
|
mkdir "$OVERLAY_ROOT"
|
||||||
|
|
||||||
|
setup_mountpoint binary/boot/squashfs.dir
|
||||||
|
|
||||||
|
# Create an installer squashfs layer
|
||||||
|
mount_overlay "$SQUASH_ROOT/" "$OVERLAY_ROOT/" "$SQUASH_ROOT/"
|
||||||
|
|
||||||
|
# Prepare installer layer.
|
||||||
|
|
||||||
|
# Install any requirements for the installer, for things we don't want
|
||||||
|
# to see on the installed system
|
||||||
|
chroot $SQUASH_ROOT apt-get update
|
||||||
|
chroot $SQUASH_ROOT apt-get -y install user-setup
|
||||||
|
|
||||||
|
# Do the snap seeding dance.
|
||||||
|
chroot $SQUASH_ROOT mkdir -p /var/lib/snapd/seed/snaps /var/lib/snapd/seed/assertions
|
||||||
|
chroot $SQUASH_ROOT sh -c '
|
||||||
|
set -x;
|
||||||
|
cd /var/lib/snapd/seed;
|
||||||
|
sudo SNAPPY_STORE_NO_CDN=1 snap download core;
|
||||||
|
sudo SNAPPY_STORE_NO_CDN=1 snap download --channel=edge subiquity;
|
||||||
|
|
||||||
|
CORE_SNAP=$(ls -1 core*.snap);
|
||||||
|
SUBIQUITY_SNAP=$(ls -1 subiquity*.snap);
|
||||||
|
|
||||||
|
mv *.assert /var/lib/snapd/seed/assertions/;
|
||||||
|
mv *.snap /var/lib/snapd/seed/snaps/;
|
||||||
|
|
||||||
|
cat <<EOF > /var/lib/snapd/seed/seed.yaml
|
||||||
|
snaps:
|
||||||
|
- name: core
|
||||||
|
channel: stable
|
||||||
|
file: ${CORE_SNAP}
|
||||||
|
- name: subiquity
|
||||||
|
channel: edge
|
||||||
|
classic: true
|
||||||
|
file: ${SUBIQUITY_SNAP}
|
||||||
|
EOF
|
||||||
|
'
|
||||||
|
|
||||||
|
cat <<EOF > $SQUASH_ROOT/var/lib/snapd/seed/assertions/cyphermox.account
|
||||||
|
type: account
|
||||||
|
authority-id: canonical
|
||||||
|
account-id: H0szZPjHTU4x04XeYjLyv8tJqYXq7cYk
|
||||||
|
display-name: Mathieu Trudel
|
||||||
|
timestamp: 2016-09-12T20:11:03.478544Z
|
||||||
|
username: cyphermox
|
||||||
|
validation: unproven
|
||||||
|
sign-key-sha3-384: BWDEoaqyr25nF5SNCvEv2v7QnM9QsfCc0PBMYD_i2NGSQ32EF2d4D0hqUel3m8ul
|
||||||
|
|
||||||
|
AcLBUgQAAQoABgUCV9cL1wAAbQIQAEa8X5Bf2achG/9gC2d9YHWE+Uk9/FXK58bZ4Ym5VDTPW2Es
|
||||||
|
BZOTMA6ROcCrii8/HM88+5bKGGoYLVNjfYUosYfR31kkFT1z1payhs4zfhANTBHXQpeNlGASm9ua
|
||||||
|
O1UkBNFJwYu+tRh9gsY5wuryjfxXndS2pzUm2fXlFB4I/FgQEZnKJP99C3H0cUkGHzEwadRc7vqu
|
||||||
|
/B+mmlwX/pgzlUwt3EXkCpx0hvN4ZgSzyKAtLn+ij2XSe4MxptT/uGCY2tnqsSa+H6J+O0RYENYD
|
||||||
|
Xa7MJLXSGS9iqOwBkTO5X1eHSNPUs0LqzAqz4zTL5Kd9c/ohFwPzZpO8ltLA2nhKEfHzofMsMjEi
|
||||||
|
qwhCDQ5LZD93dQ/VWzmmrCi9cmy+mci7K+hEYLtopzbkMl7cFBVVc2pQlTArspsFy9aMurCs4m8K
|
||||||
|
GfGJOmvYP4Rnn8YYVLtAIPbGADAzG4mxBDxc8r+NRCprDIJmVHed/aQo6gNNip6VHi7xORnAJYRI
|
||||||
|
0XQThASCRYzZxEBv3iND0GzAlRdlOLA+x+jRt2CDg0qLQ5DmuXGePEkEyJEMQb+OBsFHrPcvX1UI
|
||||||
|
eHoKL9ZyvcrhsuPmG92P2UYiGp7qeKYmPQFsWNNh/R18tgingyJbm75pAE8MrpyZ1TTyDEYhwzbm
|
||||||
|
F5zdm4dy0k1EGMhTTDz/hzlE0Ugw
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat <<EOF > $SQUASH_ROOT/var/lib/snapd/seed/assertions/cyphermox-sn-test.account-key
|
||||||
|
type: account-key
|
||||||
|
authority-id: canonical
|
||||||
|
public-key-sha3-384: vihTQiNMkgsi2g39sggy3k4EVGrkFyWMof_nIrCbhxSOO7U00PRD_TDeWrpqGNor
|
||||||
|
account-id: H0szZPjHTU4x04XeYjLyv8tJqYXq7cYk
|
||||||
|
name: cyphermox-sn-test
|
||||||
|
since: 2017-03-14T21:24:50Z
|
||||||
|
body-length: 717
|
||||||
|
sign-key-sha3-384: BWDEoaqyr25nF5SNCvEv2v7QnM9QsfCc0PBMYD_i2NGSQ32EF2d4D0hqUel3m8ul
|
||||||
|
|
||||||
|
AcbBTQRWhcGAARAAqJ9Xdy+csx9nQkipmldiKNsBKqwRh3HjwlnSrBm/YpI7Jbgs6zubD8Zj/hwr
|
||||||
|
bQiu4E2d6aobJcn3cgNdTlCEXES1M3sC6vSmkuz2fXdHRsYD6V3l5rlPjlyWPGNajcKvn1lEyOxC
|
||||||
|
j6efASJysX5lCDPfGy8Joe4OdeZxmPAwCJpuxpltlSMBlPjCHBgHMzv+C1zh9wkBuFh3wDIFP8ih
|
||||||
|
hnzGN/UevSHMfZCGh3y20TzDHeaeI35hiHkaibQuifqVNMTjnxReYKHV2eAP8/2XpEhfMAU6AD/Y
|
||||||
|
020ayr9REE/c6KTYq7Po7REzvUrWlG0KknBtHM7wCn9puo5HrM767K0H+ts6fsrvx5kRC5ZheVOf
|
||||||
|
Jh3EoXYQYCL1EGw0bzU03Lxx0RQ6teEc0WTDzky54vFr6UHjCAwethpzZ7MtZRdfwW4r/jUcxwXR
|
||||||
|
JXXKh03WK/ivhtr9KAROVkdUeMb/txp/8DvLW5zs7ohTaaC0qH5J+MMp0lm6ux0S8WyPmMOcb0SP
|
||||||
|
0IwOTvQc1ALDG3SiUgtJRP9Kt5jeuWIltH0cYE+QGPzey+fJ+iJx0QmeVnF2+O2JH2RihR5uJIBE
|
||||||
|
HzQlNMVZB/iyjgdCLamMUeqa6DAOpzR2haIRgaXKtK0G9Ho1ArEsXZsRiFYorhtxzrwGmkq7kGCw
|
||||||
|
tsY2pTeILZO1QPMAEQEAAQ==
|
||||||
|
|
||||||
|
AcLBUgQAAQoABgUCWMhfrAAAXn4QALo795LKWhSNlzI7KIz3hq6rFK1YVDbj3KXW8xoF1FEwyE51
|
||||||
|
4s1hZXc5N5h7DO49pj7JcXtE+Vi2gV+X294BqRevglBZgMwUtXdHX29IgPAx0jR9ARybS9A0QQYV
|
||||||
|
OaoKmnq+44p76D2gZz0blax18uROJCKfL6GCRw29/C/GJWpRnEEJlXC2DVD45vJeptSqLDcBL6z+
|
||||||
|
AypoV9NhJlmGm2jxPg5Jm+BdkyCZSbfNMw2sBcjJbs63KHgE9XsaP6Frb9gBexwXCx8/U6Y2jFTL
|
||||||
|
wmyHpXXjBY0et8ze2bcqcEsDeW30eFALki/+FfPzjTtxY/Xo/r2j78YMHVFOkWJYj3MZJ+LJ0UWC
|
||||||
|
eM4xzJm2ROwxFhFpIqlIRtR6WUPIxAx3Fb1j3uDTSBXDYv/hjxhSLZpw3/AN7Rj7pLWnwfD3076i
|
||||||
|
3R900ad3/tRQp8hlrn4H9zRxBwaCKhZ9h1kfmyHcVpf0Nk03Fe5tHTai0pdHpC6bPi798Iw6qt0r
|
||||||
|
D7VoKv29fa55zlGRTAG9mW0cbgkKUq1SBtLnBSy+peluVGjJWgZ3j1K9waTEoQPiNn6/JJvg2GjK
|
||||||
|
awZPm8R1ngBYQs/vGPhcfz8DGF3uwFzbSh/bLAKky22qrRypTtczDXw4H1LWPlUvB4cQfTY6Ad+w
|
||||||
|
KaHPaPmuIpn1DVEfPhNeByz57PDu
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat <<EOF > $SQUASH_ROOT/var/lib/snapd/seed/assertions/cyphermox-classic.model
|
||||||
|
type: model
|
||||||
|
authority-id: H0szZPjHTU4x04XeYjLyv8tJqYXq7cYk
|
||||||
|
series: 16
|
||||||
|
brand-id: H0szZPjHTU4x04XeYjLyv8tJqYXq7cYk
|
||||||
|
model: cyphermox-test-classic
|
||||||
|
classic: true
|
||||||
|
timestamp: 2017-03-15T14:32:45+00:00
|
||||||
|
sign-key-sha3-384: vihTQiNMkgsi2g39sggy3k4EVGrkFyWMof_nIrCbhxSOO7U00PRD_TDeWrpqGNor
|
||||||
|
|
||||||
|
AcLBXAQAAQoABgUCWMm5vAAKCRBdai1JSycAlUiAD/41bWorQOI343Ub/JVGFXN8aHXwZWh2iVzY
|
||||||
|
m42QbHZSuyyLBLiEqauiQLvuFa3Dtb3i6GC6hdtOlf/sPwZISriWrNuO5qPXik5SqP5zZop/qy4y
|
||||||
|
msWpG1S6M/aNqGVfUPIx0v7l9iTb4ZG9hyyxPwdE5lFj4nIqWlu6rIGPCGC+dfAS62PPkUGdXqzV
|
||||||
|
VOA6/D2FgthhxywaZZwSLwzP/Ee+JAgeO17iX605Lb0dzy/5HmopM7G8wUgzidPUY9AIZ63gr+GP
|
||||||
|
KyBrvwHzE6PbH9QjQy1Z7DhkThKeViocx67ewnBocBr75F09LfcVR+cAxMujSs7NBbYl444aQeth
|
||||||
|
HUuLwvuH189KsnQdqF2Tfta5lkCn9Uqeshq2c2jGyYXBTpvxyQny4X+yQZF1uEalH3PRR+AxIT9Y
|
||||||
|
2siMLMuRyS/iMhIkLToutzuhZS+7ujuGs7H4l9C0hUon9c+62XEIkNH4rjutR7lCuFbE3CMqVl9H
|
||||||
|
lgGQ6HXl0uoJHEzK4T1+ipstSiujn9KD+8LCtkz0YWFmdWQ97VHB2Wmjp4c2bze+BojbqJyfJ2bo
|
||||||
|
AAHP0AEiHQ7zN0yLl7+fkYIMy64xQJqamH1Z2BFN0GWMPwTjpXpszOC+ev7Bpbg0xoldQ1tBHHxH
|
||||||
|
J4Weia71DnXOnt8cj1VhebVMlyv7B/TGAbGwgprgmQ==
|
||||||
|
EOF
|
||||||
|
|
||||||
|
mv resolv.conf.tmp "binary/boot/squashfs.dir/etc/resolv.conf"
|
||||||
|
|
||||||
|
# Unmount the overlay first, where it is mounted:
|
||||||
|
umount "$SQUASH_ROOT"
|
||||||
|
|
||||||
|
# Then we can start unmounting the "real" root:
|
||||||
|
umount "binary/boot/squashfs.dir/proc"
|
||||||
|
umount "binary/boot/squashfs.dir/sys"
|
||||||
|
umount "binary/boot/squashfs.dir/dev/pts"
|
||||||
|
umount "binary/boot/squashfs.dir/dev"
|
||||||
|
umount "binary/boot/squashfs.dir/tmp"
|
||||||
|
|
||||||
|
apt-get -qqy install squashfs-tools
|
||||||
|
|
||||||
|
squashfs_f="${PWD}/livecd.ubuntu-server-next.installer.squashfs"
|
||||||
|
|
||||||
|
(cd "$OVERLAY_ROOT/" &&
|
||||||
|
mksquashfs . ${squashfs_f} \
|
||||||
|
-no-progress -xattrs -comp xz )
|
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
ln -snf ../run/resolvconf/resolv.conf /etc/resolv.conf
|
@ -0,0 +1,9 @@
|
|||||||
|
127.0.0.1 localhost.localdomain localhost
|
||||||
|
::1 localhost6.localdomain6 localhost6
|
||||||
|
|
||||||
|
# The following lines are desirable for IPv6 capable hosts
|
||||||
|
::1 localhost ip6-localhost ip6-loopback
|
||||||
|
fe00::0 ip6-localnet
|
||||||
|
ff02::1 ip6-allnodes
|
||||||
|
ff02::2 ip6-allrouters
|
||||||
|
ff02::3 ip6-allhosts
|
@ -0,0 +1,31 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Subiquity, the installer for Ubuntu Server
|
||||||
|
After=systemd-user-sessions.service plymouth-quit-wait.service
|
||||||
|
After=rc-local.service
|
||||||
|
Requires=snapd.service
|
||||||
|
IgnoreOnIsolate=yes
|
||||||
|
ConditionPathExists=/dev/tty0
|
||||||
|
ConditionPathExists=!/run/subiquity/complete
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Environment=PYTHONPATH=/usr/share/subiquity
|
||||||
|
ExecStartPre=/bin/systemctl stop getty@tty1
|
||||||
|
ExecStart=/sbin/agetty -n --noclear -l /snap/bin/subiquity tty1 $TERM
|
||||||
|
ExecStopPost=/bin/systemctl start getty@tty1
|
||||||
|
Type=idle
|
||||||
|
Restart=always
|
||||||
|
RestartSec=0
|
||||||
|
UtmpIdentifier=tty1
|
||||||
|
TTYPath=/dev/tty1
|
||||||
|
TTYReset=yes
|
||||||
|
TTYVHangup=yes
|
||||||
|
TTYVTDisallocate=yes
|
||||||
|
KillMode=process
|
||||||
|
IgnoreSIGPIPE=no
|
||||||
|
SendSIGHUP=yes
|
||||||
|
|
||||||
|
#KillMode=process
|
||||||
|
#Restart=always
|
||||||
|
#StandardInput=tty-force
|
||||||
|
#StandardOutput=tty
|
||||||
|
#StandardError=tty
|
@ -0,0 +1,30 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Subiquity debug shell %I
|
||||||
|
After=systemd-user-sessions.service plymouth-quit-wait.service
|
||||||
|
After=rc-local.service
|
||||||
|
IgnoreOnIsolate=yes
|
||||||
|
ConditionPathExists=/dev/tty0
|
||||||
|
ConditionPathExists=!/run/subiquity/complete
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Environment=PYTHONPATH=/usr/share/subiquity
|
||||||
|
ExecStartPre=/bin/systemctl stop getty@%I
|
||||||
|
ExecStart=/sbin/agetty -n --noclear -l /usr/share/subiquity/subiquity-debug %I $TERM
|
||||||
|
ExecStopPost=/bin/systemctl start getty@%I
|
||||||
|
Type=idle
|
||||||
|
Restart=always
|
||||||
|
RestartSec=0
|
||||||
|
UtmpIdentifier=%I
|
||||||
|
TTYPath=/dev/%I
|
||||||
|
TTYReset=yes
|
||||||
|
TTYVHangup=yes
|
||||||
|
TTYVTDisallocate=yes
|
||||||
|
KillMode=process
|
||||||
|
IgnoreSIGPIPE=no
|
||||||
|
SendSIGHUP=yes
|
||||||
|
|
||||||
|
#KillMode=process
|
||||||
|
#Restart=always
|
||||||
|
#StandardInput=tty-force
|
||||||
|
#StandardOutput=tty
|
||||||
|
#StandardError=tty
|
@ -0,0 +1,31 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Subiquity, the installer for Ubuntu Server
|
||||||
|
After=systemd-user-sessions.service plymouth-quit-wait.service
|
||||||
|
After=rc-local.service
|
||||||
|
Requires=snapd.service
|
||||||
|
IgnoreOnIsolate=yes
|
||||||
|
ConditionPathExists=/dev/tty0
|
||||||
|
ConditionPathExists=!/run/subiquity/complete
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Environment=PYTHONPATH=/usr/share/subiquity
|
||||||
|
ExecStartPre=/bin/systemctl stop getty@tty1
|
||||||
|
ExecStart=/sbin/agetty -n --noclear -l /snap/bin/subiquity tty1 $TERM
|
||||||
|
ExecStopPost=/bin/systemctl start getty@tty1
|
||||||
|
Type=idle
|
||||||
|
Restart=always
|
||||||
|
RestartSec=0
|
||||||
|
UtmpIdentifier=tty1
|
||||||
|
TTYPath=/dev/tty1
|
||||||
|
TTYReset=yes
|
||||||
|
TTYVHangup=yes
|
||||||
|
TTYVTDisallocate=yes
|
||||||
|
KillMode=process
|
||||||
|
IgnoreSIGPIPE=no
|
||||||
|
SendSIGHUP=yes
|
||||||
|
|
||||||
|
#KillMode=process
|
||||||
|
#Restart=always
|
||||||
|
#StandardInput=tty-force
|
||||||
|
#StandardOutput=tty
|
||||||
|
#StandardError=tty
|
Loading…
Reference in new issue