From patchwork Wed Nov 13 07:47:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 3920 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Wed, 13 Nov 2024 08:48:04 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-il1-f186.google.com (mail-il1-f186.google.com [209.85.166.186]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 4AD7m2eF026322 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 13 Nov 2024 08:48:03 +0100 Received: by mail-il1-f186.google.com with SMTP id e9e14a558f8ab-3a7191aa79csf2665875ab.1 for ; Tue, 12 Nov 2024 23:48:03 -0800 (PST) ARC-Seal: i=3; a=rsa-sha256; t=1731484077; cv=pass; d=google.com; s=arc-20240605; b=KAY43TassRpEuYjHXCXdtkyHeVKoL6Dij62HVfSodWovOAb7OPmwkTQskU3O7EqFqM Zq3/pPh/KsTFth7URz8ckhmjb6a9H4pjXkJsev3Y7YFnGnsRwuYeahMMGWgYV+vNrE2U vUW04ze85SL6vpYQOexfx8+3VpxWRxXsLyhTnl7IMn4RHDSuX63bt+ALGy+bErnZkF1Z Ipw7Z2FQIyDVE3tXXvGFcIrf+DLl3+VMIzn7jRJvrVQ+80tpVGRMwhtaHFJSG/cYI8au JN9hdBHOx7SfpNanuqpT3FHY2jCq8fem1GolOZOtSKBXWw/kDbbbigzRvPxmBReVYsIt VugQ== ARC-Message-Signature: i=3; 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:mime-version:in-reply-to :autocrypt:content-language:from:references:cc:to:subject:user-agent :date:message-id:dkim-signature; bh=9Et0wMS7SDrNwm+T0Noi7HRH0toY3VvOq1K/sbHZkkg=; fh=3Ip3cTey5pJ7GatSGZ8mQxDxiDl4+Gax1pQDe6q+ybk=; b=iOs320wT+ayeFz5q9oIXyyiyIY3kHMsvWhhxsvBHODOMx2M5q7wXoZDfmFawyGP1xF MELiApFkQHvKEsywvFfL+fS6b5RI5y+yFjewD4aNVxDnzdkecumYBf1SxtsnpR6Pd1VZ BA8yRCCkmaLIQBgASFhyeBijBbba9nkidHg/4yUOWoFTL6KG+ykoJbzTS1ooKnm7rhiu Laz9W38z9iCGMnjGm0PWljChja2AXquANN1jS1DjeDZMEgEwZL3bvKy2L4zozTkuDVEV 5DvWy6d1TRVSOj56JgYP6a02byp0m4L0yyGMf9xx7eiL8T9ZhitaSO8LEhrydVo9/H5E W7rA==; darn=isar-build.org ARC-Authentication-Results: i=3; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=ymQBEmxw; arc=pass (i=1 spf=pass spfdomain=siemens.com dkim=pass dkdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of jan.kiszka@siemens.com designates 2a01:111:f403:c201:: as permitted sender) smtp.mailfrom=jan.kiszka@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=1731484077; x=1732088877; 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:mime-version :in-reply-to:autocrypt:content-language:from:references:cc:to :subject:user-agent:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=9Et0wMS7SDrNwm+T0Noi7HRH0toY3VvOq1K/sbHZkkg=; b=uK8eYvpQt4COsqrG6e76wfVfyrq1UO6u92dVuImn6iHW7LIutxMF0I51DFWs7tuOaL MOkR4kmQkmaPguBtR2RrFhYgsc1cfYKPYfxJZIowk0j5zcUOZbUqUHMz/SbxLxHh6T+z N0bL3zWY5t+aeGKa0b0LMBoMBqBR388YFh/mEAqpMnBRF3LeDUI/OHNbFerPdf58avzi aQz9QnScvMp674MEys2SOMz1DDWLr1LveDPKfx2TqnU2okYlfhjSKWJNtoV5De8RDENT yHDviYZJT1a9ibKSprFyP0qhrU/j6Ng0SjsspYXmuDf1z6HYt0HJRZj/MumwJ8Jkk4yM YQfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731484077; x=1732088877; 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:mime-version :in-reply-to:autocrypt:content-language:from:references:cc:to :subject:user-agent:date:message-id:x-beenthere:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=9Et0wMS7SDrNwm+T0Noi7HRH0toY3VvOq1K/sbHZkkg=; b=f8K1KPB3ZbWIG+cVtlIkiAIklskg6ct4InLYI31eVpeayn8fdkL680jRw1cyU2UpkM 3gdZ2aAuu+uwCK9wKI2pssbMN8ZlawTqMc3jrVbok9zz6iGNPPWf/fIiwEk2krCKSPZH uQmY+IGnVFKa0tDNngJOgf17TUrwNMyYIYlGUqFIjec2cYf2MRb8oQ82DrIPqeyGXD3J 0qIoNUDIC6JSYSRo0kIkf4IeDsm/vVBwmMK/TbVzghlnxNHExUAQfBkKB9F0dacjuDqn A1vY/T2A1mVTVwVhmE/qVHRi6TRUjizi3MGfJoxgb+ijHI4y7HA3u85M+BLK7nw5wpy6 d27Q== X-Forwarded-Encrypted: i=3; AJvYcCU7CgdZyAQ9SewxoOvfXmKWmwajVyUCR3nqeSkOzCD1HXyKhsMBrEaZviwZntMtpcmX9yyBAbQ=@isar-build.org X-Gm-Message-State: AOJu0YxLvQhX8+5Au+ptZ83RXkbQogvNtSs8xsL2i3sM1eJ3a5jqKLDh IOOk2NT6yFn2GtQI+lrJ1jKAJgKlji1F9wACcyA9fAfF9Kqy7pmz X-Google-Smtp-Source: AGHT+IH0ZZHJ94dbdyIETUXAyZqmC9m3g/e0lMWZ8Ab3hq8tsff9jfPhVtBau/uUZBJ024Vr/d1tLw== X-Received: by 2002:a05:6e02:164f:b0:3a6:afae:752e with SMTP id e9e14a558f8ab-3a715772b89mr22374505ab.16.1731484076779; Tue, 12 Nov 2024 23:47:56 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6e02:1202:b0:3a7:158d:67d9 with SMTP id e9e14a558f8ab-3a7158d694als2993035ab.1.-pod-prod-03-us; Tue, 12 Nov 2024 23:47:56 -0800 (PST) X-Received: by 2002:a05:6602:2cce:b0:83a:ab63:20b with SMTP id ca18e2360f4ac-83e4faab416mr267127039f.4.1731484075763; Tue, 12 Nov 2024 23:47:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1731484075; cv=pass; d=google.com; s=arc-20240605; b=ikKNblVIrtgki1NmcRj3XAD6TeJ0BQ/6fuZWp+Aq/4yMSSJU9TZGL7fjmdW9qaVn+U X7q3f62zlw4sab1T1FEOyhJtRdWn3NUrdBNAOOdU5r15J43CDt8Icc+kn8XmvWhjRJU/ QdUHnSiwRuoqob3j39XPBbYv/VW97WNgy/tbR2NjrKGMgt0Spnz6q9NneRcFcA7B+bDO EX4kIAqU3/3DJwigOLkBx08Ir6xShpsfQqbkl9W05d1QPcbqWO0gwoQsXN4fRKU4kip2 Ph+Ip/bnXtedbocaYfBh2ZvXeP6A0+JshqaNK3K4v4FA1PuvE0H/JTLaM/SRxiTjw4XF MY6w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=mime-version:content-transfer-encoding:in-reply-to:autocrypt :content-language:from:references:cc:to:subject:user-agent:date :message-id:dkim-signature; bh=4tfbNr+3U5tRm5ZMpr6FZwemk/5N83VxEjxoQ8Gicws=; fh=TWGwN84gUgHIe5O4CbyH9KISyeWwGbvUX7cnJPxVD70=; b=X8ZWspkVaut3jfc6BuImutV/2EofMZc2dTiH2WaQrHbDNJW0bIXS/C16azbiC7sQRy psbw6XMNyCgkjmGEISfOnttCuAwWoNukHuwPZOKNHwNi2WXItU1BoIBmjTGVS+Pc3GAJ ADr5OGRmfONf4GaSGV93laKGAjJKgvTbseyMd0t5ouDkaL/UonqgBjMg3Vbi2sso3V2j /dw1Dt2ldoFmJ4UzYDmdLJdCfUAeNzMGmqfL5hSHSw9c+LSQjqyMWIOqYaD6S4J05oIW 0ftuDYKPMh+HKIoH7mzBSK1kC2kqvZcVFRIn0KQYmjhUa4MepKa08g8ZGcJW2PhzouQ+ Kveg==; dara=google.com ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=ymQBEmxw; arc=pass (i=1 spf=pass spfdomain=siemens.com dkim=pass dkdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of jan.kiszka@siemens.com designates 2a01:111:f403:c201:: as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazlp170100000.outbound.protection.outlook.com. [2a01:111:f403:c201::]) by gmr-mx.google.com with ESMTPS id ca18e2360f4ac-83e130f0de7si31662639f.0.2024.11.12.23.47.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2024 23:47:55 -0800 (PST) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 2a01:111:f403:c201:: as permitted sender) client-ip=2a01:111:f403:c201::; ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ebe68wxBkaZ6qOGteHF3yuJSUXg/naN9NE/KGv7wEK2PebNzEqIiUsziBUj6c1Z97roeNqERe2SuLKNjlR/7EW2QcaLHcG7UGZWouBhZpcRmnTj6vX8IghnoFl5m3svx4t5y9Dmo1GDVsXofg/qKGqOlfMNGbmBcPPptEAdre5SYCiMYU930kJ4/H5C42Oobv1jVmfyrobiMnVsVukV3Z3B+J/tv98GlvcrpyohGf0yqEGGFWULJb1guqWQQ6E55JzUK41xgdVCn5Mq6IaJV9U9WBt1kotGv+eXlNhAy8wGBH+o3JXwkDvKQxBZajx7ppvlewOaPrOWith+daidIwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4tfbNr+3U5tRm5ZMpr6FZwemk/5N83VxEjxoQ8Gicws=; b=Smhfv7z2kEEWipVZ3VfUs4Q0fCVLu7NVED4oFfqVp5ACDQS8N/LskYNnpknTP7aPZELdZsuz44VXAogypp0hRlxICKEDJBqC/QEz7G+CP73d9NAkGa+EtR17pPJ0YbgxZM0q0uMq+o6tQo+dHWmVbvtPRjrbaZY+QvUx0U+g71rbjqz89aUBqy2fawTgNmpIziwW/w8xwqVEPlfOdzdPynAHlT+GpkdgcOIyWR6n8QC+jhJpz5ct/89upEDOaeefIIkagEP1QvSzE1OIpsWWUTMLDKEKjAWwUIfokUUgKUuK1qhVL9Q+Y/WyIHxh42g0AfrD/00G/vk6gcSysiR2Rw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=siemens.com; dmarc=pass action=none header.from=siemens.com; dkim=pass header.d=siemens.com; arc=none Received: from AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:588::19) by PAVPR10MB6861.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:102:321::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.15; Wed, 13 Nov 2024 07:47:48 +0000 Received: from AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM ([fe80::8fe1:7e71:cf4a:7408]) by AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM ([fe80::8fe1:7e71:cf4a:7408%6]) with mapi id 15.20.8158.013; Wed, 13 Nov 2024 07:47:48 +0000 Message-ID: Date: Wed, 13 Nov 2024 08:47:47 +0100 User-Agent: Mozilla Thunderbird Subject: [PATCH v2 1/7] initramfs-hook: Add infrastructure to ease writing hooks To: isar-users Cc: Quirin Gylstorff References: <934f188717e95b8c019736e4546d57e90a247327.1731358224.git.jan.kiszka@siemens.com> X-Patchwork-Original-From: "'Jan Kiszka' via isar-users" From: Jan Kiszka Content-Language: en-US Autocrypt: addr=jan.kiszka@siemens.com; keydata= xsFNBGZY+hkBEACkdtFD81AUVtTVX+UEiUFs7ZQPQsdFpzVmr6R3D059f+lzr4Mlg6KKAcNZ uNUqthIkgLGWzKugodvkcCK8Wbyw+1vxcl4Lw56WezLsOTfu7oi7Z0vp1XkrLcM0tofTbClW xMA964mgUlBT2m/J/ybZd945D0wU57k/smGzDAxkpJgHBrYE/iJWcu46jkGZaLjK4xcMoBWB I6hW9Njxx3Ek0fpLO3876bszc8KjcHOulKreK+ezyJ01Hvbx85s68XWN6N2ulLGtk7E/sXlb 79hylHy5QuU9mZdsRjjRGJb0H9Buzfuz0XrcwOTMJq7e7fbN0QakjivAXsmXim+s5dlKlZjr L3ILWte4ah7cGgqc06nFb5jOhnGnZwnKJlpuod3pc/BFaFGtVHvyoRgxJ9tmDZnjzMfu8YrA +MVv6muwbHnEAeh/f8e9O+oeouqTBzgcaWTq81IyS56/UD6U5GHet9Pz1MB15nnzVcyZXIoC roIhgCUkcl+5m2Z9G56bkiUcFq0IcACzjcRPWvwA09ZbRHXAK/ao/+vPAIMnU6OTx3ejsbHn oh6VpHD3tucIt+xA4/l3LlkZMt5FZjFdkZUuAVU6kBAwElNBCYcrrLYZBRkSGPGDGYZmXAW/ VkNUVTJkRg6MGIeqZmpeoaV2xaIGHBSTDX8+b0c0hT/Bgzjv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FxrkXA/kFpR3JsMzNmvextkN2kOLCCHkym0zz5Y3vxaYtbXG2wTrqJ 8WpkWIE8STUhQa9AkezgucXN7r6uSrzW8IQXxBInZwFIyBgM0f/fzyNqzThFT15QMrYUqhhW ZffO4PeNJOUYfXdH13A6rbU0y6xE7Okuoa01EqNi9yqyLA8gPgg/DhOpGtK8KokCsdYsTbk= In-Reply-To: <934f188717e95b8c019736e4546d57e90a247327.1731358224.git.jan.kiszka@siemens.com> X-ClientProxiedBy: FR4P281CA0441.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:c6::10) To AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:588::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS4PR10MB6181:EE_|PAVPR10MB6861:EE_ X-MS-Office365-Filtering-Correlation-Id: 9c411064-879f-4ed5-1efe-08dd03b7782d X-MS-Exchange-AtpMessageProperties: SA X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?deyxn6jcq6MxejdIe+2lziFhD4P/iGN?= =?utf-8?q?jN5OYN54fq4BxGEhowP3PrEs4PAGNPaNn/LleeKwPN396tW35r4OOQAocJapONqHv?= =?utf-8?q?aRMmnL7tH2DB0knxG9fogCh9YXTL36Hm4phv56Ifv+nc2WYlYZXfaGsM6la1/aQ5W?= =?utf-8?q?IXvpvveA75aYNLbzFoPDhLORphdd9M/+Xq8VDyDaBlO7yDpYSO/IJ28PRyf9VG90N?= =?utf-8?q?nsPRCWwSrXWhXfHkEwOL+BGjS35NWDVBQnrOLREyUTL/L0ApJEuA9B3t6QN7OIczP?= =?utf-8?q?jH5X8eFDboPocHf2XzDNx8GKwPItenRgO3/DmEETCWL5uvGzchhm8XKL/X/1Ih6zd?= =?utf-8?q?Xb+sIQTIVSYFFbRf3V3UqXO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ZGfDzGNZWaM+ulbvegQzx/ceMmUX6ncI37QJP?= =?utf-8?q?McNnnjcnN8WG2?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?rNzGh5Q8hkjS/JaP0NbteicBfvsf?= =?utf-8?q?AIxaG5NeGA4dnKqIwWMDyBG3Hxpg49ZUHm9WOuTeiBqBjIgO6odhm65JTQzNFLSbP?= =?utf-8?q?lxNoYDYbGnKJD6IfjvAj6IoC5Kfrr2NM+aNOl+RO+xkObF8Fl4GTNzNhebeg41+ms?= =?utf-8?q?+REdOJdq5IyQzNsepLxH41dCw/pR25DIwmzhT2oSS8jKIvI5iASyHOr3rBE38/kR6?= =?utf-8?q?CjwcaJpyEIhyzPD4w1bM138+baXFxs8kSOXI/P/GqCIXeuKKFIJmTlYQ7sjvMTqXo?= =?utf-8?q?2qmFXBpfKOh4CAJeA/eh3sPnyjminKzroxQgo3aVKIT700QfYFw7ZJMCybCr7KEW3?= =?utf-8?q?SMcBjzN8u1lKHscW45MS99HtkqmWI1Fc3RjeXM8hXKilPG/xA8u8a9WpC2u3iAUxj?= =?utf-8?q?b2CdNEOPL6E+4T0iIN3BdNXHKzCkDU05DSW8UbiGELEccAfWoNCJ80qVWQdRudvIH?= =?utf-8?q?Uedv6BPS066NV9M957IoGkbVcLByrs271c9nrKdLsOLAWNV1CXbz9ZQ7kq/C8mPib?= =?utf-8?q?zK/qbehonmpRpVKxYGHBODr0vQtskgIGn3NiJaQmCjBXbXjidLdipGbfOXMUlvXqS?= =?utf-8?q?HT3EHFX49bw0JKtbkXsREyW7EpO2iiPR0Y1A9zHfgzOswzrWkWPjhTPoEG+w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tW02Y4?= =?utf-8?q?+34gzEBbqWPm?= X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9c411064-879f-4ed5-1efe-08dd03b7782d X-MS-Exchange-CrossTenant-AuthSource: AS4PR10MB6181.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Nov 2024 07:47:48.7984 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 38ae3bcd-9579-4fd4-adda-b42e1495d55a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: BoLcRGxZMFboh+7qxUGAJ1CGvq6GNyW1SZOIeKsDJwsufq3i0n6FTpdX/mhRdoLQ95Rl4pA+2CFR8ckL0XKN3g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR10MB6861 X-Original-Sender: jan.kiszka@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=ymQBEmxw; arc=pass (i=1 spf=pass spfdomain=siemens.com dkim=pass dkdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of jan.kiszka@siemens.com designates 2a01:111:f403:c201:: as permitted sender) smtp.mailfrom=jan.kiszka@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 This recipe include shall simplify writing of initramfs hooks. It provides the usual headers for the installation hook as well as the boot scripts, allow to generate that code that installs executables and modules into the image, but also supports expanding the scripts with own snippets. Signed-off-by: Jan Kiszka --- Changes in v2: - fill out commit message, no code changes .../initramfs-hook/files/hook-header.tmpl | 39 ++++++++++ .../initramfs-hook/files/script-header.tmpl | 26 +++++++ .../recipes-initramfs/initramfs-hook/hook.inc | 74 +++++++++++++++++++ 3 files changed, 139 insertions(+) create mode 100644 meta/recipes-initramfs/initramfs-hook/files/hook-header.tmpl create mode 100644 meta/recipes-initramfs/initramfs-hook/files/script-header.tmpl create mode 100644 meta/recipes-initramfs/initramfs-hook/hook.inc diff --git a/meta/recipes-initramfs/initramfs-hook/files/hook-header.tmpl b/meta/recipes-initramfs/initramfs-hook/files/hook-header.tmpl new file mode 100644 index 00000000..ee30d691 --- /dev/null +++ b/meta/recipes-initramfs/initramfs-hook/files/hook-header.tmpl @@ -0,0 +1,39 @@ +#!/bin/sh +# +# Copyright (c) Siemens AG, 2024 +# +# Authors: +# Jan Kiszka +# +# SPDX-License-Identifier: MIT +# + +set -e + +prereqs() +{ + echo "${HOOK_PREREQ}" +} + +case $1 in +prereqs) + prereqs + exit 0 + ;; +esac + +. /usr/share/initramfs-tools/hook-functions + +for module in ${HOOK_ADD_MODULES}; do + manual_add_modules $module +done + +for executable in ${HOOK_COPY_EXECS}; do + if exec_path=$(command -v $executable 2>/dev/null); then + copy_exec "$exec_path" + else + echo "(ERROR): Unable to copy $executable" >&2 + exit 1 + fi +done + diff --git a/meta/recipes-initramfs/initramfs-hook/files/script-header.tmpl b/meta/recipes-initramfs/initramfs-hook/files/script-header.tmpl new file mode 100644 index 00000000..faa1a644 --- /dev/null +++ b/meta/recipes-initramfs/initramfs-hook/files/script-header.tmpl @@ -0,0 +1,26 @@ +#!/bin/sh +# +# Copyright (c) Siemens AG, 2024 +# +# Authors: +# Jan Kiszka +# +# SPDX-License-Identifier: MIT +# + +set -e + +prereqs() +{ + echo "${SCRIPT_PREREQ}" +} + +case $1 in +prereqs) + prereqs + exit 0 + ;; +esac + +. /scripts/functions + diff --git a/meta/recipes-initramfs/initramfs-hook/hook.inc b/meta/recipes-initramfs/initramfs-hook/hook.inc new file mode 100644 index 00000000..5509c074 --- /dev/null +++ b/meta/recipes-initramfs/initramfs-hook/hook.inc @@ -0,0 +1,74 @@ +# +# Copyright (c) Siemens AG, 2024 +# +# Authors: +# Jan Kiszka +# +# SPDX-License-Identifier: MIT +# + +FILESPATH:append := ":${FILE_DIRNAME}/files" + +inherit dpkg-raw + +SRC_URI = " \ + file://hook-header.tmpl \ + file://script-header.tmpl" + +TEMPLATE_FILES = " \ + hook-header.tmpl \ + script-header.tmpl" + +TEMPLATE_VARS:append = " \ + HOOK_PREREQ \ + HOOK_ADD_MODULES \ + HOOK_COPY_EXECS \ + SCRIPT_PREREQ" + +HOOK_PREREQ ?= "" +HOOK_ADD_MODULES ?= "" +HOOK_COPY_EXECS ?= "" +SCRIPT_PREREQ ?= "" + +DEBIAN_DEPENDS = "initramfs-tools" + +def get_initramfs_hook_name(d): + name = d.getVar('BPN') + if name.startswith("initramfs-"): + name = name[10:] + if name.endswith("-hook"): + name = name[:-5] + return name + +INITRAMFS_HOOK_NAME ?= "${@get_initramfs_hook_name(d)}" + +do_install() { + if [ -f "${WORKDIR}/hook" ] || [ -n "${HOOK_COPY_EXECS}" ] || \ + [ -n "${HOOK_ADD_MODULES}" ]; then + rm -rf "${D}/usr/share/initramfs-tools/hooks" + install -d -m 0755 "${D}/usr/share/initramfs-tools/hooks" + + install -m 0755 "${WORKDIR}/hook-header" \ + "${D}/usr/share/initramfs-tools/hooks/${INITRAMFS_HOOK_NAME}" + if [ -f "${WORKDIR}/hook" ]; then + cat "${WORKDIR}/hook" >> \ + "${D}/usr/share/initramfs-tools/hooks/${INITRAMFS_HOOK_NAME}" + else + echo "exit 0" >> \ + "${D}/usr/share/initramfs-tools/hooks/${INITRAMFS_HOOK_NAME}" + fi + fi + + for script in init-top init-premount local-top nfs-top local-block \ + local-premount nfs-premount local-bottom nfs-bottom \ + init-bottom; do + if [ ! -f "${WORKDIR}/$script" ]; then + continue + fi + + rm -rf "${D}/usr/share/initramfs-tools/scripts/$script" + install -d -m 0755 "${D}/usr/share/initramfs-tools/scripts/$script" + install -m 0755 "${WORKDIR}/$script" \ + "${D}/usr/share/initramfs-tools/scripts/$script/${INITRAMFS_HOOK_NAME}" + done +}