From 691a0ca08f75578319731870d5d1fe7887574c65 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Thu, 4 Feb 2016 16:53:00 -0800 Subject: [PATCH] Add hooks to ubuntu-cpc to divert /bin/sync in the chroot and undivert it at the end. This is a general-purpose change that should be applied to all flavors and archs, but at the moment it's only needed on armhf+raspi2 to work around the raspberrypi2-firmware postinst calling sync, which is actually warranted in the normal case. --- debian/changelog | 5 +++++ .../ubuntu-cpc/hooks/001-divert-sync.chroot_early | 13 +++++++++++++ .../ubuntu-cpc/hooks/999-undivert-sync.chroot | 5 +++++ 3 files changed, 23 insertions(+) create mode 100755 live-build/ubuntu-cpc/hooks/001-divert-sync.chroot_early create mode 100755 live-build/ubuntu-cpc/hooks/999-undivert-sync.chroot diff --git a/debian/changelog b/debian/changelog index ed58cc30..2c77e4e6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,11 @@ livecd-rootfs (2.376) UNRELEASED; urgency=medium [ Steve Langasek ] * Drop BuildLiveCD from the examples; we now use launchpad-buildd to drive livefs builds, so BuildLiveCD is obsolete and misleading. + * Add hooks to ubuntu-cpc to divert /bin/sync in the chroot and undivert it + at the end. This is a general-purpose change that should be applied to + all flavors and archs, but at the moment it's only needed on armhf+raspi2 + to work around the raspberrypi2-firmware postinst calling sync, which is + actually warranted in the normal case. -- Ɓukasz 'sil2100' Zemczak Thu, 04 Feb 2016 17:31:18 +0100 diff --git a/live-build/ubuntu-cpc/hooks/001-divert-sync.chroot_early b/live-build/ubuntu-cpc/hooks/001-divert-sync.chroot_early new file mode 100755 index 00000000..7929ed6d --- /dev/null +++ b/live-build/ubuntu-cpc/hooks/001-divert-sync.chroot_early @@ -0,0 +1,13 @@ +#!/bin/sh +set -e + +ARCH=$(dpkg --print-architecture) + +dpkg-divert --quiet --add --divert /bin/sync.REAL --rename /bin/sync +cat > /bin/sync <<'EOF' +#! /bin/sh +echo "$0: diverted by livecd-rootfs" >&2 +exit 0 +EOF + +chmod +x /bin/sync diff --git a/live-build/ubuntu-cpc/hooks/999-undivert-sync.chroot b/live-build/ubuntu-cpc/hooks/999-undivert-sync.chroot new file mode 100755 index 00000000..8a97432d --- /dev/null +++ b/live-build/ubuntu-cpc/hooks/999-undivert-sync.chroot @@ -0,0 +1,5 @@ +#! /bin/sh +set -e + +rm -f /bin/sync +dpkg-divert --quiet --remove --rename /bin/sync