From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7091532166592462848 X-Received: by 2002:a05:600c:4e4f:b0:392:ae18:2347 with SMTP id e15-20020a05600c4e4f00b00392ae182347mr36712399wmq.45.1651125998184; Wed, 27 Apr 2022 23:06:38 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a5d:59a4:0:b0:20a:d221:a277 with SMTP id p4-20020a5d59a4000000b0020ad221a277ls6333041wrr.2.gmail; Wed, 27 Apr 2022 23:06:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwN2sSvBBc7xPREetNAr350YhscD1alyYPgqTW4/U6AN3w9mACylxmnf80RpuW0H560Kd03 X-Received: by 2002:a5d:61c2:0:b0:20a:d92f:9056 with SMTP id q2-20020a5d61c2000000b0020ad92f9056mr16025213wrv.652.1651125997155; Wed, 27 Apr 2022 23:06:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1651125997; cv=pass; d=google.com; s=arc-20160816; b=CL+29DmwyotkhJVgXQ9dBU95pjxhj/Js49TlRLLlX9DGnXbgeG9riblB6nL37ZKVJ2 4lveGDAYvdda8hBSs5bAUx5fWBT/NbNZmvpi/Koqw9Wl8N/STpPaclNZf9CneZbGTmwI qT57mpOiQUrDLExspCkg98Rdmetz0GUBNQHR+qwZJbAUeub8bzdwWK/lG3mrqf+rgBmg 0mOZhboBX9+OcMkpUPgVs+je8NoKmqloyMJmcnhw5xUhgV3yOjna+vDvrb3fjZTIgZ3F LvahDCZ7P6Jh5hTHLVFx/MF4kCyW5WJ65f/BqLGDSXxaJldTinOVgYB4A8fAWUYf2cR6 IkRw== ARC-Message-Signature: i=2; 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:dkim-signature; bh=LJNntfJ2gS1x+E69bo7kqemDAHnKIqDz3ORvQEyywb0=; b=qxACAsqLwI0lU6SegwmnEDAObCiDH4Lpo4JTpeWR+iKyMHibYorNSRZ9oHcr/UgF4x UlbN/gl8loojUN880anJ4COmRfWkwLj7fWp39qCkfuBzkxvrVQIo/hIpKACDHLovmHcR fcLLGn7sbJ3Jvn3sFRwNqzn+fPgiMAEjWltgURo8ftcgGUOR2xwqRbU9wGet3+xA0x2B 7D3aQJOu3hFzkhmsmXH2d02Zg/mHOJqxXtLmuVvqXm3fr7LU/7RYvBvpTYcIbu+kKVuo 3MtZEx8MMm8M6+iamK8FhyspbXZD31OSK5mSgAhZE6hZdiSP0/1288eknhMXontGHzR6 DVhQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=uGy0L0Lo; arc=pass (i=1 spf=pass spfdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of adriaan.schmidt@siemens.com designates 2a01:111:f400:7d00::600 as permitted sender) smtp.mailfrom=adriaan.schmidt@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on20600.outbound.protection.outlook.com. [2a01:111:f400:7d00::600]) by gmr-mx.google.com with ESMTPS id d23-20020a1c7317000000b0038ebc691b17si503106wmb.2.2022.04.27.23.06.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Apr 2022 23:06:37 -0700 (PDT) Received-SPF: pass (google.com: domain of adriaan.schmidt@siemens.com designates 2a01:111:f400:7d00::600 as permitted sender) client-ip=2a01:111:f400:7d00::600; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=uGy0L0Lo; arc=pass (i=1 spf=pass spfdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of adriaan.schmidt@siemens.com designates 2a01:111:f400:7d00::600 as permitted sender) smtp.mailfrom=adriaan.schmidt@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=StK6dCz+eZcuyBQmHaCOouFAjgC5UaXU/nhNucrmrWUNigQTfB7vM1cJ00OmYee+hVmrpamaW5/AO46PijkAstqKrbagF0gZiUGLyU1imCvKh5zaoIK6lJVHFkdM833BHw4bEVbLKNAMsC0PZeMfAHKLcs3MwNu/r6E6x7Co+W+Oh50901ekV1iatv03raE4DhXMNfut1V0KjHxvJZIk0ceL37JcCyqGtgN20gV7yWKcOVjQ1EozNIQizSmZI92dw+B27br3eyeFkwyQ3lPriv55wpIw/3/vl1Kjzvbvk55lFwgT7j0a8n4+GHoD4R3trbUnAdzq+KaGPoR+ILV95g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=LJNntfJ2gS1x+E69bo7kqemDAHnKIqDz3ORvQEyywb0=; b=fgzVl6j7X2A4BgQbTamIJrU51tpzCTdRimB4sNn6pu1LRtEsp3nMMtGCl+rz/bKHkPZhyfgseeLc5B4BS8135NMeDh8XmqQ77kjS0DstDZ3o0BC5ZXtmKOFLuNdbeELrjVrs1sO5ZwycWLWTutTE2JQ9RcEiWJtRQARGifUXIUcgw49alDYy2pv8OwALdcib5ju7/B79Mye8sAlWMeoKCNGWBbk1MvSst2clw7A8kMKR9c33LrcQxsrWcpKpkRR2TeY8PiOvKxnob7EpIDum/JNZQF/c5ZutIxxaqbksZsWhiSnkdLFGLYGoaEuWo/fwhU6MIP7e7Yh2RgVPEhOksA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 194.138.21.72) smtp.rcpttodomain=googlegroups.com smtp.mailfrom=siemens.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=siemens.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=siemens.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LJNntfJ2gS1x+E69bo7kqemDAHnKIqDz3ORvQEyywb0=; b=uGy0L0LolB1Rm7BXXIMQQrU/Q/zhuOLyrkKjLIQSFH3EtRId7Vxv04eCw3zRvHtpzlvsdH7JuNuz0DYL3vneS3Fhn0zMMf3csa8af3q1SyDLUI3ugmIghWHKPuaqBQhbprW/MVH7vOd8SAzP50qcwtGxnRCMUdNjQEgSFl0JujcsfHAmHxvdayiKwlNADL8UP/Gp65lXTURtTrke8kvCWhNcVuasMxEh+tp8ED0DBzn2zJx5rPPA/A39eZ/+uZgpMN2jFeSWVvMhCYtMDACb87avpmiXvqpq3OEBzpX0FB1LTh5dR4sMWGVhWJubYDrV7ABiEFtFCf9jIdir5kAO4A== Received: from DU2P250CA0014.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:231::19) by AM6PR10MB2901.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:e5::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.15; Thu, 28 Apr 2022 06:06:35 +0000 Received: from DB5EUR01FT085.eop-EUR01.prod.protection.outlook.com (2603:10a6:10:231:cafe::e7) by DU2P250CA0014.outlook.office365.com (2603:10a6:10:231::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.14 via Frontend Transport; Thu, 28 Apr 2022 06:06:35 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 194.138.21.72) smtp.mailfrom=siemens.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=siemens.com; Received-SPF: Pass (protection.outlook.com: domain of siemens.com designates 194.138.21.72 as permitted sender) receiver=protection.outlook.com; client-ip=194.138.21.72; helo=hybrid.siemens.com; Received: from hybrid.siemens.com (194.138.21.72) by DB5EUR01FT085.mail.protection.outlook.com (10.152.5.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5206.12 via Frontend Transport; Thu, 28 Apr 2022 06:06:35 +0000 Received: from DEMCHDC89XA.ad011.siemens.net (139.25.226.103) by DEMCHDC9SMA.ad011.siemens.net (194.138.21.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 28 Apr 2022 08:06:35 +0200 Received: from random.ppmd.siemens.net (139.25.68.25) by DEMCHDC89XA.ad011.siemens.net (139.25.226.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 28 Apr 2022 08:06:34 +0200 From: Adriaan Schmidt To: CC: Adriaan Schmidt Subject: [PATCH v4 7/8] docs: add new imagetypes to user manual Date: Thu, 28 Apr 2022 08:06:14 +0200 Message-ID: <20220428060615.986332-8-adriaan.schmidt@siemens.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220428060615.986332-1-adriaan.schmidt@siemens.com> References: <20220428060615.986332-1-adriaan.schmidt@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Return-Path: adriaan.schmidt@siemens.com X-Originating-IP: [139.25.68.25] X-ClientProxiedBy: DEMCHDC89XA.ad011.siemens.net (139.25.226.103) To DEMCHDC89XA.ad011.siemens.net (139.25.226.103) X-TM-AS-Product-Ver: SMEX-14.0.0.3080-8.6.1018-26680.007 X-TM-AS-Result: No-10--16.244900-8.000000 X-TMASE-MatchedRID: 4U5WdtFP0Q4QwVtkLIfLLbHs1wZTXKHBYlldA0POS1Jtdr9d0G+tOpho XhL48wE7eucl7MdNw8RlgPlELHsWWRyr9kofgD0FFR00oYoqDJafbxa3A1yTpzfu+RTlciXg/Md +OvVRT/kR34ro7k23nVBtcAz9x24SKWZyYRZycgtJ/2MFRNZuNR+X41oiFhcu6HuV1BUJYPNBJ1 CxuVkwjUtcaZvMECGy1Br5wWX7YQ2okitJmrFCuON7MovG9cvQ9eUjmTFKQ/T8OMEMU7OyZtPZW t1+42smTPm/MsQarwMBIoIumpW6V/4yf+7IYDgcsW3Cgu625dVTZyP+S3GVYH0OE02QLVC+WRYt BXVuRSVGMe+tDjQ3FnIin2hX71Kr5shPFSKOueR6p3UUV82FSRVdTj9tM44xggra2NOo2i3jLrH qvAiSy6lTFDGZMPhCixP77M1esQwZmf7ofP3gccKwBNRhxAkuxQuyWuTn6yqXfrypKnpvnre2wM m8sT5/E4klva9z5Jx6RaSpHJq/AA/hpPV0bNgBIvabuzhmQeCEtFE/+7XCuolSWYvdSPSYf3PPz 7C7ukZr9YiEX0WhNplA4IpB7gNOs8mgqR6m778aiTke3N9xUXdpFkj4BgGZCtzGvPCy/m68xE2H 2EuMWS5MlWghP7UmX46iGZTPpJ6qqsCwzad2bB6kX/VShDhejxn4v13MgUbB6S7ffS3eayLLJGC SgZKk4PdcWsl+C/MTUMg5euvPiXUbN++MZYTqFUGiMcidh6Px9/PgR0+rlp4CIKY/Hg3AGdQnQS TrKGPEQdG7H66TyOk/y0w7JiZo X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--16.244900-8.000000 X-TMASE-Version: SMEX-14.0.0.3080-8.6.1018-26680.007 X-TM-SNTS-SMTP: 0FDA5D56C3A81DD9C1409E9F3E6E00F9CF90E1430AC48E8B3340CC1093AAC6CC2000:8 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d7e6de02-0822-406e-a7ac-08da28dd4035 X-MS-TrafficTypeDiagnostic: AM6PR10MB2901:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mmd0N8VQ5kydnvjhcMFkqJI3gC/SG18Xep4enD7rLFtLc8nSApTHK5oAksxGV5glTZUyLaVzSYTBic24ijPUqjwi7iM9h77jFSPEu5Lvmv3z/njUaaLMeM9COXF36+tP6TKN/ImD9ETJh3XLk6uZyRQypUNkIgMPD4WkZjJ3ixuTe8BtkvQUq7orce2DEeXPGtdjPIg6ZkRnlbfeAQErJNcApw/YSp/EhO7JXt19LIY666FXIxcRNl6oxIEEsGrFK2JE6wb2Zy5gJ4xk/eYktU2sicxYy1ZuXcIKurKiuhwO6mQXbsOjKY0rqLFDLHAvP6vSnV8+VaekxvO2CGjk2cgc655cqLLE/wY6LCp3VwaXIwfJUruhpsVyZGlXP5CQOL7HK63mkKeNG92k3H1q9eJoBgsMuaawyv2kvM3ndf9nTKXnIpSrBBQwXZi+HS18f1xvoDyp9XGLIWh22avpd+4ATcUDbH/eKw3QVp2pFcw1zzBpVgaoON7bDq3y9eGZqn/ik6HdATi1ohVZ1n2clNdJgX85NUsoyXCCo2Ds0Ctw8Nv5Xf8MHHEB40RPpNprw4qK4pLXBVOmrVu9ccBnXMvHCDUGk7FrNe1cSGfS+waelapbj+MUQr5TIA+xePg2rSGrz94y1g3bXWSK5si7J2mw0Oq6L87M1ZniNBnEOCeXBTxA3uX9mRTsf6pY6gfRGqOSJ6+c6HR0IJhGVZ0KiVIbRBS6qcr4jnkoYOeLQ/loGBxS96RVYYPHEk0fAalHD3akRQpn8n9TGJicYoFIC34suOecJ8ef2Pfa2x9YdbV+UXg7q6b5cb2tllhlPrW5Wrg5qLEDtvW9qLXFS8BYtjWU8DmHtN2ZKeW/4Q/muZ0= X-Forefront-Antispam-Report: CIP:194.138.21.72;CTRY:DE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:hybrid.siemens.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230001)(4636009)(36840700001)(40470700004)(46966006)(186003)(70586007)(70206006)(336012)(4326008)(956004)(8676002)(82310400005)(5660300002)(16526019)(36756003)(26005)(6666004)(316002)(6916009)(86362001)(356005)(2616005)(81166007)(1076003)(966005)(47076005)(107886003)(2906002)(83380400001)(82960400001)(36860700001)(40460700003)(44832011)(8936002)(508600001)(403724002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Apr 2022 06:06:35.5550 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d7e6de02-0822-406e-a7ac-08da28dd4035 X-MS-Exchange-CrossTenant-Id: 38ae3bcd-9579-4fd4-adda-b42e1495d55a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=38ae3bcd-9579-4fd4-adda-b42e1495d55a;Ip=[194.138.21.72];Helo=[hybrid.siemens.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR01FT085.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR10MB2901 X-TUID: AavcBbyTtVCB Signed-off-by: Adriaan Schmidt --- doc/user_manual.md | 86 ++++++++++++++++++++++++++++------------------ 1 file changed, 53 insertions(+), 33 deletions(-) diff --git a/doc/user_manual.md b/doc/user_manual.md index b950ff7f..cdb73224 100644 --- a/doc/user_manual.md +++ b/doc/user_manual.md @@ -213,7 +213,7 @@ tmp/deploy/images/rpi/isar-image-base-raspbian-stretch-rpi.wic.img ### Generate full disk image -A bootable disk image is generated if `wic-img` is listed in IMAGE_FSTYPES. +A bootable disk image is generated if `wic` is listed in IMAGE_FSTYPES. Behind the scenes a tool called `wic` is used to assemble the images. It is controlled by a `.wks` file which you can choose with changing WKS_FILE. Some examples in the tree use that feature already. @@ -253,7 +253,8 @@ https://github.com/intel/bmap-tools ### Generate container image with root filesystem A runnable container image is generated if IMAGE_FSTYPES variable includes -'container-img'. +one of the supported container formats `oci`, `oci-archive`, `docker-archive`, +`docker-daemon`, or `containers-storage`. Getting a container image can be the main purpose of an Isar configuration, but not only. A container image created from an Isar configuration meant for bare-metal or @@ -261,10 +262,9 @@ virtual machines can be helpfull to test certain applications which requirements (e.g. libraries) can be easily resolved in a containerized environment. -Container images can be generated in different formats, selected with the -variable `CONTAINER_IMAGE_FORMATS`. One or more (whitespace separated) of following -options can be given: - - `docker-archive`: (default) an archive containing a Docker image that can +Container images can be generated in different formats. One or more (whitespace +separated) of following options can be given: + - `docker-archive`: an archive containing a Docker image that can be imported with [`docker load`](https://docs.docker.com/engine/reference/commandline/load) - `docker-daemon`: resulting container image is made available on the local Docker Daemon @@ -280,12 +280,6 @@ It's technically possible, but requires making host resources (e.g. the Docker Daemon socket) accessible in the container, which can endanger the stability and security of the host. -The resulting container image archives (only for `docker-archive` and -`oci-archive`) are made available as -`tmp/deploy/images/${MACHINE}/${DISTRO}-${DISTRO_ARCH}-${container_format}.tar.xz` -(being `container_format` each one of the formats specified in -`CONTAINER_IMAGE_FORMATS`). - ### Example - Make the relevant environment variables available to the task @@ -293,9 +287,8 @@ The resulting container image archives (only for `docker-archive` and For one-shot builds (use `local.conf` otherwise): ``` -export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE IMAGE_TYPE CONTAINER_IMAGE_FORMATS" -export IMAGE_FSTYPES="container-img" -export CONTAINER_IMAGE_FORMATS="docker-archive" +export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE IMAGE_FSTYPES" +export IMAGE_FSTYPES="docker-archive.xz" ``` - Trigger creation of container image from root filesystem @@ -307,7 +300,7 @@ bitbake mc:qemuarm-buster:isar-image-base - Load the container image into the Docker Daemon ``` -docker load -i build/tmp/deploy/images/qemuarm/isar-image-base-debian-buster-armhf-1.0-r0-docker-archive.tar.xz +docker load -i build/tmp/deploy/images/qemuarm/isar-image-base-debian-buster-armhf-1.0-r0.docker-archive.xz ``` - Run a container using the container image (following commands starting with @@ -460,10 +453,15 @@ Isar can generate various images types for specific machine. The type of the image to be generated may be specified through the `IMAGE_FSTYPES` variable. Currently, the following image types are provided: - - `ext4` - Raw ext4 filesystem image (default option for `qemuarm` machine). - - `wic-img` - A full disk image with user-specified partitions created and populated using the wic tool. - - `ubi-img` - A image for use on mtd nand partitions employing UBI - - `vm-img` - A image for use on VirtualBox or VMware + - `tar` - tarball of the root file system + - `cpio` - cpio archive + - `ext4` - raw ext4 filesystem image (default option for `qemuarm` machine) + - `wic` - full disk image with user-specified partitions created and populated using the wic tool + - `ubi` - image for use on mtd nand partitions employing UBI + - `ova` - Open Virtual Appliance: image for use on VirtualBox or VMware + +In addition, image types can be converted using suffixes, e.g. `tar.gz`. +Available conversions are `gz` and `xz`, which both provide image compression. There are several image types can be listed in `IMAGE_FSTYPES` divided by space. @@ -539,7 +537,7 @@ IMAGE_PREINSTALL = "linux-image-rpi-rpfv \ KERNEL_IMAGE = "vmlinuz-4.4.0-1-rpi" INITRD_IMAGE = "initrd.img-4.4.0-1-rpi" MACHINE_SERIAL = "ttyAMA0" -IMAGE_FSTYPES = "wic-img" +IMAGE_FSTYPES = "wic" WKS_FILE = "rpi-sdimg" ``` @@ -579,22 +577,44 @@ Every image type in Isar is implemented as a `bitbake` class. The goal of these ### Create Custom Image Type -As already mentioned, Isar uses `bitbake`to accomplish the work. The whole build process is a sequence of tasks. This sequence is generated using task dependencies, so the next task in chain requires completion of previous ones. -The last task of image recipe is `do_populate`, so the class that implement new image type should continue execution from this point. According to the BitBake syntax, this can be implemented as follows: +The following steps are required to implement a custom image type: Create a new class: ``` $ vim meta-user/classes/my-image.bbclass ``` -Add these lines: + +Specify the command to generate the new image, and optionally image type +dependencies or required arguments: ``` -do_my_image() { +IMAGE_TYPEDEPS_my_image = "ext4" +IMAGE_CMD_REQUIRED_ARGS_my_image = "MY_ARG" +IMAGE_CMD_my_image() { + INPUT="${PP_DEPLOY}/${IMAGE_FULLNAME}.ext4" + ${SUDO_CHROOT} my_command ${MY_ARG} -i ${INPUT} -o ${IMAGE_FILE_CHROOT} } -addtask my_image before do_build after do_populate ``` -The content of `do_my_image` function can be implemented either in shell or in Python. +The IMAGE_CMD is a shell function, and the environment has some pre-set +variables: + + - `IMAGE_FILE_HOST` and `IMAGE_FILE_CHROOT` are the paths of the output image + (including extension) in the host or buildchroot. + - `SUDO_CHROOT` is a prefix you can use to have a command run inside the + buildchroot. + +If the code you provide in `IMAGE_CMD` requires the building and/or installation +of additional packages in the buildchroot, you can specify this: +``` +IMAGER_BULID_DEPS_my_image = "my_command" +IMAGER_INSTALL_my_image = "my_command" +``` + +To use your custom image class, add it to `IMAGE_CLASSES` in your machine config: +``` +IMAGE_CLASSES += "my-image" +``` -In the machine configuration file, set the following: +And finally select the new image type: ``` IMAGE_FSTYPES = "my-image" ``` @@ -603,11 +623,11 @@ IMAGE_FSTYPES = "my-image" Isar contains additional image type classes that can be used as reference: - - `ext4-img` - - `targz-img` - - `ubifs-img` - - `ubi-img` - - `wic-img` + - `ext4` + - `tar.gz` + - `ubifs` + - `ubi` + - `wic` --- -- 2.30.2