[Merge] lp:~mwhudson/livecd-rootfs/live-server-kernel-futzing into lp:livecd-rootfs
Steve Langasek
steve.langasek at canonical.com
Fri Nov 30 01:29:16 UTC 2018
Diff comments:
>
> === added file 'live-build/ubuntu-server/hooks/033-kernel-bits.binary'
> --- live-build/ubuntu-server/hooks/033-kernel-bits.binary 1970-01-01 00:00:00 +0000
> +++ live-build/ubuntu-server/hooks/033-kernel-bits.binary 2018-11-30 01:14:53 +0000
> @@ -0,0 +1,83 @@
> +#!/bin/bash -ex
> +# vi: ts=4 noexpandtab
> +#
> +# Generate a squashfs root and manifest
> +
> +set -x
> +
> +echo "033-kernel-bits.binary"
> +
> +case $IMAGE_TARGETS in
> + ""|*squashfs*)
> + ;;
> + *)
> + echo "Skipping squashfs build"
> + exit 0
> + ;;
> +esac
> +
> +if [ -n "$SUBARCH" ]; then
> + echo "Skipping rootfs build for subarch flavor build"
> + exit 0
> +fi
> +
> +. config/functions
> +. config/common
> +
> +filesystem_squashfs_f="${PWD}/livecd.${PROJECT}.filesystem.squashfs"
> +installer_squashfs_f="${PWD}/livecd.${PROJECT}.installer.squashfs"
> +
> +# suffix can be -hwe for an LTS's .2 and later releases.
> +for suffix in ''; do
> + if [ -n "${suffix}" ]; do
> + metapkg=linux-generic-${suffix}-$(lsb_release -sr)
I wouldn't use lsb_release -sr here, but instead define the suffix list to '' '-hwe-18.04' (or so).
Possibly remove this if/else entirely in favor of:
metapkg=linux-generic$suffix
that also removes the shell syntax error.
> + else
> + metapkg=linux-generic
> + done
> +
> + KERNEL_BITS_ROOT=binary/boot/kernel-bits.dir
> + KERNEL_BITS_OVERLAY=binary/boot/overlay-kernel-bits
> +
> + mkdir -p $KERNEL_BITS_ROOT
> + mkdir -p $KERNEL_BITS_OVERLAY
> +
> + # in overlayfs lowerdir are mounted right to left, colon separated
> + mount_overlay "$installer_squashfs_f:$filesystem_squashfs_f" "$KERNEL_BITS_OVERLAY/" "$KERNEL_BITS_ROOT/"
> +
> + setup_mountpoint $KERNEL_BITS_ROOT
> +
> + if [ -n "$LB_INITRAMFS_COMPRESSION" ]; then
> + echo "COMPRESS=$LB_INITRAMFS_COMPRESSION" > "$KERNEL_BITS_ROOT"/etc/initramfs-tools/conf.d/livecd-rootfs.conf
> + fi
> + echo "CASPER_GENERATE_UUID=1" > "$KERNEL_BITS_ROOT"/etc/initramfs-tools/conf.d/casper.conf
> +
> + cat <<EOF > "$KERNEL_BITS_ROOT"/etc/initramfs-tools/scripts/init-bottom/live-server
> +#!/bin/sh
> +case \$1 in
> +prereqs)
> + echo ""
> + exit 0
> + ;;
> +esac
> +
> +echo ${metapkg} > /run/kernel-meta-package
> +mkdir -p /lib/modules
> +mount \$rootmnt/casper/modules${suffix}.squashfs /lib/modules
ah, here's the other use of $suffix that's incompatible with what I suggested above. Could we reasonably call this /casper/modules-hwe-18.04.squashfs instead of /casper/modules-hwe.squashfs? (which is what I assume you meant, despite the missing '-' here)
> +EOF
> + chmod +x "$KERNEL_BITS_ROOT"/etc/initramfs-tools/scripts/init-bottom/live-server
> +
> + env DEBIAN_FRONTEND=noninteractive chroot $KERNEL_BITS_ROOT apt-get -y install ${metapkg}
> +
> + mv "$KERNEL_BITS_ROOT"/boot/initrd.img-* ${PWD}/livecd.${PROJECT}.initrd-generic${suffix}
> + mv "$KERNEL_BITS_ROOT"/boot/vmlinu?-* ${PWD}/livecd.${PROJECT}.kernel-generic${suffix}
> +
> + modules_squashfs_f="${PWD}/livecd.${PROJECT}.modules${suffix}.squashfs"
> +
> + (cd "$KERNEL_BITS_ROOT/lib/modules" &&
> + mksquashfs . ${modules_squashfs_f} \
> + -no-progress -xattrs -comp xz )
> +
> + teardown_mountpoint $KERNEL_BITS_ROOT
> +
> + rm -rf $KERNEL_BITS_ROOT $KERNEL_BITS_OVERLAY
> +done
--
https://code.launchpad.net/~mwhudson/livecd-rootfs/live-server-kernel-futzing/+merge/359880
Your team Ubuntu Core Development Team is requested to review the proposed merge of lp:~mwhudson/livecd-rootfs/live-server-kernel-futzing into lp:livecd-rootfs.
More information about the Ubuntu-reviews
mailing list