From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6750187537661165568 X-Received: by 2002:ac8:2f45:: with SMTP id k5mr13819308qta.183.1573825344753; Fri, 15 Nov 2019 05:42:24 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a37:bec4:: with SMTP id o187ls2178440qkf.12.gmail; Fri, 15 Nov 2019 05:42:24 -0800 (PST) X-Google-Smtp-Source: APXvYqweH9bQBan79V0xjP0nhLdIrE85rmJn0RN0mDMLFpMaOUROueb4opAp5WgowhapOkEgfx1V X-Received: by 2002:a37:ac09:: with SMTP id e9mr12637206qkm.63.1573825344277; Fri, 15 Nov 2019 05:42:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573825344; cv=none; d=google.com; s=arc-20160816; b=PQkCKSchDYYnRIHSvoWiHLGCNat5b8cEjGb9/zRO3JGWcuYckU5axSoMvaCDOuuJVa iJKv6QhY4SKTK7VYLY5pohIQZIJhtDNEZyDKid6YJ5sny2fB51erjIDbvH5gSaMootF6 tnSV/qmGoZDcl9MLB4s+ZfaIFC+iVnw/dyQx4jMJO9Cdk5rEL8waxdZGXMbiZIDTERVR dfNQQgQnAwHmx6z256G9rBmo62eTKgQldWfsSpjheLwoLsWAcnHHShAyoY33gRR4gvwg loWT431mfSbJifmJ7ae576321RkhvfT+xDeo+fjNsjK2Eks3tGrTZGZx6FXNh+AIB6VP QyVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-language:content-transfer-encoding:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject:ironport-sdr :ironport-sdr; bh=XJ4BwAUtGfUHlR5he55W4JueUUxybVRHx7IamyJI3b8=; b=VTDCGTm6975rR5VnMSqyMirLfyrFwSGz7vVEWUBxrz+wyvAKP+Ob7IzFMMn7QkDAtN ktVKkFiM3/v9LAKNLb0sXyAfUlhKzRY1NcCiKP2cc/d5YtZ1O8x4xO39dPb0fQvH7Leq /fI19iix3ZnA8uBVsZiSKxgvAA8xLkPauWEAvG7FI+huFlDAMKGLDLCTLgkMAEP/MrjW S3PzM3yKLPD7w+gEQ3i6PE7RBV4p5wDz85K6Gv53Fa0NKmAltvdjuUnFLjD7wziI+VrZ 64ts9ZsAmIFEKc6MblwNx9OZHCOgBP3LGr7RbxmQRvgUO01PH+O0fFDTaTzWcYfxSjcY nbWw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of cedric_hombourger@mentor.com designates 68.232.129.153 as permitted sender) smtp.mailfrom=Cedric_Hombourger@mentor.com Return-Path: Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com. [68.232.129.153]) by gmr-mx.google.com with ESMTPS id x6si463570qkl.7.2019.11.15.05.42.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Nov 2019 05:42:24 -0800 (PST) Received-SPF: pass (google.com: domain of cedric_hombourger@mentor.com designates 68.232.129.153 as permitted sender) client-ip=68.232.129.153; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of cedric_hombourger@mentor.com designates 68.232.129.153 as permitted sender) smtp.mailfrom=Cedric_Hombourger@mentor.com IronPort-SDR: k6n6reEZ3HD0PST2hBOUawelj5Pw+EkWFgeJ5yrtieIWFLZbygJVgTg2sBftaJh8Imn54txUME tWMjDVVHX3kRd0hjrFsfQFCVRqadqfq4QQXQa5aI5j3+FFbWH8rNazgpqrSBwLLcIN+UimtX++ eURNgDQ148G02JiHVN/GEBzifY7e/aWqUj9l6YKXMM+aVOPLzIHT7N6RTmtl5KlUH1eYFxHS36 5k4+2K1w33kRoAwKNvB/iQEFBKtNE404ygmZtYZOhqxdDOykHqCuE7rTfvaVqOmpIeTTXCsxRY noU= X-IronPort-AV: E=Sophos;i="5.68,308,1569312000"; d="scan'208";a="45077143" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 15 Nov 2019 05:42:21 -0800 IronPort-SDR: D6pNpoQaqQ4UTStGp7A9eMKYlU+kFqUZIthmPRDFF7qez1J/Uuys1GT7AzPFlQ5/I9tVLfyp5U Wp9w5h+IuPcbi7iHk0u0KZlxah2u+bi8i5NURTqpAWORtfdFE+gXCY7MbtYy03sTstGdM1o2zO JBtBrrVIZ5YkjhcgNUfVjn6PmzUiT9pNe/smdvz4I/QB9R/D6hupmvEIjVI506psKgBNKWn50X UQT1NGoWDIRMIFjkwWoMBKwmTaTNMzELIcxLhaRy0sTZP0oU2XwLXeZMClbryAxnf8nWZWEsq7 yB4= Subject: Re: [PATCH v4 - misc fixes 1/6] wic-img: do not leave temporary files behind To: Jan Kiszka , References: <1572958385-246-1-git-send-email-Cedric_Hombourger@mentor.com> <1573205003-1335-1-git-send-email-Cedric_Hombourger@mentor.com> <1573205003-1335-2-git-send-email-Cedric_Hombourger@mentor.com> <26ab6076-157e-7573-919d-dfa7cb273b25@siemens.com> From: Cedric Hombourger Message-ID: <11bd7e0b-4db8-4675-487c-1d3c01d403ee@mentor.com> Date: Fri, 15 Nov 2019 14:42:14 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <26ab6076-157e-7573-919d-dfa7cb273b25@siemens.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Return-Path: Cedric_Hombourger@mentor.com X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-06.mgc.mentorg.com (139.181.222.6) To svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) X-TUID: 8JwbEtiEMNzN On 11/15/19 2:38 PM, Jan Kiszka wrote: > On 08.11.19 10:23, Cedric Hombourger wrote: >> We do not seem to make any use of the timestamped wic images being >> generated and worse we are leaving them in the buildchroot tmp folder. >> "mv" the generated files instead of "cp"'ing them to the deploy >> directory. >> >> Signed-off-by: Cedric Hombourger >> --- >>   meta/classes/wic-img.bbclass | 8 ++++++-- >>   1 file changed, 6 insertions(+), 2 deletions(-) >> >> diff --git a/meta/classes/wic-img.bbclass b/meta/classes/wic-img.bbclass >> index 795640f..24c3b65 100644 >> --- a/meta/classes/wic-img.bbclass >> +++ b/meta/classes/wic-img.bbclass >> @@ -155,8 +155,12 @@ EOSUDO >>               -e ${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) >> -    cp -f ${WIC_DIRECT} ${WIC_IMAGE_FILE} >> -    cp -f ${WIC_DIRECT}.bmap ${WIC_IMAGE_FILE}.bmap >> +    sudo chown $(stat -c "%U:%G" ${ISARROOT}) ${WIC_DIRECT} >> ${WIC_DIRECT}.bmap >> +    sudo mv -f ${WIC_DIRECT} ${WIC_IMAGE_FILE} >> +    sudo mv -f ${WIC_DIRECT}.bmap ${WIC_IMAGE_FILE}.bmap >> +    sudo rmdir --ignore-fail-on-non-empty \ >> +        ${BUILDCHROOT_DIR}/${WICTMP}/${IMAGE_FULLNAME}.wic \ >> +        ${BUILDCHROOT_DIR}/${WICTMP} > > Where does the need for the sudos come from? What are source and > target users here? > files created by wic are owned by root. I am happy to check if the following sudos are truly required (sudo wasn't required before because the files were copied and not moved, so ro access was sufficient) > Jan > >>   } >>     do_wic_image[file-checksums] += "${WKS_FILE_CHECKSUM}" >> >