From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Wed, 05 Nov 2025 13:14:13 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-ed1-f57.google.com (mail-ed1-f57.google.com [209.85.208.57]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 5A5CEBlk018672 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 5 Nov 2025 13:14:12 +0100 Received: by mail-ed1-f57.google.com with SMTP id 4fb4d7f45d1cf-64081e1f6a0sf5700954a12.1 for ; Wed, 05 Nov 2025 04:14:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1762344845; cv=pass; d=google.com; s=arc-20240605; b=BROO9m66oiqmhD8uJF6FHRygcnSpRmSuCBRPh7fBmlhIviMANIcN0D6WXsqnLizViN jMty8Yu50TNCqGg1jS9X2K/VrIy1x6PINonx9c7h2/VXb2gc+L0sVyGli6eqWNpSXa4U xh3hekYUwCMbu01eHR4Aj3hG/i8kp1pjz6y4CE08H8Kolul/7ReIDL8yAI2I9aLYcCm5 mKVCwRsZsIBTjn1Ts4wA3n5u/jWqFOiI7wF44y7rRXmxmndzjpBSRwKxH9npvvjSiXrW nskmkooz1ioamios4Po98fwpHrkd/KEYpcVW8zvjjgInv8i0y/vFVo4gfyw7OctERuYJ et+Q== 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:to:from :dkim-signature; bh=m6NHHdGhsiMM0VSZJQZtbC9HM/UYXkFDxmCdj/erVqI=; fh=EwiRY2l39C7I4qg63PMh26RQKh1+LP431BuK4t9KtRE=; b=X96w1j1B7ZOtwXKupZBz9N0qtuQVwkKAXeLxgabqAWqVF0PQmE4Wxm9egLaTRvgaNn NFHMKMuPGPSXb4mUTaWsE24uI20f4hMKSM7fId4BDEc6Chd1wvp21ZzXPoGOMz6J4VWW TBAab6Z+/ErmMklyNxAjTAQrgrY/Q9N8SM5wYXBKWkBFm7neL5bSEO+X4ujRp3XKD32L MZZhfUARM7k/tTDdVyRSJYv43UYPY2muK05mwRv8LZRRlo1pBajHTPLeLBWm9G7c84Vw 95aPOgRWO1r+YXOW77NPRzSqyh9FhL7Bb7f0SV1rDBheD80D326Q6Hfg6OO+4HjVTA/8 djAQ==; darn=ilbers.de ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=mHO7VJCX; spf=pass (google.com: domain of fm-51332-2025110512140150b6c1fea800020732-0vmhej@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-51332-2025110512140150b6c1fea800020732-0vMHEJ@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=1762344845; x=1762949645; darn=ilbers.de; 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:to:from :from:to:cc:subject:date:message-id:reply-to; bh=m6NHHdGhsiMM0VSZJQZtbC9HM/UYXkFDxmCdj/erVqI=; b=AcJJ2Q0sBu9bvJhTlZcjQhmXkKZE9kCtHEiN3gqjnWtYrIaHdpxoZbuzAetQUtYpYi HQx1ANS0gRzCFI/RZIB6M1at50kMrn+BPOCKAxeVGCiudgTWV4HZraG2oi76hoVx4+iy 3PNYMTBsyP1RRpl+hvKxT03bdgXl8wufQRAY6f+V+VS8QIIR+7QMbr3UiQIe9Usg5aaa IZaAIlqF7KMMklcSm3FS7V57MoLt/NCTe8x6jenH1A9cRBTtqU3nhe+qiGg2B++iSMIq y3Ro4uYWmN79Wfu7ITvRsW50/wmZwUBqqMCfd6PP2XW+AFdqauPhaqhGZ4j1kvwdQSeF tuqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762344845; x=1762949645; 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:to:from :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=m6NHHdGhsiMM0VSZJQZtbC9HM/UYXkFDxmCdj/erVqI=; b=Kq2FC+Dh69bzU8Fj4pW8EBy46Xfj/hDGgINzPOo5nTzwUxw4nlnPjNRxLhkFv+Jrt0 Vvimeh1xT41OnNxM6TSUIJCV+rVpTPqBGHPs5fltSHTzzluFLATnWWJy2Xw6ZxqLfd1B 4AprEwbBMDdfqL5QreK79i06eLlHXfWjih3QwIFydPsXuVEEHRgU8qVGvyV+3jRb1Y99 bSwGgqypo2eKSteW01bqjoKPVaVvn80vPLJc3twiIZZqxJ1ZXG/1mvBcvj/AJ0JxSbGI /Z9wE+aXx6N/numez0epxU+kqH9kW8tl6zpGEH/hhFBMinBQXhi2dScU7ePp0YiyYIVy EMgw== X-Forwarded-Encrypted: i=2; AJvYcCUYniVJlfCkj2EHEwnhG6l688sbdsQb9Lbgj/HdYuvIq5nSsIcldn/Ujn96x68STCpWi2nO@ilbers.de X-Gm-Message-State: AOJu0Yyg7CUb9AJF9HBF2IM3qCMa88R7xlp8QyaeKxkZnMeIDwv7BxNg JU+GBhWMYGuDO1ybbXxR/Bn7IdSgGIggblhwb6qrCb6JdfVlOqIE5U89 X-Google-Smtp-Source: AGHT+IG2GsDRSnmfpr90iuDp+MQb/vX3GsKDhtne7zPfqdX+uzfQ7WZtWpej9lOQAlJufm4qGLLDJQ== X-Received: by 2002:a05:6402:5351:20b0:640:93b2:fd07 with SMTP id 4fb4d7f45d1cf-64105c9625dmr2142002a12.33.1762344844741; Wed, 05 Nov 2025 04:14:04 -0800 (PST) X-BeenThere: isar-users@googlegroups.com; h="Ae8XA+apthevhVx9kNy64+KUtNCCWzVuNceMT2DvQacfz8EhGA==" Received: by 2002:a05:6402:120e:b0:640:ec04:2e56 with SMTP id 4fb4d7f45d1cf-640ec04338bls1679184a12.2.-pod-prod-02-eu; Wed, 05 Nov 2025 04:14:01 -0800 (PST) X-Received: by 2002:a17:907:3c93:b0:b40:cfe9:ed2c with SMTP id a640c23a62f3a-b72655abb0dmr299407166b.64.1762344841712; Wed, 05 Nov 2025 04:14:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1762344841; cv=none; d=google.com; s=arc-20240605; b=WY2mdwvu91ASu1odsVPE/4SdC3j7YEUG8awY+qdK7Bmk5TW2Sb7qLU/6e9hKcJwp5O 66LxQ5CjsaH9CiE1Pojcd6YnR2DBCzvZu/ZKnadles16A27ehhTeu6pmslZaVckmauAr vL7Po9jEQg5FDdL+NZE6tPaT48o70ZOuY1r8qQoOtN0MhwAGuqtscPvgHwn+RH4xe9sQ P9adGH7iT5qgXdXRsJo5fLRmoW7DmN8EQ0rXyZjbsmszwrQoHwCZIw+qeqiDJ/KAy9dP A0DhuXThHnORdzJdQPN+5pVBZznqcmnIt0ujpa2oDEePkjJYPDGX+M2NCrM5GBm8d0Nu q7Dw== 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:to:from:dkim-signature; bh=TrjJjwe5Q/QqXfugqLcIpDSrDJxMThyL3JFU0gUO518=; fh=pD9NMAE6punlmxDz2SM7DMFwkWrKOHAvTYxfub7CxRs=; b=iB7/9+5IhvsIKF4BfTf1Vxb4P6DJkqFYjhbxiWOsCh7IfFvLdq8hG40v1H/RoemZg2 QIHQQtVGYZAI77b8as582YcCBsMasTA1ZKnZWlopHUfaSpm2k6E+6flnJXWORhpwqknX t30aQYbOxzI4+xcIv5rnavbCdS8LzjbrxFKK/db5utMXorUM/H2bXQ5s1vDnGQ1pz1Ei Kn0VfOrOI2T+RivUP1X283/u2I1fhgMhFj7vT2VKS8rD0JN1+zT+IeAVmB9vQpRAjGBt 6ybxnLtuoB2PEPglDPXKgWDNaAHjAfEoyFLeXPB3Mo5BlObg+VydhMEQWC0MzGearcx8 2kQQ==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=mHO7VJCX; spf=pass (google.com: domain of fm-51332-2025110512140150b6c1fea800020732-0vmhej@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-51332-2025110512140150b6c1fea800020732-0vMHEJ@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 a640c23a62f3a-b724130ff62si17951066b.3.2025.11.05.04.14.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Nov 2025 04:14:01 -0800 (PST) Received-SPF: pass (google.com: domain of fm-51332-2025110512140150b6c1fea800020732-0vmhej@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 2025110512140150b6c1fea800020732 for ; Wed, 05 Nov 2025 13:14:01 +0100 From: "'Quirin Gylstorff' via isar-users" To: isar-users@googlegroups.com, jan.kiszka@siemens.com, felix.moessbauer@siemens.com, cedric.hombourger@siemens.com Subject: [PATCH v7 08/13] Add class to generate custom dracut initramfs Date: Wed, 5 Nov 2025 13:12:39 +0100 Message-ID: <20251105121350.114449-9-Quirin.Gylstorff@siemens.com> In-Reply-To: <20251105121350.114449-1-Quirin.Gylstorff@siemens.com> References: <20251105121350.114449-1-Quirin.Gylstorff@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-51332:519-21489:flowmailer X-Original-Sender: quirin.gylstorff@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=mHO7VJCX; spf=pass (google.com: domain of fm-51332-2025110512140150b6c1fea800020732-0vmhej@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-51332-2025110512140150b6c1fea800020732-0vMHEJ@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com X-Original-From: Quirin Gylstorff Reply-To: Quirin Gylstorff Content-Type: text/plain; charset="UTF-8" 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-TUID: Wo3vPi2MB05z From: Quirin Gylstorff This class allows to customize a dracut initramfs by using configuration files add addition modules and drivers. It is recommended to use the addition of modules and drivers sparely and prefer dracut configuration files. This class has the option to add custom modules automatically to the initramfs if: - The modules are provided by the ISAR build system - The module name is part of the package name, valid names are - dracut- - -dracut - -dracut- Signed-off-by: Quirin Gylstorff --- meta/classes-recipe/initrd-dracut.bbclass | 58 +++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 meta/classes-recipe/initrd-dracut.bbclass diff --git a/meta/classes-recipe/initrd-dracut.bbclass b/meta/classes-recipe/initrd-dracut.bbclass new file mode 100644 index 00000000..0602c364 --- /dev/null +++ b/meta/classes-recipe/initrd-dracut.bbclass @@ -0,0 +1,58 @@ +# This software is a part of ISAR. +# This class provides the necessary options to +# customize a dracut based initramfs. +# +# This class should not provide every dracut cmdline +# option possible. Use the dracut configuration files. + +INITRAMFS_GENERATOR_PKG = "dracut" + +# The preferred way to configure dracut is to +# provide dracut-config- package which +# contains all necessary config options +DRACUT_CONFIG_PATH ??= "" + +# Variable to add additional kernel driver to the initrd +DRACUT_EXTRA_DRIVERS ??= "" + +# Variable to add additional dracut modules to the initrd +DRACUT_EXTRA_MODULES ??= "" + +# This option does not work with some of the dracut modules in Debian +# as there is no standardized mapping between module name and package name +DRACUT_EXTRACT_MODULES_FROM_PACKAGE_NAMES ??= "False" + +def extend_dracut_cmdline(d): + config_path = d.getVar('DRACUT_CONFIG_PATH') or '' + extra_drivers = d.getVar('DRACUT_EXTRA_DRIVERS') or '' + extra_modules = d.getVar('DRACUT_EXTRA_MODULES') or '' + enable_module_extraction = bb.utils.to_boolean(d.getVar('DRACUT_EXTRACT_MODULES_FROM_PACKAGE_NAMES')) + pkg_list = d.getVar('INITRAMFS_INSTALL') or '' + + cmdline = [] + modules_from_pkg_names = [] + if enable_module_extraction: + for pkg in pkg_list.split(): + # Skip dracut-config-* packages + if pkg.startswith('dracut-config-'): + continue + elif pkg.startswith('dracut-'): + modules_from_pkg_names.append(pkg[7:]) + elif pkg.endswith('-dracut'): + modules_from_pkg_names.append(pkg[:-7]) + elif '-dracut-' in pkg: + _, module_name = pkg.split('-dracut-', 1) + modules_from_pkg_names.append(module_name) + extra_modules = extra_modules + ' ' +' '.join(modules_from_pkg_names) + + if config_path: + cmdline.append(f"--conf {config_path}") + if extra_drivers: + cmdline.append(f"--add-drivers {extra_drivers}") + if extra_modules: + cmdline.append(f"--add {extra_modules}") + return ' '.join(cmdline) + +ROOTFS_INITRAMFS_GENERATOR_CMDLINE:append = " ${@ extend_dracut_cmdline(d)}" + +inherit initramfs -- 2.51.0 -- You received this message because you are subscribed to the Google Groups "isar-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/isar-users/20251105121350.114449-9-Quirin.Gylstorff%40siemens.com.