From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6880180325712920576 X-Received: by 2002:a05:651c:28c:: with SMTP id b12mr212211ljo.293.1601916832149; 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-Google-Smtp-Source: ABdhPJxuOTIHzB9OQpQCt37QmERBRAxl/4dLUVTGep3aBOcgx+raDaIPlH0TY3w0A8xz1udnxvpW 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 Return-Path: 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; 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 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 Content-Type: text/plain Return-Path: Vijaikumar_Kanagarajan@mentor.com 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-TUID: yLh0DXJZurUS 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}" -- 2.17.1