From patchwork Wed Sep 16 06:50:16 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: 52 Return-Path: Delivered-To: ilbers.mnt@gmail.com Received: by 2002:a4a:eb04:0:0:0:0:0 with SMTP id f4csp517867ooj; Wed, 16 Sep 2020 07:51:05 -0700 (PDT) X-Received: by 2002:a54:4793:: with SMTP id o19mr3462188oic.125.1600267865283; Wed, 16 Sep 2020 07:51:05 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1600267865; cv=pass; d=google.com; s=arc-20160816; b=z7D2IPFoy6rVbH33JYD9TGVW/x0tYdzK4xQWWHQtww3TnEP+OwSygBT5G+sE2QzaS+ 7ChCWQ8sOP8Ba0wWsASSalPjq8spfc8N7MfCAWAm9RB1d+M9n2XrpyC/Yhgz5bqixwpq grswlOUFT2WmRlSMDcenc2BO1GOvoGvmiGaCXf6TqcwiL121NiwWs1TqMJ51+RsthRU1 ni8b4uhE1cC1B/+FC+2Hmw11BRewr3GP0u4fdFDxrF+ApBTJxmnIlOhJcJQgkGrk25s/ 1qAYoZpIAelwO7bpYYldNp7rnvSykUF8VrODrn/Jr+7cdi8ghLiKTA4BoDR1YLMV2ctA id8A== 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=LeZL+VL2s298mDxP6wSmaBs5IUH+4owuughSGD5Uo/I=; b=Crva5m+C17R0Zqucp2IY/DB3HDCKFmG+HIw7WassVm1lhNlblrJUU0gJ+ogey+Wv41 +tbdAXpnRGL/G74YnpQFTdfU4Y76nUV5uRS2bMMLfWfxg1Qgg7e/EurkH33b0HYGXVoX +ZLwguS65o502BspZRgd911ykXEv31/Wy82NcCCcJD2t4SeaAe20/5iPMR/tChPrQF3n 7I+O7iH4vZRiOQJieBAO6n899cqe7A9IOMPiXmwTZuFtGdOCjX3I5xUUU9WkhdYbNeGn vgVfpqKwqi73fJ+zYY6PjLAXQv7OaJOMkLtU1dFBPJmHweUQF5f8Hkox/64Z5OBXjpSK K8pg== ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b=J0tjSlZV; arc=pass (i=2 spf=pass spfdomain=mentor.com); spf=pass (google.com: domain of isar-users+bncbcwp7lf37ukrbwgmrd5qkgqenxhnuga@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCWP7LF37UKRBWGMRD5QKGQENXHNUGA@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 n9sor4292006oic.122.2020.09.16.07.51.05 (Google Transport Security); Wed, 16 Sep 2020 07:51:05 -0700 (PDT) Received-SPF: pass (google.com: domain of isar-users+bncbcwp7lf37ukrbwgmrd5qkgqenxhnuga@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=J0tjSlZV; arc=pass (i=2 spf=pass spfdomain=mentor.com); spf=pass (google.com: domain of isar-users+bncbcwp7lf37ukrbwgmrd5qkgqenxhnuga@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCWP7LF37UKRBWGMRD5QKGQENXHNUGA@googlegroups.com ARC-Seal: i=2; a=rsa-sha256; t=1600267865; cv=pass; d=google.com; s=arc-20160816; b=wzWLgTZ1yx/Lqt3qhIMuwtsWWtcmOOZsJ8OOL7j1oxOPc2nN24S/WZMJxE0iZVFPVs iYI6b0LLHArp5vVu51bJ3BFladJ7ArjJ+2cdPGu+gWm9bX/oh9jX0w2SqwRnp39E0LjO Oyq4dtUajWo9zFOBjRbOXZoeolphWbqUmACHjyWOQY9FFY3D036cdd2A50eexwj+kjS7 680Vx+OTHve3GikTDSqaWU+3r3tbf1dAOzxUhcco1dHLJzK8yfJpisWzwxPYH4L9omk/ J/h+Wp6nATQMvVYtTxe6coYgEIO9uMKYKhkoluqQTcA1EtdQJNN4W+gBRE4jqpemg2op NpoQ== 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=LeZL+VL2s298mDxP6wSmaBs5IUH+4owuughSGD5Uo/I=; b=ymFYF88OZXNY2gWxUO/MKq/fUCVqEcheGO0hEgQSHJRtiq1jKqQuwKJvb+rIX5LPTE HhWUsekAvd2pv9CbWOruwJB+xH8USqZTAZEQTI8g2HCQQ7h4rN1tBMr7utThqBf9jpr3 obZ9q1Qx8RwX0S2iLl5wvk2Bqzyr77McXamuwvpS82rd2Nf7tqj6bTnW8Sf7cSdYANzs 98Om9vtQ0s93y6ZuCRmYjk7iOnYMaYn5xM0YTDAwFDGHneQNUr2yDN8YTNNfeKy+9ScU dmmhOqXGIc6dBfnKgH/PQboeq/adDHnSAkHwYv8r/yX5BjWX75JJ9m6Cb7z+j4r7zAnq A4Cg== 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=LeZL+VL2s298mDxP6wSmaBs5IUH+4owuughSGD5Uo/I=; b=J0tjSlZVSz7ZvUarFe8lKWGTDUBB/1UFRt5z6eibx63OZTqXfO9UW4pXc7cTfOZrIa hPYPLGd3I2itTSzNdiUAOQQer2cy09ZJ4PaO1SidIGxRusEm/WxICrj5Jy0NmXE/TiKR RIeuJaNwg3wGuxWPXMq/+2uaKP5BdubKZTxo3exV9Zje4xPUOS3UXr8bS13/8ffOPFDh NPwEYAgCDsQAvq/03PPowkpidI6xcvATChTCA8Z+JIfkSBf7NuwwNVAONjb2iFNl0Yb0 XfSdslq4gbo6VsRPXrZ0+vmFdPFnJyDhct1pzlCvesh3zslOC5yyhPEyHvQLpHfoDV/y vAow== 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=LeZL+VL2s298mDxP6wSmaBs5IUH+4owuughSGD5Uo/I=; b=C5zpZZWkQtwA9ZinRVbKSPghw28TbAG1FWUS4Kt2NUwmnNJlW8fhxXQTP7SzBV70jU Tzf4zPQEqLXkgdeIUCVqQC98QjseYYssxgn0FxEl9JpwCnEeKwsRnys4WQw+2hVVhoV7 x+QorSYghYtDw1FFNP70Ww6t4afOEvrOrKK7j0O20C1N5tzpIn9j8++ZknG4FadAUOkG q7YSx0lsbD2Znm6vqRhfZDbHk23Mp7nTPkYm0WBb5bvJCIiL3JEvRvHVmXKryj64/+E5 i6W+IIX9yeDL6sOoTVx4WoGx0gamWiKiFVKRvHQJ3jQX0tcy0UAYYxMu5EvCStuMBGC0 lSDw== Sender: isar-users@googlegroups.com X-Gm-Message-State: AOAM530MBIIZvmU5l5olvP/P0iNsd//9ElFDdGkCU9YyTllm/AlIPZJl GTEkdX8VsYqcSSeZ/GGocF4= X-Google-Smtp-Source: ABdhPJyUVVbuhtIWxnU0c5nieht4nRfoyoz1U0tJoOWh2mDJaoZ4mnJe4hE+Fq6/tojUFulk9fTyZQ== X-Received: by 2002:aca:58c3:: with SMTP id m186mr2747327oib.139.1600267864886; Wed, 16 Sep 2020 07:51:04 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:aca:2208:: with SMTP id b8ls554627oic.9.gmail; Wed, 16 Sep 2020 07:51:04 -0700 (PDT) X-Received: by 2002:aca:cc07:: with SMTP id c7mr3512194oig.82.1600267864373; Wed, 16 Sep 2020 07:51:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600267864; cv=none; d=google.com; s=arc-20160816; b=xR53IlVf+BJLdV9HD5WBZzyYyuDGu8e6vwdg/F8GotWnAoZ4TRTeEgOGKclCFq8jXn cDMaqPVqwqgt7FCIrvAxqR27WK05yruU+NGDBbRri2eeXzGdSH86hWQ08UrzHJOx0x29 2sxcfhXjwtJttyDl/CKaPOTZzhFd1TpTt7g4ASerkzvC7USwNJ1x9P7RkcRrUflx1/Um z85NqLCjI13/eZUnGMa9pMVxWyAFl0rQ4A++HNfvBAFGe7dhdylNLuw3dunrjdGjb6R/ iHz7I+lCUl8Olvav6Q+C1HyMjTD81NM9Gg3EH7oSyEymsZMhpPk5CUnnsQNr1BXcx98R ggtw== 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=xGNxrkYJjnv7TRWKLN0Rc8qrdJ6ul5660sZQ9FMvutF6ULlSF6UvUld8fUP//OsT3d /gqD81OwLaCnaUVHuncbtTpT66bmzFWaLHIbiHmSf2J+9htItZJiKt+Mi44/T9WJk93L Pz2QNROwZpkAg7u4vqy0eLyFNWZxJgB7cihvBOGrIxvMBrgx3OopCfTt553hbU1s4jt5 VrPTHZaL3US8f55BhiQMhThJEqDF833hRQ8UyIvgO2YHahlDKjuwfbwAMfGe72hfyqqx bB48qCtL0rjpKuaGNMBN65HbaTdxr7Oe/dH3RD7USGsOADh0dW7Etf4beoZiww0RpXv+ ZgOg== 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 q10si1058241oov.2.2020.09.16.07.51.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Sep 2020 07:51:04 -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: OXVJu3ZTi72P7j2KpE4BvgL5Q3EoJZ6px6uvJVqjJoyFHiWKHiH6wj2gI9HfsCS2UqpvIUBrwh bKFWtvfPlQP53+fE8F6F00anjWa/yOI0mEEGYK88E6GyK5xaeIM+deq3QGsAUVvblOHZRIWSA/ uTd5nZh73GiJ+UIYmttpjEwtEHbSwBogQgCoZ7YEmbSUVp4jSkh84ZEHjB/CahJJSKTr3iThPw tp4TpxhzkTwfdmUEQtFwVJapwFaEEc0P4nzIwq7ItavFXI3e6TT8JyAUpHbiwXQtJy57qLJpl9 XYM= X-IronPort-AV: E=Sophos;i="5.76,433,1592899200"; d="scan'208";a="52989552" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 16 Sep 2020 06:51:03 -0800 IronPort-SDR: KQy+KgSV88AOEhgP50tAriCquMGd4PyeFZVeN7cn3pR8BZ6ZqwFHBJ4C6dlwEOh+S0NiVrfIC5 ZbHwOV1acp0krv77nzT+HEfmbfXrSvgL6czT0bIhsLAETtGu5gMKES+5tmlzKwDn6ri4qGgaiP bimKiuZVcR60Cnc//OTnkvBdjYH0SCaMxORqiuhBQb5BSP5MI6ADFmkPmq1RhbjWT+TImjnOuK IOoGYf3G47EjRWUdEaAlV919KdMJFT5q3tsVzIPZUEBY9TgwdfJsJRwn2NZXjP8TYAqEk7Chbs fbU= From: Vijai Kumar K To: , , Subject: [PATCH v4 3/8] wic-img: Satisfy the quirks of latest wic Date: Wed, 16 Sep 2020 20:20:16 +0530 Message-ID: <20200916145021.5856-4-Vijaikumar_Kanagarajan@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200916145021.5856-1-Vijaikumar_Kanagarajan@mentor.com> References: <20200916145021.5856-1-Vijaikumar_Kanagarajan@mentor.com> MIME-Version: 1.0 X-ClientProxiedBy: SVR-ORW-MBX-06.mgc.mentorg.com (147.34.90.206) 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?1678002477348193138?= X-GMAIL-MSGID: =?utf-8?q?1678002477348193138?= 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}"