From patchwork Fri Aug 4 14:25:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Eatmon X-Patchwork-Id: 28408 X-Patchwork-Delegate: reatmon@ti.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5381CC001DB for ; Fri, 4 Aug 2023 14:25:49 +0000 (UTC) Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by mx.groups.io with SMTP id smtpd.web11.12421.1691159141106327112 for ; Fri, 04 Aug 2023 07:25:41 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=fptc0lPa; spf=pass (domain: ti.com, ip: 198.47.23.249, mailfrom: reatmon@ti.com) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 374EPcYC104009; Fri, 4 Aug 2023 09:25:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1691159138; bh=gZKqe4L0h9znpYv9Ywesgv9q9LnjWOYMZHk/Kkn3gd4=; h=From:To:Subject:Date:In-Reply-To:References; b=fptc0lPa7Za5OfOTOAAZwRyLVrp/HXBfHn3wXnmTYLEWEnFnMyGmWQc91uJkEPNfS HrXyZkX+TaIXeYr/VsZgDGqK/wdkVBkLS9kOiO2/0ZjOTqD5uVPTOSwyg990pg40oD KwmBoecWaU2a3jFy0qPAie81WwBaBnAO+o9xSLRo= Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 374EPcFe004237 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 4 Aug 2023 09:25:38 -0500 Received: from DLEE106.ent.ti.com (157.170.170.36) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Fri, 4 Aug 2023 09:25:37 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE106.ent.ti.com (157.170.170.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Fri, 4 Aug 2023 09:25:37 -0500 Received: from uda0214219 (ileaxei01-snat.itg.ti.com [10.180.69.5]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 374EPbK1006816; Fri, 4 Aug 2023 09:25:37 -0500 Received: from reatmon by uda0214219 with local (Exim 4.90_1) (envelope-from ) id 1qRvkH-0005kl-Gv; Fri, 04 Aug 2023 09:25:37 -0500 From: Ryan Eatmon To: Praneeth Bajjuri , Denys Dmytriyenko , Subject: [meta-arago][master/kirkstone][PATCH v2 2/3] tisdk-tiny-initramfs: Create a smaller dedicated initramfs for tiny Date: Fri, 4 Aug 2023 09:25:36 -0500 Message-ID: <20230804142537.22072-2-reatmon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230804142537.22072-1-reatmon@ti.com> References: <20230804142537.22072-1-reatmon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 04 Aug 2023 14:25:49 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arago/message/14821 The initramfs does not need grub-efi or the /boot directory since it does not have to boot the system itself. So create a version of the tiny-image that strips those out and follow the oe-core methodology for initramfs. Signed-off-by: Ryan Eatmon --- .../classes/remove-boot-dir.bbclass | 8 ++++++ .../images/tisdk-tiny-initramfs.bb | 26 +++++++++++++++++++ .../packagegroup-arago-initramfs.bb | 4 +++ 3 files changed, 38 insertions(+) create mode 100644 meta-arago-distro/classes/remove-boot-dir.bbclass create mode 100644 meta-arago-distro/recipes-core/images/tisdk-tiny-initramfs.bb create mode 100644 meta-arago-distro/recipes-core/packagegroups/packagegroup-arago-initramfs.bb diff --git a/meta-arago-distro/classes/remove-boot-dir.bbclass b/meta-arago-distro/classes/remove-boot-dir.bbclass new file mode 100644 index 00000000..bd0c09fc --- /dev/null +++ b/meta-arago-distro/classes/remove-boot-dir.bbclass @@ -0,0 +1,8 @@ +# Add a ROOTFS_POSTPROCESS_COMMAND that will remove some files from the +# rootfs for initramfs images. + +ROOTFS_POSTPROCESS_COMMAND += "remove_boot_dir;" + +remove_boot_dir () { + rm -rf ${IMAGE_ROOTFS}/boot +} diff --git a/meta-arago-distro/recipes-core/images/tisdk-tiny-initramfs.bb b/meta-arago-distro/recipes-core/images/tisdk-tiny-initramfs.bb new file mode 100644 index 00000000..0bea8276 --- /dev/null +++ b/meta-arago-distro/recipes-core/images/tisdk-tiny-initramfs.bb @@ -0,0 +1,26 @@ +SUMMARY = "Arago TI SDK super minimal base image for initramfs" + +DESCRIPTION = "Image meant for basic boot of linux kernel. Intended as\ + bare system, this image does not package the kernel in the\ + standard /boot folder in rootfs. Instead, it provides a base\ + rootfs allowing kernel to be deployed elsewhere\ + (tftp/separate boot partition/jtag log etc..) and boot\ + the image.\ +" + +LICENSE = "MIT" + +inherit core-image +inherit remove-boot-dir + +IMAGE_FEATURES:remove = "package-management" + +INITRAMFS_FSTYPES = "cpio cpio.xz" +INITRAMFS_MAXSIZE = "65536" +IMAGE_OVERHEAD_FACTOR = "1" + +IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" + +PACKAGE_INSTALL = "packagegroup-arago-initramfs" + +export IMAGE_BASENAME = "tisdk-tiny-initramfs" diff --git a/meta-arago-distro/recipes-core/packagegroups/packagegroup-arago-initramfs.bb b/meta-arago-distro/recipes-core/packagegroups/packagegroup-arago-initramfs.bb new file mode 100644 index 00000000..380cc0e3 --- /dev/null +++ b/meta-arago-distro/recipes-core/packagegroups/packagegroup-arago-initramfs.bb @@ -0,0 +1,4 @@ + +require recipes-core/packagegroups/packagegroup-core-boot.bb + +RDEPENDS:${PN}:remove = "grub-efi kernel"