From patchwork Sat Nov 16 11:12:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 3941 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 12:13:14 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-il1-f192.google.com (mail-il1-f192.google.com [209.85.166.192]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 4AGBDCrf014106 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 16 Nov 2024 12:13:13 +0100 Received: by mail-il1-f192.google.com with SMTP id e9e14a558f8ab-3a7162d1485sf29641065ab.0 for ; Sat, 16 Nov 2024 03:13:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1731755586; cv=pass; d=google.com; s=arc-20240605; b=PnnPCwMzjazY6xgxjFS6GDFsKXbHd48UeL3fIiU5pkthRnuVfzclIwTp7bxcWUm8uR LXhKnGLOb60zpZ33BIgVfU84E5Wovib6Q6f/xO3qSSTDmmHYkzvhkVxYy9UDr71vGX5u AmJ5gFs/2EyNHObQO5W6TlTQ5rhxkOW+v1uhm6O9HBdTnHcLgosOPxGWT/0S0hEPQfvD PEtPOrkhIHnhzE9wpWKqagZy4wqDRZf8euEPABXcYomQZqhYCpWntsAlGqGQMOk5vdZW 4mobJT3NZ9vVLiorZkGkWamWAmGTSj0rxZDPSzOXDpVWETtv8o/2u0briXspentfOdOC x+dQ== 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=gVrV8OUyzPmvCMrdtITmIIy9KKQ34Vtd4WmhqpTM9Xk=; fh=qQV4tWhDw9ZPvQXj9119xZ5vbpk9YxIfAO+QJJ/ih8w=; b=Jseyj2fcr5ig9+lkG81L0PQwiCftB/8eH8wd/FXI9qo3ZoMNmZtwuQcRGDGzZl/Tb8 JzdWEI9KsonuzaO0oWoLXveUqVmxPRINnFygDPpff0Cs0WzHP6XFCoeJ6OvHttOzPozy Nl1atzADvffQ7HkGU0gcZ93QVLIPGVajAfN0VgsSukwFmjA0HAwVpOCXhE9IzUXUYxCW X1I+tX5XoZNqI42XNSEdbxzcxxbuhTVhds/t4OA2HSr8NH/LwVWiyfGIifbftlCCRoPI ctJqqhw7RJ+l/YwmroCSHS8F856KtyDlhMw9716U3Uz92U/bFERnSfMlEznf7t2UvH4m N+Gw==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=ELggI2kF; spf=pass (google.com: domain of fm-294854-20241116111303ba56ff9b606745f27e-tawfy5@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-294854-20241116111303ba56ff9b606745f27e-taWfy5@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=1731755586; x=1732360386; 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=gVrV8OUyzPmvCMrdtITmIIy9KKQ34Vtd4WmhqpTM9Xk=; b=XSK16X7SzTjmnqFj4MWtrX9HGviqjmRUYQ4p08l7VDuGgniEhF7uZJEgCVIV5WAe/M ERXgTG/ZU8Ho1nyn4F63Ui0v3OIORztzplFH3+tD7k3atMpwSBJrh2i+9gBYxg+DSD2c PAhm9rQCsWGuY7tCnz1BK6ex+H+tsybH1rV0LUORy/Km/eREYS8UJUQ5RNme9PGEHsEE 25SHLKYIwozJuqN4CPLR4YuCoIs+bV6d7qzsS1DT8P5IV50Tb18n4ulkihI7EwqrXaCp Uoe7k5PKesSd87tbs4jru0bIhUYZGJjMhpmLE7LwiLF8rxQ73I4i5jmbx3U0arsQI81e yK+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731755586; x=1732360386; 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=gVrV8OUyzPmvCMrdtITmIIy9KKQ34Vtd4WmhqpTM9Xk=; b=nwlAC/C/uENrDegW1VH1mRG2OF0GZzPczLTDPyqsAsI/X9rCRDpAQvmR4pMIcvtpaF PZ2C6mkOxYSqvLatBUzP07t29bkhqU4y+nEHXZ4dhpbNE28TsNZ7XKGEWy2GNOriWNfE WoxTO9GfyG7vzdcUXzSyOjSQ/7Nf9ADof4XSYZQr7Ng7KZ3JSevnDft/7HJrUY0zxvCu KujRUDcT97VFHUyUAZBEim/JKRsXjsY79L+oLpxOWy9Ydqun7Dyh9ACR0H5cQb/C5NH7 DkShYsd8UCeTaXR/ICALP/tXLRB824AXOopopogcBVo5+0OotBU/DnkqFGD44ZxjCDTI MdBg== X-Forwarded-Encrypted: i=2; AJvYcCXLopMyPzM4U0XUBXaUijzrZdlCZ2Z2VEEtWUTMSe2RxwnEBhOs2NGXR3PSQ2zKzmNlx7hU4h4=@isar-build.org X-Gm-Message-State: AOJu0YwNaAqe9n0OuZG9aHOiW3COxPhSaZ/OmfyvsvjySNfh3h+5W+/H AS6o5DPVU/KydplVPOyPVlV3pKKpR87z8ov6xozAslo48dYLXHKp X-Google-Smtp-Source: AGHT+IHroBM6hFF1wkncCK+FipYwOA5I5J/jfuNajmZpVs9f3XrQxXulsAQE17egRCfIvFFUOLSYvQ== X-Received: by 2002:a05:6e02:a:b0:3a6:c27a:6383 with SMTP id e9e14a558f8ab-3a74808784emr59892155ab.19.1731755586047; Sat, 16 Nov 2024 03:13:06 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a92:d30d:0:b0:3a7:450c:7e38 with SMTP id e9e14a558f8ab-3a7450c83c6ls12259855ab.1.-pod-prod-09-us; Sat, 16 Nov 2024 03:13:05 -0800 (PST) X-Received: by 2002:a05:6e02:13ab:b0:3a7:1e78:330b with SMTP id e9e14a558f8ab-3a748087658mr57247935ab.17.1731755585119; Sat, 16 Nov 2024 03:13:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731755585; cv=none; d=google.com; s=arc-20240605; b=gijNF4bnj+UXo0lDCd3W9u6YKVjpcymt3LQUxOzjXThJl+d799WsmhwdfHZ3Yx6Kcy g7bbVjBC6Ut+fsWBYpXpxtWZWJU94HJS/MCuIj2918msYv2CVt7iIk2Ppx0qIc8gbdc2 0k9IuT59qM76FbNmEiwbF6cv2Vs6DGYuzxqM4VDSZ37vrfFQasZ93DVz/H3mm2XczMZS tMVLcuWu8Rvgwy5cKeaNneVK1NN96jIT2ntqjKrLKmRF//hpAwxEDRl6HIQz0ypQ8ljT pU2BnDU1zZK7ZLoly2T6J9vvY960oFSC6lkYsgI8b2ot6aDJ8k5kFDsYZdSjwqtNrfCy FwrA== 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=ij2NVlY7ydw9uVPk0nL6wyhJIbNyLsD2ls2m2yPcaTx8zfFsiy6hM59zp2X67gLcEv tSl83YztT3mH4JvPgx9qMFii4J0tITofsg8KNbJZtwedT3685svBfCwedMya5H12oy4A hvltiLsg1e4M6piYRO3z6UD4BmRMXg7pqPyCTXNLpgEhS0g7sfrGBO+0QjiD5X/fyU8i WYNo2Ve0jNpYqN3+5XQxx5qVVuEyTxnCnB1vvnCfcwP+8NvzZZS4QBIQ737Sjv6ReSB/ 06emWkCVPo4dk/QrVJL5ToR44Rl3Z2d6kFPE10/BesAadrqFNLnp7m8CD203PoZUQMwh AiRw==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=ELggI2kF; spf=pass (google.com: domain of fm-294854-20241116111303ba56ff9b606745f27e-tawfy5@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-294854-20241116111303ba56ff9b606745f27e-taWfy5@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-64-226.siemens.flowmailer.net (mta-64-226.siemens.flowmailer.net. [185.136.64.226]) by gmr-mx.google.com with ESMTPS id 8926c6da1cb9f-4e070b228acsi169917173.3.2024.11.16.03.13.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Nov 2024 03:13:05 -0800 (PST) Received-SPF: pass (google.com: domain of fm-294854-20241116111303ba56ff9b606745f27e-tawfy5@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) client-ip=185.136.64.226; Received: by mta-64-226.siemens.flowmailer.net with ESMTPSA id 20241116111303ba56ff9b606745f27e for ; Sat, 16 Nov 2024 12:13:03 +0100 X-Patchwork-Original-From: "'Jan Kiszka' via isar-users" From: Jan Kiszka To: isar-users Cc: Quirin Gylstorff Subject: [PATCH v4 5/7] initramfs-fsck-ext4-hook: Convert to hook.inc and improve Date: Sat, 16 Nov 2024 12:12:59 +0100 Message-ID: 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=ELggI2kF; spf=pass (google.com: domain of fm-294854-20241116111303ba56ff9b606745f27e-tawfy5@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-294854-20241116111303ba56ff9b606745f27e-taWfy5@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 -}