From patchwork Mon Jan 18 00:07:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harald Seiler X-Patchwork-Id: 273 Return-Path: Delivered-To: ilbers.mnt@gmail.com Received: by 2002:a4a:b386:0:0:0:0:0 with SMTP id p6csp2288850ooo; Mon, 18 Jan 2021 02:08:47 -0800 (PST) X-Received: by 2002:a2e:2e19:: with SMTP id u25mr9766786lju.468.1610964527364; Mon, 18 Jan 2021 02:08:47 -0800 (PST) ARC-Seal: i=3; a=rsa-sha256; t=1610964527; cv=pass; d=google.com; s=arc-20160816; b=U5tw9T5dQpBwjwNokoB2HlHKCOtEL7EBb/SeIA0pSJeQy+/Bp7uC51jgPxaHFVyDRD 4SfoyVL+RNmJMcJokO8lsTw8Xsexdmpkwk+sq6hLNXVaWzuppoo7IksgRwANTKRM5xEK y0z4WppgLEKaWuJHgSlBrEKOBOB9HVr+b8axA3oiAE8ShN4IuSUHuap6u+Vs4kvyNsS8 X1oZuUNNINjHxN4g6j0TFJsV50qvOTj0ZcsuQuY5T1n9HsKdefc/oNZhuZu9eQQaNjUn g6bj2+rb3ovL/S/QL0SXY7HxMndoX6+MtyhNDIoE3pFOK0NMCdtk1TIy8C66PcqIEjs6 ommA== ARC-Message-Signature: i=3; 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:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=IXRSAhrr+rcGaoK6fk/XvHgMYHG1Xct/1Z1iupZf/Q0=; b=hwsgaJN8LRpEDy6Vct1XumHKtkleS9ORLChhv0nU6GU9WxwreC/CqDZXc3kJ0V7baJ V06DDhNNX7/GoWyj5pw1aZCINMzg7c/le1bvNpN+3dnYzjZsLG8RFD4uzEJpRBacOScJ zlxSYNfSrCRIjUDYzq6xB2bjQdVTD4ytjBsjuFtXMhvRd36D+/eKVcJz0OK6Zp439nN3 gch+BgFAGgCXegmx3l1rj0eHzWtmH25DxnVLGoLGLhBsLzI5a3poE5p9ZTB0KIdtyA+A qPSMBN8f0jkg5+elzTB+nQMdzKjPQoFIJgue9L+ECe/XFtmKOPr5poAA5yroAQcVmq+6 Mpbg== ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b=JZy867gO; arc=pass (i=2); spf=pass (google.com: domain of isar-users+bncbczlpqw3rykrblv4swaamgqekiqblei@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCZLPQW3RYKRBLV4SWAAMGQEKIQBLEI@googlegroups.com Received: from mail-sor-f55.google.com (mail-sor-f55.google.com. [209.85.220.55]) by mx.google.com with SMTPS id o13sor3753120lfg.44.2021.01.18.02.08.47 (Google Transport Security); Mon, 18 Jan 2021 02:08:47 -0800 (PST) Received-SPF: pass (google.com: domain of isar-users+bncbczlpqw3rykrblv4swaamgqekiqblei@googlegroups.com designates 209.85.220.55 as permitted sender) client-ip=209.85.220.55; Authentication-Results: mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b=JZy867gO; arc=pass (i=2); spf=pass (google.com: domain of isar-users+bncbczlpqw3rykrblv4swaamgqekiqblei@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCZLPQW3RYKRBLV4SWAAMGQEKIQBLEI@googlegroups.com ARC-Seal: i=2; a=rsa-sha256; t=1610964527; cv=pass; d=google.com; s=arc-20160816; b=GlBPIbVl6akGvjHOfxXzCfVth9FesecbhPWgBP9rSFommXtttNn0lmbG2o/XQnYR2M tYlFtDWErCIcN5SnmtYuVmNIiEWuO4JXkFxL9Ae7HKgfXaM++ET1xUO3P8+301rId11+ ClVIL7Wh42zd6P89l5V277daKZWzJeInufwP++6vf+32J5FAyeep0emALpNzGVNH6qnP ZIboL8esqa84VMIhtLRkUHYPqOCJIPxYJ0RGjojtd51rfhu85qpUcj3vWRIwM1/5OQxp X2rj1E8leNLHdznwgi0Gs/LndZxuJwe65Qp0f/b6pxJz8vgxcHS0NNmkHXNnp0OWFJ9z nWqg== 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:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=IXRSAhrr+rcGaoK6fk/XvHgMYHG1Xct/1Z1iupZf/Q0=; b=I3zxt9PLHNIi3/yTFU261Rq0l06dKVPX1415P7PwdUj6YNUmLt9vlB/L55s5zPRrD6 weS4jz5prxu8TqL35/WfEj9wogemQaOuCuNwD8Rs16AJFYwhgiPgpOYzklYWCsUb1Eax krRFaNn8e2LN81mjtpxYfBnOexnJLHmSV8Y9+Zf5/+oPZNNIHswcj9wK1EBcdMcVcTbu jV/nIJdrYR11g+yLQ7HUP25ryUEzmdrUoSY3YbyTWPbTJpRw646E6KGKfqntElNygBIx YbizQKJIESdipc8rjIeAR2VjEABOt9vKPTX/ozu5O/16HMqeGn0BVZgWY30TcW5SYICj mQYA== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of hws@denx.de) smtp.mailfrom=hws@denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=IXRSAhrr+rcGaoK6fk/XvHgMYHG1Xct/1Z1iupZf/Q0=; b=JZy867gOluNzNVKPBZKqVjEKPLln5/iGoFUhWJSQHU9VSdieKcy5ejF7sDKo5ITEDM ua1FeiNoAkmzgH/wsmBoWpM48j7kbyDrvCxO4EBkpi8Q+3QsWnCwhT29JuWKVRQvmDzZ V7pv+KxsY8ZZ9sX9ECJegIYvBI7/oWXq5/vokuaNLhhGFX9QqOtyf4Rd/vgAR64jf2ZM r2fwkQsAzJmxhTSfRhv8kEC/D+gs0hexFWkFQX6gG3HMfXaZy0+2JyE4LW1x83ajd/Kr SSic3qvYpj3gi40kaBfk9WjC4thOD5e/hSRXQvheE9hbbF00CogFT4pGBvokBStHHCoi ujDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=IXRSAhrr+rcGaoK6fk/XvHgMYHG1Xct/1Z1iupZf/Q0=; b=bOP1yjZyRaUYAW0TBHgXAX4fWZ4i5KbFcEBnrYfOnjQQK4yGrhYMsh5euGooBOFXqZ DFTUD/L7ujNTdZtd0ofOVC7VNHMBY9070tIBwuSiRgmQBtPWjTuDyNHhHaYGKwRQUkqJ cTOQgOuUixKJX8KjEwob9oT6r10gOpRevy0IYZ4stdW7LfFydB7foyf/iqEKqumtt3N9 vO4fDCYRlUcqE3CKgvzS5e4A/kbn56zUIhSav/4bpWjx8ur0tMphw8PB+lP5n387WuPg xZz11yUL6cEcjksDZTPXILv4V1gDXiBLUWov4Hvb3N7kcX4Aa9+dcY82GaoGhFYjqJdO pa7w== Sender: isar-users@googlegroups.com X-Gm-Message-State: AOAM532Kogx8SxdMBKm7mSIJBpLI11aBzsNDNNSgQCGEeMAUXTVqWIcS qvAmhbia3BRWgbb36cHXVJw= X-Google-Smtp-Source: ABdhPJzmLWNwFx0VzGxPBVmu1eznQVjCDbX9XnBfQDZT12qiqMiixkovr2XxbfQ3ZtEAPt3az8ChiA== X-Received: by 2002:a19:797:: with SMTP id 145mr10620374lfh.651.1610964527072; Mon, 18 Jan 2021 02:08:47 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a19:6145:: with SMTP id m5ls2435121lfk.2.gmail; Mon, 18 Jan 2021 02:08:46 -0800 (PST) X-Received: by 2002:ac2:46e7:: with SMTP id q7mr10516397lfo.311.1610964526208; Mon, 18 Jan 2021 02:08:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610964526; cv=none; d=google.com; s=arc-20160816; b=wiixAjTYmkfsNzpAEhhERuRqiLOoZlPRJSin6PuGAFa4BNuf+LXXs2krsNlPxKbb+2 wNgECqECx8G2oA+TafjJuPIzo5RVv5oEkcIjDnv/SY/hNOfI9fgjtUnMtMXwSIfU9ITg 9HbSLa4BPsCD12PD3PvQSzNPLiTvJUp6x5wGJC3IqU/YLaqYMaSrzA4j9tuerx1gWE5e ZXwfHpTbJBvO7MnpK2dGlSZPUaxCHHKDqicxiwZw/0tUmSJ7vPn41V/5NGjq4r70eSIu U6CM5tLU1WI4LcVqGPnF2VvSxeteP/Q9tDuBr5Vfe5bWcB7vPMhSJqCbRqeOG5f4kzNg 8dqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=CDVew4gbAsnRTQ13Xl4RRpCV1PfelN0ZqX1Dg6Zz4SI=; b=fKYny9/gpMuhF/060sne0R3gUntq1mO54zvWsuu9U5Tz/54VpKV449uncG1TlrDEgg hwb1IY11VKm64ZJvz+y8ZTYpPf4FKgQhMUwxsgB6j9WYFGS+osaNmgz2edmPf1z6XUiH dSJVLjOhLDrsMYTcYUEVL/gkPJFEMpdnHWWAVq1bES1HlMu09tY9xyi+4wpc9JsWoKHN yLaYd1EfO3M1RIcIRklMFXXIt5/hb88yEwrJ2RrfNbqZXFnGbn25XDDvhhv9HN1swbDj VMuoj3hNHKjjFGVWMnrahRKE0wzhWEpkd6PBDPc+Kx7trioOtC+AIpCEgGWq/gUUP4z5 urMQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of hws@denx.de) smtp.mailfrom=hws@denx.de Received: from mail-out.m-online.net (mail-out.m-online.net. [212.18.0.9]) by gmr-mx.google.com with ESMTPS id r12si595531ljm.1.2021.01.18.02.08.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Jan 2021 02:08:46 -0800 (PST) Received-SPF: neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of hws@denx.de) client-ip=212.18.0.9; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4DK6v15mXzz1qs3n; Mon, 18 Jan 2021 11:08:45 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4DK6v15TMBz1tSQZ; Mon, 18 Jan 2021 11:08:45 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id UOggrWUeQgI1; Mon, 18 Jan 2021 11:08:44 +0100 (CET) X-Auth-Info: TDL5YHWqIAJcAWDT4PJkqqCapDXqC5c5CHWbtCOHsK8= Received: from maia.denx.de (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Mon, 18 Jan 2021 11:08:44 +0100 (CET) From: Harald Seiler To: isar-users@googlegroups.com Cc: Harald Seiler , Jan Kiszka , "florian . bezdeka @ siemens . com" Subject: [PATCH v4 2/3] Add example initramfs module recipe Date: Mon, 18 Jan 2021 11:07:28 +0100 Message-Id: <20210118100729.138523-2-hws@denx.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210118100729.138523-1-hws@denx.de> References: <20210118100729.138523-1-hws@denx.de> MIME-Version: 1.0 X-Original-Sender: hws@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of hws@denx.de) smtp.mailfrom=hws@denx.de 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1689218740138428341?= X-GMAIL-MSGID: =?utf-8?q?1689218740138428341?= Add the initramfs-example recipe/package which demonstrates how to write initramfs modules. It demonstrates how to add hook scripts, boot scripts, and conf-hooks. Signed-off-by: Harald Seiler --- Notes: Changes in v3: - None Changes in v4: - None .../initramfs-example/files/example.conf-hook | 7 ++++ .../initramfs-example/files/example.hook | 19 +++++++++ .../initramfs-example/files/example.script | 21 ++++++++++ .../initramfs-example/initramfs-example.bb | 40 +++++++++++++++++++ 4 files changed, 87 insertions(+) create mode 100644 meta-isar/recipes-initramfs/initramfs-example/files/example.conf-hook create mode 100644 meta-isar/recipes-initramfs/initramfs-example/files/example.hook create mode 100644 meta-isar/recipes-initramfs/initramfs-example/files/example.script create mode 100644 meta-isar/recipes-initramfs/initramfs-example/initramfs-example.bb diff --git a/meta-isar/recipes-initramfs/initramfs-example/files/example.conf-hook b/meta-isar/recipes-initramfs/initramfs-example/files/example.conf-hook new file mode 100644 index 000000000000..2a3cf7a84040 --- /dev/null +++ b/meta-isar/recipes-initramfs/initramfs-example/files/example.conf-hook @@ -0,0 +1,7 @@ +# Example conf-hook. +# +# See "CONFIGURATION HOOK SCRIPTS" in initramfs-tools(7) for details. + +# Example: Use busybox instead of klibc-utils. The package must also add +# `busybox` as a dependency when this is set. +BUSYBOX=y diff --git a/meta-isar/recipes-initramfs/initramfs-example/files/example.hook b/meta-isar/recipes-initramfs/initramfs-example/files/example.hook new file mode 100644 index 000000000000..0d84e7a97efd --- /dev/null +++ b/meta-isar/recipes-initramfs/initramfs-example/files/example.hook @@ -0,0 +1,19 @@ +#!/bin/sh +# Example hook script. +# +# See "HOOK SCRIPTS" in initramfs-tools(7) for details. + +PREREQ="" +prereqs() +{ + echo "$PREREQ" +} +case $1 in +prereqs) + prereqs + exit 0 + ;; +esac + +. /usr/share/initramfs-tools/hook-functions +# Begin real processing below this line diff --git a/meta-isar/recipes-initramfs/initramfs-example/files/example.script b/meta-isar/recipes-initramfs/initramfs-example/files/example.script new file mode 100644 index 000000000000..784fad9c99bb --- /dev/null +++ b/meta-isar/recipes-initramfs/initramfs-example/files/example.script @@ -0,0 +1,21 @@ +#!/bin/sh +# Example boot script. +# +# See "BOOT SCRIPTS" in initramfs-tools(7) for details. + +PREREQ="" +prereqs() +{ + echo "$PREREQ" +} +case $1 in +prereqs) + prereqs + exit 0 + ;; +esac + +. /scripts/functions +# Begin real processing below this line + +log_success_msg "Hello from ISAR!" diff --git a/meta-isar/recipes-initramfs/initramfs-example/initramfs-example.bb b/meta-isar/recipes-initramfs/initramfs-example/initramfs-example.bb new file mode 100644 index 000000000000..c336dda92b5d --- /dev/null +++ b/meta-isar/recipes-initramfs/initramfs-example/initramfs-example.bb @@ -0,0 +1,40 @@ +# Example of a recipe containing an initramfs module. Packages like this can be +# used with initramfs.bbclass or installed directly into a rootfs, depending on +# the usecase. +# +# This software is a part of ISAR. + +DESCRIPTION = "Sample initramfs module for ISAR" +MAINTAINER = "Your name here " +DEBIAN_DEPENDS = "initramfs-tools" + +# If the conf-hook enables BUSYBOX=y, busybox is needed: +DEBIAN_DEPENDS .= ", busybox" + +SRC_URI = " \ + file://example.conf-hook \ + file://example.hook \ + file://example.script \ + " + +inherit dpkg-raw + +do_install[cleandirs] += " \ + ${D}/usr/share/initramfs-tools/conf-hooks.d \ + ${D}/usr/share/initramfs-tools/hooks \ + ${D}/usr/share/initramfs-tools/scripts/local-top \ + " +do_install() { + # See "CONFIGURATION HOOK SCRIPTS" in initramfs-tools(7) for details. + install "${WORKDIR}/example.conf-hook" \ + "${D}/usr/share/initramfs-tools/conf-hooks.d/isar-example" + + # See "HOOK SCRIPTS" in initramfs-tools(7) for details. + install "${WORKDIR}/example.hook" \ + "${D}/usr/share/initramfs-tools/hooks/isar-example" + + # Note that there are other places where a boot script might be deployed to, + # apart from local-top. See "BOOT SCRIPTS" in initramfs-tools(7) for details. + install "${WORKDIR}/example.script" \ + "${D}/usr/share/initramfs-tools/scripts/local-top/example.script" +}