From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6610281096522235904 X-Received: by 2002:adf:add4:: with SMTP id w78-v6mr2739473wrc.26.1539087426828; Tue, 09 Oct 2018 05:17:06 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:7ec2:: with SMTP id z185-v6ls137732wmc.26.gmail; Tue, 09 Oct 2018 05:17:06 -0700 (PDT) X-Google-Smtp-Source: ACcGV60FGr1X2anlfaTh4bc1tTEgQCerzMU4xZUWingGzkU0EfetjULgwPzDwIU7eJ27PZoCjH4M X-Received: by 2002:a1c:b606:: with SMTP id g6-v6mr423191wmf.13.1539087426282; Tue, 09 Oct 2018 05:17:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539087426; cv=none; d=google.com; s=arc-20160816; b=G4kJ3YpgM0Ot5Fl7tmtb5H/g9d8uyME3658mHVRTb2a8/vpPaZZ3SMrSZjXVGUvJGH cXk+xqPUJMGl0hZWiyR9z4YD15wOWcC/3P8MYjJlkonVQhlR5TBIScBiOZ7aSZR/KfxV O3iMjOhrYO+ECc0BZSCxF+FcvP+g/CTVJKU2gm2Mgf7DOtkLccsAchEJevls86+4FAOQ npckLdiIrx9tRSHUr8/S62LZocYUZxJTQxgG1XrzfJUeAITkTXfOxuIyTL1c4LAejj/C Kg4ZZmXHH+K5+pawDdWoHtrbmel/UNKlYIqsMPlHAekiuT3chs5+1Dy6g2SiMXEHLOxU JB3A== 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:from:references:to:subject; bh=5+iB659kJCSWMQoq6zyfTbJJX001rNqq0A99MS6cqg8=; b=HbJIAyz4XC4INkNB2CmlJFY3RzZWlWdZlHxGIRzCv5pMn6gEbfZmjM/tmElfUlIaib r2Cgkqky8MrGxxZClrb/z1itqXpAFxiL4v6HDQFSO5Mdx5bjWNk8+SFW/Hv6lv763/IJ b3TW6e3Gl4Fw8pnVP/b2rzumrjOej5YKbfDTIPU9KpCo/sUPJU4fhOJVydaDBYHIlpmU zJNGmmDfVb5loJR83DY62b9qZ6p4oLM6wvnJtn7E7PJY+4/D3RuBb2SG78WJYP8bi1wU sSnbhLphWCJZ6/bLXXLab2uCSw73OjpUvhuBI2wAdF2fp+Qkbn4+R6WPDpGoCwxDqicE 7WMA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Return-Path: Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id h74-v6si812106wmd.4.2018.10.09.05.17.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Oct 2018 05:17:06 -0700 (PDT) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.2 as permitted sender) client-ip=192.35.17.2; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id w99CH5dJ012580 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 9 Oct 2018 14:17:05 +0200 Received: from [139.25.68.37] (md1q0hnc.ad001.siemens.net [139.25.68.37] (may be forged)) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id w99CH4DV024608; Tue, 9 Oct 2018 14:17:04 +0200 Subject: Re: [PATCH] dpkg-raw: Fix rebuilding recipes To: Harald Seiler , isar-users@googlegroups.com References: <23f5cd40400ecfc4074e0fb0185902fccd7bae2e.camel@denx.de> <9e705dc1-53cd-28d1-8d8d-a832fb887d16@siemens.com> <158f4ad6a1cda4cca01e820a4279c11807b281a5.camel@denx.de> From: Jan Kiszka Message-ID: <70898627-9e55-4d83-b25c-1f41cf07da51@siemens.com> Date: Tue, 9 Oct 2018 14:17:03 +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: <158f4ad6a1cda4cca01e820a4279c11807b281a5.camel@denx.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: bf2MfQw2xkTT 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. 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} >>> > -- Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux