From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6864480010557718528 X-Received: by 2002:a9d:170e:: with SMTP id i14mr15624194ota.170.1599495506233; Mon, 07 Sep 2020 09:18:26 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:aca:3a07:: with SMTP id h7ls3716354oia.1.gmail; Mon, 07 Sep 2020 09:18:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuh2KdzYvb0Zkvpr7ccO2VsKsm+jpB5l+JftC17cYRsJNJhd8t+1Z3MN5hVfXItobSJKCM X-Received: by 2002:aca:cfc2:: with SMTP id f185mr73741oig.56.1599495505712; Mon, 07 Sep 2020 09:18:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599495505; cv=none; d=google.com; s=arc-20160816; b=f7u7ntEzO1+cM4NDNmtyOw64khAVs53ODaebXUMmA9DT7yZJ9zUpJRMVDWOFmLs7aC AUGSOmvkiwqicMu6//USe0tV4ZFP0QMHymoQu/++7DQmYAqt9tbbENlNo31bPi5PKE9a LbOMihsSWgVoJeSa1BDfCRWl68VJKKGmCf2TN4plOBT5REGwaNlI7ItvIzniPcS0oV0N 6nQDUqkoanF6DevlK05I2mNYxqmBX6M1XtkLLBPZkdsJF2XSrPD+DFuFy21uo1us+rxq mHpeaGaPlkLLAtaS8e6DDvUAqTbWyoPBOdenbFk6lngK4UVIqiFZG8M8JNk9xFNSObLY 9MtQ== 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:to:from :ironport-sdr:ironport-sdr; bh=pkkdZJOcdikE9BSZ7EgjrH5YPOYe2ptxZsF1SNAtRpU=; b=N2iUM+O3Wv68PTpMadpVeA8j2frmf6ygngQlsahJEdtDzcUC+6h5hJIDBSxkc2Vs/h 0h0VcqVwWLX18rU2aW9htnN74p13o0giOZJSSUJr2f5giuPICcnX1iFCd2fX3yGFMKDI stfh6TVN7eXVGUQxFC1qsR29OjIETdRfGyQPHi75dqWA5hH2u0LjK7X1ni9dtopvHFx3 +l4XcuyeQiAKnZbNhpo13ECqWrCmcxpOwTcVAmqRjtHCXLqr0Rt2FP5VomNJ04/kT2L6 YrIr33fqeSeQX13+xMwFacetr7T3hNSHLzSonjk7RkUMd/sPzmqSg+Xvjw8mIw9vt4Dm b9fw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.141.98 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com Return-Path: Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com. [68.232.141.98]) by gmr-mx.google.com with ESMTPS id d11si862274oti.2.2020.09.07.09.18.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Sep 2020 09:18:25 -0700 (PDT) Received-SPF: pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.141.98 as permitted sender) client-ip=68.232.141.98; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.141.98 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com IronPort-SDR: 91r4fKgUAd9s2julbT1IedlRcBFY200yy2EgBdr+iDK1KNubhl/GaiGiY+kTXPSFx1x8RrxKOJ bSzADJJxmEheEVQrRASRxwo8ObM10LILmcRmEJZ2zpIF+GeBsg/oIkaCPKN9P/tBJwOTOs2KXu Ymg71A0EZscDfFzfWX1vnHHkt1gGervzXaS0T/HVsxaOMvnQo3c5iq33QWTlVom55C9znas49k eTIAdmOO6xsFzgJTwcitPw3Dp0yZDFcaIEQ/O+5gX9MKaqGzMI47Y890d7x+DCWmxA9909Z5A8 r2A= X-IronPort-AV: E=Sophos;i="5.76,402,1592899200"; d="scan'208";a="52670208" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 07 Sep 2020 08:18:25 -0800 IronPort-SDR: RsBQ5eLcko/kwc9WAFsfE4LH/ux7HApoAJ6yHTx241PE7VuxyPz9uqp7fDr6cQBkcoqSdVJkLl XA9/+6k2q0c7Bm9lkura9xyMqVtBA1s9XhoMZ07jDog2wogw9Vuk/wMAOpOIxufS0D6w4wwT0y h1FGLxTutg9sU6HEgnGPRwrjcGjGFmakCSDoAUFZbR3XggbVdsmqeoVBwD2bfByhHjHn+nTizw BfBPAJvJYE9wTFAzonLy9uNctLgZnInh+Y4UOTinZJoZhU3wp+gspoxak3u6jb7q/EStJY6XdR pco= From: Vijai Kumar K To: , Subject: [PATCH v3 3/9] wic-img: Satisfy the quirks of latest wic Date: Mon, 7 Sep 2020 21:47:50 +0530 Message-ID: <20200907161756.16372-4-Vijaikumar_Kanagarajan@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200907161756.16372-1-Vijaikumar_Kanagarajan@mentor.com> References: <20200907161756.16372-1-Vijaikumar_Kanagarajan@mentor.com> MIME-Version: 1.0 Content-Type: text/plain Return-Path: Vijaikumar_Kanagarajan@mentor.com X-ClientProxiedBy: svr-orw-mbx-02.mgc.mentorg.com (147.34.90.202) To svr-orw-mbx-01.mgc.mentorg.com (147.34.90.201) X-TUID: 6GyRfFupbIUh 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 | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/meta/classes/wic-img.bbclass b/meta/classes/wic-img.bbclass index afab394..a2c9627 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) @@ -157,22 +158,31 @@ EOSUDO IMAGE_FULLNAME="$6" IMAGE_BASENAME="$7" shift 7 - + # 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="$ISARROOT/bitbake/bin:$PATH" "$ISARROOT"/scripts/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 "${ISARROOT}" "${WKS_FULL_PATH}" "${STAGING_DIR}" \ "${MACHINE}" "${WICTMP}" "${IMAGE_FULLNAME}" "${IMAGE_BASENAME}" \ ${WIC_CREATE_EXTRA_ARGS} + 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