From patchwork Mon Oct 5 07:53:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijai Kumar K X-Patchwork-Id: 109 Return-Path: Delivered-To: ilbers.mnt@gmail.com Received: by 2002:a4a:eb04:0:0:0:0:0 with SMTP id f4csp3887342ooj; Mon, 5 Oct 2020 09:53:52 -0700 (PDT) X-Received: by 2002:a2e:9955:: with SMTP id r21mr212225ljj.124.1601916832545; Mon, 05 Oct 2020 09:53:52 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1601916832; cv=pass; d=google.com; s=arc-20160816; b=k0JkD01oHNMwC+3LjdACPAhxegMBaEQtsgfw9x9kA41/mxzrE4ugYoYkq0/RKGKawX xSp16tV9l8iWRNmgKSt0UpMZoMlE0ugozXTPjI5rbW5fNDD2Gv/NXxiHxcxo44Y3whlf tjF8o/T42SultcmaTaHkKJwiBJ8PU+vV1t5tVFGdg9BV2hLlct7OQbyzIxUMnaU50ohV 6sCBUhcEvUY1kmQS6BiFtKFR97qzq2J7MJXzp2qBxgLi7Q7mlATlY57fP1n8AuRzBJGK Ey9gDdBXNMEbnjZYxp6ARW2Z5hJZiEigqir7/RY7hBKrITAKmiYKLD6iffllDJt6j+Xj 7VEQ== 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:ironport-sdr:ironport-sdr:sender :dkim-signature; bh=mijmKgM0VR87dYBZ++xLPyCkdRwiR16sZmh93cdH7As=; b=XBibfJWPdicOSgg2Ri1iXHUHZ64Lb1qbuHcyQYe6Ny4ffoTT+fVNqCWPsjq2NYVj9g FIvT67U9G/NzjuiSQidGGxqwKroClid/nhx8U14/EG1TErTCAINMdJtKR/wI54ilby0g E1UzWEiObWkr4bGZe/egMncKMeV4qXqicFqdn6kBkxRmcTXioEQMRk3ky8Z47mbt9OyD 5N/goPQNK8nmR1QwJN5otVJmABhgJ7Fh4s/ooQoqTNVpNMkbVnIVnmyt2fhJ3SeU9lMY tET88pEzi3JkomRSNASTSVhZrthGxNujY86hQhe893jTmhxbR5wrdr9r9ccIVWmNiBv2 uEMg== ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b="I/U1Oaj0"; arc=pass (i=2 spf=pass spfdomain=mentor.com); spf=pass (google.com: domain of isar-users+bncbcwp7lf37ukrbh475x5qkgqeyfgkwoy@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCWP7LF37UKRBH475X5QKGQEYFGKWOY@googlegroups.com Received: from mail-sor-f55.google.com (mail-sor-f55.google.com. [209.85.220.55]) by mx.google.com with SMTPS id z10sor121084lji.31.2020.10.05.09.53.52 (Google Transport Security); Mon, 05 Oct 2020 09:53:52 -0700 (PDT) Received-SPF: pass (google.com: domain of isar-users+bncbcwp7lf37ukrbh475x5qkgqeyfgkwoy@googlegroups.com designates 209.85.220.55 as permitted sender) client-ip=209.85.220.55; Authentication-Results: mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b="I/U1Oaj0"; arc=pass (i=2 spf=pass spfdomain=mentor.com); spf=pass (google.com: domain of isar-users+bncbcwp7lf37ukrbh475x5qkgqeyfgkwoy@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCWP7LF37UKRBH475X5QKGQEYFGKWOY@googlegroups.com ARC-Seal: i=2; a=rsa-sha256; t=1601916832; cv=pass; d=google.com; s=arc-20160816; b=A0H47JCB6tffDBG3Iew/KCED1RLuuyuqKTpbqZOMM3esql3tJ+lNoebgwLdh9jRbTr Ur1RwnaJbeksN8kdpIF9Dw17LR0kRm3ga6P0CBqyXtQZ1cI0DqBgoUsUpmYw4VWlC7uV ue9XTJaolPzqfsCimzG+T7xZogYopkekBuqaJhAn1Xa/tbPqZwZLEy+As4JJniZkoBRo RlDZ/wjHLTlXn6RHseVOoIIzHfG+ctl3cFEK+/NVgpqbkttEr3WBmaMA7r+iBowfzEFm 7dJGi1qCwjNQ5f9K/l1XkQBQ0zMu7fSnNnfaKlbm0Oyfjs0kxuOLgkf7zlEZ8H3bRxwR dgdA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr:sender :dkim-signature; bh=mijmKgM0VR87dYBZ++xLPyCkdRwiR16sZmh93cdH7As=; b=e7feXKoNKJKYo3EgiQgsEU26fmZAh4krnESF6L3sC1cCse0j1K3A5oLfTnQFYyRko3 ZYPeaAUrqRy2p3YIVavmNgDB5qMzL+tf3b2SmjikIW8QCfLo99cDoqHhR5xdcLFuHAv3 mRL2l2uYDFzCWADOs2doNmgMOPUgnvhMyY24OqipGHFTXHTMUZpc7m7fGm7nFYO7UA3A yJNP13OxAwUuiuWFxOhQL6M939pH342wy66GhCEuUQPoxmntv1Xc/0UIO/OWeJM92w8d khBc6jbc+TC9LgsfL2po7IkI9oieFkwenZyMWMFjDwGddmiYWHHygKPUFmpS06UzuPAJ VmxA== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.252 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:ironport-sdr:ironport-sdr: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=mijmKgM0VR87dYBZ++xLPyCkdRwiR16sZmh93cdH7As=; b=I/U1Oaj0fhtczLTRWi0xMANokgg83zQWv4CU6W5UU1q7PPjPBxpUoAm6agJRtU98QU n6QE7zyHb5mSASz11eBMING7faWuNZ8vKfccCK8XOHw0vAn6myw72TNYZjPz/Mx6rNuC SBSGed8H+4p0V5sJQj253yZ5Pq5ct/oyrZfiB318ULxQoTHCRnaNJtjSLHTnEAoVdZf7 5IPNwp9fmWinqPlYH2BT9XejeBxj10+mxFLxtwR/M713JPd1jcqNvaj7OfS+UsSrklMC hkyUZQ9NmJluAQV6Cm1EEfgXHC4Qu/awuasKhfGkt0f2eIpLzd8NqpHZk6mFxJitQezx 4TWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:ironport-sdr:ironport-sdr: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=mijmKgM0VR87dYBZ++xLPyCkdRwiR16sZmh93cdH7As=; b=he1CrNAYVLHNjInX+Lj/ZDDxihjTwXWFZdd8GVTN0mpP9T5id4UU0UGN9PjNcc9fnu XDCCpDwnltdyDMF6P4RcmIFW2DQx/1Ems72B0VLVD/jtxdZh6uhiBncf1qtwcMWYcr6W L7XrmVuoeSO6C9Aq3yfFiN/Ee2FbHGpIl0hQGxSxhPUs+eK5zYLxN/0eHZ66WcAS7uAT NAWQDHE0yXLdFgzJ2seNsKJdKzrMCmR2CzGvsflr50d04RCRZYSU6OZl/gWs1Qf+zzfr MQTEG+8tLbP7a13k/3PbxMkDufz/8k6jHA2bI0Krop53rka2ysASNcm6EuI1OfKgdy3k Qf5w== Sender: isar-users@googlegroups.com X-Gm-Message-State: AOAM532RcZE5pokTyJrPjx1RFw241gIxRBG9rSIDtHmLqmcM1f5GkP9n 6HyJtEO29GDx8Mc6hYOwXfU= X-Google-Smtp-Source: ABdhPJxVBY6Rn9Wz4XhkAs36wUKmY63l3sdV4d8T29ewyvQGVbyduSldBfhdNnvJ6/W2yGPqeW9YPQ== X-Received: by 2002:a2e:2ac3:: with SMTP id q186mr202682ljq.419.1601916832080; Mon, 05 Oct 2020 09:53:52 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a19:c7c8:: with SMTP id x191ls507946lff.0.gmail; Mon, 05 Oct 2020 09:53:50 -0700 (PDT) X-Received: by 2002:a19:f00c:: with SMTP id p12mr125061lfc.357.1601916830098; Mon, 05 Oct 2020 09:53:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601916830; cv=none; d=google.com; s=arc-20160816; b=Jel1VQXhwwqwXHQ5apP3QlkChVVFXlhVpykhdZdbsI5Abj0a3lPMFBLqAR/jW+dfGd X0ljbvAM63KXWy2llhSp9ZD2WHRZxyr9CKUIhLpXBN8f3fn6TsXUSM61on+U/srNVC3h RSNHF5VBNo0FD+nRAdIY4OGxHfn1rroQAgcEp2WoggXYrmeYQJSpCnJEthUG+jhkf8w5 JAAyhL3go4bmQ5NGyQzY2neUXb4ls8etRhuGAo48L9pD1s9DciTIPNmnHIb0tTB+QeYz 7FPCA61rejcs2cDcmJQRNOUS5eraPmyiaNp5DEIuCWxaCHNvx9cxNvbpHGaGe2bomiUA hYBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:ironport-sdr:ironport-sdr; bh=a+KwTjT97YmeB29mLnGuGgFISg7sFeWprwQC4ykEVbQ=; b=eONN0VNExCmJiDmWvBxvO+30MeTTcDeKnxQZYwcPTW5PY4fzaWsA6lq4rm/B4IRK1Z Qr3bOb1tWQ4YM+Fu0lgBIrYMvL8fy64tA6UWqk2udJY3LjZEHtKOfiRn3CxGyiihNnWt Ty9J9uuR2egjKSjhcJS3J/1h4CKDcmW923j9EQ9IId1ZJP/ccUw4+Xz5RYysz+D3eRsn VbYTqJcHYDNZLoGH1Aj/0ejHSIJRZVbP3Vqg6M8ZzEdDVOGlc1iyypRnM1OBYE4T1mx7 MezCbXIszEPpwHXA52x8lH8rr1pFzavGzEKb+rtzGmYA/6WeTDnpb+d2TIYQZFLwz74m SGLA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.252 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com. [68.232.137.252]) by gmr-mx.google.com with ESMTPS id j75si16955lfj.5.2020.10.05.09.53.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Oct 2020 09:53:50 -0700 (PDT) Received-SPF: pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.252 as permitted sender) client-ip=68.232.137.252; IronPort-SDR: j+jnZNGRr2FEb1Y3xBq/i6v5+aDovpSjRT02Akqx9k7PdmRe9Xp/DwLuQIyZGyiZehHOq0++vj 8WT/VSwbujdB9dIpLdpgrEkgFXbwd4yPWPK2IkU1BK1MA29QBFEyC7qt4KtOmJIiq+MkGIFjxz rt9V8qQGfXkwyklSd1MKjxTuLiHOeCR/t1rXnQzSX6SCTQmV8a0bw0xk8NUxsZuBBp60X/+/7k xs8sSW5smTJssDL5CLrqUWOgpvdFZDrCCyfo5fabop0XPZJ80gqMbsTeOEGHfJPZa/Xi/O0PUY GZ4= X-IronPort-AV: E=Sophos;i="5.77,340,1596528000"; d="scan'208";a="53722782" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 05 Oct 2020 08:53:47 -0800 IronPort-SDR: KGeu97fYzcj/8fE9C+Ir9WbmC47908MKPcKZZvyI55o523vUi0u4mSAnt1Id8/YFm3UZCbyDJ5 z1ruxdqB00NBa4250prwRLJkCq/2g0QoYO50GrBf+dJAmKQ4/sKN6pF/FlYqwfJFcbVQ8U+bEY 0QABNXzN0gDk1/FNqMCagHd9itaNdfddn7S3Qn/TgTTlmDfRPMRg0DCdozV0pJEOlbK0ohrBr3 S5YfkxI5jkZ8cD6ViqMsYLE9omY0d5J1ee0TykoOzJTRAgZxkDRhzMjBGgint9QOVkmCkf0Acq Sts= From: Vijai Kumar K To: , CC: Vijai Kumar K Subject: [PATCH v5 3/8] wic-img: Satisfy the quirks of latest wic Date: Mon, 5 Oct 2020 22:23:02 +0530 Message-ID: <20201005165307.14668-4-Vijaikumar_Kanagarajan@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201005165307.14668-1-Vijaikumar_Kanagarajan@mentor.com> References: <20201005165307.14668-1-Vijaikumar_Kanagarajan@mentor.com> MIME-Version: 1.0 X-ClientProxiedBy: SVR-ORW-MBX-05.mgc.mentorg.com (147.34.90.205) To svr-orw-mbx-01.mgc.mentorg.com (147.34.90.201) X-Original-Sender: vijaikumar_kanagarajan@mentor.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.252 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1679731544763929397?= X-GMAIL-MSGID: =?utf-8?q?1679731544763929397?= The latest WIC doesnot use fakeroot if pseudo_dir(IMAGE_ROOTFS/../pseudo) is non-existent. This results in wic_fakeroot not being used. Create a dummy pseudo_dir to satisfy wic. WIC hardcodes the python(/usr/bin/python3-native/python3) to be used while running bmaptool. The above path is OE specific and hence breaks build in ISAR. Create a symbolic link in the above location to satisfy wic. In case of stretch, bmaptool is based on python2. In case of buster and beyond it is python3. Grep the first line of bmaptool to find out which version of python is used and symlink the appropriate binary to /usr/bin/python3-native/python3. Signed-off-by: Vijai Kumar K --- meta/classes/wic-img.bbclass | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/meta/classes/wic-img.bbclass b/meta/classes/wic-img.bbclass index 0ec9575..29956e5 100644 --- a/meta/classes/wic-img.bbclass +++ b/meta/classes/wic-img.bbclass @@ -143,6 +143,7 @@ EOSUDO export FAKEROOTCMD=${FAKEROOTCMD} export BUILDDIR=${BUILDDIR} export MTOOLS_SKIP_CHECK=1 + mkdir -p ${IMAGE_ROOTFS}/../pseudo # create the temp dir in the buildchroot to ensure uniqueness WICTMP=$(cd ${BUILDCHROOT_DIR}; mktemp -d -p tmp) @@ -158,22 +159,31 @@ EOSUDO IMAGE_FULLNAME="$7" IMAGE_BASENAME="$8" shift 8 - + # The python path is hard-coded as /usr/bin/python3-native/python3 in wic. Handle that. + mkdir -p /usr/bin/python3-native/ + if [ $(head -1 $(which bmaptool) | grep python3) ];then + ln -s /usr/bin/python3 /usr/bin/python3-native/python3 + else + ln -s /usr/bin/python2 /usr/bin/python3-native/python3 + fi export PATH="$BITBAKEDIR/bin:$PATH" "$SCRIPTSDIR"/wic create "$WKS_FULL_PATH" \ --vars "$STAGING_DIR/$MACHINE/imgdata/" \ -o "/$WICTMP/${IMAGE_FULLNAME}.wic/" \ --bmap \ - -e "$IMAGE_BASENAME" $@' \ + -e "$IMAGE_BASENAME" $@ + rm -rf /usr/bin/python3-native' \ my_script "${BITBAKEDIR}" "${SCRIPTSDIR}" "${WKS_FULL_PATH}" "${STAGING_DIR}" \ "${MACHINE}" "${WICTMP}" "${IMAGE_FULLNAME}" "${IMAGE_BASENAME}" \ ${WIC_CREATE_EXTRA_ARGS} - sudo chown -R $(stat -c "%U" ${LAYERDIR_core}) ${LAYERDIR_core} ${LAYERDIR_isar} ${SCRIPTSDIR} || true + + sudo chown -R $(stat -c "%U" ${ISARROOT}) ${ISARROOT}/meta ${ISARROOT}/meta-isar ${ISARROOT}/scripts || true WIC_DIRECT=$(ls -t -1 ${BUILDCHROOT_DIR}/$WICTMP/${IMAGE_FULLNAME}.wic/*.direct | head -1) sudo chown -R $(id -u):$(id -g) ${BUILDCHROOT_DIR}/${WICTMP} mv -f ${WIC_DIRECT} ${WIC_IMAGE_FILE} mv -f ${WIC_DIRECT}.bmap ${WIC_IMAGE_FILE}.bmap rm -rf ${BUILDCHROOT_DIR}/${WICTMP} + rm -rf ${IMAGE_ROOTFS}/../pseudo } do_wic_image[file-checksums] += "${WKS_FILE_CHECKSUM}"