diff --git a/debian/changelog b/debian/changelog index 6517126e..ef831f37 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,221 @@ +livecd-rootfs (2.819) lunar; urgency=medium + + [ Heinrich Schuchardt ] + * Add image for StarFive VisionFive 2. + + [ Steve Langasek ] + * Update URL to point to ubuntu-archive-team.ubuntu.com. + + -- Łukasz 'sil2100' Zemczak Wed, 05 Apr 2023 18:01:07 +0200 + +livecd-rootfs (2.818) lunar; urgency=medium + + [ Dave Jones ] + * raspi: drop mkswap.service and swapfile.swap units in + 099-ubuntu-image-customization.chroot in favour of units provided by + ubuntu-raspi-settings-desktop + * raspi: drop 01-network-manager-all.yaml in favour of configuration + provided by ubuntu-raspi-settings-desktop + * raspi: drop growfs option from fstab in favour of growroot-almost + service provided by ubuntu-raspi-settings-desktop + + [ William 'jawn-smith' Wilson ] + * Skip oem-config setup in hooks if the oem user already exists. + + -- Dave Jones Tue, 28 Mar 2023 14:38:55 +0100 + +livecd-rootfs (2.817) lunar; urgency=medium + + [ John Chittum ] + * revert ipc change. kernel 6.2 will have the correct setting + + -- Steve Langasek Mon, 27 Mar 2023 12:11:06 -0700 + +livecd-rootfs (2.816) lunar; urgency=medium + + [ Chad Smith ] + * Replace cloud-init.service on NetworkManager images to address an ordering + cycle interfering with autoinstall with ubuntu-desktop-installer. + (LP: #2008952) + + -- Dan Bungert Fri, 24 Mar 2023 18:35:46 -0600 + +livecd-rootfs (2.815) lunar; urgency=medium + + [ Dan Bungert ] + * debian/control: depend on zstd to fix unmkinitramfs failure. + + [ Łukasz 'sil2100' Zemczak ] + * Change the mini-iso livefs artifact name from .mini-iso.iso to .iso to be + more compatible with existing cdimage machinery. + * Rename variables accessed in the mini-iso to the equivalents exported to + binary hooks. + + -- Łukasz 'sil2100' Zemczak Thu, 23 Mar 2023 10:43:29 +0100 + +livecd-rootfs (2.814) lunar; urgency=medium + + * Adjust journald settings for live-server for compatibility with Subiquity. + With a move to core22 we can turn zstd back on, but the new compact flag + needs to be off. (LP: #2006985) + + -- Dan Bungert Mon, 20 Mar 2023 15:00:52 -0600 + +livecd-rootfs (2.813) lunar; urgency=medium + + [ Łukasz 'sil2100' Zemczak ] + * Make sure that for devel we also use the right intel-iot kernel flavor + for the images. We don't build any for this series, but it's good to have + parity in the devel branch. + * Add support for building intel-iot server images. Not used in lunar, but + adding to keep devel up-to-date with changes. + + [ Steve Langasek ] + * No new dependencies on i386 (xorriso). + + -- Steve Langasek Sat, 18 Mar 2023 08:25:03 -0700 + +livecd-rootfs (2.812) lunar; urgency=medium + + * Inform cloud-init when network manager is in use. (LP: #1982855) + + -- Dan Bungert Thu, 09 Mar 2023 14:59:17 -0600 + +livecd-rootfs (2.811) lunar; urgency=medium + + [ John Chittum ] + * fix: remove ipc from apparmor features in 6.1 + * open 2.810 release + + -- Dimitri John Ledkov Thu, 09 Mar 2023 18:10:05 +0000 + +livecd-rootfs (2.810) lunar; urgency=medium + + * Add ubuntu-mini-iso build project. + + -- Dan Bungert Mon, 06 Mar 2023 08:17:11 -0700 + +livecd-rootfs (2.809) lunar; urgency=medium + + * Do not use the ubuntucinnamon-desktop task for cinnamon builds, it doesn't + seem to be present in the archive yet. Use the metapackage instead, which + seems like a better way forward anyway. For the live task, temporarily use + a hard-coded list of packages. + * Explicitly define the kernel flavor for ubuntucinnamon. + + -- Łukasz 'sil2100' Zemczak Mon, 06 Mar 2023 11:27:02 +0100 + +livecd-rootfs (2.808) lunar; urgency=medium + + * Add ubuntucinnamon to the seed-determination switch-case. + + -- Łukasz 'sil2100' Zemczak Fri, 03 Mar 2023 15:07:06 +0100 + +livecd-rootfs (2.807) lunar; urgency=medium + + * auto/config: Add support for ubuntu core arm64 generic images (LP: #2009067) + + -- Dimitri John Ledkov Thu, 02 Mar 2023 18:18:18 +0000 + +livecd-rootfs (2.806) lunar; urgency=medium + + [ Sean Davis ] + * Remove snap base seed for xubuntu:minimal + + -- Steve Langasek Tue, 28 Feb 2023 08:00:08 -0800 + +livecd-rootfs (2.805) lunar; urgency=medium + + * riscv64: set attribute required partition for firmware. + + -- Michael Hudson-Doyle Mon, 27 Feb 2023 21:49:27 +1300 + +livecd-rootfs (2.804) lunar; urgency=medium + + * Clarified with Erich that edubuntu should install ubuntu-desktop-minimal + task. + + -- Steve Langasek Fri, 24 Feb 2023 21:11:56 -0800 + +livecd-rootfs (2.803) lunar; urgency=medium + + * Fix wrong task name for xubuntu-minimal. + * Fix edubuntu build: ubuntu-minimal is not a task and minimal is already + declared. + + -- Steve Langasek Fri, 24 Feb 2023 21:05:48 -0800 + +livecd-rootfs (2.802) lunar; urgency=medium + + * Address the fact that debootstrap doesn't follow Recommends and as a + result we're missing several Recommends that should be installed by + default and are on upgrades but not on new installs. This is not + applied to minimized images, which don't follow Recommends; but does get + separately applied to the ubuntu-server full squashfs. + + -- Steve Langasek Fri, 24 Feb 2023 17:47:54 -0800 + +livecd-rootfs (2.801) lunar; urgency=medium + + [ Heinrich Schuchardt ] + * RISC-V: avoid soft lockup Radeon GPUs. With Radeon GPUs and kernel 5.19 a + soft lockup was observed. Increase the watchdog threshold. + + [ Łukasz 'sil2100' Zemczak ] + * Add ubuntucinnamon to the supported flavours. + * Terrible hack workaround for clearing out the non-offline apt cache + for desktop related images. + + [ Dimitri John Ledkov ] + * ubuntu-cpc: set default ext4 mount option commit=30 (LP: #2006511). + * Cherry-pick jammy point release fixes. + + -- Dimitri John Ledkov Fri, 24 Feb 2023 12:20:04 +0000 + +livecd-rootfs (2.800) lunar; urgency=medium + + * WSL: do not depend on standard anymore. + Evolve the seed to only ship the specific part useful to WSL users. This + allows to trim down the image size. + + -- Didier Roche Mon, 20 Feb 2023 11:59:25 +0100 + +livecd-rootfs (2.799) lunar; urgency=medium + + * Reintroduce edubuntu. + + -- Steve Langasek Tue, 14 Feb 2023 15:55:41 -0800 + +livecd-rootfs (2.798) lunar; urgency=medium + + * Add xubuntu minimal subproject. + + -- Steve Langasek Mon, 13 Feb 2023 21:07:27 -0800 + +livecd-rootfs (2.797) lunar; urgency=medium + + * Drop dependency on rsync, not used in a very long time and lets us drop + rsync on i386. + + -- Steve Langasek Wed, 01 Feb 2023 07:44:33 -0800 + +livecd-rootfs (2.796) lunar; urgency=medium + + [ Heinrich Schuchardt ] + * riscv64: adjust U-Boot installation for Nezha D1 and LicheeRV. Since + version 2022.10 U-Boot SPL and U-Boot are installed onto the same + partition. Package nezha-boot0 is not needed anymore. + + -- Łukasz 'sil2100' Zemczak Mon, 09 Jan 2023 14:10:22 +0100 + +livecd-rootfs (2.795) lunar; urgency=medium + + * Don't depend on python3-launchpadlib on i386. This breaks ppa-enabled + builds on i386, but avoids pulling in a large dependency tree that's + not otherwise needed on i386. + + -- Steve Langasek Thu, 05 Jan 2023 22:07:17 -0800 + livecd-rootfs (2.794) lunar; urgency=medium [ Sebastien Bacher ] diff --git a/debian/control b/debian/control index 18cdafbc..48d6d8e7 100644 --- a/debian/control +++ b/debian/control @@ -30,16 +30,17 @@ Depends: ${misc:Depends}, procps, python3, python3-apt, - python3-launchpadlib, + python3-launchpadlib [!i386], python3-yaml, qemu-utils [!i386], - rsync, snapd (>= 2.39) [!i386], squashfs-tools (>= 1:3.3-1), sudo, python3-vmdkstream [amd64 i386], + xorriso [!i386], xz-utils, - zerofree + zerofree, + zstd Breaks: ubuntu-defaults-builder (<< 0.32) Description: construction script for the livecd rootfs livecd-rootfs provides the script used to create the root filesystem diff --git a/debian/tests/default-bootstraps b/debian/tests/default-bootstraps index 9e1fc5f6..9d63d7a0 100755 --- a/debian/tests/default-bootstraps +++ b/debian/tests/default-bootstraps @@ -13,6 +13,7 @@ fi # Listed subprojects can be combined with other projects as well, # but this list gives reasonable coverage. ALL_TRIPLETS=" + edubuntu:: kubuntu:: kubuntu-dvd:: kubuntu-plasma5:: @@ -26,6 +27,7 @@ ALL_TRIPLETS=" ubuntu-budgie:: ubuntu-budgie-desktop:: ubuntu-budgie-live:: + ubuntucinnamon:: ubuntu-core:system-image:ubuntu-core ubuntu-cpc::ubuntu-cpc ubuntu-cpc:minimized:ubuntu-cpc @@ -38,7 +40,8 @@ ALL_TRIPLETS=" ubuntu-mate-live:: ubuntu-netbook:: ubuntu-server:live:ubuntu-server - xubuntu::" + xubuntu:: + xubuntu:minimal:" if [ -z "$SELECTED_TRIPLETS" ]; then SELECTED_TRIPLETS=" diff --git a/live-build/auto/build b/live-build/auto/build index bcf0bf21..c8e8da6e 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -330,6 +330,16 @@ EOF chmod +x chroot/usr/bin/man fi + if [ "${SUBPROJECT:-}" != minimized ] \ + && [ "${PROJECT}" != "ubuntu-server" ] + then + # debootstrap doesn't handle Recommends and fixing this is + # non-trivial, so install missing Recommends here + echo "Installing any missing recommends" + Chroot chroot "env DEBIAN_FRONTEND=noninteractive \ + apt-get -y --fix-policy install" + fi + if [ -n "${PASSES}" ]; then PATH="config/:$PATH" lb chroot_layered "$@" else @@ -485,6 +495,18 @@ EOF clean_debian_chroot fi + # XXX: Terrible last-minute hack to work-around issue LP: #2008082 ! + # This basically needs to be done better, we simply need to make sure + # that we don't update the cache after lb cleans up. Since identifying + # that might take a moment, for now, for flavors that are generally + # affected by this, we manually clear out the archive-related Packages + # files in the cache. + case $PROJECT in + ubuntu|xubuntu|kubuntu|ubuntu-budgie|ubuntukylin|ubuntu-mate) + rm -f chroot/var/lib/apt/lists/*ubuntu.com*_Packages + ;; + esac + if [ -n "${PASSES}" ]; then PATH="config/:$PATH" lb binary_layered "$@" else @@ -588,6 +610,9 @@ for FLAVOUR in $LB_LINUX_FLAVOURS; do image-intel) FLAVOUR="intel" ;; + intel-iotg*) + FLAVOUR="intel-iotg" + ;; esac KVERS="$( (cd "binary/$INITFS"; ls vmlinu?-* 2>/dev/null || true) | (fgrep -v .efi || true) | sed -n "s/^vmlinu.-\\([^-]*-[^-]*-$FLAVOUR\\)$/\\1/p" )" if [ -z "$KVERS" ]; then diff --git a/live-build/auto/config b/live-build/auto/config index e22474e1..1b3dd4ad 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -12,7 +12,7 @@ fi echo "Building on $(hostname --fqdn)" -SEEDMIRROR=http://people.canonical.com/~ubuntu-archive/seeds/ +SEEDMIRROR=https://ubuntu-archive-team.ubuntu.com/seeds/ if [ -z "$MIRROR" ]; then case $(hostname --fqdn) in *.ubuntu.com) MIRROR=http://ftpmaster.internal/ubuntu/ @@ -346,12 +346,32 @@ if [ -z "${IMAGEFORMAT:-}" ]; then ubuntu-base:*) IMAGEFORMAT=ubuntu-image ;; - ubuntu-server:live) + ubuntu-server:live|ubuntu-mini-iso:) IMAGEFORMAT=plain ;; esac fi +# Configure preinstalled ubuntu-cpc images with included password +# one also must request disk1-img-xz image format +if [ "$IMAGEFORMAT" = "ext4" ] && [ "$PROJECT" = "ubuntu-cpc" ]; then + case $ARCH:$SUBARCH in + armhf:raspi2 | \ + riscv64:icicle | \ + riscv64:nezha | \ + riscv64:licheerv | \ + riscv64:sifive_* | \ + riscv64:visionfive | \ + riscv64:visionfive2 | \ + *:generic) + IMAGE_HAS_HARDCODED_PASSWORD=1 + if [ -z "${IMAGE_TARGETS:-}" ]; then + export IMAGE_TARGETS="disk1-img-xz" + fi + ;; + esac +fi + skip_lb_stage() { STAGE="$1" mkdir -p .build @@ -368,6 +388,8 @@ case $IMAGEFORMAT in ubuntu-server:live) touch config/universe-enabled ;; + ubuntu-mini-iso:) + ;; *) PREINSTALLED=true ;; @@ -396,6 +418,8 @@ case $IMAGEFORMAT in MODEL=pi3-arm64 ;; armhf+cm3) MODEL=cm3 ;; + arm64+*) + MODEL=pc-arm64 ;; *) echo "Model $ARCH+${SUBARCH:-} unknown to livecd-rootfs" >&2 exit 1 @@ -414,7 +438,7 @@ case $IMAGEFORMAT in CHANNEL="${CHANNEL:-edge}" case $MODEL in - pc-amd64) + pc-amd64|pc-arm64) if [ -z "${SUBARCH:-}" ]; then # This is to make sure there's enough writable space UBUNTU_IMAGE_ARGS="$UBUNTU_IMAGE_ARGS --image-size 3700M" @@ -556,7 +580,7 @@ if [ "$PREINSTALLED" = "true" ]; then ubuntu-server) add_package live oem-config-debconf ubiquity-frontend-debconf ;; - ubuntu-base|ubuntu-oci|ubuntu-cpc|ubuntu-wsl) + ubuntu-base|ubuntu-oci|ubuntu-cpc|ubuntu-wsl|ubuntu-mini-iso) ;; ubuntu) add_package live oem-config-gtk ubiquity-frontend-gtk @@ -611,16 +635,19 @@ case $PROJECT in ubuntustudio*) SEED=ubuntustudio.$SUITE ;; + ubuntucinnamon*) + SEED=ubuntucinnamon.$SUITE + ;; *) SEED=ubuntu.$SUITE ;; esac case $PROJECT in - ubuntu-server) + ubuntu-server|ubuntu-mini-iso) COMPONENTS='main' ;; - kubuntu|kubuntu-dvd|kubuntu-plasma5|ubuntu-gnome|ubuntu-budgie|ubuntukylin) + kubuntu|kubuntu-dvd|kubuntu-plasma5|edubuntu|ubuntu-gnome|ubuntu-budgie|ubuntukylin|ubuntucinnamon) COMPONENTS='main restricted universe' ;; xubuntu|mythbuntu|lubuntu|ubuntu-mate|ubuntu-unity|ubuntustudio-dvd|ubuntu-unity) @@ -654,7 +681,7 @@ case $PROJECT in add_task live ubuntu-desktop-minimal-default-languages ubuntu-desktop-default-languages KERNEL_FLAVOURS='generic-hwe-22.04' if [ "$SUBARCH" = "intel-iot" ]; then - KERNEL_FLAVOURS='image-intel' + KERNEL_FLAVOURS='intel-iotg' fi ;; desktop-preinstalled) @@ -672,7 +699,7 @@ case $PROJECT in OPTS="${OPTS:+$OPTS }--ext-fudge-factor=15" ;; intel-iot) - KERNEL_FLAVOURS='image-intel' + KERNEL_FLAVOURS='intel-iotg' OPTS="${OPTS:+$OPTS }--initramfs=none" OPTS="${OPTS:+$OPTS }--system=normal" OPTS="${OPTS:+$OPTS }--hdd-label=cloudimg-rootfs" @@ -742,8 +769,34 @@ case $PROJECT in add_chroot_hook remove-gnome-icon-cache ;; + edubuntu) + add_task install minimal standard ubuntu-desktop-minimal edubuntu-desktop-gnome + LIVE_TASK='edubuntu-live' + ;; + + ubuntucinnamon) + add_task install minimal standard + add_package install ubuntucinnamon-desktop + # XXX: Adding live packages manually temporarily until we have + # the live task for ubuntucinnamon set up properly. + add_package live ubiquity-frontend-gtk + add_package live ubiquity-ubuntu-artwork ubiquity-slideshow-ubuntu + add_package live gtk-im-libthai ibus-hangul ibus-mozc ibus-unikey + add_package live zfsutils-linux zfs-initramfs zsys + add_package live sssd realmd adcli + add_package live gparted cifs-utils + KERNEL_FLAVOURS=generic + ;; + xubuntu) - add_task install minimal standard xubuntu-desktop + case ${SUBPROJECT:-} in + minimal) + add_task install minimal standard xubuntu-minimal + ;; + *) + add_task install minimal standard xubuntu-desktop + ;; + esac add_package install xterm LIVE_TASK='xubuntu-live' case $ARCH in @@ -831,9 +884,15 @@ case $PROJECT in # the GA and HWE kernels (in separate layers) so this code is # written generically to support both even though a lot of the # time only one kernel is offered. - - # variants='ga hwe' - variants='ga' + case ${SUBARCH:-} in + intel-iot) + variants='intel' + ;; + *) + # variants='ga hwe' + variants='ga' + ;; + esac for variant in $variants; do if [ "$variant" = "ga" ]; then @@ -842,6 +901,9 @@ case $PROJECT in elif [ "$variant" = "hwe" ]; then kernel_metapkg=linux-generic-hwe-$(lsb_release -sr) flavor=generic-hwe + elif [ "$variant" = "intel" ]; then + kernel_metapkg=linux-intel-iotg + flavor=intel-iotg else echo "bogus variant: $variant" exit 1 @@ -874,6 +936,25 @@ case $PROJECT in PREINSTALL_POOL_SEEDS='server-ship' ;; + ubuntu-mini-iso) + OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal" + + OPTS="${OPTS:+$OPTS }--linux-packages=none --initramfs=none" + KERNEL_FLAVOURS=none + BINARY_REMOVE_LINUX=false + + add_package install mini-iso-tools openssl ca-certificates isc-dhcp-client linux-generic + case $ARCH in + amd64) + add_package install cd-boot-images-amd64 + ;; + *) + echo "unexpected architecture for $PROJECT: '$ARCH'" + exit 1 + ;; + esac + ;; + ubuntu-base) OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal" ;; @@ -883,7 +964,7 @@ case $PROJECT in ;; ubuntu-wsl) - add_task install minimal standard ubuntu-wsl + add_task install minimal ubuntu-wsl OPTS="${OPTS:+$OPTS }--linux-packages=none --initramfs=none" KERNEL_FLAVOURS=none BINARY_REMOVE_LINUX=false @@ -925,7 +1006,7 @@ case $PROJECT in if [ "${SUBARCH:-}" = "generic" ]; then KERNEL_FLAVOURS=generic elif [ "${SUBARCH:-}" = "intel-iot" ]; then - KERNEL_FLAVOURS=image-intel + KERNEL_FLAVOURS=intel-iotg OPTS="${OPTS:+$OPTS }--initramfs=none" fi ;; @@ -1000,10 +1081,12 @@ case $PROJECT:${SUBPROJECT:-} in ubuntu-server:live) BASE_SEED='server' ;; - ubuntu-base:*|ubuntu-core:*) + ubuntu-base:*|ubuntu-core:*|ubuntu-mini-iso:) ;; ubuntu-oci:*) ;; + xubuntu:minimal) + ;; *) BASE_SEED='desktop' ;; @@ -1109,7 +1192,7 @@ case $PROJECT in KERNEL_FLAVOURS="${SUBARCH:-$KERNEL_FLAVOURS}" case $SUBARCH in intel-iot) - KERNEL_FLAVOURS='image-intel' + KERNEL_FLAVOURS='intel-iotg' ;; esac ;; @@ -1171,7 +1254,7 @@ if [ "${IMAGE_HAS_HARDCODED_PASSWORD:-}" = "1" ]; then fi case $PROJECT in - ubuntu-cpc|ubuntu-core|ubuntu-base|ubuntu-oci|ubuntu-wsl) + ubuntu-cpc|ubuntu-core|ubuntu-base|ubuntu-oci|ubuntu-wsl|ubuntu-mini-iso) # ubuntu-cpc gets this added in 025-create-groups.chroot, and we do # not want this group in projects that are effectively just chroots ;; @@ -1330,7 +1413,7 @@ EOF fi ;; - ubuntu-cpc:*|ubuntu-server:live|ubuntu:desktop-preinstalled|ubuntu-wsl:*) + ubuntu-cpc:*|ubuntu-server:live|ubuntu:desktop-preinstalled|ubuntu-wsl:*|ubuntu-mini-iso:*) # Ensure that most things e.g. includes.chroot are copied as is for entry in /usr/share/livecd-rootfs/live-build/${PROJECT}/*; do case $entry in diff --git a/live-build/functions b/live-build/functions index 210a783c..a3cbadfd 100644 --- a/live-build/functions +++ b/live-build/functions @@ -4,6 +4,8 @@ imagesize=${IMAGE_SIZE:-2361393152} fs_label="${FS_LABEL:-rootfs}" +AUTOMATION_HEADER="# Automatically generated by installer build process" + rootfs_dev_mapper= loop_device= loop_raw= @@ -997,7 +999,7 @@ configure_network_manager() { # default. Installing NM on an existing system only manages wifi and wwan via # /usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf. When setting # the global backend to NM, netplan overrides that file. - if [ -e chroot/usr/sbin/NetworkManager -a ! -f chroot/etc/netplan/01-network-manager-all.yaml ]; then + if [ -e chroot/usr/sbin/NetworkManager -a ! -f chroot/etc/netplan/01-network-manager-all.yaml -a "$SUBPROJECT" != "desktop-preinstalled" ]; then echo "===== Enabling all devices in NetworkManager ====" mkdir -p chroot/etc/netplan cat < chroot/etc/netplan/01-network-manager-all.yaml @@ -1006,6 +1008,72 @@ network: version: 2 renderer: NetworkManager EOF + + # inform cloud-init of the same (LP: #1982855) + mkdir -p chroot/etc/cloud/cloud.cfg.d + cat < chroot/etc/cloud/cloud.cfg.d/99-installer-use-networkmanager.cfg +${AUTOMATION_HEADER} +# Let NetworkManager manage all devices on this system +system_info: + network: + renderers: ['network-manager'] + activators: ['network-manager'] +EOF + + # Position cloud-init.service After=NetworkManager.service. + # (LP: #2008952). + # We override the entire cloud-init.service definition because + # systemd drop-in files only allow adding Before/After constraints + # yet we are dropping the Before=sysinit.target from the upstream + # cloud-init.service. + # This override can be dropped when NetworkManager.service can run + # Before=sysinit.target when it drops strict dbus.service dependency. + cat < chroot/lib/systemd/system/cloud-init.service +${AUTOMATION_HEADER} +# Based on cloud-init 23.1 for Desktop LiveCD +[Unit] +Description=Initial cloud-init job (metadata service crawler) +DefaultDependencies=no +Wants=cloud-init-local.service +Wants=sshd-keygen.service +Wants=sshd.service +After=cloud-init-local.service +After=systemd-networkd-wait-online.service +# Installer Added After=NetworkManager* ordering +After=NetworkManager.service +After=NetworkManager-wait-online.service +After=networking.service +Before=network-online.target +Before=sshd-keygen.service +Before=sshd.service +# Before=sysinit.target Installer removed to allow for NM dependency +Before=shutdown.target +Conflicts=shutdown.target +Before=systemd-user-sessions.service + +[Service] +Type=oneshot +ExecStart=/usr/bin/cloud-init init +RemainAfterExit=yes +TimeoutSec=0 + +# Output needs to appear in instance console output +StandardOutput=journal+console + +[Install] +WantedBy=cloud-init.target +EOF + + # Allow cloud-init clean to inform of strict network-manager config + mkdir -p chroot/etc/cloud/clean.d + cat < chroot/etc/cloud/clean.d/99-installer-use-networkmanager +# Inform clone image creators about strict network-manager cfg for cloud-init +if [ -f /etc/cloud/cloud.cfg.d/99-installer-use-networkmanager.cfg ]; then + echo "WARNING: cloud-init network config is limited to using network-manager." + echo "If this is undesirable: rm /etc/cloud/cloud.cfg.d/99-installer-use-networkmanager.cfg" +fi +EOF + chmod +x chroot/etc/cloud/clean.d/99-installer-use-networkmanager else echo "==== NetworkManager not installed ====" fi diff --git a/live-build/lb_binary_layered b/live-build/lb_binary_layered index 424f7001..f31d5e22 100755 --- a/live-build/lb_binary_layered +++ b/live-build/lb_binary_layered @@ -56,9 +56,12 @@ build_layered_squashfs () { Echo_message "lb_binary_layered: treating pass $pass" + # Per convention, we include the subarch name next to the project + PROJECT_FULL=$PROJECT${SUBARCH:+-$SUBARCH} + # Building squashfs filesystem & manifest local overlay_dir="overlay.${pass}" - base="${PWD}/livecd.${PROJECT}.${pass}" + base="${PWD}/livecd.${PROJECT_FULL}.${pass}" squashfs_f="${base}.squashfs" # We have already treated that pass @@ -113,7 +116,7 @@ build_layered_squashfs () { create_manifest "chroot" "${squashfs_f_manifest}.full" # Delta manifest - diff -NU0 ${PWD}/livecd.${PROJECT}.$(get_parent_pass $pass).manifest.full ${squashfs_f_manifest}.full|grep -v ^@ > $squashfs_f_manifest + diff -NU0 ${PWD}/livecd.${PROJECT_FULL}.$(get_parent_pass $pass).manifest.full ${squashfs_f_manifest}.full|grep -v ^@ > $squashfs_f_manifest squashfs_f_size="${base}.size" du -B 1 -s "overlay.${pass}/" | cut -f1 > "${squashfs_f_size}" @@ -121,7 +124,7 @@ build_layered_squashfs () { # We take first live pass for "global" ISO properties (used by installers and checkers): # Prepare initrd + kernel # Main manifest and size files - prefix="livecd.$PROJECT${SUBARCH:+-$SUBARCH}" + prefix="livecd.$PROJECT_FULL" if [ ! -e "${prefix}.manifest" ] && $(is_live_layer "$pass"); then totalsize=$(cat ${squashfs_f_size}) curpass="$pass" @@ -130,7 +133,7 @@ build_layered_squashfs () { # We climbed up the tree to the root layer, we are done [ -z "$curpass" ] && break - totalsize=$(expr $totalsize + $(cat "${PWD}/livecd.${PROJECT}.${curpass}.size")) + totalsize=$(expr $totalsize + $(cat "${PWD}/livecd.${PROJECT_FULL}.${curpass}.size")) done echo ${totalsize} > "${prefix}.size" @@ -141,7 +144,7 @@ build_layered_squashfs () { if [ -f config/$pass.catalog-in.yaml ]; then echo "Expanding catalog entry template for $pass" - usc_opts="--output livecd.${PROJECT}.install-sources.yaml \ + usc_opts="--output livecd.${PROJECT_FULL}.install-sources.yaml \ --template config/$pass.catalog-in.yaml \ --size $(du -B 1 -s chroot/ | cut -f1) --squashfs ${pass}.squashfs \ --translations config/catalog-translations" @@ -168,9 +171,9 @@ do done # Ubiquity-compatible removal manifest for ISO not using a layered-aware installer -if [ -n "$(ls livecd.${PROJECT}.*install.live.manifest.full 2>/dev/null)" ] && \ - [ -n "$(ls livecd.${PROJECT}.*install.manifest.full 2>/dev/null)" ]; then - echo "$(diff livecd.${PROJECT}.*install.live.manifest.full livecd.${PROJECT}.*install.manifest.full | awk '/^< / { print $2 }')" > livecd.${PROJECT}-manifest-remove +if [ -n "$(ls livecd.${PROJECT_FULL}.*install.live.manifest.full 2>/dev/null)" ] && \ + [ -n "$(ls livecd.${PROJECT_FULL}.*install.manifest.full 2>/dev/null)" ]; then + echo "$(diff livecd.${PROJECT_FULL}.*install.live.manifest.full livecd.${PROJECT_FULL}.*install.manifest.full | awk '/^< / { print $2 }')" > livecd.${PROJECT_FULL}-manifest-remove fi chmod 644 *.squashfs *.manifest* *.size diff --git a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary index 3c6bd3dd..c77305a2 100755 --- a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary +++ b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary @@ -84,12 +84,15 @@ create_partitions() { --new=13:256:25575 \ --change-name=13:loader1 \ --typecode=13:B161E8AB-7D4B-4DB4-821C-4120A0554A35 \ + --attributes=13:set:0 \ --new=16:25576:32799 \ --change-name=16:loader2b \ --typecode=16:F79E76D9-AC98-418B-8F31-E17EA24FF07C \ + --attributes=16:set:0 \ --new=14:32800:43007 \ --change-name=14:loader2 \ --typecode=14:F4FA3898-3478-4941-887D-FCEC4E9E3C05 \ + --attributes=14:set:0 \ --new=15::+106M \ --typecode=15:ef00 \ --change-name=15:ESP \ @@ -104,6 +107,7 @@ create_partitions() { --new=13:256:25575 \ --change-name=13:loader \ --typecode=13:ef02 \ + --attributes=13:set:0 \ --new=15::+106M \ --typecode=15:ef00 \ --change-name=15:ESP \ @@ -124,6 +128,23 @@ create_partitions() { --change-name=3:uEnv \ --new=1:: \ --attributes=1:set:2 + elif [ "${SUBARCH:-}" = "visionfive2" ]; then + # VisionFive 2 + sgdisk "${disk_image}" \ + --set-alignment=4096 \ + --new=13:4096:8191 \ + --typecode=13:2E54B353-1271-4842-806F-E436D6AF6985 \ + --change-name=13:loader1 \ + --new=2:8192:16383 \ + --typecode=2:7a097280-70d2-44bc-886c-ff5ffbb7b098 \ + --change-name=2:loader2 \ + --new=12:16384:24575 \ + --change-name=12:CIDATA \ + --new=15:24576:229375 \ + --typecode=15:ef00 \ + --change-name=15:ESP \ + --new=1:229376: \ + --attributes=1:set:2 else # preinstalled server, currently FU540 # FU740 too in the future @@ -132,9 +153,11 @@ create_partitions() { --new=13:34:2081 \ --change-name=13:loader1 \ --typecode=13:5B193300-FC78-40CD-8002-E86C45580B47 \ + --attributes=13:set:0 \ --new=14:2082:10239 \ --change-name=14:loader2 \ --typecode=14:2E54B353-1271-4842-806F-E436D6AF6985 \ + --attributes=14:set:0 \ --new=15::+106M \ --typecode=15:ef00 \ --new=12::+4M \ @@ -243,10 +266,11 @@ install_grub() { local my_d=$(dirname $(readlink -f ${0})) echo "Adjusting GRUB defaults for ${ARCH}" mkdir -p mountpoint/etc/default/grub.d/ - cp ${my_d}/riscv64/grub/cmdline.cfg mountpoint/etc/default/grub.d/ + cp ${my_d}/riscv64/grub/10_cmdline.cfg mountpoint/etc/default/grub.d/ case "${SUBARCH}" in "icicle") echo "Installing GRUB for ${SUBARCH} board" + cp ${my_d}/riscv64/grub/90_watchdog-thresh.cfg mountpoint/etc/default/grub.d/ # flash-kernel is needed to install the dtb for update-grub: it uses the # /proc/device-tree/model value to pick the correct dtb and as we are in a chroot, # the model value is wrong and we need to use /etc/flash-kernel/machine instead. @@ -298,16 +322,12 @@ install_grub() { chroot mountpoint bash -c 'FK_FORCE=yes apt-get install -qqy grub-efi-riscv64 flash-kernel' efi_target=riscv64-efi - # nezha-boot0 is actually compatible with the LicheeRV boards (and probably other D1-based boards) - chroot mountpoint apt-get install -qqy nezha-boot0 - # FSBL, which gets U-Boot SPL - loader1="/dev/mapper${loop_device///dev/}p13" - dd if=mountpoint/usr/lib/u-boot/nezha/boot0_sdcard_sun20iw1p1.bin of=$loader1 - # The real U-Boot - # u-boot-nezha actually contains both the LicheeRV and the Nezha boards support + # u-boot-nezha supports both the LicheeRV and the Nezha D1. chroot mountpoint apt-get install -qqy u-boot-nezha - loader2="/dev/mapper${loop_device///dev/}p14" - dd if=mountpoint/usr/lib/u-boot/${SUBARCH}/u-boot.toc1 of=$loader2 + # Since version 2022.10 U-Boot SPL and U-Boot are installed onto the same partition. + # Package nezha-boot0 is not needed anymore. + loader1="/dev/mapper${loop_device///dev/}p13" + dd if=mountpoint/usr/lib/u-boot/${SUBARCH}/u-boot-sunxi-with-spl.bin of=$loader1 # Provide end-user modifyable CIDATA cidata_dev="/dev/mapper${loop_device///dev/}p12" setup_cidata "${cidata_dev}" @@ -370,8 +390,35 @@ EOF # without a cloud datasource. setup_cinocloud mountpoint ;; + "visionfive2") + echo "Installing GRUB for ${SUBARCH} board" + cp ${my_d}/riscv64/grub/90_watchdog-thresh.cfg mountpoint/etc/default/grub.d/ + # flash-kernel is needed to install the dtb for update-grub: it uses the + # /proc/device-tree/model value to pick the correct dtb and as we are in a chroot, + # the model value is wrong and we need to use /etc/flash-kernel/machine instead. + # This explains why we install flash-kernel here. + chroot mountpoint mkdir -p /etc/flash-kernel/ + chroot mountpoint bash -c "echo 'StarFive VisionFive 2 v1.3B' > /etc/flash-kernel/machine" + chroot mountpoint bash -c 'FK_FORCE=yes apt-get install -qqy grub-efi-riscv64 flash-kernel' + efi_target=riscv64-efi + # Provide end-user modifyable CIDATA + cidata_dev="/dev/mapper${loop_device///dev/}p12" + setup_cidata "${cidata_dev}" + # Provide stock nocloud datasource + # Allow interactive login on baremetal board, + # without a cloud datasource. + setup_cinocloud mountpoint + # Flash-kernel creates boot.scr if it believes we did + # not boot in UEFi mode. Remove it so that we can boot + # via GRUB. + chroot mountpoint rm -f /boot/boot.scr + ;; *) + cp ${my_d}/riscv64/grub/90_watchdog-thresh.cfg mountpoint/etc/default/grub.d/ + echo "Installing u-boot-menu for ${SUBARCH} board" chroot mountpoint apt-get install -qqy u-boot-menu #grub-efi-riscv64 + mkdir -p mountpoint/etc/u-boot-menu/conf.d/ + cp ${my_d}/riscv64/u-boot-menu/*.conf mountpoint/etc/u-boot-menu/conf.d/ efi_target=riscv64-efi chroot mountpoint u-boot-update u_boot_arch="${SUBARCH}" @@ -402,7 +449,11 @@ EOF chroot mountpoint u-boot-update fi - if [ "${SUBARCH:-}" != "visionfive" ] && [ "${SUBARCH:-}" != "nezha" ] && [ "${SUBARCH:-}" != "licheerv" ] && [ "${SUBARCH:-}" != "icicle" ]; then + if [ "${SUBARCH:-}" != "nezha" ] && \ + [ "${SUBARCH:-}" != "licheerv" ] && \ + [ "${SUBARCH:-}" != "icicle" ] \ + [ "${SUBARCH:-}" != "visionfive" ] && \ + [ "${SUBARCH:-}" != "visionfive2" ]; then ## TODO remove below once we have grub-efi-riscv64 for the platforms rm mountpoint/tmp/device.map umount mountpoint/boot/efi diff --git a/live-build/ubuntu-cpc/hooks.d/base/riscv64/grub/cmdline.cfg b/live-build/ubuntu-cpc/hooks.d/base/riscv64/grub/10_cmdline.cfg similarity index 100% rename from live-build/ubuntu-cpc/hooks.d/base/riscv64/grub/cmdline.cfg rename to live-build/ubuntu-cpc/hooks.d/base/riscv64/grub/10_cmdline.cfg diff --git a/live-build/ubuntu-cpc/hooks.d/base/riscv64/grub/90_watchdog-thresh.cfg b/live-build/ubuntu-cpc/hooks.d/base/riscv64/grub/90_watchdog-thresh.cfg new file mode 100644 index 00000000..e9988e50 --- /dev/null +++ b/live-build/ubuntu-cpc/hooks.d/base/riscv64/grub/90_watchdog-thresh.cfg @@ -0,0 +1,3 @@ +# When booting with Radeon GPUs a soft lockup was observed. Increase the +# watchdog threshhold. +GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT sysctl.kernel.watchdog_thresh=60" diff --git a/live-build/ubuntu-cpc/hooks.d/base/riscv64/u-boot-menu/10_cmdline.conf b/live-build/ubuntu-cpc/hooks.d/base/riscv64/u-boot-menu/10_cmdline.conf new file mode 100644 index 00000000..380be66e --- /dev/null +++ b/live-build/ubuntu-cpc/hooks.d/base/riscv64/u-boot-menu/10_cmdline.conf @@ -0,0 +1 @@ +U_BOOT_PARAMETERS="ro efi=debug earlycon" diff --git a/live-build/ubuntu-cpc/hooks.d/base/riscv64/u-boot-menu/90_watchdog-thresh.conf b/live-build/ubuntu-cpc/hooks.d/base/riscv64/u-boot-menu/90_watchdog-thresh.conf new file mode 100644 index 00000000..d6340d33 --- /dev/null +++ b/live-build/ubuntu-cpc/hooks.d/base/riscv64/u-boot-menu/90_watchdog-thresh.conf @@ -0,0 +1,3 @@ +# When booting with Radeon GPUs a soft lockup was observed. Increase the +# watchdog threshhold. +U_BOOT_PARAMETERS="$U_BOOT_PARAMETERS sysctl.kernel.watchdog_thresh=60" diff --git a/live-build/ubuntu-cpc/hooks.d/chroot/999-cpc-fixes.chroot b/live-build/ubuntu-cpc/hooks.d/chroot/999-cpc-fixes.chroot index 3d780e6e..9a25c0a0 100755 --- a/live-build/ubuntu-cpc/hooks.d/chroot/999-cpc-fixes.chroot +++ b/live-build/ubuntu-cpc/hooks.d/chroot/999-cpc-fixes.chroot @@ -72,7 +72,7 @@ if [ -n "${root_fs_label}" ]; then sed -i "s,^[^#${bl}]*\([${bl}]*/[${bl}].*\),${lstr}\1," "${rootd}/etc/fstab" fi cat > /etc/fstab << EOM -LABEL=cloudimg-rootfs / ext4 discard,errors=remount-ro 0 1 +LABEL=cloudimg-rootfs / ext4 discard,commit=30,errors=remount-ro 0 1 EOM # for quantal and newer, add /etc/overlayroot.local.conf diff --git a/live-build/ubuntu-mini-iso/hooks/01-mini-iso.binary b/live-build/ubuntu-mini-iso/hooks/01-mini-iso.binary new file mode 100755 index 00000000..b5d4b082 --- /dev/null +++ b/live-build/ubuntu-mini-iso/hooks/01-mini-iso.binary @@ -0,0 +1,79 @@ +#!/bin/sh + +set -eu + +case $ARCH in + amd64) + ;; + *) + exit 0 + ;; +esac + +. config/binary + +KERNEL=chroot/boot/vmlinuz +INITRD=chroot/boot/initrd.img + +mkdir -p "chroot/etc/initramfs-tools/conf.d" +cat > chroot/etc/initramfs-tools/conf.d/casperize.conf < ubuntu-mini-iso/amd64/tree/boot/grub/grub.cfg < ubuntu-mini-iso/$ARCH/tree/.disk/cd_type < ubuntu-mini-iso/$ARCH/tree/.disk/info </dev/null; then + /usr/sbin/useradd -d /home/oem -G adm,sudo -m -N -u 29999 oem + /usr/sbin/oem-config-prepare --quiet + touch "/var/lib/oem-config/run" + fi + /usr/sbin/useradd -d /home/oem -G adm,sudo -m -N -u 29999 oem /usr/sbin/oem-config-prepare --quiet touch "/var/lib/oem-config/run" - # Update the fstab to include the "discard" option, and - # "x-systemd.growfs" to ensure the root partition is expanded on first - # boot + # Update the fstab to include the "discard" option awk \ -v root_fs_label="writable" \ - -v root_fs_options="discard,x-systemd.growfs" \ + -v root_fs_options="discard" \ ' BEGIN { OFS="\t"; count=0; } @@ -51,35 +55,5 @@ if [ "$IMAGEFORMAT" == "none" ]; then } ' /etc/fstab > /etc/fstab.new mv /etc/fstab.new /etc/fstab - - # Add units for a 1GiB swapfile, generated on first boot - cat << EOF > /lib/systemd/system/mkswap.service -[Unit] -Description=Create the default swapfile -DefaultDependencies=no -Requires=local-fs.target -After=local-fs.target -Before=swapfile.swap -ConditionPathExists=!/swapfile - -[Service] -Type=oneshot -ExecStartPre=fallocate -l 1GiB /swapfile -ExecStartPre=chmod 600 /swapfile -ExecStart=mkswap /swapfile - -[Install] -WantedBy=swap.target -EOF - cat << EOF > /lib/systemd/system/swapfile.swap -[Unit] -Description=The default swapfile - -[Swap] -What=/swapfile -EOF - mkdir -p /lib/systemd/system/swap.target.wants - ln -s ../mkswap.service /lib/systemd/system/swap.target.wants/ - ln -s ../swapfile.swap /lib/systemd/system/swap.target.wants/ fi fi