From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6610281096522235904 X-Received: by 2002:a5d:6081:: with SMTP id w1-v6mr4192469wrt.17.1540223831235; Mon, 22 Oct 2018 08:57:11 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:8cd0:: with SMTP id o199-v6ls168532wmd.21.gmail; Mon, 22 Oct 2018 08:57:10 -0700 (PDT) X-Google-Smtp-Source: ACcGV63ZX1CTFdIYagOnvOhESevR+S1UjUgIqVkwJyfV2KsHJWSdH3S2OBT5+8KmPBmHfgl9QR3l X-Received: by 2002:a1c:49:: with SMTP id 70-v6mr1609375wma.15.1540223830802; Mon, 22 Oct 2018 08:57:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540223830; cv=none; d=google.com; s=arc-20160816; b=RyKL8WhWfsKTyvdQ/LFbtxTus56oR7X20wAAH9tHRbDNmLJpSgkJKqSHmBwHO/U8Kn Pk1tQ+RX2sdl8Bb3+Feoua1uA7jZDRz9DVrT8tZEeQx8KzNpUDt8GRMTBSuwwryDrYhS +4e+xpcjsOJVd/CzYvpRBkchZazLOZl2dD60sE7TVpU5GbH4/djS8o7Spaluv2w2evpk V3ovuR88Hgl0FaTgrrY3GjBl7B7LcPUdD85TJUOrO5nFZDvCWVZcWLVRm3DU6nvRMe1Q 64Rw8+QIkYD/BFAmFUMj009IUwZhidR0+zyhxhAFeT3ufDTt2PkBgRRxMWqxYfFIIyFf BLZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date; bh=506EY8ZMAp0r2e2jHOCTsrWXwpW3bx0upBiwyR1NKfc=; b=IcHAUknIKVepwJO1d7XZQVah92Cmw8sgjwLEEW4xqJ2UhQPzS/lf3SmK2OUcS+uJ+Y v3s4wEJPjd4/RF1EtISJS7RulaTIVLgHKLyeAwYpzaU4ZIfSXG0SPUeY9O+ZXcK3/sH6 DdSoPx28tUv4K1gECLqHdRQh3CGki01mOPTgr1cCk862O3r7WDMx7NLYvfS06l1l6f6w v36rShyUXELh6Kve84If+hx4uqfpMsFpv/GE8+tlYoM4+ponUGKhSURRGSMM7CkoCB2D /QeK1rH/30qLtJo9FPpMpTQtDeZvMs0AnZWgedjoCUxYtU1VIqcP+PbAEz9Dk9tl3twI RW6A== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id 204-v6si586530wmw.3.2018.10.22.08.57.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Oct 2018 08:57:10 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.14 as permitted sender) client-ip=192.35.17.14; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id w9MFv9l6018568 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 Oct 2018 17:57:09 +0200 Received: from md1pvb1c.ad001.siemens.net (md1pvb1c.ad001.siemens.net [139.25.68.40] (may be forged)) by mail1.sbs.de (8.15.2/8.15.2) with ESMTPS id w9MFv9Kv025767 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 22 Oct 2018 17:57:09 +0200 Date: Mon, 22 Oct 2018 17:57:30 +0200 From: Henning Schild To: "[ext] Jan Kiszka" Cc: Harald Seiler , Subject: Re: [PATCH] dpkg-raw: Fix rebuilding recipes Message-ID: <20181022175730.34ec84ed@md1pvb1c.ad001.siemens.net> In-Reply-To: <70898627-9e55-4d83-b25c-1f41cf07da51@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> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: o58HsEe/7oPV Am Tue, 9 Oct 2018 14:17:03 +0200 schrieb "[ext] Jan Kiszka" : > 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. I once wrote a recipe for a customized debian package. Next to the customization i also had to patch out an assertion that the build is not allowed to run as root. So one thing to add to Isar would be to actually create a user "builder" and do not build as "root". That would have found the "sudo" and would never have triggered my assertion. I doubt that debian folks build their packages as root ... Henning > Jan > > > > > I have seen this error with a lot of different packages so I am > > pretty certain that it is not a bug in the recipes I tested. > > > > Harald > > > >>> cat<<-__EOF__ > ${D}/DEBIAN/control > >>> Package: ${PN} > >>> Architecture: ${DISTRO_ARCH} > >>> > > >