From 38157b37487d244b27af33f7863e6b15253c8f94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Thu, 1 Oct 2020 11:23:28 +0200 Subject: [PATCH] First batch of changes for raspi desktop. --- live-build/auto/config | 23 ++++++++++++++++- .../099-ubuntu-image-customization.chroot | 25 +++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 live-build/ubuntu/hooks/099-ubuntu-image-customization.chroot diff --git a/live-build/auto/config b/live-build/auto/config index 89e25277..46ebe9dc 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -445,6 +445,11 @@ case $IMAGEFORMAT in ;; esac + if [ "$SUBPROJECT" = "desktop-preinstalled" ]; then + BRANCH="desktop" + fi + + UBUNTU_IMAGE_ARGS="$UBUNTU_IMAGE_ARGS${SUBPROJECT:+ --subproject \"$SUBPROJECT\"}" UBUNTU_IMAGE_ARGS="$UBUNTU_IMAGE_ARGS${PROPOSED:+ --with-proposed}" UBUNTU_IMAGE_ARGS="$UBUNTU_IMAGE_ARGS${EXTRA_PPAS:+ --extra-ppas \"$EXTRA_PPAS\"}" @@ -472,6 +477,7 @@ case $IMAGEFORMAT in # Currently the IMAGEFORMAT none format is used only for ubuntu-image # targeted image builds which, currently, only target physical devices. OPTS="${OPTS:+$OPTS }--chroot-filesystem $IMAGEFORMAT" + PREINSTALLED=true ;; *) case $PROJECT in @@ -519,7 +525,7 @@ if [ "$PREINSTALLED" = "true" ]; then 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 + add_package live language-pack-en-base oem-config-slideshow-ubuntu fi ;; *) @@ -597,6 +603,21 @@ case $PROJECT in remove_packages_from_seed_regexp minimal.standard desktop-default-languages '^desktop-(?!default-languages|minimal|common)[^.]+$' remove_packages_from_seed_regexp minimal.standard desktop-default-languages '' # none (if no default langpack is selected) ;; + + desktop-preinstalled) + add_task install minimal standard cloud-image + if [ "$SUBARCH" = "raspi" ]; then + add_task install desktop-raspi + fi + # XXX: Are those actually needed? I see we use those for ubuntu-cpc, which is the project + # for existing raspi preinstalled images + OPTS="${OPTS:+$OPTS }--initramfs=none" + OPTS="${OPTS:+$OPTS }--system=normal" + OPTS="${OPTS:+$OPTS }--hdd-label=cloudimg-rootfs" + OPTS="${OPTS:+$OPTS }--ext-resize-blocks=536870912 --ext-block-size=4096" + OPTS="${OPTS:+$OPTS }--ext-fudge-factor=15" + ;; + *) LIVE_TASK='ubuntu-live' add_task install minimal standard ubuntu-desktop diff --git a/live-build/ubuntu/hooks/099-ubuntu-image-customization.chroot b/live-build/ubuntu/hooks/099-ubuntu-image-customization.chroot new file mode 100644 index 00000000..bb4f961a --- /dev/null +++ b/live-build/ubuntu/hooks/099-ubuntu-image-customization.chroot @@ -0,0 +1,25 @@ +#!/bin/bash -ex + +. /root/config/chroot + +# Specific ubuntu-image chroot configuration goes here. +if [ "$IMAGEFORMAT" == "none"]; then + if [ "$SUBPROJECT" == "desktop-preinstalled" ]; then + # Create files/dirs Ubiquity requires + mkdir -p /var/log/installer + touch /var/log/installer/debug + touch /var/log/syslog + chown syslog:adm /var/log/syslog + + sed -i "s|#WaylandEnable=false|#WaylandEnable=false\nInitialSetupEnable=false|" "/etc/gdm3/custom.conf" + + # Create the oem user account + /usr/sbin/useradd -d /home/oem -m -N -u 29999 oem + + /usr/sbin/oem-config-prepare --quiet + touch "/var/lib/oem-config/run" + + # Make the writable partition grow + echo "LABEL=writable / ext4 defaults,x-systemd.growfs 0 0" >>/etc/fstab + fi +fi