Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp5953016rwb; Tue, 1 Aug 2023 10:04:55 -0700 (PDT) X-Google-Smtp-Source: APBJJlFKfPi2Nxi2FHDt5ERQS8sy3WjI3hRlDFk3BeObHgC1JvqqmOr3ZYkneFS03zBVoqrkWlvt X-Received: by 2002:aa7:de14:0:b0:519:6a6a:7659 with SMTP id h20-20020aa7de14000000b005196a6a7659mr3230598edv.18.1690909495386; Tue, 01 Aug 2023 10:04:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690909495; cv=none; d=google.com; s=arc-20160816; b=YLBFFBg4wEJeaXSsAU7DqZsOsezu94uDYM4sff9fWU2fkei2hUFdj0SYNkaDUBup1W dcDzaSS4We76iu/zdl/hnudCF4ATdVtluBmAgDV7hYFWsRwMg5VwEwReqfjD1nBKvAqk vyjlx8OOngiDGdcYSZDe7eeiBwHEI5DbK+x8MW6gX1ZgPJ38rUYXjbQP8mwDM1+iQMXg uadlNn950qCcvUExqrpDULTk0+CVmlIJcH/XhUGlZLrq5u4DFmS4/nQ45A1C/CEUAg5Y ADpmvDi193t45CZzgkm9kjkQvuD8AQybuOqo0oD6Fe+V4w8nQrsgy9xZiEomgynkgqo/ DvEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Np1Qd2nv6XrX+Djl47Mk07/H3GQ0t4eCtZtay+MASP8=; fh=dMNCMksimw7wAld9W0lInj22ZStypnwtaWBH2ig850Y=; b=h7urkTy+/U+4LZX/JFsDBNhG+8/7OTyDkHGU1usMf7fTb1RlqvTtP5LDFUKvI7X04P qq/l3KQy6d8JiVsBZu1nJkwiWopiIXAxFt6Xt3Fv+N/RyCogu5DDS/2T4srY15EUSl4h jvVp6rZuMBEusdllkuZxg/o1SWZvK9q7ARSf/VlNn6vXwtzaSWhuZ5llOACelMRX8p4w 7Qbaq6KjxVWKzODKUqenNn2g+zmT6ugzhVglBxj+0aMBecCBsi7A7IOycnoXY1pNQkEL seF4zI93hcmAzXYuX1l89la8g/dcQOmoenAltSULAcjOflzqBHu43YhwS41XCylerr/D RhbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="VqsIEBx/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n12-20020aa7c68c000000b0051e4bdea714si4305772edq.575.2023.08.01.10.04.04; Tue, 01 Aug 2023 10:04:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="VqsIEBx/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232660AbjHAQwq (ORCPT + 99 others); Tue, 1 Aug 2023 12:52:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232520AbjHAQwi (ORCPT ); Tue, 1 Aug 2023 12:52:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DBD72698; Tue, 1 Aug 2023 09:52:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2303B615C2; Tue, 1 Aug 2023 16:52:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35D68C433C8; Tue, 1 Aug 2023 16:52:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690908741; bh=KSaGb+S4Sy8ldO6yw8Yex7ClXfz16xEbNtyeKz4Ie0c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VqsIEBx/QR8gxhaQULElabmV4YUorXoSkdiu+5FxFaOhMGfqYidaZu/NLm6xEU7ge yyGI4yUV0FHUFoUqRKt1LVeBiR09pevN4Kurv9ItjfZnHa3S5+dDqeBjMVRjnbf2hU +uXSUstFm2uCYgCaRZMeR0s8VQ3VFcC3GejxZMxfbF/9GOnfMLslmR96P29NZIgl1e o+eKcaXt2/CAxUga35zTivtUV76icffFpQ/5sxbm0kmWYsN4uAOb3xF2iJ9g/zqYBK jSEobqOWjKMJkdASo1SK3iLXUY0r0wHSX/s1EbgnJ5cXWv5ym9sZ8HXYuCP0/MYPdV qiKmJDwJCPfXQ== Date: Tue, 1 Aug 2023 09:52:19 -0700 From: Nathan Chancellor To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Ben Hutchings , Nick Desaulniers , Nicolas Schier Subject: Re: [PATCH v2 2/2] kbuild: deb-pkg: split debian/rules Message-ID: <20230801165219.GB2472327@dev-arch.thelio-3990X> References: <20230801121926.1677205-1-masahiroy@kernel.org> <20230801121926.1677205-2-masahiroy@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230801121926.1677205-2-masahiroy@kernel.org> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 01, 2023 at 09:19:26PM +0900, Masahiro Yamada wrote: > debian/rules is generated by shell, but the escape sequence (\$) is > unreadable. > > debian/rules embeds only two variables (ARCH and KERNELRELEASE). > > Split them out to debian/rules.vars, and check-in the rest of Makefile > code to scripts/package/debian/rules. > > Signed-off-by: Masahiro Yamada Tested-by: Nathan Chancellor > --- > > Changes in v2: > - Change ${MAKE} to $(MAKE) for consistency > - Fix shellcheck warning > > scripts/package/debian/rules | 28 ++++++++++++++++++++++++++++ > scripts/package/mkdebian | 34 +++++----------------------------- > 2 files changed, 33 insertions(+), 29 deletions(-) > create mode 100755 scripts/package/debian/rules > > diff --git a/scripts/package/debian/rules b/scripts/package/debian/rules > new file mode 100755 > index 000000000000..226e127efd63 > --- /dev/null > +++ b/scripts/package/debian/rules > @@ -0,0 +1,28 @@ > +#!/usr/bin/make -f > +# SPDX-License-Identifier: GPL-2.0-only > + > +include debian/rules.vars > + > +srctree ?= . > + > +.PHONY: binary binary-indep binary-arch > +binary: binary-arch binary-indep > +binary-indep: build-indep > +binary-arch: build-arch > + $(MAKE) -f $(srctree)/Makefile ARCH=$(ARCH) \ > + KERNELRELEASE=$(KERNELRELEASE) \ > + run-command KBUILD_RUN_COMMAND=+$(srctree)/scripts/package/builddeb > + > +.PHONY: build build-indep build-arch > +build: build-arch build-indep > +build-indep: > +build-arch: > + $(MAKE) -f $(srctree)/Makefile ARCH=$(ARCH) \ > + KERNELRELEASE=$(KERNELRELEASE) \ > + $(shell $(srctree)/scripts/package/deb-build-option) \ > + olddefconfig all > + > +.PHONY: clean > +clean: > + rm -rf debian/files debian/linux-* > + $(MAKE) -f $(srctree)/Makefile ARCH=$(ARCH) clean > diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian > index 2829f5b8aea6..5044224cf671 100755 > --- a/scripts/package/mkdebian > +++ b/scripts/package/mkdebian > @@ -263,35 +263,11 @@ Description: Linux kernel debugging symbols for $version > EOF > fi > > -cat < debian/rules > -#!/usr/bin/make -f > - > -srctree ?= . > -KERNELRELEASE = ${KERNELRELEASE} > - > -.PHONY: clean build build-arch build-indep binary binary-arch binary-indep > - > -build-indep: > -build-arch: > - \$(MAKE) -f \$(srctree)/Makefile ARCH=${ARCH} \ > - KERNELRELEASE=\$(KERNELRELEASE) \ > - \$(shell \$(srctree)/scripts/package/deb-build-option) \ > - olddefconfig all > - > -build: build-arch > - > -binary-indep: > -binary-arch: build-arch > - \$(MAKE) -f \$(srctree)/Makefile ARCH=${ARCH} \ > - KERNELRELEASE=\$(KERNELRELEASE) \ > - run-command KBUILD_RUN_COMMAND=+\$(srctree)/scripts/package/builddeb > - > -clean: > - rm -rf debian/files debian/linux-* > - \$(MAKE) -f \$(srctree)/Makefile ARCH=${ARCH} clean > - > -binary: binary-arch > +cat < debian/rules.vars > +ARCH := ${ARCH} > +KERNELRELEASE := ${KERNELRELEASE} > EOF > -chmod +x debian/rules > + > +cp "${srctree}/scripts/package/debian/rules" debian/ > > exit 0 > -- > 2.39.2 >