From patchwork Tue Apr 5 05:24:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Schmidt, Adriaan" X-Patchwork-Id: 1659 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3) with LMTPA; Tue, 05 Apr 2022 15:25:10 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-lf1-f61.google.com (mail-lf1-f61.google.com [209.85.167.61]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8) with ESMTPS id 235DOwC6023879 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 5 Apr 2022 15:24:58 +0200 Received: by mail-lf1-f61.google.com with SMTP id h11-20020a0565123c8b00b0044b05b775cesf2396051lfv.6 for ; Tue, 05 Apr 2022 06:24:58 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1649165093; cv=pass; d=google.com; s=arc-20160816; b=GU2pAiKc/4c24w0XBePdYX3x39O2yqOD/l6mluev+VQ4HSj8SThNmvrp8lG8lmP4jd OwpEcvRUnaaE+rkKX/B79kld7QbJN32v7E5kOF5YRwr4EWyf+AuttCxKL5N3SlouaJPe noA4s4ROSm+x6pA4g8VY2jwJW6q9PPNVgQVv/KPUEbP4dCGtU9Kyrdxf+l5s7rcgQAcA aXdgeZn/mn+BDbM6+nu52Byh90OmnMYmW7RNeJ+/CZCAQEsP/jyGC7K+mjBe5IwktjX6 jQ2uve4KAaATiMaKchEs5mI+G39m8rvNr6/FaZ1ekD0PO7SUDPf/hY5F9Zhnj/pj00PQ JByw== 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=nA0ATvNGfBHDrO8ODnFOvNyUj45Clz1IdiWmEJXUX4g=; b=QXETuY/J3Sux/LRLIUt0/yLVk7v/Ku0LpLDGTZOeDwKBddcNk/kH7Ns8EvXoECbaQ/ vcNmujJylph5QTj0pzg1N3AvUXGXSSF/rCUJPMIhrgMiuCXhYVUmfTTIIwbj5XbcZPh3 s4iI782yNrNuc1nOjrt8TT7CAihkHPUQE5ccZ5ZtTYmpDZbmzBF9sJe6RsT7sfZhfT8R z8CUQ2e8HEFpJ8d0VcuARBCIXHMp0uLED9cRf12pE+C8fsXbL8NoGe/Bbd42K94oDiXD Hy9NRuwEDzvORcuuKRNv/9r9NUv1BoukgkB4qqJjwVKStwpuAQrfv3lp4HZ8hmEOw5c/ 3eog== ARC-Authentication-Results: i=3; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=YPtG4wye; 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:fe0a::608 as permitted sender) smtp.mailfrom=adriaan.schmidt@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; 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=nA0ATvNGfBHDrO8ODnFOvNyUj45Clz1IdiWmEJXUX4g=; b=IBfY0VphhniKHGeWtRdR+SeKl3OAXYEAzFQ94xxbQQC/lVCOkvp03a/ct4ErMXbGIR cnZ7zv4jUba2X1FeEbM/T3aD58N0QMghjQbxL6xxDAdg8s6ShW5ScuJZr4eCxO8E+9xQ GQjeaQYfHgJ1I/81Zqw6MbuQ9AbVWaarJcKTHo5su9Cs2jF6fObZPkTJVAjtL6ZYXWjO Nq9FWqGPlrVonv2e2nF0A9zB4xoGp6+xpHqG71e43p8WUzZ0Bez35zToONkQW+P9erPB 3GtDgIPJ9OLgqkojfycMIbAgO1DgKIoidWZJFdNmJoIBMDzflq0WZ42zGRmS4IqursFp Jw6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=nA0ATvNGfBHDrO8ODnFOvNyUj45Clz1IdiWmEJXUX4g=; b=T6vMj67wF3xFrXHpyH52y5NaJhTYc+H0DyY1gxLo9vL9vIoROvAbz9ECfd7vLUz8bH Qbui2J2KWXyX1KlfXkRWy2aY0ubDG/9R4FJbWaYrv40xnQAwxxe9knvRvr7Yb7U9Z1FC c/scd64Cx2dcOnEz86RrvMo2OQoVa0YYHqEdDG0b96SvSe0BN7Ngy2EFAStAi7DavqWl GlkbAyZGha/61rnx18ZrmYSnqUr//zY8hX+j3q6YG7MitbQmb/hZ155IucqJN1NA5cZf Vno+52lHxfuUVKnHZXYuSde5QTfBCHZw3JU0mI6aK2pIj4PVbV37dvHh08ID3dXdDfhg lVwQ== Sender: isar-users@googlegroups.com X-Gm-Message-State: AOAM5338gN1fUMV7tmbjou21dDsWUXQg2FBTvo56OtCKgxWK6ygfUCJU sTfuwK63E4RhZDEZ1djygz0= X-Google-Smtp-Source: ABdhPJztrgonqqzAwOd0vwICBExd0YWS0P2kNCRWzYHDUxR3R0FyRq0+3KIMxa5lcLrRPDnvt4l3JQ== X-Received: by 2002:a05:6512:2613:b0:448:5164:689d with SMTP id bt19-20020a056512261300b004485164689dmr2647389lfb.526.1649165092962; Tue, 05 Apr 2022 06:24:52 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a19:3813:0:b0:44a:9ec7:d611 with SMTP id f19-20020a193813000000b0044a9ec7d611ls545208lfa.3.gmail; Tue, 05 Apr 2022 06:24:52 -0700 (PDT) X-Received: by 2002:a05:6512:1112:b0:44a:4096:39b0 with SMTP id l18-20020a056512111200b0044a409639b0mr2645749lfg.35.1649165091962; Tue, 05 Apr 2022 06:24:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1649165091; cv=pass; d=google.com; s=arc-20160816; b=FbVH5X2x39OCOlcStRNoG6rwuyszsw/Olf7QAX8eeZ8mf5G3/QkUcTHj3+urQDULaI 1AZcguCPk/uuxr4Y8aHRwDDOCi4wwqvhTfVxup8yizCJog0AiM6Wc0MGqko9CLtWW9UX SGAMVw6bDcFq6RaAgjwOaU7EdSyFhb2alPMa3nYomLYM/0Kou/M6F6GZcAO4fupEJlrr LtZUq0Nr1rEN6MUfgcI3HTryqlNse5+VPwYYhwrs45rMFjkv+3UXTviluQHle+OklcvG wZZA/6fP7CebkpOBDSHIA/M7pZLQM+Dt/6EQet76/1x0hVdyAGyP+YBVT63Ovx4JGEAr aLgA== 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=zqiw5N9yxJfgDuoafUazNHYmzViXlNgVSnhXy7ce1Os=; b=HtWhrK7yw0/KhRxMeLzk8FGMz2Hey6RM9/YzLWLFPgSxEoulcKtq9UIgsrU+5FuJ9Y inHiYci5Yzlc2xtwjkxYtPiuBWfs25Rb8Rd76caUbTDelqBwPiBeQnOj9b5Ah3I+Chha oTYdDL6cFqhqbocr/Hd3wEvkkaGu24O2BTPYfjACl3sNwWh/cbWca/PVdZK0x++HcQkq UTzmZeJFR6s3VQpIR2GrCpfPz93oZvb/B3OSLEUsfYEZS96KSDbgVXMYkQ0oXQOFUkkR ZBlZfVeTOkvRHEnBqTne3miXs9KjK7/+5LNtOeYX5hngL2i+PHBkCTnQGhcXZso0Fbrq E8cA== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=YPtG4wye; 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:fe0a::608 as permitted sender) smtp.mailfrom=adriaan.schmidt@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-db5eur03on0608.outbound.protection.outlook.com. [2a01:111:f400:fe0a::608]) by gmr-mx.google.com with ESMTPS id i36-20020a0565123e2400b0044ada59207csi553655lfv.10.2022.04.05.06.24.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Apr 2022 06:24:51 -0700 (PDT) Received-SPF: pass (google.com: domain of adriaan.schmidt@siemens.com designates 2a01:111:f400:fe0a::608 as permitted sender) client-ip=2a01:111:f400:fe0a::608; ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QCADgQ7mbOEMsUpksV1DIZtPqZ0XuWDy3R6HlBRzRute0+jq3OzXZPaDSnGYAllnKl22unBO2tfnr0LFEf0C7a1UHOyBCbBSVuYUjjFFuDkW4K5FTyQp3rqp0WCYk4EpUkY3VL1ijSdvJKKgy2p3IVBYjDWlaS2s4gOdQ1vRagxKV4Vc3c4aexzjAsVs6L6su4rU7VPsm1W4XgMU64UPWTaqZh1OCPT5elTwhWWmd0XE5JJtTwa/RBF7A6Hv6tX4aYR9mSZEOBNh3yAzk6kHqQTqufp3L2bmH1aAvt7VCIL4DnBb7/ZCyVd9L4uxUCVUrddsKucwJqVnEZG0OUoGpg== 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=zqiw5N9yxJfgDuoafUazNHYmzViXlNgVSnhXy7ce1Os=; b=V8fziSp/z5wVxWzJumU1gDEA7xSAIX9E3nXG7AJUthPHRYZWU27uguaCTNg9mBBCbxiopk4My7immRWu+HNi/KHV6f4spOTDNldn2bVP4pwU4exqCFUoU0eHMRK9qIAjuoSi+v4t4oRdF5b6Dqp9TP/lWzax+gtXbX/uoEAqJqzlUIAcdzIfOrmg2TOtd9FzIPDUoQOkxU/VGrqpclhNm4tkskZEpwsIprSTI0iKjF1qliLz3PRA5S1birybGJ+6Y2hIM3PYqmFoAGBRBr0j/kTzHIFFn1DmlwZD+JPj6uYdwFGQVwMb9IiTBeuKp8oyqCUIMukOBWtbrjHxwQhYnw== 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 Received: from SV0P279CA0045.NORP279.PROD.OUTLOOK.COM (2603:10a6:f10:13::14) by DB7PR10MB2010.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:5:b::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5123.31; Tue, 5 Apr 2022 13:24:49 +0000 Received: from HE1EUR01FT098.eop-EUR01.prod.protection.outlook.com (2603:10a6:f10:13:cafe::e) by SV0P279CA0045.outlook.office365.com (2603:10a6:f10:13::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5123.13 via Frontend Transport; Tue, 5 Apr 2022 13:24:48 +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 HE1EUR01FT098.mail.protection.outlook.com (10.152.1.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5123.19 via Frontend Transport; Tue, 5 Apr 2022 13:24:47 +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; Tue, 5 Apr 2022 15:24:47 +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; Tue, 5 Apr 2022 15:24:47 +0200 From: Adriaan Schmidt To: CC: Adriaan Schmidt Subject: [PATCH v2 3/7] meta: introduce IMAGE_CMD_* Date: Tue, 5 Apr 2022 15:24:27 +0200 Message-ID: <20220405132431.2895832-4-adriaan.schmidt@siemens.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220405132431.2895832-1-adriaan.schmidt@siemens.com> References: <20220405132431.2895832-1-adriaan.schmidt@siemens.com> MIME-Version: 1.0 X-Originating-IP: [139.25.68.25] X-ClientProxiedBy: DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) 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--12.558700-8.000000 X-TMASE-MatchedRID: 04gHLlJC4S2KjhO49WcRvxtMufvbmwz+hrD3pNcSx1aqFx2c/3V5cVjW waUPviNZ/gMNehoKqTuPOugxGvLnIvjJU0Xm/BNSypQ4fHj6rguB/H+OOilxfxwu4QM/6Cpy9/p lKg1lCsgXR19nmRX2XzmxtICXCkUOwpZcTMweUzBMrrG8rDAmaE+K6zmZLkA4p7rgqkxHgFTnSS hdAiVGyk2aZutybpc1V/e2x3csJRf2H36ylfVrrqKCxNEJvTR8TzkB7683LnMD2WXLXdz+AT+k5 IvvZ1N/pKG9GN+fhxSAecOigRAlteuop+u1c/uKWElXx2UUcMxpHPhb7pMEQW/6CCblACLhmTMk hNp6sQVWw5sMt9VCxLH4VzREB3QgXcTaTibhQ6ooX6fjWPUAlhTfVlVWxWRBec1y1wrvN8XKII2 XfSJs2UvEK4FMJdoqsocs4UkLS9JGsDdPt+DAPpbrFFwxb/fFrP6YwNCF5LuRgPzABkqxILqzpQ vjy9EAzVgwP7ZMYf/wcuRC9bbiZHQ7cqwFABUDb/+iW2gmXjw/QMF1B4qVfceuFL5UpINxTFQnI +epPIa8e5jXab0QP8VjEEE40kDNX3rc5KLrywNMlj7xUQx4Xk6L74JlBxByjUbBeH6QHOoBDya2 JbH/+iU2i+a38omfXdjnxOsxOOwqrHKrDVF+8yRyoHwqLShw4xinGtBYZzMrUvpNWR2DO805KBm 2/UMh33Nl3elSfsp68AfW6N1gxLuesy4o/Gk/Ift+vU06BvKinbS6HV1jJ8VUBXy8OM3//4+GQc smc+JefZxsQ0yCHg2KH0LgF2+4pWcHTgKw2rGbKItl61J/yZ+inTK0bC9eKrauXd3MZDWXf5sC3 9gVVHNxBnxGfH/U29agO6dvMsO0hVbub24xD3/eCwkDqXmyH8FerAT0dJY= X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--12.558700-8.000000 X-TMASE-Version: SMEX-14.0.0.3080-8.6.1018-26680.007 X-TM-SNTS-SMTP: 6E30751DED29298CEFF3E37824FB2F5CE04C3FD18B3767B5E7F309528009368A2000:8 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c2d816f3-5179-4f7b-9bb3-08da1707a82a X-MS-TrafficTypeDiagnostic: DB7PR10MB2010: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: l4aC/Az00lcCLnZD3/lCzwlnr5ZN+mAesP411c9kg+98HeWYYx1vpxV0HFs+EHMP7XRnb4tATRAE6OwKKtTMPR/CYVq/4OsWZgakTKTW7Q3EH9+Rd+ToXRIUzthjCQZlMh+ks1v1CWlYioBuw9q6uqH+zGSj9UwlKKY7jd8CcKQ5yIxAH3cEE3nFj52Kw0kCPlQ8o/M3f1VhwPK/VRTRc04Cc0WOcPrhlu6TZ9LqQI1cqXiCQNB4a4cNfynd9zMM75xRQ8SthNU+FS7bM2P44cY5bEl9ZQQLWve4pgSeJ0LFVyaZOL7OZ/awfNwJku+XcN8Ot4pdkFVeaFCDZcuC/Muoj6x0ORLVvuvxTcZ1QdGxDifvRqo2R6Dg9NhxGkj4JdHAQI4Vs8e/RVAAbSj57sXBJ/iounCvsfuLCb7QPr5p6+F5ldd1Dx4alaoe6u2emRei6VKhyY8D/L6DzNyzSSyQUTkXuMI7VCIzz83XzVYMgXfD4e+K5aw3hwmWauy/t3nm9j4It/oh6t8vqisegAIqM1fZtZYgwc2oPxCy5ux/EOyVeemkrY/HuizeuVt5JNQdco80PrrH6wug+mDeVWz3U1NZoZcfb+3e1xSd4kGK3FUtthdEhfeyt8h/xMVezciOTnopNx2NtnEQVR2rp8CHUEAx7lDa0OHZNfnFkxJxlZULJ1yGnwINDnILhl2tMm9+BsuJFfsgecWsBZH3Gj+aH+1vQmlQjAg+J/ErE17ExfzMXmKjQpv6uwx4mepsLLPoPVrqjQnrPlg9naz3dkG/FYISfYTZ6PCOpl/vjQxrKk3rgYnm0Yr77PfmQUu1 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)(40470700004)(46966006)(36840700001)(498600001)(8936002)(47076005)(40460700003)(5660300002)(44832011)(36756003)(82960400001)(81166007)(2906002)(966005)(30864003)(356005)(8676002)(83380400001)(1076003)(107886003)(82310400005)(186003)(4326008)(70586007)(70206006)(6916009)(336012)(16526019)(956004)(2616005)(26005)(86362001)(36860700001)(6666004)(403724002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Apr 2022 13:24:47.9077 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c2d816f3-5179-4f7b-9bb3-08da1707a82a 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: HE1EUR01FT098.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR10MB2010 X-Original-Sender: adriaan.schmidt@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=YPtG4wye; 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:fe0a::608 as permitted sender) smtp.mailfrom=adriaan.schmidt@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com 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=-0.9 required=5.0 tests=DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,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: INBOX This makes a number of changes: - Replace all do_*_image tasks with IMAGE_CMD_* definitions - Remove all implicit conversions (gz, xz) - Add IMAGE_CONVERSION_* commands - Create tasks (do_image_*) on demand in image.bbclass for all requested IMAGE_FSTYPES - When creating the tasks: - image_do_mounts is inserted automatically - a final chown is inserted automatically - variables IMAGE_FILE_HOST and IMAGE_FILE_CHROOT are set to reference the image - variable SUDO_CHROOT contains the chroot command - Create conversions on demand based on IMAGE_FSTYPES. A conversion is defined by CONVERSION_CMD_type, and its dependencies given as CONVERSION_DEPS_type - In conversion commands - the input file is named ${IMAGE_FULLNAME}.${type} - the conversions appends its own type, e.g. the output file would be ${IMAGE_FULLNAME}.${type}.xz - a final chown is appended automatically - Image types now longer have a -img suffix, e.g., ext4 instead of ext4-img, and conversions are appended like tar.gz instead of targz-img - Imager dependencies are set as IMAGER_INSTALL_type - Dependencies between image types are modelled like IMAGE_TYPEDEP_ova = "wic" - Required arguments/variables are modelled by IMAGE_CMD_REQUIRED_ARGUMENTS = "A B C" - Container types (previously CONTAINER_IMAGE_FORMATS) are now first class image types (oci, oci-archive, docker-archive, docker-daemon, containers.storage) - The logic of image-container-extension has moved to container-img - The VM image now has type ova (instead of vm-img) Signed-off-by: Adriaan Schmidt --- meta/classes/container-img.bbclass | 94 ++++++++- meta/classes/cpiogz-img.bbclass | 20 +- meta/classes/ext4-img.bbclass | 21 +- meta/classes/fit-img.bbclass | 17 +- .../classes/image-container-extension.bbclass | 83 -------- meta/classes/image.bbclass | 184 +++++++++++++++++- meta/classes/rootfs.bbclass | 1 + meta/classes/sdk.bbclass | 2 +- meta/classes/targz-img.bbclass | 11 +- meta/classes/ubi-img.bbclass | 24 +-- meta/classes/ubifs-img.bbclass | 29 +-- meta/classes/vm-img.bbclass | 24 +-- meta/classes/wic-img.bbclass | 45 ++--- 13 files changed, 331 insertions(+), 224 deletions(-) delete mode 100644 meta/classes/image-container-extension.bbclass diff --git a/meta/classes/container-img.bbclass b/meta/classes/container-img.bbclass index 322889a9..436a0051 100644 --- a/meta/classes/container-img.bbclass +++ b/meta/classes/container-img.bbclass @@ -3,15 +3,93 @@ # # SPDX-License-Identifier: MIT # -# This class provides the task 'container_image' +# This class provides the task 'containerize' # to create container images containing the target rootfs. -do_container_image[dirs] = "${DEPLOY_DIR_IMAGE}" -do_container_image[stamp-extra-info] = "${DISTRO}-${MACHINE}" -do_container_image[vardeps] += "CONTAINER_IMAGE_FORMATS" -do_container_image(){ - bbdebug 1 "Generate container image in these formats: ${CONTAINER_IMAGE_FORMATS}" - containerize_rootfs "${IMAGE_ROOTFS}" "${CONTAINER_IMAGE_FORMATS}" +CONTAINER_TYPES = "oci oci-archive docker-archive docker-daemon containers-storage" +USING_CONTAINER = "${@bb.utils.contains_any('IMAGE_BASETYPES', d.getVar('CONTAINER_TYPES').split(), '1', '0', d)}" + +CONTAINER_IMAGE_NAME ?= "${PN}-${DISTRO}-${DISTRO_ARCH}" +CONTAINER_IMAGE_TAG ?= "${PV}-${PR}" + +python() { + if not d.getVar('USING_CONTAINER') == '1': + return + for t in d.getVar('CONTAINER_TYPES').split(): + t_clean = t.replace('-', '_').replace('.', '_') + d.setVar('IMAGE_CMD_' + t_clean, 'convert_container %s "${CONTAINER_IMAGE_NAME}" "${IMAGE_FILE_HOST}"' % t) + d.setVar('IMAGE_FULLNAME_' + t_clean, '${PN}-${DISTRO}-${DISTRO_ARCH}') + bb.build.addtask('containerize', 'do_image_' + t_clean, 'do_image_tools', d) +} + +do_containerize() { + local cmd="/bin/dash" + local empty_tag="empty" + local tag="${CONTAINER_IMAGE_TAG}" + local oci_img_dir="${WORKDIR}/oci-image" + local rootfs="${IMAGE_ROOTFS}" + + # prepare OCI container image skeleton + bbdebug 1 "prepare OCI container image skeleton" + sudo rm -rf "${oci_img_dir}" "${oci_img_dir}_unpacked" + sudo umoci init --layout "${oci_img_dir}" + sudo umoci new --image "${oci_img_dir}:${empty_tag}" + sudo umoci config --image "${oci_img_dir}:${empty_tag}" \ + --config.cmd="${cmd}" + sudo umoci unpack --image "${oci_img_dir}:${empty_tag}" \ + "${oci_img_dir}_unpacked" + + # add root filesystem as the flesh of the skeleton + sudo cp -a "${rootfs}"/* "${oci_img_dir}_unpacked/rootfs/" + # clean-up temporary files + sudo find "${oci_img_dir}_unpacked/rootfs/tmp" -mindepth 1 -delete + + # pack container image + bbdebug 1 "pack container image" + sudo umoci repack --image "${oci_img_dir}:${tag}" \ + "${oci_img_dir}_unpacked" + sudo umoci remove --image "${oci_img_dir}:${empty_tag}" + sudo rm -rf "${oci_img_dir}_unpacked" + + # no root needed anymore + sudo chown --recursive $(id -u):$(id -g) "${oci_img_dir}" } -addtask container_image before do_image after do_image_tools +convert_container() { + local tag="${CONTAINER_IMAGE_TAG}" + local oci_img_dir="${WORKDIR}/oci-image" + local container_type="$1" + local image_name="$2" + local image_archive="$3" + + # convert the OCI container image to the desired format + bbdebug 1 "Creating container image type: ${container_type}" + case "${container_type}" in + "docker-archive" | "oci-archive") + if [ "${container_type}" = "oci-archive" ] ; then + target="${container_type}:${image_archive}:${tag}" + else + target="${container_type}:${image_archive}:${image_name}:${tag}" + fi + rm -f "${image_archive}" + bbdebug 2 "Converting OCI image to ${container_type}" + skopeo --insecure-policy copy \ + "oci:${oci_img_dir}:${tag}" "${target}" + ;; + "oci") + tar --create --directory "${oci_img_dir}" \ + --file "${image_archive}" . + ;; + "docker-daemon" | "containers-storage") + if [ -f /.dockerenv ] || [ -f /run/.containerenv ] ; then + die "Adding the container image to a container runtime (${container_type}) not supported if running from a container (e.g. 'kas-container')" + fi + skopeo --insecure-policy copy \ + "oci:${oci_img_dir}:${tag}" \ + "${container_type}:${image_name}:${tag}" + ;; + *) + die "Unsupported format for convert_container: ${container_type}" + ;; + esac +} diff --git a/meta/classes/cpiogz-img.bbclass b/meta/classes/cpiogz-img.bbclass index 2a49456b..f4c33bd9 100644 --- a/meta/classes/cpiogz-img.bbclass +++ b/meta/classes/cpiogz-img.bbclass @@ -3,20 +3,12 @@ # # SPDX-License-Identifier: MIT -CPIOGZ_FNAME ?= "${IMAGE_FULLNAME}.cpio.gz" -CPIOGZ_IMAGE_FILE = "${DEPLOY_DIR_IMAGE}/${CPIOGZ_FNAME}" -IMAGER_INSTALL += "cpio" +IMAGER_INSTALL_cpio += "cpio" CPIO_IMAGE_FORMAT ?= "newc" -do_cpiogz_image() { - sudo rm -f ${CPIOGZ_IMAGE_FILE} - image_do_mounts - sudo chroot ${BUILDCHROOT_DIR} \ - sh -c "cd ${PP_ROOTFS}; /usr/bin/find . | \ - /usr/bin/cpio -H ${CPIO_IMAGE_FORMAT} -o | /usr/bin/gzip -9 > \ - ${PP_DEPLOY}/${CPIOGZ_FNAME}" - sudo chown $(id -u):$(id -g) ${CPIOGZ_IMAGE_FILE} +IMAGE_CMD_cpio() { + ${SUDO_CHROOT} \ + sh -c "cd ${PP_ROOTFS}; /usr/bin/find . | \ + /usr/bin/cpio -H ${CPIO_IMAGE_FORMAT} -o > \ + ${IMAGE_FILE_CHROOT}" } - -addtask cpiogz_image before do_image after do_image_tools -do_cpiogz_image[dirs] = "${DEPLOY_DIR_IMAGE}" diff --git a/meta/classes/ext4-img.bbclass b/meta/classes/ext4-img.bbclass index 5085afcc..73d1bb57 100644 --- a/meta/classes/ext4-img.bbclass +++ b/meta/classes/ext4-img.bbclass @@ -1,24 +1,15 @@ # This software is a part of ISAR. # Copyright (C) 2015-2017 ilbers GmbH -EXT4_IMAGE_FILE = "${IMAGE_FULLNAME}.ext4.img" - -IMAGER_INSTALL += "e2fsprogs" +IMAGER_INSTALL_ext4 += "e2fsprogs" MKE2FS_ARGS ?= "-t ext4" # Generate ext4 filesystem image -do_ext4_image() { - rm -f '${DEPLOY_DIR_IMAGE}/${EXT4_IMAGE_FILE}' - - truncate -s ${ROOTFS_SIZE}K '${DEPLOY_DIR_IMAGE}/${EXT4_IMAGE_FILE}' +IMAGE_CMD_ext4() { + truncate -s ${ROOTFS_SIZE}K '${IMAGE_FILE_HOST}' - image_do_mounts - - sudo chroot ${BUILDCHROOT_DIR} /sbin/mke2fs ${MKE2FS_ARGS} \ - -F -d '${PP_ROOTFS}' '${PP_DEPLOY}/${EXT4_IMAGE_FILE}' + ${SUDO_CHROOT} /sbin/mke2fs ${MKE2FS_ARGS} \ + -F -d '${PP_ROOTFS}' '${IMAGE_FILE_CHROOT}' } - -addtask ext4_image before do_image after do_image_tools -do_ext4_image[prefuncs] = 'set_image_size' -do_ext4_image[dirs] = "${DEPLOY_DIR_IMAGE}" +#IMAGE_CMD_ext4[vardepsexclude] = "ROOTFS_SIZE ROOTFS_EXTRA" diff --git a/meta/classes/fit-img.bbclass b/meta/classes/fit-img.bbclass index 1ad0c5b8..ef65af88 100644 --- a/meta/classes/fit-img.bbclass +++ b/meta/classes/fit-img.bbclass @@ -6,24 +6,17 @@ MKIMAGE_ARGS ??= "" FIT_IMAGE_SOURCE ??= "fitimage.its" -FIT_IMAGE_FILE ?= "${IMAGE_FULLNAME}.fit.img" -IMAGER_INSTALL += "u-boot-tools device-tree-compiler" +IMAGER_INSTALL_fit += "u-boot-tools device-tree-compiler" # Generate fit image -do_fit_image() { +IMAGE_CMD_fit() { if [ ! -e "${WORKDIR}/${FIT_IMAGE_SOURCE}" ]; then die "FIT_IMAGE_SOURCE does not contain fitimage source file" fi - rm -f '${DEPLOY_DIR_IMAGE}/${FIT_IMAGE_FILE}' - - image_do_mounts - # Create fit image using buildchroot tools - sudo chroot ${BUILDCHROOT_DIR} /usr/bin/mkimage ${MKIMAGE_ARGS} \ - -f '${PP_WORK}/${FIT_IMAGE_SOURCE}' '${PP_DEPLOY}/${FIT_IMAGE_FILE}' - sudo chown $(id -u):$(id -g) '${DEPLOY_DIR_IMAGE}/${FIT_IMAGE_FILE}' + ${SUDO_CHROOT} /usr/bin/mkimage ${MKIMAGE_ARGS} \ + -f '${PP_WORK}/${FIT_IMAGE_SOURCE}' '${IMAGE_FILE_CHROOT}' } -addtask fit_image before do_image after do_image_tools do_transform_template -do_fit_image[dirs] = "${DEPLOY_DIR_IMAGE}" +IMAGE_CMD_fit[depends] = "${PN}:do_transform_template" diff --git a/meta/classes/image-container-extension.bbclass b/meta/classes/image-container-extension.bbclass deleted file mode 100644 index cdec4633..00000000 --- a/meta/classes/image-container-extension.bbclass +++ /dev/null @@ -1,83 +0,0 @@ -# This software is a part of ISAR. -# Copyright (C) Siemens AG, 2021 -# -# SPDX-License-Identifier: MIT -# -# This class extends the image.bbclass for containerizing the root filesystem. - -CONTAINER_IMAGE_FORMATS ?= "docker-archive" -CONTAINER_IMAGE_NAME ?= "${PN}-${DISTRO}-${DISTRO_ARCH}" -CONTAINER_IMAGE_TAG ?= "${PV}-${PR}" - -containerize_rootfs() { - local cmd="/bin/dash" - local empty_tag="empty" - local tag="${CONTAINER_IMAGE_TAG}" - local oci_img_dir="${WORKDIR}/oci-image" - local rootfs="$1" - local container_formats="$2" - local container_name_prefix="$3" - - # prepare OCI container image skeleton - bbdebug 1 "prepare OCI container image skeleton" - sudo rm -rf "${oci_img_dir}" "${oci_img_dir}_unpacked" - sudo umoci init --layout "${oci_img_dir}" - sudo umoci new --image "${oci_img_dir}:${empty_tag}" - sudo umoci config --image "${oci_img_dir}:${empty_tag}" \ - --config.cmd="${cmd}" - sudo umoci unpack --image "${oci_img_dir}:${empty_tag}" \ - "${oci_img_dir}_unpacked" - - # add root filesystem as the flesh of the skeleton - sudo cp -a "${rootfs}"/* "${oci_img_dir}_unpacked/rootfs/" - # clean-up temporary files - sudo find "${oci_img_dir}_unpacked/rootfs/tmp" -mindepth 1 -delete - - # pack container image - bbdebug 1 "pack container image" - sudo umoci repack --image "${oci_img_dir}:${tag}" \ - "${oci_img_dir}_unpacked" - sudo umoci remove --image "${oci_img_dir}:${empty_tag}" - sudo rm -rf "${oci_img_dir}_unpacked" - - # no root needed anymore - sudo chown --recursive $(id -u):$(id -g) "${oci_img_dir}" - - # convert the OCI container image to the desired format - image_name="${container_name_prefix}${CONTAINER_IMAGE_NAME}" - for image_type in ${CONTAINER_IMAGE_FORMATS} ; do - image_archive="${DEPLOY_DIR_IMAGE}/${image_name}-${tag}-${image_type}.tar" - bbdebug 1 "Creating container image type: ${image_type}" - case "${image_type}" in - "docker-archive" | "oci-archive") - if [ "${image_type}" = "oci-archive" ] ; then - target="${image_type}:${image_archive}:${tag}" - else - target="${image_type}:${image_archive}:${image_name}:${tag}" - fi - rm -f "${image_archive}" "${image_archive}.xz" - bbdebug 2 "Converting OCI image to ${image_type}" - skopeo --insecure-policy copy \ - "oci:${oci_img_dir}:${tag}" "${target}" - bbdebug 2 "Compressing image" - xz -T0 "${image_archive}" - ;; - "oci") - tar --create --xz --directory "${oci_img_dir}" \ - --file "${image_archive}.xz" . - ;; - "docker-daemon" | "containers-storage") - if [ -f /.dockerenv ] || [ -f /run/.containerenv ] ; then - die "Adding the container image to a container runtime (${image_type}) not supported if running from a container (e.g. 'kas-container')" - fi - skopeo --insecure-policy copy \ - "oci:${oci_img_dir}:${tag}" \ - "${image_type}:${image_name}:${tag}" - ;; - *) - die "Unsupported format for containerize_rootfs: ${image_type}" - ;; - esac - done -} - diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index f87b76e7..4413a7d6 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -10,7 +10,8 @@ STAMPCLEAN = "${STAMPS_DIR}/${DISTRO}-${DISTRO_ARCH}/${PN}-${MACHINE}/*-*" SSTATE_MANIFESTS = "${TMPDIR}/sstate-control/${MACHINE}-${DISTRO}-${DISTRO_ARCH}" IMAGE_INSTALL ?= "" -IMAGE_FSTYPES ?= "${@ d.getVar("IMAGE_TYPE", True) if d.getVar("IMAGE_TYPE", True) else "ext4-img"}" +IMAGE_FSTYPES ?= "${@ d.getVar("IMAGE_TYPE", True) if d.getVar("IMAGE_TYPE", True) else "ext4"}" +IMAGE_CONVERSIONS = "gz xz" IMAGE_ROOTFS ?= "${WORKDIR}/rootfs" KERNEL_IMAGE_PKG ??= "${@ ("linux-image-" + d.getVar("KERNEL_NAME", True)) if d.getVar("KERNEL_NAME", True) else ""}" @@ -83,7 +84,183 @@ inherit image-tools-extension inherit image-postproc-extension inherit image-locales-extension inherit image-account-extension -inherit image-container-extension + +def get_base_type(t, d): + bt = t + for c in d.getVar('IMAGE_CONVERSIONS').split(): + if t.endswith('.' + c): + bt = t[:-len('.' + c)] + break + return bt if bt == t else get_base_type(bt, d) + +# determine image basetypes, just so we can use it in imagetypes* classes +python() { + basetypes = set() + for t in (d.getVar('IMAGE_FSTYPES') or '').split(): + bt = get_base_type(t, d) + if bt.endswith('-img'): + # be backwards-compatible + bt = bt[:-len('-img')] + bb.warn("IMAGE_TYPE '{0}-img' is deprecated. Please use '{0}' instead.".format(bt)) + basetypes.add(bt) + deps = (d.getVar('IMAGE_TYPEDEP_' + bt.replace('-', '_').replace('.', '_')) or '').split() + basetypes |= set([get_base_type(t, d) for t in deps]) + d.setVar('IMAGE_BASETYPES', ' '.join(basetypes)) +} + +# image types +IMAGE_CLASSES ??= "" +IMGCLASSES = "container-img cpiogz-img ext4-img fit-img targz-img ubi-img ubifs-img vm-img wic-img" +IMGCLASSES += "${IMAGE_CLASSES}" +inherit ${IMGCLASSES} + +# image conversions +CONVERSION_CMD_gz = "${SUDO_CHROOT} sh -c 'gzip -f -9 -n -c --rsyncable ${IMAGE_FILE_CHROOT} > ${IMAGE_FILE_CHROOT}.gz'" +CONVERSION_DEPS_gz = "gzip" + +XZ_OPTIONS ?= "" +CONVERSION_CMD_xz = "${SUDO_CHROOT} sh -c 'cat ${IMAGE_FILE_CHROOT} | xz ${XZ_OPTIONS} > ${IMAGE_FILE_CHROOT}.xz'" +CONVERSION_DEPS_xz = "xz-utils" + +# hook up IMAGE_CMD_* +python() { + image_types = (d.getVar('IMAGE_FSTYPES') or '').split() + conversions = set(d.getVar('IMAGE_CONVERSIONS').split()) + + basetypes = {} + typedeps = {} + vardeps = set() + + def collect_image_type(t): + bt = get_base_type(t, d) + if bt.endswith('-img'): + # be backwards-compatible + bt = bt[:-len('-img')] + bb.warn("IMAGE_TYPE '{0}-img' is deprecated. Please use '{0}' instead.".format(bt)) + + if bt not in basetypes: + basetypes[bt] = [] + if t not in basetypes[bt]: + basetypes[bt].append(t) + t_clean = t.replace('-', '_').replace('.', '_') + deps = (d.getVar('IMAGE_TYPEDEP_' + t_clean) or '').split() + vardeps.add('IMAGE_TYPEDEP_' + t_clean) + if bt not in typedeps: + typedeps[bt] = set() + for dep in deps: + if dep not in image_types: + image_types.append(dep) + collect_image_type(dep) + typedeps[bt].add(get_base_type(dep, d)) + if bt != t: + collect_image_type(bt) + + for t in image_types[:]: + collect_image_type(t) + + # TODO: OE uses do_image, but Isar is different... + d.appendVarFlag('do_image_tools', 'vardeps', ' '.join(vardeps)) + + imager_install = set() + imager_build_deps = set() + conversion_install = set() + for bt in basetypes: + vardeps = set() + cmds = [] + bt_clean = bt.replace('-', '_').replace('.', '_') + + # prepare local environment + localdata = bb.data.createCopy(d) + localdata.setVar('OVERRIDES', bt_clean + ':' + d.getVar('OVERRIDES', False)) + localdata.setVar('PV', d.getVar('PV')) + localdata.delVar('DATETIME') + localdata.delVar('DATE') + localdata.delVar('TMPDIR') + vardepsexclude = (d.getVarFlag('IMAGE_CMD_' + bt_clean, 'vardepsexclude', True) or '').split() + for dep in vardepsexclude: + localdata.delVar(dep) + + # check if required args are set + required_args = (localdata.getVar('IMAGE_CMD_REQUIRED_ARGS') or '').split() + if any([d.getVar(arg) is None for arg in required_args]): + bb.fatal("IMAGE_TYPE '%s' requires these arguments: %s" % (image_type, ', '.join(required_args))) + + # convenience variables to be used by CMDs + localdata.setVar('IMAGE_FILE_HOST', '${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.${type}') + #bb.warn("FULLNAME is %s -> %s" % (localdata.getVar('IMAGE_FULLNAME', False), localdata.getVar('IMAGE_FULLNAME', True))) + localdata.setVar('IMAGE_FILE_CHROOT', '${PP_DEPLOY}/${IMAGE_FULLNAME}.${type}') + localdata.setVar('SUDO_CHROOT', localdata.expand('sudo chroot ${BUILDCHROOT_DIR}')) + + # imager install + for dep in (d.getVar('IMAGER_INSTALL_' + bt_clean) or '').split(): + imager_install.add(dep) + for dep in (d.getVar('IMAGER_BUILD_DEPS_' + bt_clean) or '').split(): + imager_build_deps.add(dep) + + # construct image command + cmds.append('\timage_do_mounts') + image_cmd = localdata.getVar('IMAGE_CMD_' + bt_clean) + if image_cmd: + localdata.setVar('type', bt) + cmds.append(localdata.expand(image_cmd)) + #bb.warn("IMAGE_CMD\n*** %s\n*** %s" % (image_cmd, localdata.expand(image_cmd))) + cmds.append(localdata.expand('\tsudo chown $(id -u):$(id -g) ${IMAGE_FILE_HOST}')) + else: + bb.fatal("No IMAGE_CMD for %s" % bt) + vardeps.add('IMAGE_CMD_' + bt_clean) + d.delVarFlag('IMAGE_CMD_' + bt_clean, 'func') + task_deps = d.getVarFlag('IMAGE_CMD_' + bt_clean, 'depends') + + # add conversions + conversion_depends = set() + rm_images = set() + def create_conversions(t): + for c in sorted(conversions): + if t.endswith('.' + c): + t = t[:-len(c) - 1] + create_conversions(t) + localdata.setVar('type', t) + cmd = '\t' + localdata.getVar('CONVERSION_CMD_' + c) + if cmd not in cmds: + cmds.append(cmd) + cmds.append(localdata.expand('\tsudo chown $(id -u):$(id -g) ${IMAGE_FILE_HOST}.%s' % c)) + vardeps.add('CONVERSION_CMD_' + c) + for dep in (localdata.getVar('CONVERSION_DEPS_' + c) or '').split(): + conversion_install.add(dep) + # remove temporary image files + if t not in image_types: + rm_images.add(localdata.expand('${IMAGE_FILE_HOST}')) + + for t in basetypes[bt]: + create_conversions(t) + + if bt not in image_types: + localdata.setVar('type', t) + rm_images.add(localdata.expand('${IMAGE_FILE_HOST}')) + + for image in rm_images: + cmds.append('\trm ' + image) + + # image type dependencies + after = 'do_image_tools' + for dep in typedeps[bt]: + after += ' do_image_%s' % dep.replace('-', '_').replace('.', '_') + + # create the task + task = 'do_image_%s' % bt_clean + d.setVar(task, '\n'.join(cmds)) + d.setVarFlag(task, 'func', '1') + d.appendVarFlag(task, 'prefuncs', ' set_image_size') + d.appendVarFlag(task, 'vardeps', ' ' + ' '.join(vardeps)) + d.appendVarFlag(task, 'vardepsexclude', ' ' + ' '.join(vardepsexclude)) + d.appendVarFlag(task, 'dirs', localdata.expand(' ${DEPLOY_DIR_IMAGE}')) + if task_deps: + d.appendVarFlag(task, 'depends', task_deps) + bb.build.addtask(task, 'do_image', after, d) + + d.appendVar('IMAGER_INSTALL', ' ' + ' '.join(sorted(imager_install | conversion_install))) + d.appendVar('IMAGER_BUILD_DEPS', ' ' + ' '.join(sorted(imager_build_deps))) +} # Extra space for rootfs in MB ROOTFS_EXTRA ?= "64" @@ -256,6 +433,3 @@ do_rootfs_quality_check() { } addtask rootfs_quality_check after do_rootfs_finalize before do_rootfs - -# Last so that the image type can overwrite tasks if needed -inherit ${IMAGE_FSTYPES} diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass index b021e728..7e9fb0f3 100644 --- a/meta/classes/rootfs.bbclass +++ b/meta/classes/rootfs.bbclass @@ -172,6 +172,7 @@ rootfs_install_pkgs_install() { do_rootfs_install[root_cleandirs] = "${ROOTFSDIR}" do_rootfs_install[vardeps] += "${ROOTFS_CONFIGURE_COMMAND} ${ROOTFS_INSTALL_COMMAND}" +do_rootfs_install[vardepsexclude] += "IMAGE_ROOTFS" do_rootfs_install[depends] = "isar-bootstrap-${@'target' if d.getVar('ROOTFS_ARCH') == d.getVar('DISTRO_ARCH') else 'host'}:do_build" do_rootfs_install[recrdeptask] = "do_deploy_deb" python do_rootfs_install() { diff --git a/meta/classes/sdk.bbclass b/meta/classes/sdk.bbclass index adf9a1fe..477dff70 100644 --- a/meta/classes/sdk.bbclass +++ b/meta/classes/sdk.bbclass @@ -31,7 +31,7 @@ SDKCHROOT_DIR = "${DEPLOY_DIR_SDKCHROOT}/${BPN}-${MACHINE}" # SDK settings SDK_INCLUDE_ISAR_APT ?= "0" -SDK_FORMATS ?= "targz-img" +SDK_FORMATS ?= "tar.xz" SDK_INSTALL ?= "" SDK_PREINSTALL += " \ debhelper \ diff --git a/meta/classes/targz-img.bbclass b/meta/classes/targz-img.bbclass index bf94af02..74d34e29 100644 --- a/meta/classes/targz-img.bbclass +++ b/meta/classes/targz-img.bbclass @@ -3,13 +3,6 @@ # # SPDX-License-Identifier: MIT -TARGZ_IMAGE_FILE = "${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.tar.gz" - -do_targz_image() { - rm -f ${TARGZ_IMAGE_FILE} - sudo tar -cvzf ${TARGZ_IMAGE_FILE} --one-file-system -C ${IMAGE_ROOTFS} . - sudo chown $(id -u):$(id -g) ${TARGZ_IMAGE_FILE} +IMAGE_CMD_tar() { + sudo tar -cvzf ${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.tar.gz --one-file-system -C ${IMAGE_ROOTFS} . } - -addtask targz_image before do_image after do_image_tools -do_targz_image[dirs] = "${DEPLOY_DIR_IMAGE}" diff --git a/meta/classes/ubi-img.bbclass b/meta/classes/ubi-img.bbclass index efaf058e..92acb6f8 100644 --- a/meta/classes/ubi-img.bbclass +++ b/meta/classes/ubi-img.bbclass @@ -3,30 +3,18 @@ # # SPDX-License-Identifier: MIT -python() { - if not d.getVar("UBINIZE_ARGS"): - raise bb.parse.SkipRecipe("UBINIZE_ARGS must be set") -} - UBINIZE_CFG ??= "ubinize.cfg" -UBI_IMAGE_FILE ?= "${IMAGE_FULLNAME}.ubi.img" -IMAGER_INSTALL += "mtd-utils" +IMAGER_INSTALL_ubi += "mtd-utils" # Generate ubi filesystem image -do_ubi_image() { +IMAGE_CMD_ubi() { if [ ! -e "${WORKDIR}/${UBINIZE_CFG}" ]; then die "UBINIZE_CFG does not contain ubinize config file." fi - rm -f '${DEPLOY_DIR_IMAGE}/${UBI_IMAGE_FILE}' - - image_do_mounts - - # Create ubi image using buildchroot tools - sudo chroot ${BUILDCHROOT_DIR} /usr/sbin/ubinize ${UBINIZE_ARGS} \ - -o '${PP_DEPLOY}/${UBI_IMAGE_FILE}' '${PP_WORK}/${UBINIZE_CFG}' - sudo chown $(id -u):$(id -g) '${DEPLOY_DIR_IMAGE}/${UBI_IMAGE_FILE}' + ${SUDO_CHROOT} /usr/sbin/ubinize ${UBINIZE_ARGS} \ + -o '${IMAGE_FILE_CHROOT}' '${PP_WORK}/${UBINIZE_CFG}' } -addtask ubi_image before do_image after do_image_tools do_transform_template -do_ubi_image[dirs] = "${DEPLOY_DIR_IMAGE}" +IMAGE_CMD_ubi[depends] = "${PN}:do_transform_template" +IMAGE_CMD_REQUIRED_ARGS_ubi = "UBINIZE_ARGS" diff --git a/meta/classes/ubifs-img.bbclass b/meta/classes/ubifs-img.bbclass index 229eb3ef..60c3bf14 100644 --- a/meta/classes/ubifs-img.bbclass +++ b/meta/classes/ubifs-img.bbclass @@ -3,30 +3,19 @@ # # SPDX-License-Identifier: MIT -python() { - if not d.getVar("MKUBIFS_ARGS"): - raise bb.parse.SkipRecipe("mkubifs_args must be set") -} - -UBIFS_IMAGE_FILE ?= "${IMAGE_FULLNAME}.ubifs.img" - -IMAGER_INSTALL += "mtd-utils" +IMAGER_INSTALL_ubifs += "mtd-utils" # glibc bug 23960 https://sourceware.org/bugzilla/show_bug.cgi?id=23960 # should not use QEMU on armhf target with mkfs.ubifs < v2.1.3 -ISAR_CROSS_COMPILE_armhf = "1" +python() { + if 'ubifs' in (d.getVar('IMAGE_BASETYPES') or '').split(): + d.setVar('ISAR_CROSS_COMPILE_armhf', '1') +} # Generate ubifs filesystem image -do_ubifs_image() { - rm -f '${DEPLOY_DIR_IMAGE}/${UBIFS_IMAGE_FILE}' - - image_do_mounts - +IMAGE_CMD_ubifs() { # Create ubifs image using buildchroot tools - sudo chroot ${BUILDCHROOT_DIR} /usr/sbin/mkfs.ubifs ${MKUBIFS_ARGS} \ - -r '${PP_ROOTFS}' '${PP_DEPLOY}/${UBIFS_IMAGE_FILE}' - sudo chown $(id -u):$(id -g) '${DEPLOY_DIR_IMAGE}/${UBIFS_IMAGE_FILE}' + ${SUDO_CHROOT} /usr/sbin/mkfs.ubifs ${MKUBIFS_ARGS} \ + -r '${PP_ROOTFS}' '${IMAGE_FILE_CHROOT}' } - -addtask ubifs_image before do_image after do_image_tools -do_ubifs_image[dirs] = "${DEPLOY_DIR_IMAGE}" +IMAGE_CMD_REQUIRED_ARGS_ubifs = "MKUBIFS_ARGS" diff --git a/meta/classes/vm-img.bbclass b/meta/classes/vm-img.bbclass index 4bc977b9..8a676aca 100644 --- a/meta/classes/vm-img.bbclass +++ b/meta/classes/vm-img.bbclass @@ -5,16 +5,18 @@ # inherit buildchroot -inherit wic-img + +USING_OVA = "${@bb.utils.contains('IMAGE_BASETYPES', 'ova', '1', '0', d)}" FILESEXTRAPATHS_prepend := "${LAYERDIR_core}/classes/vm-img:" OVF_TEMPLATE_FILE ?= "vm-img-virtualbox.ovf.tmpl" -SRC_URI += "file://${OVF_TEMPLATE_FILE}" +SRC_URI += "${@'file://${OVF_TEMPLATE_FILE}' if d.getVar('USING_OVA') == '1' else ''}" -IMAGER_INSTALL += "qemu-utils gawk uuid-runtime" +IMAGE_TYPEDEP_ova = "wic" +IMAGER_INSTALL_ova += "qemu-utils gawk uuid-runtime" # virtual machine disk settings -SOURCE_IMAGE_FILE ?= "${IMAGE_FULLNAME}.wic.img" +SOURCE_IMAGE_FILE ?= "${IMAGE_FULLNAME}.wic" # For VirtualBox, this needs to be "monolithicSparse" (default to it). # VMware needs this to be "streamOptimized". @@ -34,7 +36,7 @@ def set_convert_options(d): CONVERSION_OPTIONS = "${@set_convert_options(d)}" -do_convert_wic() { +convert_wic() { rm -f '${DEPLOY_DIR_IMAGE}/${VIRTUAL_MACHINE_IMAGE_FILE}' image_do_mounts bbnote "Creating ${VIRTUAL_MACHINE_IMAGE_FILE} from ${SOURCE_IMAGE_FILE}" @@ -43,8 +45,6 @@ do_convert_wic() { '${PP_DEPLOY}/${SOURCE_IMAGE_FILE}' '${VIRTUAL_MACHINE_DISK}' } -addtask convert_wic before do_build after do_wic_image do_copy_boot_files do_install_imager_deps do_transform_template - # User settings for OVA OVA_NAME ?= "${IMAGE_FULLNAME}" OVA_MEMORY ?= "8192" @@ -67,10 +67,11 @@ OVA_VARS = "OVA_NAME OVA_MEMORY OVA_NUMBER_OF_CPU OVA_VRAM \ OVA_FIRMWARE OVA_ACPI OVA_3D_ACCEL \ OVA_SHA_ALG VIRTUAL_MACHINE_IMAGE_FILE" -TEMPLATE_FILES += "${OVF_TEMPLATE_FILE}" +TEMPLATE_FILES += "${@'${OVF_TEMPLATE_FILE}' if d.getVar('USING_OVA') == '1' else ''}" TEMPLATE_VARS += "${OVA_VARS}" -do_create_ova() { +do_image_ova[prefuncs] += "convert_wic" +IMAGE_CMD_ova() { if [ ! ${VIRTUAL_MACHINE_IMAGE_TYPE} = "vmdk" ]; then exit 0 fi @@ -81,10 +82,7 @@ do_create_ova() { export PRIMARY_MAC=$(macgen) export LAST_CHANGE=$(date -u "+%Y-%m-%dT%H:%M:%SZ") export OVA_FIRMWARE_UPPERCASE=$(echo ${OVA_FIRMWARE} | tr '[a-z]' '[A-Z]') - export OVF_TEMPLATE_STAGE2=$(echo ${OVF_TEMPLATE_FILE} | sed 's/.tmpl$//' ) - image_do_mounts - sudo -Es chroot --userspec=$( id -u ):$( id -g ) ${BUILDCHROOT_DIR} <<'EOSUDO' set -e export DISK_SIZE_BYTES=$(qemu-img info -f vmdk "${VIRTUAL_MACHINE_DISK}" \ @@ -104,5 +102,3 @@ do_create_ova() { tar -uvf ${PP_DEPLOY}/${OVA_NAME}.ova -C ${PP_DEPLOY} ${VIRTUAL_MACHINE_IMAGE_FILE} EOSUDO } - -addtask do_create_ova after do_convert_wic before do_deploy diff --git a/meta/classes/wic-img.bbclass b/meta/classes/wic-img.bbclass index 7537a27b..cfcc94c7 100644 --- a/meta/classes/wic-img.bbclass +++ b/meta/classes/wic-img.bbclass @@ -4,7 +4,8 @@ # this class is heavily inspired by OEs ./meta/classes/image_types_wic.bbclass # -WKS_FILE_CHECKSUM = "${@'${WKS_FULL_PATH}:%s' % os.path.exists('${WKS_FULL_PATH}')}" +USING_WIC = "${@bb.utils.contains('IMAGE_BASETYPES', 'wic', '1', '0', d)}" +WKS_FILE_CHECKSUM = "${@'${WKS_FULL_PATH}:%s' % os.path.exists('${WKS_FULL_PATH}') if d.getVar('USING_WIC') == '1' else ''}" WKS_FILE ??= "sdimage-efi" @@ -14,6 +15,9 @@ do_copy_wks_template () { } python () { + if not d.getVar('USING_WIC') == '1': + return + import itertools import re @@ -74,13 +78,13 @@ python () { except (IOError, OSError) as exc: pass else: - bb.build.addtask('do_copy_wks_template', 'do_transform_template do_wic_image', None, d) - bb.build.addtask('do_transform_template', 'do_wic_image', None, d) + bb.build.addtask('do_copy_wks_template', 'do_transform_template do_image_wic', None, d) + bb.build.addtask('do_transform_template', 'do_image_wic', None, d) } inherit buildchroot -IMAGER_INSTALL += "${WIC_IMAGER_INSTALL}" +IMAGER_INSTALL_wic += "${WIC_IMAGER_INSTALL}" # wic comes with reasonable defaults, and the proper interface is the wks file ROOTFS_EXTRA ?= "0" @@ -125,32 +129,23 @@ python do_rootfs_wicenv () { } -addtask do_rootfs_wicenv after do_rootfs before do_wic_image +addtask do_rootfs_wicenv after do_rootfs before do_image_wic do_rootfs_wicenv[vardeps] += "${WICVARS}" do_rootfs_wicenv[prefuncs] = 'set_image_size' -WIC_IMAGE_FILE ="${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.wic.img" - -python check_for_wic_warnings() { - with open("{}/log.do_wic_image".format(d.getVar("T"))) as f: - for line in f.readlines(): - if line.startswith("WARNING"): - bb.warn(line.strip()) +check_for_wic_warnings() { + WARN="$(grep -e '^WARNING' ${T}/log.do_image_wic || true)" + if [ -n "$WARN" ]; then + bbwarn "$WARN" + fi } -do_wic_image[file-checksums] += "${WKS_FILE_CHECKSUM}" -do_wic_image[dirs] = "${DEPLOY_DIR_IMAGE}" -python do_wic_image() { - cmds = ['wic_do_mounts', 'generate_wic_image', 'check_for_wic_warnings'] - weights = [5, 90, 5] - progress_reporter = bb.progress.MultiStageProgressReporter(d, weights) - - for cmd in cmds: - progress_reporter.next_stage() - bb.build.exec_func(cmd, d) - progress_reporter.finish() +do_image_wic[file-checksums] += "${WKS_FILE_CHECKSUM}" +IMAGE_CMD_wic() { + wic_do_mounts + generate_wic_image + check_for_wic_warnings } -addtask wic_image before do_image after do_image_tools wic_do_mounts() { buildchroot_do_mounts @@ -209,7 +204,7 @@ generate_wic_image() { sudo chown -R $(id -u):$(id -g) ${BUILDCHROOT_DIR}/${WICTMP} find ${BUILDCHROOT_DIR}/${WICTMP} -type f -name "*.direct*" | while read f; do suffix=$(basename $f | sed 's/\(.*\)\(\.direct\)\(.*\)/\3/') - mv -f ${f} ${WIC_IMAGE_FILE}${suffix} + mv -f ${f} "${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.wic${suffix}" done rm -rf ${BUILDCHROOT_DIR}/${WICTMP} rm -rf ${IMAGE_ROOTFS}/../pseudo