Add ubuntu-mini-iso project

ui-by-default-wip
Dan Bungert 2 years ago
parent f53e528de9
commit 0d61fce909

6
debian/changelog vendored

@ -1,3 +1,9 @@
livecd-rootfs (2.810) lunar; urgency=medium
* Add ubuntu-mini-iso build project.
-- Dan Bungert <daniel.bungert@canonical.com> Mon, 06 Mar 2023 08:17:11 -0700
livecd-rootfs (2.809) lunar; urgency=medium livecd-rootfs (2.809) lunar; urgency=medium
* Do not use the ubuntucinnamon-desktop task for cinnamon builds, it doesn't * Do not use the ubuntucinnamon-desktop task for cinnamon builds, it doesn't

1
debian/control vendored

@ -40,6 +40,7 @@ Depends: ${misc:Depends},
u-boot-tools [armhf arm64], u-boot-tools [armhf arm64],
ubuntu-image [!i386 !riscv64], ubuntu-image [!i386 !riscv64],
python3-vmdkstream [amd64 i386], python3-vmdkstream [amd64 i386],
xorriso,
xz-utils, xz-utils,
zerofree zerofree
Breaks: ubuntu-defaults-builder (<< 0.32) Breaks: ubuntu-defaults-builder (<< 0.32)

@ -342,7 +342,7 @@ if [ -z "${IMAGEFORMAT:-}" ]; then
;; ;;
esac esac
;; ;;
ubuntu-server:live) ubuntu-server:live|ubuntu-mini-iso:)
IMAGEFORMAT=plain IMAGEFORMAT=plain
;; ;;
esac esac
@ -377,6 +377,8 @@ case $IMAGEFORMAT in
ubuntu-server:live) ubuntu-server:live)
touch config/universe-enabled touch config/universe-enabled
;; ;;
ubuntu-mini-iso:)
;;
*) *)
PREINSTALLED=true PREINSTALLED=true
;; ;;
@ -591,7 +593,7 @@ if [ "$PREINSTALLED" = "true" ]; then
ubuntu-server) ubuntu-server)
add_package live oem-config-debconf ubiquity-frontend-debconf 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) ubuntu)
add_package live oem-config-gtk ubiquity-frontend-gtk add_package live oem-config-gtk ubiquity-frontend-gtk
@ -655,7 +657,7 @@ case $PROJECT in
esac esac
case $PROJECT in case $PROJECT in
ubuntu-server) ubuntu-server|ubuntu-mini-iso)
COMPONENTS='main' COMPONENTS='main'
;; ;;
kubuntu|kubuntu-dvd|kubuntu-plasma5|edubuntu|ubuntu-gnome|ubuntu-budgie|ubuntukylin|ubuntucinnamon) kubuntu|kubuntu-dvd|kubuntu-plasma5|edubuntu|ubuntu-gnome|ubuntu-budgie|ubuntukylin|ubuntucinnamon)
@ -938,6 +940,25 @@ case $PROJECT in
PREINSTALL_POOL_SEEDS='server-ship' 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) ubuntu-base)
OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal" OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal"
;; ;;
@ -1064,7 +1085,7 @@ case $PROJECT:${SUBPROJECT:-} in
ubuntu-server:live) ubuntu-server:live)
BASE_SEED='server' BASE_SEED='server'
;; ;;
ubuntu-base:*|ubuntu-core:*) ubuntu-base:*|ubuntu-core:*|ubuntu-mini-iso:)
;; ;;
ubuntu-oci:*) ubuntu-oci:*)
;; ;;
@ -1237,7 +1258,7 @@ if [ "${IMAGE_HAS_HARDCODED_PASSWORD:-}" = "1" ]; then
fi fi
case $PROJECT in 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 # ubuntu-cpc gets this added in 025-create-groups.chroot, and we do
# not want this group in projects that are effectively just chroots # not want this group in projects that are effectively just chroots
;; ;;
@ -1396,7 +1417,7 @@ EOF
fi 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 # Ensure that most things e.g. includes.chroot are copied as is
for entry in /usr/share/livecd-rootfs/live-build/${PROJECT}/*; do for entry in /usr/share/livecd-rootfs/live-build/${PROJECT}/*; do
case $entry in case $entry in

@ -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 <<EOF
export CASPER_GENERATE_UUID=1
EOF
chroot chroot update-initramfs -u
case $ARCH in
amd64)
mkdir -p "ubuntu-mini-iso/amd64"
cp -a chroot/usr/share/cd-boot-images-amd64/tree ubuntu-mini-iso/amd64/tree
cp -a chroot/usr/share/cd-boot-images-amd64/images ubuntu-mini-iso/amd64/images
mkdir -p "ubuntu-mini-iso/amd64/tree/casper"
cp "$KERNEL" ubuntu-mini-iso/amd64/tree/casper/vmlinuz
cp "$INITRD" ubuntu-mini-iso/amd64/tree/casper/initrd
mkdir -p "ubuntu-mini-iso/amd64/tree/boot/grub"
cat > ubuntu-mini-iso/amd64/tree/boot/grub/grub.cfg <<EOF
menuentry "Choose an Ubuntu version to install" {
set gfxpayload=keep
linux /casper/vmlinuz iso-chooser-menu ip=dhcp ---
initrd /casper/initrd
}
EOF
;;
esac
mkdir -p ubuntu-mini-iso/$ARCH/tree/.disk
touch ubuntu-mini-iso/$ARCH/tree/.disk/base_installable
tmpdir=$(mktemp -d)
unmkinitramfs $INITRD $tmpdir
if [ -e "$tmpdir/main/conf/uuid.conf" ]; then
uuid_conf="$tmpdir/main/conf/uuid.conf"
elif [ -e "$tmpdir/conf/uuid.conf" ]; then
uuid_conf="$tmpdir/conf/uuid.conf"
else
echo "uuid.conf not found"
exit 1
fi
cp "$uuid_conf" ubuntu-mini-iso/$ARCH/tree/.disk/casper-uuid-generic
rm -fr $tmpdir
cat > ubuntu-mini-iso/$ARCH/tree/.disk/cd_type <<EOF
full_cd/single
EOF
version=$(distro-info --fullname --series=$SUITE \
| sed s'/^Ubuntu/ubuntu-mini-iso/')
cat > ubuntu-mini-iso/$ARCH/tree/.disk/info <<EOF
$version - $ARCH ($NOW)
EOF
dest="${PWD}/livecd.${PROJECT}.ubuntu-mini.iso"
xorriso="$(cat chroot/usr/share/cd-boot-images-amd64/xorriso-cmd.txt)"
cd ubuntu-mini-iso/$ARCH
$xorriso -o $dest
cd ../..
rm -rf ubuntu-mini-iso
Loading…
Cancel
Save