2023-04-25 11:10:06

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH] kbuild: deb-pkg: specify targets in debian/rules as .PHONY

If a file with the same name exists, the target is not run.

For example, the following command fails.

$ make O=build-arch bindeb-pkg
[ snip ]
sed: can't read modules.order: No such file or directory
make[6]: *** [../Makefile:1577: __modinst_pre] Error 2
make[5]: *** [../scripts/Makefile.package:150: intdeb-pkg] Error 2
make[4]: *** [../Makefile:1657: intdeb-pkg] Error 2
make[3]: *** [debian/rules:14: binary-arch] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
make[2]: *** [../scripts/Makefile.package:139: bindeb-pkg] Error 2

Signed-off-by: Masahiro Yamada <[email protected]>
---

scripts/package/mkdebian | 2 ++
1 file changed, 2 insertions(+)

diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index a4c2c2276223..b6cb95473548 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -269,6 +269,8 @@ cat <<EOF > debian/rules
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} \
--
2.37.2


2023-04-25 18:11:03

by Nathan Chancellor

[permalink] [raw]
Subject: Re: [PATCH] kbuild: deb-pkg: specify targets in debian/rules as .PHONY

On Tue, Apr 25, 2023 at 08:08:59PM +0900, Masahiro Yamada wrote:
> If a file with the same name exists, the target is not run.
>
> For example, the following command fails.
>
> $ make O=build-arch bindeb-pkg
> [ snip ]
> sed: can't read modules.order: No such file or directory
> make[6]: *** [../Makefile:1577: __modinst_pre] Error 2
> make[5]: *** [../scripts/Makefile.package:150: intdeb-pkg] Error 2
> make[4]: *** [../Makefile:1657: intdeb-pkg] Error 2
> make[3]: *** [debian/rules:14: binary-arch] Error 2
> dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
> make[2]: *** [../scripts/Makefile.package:139: bindeb-pkg] Error 2
>
> Signed-off-by: Masahiro Yamada <[email protected]>

Reviewed-by: Nathan Chancellor <[email protected]>

> ---
>
> scripts/package/mkdebian | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
> index a4c2c2276223..b6cb95473548 100755
> --- a/scripts/package/mkdebian
> +++ b/scripts/package/mkdebian
> @@ -269,6 +269,8 @@ cat <<EOF > debian/rules
> 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} \
> --
> 2.37.2
>

2023-04-26 14:17:01

by Masahiro Yamada

[permalink] [raw]
Subject: Re: [PATCH] kbuild: deb-pkg: specify targets in debian/rules as .PHONY

On Wed, Apr 26, 2023 at 3:08 AM Nathan Chancellor <[email protected]> wrote:
>
> On Tue, Apr 25, 2023 at 08:08:59PM +0900, Masahiro Yamada wrote:
> > If a file with the same name exists, the target is not run.
> >
> > For example, the following command fails.
> >
> > $ make O=build-arch bindeb-pkg
> > [ snip ]
> > sed: can't read modules.order: No such file or directory
> > make[6]: *** [../Makefile:1577: __modinst_pre] Error 2
> > make[5]: *** [../scripts/Makefile.package:150: intdeb-pkg] Error 2
> > make[4]: *** [../Makefile:1657: intdeb-pkg] Error 2
> > make[3]: *** [debian/rules:14: binary-arch] Error 2
> > dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
> > make[2]: *** [../scripts/Makefile.package:139: bindeb-pkg] Error 2
> >
> > Signed-off-by: Masahiro Yamada <[email protected]>
>
> Reviewed-by: Nathan Chancellor <[email protected]>

Applied to linux-kbuild.



>
> > ---
> >
> > scripts/package/mkdebian | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
> > index a4c2c2276223..b6cb95473548 100755
> > --- a/scripts/package/mkdebian
> > +++ b/scripts/package/mkdebian
> > @@ -269,6 +269,8 @@ cat <<EOF > debian/rules
> > 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} \
> > --
> > 2.37.2
> >



--
Best Regards
Masahiro Yamada