From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6610281096522235904 X-Received: by 2002:a5d:530e:: with SMTP id e14-v6mr1288482wrv.4.1539095007538; Tue, 09 Oct 2018 07:23:27 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:b6c1:: with SMTP id g184-v6ls644781wmf.9.canary-gmail; Tue, 09 Oct 2018 07:23:27 -0700 (PDT) X-Google-Smtp-Source: ACcGV60KltZTdwoVvl6OO0JSbQmsX+hbNX3pvkWl6o3fgh+8/TRtDa8KMMzPzZZk9p+6LMgafues X-Received: by 2002:a1c:e86:: with SMTP id 128-v6mr479954wmo.10.1539095006897; Tue, 09 Oct 2018 07:23:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539095006; cv=none; d=google.com; s=arc-20160816; b=lcY/074EcB2QcyAEAS+2/2cMxpSPqaTtbvzlhL4M0q1iBvj7XHOUvgjXPYu7hG4c8M vD/slrHljxSPitinco3MvA8bI2RevEZv1CGDE4QwzR1nI6eOEJbF7Au2JboklClzN8re NTYAZfSIqzurdf5nxinC/VJL3I0I0MCT2cXmOBTyYW4DrV1yppJfR+XL48oD22AZSHzH VhT5WejrmAU9PfgLu4Ghn4aPs7Pe4gc9Gc0LX9Kqu1CGjOOkZQ2wclfGHeshOTNM/rLw 4dr/GDZUbYQGVKv9/L0XSQ/eLBMSf4FInJHlvAK401zIew5wZIgkWv7KyF2OU9QlyHeX lEAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:to:from:subject:message-id; bh=bNdR+fdaekjlfdn3euOyr3W7SWb3DZsqPMV5VY+kv2M=; b=0PUsefNMMaDK/OSu2uUPpYTFZ7q5X9zVRq4YW61yURYJxwqWNbrhSHILQNWKDw4kya 3xQ46NAziVGklsHJqTM1pysNxjcFa/gNY8og/H1OKhy3hfRZ15cjbzDi/gH8zqUjqmMx eUanmZkIekEPNTxMNjy05jxmIK3SnfG0L6pXvEALbv3cwXXyrJsITK245dqtVOxVUlQm 6y+8LfDPtoXFELNQv0a8E3RxQ/BnjtzIk+lq5JTsaqwZ0dDWHvfJA7PKNKUcE429BeVZ M7lVUEJJaVJQPagL99ld+8mtVJ4k4NhGhX0niZT0sh/Rfk4v6Y77/NW3ZQPMscy5CT1J +ADA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of hws@denx.de) smtp.mailfrom=hws@denx.de Return-Path: Received: from mail-out.m-online.net (mail-out.m-online.net. [212.18.0.9]) by gmr-mx.google.com with ESMTPS id v6-v6si220988wrn.0.2018.10.09.07.23.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Oct 2018 07:23:26 -0700 (PDT) Received-SPF: neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of hws@denx.de) client-ip=212.18.0.9; Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of hws@denx.de) smtp.mailfrom=hws@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 42Tzwt4hf0z1r5hc; Tue, 9 Oct 2018 16:23:26 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 42Tzwt4Wzxz1qtfn; Tue, 9 Oct 2018 16:23:26 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id vvcn3BLWfgOr; Tue, 9 Oct 2018 16:23:24 +0200 (CEST) X-Auth-Info: DZd0OC4JmnD4eZLCWsZ1Mjqs15pPPqmjqswIvMGM3tY= Received: from sandvich (p5B04CDC9.dip0.t-ipconnect.de [91.4.205.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Tue, 9 Oct 2018 16:23:24 +0200 (CEST) Message-ID: <24376cec5651e690297a0f06b841380a17cd7311.camel@denx.de> Subject: Re: [PATCH] dpkg-raw: Fix rebuilding recipes From: Harald Seiler To: Jan Kiszka , isar-users@googlegroups.com Date: Tue, 09 Oct 2018 16:23:23 +0200 In-Reply-To: <6dd2bb73-0163-5909-94a8-a344e034369b@siemens.com> References: <23f5cd40400ecfc4074e0fb0185902fccd7bae2e.camel@denx.de> <9e705dc1-53cd-28d1-8d8d-a832fb887d16@siemens.com> <158f4ad6a1cda4cca01e820a4279c11807b281a5.camel@denx.de> <70898627-9e55-4d83-b25c-1f41cf07da51@siemens.com> <6dd2bb73-0163-5909-94a8-a344e034369b@siemens.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TUID: Qv9zjvH/0Q8O On Tue, 2018-10-09 at 14:31 +0200, Jan Kiszka wrote: > 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. Looks like it was an error in the recipes. As far as I can tell, the faulty recipes all used some form of `sudo install` which messes up the permissions. Removing sudo fixed the issue. It would be nice if this kind of mistake would be easier to detect. Maybe by adding a warning? -- Harald DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-62 Fax: +49-8142-66989-80 Email: hws@denx.de