diff --git a/live-build/auto/build b/live-build/auto/build index 9835dfe1..3870c865 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -89,8 +89,28 @@ PREFIX="livecd.$PROJECT${SUBARCH:+-$SUBARCH}" if [ "${IMAGEFORMAT:-}" = "ubuntu-image" ]; then # Use ubuntu-image instead of live-build - export SNAPPY_STORE_NO_CDN=1 - snap install --classic --channel=beta/classic-image-redesign ubuntu-image + #export SNAPPY_STORE_NO_CDN=1 + #snap install --classic --channel=candidate ubuntu-image + + wget http://cdimage.ubuntu.com/ubuntu-base/daily/current/mantic-base-amd64.tar.gz + mkdir base + tar -C base -zxf mantic-base-amd64.tar.gz + cp /etc/resolv.conf base/etc/ + mkdir -p base/sys/kernel/security + mkdir -p base/sys/fs/cgroup + mount --bind /dev base/dev + mount --bind /proc base/proc + mount --bind /sys/kernel/security base/sys/kernel/security + mount --bind /sys/fs/cgroup/ base/sys/fs/cgroup + chroot base apt update + chroot base apt install -y snapd + chroot base snap download snapd + chroot base mount -t fuse.snapfuse -o ro,x-gdu.hide,x-gvfs-hide,allow_other snapd_19122.snap mnt/ + chroot base ls mnt/ + + echo "We got here" + + exit 0 # TODO: eventually, this should be handled by a single ubuntu-image # call without having to do a conditional on ubuntu-core/classic. @@ -106,7 +126,7 @@ if [ "${IMAGEFORMAT:-}" = "ubuntu-image" ]; then xz -0 -T4 "$PREFIX".img mv output/seed.manifest "$PREFIX".manifest else - ubuntu-image --debug classic $UBUNTU_IMAGE_ARGS \ + ubuntu-image classic $UBUNTU_IMAGE_ARGS --debug \ -O output "$PREFIX".yaml # Since the output of the ubuntu-image call can vary based on what # kind of an image we build, the safest bet is to 'export' all the @@ -351,7 +371,7 @@ EOF fi if [ -d chroot/etc/apt/preferences.d.save ]; then - # https://twitter.com/infinite_scream + # https://mastodon.social/@scream@botsin.space mv chroot/etc/apt/preferences.d.save/* chroot/etc/apt/preferences.d/ rmdir chroot/etc/apt/preferences.d.save fi @@ -502,7 +522,7 @@ EOF # 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) + ubuntu|xubuntu|kubuntu|ubuntu-budgie|ubuntukylin|ubuntu-mate|ubuntucinnamon|ubuntu-unity|edubuntu) rm -f chroot/var/lib/apt/lists/*ubuntu.com*_Packages ;; esac diff --git a/live-build/auto/config b/live-build/auto/config index 553a5314..01646dfa 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/ @@ -36,6 +36,7 @@ mkdir -p config cp -af /usr/share/livecd-rootfs/live-build/functions config/functions cp -af /usr/share/livecd-rootfs/live-build/lb_*_layered config/ cp -af /usr/share/livecd-rootfs/live-build/snap-seed-parse.py config/snap-seed-parse +cp -af /usr/share/livecd-rootfs/live-build/expand-task config/expand-task cp -af /usr/share/livecd-rootfs/live-build/squashfs-exclude-files config/ mkdir -p config/package-lists @@ -95,59 +96,47 @@ _register_pass () { PASSES="$PASSES $1" } +add_pass () +{ + local pass="$1" + _check_immutable_passes_to_layers + _register_pass "$pass" +} + add_task () { local pass="$1" shift - local task - local snap_list_file - local snap_list_files - local curseed + local file pkg_file snap_file task _check_immutable_passes_to_layers _register_pass "$pass" - # The removal of direct task installation support from live-build - # poses some problems. If the chroot has multiarch configured - for - # example, if we're building for amd64 - then dumpavail will show - # foreign-architecture packages which will have their own Task - # lines, but which we don't want to install. (Compare - # PackageContainerInterface::FromTask in apt, which restricts task - # expansion to the native architecture.) We therefore restrict our - # search to stanzas with Architecture: $ARCH or all. - # - # However, even this may not be accurate enough. At the moment I - # have no idea what happens if an Architecture: all package has - # different Task fields on different architectures. This is - # probably a lurking timebomb that we need to fix. In the meantime, - # the Architecture restriction at least saves us from abject - # failure. - # - # We want as well to grab the snap list for each PASS. Resolve for all - # given task, and deduplicate them to generate snaps for the PASS. + if [ ! -e config/germinate-output/structure ]; then + echo "add_task too soon" >&2 + exit 1 + fi + + pkg_file="config/package-lists/livecd-rootfs.list.chroot_$pass" + + if [ $PASSES_TO_LAYERS = "true" ]; then + snap_file="config/package-lists/livecd-rootfs.snaplist.chroot_$pass.full" + else + snap_file="config/seeded-snaps" + fi for task; do - # We need a ridiculous number of backslashes to protect - # parentheses from eval. - echo "!chroot chroot apt-cache dumpavail | grep-dctrl -nsPackage \\\\\\( -XFArchitecture $ARCH -o -XFArchitecture all \\\\\\) -a -wFTask $task" >> "config/package-lists/livecd-rootfs.list.chroot_$pass" - - curseed=$(seed_from_task ${task}) - if [ -z "${curseed}" ]; then - echo "W: No seed matching task ${task}" - continue - fi - snap_list_file="config/package-lists/seed.${curseed}.snaplist.full" - snap_from_seed "${curseed}" $snap_list_file - if [ -e "$snap_list_file" ]; then - snap_list_files="${snap_list_files} $snap_list_file" + ./config/expand-task config/germinate-output $FLAVOUR $task packages >> "$pkg_file" + ./config/expand-task config/germinate-output $FLAVOUR $task snaps >> "$snap_file" + done + + for file in $pkg_file $snap_file; do + if [ -s $file ]; then + sort -u -o $file $file + else + rm -f $file fi done - # The snap list is one line, and could be duplicated between seeds via inheritance. - # Uniquely sort them and store them back in one line. - if [ -n "${snap_list_files}" ]; then - cat ${snap_list_files}|xargs -n1|sort -u > "config/package-lists/livecd-rootfs.snaplist.chroot_${pass}.full" - rm ${snap_list_files} - fi } add_package () @@ -343,15 +332,32 @@ if [ -z "${IMAGEFORMAT:-}" ]; then ;; esac ;; - ubuntu-base:*) - IMAGEFORMAT=ubuntu-image - ;; 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 @@ -481,6 +487,7 @@ case $IMAGEFORMAT in for snap in $EXTRA_SNAPS; do UBUNTU_IMAGE_ARGS="$UBUNTU_IMAGE_ARGS --extra-snaps $snap" done + echo "IMAGEFORMAT=$IMAGEFORMAT" >> config/common echo "UBUNTU_IMAGE_ARGS=\"$UBUNTU_IMAGE_ARGS\"" >> config/common # Store model assertion in top dir to get it picked up later as a build artifact env SNAPPY_STORE_NO_CDN=1 snap known --remote model series=16 model="$MODEL" brand-id=canonical > "$PREFIX".model-assertion @@ -503,9 +510,7 @@ case $IMAGEFORMAT in # Save the model name used for building, mostly for any model-specific hook execution echo "MODEL=$MODEL" >> config/common - # Inform auto/build that we're using ubuntu-image echo "IMAGEFORMAT=$IMAGEFORMAT" >> config/common - # Fake finished configuration for lb build mkdir -p .build touch .build/config @@ -595,35 +600,38 @@ fi mkdir -p config/germinate-output case $PROJECT in + edubuntu*) + FLAVOUR=edubuntu + ;; kubuntu*) - SEED=kubuntu.$SUITE + FLAVOUR=kubuntu ;; xubuntu*) - SEED=xubuntu.$SUITE + FLAVOUR=xubuntu ;; ubuntu-mate*) - SEED=ubuntu-mate.$SUITE + FLAVOUR=ubuntu-mate ;; ubuntu-unity*) - SEED=ubuntu-unity.$SUITE + FLAVOUR=ubuntu-unity ;; lubuntu*) - SEED=lubuntu.$SUITE + FLAVOUR=lubuntu ;; ubuntu-budgie*) - SEED=ubuntu-budgie.$SUITE + FLAVOUR=ubuntu-budgie ;; ubuntukylin*) - SEED=ubuntukylin.$SUITE + FLAVOUR=ubuntukylin ;; ubuntustudio*) - SEED=ubuntustudio.$SUITE + FLAVOUR=ubuntustudio ;; ubuntucinnamon*) - SEED=ubuntucinnamon.$SUITE + FLAVOUR=ubuntucinnamon ;; *) - SEED=ubuntu.$SUITE + FLAVOUR=ubuntu ;; esac @@ -651,7 +659,7 @@ if ! [ -e config/germinate-output/structure ]; then GERMINATE_ARG="-c $(echo $COMPONENTS | sed -e's/ \+/,/g')" fi (cd config/germinate-output && germinate --no-rdepends --no-installer \ - -S $SEEDMIRROR -m $MIRROR -d $SUITE -s $SEED \ + -S $SEEDMIRROR -m $MIRROR -d $SUITE -s $FLAVOUR.$SUITE \ $GERMINATE_ARG -a $ARCH) fi @@ -695,6 +703,66 @@ case $PROJECT in ;; esac ;; + canary) + PASSES_TO_LAYERS="true" + # the minimal layer, for minimal installs + add_task minimal minimal standard ubuntu-desktop-minimal ubuntu-desktop-minimal-default-languages + add_package minimal cloud-init + # the standard layer, contains all base common packages for later layers (we're splitting out the snaps) + add_task minimal.standard ubuntu-desktop ubuntu-desktop-default-languages + # the classic layer, basically only contains snaps from the standard and minimal tasks + add_pass minimal.standard.classic + if [ -e "config/package-lists/livecd-rootfs.snaplist.chroot_minimal.full" ]; then + cat config/package-lists/livecd-rootfs.snaplist.chroot_minimal.full >>config/package-lists/livecd-rootfs.snaplist.chroot_minimal.standard.classic.full + rm config/package-lists/livecd-rootfs.snaplist.chroot_minimal.full + fi + if [ -e "config/package-lists/livecd-rootfs.snaplist.chroot_minimal.standard.full" ]; then + cat config/package-lists/livecd-rootfs.snaplist.chroot_minimal.standard.full >>config/package-lists/livecd-rootfs.snaplist.chroot_minimal.standard.classic.full + rm config/package-lists/livecd-rootfs.snaplist.chroot_minimal.standard.full + fi + # the live layer, contains all packages for the live session installer + # TODO: we should probably add the kernel per KERNEL_FLAVOURS + add_package minimal.standard.live linux-generic casper lvm2 mdadm cryptsetup + remove_package minimal.standard.live ubiquity-frontend-gtk + # the enhanced-secureboot layer, contains all packages for the enhanced secureboot install + add_package minimal.standard.enhanced-secureboot cryptsetup + # now let's create the neccessary catalog files + # TODO: make sure that we handle locale_support: langpack correctly + cat <<-EOF > config/minimal.catalog-in.yaml + name: "Ubuntu Desktop (minimized)" + description: >- + A minimal but usable Ubuntu Desktop. + id: ubuntu-desktop-minimal + type: fsimage-layered + variant: desktop + locale_support: none + EOF + cat <<-EOF > config/minimal.standard.catalog-in.yaml + name: "Ubuntu Desktop" + description: >- + A full featured Ubuntu Desktop. + id: ubuntu-desktop + type: fsimage-layered + variant: desktop + locale_support: none + default: yes + EOF + cat <<-EOF > config/minimal.standard.classic.catalog-in.yaml + id: ubuntu-desktop + variations: + classic: + path: minimal.standard.squashfs + EOF + cat <<-EOF > config/minimal.standard.enhanced-secureboot.catalog-in.yaml + id: ubuntu-desktop + variations: + enhanced-secureboot: + path: minimal.standard.enhanced-secureboot.squashfs + snapd_system_label: enhanced-secureboot-desktop + EOF + /usr/share/livecd-rootfs/checkout-translations-branch \ + https://git.launchpad.net/subiquity po config/catalog-translations + ;; *) touch config/universe-enabled PASSES_TO_LAYERS="true" @@ -754,13 +822,12 @@ case $PROJECT in ;; edubuntu) - add_task install minimal standard ubuntu-desktop-minimal edubuntu-desktop-gnome + add_task install minimal standard edubuntu-desktop-gnome LIVE_TASK='edubuntu-live' ;; ubuntucinnamon) - add_task install minimal standard - add_package install ubuntucinnamon-desktop + add_task install minimal standard 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 @@ -822,8 +889,7 @@ case $PROJECT in ;; ubuntu-unity) - add_task install minimal standard - add_package install ubuntu-unity-desktop + add_task install minimal standard ubuntu-unity-desktop # XXX: Adding live packages manually temporarily until we have # the live task for ubuntu-unity set up properly. add_package live metacity ubiquity-frontend-gtk @@ -854,8 +920,6 @@ case $PROJECT in add_task ubuntu-server-minimal server-minimal add_package ubuntu-server-minimal lxd-installer add_task ubuntu-server-minimal.ubuntu-server minimal standard server - # add_task really should do this itself but for now... - snap_from_seed server config/package-lists/livecd-rootfs.snaplist.chroot_ubuntu-server-minimal.ubuntu-server.full add_package ubuntu-server-minimal.ubuntu-server cloud-init add_package ubuntu-server-minimal.ubuntu-server.installer linux-firmware casper openssh-server @@ -872,6 +936,9 @@ case $PROJECT in intel-iot) variants='intel' ;; + tegra) + variants='tegra' + ;; *) # variants='ga hwe' variants='ga' @@ -888,6 +955,9 @@ case $PROJECT in elif [ "$variant" = "intel" ]; then kernel_metapkg=linux-intel-iotg flavor=intel-iotg + elif [ "$variant" = "tegra" ]; then + kernel_metapkg=linux-nvidia-tegra + flavor=nvidia-tegra else echo "bogus variant: $variant" exit 1 @@ -1071,31 +1141,24 @@ case $PROJECT:${SUBPROJECT:-} in ;; xubuntu:minimal) ;; + edubuntu:*) + BASE_SEED='desktop-gnome' + ;; *) BASE_SEED='desktop' ;; esac -if [ "$PASSES_TO_LAYERS" != "true" ] && [ -n "${BASE_SEED}" ]; then - snap_from_seed "${BASE_SEED}" config/seeded-snaps -fi if [ "$PROJECT:${SUBPROJECT:-}" = ubuntu-cpc:minimized ]; then - # We install a lxc script that installs the snap when invoked. We don't - # want any other snaps to come in without due consideration, so fail the - # build if we see such a snap. - for snap in `cat config/seeded-snaps`; do - case $snap in - lxd | lxd=*) - ;; - *) - echo "Unexpected seeded snap for ubuntu-cpc:minimized build: $snap" - exit 1 - ;; - esac - done + # We install a lxc script that installs the snap when invoked and + # don't want any other snaps. + if [ -s config/seeded-snaps ]; then + echo "Unexpected seeded snaps for ubuntu-cpc:minimized build:" + cat config/seeded-snaps + exit 1 + fi - # Truncate but don't delete to a) prevent any snaps from being seeded, - # while at the same time b) triggering initialization of assertions. + # Create an empty file to trigger initialization of assertions. truncate --size 0 config/seeded-snaps fi @@ -1140,6 +1203,11 @@ case "$ARCH${SUBARCH:++$SUBARCH}" in add_package install linux-firmware-raspi pi-bluetooth u-boot-rpi u-boot-tools BINARY_REMOVE_LINUX=false ;; + arm64+tegra) + # Common configuration for all NVIDIA Tegra image variants (server, + # desktop etc.) + KERNEL_FLAVOURS="nvidia-$SUBARCH" + ;; riscv*+*) if [ "${SUBARCH:-}" = "licheerv" ]; then # The wifi driver of the licheerv is an out-of-tree driver packaged @@ -1153,7 +1221,7 @@ case "$ARCH${SUBARCH:++$SUBARCH}" in esac case $PROJECT:${SUBPROJECT:-} in - ubuntu-server:*|ubuntu-base:*|ubuntu-oci:*) + ubuntu-server:*|ubuntu-base:*|ubuntu-oci:*|ubuntu:canary) OPTS="${OPTS:+$OPTS }--linux-packages=none --initramfs=none" KERNEL_FLAVOURS=none BINARY_REMOVE_LINUX=false @@ -1379,6 +1447,14 @@ deb $LB_PARENT_MIRROR_BINARY_VOLATILE $SUITE-proposed $LB_PARENT_ARCHIVE_AREAS EOF cp -a config/archives/proposed.list.chroot \ config/archives/proposed.list.binary + + mkdir -p config/chroot_apt/ + cat > config/chroot_apt/proposed.pref <