From patchwork Mon Sep 7 08:17:50 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: 37 Return-Path: Delivered-To: ilbers.mnt@gmail.com Received: by 2002:a4a:eb04:0:0:0:0:0 with SMTP id f4csp3466255ooj; Mon, 7 Sep 2020 09:18:26 -0700 (PDT) X-Received: by 2002:a05:6808:3d6:: with SMTP id o22mr57449oie.150.1599495506512; Mon, 07 Sep 2020 09:18:26 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1599495506; cv=pass; d=google.com; s=arc-20160816; b=Wyt+lRZ0UP5QV9pteiuuCE9XmeekF1aVaGlVGmCZY3hHkIN9Ta+2/UfZyg/nMH6laQ 188xtP9HYu3/8Ms7hfb41BC/enVHaOE7GkRqQjjFHt+u4fq5hOqdHtt9ibReQG451EUT YWr5czwzUZZKIe1KFtwyPDut0Vhst9D/DPnD5gT8fT87CVWGwP21W5CCOnO6F1veDrmQ PO1etZKmoBv+eNbvF3pSc1xjwlrIMNSvP8SFiMx0mSTTm0tK7Zi1SSjtHKZzkxvgjx6B fuoDtLG4J/MpFLPwkuXlSLD4Ui7f61hsRa6mIqS1s+hvxSIyFchmpyvi/55s95vdil/P gtDg== 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:to:from:ironport-sdr:ironport-sdr:sender :dkim-signature; bh=qgOlXrN8tMNLXTgF9cW1K1C4NTEoz+FD9X3I03MoxpM=; b=VTGe29vdu1L/xKf4JusH/PSSbKOGvjkQazYcDJAEdVhyksF/gHrSl4HeDVZ1Ny69MY 1tKIv57SBZki38aAEaUF4eMiBHN6kqAaQ1vL42bhTsWIhINhraer1n5GROJB9VBAKr7O Wa8gNlobHioEi7s5IPP8xKR4dPjlk2F1WKcJ4PrVKuUE+S44e8tDZO2l8FFyVmMeWF4P YnLNoQHy55GVuKrIIz4HVrfxxYe2K4GyMcKHQCriDQ7lbyCk1g0J3mWDIlt5FanU6glK 3XYObTHoIyk1nfKjuj431f8jN5e1IIMfcuGi+v6g4AnAz/enTlj1xjAjoPXlkcEwvOQn hzQw== ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b=LreOUPvQ; arc=pass (i=2 spf=pass spfdomain=mentor.com); spf=pass (google.com: domain of isar-users+bncbcwp7lf37ukrbuv23h5akgqew7c7goi@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCWP7LF37UKRBUV23H5AKGQEW7C7GOI@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 32sor2686998ota.35.2020.09.07.09.18.26 (Google Transport Security); Mon, 07 Sep 2020 09:18:26 -0700 (PDT) Received-SPF: pass (google.com: domain of isar-users+bncbcwp7lf37ukrbuv23h5akgqew7c7goi@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=LreOUPvQ; arc=pass (i=2 spf=pass spfdomain=mentor.com); spf=pass (google.com: domain of isar-users+bncbcwp7lf37ukrbuv23h5akgqew7c7goi@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCWP7LF37UKRBUV23H5AKGQEW7C7GOI@googlegroups.com ARC-Seal: i=2; a=rsa-sha256; t=1599495506; cv=pass; d=google.com; s=arc-20160816; b=Gkyzg/R69+HkxIs4VBlWQp8uRSoBPbEx7Xn4/qNq/TKShyCUUVvYHU+JCoGJocO9VQ UNwjC8HDbnxWk3fFYzTT98HqboIHeN7v/UQ54OqA4aKTIGXRXSoSqmGTeJUkio8SxpZV I/pMghBeqV5N5MX1AbUrZJUfzq51an6mBNqgDPLi7KBvWDTO5kbTLm3jV2GeRtrBFt/O 0DYHSAgTr/CZU5Goi2mNmKoCQdwWLlgS73apGmnwCduebpn4tSCH9MFje0eWUYuaES4u CGO6tlr+wpNsEwU4WPSbrqiuTT3PW1dvpPPgiE/EhaVTegCPs2IWvo/LDp8ZbsEHyf12 vSCg== 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:to:from:ironport-sdr:ironport-sdr:sender :dkim-signature; bh=qgOlXrN8tMNLXTgF9cW1K1C4NTEoz+FD9X3I03MoxpM=; b=FqWAGeipy+t+Z8qtEdd5eO9hhGavfYoc4GvmqmkY6RGqm9zwlWYpjndQQ7X6y96KGr uo782WSeGHmoEHZZw3KlRdPQb00g7g+aHD3G/TmYyySzDYHSlB7RK9lmIfi13EPzqt2w WbZttu0yJmu26jei9NXbZNo7ABnfi3e4DzMn3n1BQpqvh2zRYM1mPm9ng+i8ifKLDkBS fqJtiBDwyL1iV/3L8kz3OEBNxIJcrwoGU/9LoFY+ROtdMAEYXXLvb6caJeNHr2awfs/x KHcpyY8o9bUZYJORF+rocpkynPlVjWuYm9wbPmp6A54DynAH0sO4PWcARPJXOPmZi0Ir r6pA== ARC-Authentication-Results: i=2; 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:ironport-sdr:ironport-sdr:from:to: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=qgOlXrN8tMNLXTgF9cW1K1C4NTEoz+FD9X3I03MoxpM=; b=LreOUPvQX7C3S0eP4Hkkan4UNfvEJbgasIgCPAXInmbK6buWeFBPttABR567HejeN7 OUXJ548Yw2nGJz9DP453Ilmz4cFfH9Oov2bltyWvQ8voEAXQI1+HI4FXSHuKcBY622XX MU7+0OxDzxA4w/kBz3kkhjLI7eyVRaUUFH2jnqE8YPmm0RoC3fWxS+E3qoiLWZ+0Zmu+ 6iRttF1Au/6TNECJb/rG7iLCJZFbiAcwA+fvt0cpvkgZvj/ANGQO/X/UokrK4OgzmxHI NaJmKP3ulMnPs89WSS33doXs6hNPg43HYnKeW76ZMdbH7asW/rklYsBsR1aT2b/VV6nY pIaA== 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: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=qgOlXrN8tMNLXTgF9cW1K1C4NTEoz+FD9X3I03MoxpM=; b=LyGvCrZlyXiUVp+UdHvO7Plr2tc/r/8RubsH7SC3bbpD58MBiP1zRpNy3kL39J9KeY p9HXmzyEVhi34FSG6753+K+5rHdbz78wp6iBB+zU+qAZM9i8TkP+lcX26qMBMBsU3aE5 gPG/ezjkggu1gN30K2pOuB+mgPIootnFsYkeaJCZxW/BXbCVFb7TCOniurIfF57OSFO1 Jhi95JGzz9V8Bplehqeowr2uC4uoOVZJvHBb2hrxxTBurM8A5rT1SOwVxgV4zn7x3GpI 4AFCJMCJ0gC+uYklsCTHzUTDcZMaFHaKbD2IhRESe5kZ17akLY6BpeMhiY5+rjiB6tDn NbXQ== Sender: isar-users@googlegroups.com X-Gm-Message-State: AOAM530OjRMbcefTxNcSxIT9h7ErqSOwIvwGocDSHUbA+dIlnyvKUVfj 1L29Pbsmc8X66YuhCPOC9rI= X-Google-Smtp-Source: ABdhPJzhy0ZIxDaTrajTymoD2LNewXPKLorEpg+YpSNRPTaUbq851PnXB1vfE3jDTDi6ipViSpp7Yw== X-Received: by 2002:a9d:7854:: with SMTP id c20mr14843022otm.123.1599495506155; 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-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 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; 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 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-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.141.98 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?1677192600472097651?= X-GMAIL-MSGID: =?utf-8?q?1677192600472097651?= 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}"