From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6646963335912751104 X-Received: by 2002:a17:906:6006:: with SMTP id o6-v6mr1345018ejj.4.1547665775664; Wed, 16 Jan 2019 11:09:35 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a50:b1e2:: with SMTP id n31ls1724909edd.3.gmail; Wed, 16 Jan 2019 11:09:35 -0800 (PST) X-Google-Smtp-Source: ALg8bN5qEx43/RObCJPKm0aEcetwn24zPOV78wpYAAnTyVAlEuLVKg+49GbjYxpBPhVlJ4U+kk52 X-Received: by 2002:a50:ac53:: with SMTP id w19mr1500902edc.3.1547665775028; Wed, 16 Jan 2019 11:09:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547665775; cv=none; d=google.com; s=arc-20160816; b=DKNIefhhq9N/W7GypJe64M0d1v3MKPFwin0pqbArWIXoSh1gd/w8np7NkWpY/dT3Wc mV8UZi/rUH0Zk+vbq5XFea60gVYIxnN3Hku82mELuAqsrSU2hcerEpAU31ZMUMMHuHuI vBNHcat9ZSBxgMiFOe3p7Irr7zhopXNE7jKE/+do2XZXs4VhZzqcuTZPGUQZx9EIiTHr a/kRb0nauK/zWZBGJ5Y90JewwascMJUVrAwtw6ewYqLEqe1l8qHmVdr91BnhgF4n8NMS QUXf4aV9bnzkOvCfKpXMyyWFnT8wfoS/tkxyZ1RPY2Msx4sltiUl/LK7yjhHrY89K3la 0jRg== 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:cc:to:subject; bh=26JJxCVkvnmVh8y2Dsp2OaAM3/8D3LQRBAO+nApqHQs=; b=IjhH1ql0m0RHMT16+l8LMzUYtZDQXX88xbsaMnWqqX69QutXYUbSs/t7KvnQ+2ztrk lhKAzvXX2m1yQmEqx1B8wSPSaBhna0CXmLszUW7z2DfY4GMuGAG87hVVGsjj2iIBS05b xr+mwOHxvhpVwb8VKb7J09pPzuwC8Sr+HspqR0K7CvCtwOelLBoD2zwmheALKg0ap6Ie PeCz1lHU0o8TNyihzCl/Uwk97I1J/lg/0k/7GwcjdTSkSXwGWXnd/EbGhC2AfFcS9b8s sQJCqiI6w5Iu0WkQrbQebMOhi87pyCl197iNmI83cxaaKKGs6KYWq56E/p+DEJugS7Rd CrQA== 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 i2-v6si1140487ejj.1.2019.01.16.11.09.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Jan 2019 11:09:35 -0800 (PST) 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 x0GJ9YZR013110 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 16 Jan 2019 20:09:34 +0100 Received: from [139.22.33.205] ([139.22.33.205]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id x0GJ9XeA023458; Wed, 16 Jan 2019 20:09:34 +0100 Subject: Re: [PATCH v3 01/14] dpkg-raw: Respect file permissions defined by recipe if requested To: Henning Schild Cc: isar-users References: <97edc3d29b4aaa19dbbb067e13335beda3f74447.1547616747.git.jan.kiszka@siemens.com> <20190116104138.356cd52c@md1za8fc.ad001.siemens.net> <39793b3d-d5c5-4bc4-d16a-7aff13baaa5f@siemens.com> <20190116162420.3cadec9a@md1za8fc.ad001.siemens.net> From: Jan Kiszka Message-ID: Date: Wed, 16 Jan 2019 20:09:33 +0100 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: <20190116162420.3cadec9a@md1za8fc.ad001.siemens.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: RBgZBsg1EdJR On 16.01.19 16:24, Henning Schild wrote: > Am Wed, 16 Jan 2019 13:11:47 +0100 > schrieb Jan Kiszka : > >> On 16.01.19 10:41, Henning Schild wrote: >>> Am Wed, 16 Jan 2019 06:32:14 +0100 >>> schrieb Jan Kiszka : >>> >>>> From: Jan Kiszka >>>> >>>> dh_fixperms overwrites the permissions do_install may have >>>> defined. To avoid that, allow the recipe write to define an >>>> exception list via the PRESERVE_PERMS variable. >>>> >>>> Fixes: f301ccb2b5b1 ("meta/dpkg-raw: build raw packages like all >>>> others") CC: Henning Schild >>>> Signed-off-by: Jan Kiszka >>>> --- >>>> RECIPE-API-CHANGELOG.md | 7 +++++++ >>>> meta/classes/dpkg-raw.bbclass | 9 ++++++++- >>>> 2 files changed, 15 insertions(+), 1 deletion(-) >>>> >>>> diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md >>>> index 06a01e3..2bc1585 100644 >>>> --- a/RECIPE-API-CHANGELOG.md >>>> +++ b/RECIPE-API-CHANGELOG.md >>>> @@ -124,3 +124,10 @@ updated hence recipes using them shouldn't be >>>> impacted per se. >>>> These packages depend on a specific kernel. Its identification is >>>> now appended to the binary package names in the form >>>> "-${KERNEL_NAME}". + >>>> +### PRESERVE_PERMS needed with dpkg-raw for implicit file >>>> permission setting + >>>> +In order to use the same file permissions for an input file to a >>>> dpkg-raw +package on the build machine as well as on the target, >>>> its absolute target path +needs to be listed in the PRESERVE_PERMS >>>> variable (space-separated list of +files). Otherwise, default >>>> permissions are used. diff --git a/meta/classes/dpkg-raw.bbclass >>>> b/meta/classes/dpkg-raw.bbclass index 8d11433..42276e5 100644 >>>> --- a/meta/classes/dpkg-raw.bbclass >>>> +++ b/meta/classes/dpkg-raw.bbclass >>>> @@ -53,12 +53,19 @@ Description: ${DESCRIPTION} >>>> EOF >>>> } >>>> >>>> +FIXPERM_EXCLUSIONS = \ >>>> + "${@' '.join(['-X ' + x for x in \ >>>> + (d.getVar('PRESERVE_PERMS', False) or >>>> '').split()])}" + >>>> deb_create_rules() { >>>> cat << EOF > ${S}/debian/rules >>>> #!/usr/bin/make -f >>>> + >>>> +override_dh_fixperms: >>>> + dh_fixperms ${FIXPERM_EXCLUSIONS} >>>> + >>> >>> This should be done only if the variable is non-empty, to keep that >>> code generic. Also the variable name should maybe start with DH_ or >>> DEBIAN_. >> >> I can change the naming, but I disagree regarding your other concern: >> dh_fixperms is by definition the default case if there is no >> override. Therefore >> >> override_dh_fixperms: >> dh_fixperms > > I would not be sure. Say a later step in some layers append would want > to set an actual override would the two conflict? There is no overlay method for rules files. You replace them, or patch them knowing how the original version looks like. Jan -- Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux