From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6880180325712920576 X-Received: by 2002:a7b:c20d:: with SMTP id x13mr3670407wmi.83.1602682092804; Wed, 14 Oct 2020 06:28:12 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:a544:: with SMTP id j4ls4486286wrb.3.gmail; Wed, 14 Oct 2020 06:28:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7NC8L4UQjWj3Bvph0GYEvw++cCLOxMjKwMvmrPs+eWnqajWEl/157zju7psOkfaKnwb1l X-Received: by 2002:adf:9e41:: with SMTP id v1mr6127427wre.60.1602682091769; Wed, 14 Oct 2020 06:28:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602682091; cv=none; d=google.com; s=arc-20160816; b=TYtVwiRQsDne8vwTzT67/Bdt6gY5EXjy9YKp+wDaX5az93qmih0AzW7/so6bjkXFx2 Ya0/TAlZzxWvaUwtCF75bj+LhY9CZkR72EnUubuO7qzSKAZUzyPu/tLZPRFxjUE85PM1 6efjZyxDb0E/l0JyMFt447ZbWpsV/ar0ABHNsiv0onISfTDZJa4XZDmqo67AcEEAvAaJ sIIMwZnc8KZJyiFAQ1JDi8ftosnKL5D8rbw4ahDY2+n8VN7SuacZh5Enpx0F7rNqHWAX nKd/NlN97z5ZijUOFXFcQwAurpRbqJxcrs+kRyvIraVenAHT8bwrYicB4BbmW6k9tsWN ftkw== 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=m/ITXQ0YK1yfGnPRUoUhFoSqKbgwYhEbuIWd3qi9qcI=; b=wrBn+qQkDHRJ5FzS+LbjwFVauCVIbyb0jb90J9yCAqGPwBZ++zDPCHmbbHAj1Aha0B lT+7+d98k00EIUE9G3Eba+zSxDqup951ozXt+UecieNtUW2eiFstE5+AV2kcncbM+mDV d7RLYdrpqkIC5r/kYqn8ClvzaXkoaxSh0WnsBXgUmBwqDMA7rl0VDdSBtBeS7aJMkS5g 36Fzr9A+zZy5oOaHPPv60PIOe4AJpnLmmqW/dLhLCeqXl522rIEvbzN1Lw23oWXk6q8T x/s7f68AF1gFnQEW2pTLZ6T93FRAwmBdyBR20dKfbh0mKWAJAFmLfsoNkMKaayo6BZF6 88Ew== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.180 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com Return-Path: Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com. [68.232.137.180]) by gmr-mx.google.com with ESMTPS id 63si57552wrc.0.2020.10.14.06.28.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Oct 2020 06:28:11 -0700 (PDT) Received-SPF: pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.180 as permitted sender) client-ip=68.232.137.180; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.180 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com IronPort-SDR: +Q2ZopsZ1SceTOgFurAKXbQVqiuxjWCuenEF1OVzJOqDwYJCVJqjfEjoG7ElLT02kkJRUKYCAc G9ziJVRKbRdt/C/G/+m7PFyHyBmXDDEfyVvwoFS6VD/AlqVvxs5GXfDZjlbkTEBseXIG6WA6dW kWN/H1FqRxMcPUnag7Dt8NJj3Tt9cOaRFdqHVG5jWcyRLYreAHNLhb7EF2pkL45nr5axVzIf03 eSDIkJgVm/xlVBiFYL06Inwm3+wsWmomlvL9k6GiT3w99YE/kKMvQLnPy5x8usMmoSqsfN216N Ixs= X-IronPort-AV: E=Sophos;i="5.77,374,1596528000"; d="scan'208";a="53925689" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 14 Oct 2020 05:28:09 -0800 IronPort-SDR: J3ga9XpplOV9Swk5O365VaycwWZz0ri9vF7y1YVFVmfBJtjlHfdVV0ZwVDLs6pVbhp+WtVrHQy BM9zjZNh6ECXqDm3SzqKl2sDjDRllUK2t82dYX288Ybohdmi5BGMSmfU9dvaa7l3r7xa//Xqp8 KG7hNdkEo+y9/RSZNaqAAYlYN20uSUISO5QyTkzps282VY061YoyWljdHPgiL90nz2bTF7SK9Z tv7EAg2r3JWftjYf/WvGA0XD8TN8tFQZ+lLWNNKBi1a5CQLeTaw85raGUG6PZ9d9w5i5G3SpFA WMo= From: Vijai Kumar K To: CC: Vijai Kumar K Subject: [PATCH v6 3/8] wic-img: Satisfy the quirks of latest wic Date: Wed, 14 Oct 2020 18:57:24 +0530 Message-ID: <20201014132729.18571-4-Vijaikumar_Kanagarajan@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201014132729.18571-1-Vijaikumar_Kanagarajan@mentor.com> References: <20201014132729.18571-1-Vijaikumar_Kanagarajan@mentor.com> MIME-Version: 1.0 Content-Type: text/plain Return-Path: Vijaikumar_Kanagarajan@mentor.com X-ClientProxiedBy: SVR-ORW-MBX-09.mgc.mentorg.com (147.34.90.209) To svr-orw-mbx-01.mgc.mentorg.com (147.34.90.201) X-TUID: QodmIyhPIL3x 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 0ec9575..057429f 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 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