From patchwork Thu Oct 2 21:05:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Whitcroft X-Patchwork-Id: 396111 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 1DA75140139; Fri, 3 Oct 2014 07:05:26 +1000 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1XZnYw-0000cn-Il; Thu, 02 Oct 2014 21:05:22 +0000 Received: from mail-wi0-f172.google.com ([209.85.212.172]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1XZnYn-0000cK-Ur for kernel-team@lists.ubuntu.com; Thu, 02 Oct 2014 21:05:13 +0000 Received: by mail-wi0-f172.google.com with SMTP id n3so5348265wiv.5 for ; Thu, 02 Oct 2014 14:05:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZOKUZMhHL1c+jw8Iyp0qTKahNR4AIdu8S2GXUrM4mk0=; b=XOMXmky5fXf9VrEUN4AY/Rt+RGDAEtKUpgonjWwkh/sEGVABvl8j0Z/0YECcjNzygD qoVkUYV4+p6m78uSZwjCT6bOi9P21QpXRRxuoJQzULFyE1d79xichYB98XAU4ya+SDwu 3qiV0g+u2KVIB7gAwmbtqWpCYqqX3NHIW26UO9j2uxHILEIRHDeD/LvWkPTGF+Dhz4FQ 2lg7U2wRn+FnCqQhSSrJEvN+Xn6XdYPUZ+s6of+l9m/ThOpvLcLVixupDB9UKj0LeY3X SNIkTlCoGotkhSHZYC2VB6OM46tGjMXVlSv8mpBiXqEale9Lb36o3B6usGEAcrLQOsyf SJ6g== X-Gm-Message-State: ALoCoQk97v2v9/OKIUoGNNSEEaErCi0fB/fl6+14zZP1MJmpgHsGaXA9xUrajgsUD0Xs22N3JOTL X-Received: by 10.180.73.73 with SMTP id j9mr7285460wiv.2.1412283913790; Thu, 02 Oct 2014 14:05:13 -0700 (PDT) Received: from localhost ([2001:470:6973:2:3da0:7cc5:78f2:de3c]) by mx.google.com with ESMTPSA id fv1sm5781741wjb.35.2014.10.02.14.05.12 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 02 Oct 2014 14:05:13 -0700 (PDT) From: Andy Whitcroft To: kernel-team@lists.ubuntu.com Subject: [trusty 1/1] UBUNTU: [Config] linux-image-extra is additive to linux-image Date: Thu, 2 Oct 2014 22:05:10 +0100 Message-Id: <1412283910-31125-2-git-send-email-apw@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1412283910-31125-1-git-send-email-apw@canonical.com> References: <1412283910-31125-1-git-send-email-apw@canonical.com> Cc: Andy Whitcroft X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com linux-image-extra is special, it is only additive to linux-image, this means really cannot use the standard kernel postinst/postrm for this package. As it also depends on linux-image we know that linux-image will have been installed before it, and will be removed after it. On change (installation/update/removal) of linux-image-extra we want to run the kernel postinst to rebuilt the initramfs and update the bootloader as necessary. To this end switch to package specific postinst/postrm which trigger the /etc/kernel/postinst.d hooks. We need to do it this way to get the specially parameterised incantations of update-initramfs, to ensure we trigger the correct build rather than mearly dpkg triggering a rebuild of the running kernel. BugLink: http://bugs.launchpad.net/bugs/1375310 Signed-off-by: Andy Whitcroft --- debian/control-scripts/extra-post | 14 ++++++++++++++ debian/rules.d/2-binary-arch.mk | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 debian/control-scripts/extra-post diff --git a/debian/control-scripts/extra-post b/debian/control-scripts/extra-post new file mode 100644 index 0000000..a0c78af --- /dev/null +++ b/debian/control-scripts/extra-post @@ -0,0 +1,14 @@ +#!/bin/sh +set -e + +case "$0::$1" in +*.postinst::configure|*.postrm::remove|*.postrm::purge) + depmod -a -F /boot/System.map-=V =V || true + for dir in "/etc/kernel/postinst.d" "/etc/kernel/postinst.d/=V" + do + if [ -d "$dir" ]; then + run-parts --verbose --exit-on-error --arg="=V" --arg="/boot/=K-=V" "$dir" + fi + done + ;; +esac diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk index 4b43d2f..223186f 100644 --- a/debian/rules.d/2-binary-arch.mk +++ b/debian/rules.d/2-binary-arch.mk @@ -173,7 +173,7 @@ ifeq ($(do_extras_package),true) for script in postinst postrm ; do \ sed -e 's/=V/$(abi_release)-$*/g' -e 's/=K/$(instfile)/g' \ -e 's/=L/$(loader)/g' -e 's@=B@$(build_arch)@g' \ - debian/control-scripts/$$script > $(pkgdir_ex)/DEBIAN/$$script; \ + debian/control-scripts/extra-post > $(pkgdir_ex)/DEBIAN/$$script; \ chmod 755 $(pkgdir_ex)/DEBIAN/$$script; \ done; \ fi