From patchwork Sat Nov 16 10:55:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 3933 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Sat, 16 Nov 2024 11:56:06 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-pl1-f191.google.com (mail-pl1-f191.google.com [209.85.214.191]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 4AGAu4XO013496 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 16 Nov 2024 11:56:05 +0100 Received: by mail-pl1-f191.google.com with SMTP id d9443c01a7336-21147fea103sf22377755ad.2 for ; Sat, 16 Nov 2024 02:56:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1731754558; cv=pass; d=google.com; s=arc-20240605; b=iZhVqabY0S2Bhh54OvW70B3NjJDwmQybfF+tRAwnf7Rx5GyDZ7QUHpHehnQa2lrJXo +0JuOYmPmB/dVWPMp0Cn4MrOJZk2ncJ5GizRzJsY+g3zSsgo7RWPeA3M7VGOXGa2rI5e Tho7H5HWKEMSi8Uxlxf6bJMAvc046Chg3qs8ndPhrOFNKRlgMcpbRDpoOkZjoxNJsY6k RUSqBsrv93NMZZ7bQLg2X01xptEzL+nBIh8nDH6ijCfPQn+DfyChOq006LC+dpJrST3e dUlnEhis2La5VcB7c/9IjfG8cWsOmhsgg1w0OXE+DinesrORJ444nsegZgeVuXViuXgX b00g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:feedback-id:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=kBD5hcpuOQOtpY0H7iGhIU6QrkCDM8a9phvObapTqNo=; fh=IcUsTgsOjhpjOhI9Snq6g45HnPImMdDhIo6M9zszEgg=; b=YWiJD69/j9zVJLrnD3byobZXazUusiAra3hZZzy4SpCoa+mapVlz3bumeKNVcL6V0i Dwgs4hyO/6Zvvrk/geDeFcENJsxJ6JPC9CiCK4mf7POfLmt0mL5J651epnQRgjefDgto uFi9E5iz8LFuPc9/sfPLxwYDtwjA4sZvEglRuRI01EDX8YkkcZ3YBB/GDBC5w0rvxxIh zR+z2XBPEhrj4P1/ecaNreFlIONJsGWY9eOyf15ar8WdiYNzis36xctEYiCeAoQN4dh6 a+AH6IGk7uEq1Y7/PFfkMnnGrfcByJWWPYnf7m7NKosU5FbP480MVbfW89gNrl9sO5ce vXkg==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=FqPR7BsN; spf=pass (google.com: domain of fm-294854-20241116105554839252d082cc6ab7e9-129cpz@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) smtp.mailfrom=fm-294854-20241116105554839252d082cc6ab7e9-129cpz@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=1731754558; x=1732359358; 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:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=kBD5hcpuOQOtpY0H7iGhIU6QrkCDM8a9phvObapTqNo=; b=rdj8EDbiQvfs2mifwr8pi+wiOvF1R5kqgI7VDx1L8k8+FSn4oGemZ/XZbBxqLkY+/D ++RgrBVs3o1q+j1MdcIOVyM62Dmo53VFoLUl5v0v5JvvrNiCoTiQl31ca3787TRdCF80 FX8KkfJcMtJdcj3qxWz7wJcM9UQkwgITnDtTpxzgooG3S/fqEtpWgmV9CsGX3jWeSU4u vQHhChlAc0ClnU0bvR6Bm8/eubMowf6eCBYyMLQbksEXXv+y4wDIDEWrdv3wr3+riDW9 hqMYGlG8o28b3LbrjsGP/OiK+qzPn9uw+y7iOTYdnxSwIRz7toY9MfOpknV/ZrowmwoQ IUUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731754558; x=1732359358; 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:references:in-reply-to:message-id:date:subject:cc:to :from:x-beenthere:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=kBD5hcpuOQOtpY0H7iGhIU6QrkCDM8a9phvObapTqNo=; b=oJLs6DUnbhDGESPil+sMI2looo/EmBTJWft9dWv5WB1dvgrvJh/tq/b3HDxiIIBrHt joZJg5/wzKpDQKZ6AvOZYO1nQuHTvDRgm9OjECRUlCCD/WD2emQl8VsLaRC4ZU6r8T8z 2VipqrWbGCcG7AX+BBi+ChyCP1jSaA+xvYScqNF0D1KZVKEfvkdfRiFulXE1uAkNCS09 nr4yMj0S327Pvb31EkqJ2JB0M2Wp02nojd6OUovp51GomWb3GGnxWQ9R9LRuDtdXDJT8 58nPLjL3u51XcpHxN2rl4wO3W6/GDeIvGR/fa04fgDa6/aizmB3oxWGF+vFV1nNbmwl9 H7Kw== X-Forwarded-Encrypted: i=2; AJvYcCU6L1x98B4lQWcV6kki1/+/XdpYgrPw6Eg1tjRV5zyvxkfzHznYciHyLCzYji/xbx1CGxWON08=@isar-build.org X-Gm-Message-State: AOJu0YzXecCJnTx4DwOWYWWl6z0dq4pJT+6+prVZZ92KEM/cwT0i9J5I uuuBRpxLex7oot/70dnFpyGd9a4aXqItlyWpRkK5VDaXUJAr9BrN X-Google-Smtp-Source: AGHT+IG5/wZQFF12iKC7mYTg53qQdYxdTxniRM25XQfTRfRi2XGTYMfNKQPiEs+a4dEG7wctkUB6QA== X-Received: by 2002:a17:902:e745:b0:20c:e6e4:9d9f with SMTP id d9443c01a7336-211d0ebd07cmr90699485ad.40.1731754558470; Sat, 16 Nov 2024 02:55:58 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:902:e843:b0:20c:a04f:9257 with SMTP id d9443c01a7336-211d0f36940ls2348435ad.0.-pod-prod-03-us; Sat, 16 Nov 2024 02:55:57 -0800 (PST) X-Received: by 2002:a17:903:11cd:b0:20c:ecd8:d0af with SMTP id d9443c01a7336-211d0d5eea4mr83149175ad.9.1731754556990; Sat, 16 Nov 2024 02:55:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731754556; cv=none; d=google.com; s=arc-20240605; b=VZ7DD6Fqs2y+nLHrQVRc4PxVf24oEUMkOzr869UQ/AQAofX5NaLOVogtS3OqYIww4R iYQ1NWJDWo3wJKD7iyKi9JgostHe2vdVEaMLlrnJPXTgEGNiaEvNtOtivKR66FNaS60R fOfUQHCuWrd+nZ/TQ1Pz8fEl00oOpzH2u90mReiZGdO+V2DDdqas0H5Rj0Y3n29Lfog7 k/XBR63+41/narQGrfwD66/UbsxJihuLDD1Fd5Jaod61jBA7cG5dBCyuQHUhl3fi2MtZ A/6LuufAeuScehWXNndeTV7KssS4bhXjstHsWy3mJ+9ZY1nKN9kqYF5AHVT10pRubEIP fYGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=feedback-id:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=1SmGJD8sNAT8lI5B4I8KeLxB2HgGvxa/go9kgLfOnLc=; fh=TWGwN84gUgHIe5O4CbyH9KISyeWwGbvUX7cnJPxVD70=; b=bUqhDNdI4cWJE9E5fzERUlTgKvI7Jk7yjpL1U3jOwa94td4d6UUYziKsqxKcnEJ3JB Xi/a1d/gQGZHnNN97h9Ow8y1KXiAwgX09heQ6bUa7dIgK3fHBbzwYzUezz0Qe/BVGj/y XutbmyTtBHqcI3eVBi84Dn2+FfsegCJkx5UYEgXAFWohPkA0S15ggnToK/CcETXIobrz FkWyp/EZg/5R0IVwWF4PsQYc43qEFKkZtK6y7bcATkSzsEwgJyFdtWhQFCjSFTc0Z/E2 gq1/3XtfLR0G2F9/L/DMjA1sGqh/NXQgBY7B0AXd3WXPKAjNiwcWV8gBmJM31cHOrDnz rplA==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=FqPR7BsN; spf=pass (google.com: domain of fm-294854-20241116105554839252d082cc6ab7e9-129cpz@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) smtp.mailfrom=fm-294854-20241116105554839252d082cc6ab7e9-129cpz@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-65-226.siemens.flowmailer.net (mta-65-226.siemens.flowmailer.net. [185.136.65.226]) by gmr-mx.google.com with ESMTPS id d9443c01a7336-211d0d23127si1805575ad.0.2024.11.16.02.55.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Nov 2024 02:55:56 -0800 (PST) Received-SPF: pass (google.com: domain of fm-294854-20241116105554839252d082cc6ab7e9-129cpz@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) client-ip=185.136.65.226; Received: by mta-65-226.siemens.flowmailer.net with ESMTPSA id 20241116105554839252d082cc6ab7e9 for ; Sat, 16 Nov 2024 11:55:54 +0100 X-Patchwork-Original-From: "'Jan Kiszka' via isar-users" From: Jan Kiszka To: isar-users Cc: Quirin Gylstorff Subject: [PATCH v3 5/7] initramfs-fsck-ext4-hook: Convert to hook.inc and improve Date: Sat, 16 Nov 2024 11:55:50 +0100 Message-ID: <2e8aadf060ee7f3242d6f4a969d2243e18491477.1731754552.git.jan.kiszka@siemens.com> In-Reply-To: References: MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-294854:519-21489:flowmailer X-Original-Sender: jan.kiszka@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=FqPR7BsN; spf=pass (google.com: domain of fm-294854-20241116105554839252d082cc6ab7e9-129cpz@rts-flowmailer.siemens.com designates 185.136.65.226 as permitted sender) smtp.mailfrom=fm-294854-20241116105554839252d082cc6ab7e9-129cpz@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com X-Original-From: Jan Kiszka Reply-To: Jan Kiszka 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=-4.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,RCVD_IN_RP_CERTIFIED, RCVD_IN_RP_RNBL,RCVD_IN_RP_SAFE,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?= From: Jan Kiszka Use the convention and helping features of the new initramfs hook.inc to simplify this hook. We move it under recipes-initramfs to align with other recipes there. Another change is making fsck.ext4 mandatory, both as dependency and while copying it in via the helper - there is no reason for this recipe to almost silently ignore any unavailability. Signed-off-by: Jan Kiszka --- .../images/isar-initramfs.bb | 2 +- .../files/initramfs-fsck-hook-ext4.triggers | 0 .../initramfs-fsck-ext4-hook_0.3.bb | 14 +++++++ .../files/initramfs.fsck.ext4.hook | 39 ------------------- .../initramfs-fsck-hook-ext4_0.2.bb | 18 --------- 5 files changed, 15 insertions(+), 58 deletions(-) rename meta/{recipes-support => recipes-initramfs}/initramfs-fsck-hook/files/initramfs-fsck-hook-ext4.triggers (100%) create mode 100644 meta/recipes-initramfs/initramfs-fsck-hook/initramfs-fsck-ext4-hook_0.3.bb delete mode 100644 meta/recipes-support/initramfs-fsck-hook/files/initramfs.fsck.ext4.hook delete mode 100644 meta/recipes-support/initramfs-fsck-hook/initramfs-fsck-hook-ext4_0.2.bb diff --git a/meta-isar/recipes-initramfs/images/isar-initramfs.bb b/meta-isar/recipes-initramfs/images/isar-initramfs.bb index 71dbaa43..d2a946f7 100644 --- a/meta-isar/recipes-initramfs/images/isar-initramfs.bb +++ b/meta-isar/recipes-initramfs/images/isar-initramfs.bb @@ -15,5 +15,5 @@ INITRAMFS_PREINSTALL += " \ # Recipes that should be installed into the initramfs build rootfs. INITRAMFS_INSTALL += " \ initramfs-isar-example-hook \ - initramfs-fsck-hook-ext4 \ + initramfs-fsck-ext4-hook \ " diff --git a/meta/recipes-support/initramfs-fsck-hook/files/initramfs-fsck-hook-ext4.triggers b/meta/recipes-initramfs/initramfs-fsck-hook/files/initramfs-fsck-hook-ext4.triggers similarity index 100% rename from meta/recipes-support/initramfs-fsck-hook/files/initramfs-fsck-hook-ext4.triggers rename to meta/recipes-initramfs/initramfs-fsck-hook/files/initramfs-fsck-hook-ext4.triggers diff --git a/meta/recipes-initramfs/initramfs-fsck-hook/initramfs-fsck-ext4-hook_0.3.bb b/meta/recipes-initramfs/initramfs-fsck-hook/initramfs-fsck-ext4-hook_0.3.bb new file mode 100644 index 00000000..c4d10c44 --- /dev/null +++ b/meta/recipes-initramfs/initramfs-fsck-hook/initramfs-fsck-ext4-hook_0.3.bb @@ -0,0 +1,14 @@ +# This software is a part of ISAR. +# Copyright (C) Siemens AG, 2019-2024 +# +# SPDX-License-Identifier: MIT + +DESCRIPTION = "Recipe to add fsck hook to the initramfs" + +require recipes-initramfs/initramfs-hook/hook.inc + +SRC_URI += "file://initramfs-fsck-hook-ext4.triggers" + +HOOK_COPY_EXECS = "fsck fsck.ext4 logsave" + +DEBIAN_DEPENDS .= ", e2fsprogs, logsave" diff --git a/meta/recipes-support/initramfs-fsck-hook/files/initramfs.fsck.ext4.hook b/meta/recipes-support/initramfs-fsck-hook/files/initramfs.fsck.ext4.hook deleted file mode 100644 index 259b73b4..00000000 --- a/meta/recipes-support/initramfs-fsck-hook/files/initramfs.fsck.ext4.hook +++ /dev/null @@ -1,39 +0,0 @@ -# This software is a part of ISAR. -# Copyright (C) Siemens AG, 2019 -# -# SPDX-License-Identifier: MIT - -#!/bin/sh - -set -e - -PREREQ="" - -prereqs() -{ - echo "$PREREQ" -} - -case $1 in -prereqs) - prereqs - exit 0 - ;; -esac - -. /usr/share/initramfs-tools/scripts/functions -. /usr/share/initramfs-tools/hook-functions - -if [ ! -x /sbin/fsck ]; then - echo "Warning: couldn't find /sbin/fsck!" - exit 0 -fi - -copy_exec /sbin/fsck -copy_exec /sbin/logsave - -if prog="$(command -v fsck.ext4)"; then - copy_exec "$prog" -else - echo "Warning: /sbin/fsck.ext4 doesn't exist, can't install to initramfs, ignoring." -fi diff --git a/meta/recipes-support/initramfs-fsck-hook/initramfs-fsck-hook-ext4_0.2.bb b/meta/recipes-support/initramfs-fsck-hook/initramfs-fsck-hook-ext4_0.2.bb deleted file mode 100644 index 9860dbc8..00000000 --- a/meta/recipes-support/initramfs-fsck-hook/initramfs-fsck-hook-ext4_0.2.bb +++ /dev/null @@ -1,18 +0,0 @@ -# This software is a part of ISAR. -# Copyright (C) Siemens AG, 2019 -# -# SPDX-License-Identifier: MIT - - -DESCRIPTION = "Recipe to add fsck hook to the initramfs" - -inherit dpkg-raw -SRC_URI = "file://initramfs-fsck-hook-ext4.triggers \ - file://initramfs.fsck.ext4.hook \ - " - - -do_install() { - install -m 0755 -d ${D}/etc/initramfs-tools/hooks - install -m 0740 ${WORKDIR}/initramfs.fsck.ext4.hook ${D}/etc/initramfs-tools/hooks/fsck.ext4.hook -}