From 138465c476e70202a5ec9fa81a68328de5126f7d Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Fri, 10 Oct 2014 00:11:26 -0700 Subject: [PATCH] Add support to the ubuntu-touch target to generate a separate custom tarball as part of the build, moving most click packages into it. --- debian/changelog | 7 +++++ live-build/auto/build | 6 +++++ .../hooks/60-install-click.binary | 9 +++++++ .../hooks/60-install-click.chroot | 26 ++++++++++++++++++- .../90-precompile-apparmor-policies.chroot | 4 +++ 5 files changed, 51 insertions(+), 1 deletion(-) create mode 100755 live-build/ubuntu-touch/hooks/60-install-click.binary diff --git a/debian/changelog b/debian/changelog index 2a5b439d..84e7ed7f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +livecd-rootfs (2.253) UNRELEASED; urgency=medium + + * Add support to the ubuntu-touch target to generate a separate custom + tarball as part of the build, moving most click packages into it. + + -- Steve Langasek Thu, 09 Oct 2014 20:46:46 -0700 + livecd-rootfs (2.252) utopic; urgency=low [ James Hunt ] diff --git a/live-build/auto/build b/live-build/auto/build index 197e3113..c1036ec1 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -298,6 +298,12 @@ elif [ -e binary-tar.tar.gz ]; then cp -a binary-tar.tar.gz "$PREFIX.rootfs.tar.gz" fi +if [ "$PROJECT" = "ubuntu-touch" ]; then + (cd "binary/$INITFS/custom.dir/" && tar -c *) | \ + gzip -9 --rsyncable > "$PREFIX.custom.tar.gz" + chmod 644 "$PREFIX.custom.tar.gZ" +fi + # '--initramfs none' produces different manifest names. if [ -e "binary/$INITFS/filesystem.packages" ]; then ln "binary/$INITFS/filesystem.packages" "$PREFIX.manifest" diff --git a/live-build/ubuntu-touch/hooks/60-install-click.binary b/live-build/ubuntu-touch/hooks/60-install-click.binary new file mode 100755 index 00000000..c57b372e --- /dev/null +++ b/live-build/ubuntu-touch/hooks/60-install-click.binary @@ -0,0 +1,9 @@ +#!/bin/sh + +set -e + +echo "Splitting out custom tarball" + +rm -f binary/boot/custom.dir +mkdir binary/boot/custom.dir +mv binary/boot/filesystem.dir/custom binary/boot/custom.dir/custom diff --git a/live-build/ubuntu-touch/hooks/60-install-click.chroot b/live-build/ubuntu-touch/hooks/60-install-click.chroot index 0b4b2b7d..92537c3b 100755 --- a/live-build/ubuntu-touch/hooks/60-install-click.chroot +++ b/live-build/ubuntu-touch/hooks/60-install-click.chroot @@ -7,10 +7,15 @@ echo "Setting up click packages" click_uri=http://archive-team.internal/click_packages click_list=$click_uri/click_list click_db=/usr/share/click/preinstalled +click_db_custom=/custom/click mkdir -p -m 755 "$click_db" chown clickpkg:clickpkg "$click_db" +# some of these get installed to /custom/click +mkdir -p -m 755 "$click_db_custom" +chown clickpkg:clickpkg "$click_db_custom" + tmpdir="$(mktemp -d)" cleanup () { rm -rf "$tmpdir"; } trap cleanup EXIT @@ -23,7 +28,26 @@ do if echo $package | egrep -q "_$CLICKARCH.click|_all.click|_unknown.click"; then echo "Setting up $package" wget --no-verbose -O "$tmpdir/$package" "$click_uri/$package" - click install --force-missing-framework --root="$click_db" --all-users \ + # FIXME: first attempt, a hard-coded list of the packages that go to + # the custom tarball + case $package in + com.ubuntu.developer.webapps.webapp-amazon_*|\ + com.ubuntu.dropping-letters_*|\ + com.ubuntu.developer.webapps.webapp-ebay_*|\ + com.ubuntu.filemanager_*|\ + com.ubuntu.developer.webapps.webapp-gmail_*|\ + com.ubuntu.reminders_*|\ + com.ubuntu.sudoku_*|\ + com.ubuntu.terminal_*|\ + com.ubuntu.developer.webapps.webapp-facebook_*|\ + com.ubuntu.developer.webapps.webapp-twitter_*) + root="$click_db_custom" + ;; + *) + root="$click_db" + ;; + esac + click install --force-missing-framework --root="$root" --all-users \ "$tmpdir/$package" fi done diff --git a/live-build/ubuntu-touch/hooks/90-precompile-apparmor-policies.chroot b/live-build/ubuntu-touch/hooks/90-precompile-apparmor-policies.chroot index 36779203..8d92cea5 100755 --- a/live-build/ubuntu-touch/hooks/90-precompile-apparmor-policies.chroot +++ b/live-build/ubuntu-touch/hooks/90-precompile-apparmor-policies.chroot @@ -7,3 +7,7 @@ echo "I: precompiling click apparmor policies" echo "I: precompiling deb apparmor policies" /sbin/apparmor_parser -M ${FEATURES} -Q --write-cache --cache-loc=/etc/apparmor.d/cache/ `find /etc/apparmor.d/ -maxdepth 1 -type f -not -path '*/\.*'` + +echo "I: precompiling custom click apparmor policies" +mkdir -p /custom/cache/apparmor +/sbin/apparmor_parser -M ${FEATURES} -Q --write-cache --cache-loc=/custom/cache/apparmor/ `find /var/lib/apparmor/profiles/ -maxdepth 1 -type f -not -path '*/\.*'`