From 92b0d8c50265bb9a3ef16d51a84bf81f7beca842 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 14 Nov 2014 13:06:19 +0100 Subject: [PATCH] Import patches-unapplied version 2.267 to ubuntu/vivid-proposed Imported using git-ubuntu import. Changelog parent: 50aa7ff1c2c14ba7e453dcae26a7a68170d009fc New changelog entries: * live-build/auto/config: - system-image: do not install ubuntu-minimal - system-image: install KERNEL_FLAVOURS=virtual on i386/amd64 - system-image: use "--linux-packages=linux-image" - add click-hook-framework * live-build/auto/build: - system-image: collect the deivce.tar.gz * live-build/ubuntu-core/hooks/09-move-kernel-to-device-tar.binary: - create a device.tar.gz from the installed kernel/modules and remove it from the rootfs * live-build/ubuntu-core/hooks/10-remove-documentation.binary: - strip documentation * live-build/ubuntu-core/hooks/11-remove-extra-packages.chroot: - remove extra packages like libicu52/libqt that are still on the image because vivid system-image has a dependency on u-d-m which depends on libqt * live-build/ubuntu-core/hooks/12-add-docker-user.chroot: - add a docker user/group into the image (this can go once we have a hook for this) --- debian/changelog | 24 +++++++++++++++++++ live-build/auto/build | 10 ++++++++ live-build/auto/config | 16 +++++++++---- .../hooks/09-move-kernel-to-device-tar.binary | 21 ++++++++++++++++ .../hooks/10-remove-documentation.binary | 21 ++++++++++++++++ .../hooks/11-remove-extra-packages.chroot | 9 +++++++ .../hooks/12-add-docker-user.chroot | 16 +++++++++++++ 7 files changed, 113 insertions(+), 4 deletions(-) create mode 100644 live-build/ubuntu-core/hooks/09-move-kernel-to-device-tar.binary create mode 100644 live-build/ubuntu-core/hooks/10-remove-documentation.binary create mode 100644 live-build/ubuntu-core/hooks/11-remove-extra-packages.chroot create mode 100644 live-build/ubuntu-core/hooks/12-add-docker-user.chroot diff --git a/debian/changelog b/debian/changelog index 1e2d89b9..88257a12 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,27 @@ +livecd-rootfs (2.267) vivid; urgency=low + + * live-build/auto/config: + - system-image: do not install ubuntu-minimal + - system-image: install KERNEL_FLAVOURS=virtual on i386/amd64 + - system-image: use "--linux-packages=linux-image" + - add click-hook-framework + * live-build/auto/build: + - system-image: collect the deivce.tar.gz + * live-build/ubuntu-core/hooks/09-move-kernel-to-device-tar.binary: + - create a device.tar.gz from the installed kernel/modules and + remove it from the rootfs + * live-build/ubuntu-core/hooks/10-remove-documentation.binary: + - strip documentation + * live-build/ubuntu-core/hooks/11-remove-extra-packages.chroot: + - remove extra packages like libicu52/libqt that are still on the + image because vivid system-image has a dependency on u-d-m which + depends on libqt + * live-build/ubuntu-core/hooks/12-add-docker-user.chroot: + - add a docker user/group into the image (this can go once we have + a hook for this) + + -- Michael Vogt Fri, 14 Nov 2014 13:06:19 +0100 + livecd-rootfs (2.266) vivid; urgency=medium * Move the shorts click package to the custom tarball. LP: #1386177. diff --git a/live-build/auto/build b/live-build/auto/build index 0d79b5c7..e75c2149 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -317,6 +317,16 @@ if [ -e "binary/$INITFS/filesystem.packages-remove" ]; then fi fi +# ubuntu-core splits kernel stuff into a "device" tarball so at this point +# we reset it to "none" as all the work to extract it was done already +# in a binary hook +if [ "$PROJECT" = "ubuntu-core" ] && [ "$SUBPROJECT" = "system-image" ]; then + LB_LINUX_FLAVOURS=none + + # rename to have the right prefix etc + mv device.tar.gz "$PREFIX.device.tar.gz" +fi + for FLAVOUR in $LB_LINUX_FLAVOURS; do if [ -z "$LB_LINUX_FLAVOURS" ] || [ "$LB_LINUX_FLAVOURS" = "none" ]; then continue diff --git a/live-build/auto/config b/live-build/auto/config index 25c5a686..89999705 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -335,30 +335,38 @@ case $PROJECT in ;; ubuntu-core) - add_task install minimal # mvo: This is for cron.daily-preinstalled # CDIMAGE_PREINSTALLED is not passed from build.py # and PREINSTALLED means something different. So # we use SUBPROJECT to pass on the information if [ "$SUBPROJECT" = "system-image" ]; then OPTS="${OPTS:+$OPTS }--apt-recommends false" + + # no minimal as we want to be really minimal + #add_task install minimal add_task install ubuntu-core + # only available in the PPA right now + add_package install click-hook-framework + # some workarounds because the seeds are not quite # corrent at the moment add_package install dbus add_package install libpam-systemd + add_package install isc-dhcp-client + add_package install resolvconf + case $ARCH in i386|amd64) add_package install grub-pc + KERNEL_FLAVOURS=virtual ;; armhf) add_package install flash-kernel u-boot-tools + KERNEL_FLAVOURS=generic ;; esac - - # generic kernel on amd64/arm for now - KERNEL_FLAVOURS=generic + OPTS="${OPTS:+$OPTS }--linux-packages=linux-image" # contains the framework definition add_package install ubuntu-core-libs diff --git a/live-build/ubuntu-core/hooks/09-move-kernel-to-device-tar.binary b/live-build/ubuntu-core/hooks/09-move-kernel-to-device-tar.binary new file mode 100644 index 00000000..5b68561d --- /dev/null +++ b/live-build/ubuntu-core/hooks/09-move-kernel-to-device-tar.binary @@ -0,0 +1,21 @@ +#!/bin/sh + +set -e + +echo "Moving kernel into device tarball" + +# remove the kernel, its part of the bootimg +HERE=$(pwd) +(cd binary/boot/filesystem.dir && \ + tar czf $HERE/device.tar.gz \ + boot/vmlinu?-* \ + boot/initrd.img-* \ + vmlinu? \ + initrd.img \ + lib/modules/ ) + +rm -f binary/boot/filesystem.dir/boot/vmlinu?-* +rm -f binary/boot/filesystem.dir/boot/initrd.img-* +rm -f binary/boot/filesystem.dir/initrd.img +rm -f binary/boot/filesystem.dir/vmlinu? +rm -rf binary/boot/filesystem.dir/lib/modules diff --git a/live-build/ubuntu-core/hooks/10-remove-documentation.binary b/live-build/ubuntu-core/hooks/10-remove-documentation.binary new file mode 100644 index 00000000..7116002d --- /dev/null +++ b/live-build/ubuntu-core/hooks/10-remove-documentation.binary @@ -0,0 +1,21 @@ +#!/bin/sh -x + +echo "I: Remove unneeded files from /usr/share/doc " +find binary/boot/filesystem.dir/usr/share/doc -depth -type f ! -name copyright|xargs rm -f || true +find binary/boot/filesystem.dir/usr/share/doc -empty|xargs rmdir || true + +echo "I: Remove man/info pages" +rm -rf binary/boot/filesystem.dir/usr/share/man \ + binary/boot/filesystem.dir/usr/share/groff \ + binary/boot/filesystem.dir/usr/share/info \ + binary/boot/filesystem.dir/usr/share/lintian \ + binary/boot/filesystem.dir/usr/share/linda \ + binary/boot/filesystem.dir/var/cache/man + + +echo "I: Removing /var/lib/apt/lists/*" +find binary/boot/filesystem.dir/var/lib/apt/lists/ -type f | xargs rm -f + +echo "I: Removing /var/cache/apt/*.bin" +rm -f binary/boot/filesystem.dir/var/cache/apt/*.bin + diff --git a/live-build/ubuntu-core/hooks/11-remove-extra-packages.chroot b/live-build/ubuntu-core/hooks/11-remove-extra-packages.chroot new file mode 100644 index 00000000..39614ac9 --- /dev/null +++ b/live-build/ubuntu-core/hooks/11-remove-extra-packages.chroot @@ -0,0 +1,9 @@ +#!/bin/sh + +set -e + +# we want a really minimal image +apt-get remove -y locales + +# this will also get rid of libqt +apt-get remove -y libicu52 diff --git a/live-build/ubuntu-core/hooks/12-add-docker-user.chroot b/live-build/ubuntu-core/hooks/12-add-docker-user.chroot new file mode 100644 index 00000000..b6d6d134 --- /dev/null +++ b/live-build/ubuntu-core/hooks/12-add-docker-user.chroot @@ -0,0 +1,16 @@ +#!/bin/sh -x + +# FIXME: add click hook for user creation + +USER=docker + +echo "I: creating docker user" + +addgroup --system --quiet $USER +adduser --system \ + --ingroup $USER \ + --disabled-login \ + --shell /bin/false \ + --no-create-home \ + $USER +