diff --git a/debian/changelog b/debian/changelog index 190ab7e8..da5fcb8b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,37 @@ +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 diff --git a/debian/control b/debian/control index d1d6ee66..e784364a 100644 --- a/debian/control +++ b/debian/control @@ -40,6 +40,7 @@ Depends: ${misc:Depends}, u-boot-tools [armhf arm64], ubuntu-image [!i386 !riscv64], python3-vmdkstream [amd64 i386], + xorriso [!i386], xz-utils, zerofree Breaks: ubuntu-defaults-builder (<< 0.32) diff --git a/live-build/apparmor/generic/ipc/posix_mqueue b/live-build/apparmor/generic/ipc/posix_mqueue deleted file mode 100644 index c20f9f93..00000000 --- a/live-build/apparmor/generic/ipc/posix_mqueue +++ /dev/null @@ -1 +0,0 @@ -create read write open delete setattr getattr diff --git a/live-build/auto/build b/live-build/auto/build index 83324c25..ddbb7332 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -607,6 +607,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 54510c73..1f812180 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -342,7 +342,7 @@ if [ -z "${IMAGEFORMAT:-}" ]; then ;; esac ;; - ubuntu-server:live) + ubuntu-server:live|ubuntu-mini-iso:) IMAGEFORMAT=plain ;; esac @@ -377,6 +377,8 @@ case $IMAGEFORMAT in ubuntu-server:live) touch config/universe-enabled ;; + ubuntu-mini-iso:) + ;; *) PREINSTALLED=true ;; @@ -591,7 +593,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 @@ -655,7 +657,7 @@ case $PROJECT in esac case $PROJECT in - ubuntu-server) + ubuntu-server|ubuntu-mini-iso) COMPONENTS='main' ;; kubuntu|kubuntu-dvd|kubuntu-plasma5|edubuntu|ubuntu-gnome|ubuntu-budgie|ubuntukylin|ubuntucinnamon) @@ -692,7 +694,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) @@ -710,7 +712,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" @@ -895,9 +897,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 @@ -906,6 +914,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 @@ -938,6 +949,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" ;; @@ -989,7 +1019,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 ;; @@ -1064,7 +1094,7 @@ case $PROJECT:${SUBPROJECT:-} in ubuntu-server:live) BASE_SEED='server' ;; - ubuntu-base:*|ubuntu-core:*) + ubuntu-base:*|ubuntu-core:*|ubuntu-mini-iso:) ;; ubuntu-oci:*) ;; @@ -1175,7 +1205,7 @@ case $PROJECT in KERNEL_FLAVOURS="${SUBARCH:-$KERNEL_FLAVOURS}" case $SUBARCH in intel-iot) - KERNEL_FLAVOURS='image-intel' + KERNEL_FLAVOURS='intel-iotg' ;; esac ;; @@ -1237,7 +1267,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 ;; @@ -1396,7 +1426,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..e1f00005 100644 --- a/live-build/functions +++ b/live-build/functions @@ -1006,6 +1006,27 @@ 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 +# Let NetworkManager manage all devices on this system +system_info: + network: + renderers: ['network-manager'] + activators: ['network-manager'] +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-mini-iso/hooks/01-mini-iso.binary b/live-build/ubuntu-mini-iso/hooks/01-mini-iso.binary new file mode 100755 index 00000000..6e857f9c --- /dev/null +++ b/live-build/ubuntu-mini-iso/hooks/01-mini-iso.binary @@ -0,0 +1,77 @@ +#!/bin/sh + +set -eu + +case $ARCH in + amd64) + ;; + *) + exit 0 + ;; +esac + +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 <