From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6864480010557718528 X-Received: by 2002:aca:aa85:: with SMTP id t127mr3228173oie.46.1600267864935; 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-Google-Smtp-Source: ABdhPJwfJK4g6gNuyF0GZUgid61k2LMrkZBNMnmHFR0feKtr7Cfg1CJFDJ7aQIeVoKGGX6lxV5PH 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 Return-Path: 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; 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: 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 Content-Type: text/plain Return-Path: Vijaikumar_Kanagarajan@mentor.com 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-TUID: b8SQKbt6Nxkl 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