From patchwork Tue Nov 14 19:54:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cedric Hombourger X-Patchwork-Id: 3212 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Tue, 14 Nov 2023 20:54:55 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-lj1-f187.google.com (mail-lj1-f187.google.com [209.85.208.187]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 3AEJssrt009664 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 14 Nov 2023 20:54:54 +0100 Received: by mail-lj1-f187.google.com with SMTP id 38308e7fff4ca-2c7822862b5sf38696531fa.3 for ; Tue, 14 Nov 2023 11:54:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699991688; cv=pass; d=google.com; s=arc-20160816; b=NsdicWX47ZTaa8C4orQbSbSUvuXDzeG0ONfNLerqBYLlBE6sZ1T4lRILXmVPu8RViY ZyDHS7wO3DUIuf1xfz6n7eB8yx6ARU7cpDzQMA+LM2+9Gozk9twnClIrvQk7bLEy5hqq M5uX3GV0b2Y/YaO7MQggllYgE1UhkHmu/Jrr07pwadlsqIZMnfJxUKC2GvLkCrxrprXc xsL5PKSNzXhCw/hRvAwD1oKYf7ajBMjG3fYDmxK1fAOSDdIK/Cp6X6Q23Jas8uMN8xV0 FSg5p/Ak/iWeZlTQAFDSbqt6ZkEKwDsvBkisCNw0zvrhJvwglf0QqJhYlkGTUOFdFmJr EDRA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:feedback-id:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=nUldZwneByOsdPgjwzDc5uulSb3n2/tBL4mtLkeN6G4=; fh=1z37pEVhqwMLlkT4FDzOga7XBsM6Rzv6sXOq0pipxqo=; b=rL5twgfYEGT3Wql60/8tAROd5FQrh2pRDII4j8KOKTLfRBSBz2o162/qjrDIkGbZua /eYVckp1Lk6BRwSdIsFAn3o1IrjWZKZb2ch4L2XEM9h6StCM8OeiWuJWPjsi66iQajBx OmRXIANZiv5u9IqLu45vp9+pLf1ndteXpaH4DFc5mNsaoOHtKeYJZBs8rAUYNkcXYr+w pYyl+N0S8UqoW3Qg+AdXZGmw1GYZQcaczvNQGGMVgOr+JXUEABD9ocJ2V5b53UV1iIPH GqP3OHvxJM/8i3eAps4bCYFm/TteUt6xlQl7YV5uEijk9muoRNz7PyKCU4qTBnmroYuJ Y1Fg== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=mw7mTJW5; spf=pass (google.com: domain of fm-1212295-202311141954449db369b262e8423432-yp9b5u@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-1212295-202311141954449db369b262e8423432-yP9b5U@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1699991688; x=1700596488; darn=isar-build.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:feedback-id :mime-version:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=nUldZwneByOsdPgjwzDc5uulSb3n2/tBL4mtLkeN6G4=; b=brckCnswhzlaIoFagUzIqw+ozJTBVcA1Y93IeSeC7WsEeKgZSbnl3raMrzcH+xgwii 8096FrQDzMJT/+WHGFmduJSs0OYusIn4SV1ROXdneM/UM43DUkvjy6tpP+P8I1kHluUT cnuQT7S+jymUtmzBtRsvuDMrawRtEdwE1Kenx9nGrnFNFglcay6B6XryE0i6y6a9dFqR CpiDnaiUaZWCmljyFA6X5DfAJO0hdUgn4maOOTpTHGgH1PX/RSARyDw/cGSEJNTd/6j8 qzHhc3tV3IH3Nz1sEG2YM8OjZFc0+hVIuLS7HiObj5DPLzVgPse6/Oja6bn3c71OGkbi 2x6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699991688; x=1700596488; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:feedback-id :mime-version:message-id:date:subject:cc:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=nUldZwneByOsdPgjwzDc5uulSb3n2/tBL4mtLkeN6G4=; b=PXipHUCA44dsIAQw4F45mbjHU1ayaIc34VsZ0/fuojj6p+EEYGUEcIAVXlAI8WTWZ5 /UYBcCBLXQKd2vGWRgLjgx0t7FzC8hc5R7B0L3jwWGj0AeWTlprUXolMrK6wqHtTosef NUlkY5402Z+16Dtyz2FIbuDGFNFMVgUcPUrwmTA2HaNsNIh7B4BpFMh44SbE9kycMlJ7 yxre47RQbf7zCGACi7hIfSDWTMwOM9XoPMRvvlUDWGMV8JKt2aJkJIxZNskWNctfaGfE shrtMgPxcUd4uveBf0OQNYok2yqkuKjW8/x54HEZ+QGUgTRLZioroHPMGFE2MN0xvGbw KnOg== X-Gm-Message-State: AOJu0YwEDApINI4kOig2gEesaYayBTBXF7p+fgIfGkYrXFHqzNXGh4HH rq33bRepKG3W/NsSaA2IJrY= X-Google-Smtp-Source: AGHT+IFDjXY/+rLXVNWzg+VEe9CAdu7M6NsIAxQQRpUukrgUWZDX6zc+Gbye5U8CyNVFIBbLAWwAoA== X-Received: by 2002:a2e:bc14:0:b0:2c5:1aae:400d with SMTP id b20-20020a2ebc14000000b002c51aae400dmr2925303ljf.22.1699991687463; Tue, 14 Nov 2023 11:54:47 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:b52a:0:b0:2c0:748:89af with SMTP id z10-20020a2eb52a000000b002c0074889afls804217ljm.2.-pod-prod-02-eu; Tue, 14 Nov 2023 11:54:45 -0800 (PST) X-Received: by 2002:ac2:4834:0:b0:509:459b:13ae with SMTP id 20-20020ac24834000000b00509459b13aemr6521474lft.53.1699991685437; Tue, 14 Nov 2023 11:54:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699991685; cv=none; d=google.com; s=arc-20160816; b=mWbH2Lth+o/HfLDTbjDbh21Z2wuVACdu5vgjZgUkt+KD55b2bZfVl3SeMd8ppijJd4 UhGfgYewuyDjVHJs4qmsOasxsaKKJE1AXFKZXzow9XUf0WL1qmuSItcp5oNvWKDwziQl B/bB3rzRwuKahvr46qkzmghGYL5miKXSfF871Gg7HY2XGNjd+jEG48wPxUc47yzNkjGR g+cpvLH5OrtZ0bvrp6hHAcTP2ZLZwfTAJI08YaNvosW7Nm49eg13yB55QW95fKpfD7zB w+BeAE0LirdS1b1Eys78in7ByFzY/f16NE/xHBanyy04jSGji/C35AzlgBu03aH9BXCd lkTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=feedback-id:content-transfer-encoding:mime-version:message-id:date :subject:cc:to:from:dkim-signature; bh=NA1a+ZxcwyN2z+Ddxyton9XZWFtRnDdgLAUkBnng6aU=; fh=1z37pEVhqwMLlkT4FDzOga7XBsM6Rzv6sXOq0pipxqo=; b=w4vzAimHjeit2iwjuNjrccj2W4BtIEHzwOzlNX7TU3wJZo/pn4/WvSvPnt2L/56lDX W4rdcrVTwYmKKI9HUPIeUsDckwPeOHXKwQnymbcDkt/5faOhnwtu6AdsBgqKjeUus0/u W/pJJZYUcuXZp2fGCyNO6ap11V7Hfd7Dmsi1f6mTi58nLVnNRIL04eu5412IKTQuTm3c QMDeZfb/NPdRG3AWNQx6jY2PLujqjGHTT3WnmKrssJetsPUbuWjPoydrhho9iEQUT/xW jHp5i7ym/tTsvrTRWQC1VjaG3yGNEJQJI1wI2u88VK8EEencOgzghkLQKFoA8j9jlyFS 6S0A== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=mw7mTJW5; spf=pass (google.com: domain of fm-1212295-202311141954449db369b262e8423432-yp9b5u@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-1212295-202311141954449db369b262e8423432-yP9b5U@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-64-228.siemens.flowmailer.net (mta-64-228.siemens.flowmailer.net. [185.136.64.228]) by gmr-mx.google.com with ESMTPS id bp29-20020a056512159d00b005090fd18c05si323422lfb.11.2023.11.14.11.54.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Nov 2023 11:54:45 -0800 (PST) Received-SPF: pass (google.com: domain of fm-1212295-202311141954449db369b262e8423432-yp9b5u@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) client-ip=185.136.64.228; Received: by mta-64-228.siemens.flowmailer.net with ESMTPSA id 202311141954449db369b262e8423432 for ; Tue, 14 Nov 2023 20:54:44 +0100 X-Patchwork-Original-From: "'Cedric Hombourger' via isar-users" From: Cedric Hombourger To: isar-users@googlegroups.com Cc: Cedric Hombourger Subject: [PATCH] debianize: handle .triggers and .service files Date: Tue, 14 Nov 2023 20:54:27 +0100 Message-Id: <20231114195427.345320-1-cedric.hombourger@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1212295:519-21489:flowmailer X-Original-Sender: cedric.hombourger@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=mw7mTJW5; spf=pass (google.com: domain of fm-1212295-202311141954449db369b262e8423432-yp9b5u@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-1212295-202311141954449db369b262e8423432-yP9b5U@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com X-Original-From: Cedric Hombourger Reply-To: Cedric Hombourger Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Some packages need to update/rebuild the initramfs and this is particularly slow on Debian systems (which are not using more modern technologies such as dracut or mkosi). Instead of having each package call update-initramfs, use a trigger instead to have dpkg defer that call to the very end of the transaction. Many packages also failed to rebuild the initramfs when the package gets removed. Demonstrate use with initramfs-fsck-hook-ext4. Other packages ship systemd units and usually do this using do_install() and a postinst script. Such recipes also fail to handle the removal of such packages. By naming the unit ${PN}.service and putting it under debian/, debhelper will generate the necessary maintainer scripts (preinst, postinst, prerm, postrm). Signed-off-by: Cedric Hombourger Reviewed-by: Felix Moessbauer --- meta/classes/debianize.bbclass | 8 ++++++++ ...d-on-first-boot_1.4.bb => expand-on-first-boot_1.5.bb} | 6 +----- meta/recipes-support/expand-on-first-boot/files/postinst | 3 --- .../files/{postinst => initramfs-fsck-hook-ext4.triggers} | 5 ++--- ...k-hook-ext4_0.1.bb => initramfs-fsck-hook-ext4_0.2.bb} | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) rename meta/recipes-support/expand-on-first-boot/{expand-on-first-boot_1.4.bb => expand-on-first-boot_1.5.bb} (78%) delete mode 100644 meta/recipes-support/expand-on-first-boot/files/postinst rename meta/recipes-support/initramfs-fsck-hook/files/{postinst => initramfs-fsck-hook-ext4.triggers} (51%) rename meta/recipes-support/initramfs-fsck-hook/{initramfs-fsck-hook-ext4_0.1.bb => initramfs-fsck-hook-ext4_0.2.bb} (88%) diff --git a/meta/classes/debianize.bbclass b/meta/classes/debianize.bbclass index df7c5b50..25ae2023 100644 --- a/meta/classes/debianize.bbclass +++ b/meta/classes/debianize.bbclass @@ -138,4 +138,12 @@ deb_debianize() { fi done done + + # handle PN.service and PN.triggers files for use with debhelper + for f in service triggers + do + if [ -f ${WORKDIR}/${PN}.${f} ]; then + install -v -m 644 ${WORKDIR}/${PN}.${f} ${S}/debian/ + fi + done } diff --git a/meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.4.bb b/meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.5.bb similarity index 78% rename from meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.4.bb rename to meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.5.bb index 0996000c..1b5b066b 100644 --- a/meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.4.bb +++ b/meta/recipes-support/expand-on-first-boot/expand-on-first-boot_1.5.bb @@ -14,13 +14,9 @@ DEBIAN_DEPENDS = "systemd, sed, grep, coreutils, mount, e2fsprogs, fdisk (>=2.29 SRC_URI = " \ file://expand-on-first-boot.service \ - file://expand-last-partition.sh \ - file://postinst" + file://expand-last-partition.sh" do_install() { - install -d -m 755 ${D}/lib/systemd/system - install -m 644 ${WORKDIR}/expand-on-first-boot.service ${D}/lib/systemd/system/ - install -d -m 755 ${D}/usr/share/expand-on-first-boot install -m 755 ${WORKDIR}/expand-last-partition.sh ${D}/usr/share/expand-on-first-boot/ } diff --git a/meta/recipes-support/expand-on-first-boot/files/postinst b/meta/recipes-support/expand-on-first-boot/files/postinst deleted file mode 100644 index a190b01a..00000000 --- a/meta/recipes-support/expand-on-first-boot/files/postinst +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -systemctl enable expand-on-first-boot.service diff --git a/meta/recipes-support/initramfs-fsck-hook/files/postinst b/meta/recipes-support/initramfs-fsck-hook/files/initramfs-fsck-hook-ext4.triggers similarity index 51% rename from meta/recipes-support/initramfs-fsck-hook/files/postinst rename to meta/recipes-support/initramfs-fsck-hook/files/initramfs-fsck-hook-ext4.triggers index 07bc3d94..db45dfdc 100644 --- a/meta/recipes-support/initramfs-fsck-hook/files/postinst +++ b/meta/recipes-support/initramfs-fsck-hook/files/initramfs-fsck-hook-ext4.triggers @@ -1,6 +1,5 @@ -#!/bin/sh # This software is a part of ISAR. -# Copyright (C) Siemens AG, 2019 +# Copyright (C) Siemens AG, 2023 # # SPDX-License-Identifier: MIT -update-initramfs -u +activate-await update-initramfs diff --git a/meta/recipes-support/initramfs-fsck-hook/initramfs-fsck-hook-ext4_0.1.bb b/meta/recipes-support/initramfs-fsck-hook/initramfs-fsck-hook-ext4_0.2.bb similarity index 88% rename from meta/recipes-support/initramfs-fsck-hook/initramfs-fsck-hook-ext4_0.1.bb rename to meta/recipes-support/initramfs-fsck-hook/initramfs-fsck-hook-ext4_0.2.bb index 0be52a3b..9860dbc8 100644 --- a/meta/recipes-support/initramfs-fsck-hook/initramfs-fsck-hook-ext4_0.1.bb +++ b/meta/recipes-support/initramfs-fsck-hook/initramfs-fsck-hook-ext4_0.2.bb @@ -7,7 +7,7 @@ DESCRIPTION = "Recipe to add fsck hook to the initramfs" inherit dpkg-raw -SRC_URI = "file://postinst \ +SRC_URI = "file://initramfs-fsck-hook-ext4.triggers \ file://initramfs.fsck.ext4.hook \ "