From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7032253102499561472 X-Received: by 2002:a17:906:55d7:: with SMTP id z23mr16352241ejp.393.1637734400042; Tue, 23 Nov 2021 22:13:20 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:aa7:c98f:: with SMTP id c15ls3221478edt.0.gmail; Tue, 23 Nov 2021 22:13:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJzrmsVoiBj7K6+3K5J05N8RtIkiS4aRFaNnwhzCdCuz6zUl4XppdaSM2Rb2DIz1eiw4Fkuc X-Received: by 2002:a50:c38c:: with SMTP id h12mr19930065edf.72.1637734398995; Tue, 23 Nov 2021 22:13:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637734398; cv=none; d=google.com; s=arc-20160816; b=KFiY0i+qZ9sYb63GZN2GpB1sKyuH8QiVBnhE9KUV/Mincfy5Kk5iwwh8+aCO/SC5YC k2x/UBIbdCOiPdpWikhRSnfshu1x88Hm/O7+rM1LxLPwBcg83CwjNrQeDIcOGg/3vx3p HT9qmctPmRdFXqt/6ORpk75+GYVoaXjRLyJi9CwbkSzgfSb07TlaAijn4J8BdozA8eM1 DSfDpGVEXp8bnIHq3No6wPHt+lCkzKcj0053+vHe+I+3z9yjIYbavwxHSU4RFIpJ+iIm yXbewR36FHvyJGqHBNcRJysb07L9fojyr4dVsQ/IrlRXcGzrUX1PK8uj6yg8TiV8mZ1j Jxwg== 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=TtGWDa/ge9mAbF5Jx0AL5VQNKM2/DLrc//vIQrWUEk4=; b=NRNsBgAsfrRVk8n7eRmfUnmhO5nh8qcq+J0A0k8TkXts78YWLdCj6Mtj36chYQdv+G Gl0s6feE7vhpNO/THYl/KAS2LoV/UX3JSoA+Zee7UuEyCjoLGbH8kt6jxCPsauGpA2om VrP5uIwNwixDU5fP13/5kf4SU5XLAcTupjK9AAOulzJm9kR37bkLNJy5PAAS+hxBVZ0S 53K96xSvqSxxitcW3VrVQjqOU53WSw9uWim2i0ZDfWdPx+c0nr2fab9iYs/MFYwLREtv 608vT3BDu2H4h/ZIrA7wvAfpcj1dPp7CpGcqZ3YRb+6ELxHOAtgZqXzY0lwWVVICOWhr itOQ== 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id w5si770033ede.3.2021.11.23.22.13.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Nov 2021 22:13:18 -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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id 1AO6DIvK022101 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 24 Nov 2021 07:13:18 +0100 Received: from [167.87.0.79] ([167.87.0.79]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 1AO6DIco019635; Wed, 24 Nov 2021 07:13:18 +0100 Subject: Re: [PATCH v2 04/24] linux-module: Do not use shell environment To: Uladzimir Bely , isar-users@googlegroups.com References: <20211119121333.13805-1-ubely@ilbers.de> <20211119121333.13805-5-ubely@ilbers.de> <1bc95be7-e603-966b-5326-962362548e2c@siemens.com> <2392353.XAFRqVoOGU@home> From: Jan Kiszka Message-ID: <25fe32be-fbbd-5f21-177a-bcb31aa20fd8@siemens.com> Date: Wed, 24 Nov 2021 07:13:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <2392353.XAFRqVoOGU@home> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: Bho+iC1L4eq2 On 23.11.21 13:24, Uladzimir Bely wrote: > In the email from Friday, 19 Nov 2021. 15:44:12 +03 user Jan Kiszka wrote: >> On 19.11.21 13:13, Uladzimir Bely wrote: >> >>> +KDIR := $(shell dpkg -L $(KERNEL_DEP) | grep "/lib/modules/.*/build") >>> +endif >>> + >>> +# With sbuild `dh clean` is called before chroot's apt database updated. >>> So, +# KDIR is empty at that moment and the override causes error. Will >>> skip it. +ifneq ($(KDIR),) >>> >>> override_dh_auto_clean: >>> $(MAKE) -C $(KDIR) M=$(PWD) clean >>> >>> +endif >> >> This looks wrong, or at least fragile. Why can we live without a proper >> clean on the kernel tree? >> >> Jan > > Actually, this workaround with `ifneq ($(KDIR),)` I added to the patch after > the commit https://github.com/ilbers/isar/commit/248436880eb2 was applied to > `next`. > > This change doesn't cancel a proper clean on the kernel. Here are some example > logs: > > `next`: https://gist.github.com/WiseLord/0fb98bc036532ec03e4f763b2ba06a41 > `sbuild`: https://gist.github.com/WiseLord/3c35d477efc025bcc9cd3c5cbd3dbc5d > > On current `next` code dh_clean (and override-related `make ... clean` on > kernel code) is executed by dpkg-buildpackage. At this point KDIR is set to a > proper value, so it works as expected. > > With sbuild dh_clean happens to be executed twice: > - 1: immediately after sbuild is run, executed by sbuild itself > - 2: after few stages (like downloading deps and so on), executed by dpkg- > buildpackage. > > The issue is that at 1st execution KDIR is not set, so `make ... clean` > (coming with override) produces wrong command. > > That's why this workaround (skip `make ... clean` in case of empty KDIR) was > added. Proper cleaning is still performed, but on the second call of dh_clean. > > Probably, there is a way to say sbuild not to run this 'generic' dh_clean and > use just one from dpkg-buildpackage later... > Thanks for the explanation. How about clarifying that no clean is lost in the commit message? Jan -- Siemens AG, T RDA IOT Corporate Competence Center Embedded Linux