From patchwork Wed Apr 27 22:06:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Schmidt, Adriaan" X-Patchwork-Id: 1726 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3) with LMTPA; Thu, 28 Apr 2022 08:06:58 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-lf1-f57.google.com (mail-lf1-f57.google.com [209.85.167.57]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8) with ESMTPS id 23S66vOd005940 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 28 Apr 2022 08:06:58 +0200 Received: by mail-lf1-f57.google.com with SMTP id bp36-20020a05651215a400b004722f090903sf1382948lfb.22 for ; Wed, 27 Apr 2022 23:06:58 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1651126012; cv=pass; d=google.com; s=arc-20160816; b=Ju/awC2e4RNnjzaNz3PyBbypks6tVzQY+jwFxiyefURoRzxBClgxEaCLTSxQ3HayUx N5oeWpnfwsk9WMYPLg31s268C0EURrnxIKtV4wbJxS28ef+7rhx0yhnLuFmZGLNOFM1G Zslnebi+XkZhh8lwPNPjLp8p/dUP2DfVdBxUYSfrFQNCFH8X0X2a2t8aANtdNwh6ue4r geNmtLgI8LaLwan0wveTJTEPGrwPRiYeqRijsCc8HljKYaOH1s0LDqcV9NBknhkdKU3W xiiKv3Y7bLlIZxe27Oz9znakJ96YcLGUkst6gGT9jmmeDSYvGpvDZA8U2SESKexTFQ2m 6/mw== 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=y3ELvNLjUmd/hjnuqyOU6SqF5GB7HhiaqvGKZyf33G8=; b=z6ZAFNb2438ZuZb2gW2SZPD6qmIxSX+a4McbzzREXTB85j8rvAnwevqpcJnRe+tZ76 ZIb221OalrRjmW0Nd3BeOhEYH1MZWd4/TytFFTFLATo/RD7w3+DdKTM56sm/bDVdfjqe 9mg44ftQ3bDUkjQlei07Jx3tJS+3by52z6tP4GSWa/gLxMhQdWVxJQL8LMG9BlmFwGuR mnfImCHEH6GRRxr5+ml1ScESyR2t3DOcpOLFHsFRQnK1/ekk3RrQnJzzT6Xk4VQwLFn5 99giO264GqjaXmjJUxB+6yxwKFAKmwM30nZ/VYOG+hzS5Utur6lXgEHquqXKr/yM7Qjw nFZw== ARC-Authentication-Results: i=3; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=y0ugbGpj; 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:7e1a::605 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=y3ELvNLjUmd/hjnuqyOU6SqF5GB7HhiaqvGKZyf33G8=; b=jx7b5gFbo1vOOH/vTjUqQ8ALjS3vNvRKgPfGekyE7jECgbyxEXzSxJIfGIovjd0uTh nv1C3sBcsJO5Wp2WxzXT3GNOoCS9RbY/FYbbLd82F5NUYdtYVOXb6pAyWSYtaJuX5CUc TK1IRGRB3DnY2SAe/gywHqWdjDxZEr8uvQHI5RPOGWdNQpcyrxLNF4MJoQRSAaDRVzNa bU8KyA046009U1dTC27QhziDr1bmbpUxibfyZk/2Il2KlFD+62bzXKjIBe4KpR7TXoHR PRMJEQofdCTvfvV6llyS6OFV/Zp9Zo7wBzPI9R5M6npXwpW4fL1WO2q62yCchQuNWqF+ X9SQ== 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=y3ELvNLjUmd/hjnuqyOU6SqF5GB7HhiaqvGKZyf33G8=; b=Jpl9xrJ886ZYiWkQyC7MMQD7k84rXEHVFRLbv/Nse77t2wjads9W3ROtOiDK1BtJwh VUnrDMQXXLLl05bWuoTZ4L5Fywdfuv6F+SD0DzBlUaFODyoeFJyBtjeqkyCxKoSm2vUu lx2SWEzAZhonsdmXyscbWPAeE29AlG40amBJ6sRgKkpoeJYfAXKM0GynWmjVPaiP8mSZ /ckjPfRqTJAe2/9oT2Oscje0FEYoEwjWxKpkmsbkkG9A0mAMYswc2woPN4L6VEXowYLz ZK8lT6mv4lSDJWfwbM8WEDLn/O1NsuJeqZFTdydYxRRfO/BRk71T7viCPaf5hafnTh6R 0Zvg== Sender: isar-users@googlegroups.com X-Gm-Message-State: AOAM531z0razrqPlfuzdWgBmD+ilVjBN7hdsygbmvBm3Z6YIot2DsaOl cusN4GYaUgsA+3y1w/jFeYo= X-Google-Smtp-Source: ABdhPJxhRs3iA5vgNfc/uzPGS6mckLGL9JaWNyKKfFzS0auEOf/GonwjHqryUD7829BYTNbqm1jaow== X-Received: by 2002:a05:6512:3f89:b0:44a:f5bf:ec7e with SMTP id x9-20020a0565123f8900b0044af5bfec7emr23090700lfa.671.1651126012534; Wed, 27 Apr 2022 23:06:52 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6512:1693:b0:448:3742:2320 with SMTP id bu19-20020a056512169300b0044837422320ls3754055lfb.1.gmail; Wed, 27 Apr 2022 23:06:51 -0700 (PDT) X-Received: by 2002:ac2:4188:0:b0:471:96f4:c1d4 with SMTP id z8-20020ac24188000000b0047196f4c1d4mr22943393lfh.626.1651126011588; Wed, 27 Apr 2022 23:06:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1651126011; cv=pass; d=google.com; s=arc-20160816; b=XXUI1DJmn6XM8YeTlwBroK823u5+eaWMS/qnd/VozTuxG66ZMGdogB4I2qp+CHlP+T ZZMO772umGnjlZXh5+UG22zJH5KbXEt2XS2BR3nd8F1M30Ie1wo/cgooimCKYHl+56wq S+aqpEcrplRdqoVYlOvEtSKjnYAPXHP2iuZkiKshH2mDbkuCmTafW+wLqtnDUyaxYx9o wiP08VvsZCsRoS86Pbr/Mgf86CKxsFxdr7sr5wHW7Eah68hEh8VbM3n5MjWEWu7zUXYz 6zsun3YswbG4CEHqvl0519SQgBrv2ghfSu8asrUtJbiml36lCl4quA8Y2/taQGCs5SxU 2dvA== 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=R8leZsZSwosLRIqXXM0MebsXZrcxWC0Uvzi2FMrqq6Q=; b=XgqDyhH3xEyJVcoFeOyf+UUtQAzbTc+WXUx4/1jbYZhfW70P9vtmT2qTcGWmLz30fs tX4Lnxy26p8IBHcDIoeBQ4LIrFbko7gAV+oow8h2KOqV5BBA8KxDqRPDCOT+Ycs0y5Ol LIXCJmDVoVvJKo9DRW2eYPWWqAJtKWia0Ha68KRldLJLeCH0y4naP01q2N/s8elNbQGM 3wevBLy0eeP284kUqqU8ZocV3jx14gbVxrwBReetgDaNsbQTsg9u4/x5A3Ms1Sac5MQz B8wsbxyFuSg+VHjqESQwoQYGRqg5DlYHwaGozDuLwFXguYxO89Oze1qRhI8SEZGmiHVR StKQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=y0ugbGpj; 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:7e1a::605 as permitted sender) smtp.mailfrom=adriaan.schmidt@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on20605.outbound.protection.outlook.com. [2a01:111:f400:7e1a::605]) by gmr-mx.google.com with ESMTPS id b18-20020a056512305200b0047193d0273asi165819lfb.8.2022.04.27.23.06.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Apr 2022 23:06:51 -0700 (PDT) Received-SPF: pass (google.com: domain of adriaan.schmidt@siemens.com designates 2a01:111:f400:7e1a::605 as permitted sender) client-ip=2a01:111:f400:7e1a::605; ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nmDkzzq15LCsiE2+oqS27YXxQVC737FrpeW+4me8JRyPQC0vQGXBC5QVoMbyQZ4hR6r/C1VnBEaQYk+bg5LL6N0oT0rGqq12+jXqPMNvISjzJtkKoh4J84L43EXs4X5ys8RW2tRuNYjmuMM6oRy/iXPWs80m5ASSBwJTuVdG9E9fqz3vr5YpVLff0iWlbP45mbVDAf2sWRpEyeCkipf1r9Rf6NPtSmFcFkY2132+OlMSALPjE2xh+WSbAV3kzYOdiBO/E6ex4y09ZMcPz+7SvEr5YxxmXajFiA0n3Xq/mgEuPYd6FG4hZ7ofzgGKTziq3wivjpd54Z52GRW3oKjGoQ== 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=R8leZsZSwosLRIqXXM0MebsXZrcxWC0Uvzi2FMrqq6Q=; b=EZJrncXpX8xt9ouZk3uJ1u+3ZZglNwUW+D5uksFDJirSkTJ4lsW9XS4Wgl5SxFHyClo/IdKi4B3EgHHI0PjGEHGEptFpy1aqz7wa81IFetxkhqfC6QtqmRBvt0RbMg7r9j5DCwQb1iCDQBu2RFzB6y5NZ7PDt2sqwBgCcujrZAjV8aJBeXhnbeLdaBsTppLBPds1Lp7R56IKTlkip+Fml4a+HSlVIOgfwlVs295zGl3Mz6xEf3EQwpo/ugJ7JUkHs2E9yP0rvkOFT2sdWNkskzAt2Ow1L6w3SPUyowxbr3tha/nV0rUVXTcMQDVuo/alqL+B5Qk7YWM6ud+d/IxZYQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 194.138.21.73) 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 SV0P279CA0049.NORP279.PROD.OUTLOOK.COM (2603:10a6:f10:13::18) by VI1PR10MB2142.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:803:80::20) 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:38 +0000 Received: from HE1EUR01FT107.eop-EUR01.prod.protection.outlook.com (2603:10a6:f10:13:cafe::5d) by SV0P279CA0049.outlook.office365.com (2603:10a6:f10:13::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.12 via Frontend Transport; Thu, 28 Apr 2022 06:06:38 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 194.138.21.73) 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.73 as permitted sender) receiver=protection.outlook.com; client-ip=194.138.21.73; helo=hybrid.siemens.com; Received: from hybrid.siemens.com (194.138.21.73) by HE1EUR01FT107.mail.protection.outlook.com (10.152.0.244) 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:38 +0000 Received: from DEMCHDC89XA.ad011.siemens.net (139.25.226.103) by DEMCHDC9SNA.ad011.siemens.net (194.138.21.73) 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 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 3/8] meta: introduce IMAGE_CMD_* Date: Thu, 28 Apr 2022 08:06:10 +0200 Message-ID: <20220428060615.986332-4-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 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--11.322700-8.000000 X-TMASE-MatchedRID: u0SOUSjK6nuKjhO49WcRvxtMufvbmwz+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+a38omfXdjnxOsxOOzVy1G1jO4I4qdhC2OTf6ksRncwz3CwuNS8coKUcaOOvZdr6oz k7W7RVZm0ipWSDf0Ha/ro3I/fUz1JaUm3mqtHC/g/vgkoKiXErhw/CPhbBXOzSsLVQWM99Acduu dkA1MgUEQTkIWiYv9SvU5mykyAqn35kXoM3qyAMuqetGVetnyef22ep6XYOwBXM346/+y0DhJtD ZPazWeDbKlR2lAOw08aAGsG05rxdulGnddVmVEM3VsY/S+0 X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--11.322700-8.000000 X-TMASE-Version: SMEX-14.0.0.3080-8.6.1018-26680.007 X-TM-SNTS-SMTP: 02E609A6DD9628362CBEF7B0C3B27181AE32C7CA5F2B78FF38F015E7120E08AC2000:8 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6bb77bfd-aa90-4a5c-63f1-08da28dd41b1 X-MS-TrafficTypeDiagnostic: VI1PR10MB2142: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: kRd//gWZ2cGvxs0CxrwZ3/bOgPPEau0sA8Km3h+MrslP3s3BC+p135O21V0cdD6QNmndWBRpiZP0V6O8pJ0Mhsy76vm7ZQC4ebU20uA7j30iUAQpITfHFyBMvWMBxYA2vxejAdjaUjwtYUduco8NFVKTiuIzmo4Q5pEWfDXfbzmKLZ53+pVYKvn3DyvOTnkpW0CWHhDTVQ9rixDxA8VbC7NXkHaz6sybeRDRYZSyRsPnQ0l3h6ZcTsm5CojQufjo9KF+VHVLGlty5Aldx7gUZLBG4iADqWEFX2N1zSUWo+m7r6SQNgquDpnLjOumZgb4GfRhQT7DGjZD/blnmdF7DEXiU1CWTiU+y+Px//2CE4pqOn3bvhAQloxXYDFMhxm69Ze09x0KAItAya2CDzWC+cDLPVLKuDEZjD9J+JnH6fOsd/BUTPfh/vnx6wFTo8znREQBIHpOXSC8T2HGKqw99LyiDBcFxZDzs3KAG8DRykPc8Qhj233mzjZcBqpNKZ9kAL24ORkI0ueu//8jQQydz8rWAGTCfRrYPE4DS/IpWneoUGZN25rldcjNs0mGy7evGOB+QY6n0gAJG5SDlgnH2Tx0FYxSEWlO2ofo/disehnA6ij3nEeo/pua4Wt8Ah5hLbW2bsdZkt+qi2z3XI7gxM9YHb/bllsgYxxhguDPvKZEkdsqIHoSa6XNIpDmbMWaHxiiHpVdhf2XU9uTT3rIfVMFR8EnsXjbd/25Fipjndvnhif7yCbbibc9xgyEQwfrATOJXVausOf1fV1Dhk1zCXP0cyAEaa0HVGJLxwYGMdE2OSlv3eqqhaGfOGzEgu+1 X-Forefront-Antispam-Report: CIP:194.138.21.73; CTRY:DE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:hybrid.siemens.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230001)(4636009)(46966006)(36840700001)(40470700004)(16526019)(47076005)(82310400005)(6666004)(86362001)(81166007)(26005)(36756003)(70586007)(70206006)(6916009)(316002)(107886003)(2616005)(1076003)(956004)(336012)(186003)(8936002)(44832011)(966005)(508600001)(82960400001)(30864003)(8676002)(40460700003)(83380400001)(2906002)(5660300002)(36860700001)(356005)(4326008)(403724002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Apr 2022 06:06:38.0593 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6bb77bfd-aa90-4a5c-63f1-08da28dd41b1 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.73]; Helo=[hybrid.siemens.com] X-MS-Exchange-CrossTenant-AuthSource: HE1EUR01FT107.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR10MB2142 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=y0ugbGpj; 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:7e1a::605 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, 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 | 198 +++++++++++++++++- 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 | 27 +-- meta/classes/vm-img.bbclass | 24 +-- meta/classes/wic-img.bbclass | 45 ++-- 13 files changed, 343 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..91c7aaaa 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,197 @@ 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) + +# Calculate IMAGE_BASETYPES as list of all image types that need to be built, +# also due to dependencies, but withoug any conversions. +# This is only for use in imagetype classes, e.g., for conditional expressions +# in the form of "${@bb.utils.contains('IMAGE_BASETYPES', type, a, b, d)}" +# All this dependency resolution (including conversions) is then done again +# below when the actual image tasks are constructed. +def get_image_basetypes(d): + def recurse(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)) + deps = (d.getVar('IMAGE_TYPEDEP_' + bt.replace('-', '_').replace('.', '_')) or '').split() + ret = set([bt]) + for dep in deps: + ret |= recurse(dep) + return ret + basetypes = set() + for t in (d.getVar('IMAGE_FSTYPES') or '').split(): + basetypes |= recurse(t) + return ' '.join(list(basetypes)) + +IMAGE_BASETYPES = "${@get_image_basetypes(d)}" + +# 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_MEMLIMIT ?= "50%" +XZ_THREADS ?= "${@oe.utils.cpu_count(at_least=2)}" +XZ_THREADS[vardepvalue] = "1" +XZ_OPTIONS ?= "--memlimit=${XZ_MEMLIMIT} --threads=${XZ_THREADS}" +XZ_OPTIONS[vardepsexclude] += "XZ_MEMLIMIT XZ_THREADS" +CONVERSION_CMD_xz = "${SUDO_CHROOT} sh -c 'xz -c ${XZ_OPTIONS} ${IMAGE_FILE_CHROOT} > ${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 +447,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..5f1be89e 100644 --- a/meta/classes/ubifs-img.bbclass +++ b/meta/classes/ubifs-img.bbclass @@ -3,30 +3,17 @@ # # 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" +THIS_ISAR_CROSS_COMPILE := "${ISAR_CROSS_COMPILE}" +ISAR_CROSS_COMPILE_armhf = "${@bb.utils.contains('IMAGE_BASETYPES', 'ubifs', '1', '${THIS_ISAR_CROSS_COMPILE}', d)}" # 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