From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6610281096522235904 X-Received: by 2002:a19:1a12:: with SMTP id a18-v6mr727404lfa.37.1539088263550; Tue, 09 Oct 2018 05:31:03 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:ac2:4145:: with SMTP id c5-v6ls105409lfi.13.gmail; Tue, 09 Oct 2018 05:31:02 -0700 (PDT) X-Google-Smtp-Source: ACcGV60vmQkYHTo9bqBdeW+1YJ5qEfT6Wwf6Z4ZL65QRCSujhn/d3gRWjZ/LP/aJyWSWfG6AZzoQ X-Received: by 2002:a19:174d:: with SMTP id n74-v6mr465595lfi.5.1539088262953; Tue, 09 Oct 2018 05:31:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539088262; cv=none; d=google.com; s=arc-20160816; b=mr2Vpfb7coQO8ql+S1f2r7RfZXzcaTUdJvzIbKgZK7Rc2tqAWxyIVIN6DEeY+V4sYb LdktPd/9sNUv4XgaxzSKYYc0T5NcbMmsfL3yfXfks+v91VrzlzgN40KcP2zV25F+BWnI 2Sq2hIKxE7e9hHWEQaDoa7Wutz/Iaw1qHsS+3eOGbRs3otKcxuzYM0FuFVan7KHgTubP L85HjIk5zMd/jfHBG8WI67Wmo2ke9aSdNYjxgo6h10Fqd9SbGqJbXrnDj5c9wuS7tJvp uvXTnAptKYW0029nMapqPimQdYPbdjKTi99lhlE8vtTWe3oCFjSydGRHog8sNUSX2y13 BeEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:references:to:from:subject; bh=eUXvHe1+WNE7vzKLYKpoVwMllXDLl67KwuT3kFRpqKU=; b=wxJW0b3kpsUF4e8s7xxP0Mi2wHnM+VqZjcl/Egcn6+5vfDlxOL7zsuNH5ugcRbd5OB XscxdvEx4czponsndM9T1IJ70HGkXicvW3GeUX7IbnJNjjDvAB21cCOSRpNeIyywpbs8 lR8fp93teLd+uR3/11tR4x+Y1x82D3dlMk31qjnKwx1wTcC6yT3rSiasla6N6gXCg2xa PK9UdHFcomQrsMrKWZ4HNGjsr98ReMKxhMZPiQt8Tcc0DrxxOwOeo2Abi9NTMAEFz0Ie hFtWQVScat0vE/AjDA6prDcYAH3jivtG15qk1sf/kzOitAODZNu9dgbaMV8ZymsLxCTn VZew== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Return-Path: Received: from goliath.siemens.de (goliath.siemens.de. [192.35.17.28]) by gmr-mx.google.com with ESMTPS id h20-v6si62132ljj.5.2018.10.09.05.31.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Oct 2018 05:31:02 -0700 (PDT) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.28 as permitted sender) client-ip=192.35.17.28; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id w99CV1eY009193 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 9 Oct 2018 14:31:01 +0200 Received: from [139.25.68.37] (md1q0hnc.ad001.siemens.net [139.25.68.37] (may be forged)) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id w99CV1VR016762; Tue, 9 Oct 2018 14:31:01 +0200 Subject: Re: [PATCH] dpkg-raw: Fix rebuilding recipes From: Jan Kiszka To: Harald Seiler , isar-users@googlegroups.com References: <23f5cd40400ecfc4074e0fb0185902fccd7bae2e.camel@denx.de> <9e705dc1-53cd-28d1-8d8d-a832fb887d16@siemens.com> <158f4ad6a1cda4cca01e820a4279c11807b281a5.camel@denx.de> <70898627-9e55-4d83-b25c-1f41cf07da51@siemens.com> Message-ID: <6dd2bb73-0163-5909-94a8-a344e034369b@siemens.com> Date: Tue, 9 Oct 2018 14:31:00 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 In-Reply-To: <70898627-9e55-4d83-b25c-1f41cf07da51@siemens.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-TUID: 38EMpCjNZj8H On 09.10.18 14:17, [ext] Jan Kiszka wrote: > On 09.10.18 12:28, Harald Seiler wrote: >> On Tue, 2018-10-09 at 12:05 +0200, Jan Kiszka wrote: >>> On 09.10.18 11:06, Harald Seiler wrote: >>>> Rebuilding dpkg-raw packages fails because the >>>> DEBIAN directories' ownership is transferred to >>>> root in dpkg_runbuild.  This commit ensures the >>>> ownership is reset before attempting to write >>>> metadata. >>>> >>>> Signed-off-by: Harald Seiler >>>> --- >>>>    meta/classes/dpkg-raw.bbclass | 3 ++- >>>>    1 file changed, 2 insertions(+), 1 deletion(-) >>>> >>>> diff --git a/meta/classes/dpkg-raw.bbclass b/meta/classes/dpkg-raw.bbclass >>>> index c848f3d..806a2d4 100644 >>>> --- a/meta/classes/dpkg-raw.bbclass >>>> +++ b/meta/classes/dpkg-raw.bbclass >>>> @@ -18,7 +18,8 @@ addtask install after do_unpack before do_prepare_build >>>>    deb_package_prepare() { >>>>        sudo rm -rf ${D}/DEBIAN >>>> -    mkdir -p ${D}/DEBIAN >>>> +    sudo mkdir -p ${D}/DEBIAN >>>> +    sudo chown ${USER}:${USER} ${D}/DEBIAN >>> >>> That makes no sense to me: We remove that folder first, and then create it under >>> the name of the current user. These two changes are redundant in that light. >>> >>> Can you describe in more details what you did and how the error messages looked >>> like? I frequently rebuild dpkg-raw packages and never saw such an issue >>> recently. >> >> Sure, the error message is the following: >> mkdir: cannot create directory `[...]/image//DEBIAN`: Permission denied >> >> This makes sense, because image/ seems to somewhere get changed to be owned by >> root. >> Because of this, the unprivileged mkdir fails when rebuilding.  The change I >> made is >> to run mkdir as root and then change the ownership of the created directory. >> I chose >> this solutuion because I did not want to touch the permissions of image/. > > But if image has the wrong permissions/ownership, that is what should be > changed. It may actually cause other problems down the road. > Actually, we should first of all understand what is causing this, if it is an Isar issue or maybe something downstream (check if your recipe doesn't do something special here). The dpkg-raw.bbclass itself only plays with the ownership of the DEBIAN folder, and it resolves that be purging it prior to the recreation. And if I check the Isar test case itself: # ls -ld tmp/work/debian-stretch-amd64/example-raw-0.2-r0/image/ drwxr-xr-x 4 builder builder 4096 Oct 6 12:08 tmp/work/debian-stretch-amd64/example-raw-0.2-r0/image/ Looks OK. Jan -- Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux