Imported 2.594

No reason for CPC update specified.
impish
CloudBuilder 6 years ago
parent a7935883ac
commit 8e60795a84

10
debian/changelog vendored

@ -1,3 +1,13 @@
livecd-rootfs (2.594) eoan; urgency=medium
[ David Krauser ]
* Add support for HyperV Gallery images
[ Patrick Viafore ]
* Add support for linux-kvm images
-- Tiago Stürmer Daitx <tiago.daitx@ubuntu.com> Wed, 12 Jun 2019 17:47:43 +0000
livecd-rootfs (2.593) eoan; urgency=medium
* Use boot-partition for cloud-init seed on RPi

@ -108,8 +108,8 @@ Expire-Date: 0
lb bootstrap "$@"
case $PROJECT in
ubuntu-server|ubuntu-cpc)
case $PROJECT:${SUBPROJECT:-} in
ubuntu-server:*|ubuntu-cpc:*|ubuntu:desktop-preinstalled)
# 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

@ -278,7 +278,7 @@ _get_live_passes ()
if [ -z "${IMAGEFORMAT:-}" ]; then
case $PROJECT:${SUBPROJECT:-} in
ubuntu-cpc:*)
ubuntu-cpc:*|ubuntu:desktop-preinstalled)
if [ "$SUBARCH" = "raspi3" ]; then
# For now only raspi3, but others are soon to follow
IMAGEFORMAT=ubuntu-image
@ -445,6 +445,13 @@ if [ "$PREINSTALLED" = "true" ]; then
;;
ubuntu-core|ubuntu-base|base|ubuntu-cpc)
;;
ubuntu)
add_package live oem-config-gtk ubiquity-frontend-gtk
add_package live ubiquity-slideshow-ubuntu
if [ "$SUBPROJECT" = "desktop-preinstalled" ]; then
add_package live language-pack-en-base
fi
;;
*)
add_package live oem-config-gtk ubiquity-frontend-gtk
add_package live ubiquity-slideshow-ubuntu
@ -1092,8 +1099,8 @@ EOF
fi
;;
ubuntu-core:system-image|ubuntu-cpc:*|ubuntu-server:live)
cp -af /usr/share/livecd-rootfs/live-build/${PROJECT}/* \
ubuntu-core:system-image|ubuntu-cpc:*|ubuntu-server:live|ubuntu:desktop-preinstalled)
cp -afL /usr/share/livecd-rootfs/live-build/${PROJECT}/* \
config/
if [ "$PROJECT" = "ubuntu-cpc" ]; then

@ -1,7 +1,7 @@
# 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)
# default imagesize = 2252*1024**2 = 2.2G (the current size we ship)
imagesize=${IMAGE_SIZE:-2361393152}
fs_label="${FS_LABEL:-rootfs}"
rootfs_dev_mapper=
@ -877,3 +877,19 @@ is_live_layer () {
done
return 1
}
replace_kernel () {
mountpoint=$1
new_kernel=$2
# Install custom kernel (N.B. the trailing + retains linux-base during this
# operation)
env DEBIAN_FRONTEND=noninteractive chroot "${mountpoint}" apt-get \
remove --purge --assume-yes '^linux-.*' 'linux-base+'
env DEBIAN_FRONTEND=noninteractive chroot "${mountpoint}" apt-get \
update --assume-yes
env DEBIAN_FRONTEND=noninteractive chroot "${mountpoint}" apt-get \
install --assume-yes "${new_kernel}"
env DEBIAN_FRONTEND=noninteractive chroot "${mountpoint}" apt-get \
autoremove --purge --assume-yes
}

@ -9,8 +9,17 @@ case $ARCH in
;;
esac
IMAGE_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process"
FS_LABEL="cloudimg-rootfs"
case ${PROJECT:-} in
ubuntu)
IMAGE_STR="# DESKTOP_IMG: This file was created/modified by the Desktop Image build process"
FS_LABEL="desktop-rootfs"
IMAGE_SIZE=12884901888 # 12G
;;
*)
IMAGE_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process"
FS_LABEL="cloudimg-rootfs"
;;
esac
. config/binary

@ -0,0 +1,73 @@
#!/bin/bash -eux
# vi: ts=4 expandtab
#
# Generate KVM image
#
echo "Building KVM image"
IMAGE_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process"
case ${SUBPROJECT:-} in
minimized)
echo "Skipping minimized $0 builds"
exit 0
;;
*)
;;
esac
# Only allow amd64 builds for now
case $ARCH in
amd64)
;;
*)
echo "Linux KVM images are not supported for $ARCH yet.";
exit 0;;
esac
. config/functions
mount_d=$(mktemp -d)
create_derivative "disk" "kvm" #sets ${derivative_img}
mount_disk_image ${derivative_img} ${mount_d}
# unmount disk image and remove created folders on exit
# even though we unmount manually before we convert to
# qcow2, we have this here just in case we error out before
# that step
cleanup_kvm() {
if [ -d "$mount_d" ]; then
umount_disk_image "$mount_d"
fi
rm -rf ${mount_d} ${derivative_img}
}
trap cleanup_kvm EXIT
divert_grub "${mount_d}"
replace_kernel ${mount_d} "linux-kvm"
undivert_grub "${mount_d}"
#setup grub correctly
env DEBIAN_FRONTEND=noninteractive chroot "${mount_d}" update-grub
replace_grub_root_with_label "${mount_d}"
# Remove initramfs for kvm image
env DEBIAN_FRONTEND=noninteractive chroot "${mount_d}" apt-get \
purge -y initramfs-tools busybox-initramfs
env DEBIAN_FRONTEND=noninteractive chroot "${mount_d}" rm \
-rf /boot/initrd.img-* /boot/initrd.img
# Remove indices
env DEBIAN_FRONTEND=noninteractive chroot "${mount_d}" apt-get \
clean
create_manifest ${mount_d} livecd.ubuntu-cpc.disk-kvm.manifest
# unmount disk image to prevent corruption
# and remove it so the trap doesn't try to unmount it again
umount_disk_image ${mount_d}
rm -rf ${mount_d}
convert_to_qcow2 ${derivative_img} livecd.ubuntu-cpc.disk-kvm.img

@ -2,6 +2,7 @@ depends root-dir
depends tarball
depends squashfs
depends disk-image
depends kvm
depends qcow2
depends vmdk
depends vagrant

@ -0,0 +1,2 @@
depends disk-image
base/kvm-image.binary

@ -0,0 +1 @@
../../ubuntu-cpc/hooks.d/base/disk-image-uefi.binary

@ -0,0 +1,128 @@
#!/bin/bash -eux
echo "Creating Hyper-V image with Desktop..."
case ${SUBPROJECT:-} in
minimized)
echo "We don't create minimized images for $0."
exit 0
;;
*)
;;
esac
case "${ARCH}" in
amd64)
;;
*)
echo "Hyper-V only supports amd64";
exit 0
;;
esac
IMAGE_STR="# DESKTOP_IMG: This file was created/modified by the Desktop Image build process"
FS_LABEL="desktop-rootfs"
. config/functions
export DEBIAN_FRONTEND=noninteractive
create_derivative uefi hyperv
scratch_d=$(mktemp -d)
mount_disk_image "${derivative_img}" "${scratch_d}"
cleanup_hyperv() {
umount_disk_image ${scratch_d}
rm -rf ${scratch_d}
}
trap cleanup_hyperv EXIT
# Perform customisations
chroot "${scratch_d}" apt-get update -y
chroot "${scratch_d}" apt-get -y install xrdp linux-tools-virtual linux-cloud-tools-virtual
cat > ${scratch_d}/etc/modules-load.d/hyperv.conf << EOF
${IMAGE_STR}
hv_sock
EOF
cat << EOF >> "${scratch_d}/etc/fstab"
LABEL=$FS_LABEL / ext4 defaults 0 0
EOF
# Customise xrdp
CHANGED_FILE_SUFFIX=.replaced-by-desktop-img-build
# use vsock transport.
sed -i${CHANGED_FILE_SUFFIX} -e 's/use_vsock=false/use_vsock=true/g' "${scratch_d}/etc/xrdp/xrdp.ini"
# use rdp security.
sed -i${CHANGED_FILE_SUFFIX} -e 's/security_layer=negotiate/security_layer=rdp/g' "${scratch_d}/etc/xrdp/xrdp.ini"
# remove encryption validation.
sed -i${CHANGED_FILE_SUFFIX} -e 's/crypt_level=high/crypt_level=none/g' "${scratch_d}/etc/xrdp/xrdp.ini"
# disable bitmap compression since its local its much faster
sed -i${CHANGED_FILE_SUFFIX} -e 's/bitmap_compression=true/bitmap_compression=false/g' "${scratch_d}/etc/xrdp/xrdp.ini"
# Add script to setup the ubuntu session properly
cat > "${scratch_d}/etc/xrdp/startubuntu.sh" << EOF
#!/bin/sh
${IMAGE_STR}
export GNOME_SHELL_SESSION_MODE=ubuntu
export XDG_CURRENT_DESKTOP=ubuntu:GNOME
exec /etc/xrdp/startwm.sh
EOF
chmod a+x "${scratch_d}/etc/xrdp/startubuntu.sh"
# use the script to setup the ubuntu session
sed -i${CHANGED_FILE_SUFFIX} -e 's/startwm/startubuntu/g' "${scratch_d}/etc/xrdp/sesman.ini"
# rename the redirected drives to 'shared-drives'
sed -i${CHANGED_FILE_SUFFIX} -e 's/FuseMountName=thinclient_drives/FuseMountName=shared-drives/g' "${scratch_d}/etc/xrdp/sesman.ini"
# Changed the allowed_users
sed -i${CHANGED_FILE_SUFFIX} -e 's/allowed_users=console/allowed_users=anybody/g' "${scratch_d}/etc/X11/Xwrapper.config"
# Blacklist the vmw module
cat > "${scratch_d}/etc/modprobe.d/blacklist_vmw_vsock_vmci_transport.conf" << EOF
${IMAGE_STR}
blacklist vmw_vsock_vmci_transport
EOF
# Configure the policy xrdp session
cat > ${scratch_d}/etc/polkit-1/localauthority/50-local.d/45-allow-colord.pkla << EOF
${IMAGE_STR}
[Allow Colord all Users]
Identity=unix-user:*
Action=org.freedesktop.color-manager.create-device;org.freedesktop.color-manager.create-profile;org.freedesktop.color-manager.delete-device;org.freedesktop.color-manager.delete-profile;org.freedesktop.color-manager.modify-device;org.freedesktop.color-manager.modify-profile
ResultAny=no
ResultInactive=no
ResultActive=yes
EOF
sed -i${CHANGED_FILE_SUFFIX} -e 's|After=|ConditionPathExists=!/var/lib/oem-config/run\nAfter=|g' "${scratch_d}/lib/systemd/system/xrdp.service"
# End xrdp customisation
# Don't run gnome-initial-setup from gdm
sed -i${CHANGED_FILE_SUFFIX} "s|#WaylandEnable=false|#WaylandEnable=false\nInitialSetupEnable=false|" "${scratch_d}/etc/gdm3/custom.conf"
chroot "${scratch_d}" /usr/sbin/useradd -d /home/oem -m -N -u 29999 oem
chroot "${scratch_d}" /usr/sbin/oem-config-prepare --quiet
touch "${scratch_d}/var/lib/oem-config/run"
chroot "${scratch_d}" apt-get clean
# End customisations
cleanup_hyperv
trap - EXIT
raw_img=binary/boot/disk-hyperv-uefi.ext4
vhd_img=livecd.ubuntu-desktop-hyperv.vhdx
qemu-img convert -O vhdx "$raw_img" "$vhd_img"
rm "$raw_img"
apt-get install -y zip
zip "$vhd_img.zip" "$vhd_img"
rm "$vhd_img"

@ -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
Loading…
Cancel
Save