From: Prarit Bhargava prarit@redhat.com
One of the nice things about the RHEL and ARK trees is that commands like 'make dist-configs' and 'make dist-help' can be executed from the top-level linux directory.
In the existing code, the makefile includes the top-level linux Makefile if the targets are not dist-* or distg-*. Otherwise the commands are executed with the redhat/Makefile* files. This is clunky and requires the inclusion of the makefile in .gitignore which causes problems when upstream modifies .gitignore.
A better approach is to include the code in a top-level Makefile.dist. This change can then be moved upstream for inclusion with a oneline patch to include Makefile.dist. Makefile.dist would not be included in the gitignore file because we want to track changes for the file in our own tree.
Move the makefile and Makefile.rhelver code into Makefile.dist, and include Makefile.dist from the top-level Makefile.
Signed-off-by: Prarit Bhargava prarit@redhat.com Cc: dzickus@redhat.com Cc: jforbes@redhat.com Cc: bcrocker@redhat.com --- Makefile | 6 ++---- Makefile.rhelver => Makefile.dist | 19 ++++++++++++++++++- makefile | 16 ---------------- redhat/Makefile | 4 ++-- redhat/Makefile.common | 2 +- redhat/genspec.sh | 2 +- redhat/kernel.spec.template | 2 +- redhat/scripts/new_release.sh | 12 ++++++------ 8 files changed, 31 insertions(+), 32 deletions(-) rename Makefile.rhelver => Makefile.dist (77%) delete mode 100644 makefile
diff --git a/Makefile b/Makefile index f3d1dd649d9b..c9a0d4f20808 100644 --- a/Makefile +++ b/Makefile @@ -18,10 +18,6 @@ $(if $(filter __%, $(MAKECMDGOALS)), \ PHONY := __all __all:
-# Set RHEL variables -# Use this spot to avoid future merge conflicts -include Makefile.rhelver - # We are using a recursive build, so we need to do a little thinking # to get the ordering right. # @@ -273,6 +269,8 @@ no-sync-config-targets := $(no-dot-config-targets) install %install \ kernelrelease single-targets := %.a %.i %.ko %.lds %.ll %.lst %.mod %.o %.s %.symtypes %/
+-include Makefile.dist + config-build := mixed-build := need-config := 1 diff --git a/Makefile.rhelver b/Makefile.dist similarity index 77% rename from Makefile.rhelver rename to Makefile.dist index 8fceabade7c8..0b4f2d28e7b8 100644 --- a/Makefile.rhelver +++ b/Makefile.dist @@ -12,7 +12,7 @@ RHEL_MINOR = 99 # # Use this spot to avoid future merge conflicts. # Do not trim this comment. -RHEL_RELEASE = 0 +RHEL_RELEASE = 1
# # Early y+1 numbering @@ -43,3 +43,20 @@ ifneq ("$(ZSTREAM)", "yes") RHEL_RELEASE:=$(RHEL_RELEASE).$(EARLY_YRELEASE) endif endif + +no-dot-config-targets += dist-% distg-% + +ifneq ($(filter dist-% distg-%,$(MAKECMDGOALS)),) +_OUTPUT := "." +# this section is needed in order to make O= to work +ifeq ("$(origin O)", "command line") + _OUTPUT := "$(abspath $(O))" + _EXTRA_ARGS := O=$(_OUTPUT) +endif +endif + +dist-%:: + $(MAKE) -C redhat $(@) $(_EXTRA_ARGS) + +distg-%:: + $(MAKE) -C redhat $(@) $(_EXTRA_ARGS) diff --git a/makefile b/makefile deleted file mode 100644 index 819ac9a5cd60..000000000000 --- a/makefile +++ /dev/null @@ -1,16 +0,0 @@ -ifeq ($(filter dist-% distg-%,$(MAKECMDGOALS)),) - include Makefile -endif - -_OUTPUT := "." -# this section is needed in order to make O= to work -ifeq ("$(origin O)", "command line") - _OUTPUT := "$(abspath $(O))" - _EXTRA_ARGS := O=$(_OUTPUT) -endif -dist-%:: - $(MAKE) -C redhat $(@) $(_EXTRA_ARGS) - -distg-%:: - $(MAKE) -C redhat $(@) $(_EXTRA_ARGS) - diff --git a/redhat/Makefile b/redhat/Makefile index 61dcc522fbc6..8c6a3a510768 100644 --- a/redhat/Makefile +++ b/redhat/Makefile @@ -256,7 +256,7 @@ sources-rh: $(TARBALL) configs/process_configs.sh \ parallel_xz.sh \ generate_bls_conf.sh \ - ../Makefile.rhelver \ + ../Makefile.dist \ README.rst \ $(SOURCES)/ @for KABIARCH in $(ARCH_LIST); do \ @@ -308,7 +308,7 @@ dist-release-finish: setup-source @git add $(REDHAT)/$(CHANGELOG) @echo $(MARKER) > $(REDHAT)/marker @git add $(REDHAT)/marker - @git commit -s ../Makefile.rhelver $(REDHAT)/marker $(REDHAT)/$(CHANGELOG) $(PACKAGE_NAME).spec.template -m "[redhat] $(PACKAGE_NAME)-$(STAMP_VERSION)-$(PREBUILD)$(BUILD)$(BUILDID)" + @git commit -s ../Makefile.dist $(REDHAT)/marker $(REDHAT)/$(CHANGELOG) $(PACKAGE_NAME).spec.template -m "[redhat] $(PACKAGE_NAME)-$(STAMP_VERSION)-$(PREBUILD)$(BUILD)$(BUILDID)" @$(MAKE) dist-configs @$(MAKE) dist-kabi @$(MAKE) dist-kabi-dup diff --git a/redhat/Makefile.common b/redhat/Makefile.common index 6d048415ba6d..d4e68369fb05 100644 --- a/redhat/Makefile.common +++ b/redhat/Makefile.common @@ -1,6 +1,6 @@ TOPDIR:=$(shell git rev-parse --show-toplevel) REDHAT:=$(TOPDIR)/redhat -include $(TOPDIR)/Makefile.rhelver +include $(TOPDIR)/Makefile.dist
RPMBUILD := $(shell if [ -x "/usr/bin/rpmbuild" ]; then echo rpmbuild; \ else echo rpm; fi) diff --git a/redhat/genspec.sh b/redhat/genspec.sh index b72dffe14729..1cd9095a69ea 100755 --- a/redhat/genspec.sh +++ b/redhat/genspec.sh @@ -253,7 +253,7 @@ if [ "$SINGLE_TARBALL" = 0 ]; then ":(exclude,top).gitignore" \ ":(exclude,top).gitlab-ci.yml" \ ":(exclude,top)makefile" \ - ":(exclude,top)Makefile.rhelver" \ + ":(exclude,top)Makefile.dist" \ ":(exclude,top)redhat") for c in $COMMITS; do patch=$(git format-patch --zero-commit -1 "$c") diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template index d47c9cce8a0e..93fa8c2985b1 100644 --- a/redhat/kernel.spec.template +++ b/redhat/kernel.spec.template @@ -569,7 +569,7 @@ BuildRequires: asciidoc # xzcat -qq ${TARBALL} | git get-tar-commit-id Source0: linux-%%TARBALL_VERSION%%.tar.xz
-Source1: Makefile.rhelver +Source1: Makefile.dist
# Name of the packaged file containing signing key diff --git a/redhat/scripts/new_release.sh b/redhat/scripts/new_release.sh index 1e4c7bb1dc86..f1025f458d04 100755 --- a/redhat/scripts/new_release.sh +++ b/redhat/scripts/new_release.sh @@ -13,7 +13,7 @@ if [ -s "$RHPATH/linux-kernel-test.patch" ]; then exit 1; fi
-RELEASE=$(sed -n -e 's/^RHEL_RELEASE\ =\ (.*)/\1/p' $RHPATH/../Makefile.rhelver) +RELEASE=$(sed -n -e 's/^RHEL_RELEASE\ =\ (.*)/\1/p' $RHPATH/../Makefile.dist)
YVER=$(echo $RELEASE | cut -d "." -f 1) YVER=${YVER:=$RELEASE} @@ -26,15 +26,15 @@ if [ "$ZSTREAM_FLAG" == "no" ]; then if [ "$YSTREAM_FLAG" == "yes" ]; then NEW_RELEASE="$[RELEASE + 1]"; else - EARLY_YBUILD=$(sed -n -e 's/^EARLY_YBUILD:=(.*)/\1/p' $RHPATH/../Makefile.rhelver); - EARLY_YRELEASE=$(sed -n -e 's/^EARLY_YRELEASE:=(.*)/\1/p' $RHPATH/../Makefile.rhelver); + EARLY_YBUILD=$(sed -n -e 's/^EARLY_YBUILD:=(.*)/\1/p' $RHPATH/../Makefile.dist); + EARLY_YRELEASE=$(sed -n -e 's/^EARLY_YRELEASE:=(.*)/\1/p' $RHPATH/../Makefile.dist); if [ "$EARLY_YBUILD" != "$RELEASE" ]; then NEW_EARLY_YRELEASE=1; else NEW_EARLY_YRELEASE="$[EARLY_YRELEASE + 1]"; fi - sed -i -e "s/^EARLY_YBUILD:=$EARLY_YBUILD/EARLY_YBUILD:=$RELEASE/" $RHPATH/../Makefile.rhelver; - sed -i -e "s/^EARLY_YRELEASE:=$EARLY_YRELEASE/EARLY_YRELEASE:=$NEW_EARLY_YRELEASE/" $RHPATH/../Makefile.rhelver; + sed -i -e "s/^EARLY_YBUILD:=$EARLY_YBUILD/EARLY_YBUILD:=$RELEASE/" $RHPATH/../Makefile.dist; + sed -i -e "s/^EARLY_YRELEASE:=$EARLY_YRELEASE/EARLY_YRELEASE:=$NEW_EARLY_YRELEASE/" $RHPATH/../Makefile.dist; NEW_RELEASE=$RELEASE; fi elif [ "$ZSTREAM_FLAG" == "yes" ]; then @@ -46,5 +46,5 @@ else exit 1; fi
-sed -i -e "s/RHEL_RELEASE\ =.*/RHEL_RELEASE\ =\ $NEW_RELEASE/" $RHPATH/../Makefile.rhelver; +sed -i -e "s/RHEL_RELEASE\ =.*/RHEL_RELEASE\ =\ $NEW_RELEASE/" $RHPATH/../Makefile.dist;
On Fri, Aug 21, 2020 at 01:44:55PM -0000, GitLab Bridge on behalf of prarit wrote:
diff --git a/Makefile.rhelver b/Makefile.dist similarity index 77% rename from Makefile.rhelver rename to Makefile.dist index 8fceabade7c8..0b4f2d28e7b8 100644 --- a/Makefile.rhelver +++ b/Makefile.dist @@ -12,7 +12,7 @@ RHEL_MINOR = 99 # # Use this spot to avoid future merge conflicts. # Do not trim this comment. -RHEL_RELEASE = 0 +RHEL_RELEASE = 1
Please drop the above piece.
Cheers, Don
# # Early y+1 numbering @@ -43,3 +43,20 @@ ifneq ("$(ZSTREAM)", "yes") RHEL_RELEASE:=$(RHEL_RELEASE).$(EARLY_YRELEASE) endif endif
+no-dot-config-targets += dist-% distg-%
+ifneq ($(filter dist-% distg-%,$(MAKECMDGOALS)),) +_OUTPUT := "." +# this section is needed in order to make O= to work +ifeq ("$(origin O)", "command line")
- _OUTPUT := "$(abspath $(O))"
- _EXTRA_ARGS := O=$(_OUTPUT)
+endif +endif
+dist-%::
- $(MAKE) -C redhat $(@) $(_EXTRA_ARGS)
+distg-%::
- $(MAKE) -C redhat $(@) $(_EXTRA_ARGS)
diff --git a/makefile b/makefile deleted file mode 100644 index 819ac9a5cd60..000000000000 --- a/makefile +++ /dev/null @@ -1,16 +0,0 @@ -ifeq ($(filter dist-% distg-%,$(MAKECMDGOALS)),)
- include Makefile
-endif
-_OUTPUT := "." -# this section is needed in order to make O= to work -ifeq ("$(origin O)", "command line")
- _OUTPUT := "$(abspath $(O))"
- _EXTRA_ARGS := O=$(_OUTPUT)
-endif -dist-%::
- $(MAKE) -C redhat $(@) $(_EXTRA_ARGS)
-distg-%::
- $(MAKE) -C redhat $(@) $(_EXTRA_ARGS)
diff --git a/redhat/Makefile b/redhat/Makefile index 61dcc522fbc6..8c6a3a510768 100644 --- a/redhat/Makefile +++ b/redhat/Makefile @@ -256,7 +256,7 @@ sources-rh: $(TARBALL) configs/process_configs.sh \ parallel_xz.sh \ generate_bls_conf.sh \
../Makefile.rhelver \
README.rst \ $(SOURCES)/ @for KABIARCH in $(ARCH_LIST); do \../Makefile.dist \@@ -308,7 +308,7 @@ dist-release-finish: setup-source @git add $(REDHAT)/$(CHANGELOG) @echo $(MARKER) > $(REDHAT)/marker @git add $(REDHAT)/marker
- @git commit -s ../Makefile.rhelver $(REDHAT)/marker $(REDHAT)/$(CHANGELOG) $(PACKAGE_NAME).spec.template -m "[redhat] $(PACKAGE_NAME)-$(STAMP_VERSION)-$(PREBUILD)$(BUILD)$(BUILDID)"
- @git commit -s ../Makefile.dist $(REDHAT)/marker $(REDHAT)/$(CHANGELOG) $(PACKAGE_NAME).spec.template -m "[redhat] $(PACKAGE_NAME)-$(STAMP_VERSION)-$(PREBUILD)$(BUILD)$(BUILDID)" @$(MAKE) dist-configs @$(MAKE) dist-kabi @$(MAKE) dist-kabi-dup
diff --git a/redhat/Makefile.common b/redhat/Makefile.common index 6d048415ba6d..d4e68369fb05 100644 --- a/redhat/Makefile.common +++ b/redhat/Makefile.common @@ -1,6 +1,6 @@ TOPDIR:=$(shell git rev-parse --show-toplevel) REDHAT:=$(TOPDIR)/redhat -include $(TOPDIR)/Makefile.rhelver +include $(TOPDIR)/Makefile.dist
RPMBUILD := $(shell if [ -x "/usr/bin/rpmbuild" ]; then echo rpmbuild; \ else echo rpm; fi) diff --git a/redhat/genspec.sh b/redhat/genspec.sh index b72dffe14729..1cd9095a69ea 100755 --- a/redhat/genspec.sh +++ b/redhat/genspec.sh @@ -253,7 +253,7 @@ if [ "$SINGLE_TARBALL" = 0 ]; then ":(exclude,top).gitignore" \ ":(exclude,top).gitlab-ci.yml" \ ":(exclude,top)makefile" \
":(exclude,top)Makefile.rhelver" \
":(exclude,top)redhat") for c in $COMMITS; do patch=$(git format-patch --zero-commit -1 "$c")":(exclude,top)Makefile.dist" \diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template index d47c9cce8a0e..93fa8c2985b1 100644 --- a/redhat/kernel.spec.template +++ b/redhat/kernel.spec.template @@ -569,7 +569,7 @@ BuildRequires: asciidoc # xzcat -qq ${TARBALL} | git get-tar-commit-id Source0: linux-%%TARBALL_VERSION%%.tar.xz
-Source1: Makefile.rhelver +Source1: Makefile.dist
# Name of the packaged file containing signing key diff --git a/redhat/scripts/new_release.sh b/redhat/scripts/new_release.sh index 1e4c7bb1dc86..f1025f458d04 100755 --- a/redhat/scripts/new_release.sh +++ b/redhat/scripts/new_release.sh @@ -13,7 +13,7 @@ if [ -s "$RHPATH/linux-kernel-test.patch" ]; then exit 1; fi
-RELEASE=$(sed -n -e 's/^RHEL_RELEASE\ =\ (.*)/\1/p' $RHPATH/../Makefile.rhelver) +RELEASE=$(sed -n -e 's/^RHEL_RELEASE\ =\ (.*)/\1/p' $RHPATH/../Makefile.dist)
YVER=$(echo $RELEASE | cut -d "." -f 1) YVER=${YVER:=$RELEASE} @@ -26,15 +26,15 @@ if [ "$ZSTREAM_FLAG" == "no" ]; then if [ "$YSTREAM_FLAG" == "yes" ]; then NEW_RELEASE="$[RELEASE + 1]"; else
EARLY_YBUILD=$(sed -n -e 's/^EARLY_YBUILD:=\(.*\)/\1/p' $RHPATH/../Makefile.rhelver);EARLY_YRELEASE=$(sed -n -e 's/^EARLY_YRELEASE:=\(.*\)/\1/p' $RHPATH/../Makefile.rhelver);
EARLY_YBUILD=$(sed -n -e 's/^EARLY_YBUILD:=\(.*\)/\1/p' $RHPATH/../Makefile.dist); if [ "$EARLY_YBUILD" != "$RELEASE" ]; then NEW_EARLY_YRELEASE=1; else NEW_EARLY_YRELEASE="$[EARLY_YRELEASE + 1]"; fiEARLY_YRELEASE=$(sed -n -e 's/^EARLY_YRELEASE:=\(.*\)/\1/p' $RHPATH/../Makefile.dist);
sed -i -e "s/^EARLY_YBUILD:=$EARLY_YBUILD/EARLY_YBUILD:=$RELEASE/" $RHPATH/../Makefile.rhelver;sed -i -e "s/^EARLY_YRELEASE:=$EARLY_YRELEASE/EARLY_YRELEASE:=$NEW_EARLY_YRELEASE/" $RHPATH/../Makefile.rhelver;
sed -i -e "s/^EARLY_YBUILD:=$EARLY_YBUILD/EARLY_YBUILD:=$RELEASE/" $RHPATH/../Makefile.dist; NEW_RELEASE=$RELEASE; fised -i -e "s/^EARLY_YRELEASE:=$EARLY_YRELEASE/EARLY_YRELEASE:=$NEW_EARLY_YRELEASE/" $RHPATH/../Makefile.dist;elif [ "$ZSTREAM_FLAG" == "yes" ]; then @@ -46,5 +46,5 @@ else exit 1; fi
-sed -i -e "s/RHEL_RELEASE\ =.*/RHEL_RELEASE\ =\ $NEW_RELEASE/" $RHPATH/../Makefile.rhelver; +sed -i -e "s/RHEL_RELEASE\ =.*/RHEL_RELEASE\ =\ $NEW_RELEASE/" $RHPATH/../Makefile.dist;
-- GitLab _______________________________________________ kernel mailing list -- kernel@lists.fedoraproject.org To unsubscribe send an email to kernel-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
From: Prarit Bhargava prarit@redhat.com
One of the nice things about the RHEL and ARK trees is that commands like 'make dist-configs' and 'make dist-help' can be executed from the top-level linux directory.
In the existing code, the makefile includes the top-level linux Makefile if the targets are not dist-* or distg-*. Otherwise the commands are executed with the redhat/Makefile* files. This is clunky and requires the inclusion of the makefile in .gitignore which causes problems when upstream modifies .gitignore.
A better approach is to include the code in a top-level Makefile.dist. This change can then be moved upstream for inclusion with a oneline patch to include Makefile.dist. Makefile.dist would not be included in the gitignore file because we want to track changes for the file in our own tree.
Move the makefile and Makefile.rhelver code into Makefile.dist, and include Makefile.dist from the top-level Makefile.
v2: Set RHEL_RELEASE to 0 (dzickus)
Signed-off-by: Prarit Bhargava prarit@redhat.com Cc: dzickus@redhat.com Cc: jforbes@redhat.com Cc: bcrocker@redhat.com --- Makefile | 6 ++---- Makefile.rhelver => Makefile.dist | 17 +++++++++++++++++ makefile | 16 ---------------- redhat/Makefile | 4 ++-- redhat/Makefile.common | 2 +- redhat/genspec.sh | 2 +- redhat/kernel.spec.template | 2 +- redhat/scripts/new_release.sh | 12 ++++++------ 8 files changed, 30 insertions(+), 31 deletions(-) rename Makefile.rhelver => Makefile.dist (78%) delete mode 100644 makefile
diff --git a/Makefile b/Makefile index f3d1dd649d9b..c9a0d4f20808 100644 --- a/Makefile +++ b/Makefile @@ -18,10 +18,6 @@ $(if $(filter __%, $(MAKECMDGOALS)), \ PHONY := __all __all:
-# Set RHEL variables -# Use this spot to avoid future merge conflicts -include Makefile.rhelver - # We are using a recursive build, so we need to do a little thinking # to get the ordering right. # @@ -273,6 +269,8 @@ no-sync-config-targets := $(no-dot-config-targets) install %install \ kernelrelease single-targets := %.a %.i %.ko %.lds %.ll %.lst %.mod %.o %.s %.symtypes %/
+-include Makefile.dist + config-build := mixed-build := need-config := 1 diff --git a/Makefile.rhelver b/Makefile.dist similarity index 78% rename from Makefile.rhelver rename to Makefile.dist index 8fceabade7c8..1b3b3ca89bf3 100644 --- a/Makefile.rhelver +++ b/Makefile.dist @@ -43,3 +43,20 @@ ifneq ("$(ZSTREAM)", "yes") RHEL_RELEASE:=$(RHEL_RELEASE).$(EARLY_YRELEASE) endif endif + +no-dot-config-targets += dist-% distg-% + +ifneq ($(filter dist-% distg-%,$(MAKECMDGOALS)),) +_OUTPUT := "." +# this section is needed in order to make O= to work +ifeq ("$(origin O)", "command line") + _OUTPUT := "$(abspath $(O))" + _EXTRA_ARGS := O=$(_OUTPUT) +endif +endif + +dist-%:: + $(MAKE) -C redhat $(@) $(_EXTRA_ARGS) + +distg-%:: + $(MAKE) -C redhat $(@) $(_EXTRA_ARGS) diff --git a/makefile b/makefile deleted file mode 100644 index 819ac9a5cd60..000000000000 --- a/makefile +++ /dev/null @@ -1,16 +0,0 @@ -ifeq ($(filter dist-% distg-%,$(MAKECMDGOALS)),) - include Makefile -endif - -_OUTPUT := "." -# this section is needed in order to make O= to work -ifeq ("$(origin O)", "command line") - _OUTPUT := "$(abspath $(O))" - _EXTRA_ARGS := O=$(_OUTPUT) -endif -dist-%:: - $(MAKE) -C redhat $(@) $(_EXTRA_ARGS) - -distg-%:: - $(MAKE) -C redhat $(@) $(_EXTRA_ARGS) - diff --git a/redhat/Makefile b/redhat/Makefile index 61dcc522fbc6..8c6a3a510768 100644 --- a/redhat/Makefile +++ b/redhat/Makefile @@ -256,7 +256,7 @@ sources-rh: $(TARBALL) configs/process_configs.sh \ parallel_xz.sh \ generate_bls_conf.sh \ - ../Makefile.rhelver \ + ../Makefile.dist \ README.rst \ $(SOURCES)/ @for KABIARCH in $(ARCH_LIST); do \ @@ -308,7 +308,7 @@ dist-release-finish: setup-source @git add $(REDHAT)/$(CHANGELOG) @echo $(MARKER) > $(REDHAT)/marker @git add $(REDHAT)/marker - @git commit -s ../Makefile.rhelver $(REDHAT)/marker $(REDHAT)/$(CHANGELOG) $(PACKAGE_NAME).spec.template -m "[redhat] $(PACKAGE_NAME)-$(STAMP_VERSION)-$(PREBUILD)$(BUILD)$(BUILDID)" + @git commit -s ../Makefile.dist $(REDHAT)/marker $(REDHAT)/$(CHANGELOG) $(PACKAGE_NAME).spec.template -m "[redhat] $(PACKAGE_NAME)-$(STAMP_VERSION)-$(PREBUILD)$(BUILD)$(BUILDID)" @$(MAKE) dist-configs @$(MAKE) dist-kabi @$(MAKE) dist-kabi-dup diff --git a/redhat/Makefile.common b/redhat/Makefile.common index 6d048415ba6d..d4e68369fb05 100644 --- a/redhat/Makefile.common +++ b/redhat/Makefile.common @@ -1,6 +1,6 @@ TOPDIR:=$(shell git rev-parse --show-toplevel) REDHAT:=$(TOPDIR)/redhat -include $(TOPDIR)/Makefile.rhelver +include $(TOPDIR)/Makefile.dist
RPMBUILD := $(shell if [ -x "/usr/bin/rpmbuild" ]; then echo rpmbuild; \ else echo rpm; fi) diff --git a/redhat/genspec.sh b/redhat/genspec.sh index b72dffe14729..1cd9095a69ea 100755 --- a/redhat/genspec.sh +++ b/redhat/genspec.sh @@ -253,7 +253,7 @@ if [ "$SINGLE_TARBALL" = 0 ]; then ":(exclude,top).gitignore" \ ":(exclude,top).gitlab-ci.yml" \ ":(exclude,top)makefile" \ - ":(exclude,top)Makefile.rhelver" \ + ":(exclude,top)Makefile.dist" \ ":(exclude,top)redhat") for c in $COMMITS; do patch=$(git format-patch --zero-commit -1 "$c") diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template index d47c9cce8a0e..93fa8c2985b1 100644 --- a/redhat/kernel.spec.template +++ b/redhat/kernel.spec.template @@ -569,7 +569,7 @@ BuildRequires: asciidoc # xzcat -qq ${TARBALL} | git get-tar-commit-id Source0: linux-%%TARBALL_VERSION%%.tar.xz
-Source1: Makefile.rhelver +Source1: Makefile.dist
# Name of the packaged file containing signing key diff --git a/redhat/scripts/new_release.sh b/redhat/scripts/new_release.sh index 1e4c7bb1dc86..f1025f458d04 100755 --- a/redhat/scripts/new_release.sh +++ b/redhat/scripts/new_release.sh @@ -13,7 +13,7 @@ if [ -s "$RHPATH/linux-kernel-test.patch" ]; then exit 1; fi
-RELEASE=$(sed -n -e 's/^RHEL_RELEASE\ =\ (.*)/\1/p' $RHPATH/../Makefile.rhelver) +RELEASE=$(sed -n -e 's/^RHEL_RELEASE\ =\ (.*)/\1/p' $RHPATH/../Makefile.dist)
YVER=$(echo $RELEASE | cut -d "." -f 1) YVER=${YVER:=$RELEASE} @@ -26,15 +26,15 @@ if [ "$ZSTREAM_FLAG" == "no" ]; then if [ "$YSTREAM_FLAG" == "yes" ]; then NEW_RELEASE="$[RELEASE + 1]"; else - EARLY_YBUILD=$(sed -n -e 's/^EARLY_YBUILD:=(.*)/\1/p' $RHPATH/../Makefile.rhelver); - EARLY_YRELEASE=$(sed -n -e 's/^EARLY_YRELEASE:=(.*)/\1/p' $RHPATH/../Makefile.rhelver); + EARLY_YBUILD=$(sed -n -e 's/^EARLY_YBUILD:=(.*)/\1/p' $RHPATH/../Makefile.dist); + EARLY_YRELEASE=$(sed -n -e 's/^EARLY_YRELEASE:=(.*)/\1/p' $RHPATH/../Makefile.dist); if [ "$EARLY_YBUILD" != "$RELEASE" ]; then NEW_EARLY_YRELEASE=1; else NEW_EARLY_YRELEASE="$[EARLY_YRELEASE + 1]"; fi - sed -i -e "s/^EARLY_YBUILD:=$EARLY_YBUILD/EARLY_YBUILD:=$RELEASE/" $RHPATH/../Makefile.rhelver; - sed -i -e "s/^EARLY_YRELEASE:=$EARLY_YRELEASE/EARLY_YRELEASE:=$NEW_EARLY_YRELEASE/" $RHPATH/../Makefile.rhelver; + sed -i -e "s/^EARLY_YBUILD:=$EARLY_YBUILD/EARLY_YBUILD:=$RELEASE/" $RHPATH/../Makefile.dist; + sed -i -e "s/^EARLY_YRELEASE:=$EARLY_YRELEASE/EARLY_YRELEASE:=$NEW_EARLY_YRELEASE/" $RHPATH/../Makefile.dist; NEW_RELEASE=$RELEASE; fi elif [ "$ZSTREAM_FLAG" == "yes" ]; then @@ -46,5 +46,5 @@ else exit 1; fi
-sed -i -e "s/RHEL_RELEASE\ =.*/RHEL_RELEASE\ =\ $NEW_RELEASE/" $RHPATH/../Makefile.rhelver; +sed -i -e "s/RHEL_RELEASE\ =.*/RHEL_RELEASE\ =\ $NEW_RELEASE/" $RHPATH/../Makefile.dist;
On Sun, Aug 23, 2020 at 12:25:17PM -0000, GitLab Bridge on behalf of prarit wrote:
diff --git a/Makefile.rhelver b/Makefile.dist similarity index 78% rename from Makefile.rhelver rename to Makefile.dist index 8fceabade7c8..1b3b3ca89bf3 100644 --- a/Makefile.rhelver +++ b/Makefile.dist @@ -43,3 +43,20 @@ ifneq ("$(ZSTREAM)", "yes") RHEL_RELEASE:=$(RHEL_RELEASE).$(EARLY_YRELEASE) endif endif
+no-dot-config-targets += dist-% distg-%
+ifneq ($(filter dist-% distg-%,$(MAKECMDGOALS)),) +_OUTPUT := "." +# this section is needed in order to make O= to work +ifeq ("$(origin O)", "command line")
- _OUTPUT := "$(abspath $(O))"
- _EXTRA_ARGS := O=$(_OUTPUT)
+endif +endif
We can fix this later, but I believe the above filter can be removed now that we are processing the whole top-level Makefile instead of skipping it like before.
/me goes to test that theory with:
make mrproper # clean things up mkdir output make O=output dist-configs
Ok, so that fails. Before your change it works.
So I was right about the above code as being redundant as it now adds an extra '/output' to a path with '/output' already in there. That is the first problem. We can remove that hunk.
The second problem is, it enters <path>/output and can't find the redhat/ area (which is obviously not there). Soo...
+dist-%::
- $(MAKE) -C redhat $(@) $(_EXTRA_ARGS)
+distg-%::
- $(MAKE) -C redhat $(@) $(_EXTRA_ARGS)
adding $(srctree) above "make -C $(srctree)/redhat ..." makes things better.
but that leads to a third problem. When you 'cd configs' to run process_configs.sh, it barfs because it can't ../scripts/mkmakefile (as part of the 'make oldefconfig' command in that script).
I tried adding a 'make -f ../${srctree}/Makefile olddefconfig' mimicing other script behaviours, but to no avail.
At this point I give up and have to move on to other things.
I hate to nack this but it is an unforseen regression. Sorry I didn't catch this sooner.
I am scratching my head how all this was working originally before your change. Maybe the O= path needs to be updated to add a layer of '../' in front to handle the cd into configs.
Ok, it seems like process_configs.sh 'switch_to_toplevel' was causing some issues. I changed it to it stopped inside the redhat/, thinking the srctree and objtree vars would work correctly.
Now 'make O=output dist-configs' _completes_, but it thinks redhat/ is the output area and overwrites redhat/Makefile with the dummy Makefile that belongs on output.
Alright, I have spent waaay to much time on this...
Here is my current patch on top of yours on where I am.
Again a simple:
make mrproper mkdir output make O=output dist-configs
will duplicate everything I see.
Cheers, Don
diff --git a/Makefile.dist b/Makefile.dist index 1b3b3ca89bf3..30caa1921a1d 100644 --- a/Makefile.dist +++ b/Makefile.dist @@ -46,17 +46,8 @@ endif
no-dot-config-targets += dist-% distg-%
-ifneq ($(filter dist-% distg-%,$(MAKECMDGOALS)),) -_OUTPUT := "." -# this section is needed in order to make O= to work -ifeq ("$(origin O)", "command line") - _OUTPUT := "$(abspath $(O))" - _EXTRA_ARGS := O=$(_OUTPUT) -endif -endif - dist-%:: - $(MAKE) -C redhat $(@) $(_EXTRA_ARGS) + $(MAKE) -C $(srctree)/redhat $(@) $(_EXTRA_ARGS)
distg-%:: - $(MAKE) -C redhat $(@) $(_EXTRA_ARGS) + $(MAKE) -C $(srctree)/redhat $(@) $(_EXTRA_ARGS) diff --git a/redhat/configs/process_configs.sh b/redhat/configs/process_configs.sh index 14773fef2410..43efbe8ca565 100755 --- a/redhat/configs/process_configs.sh +++ b/redhat/configs/process_configs.sh @@ -30,8 +30,7 @@ switch_to_toplevel() path="$(pwd)" while test -n "$path" do - test -e $path/MAINTAINERS && \ - test -d $path/drivers && \ + test -e $path/Makefile.cross && \ break
path="$(dirname $path)" @@ -203,9 +202,10 @@ function process_configs() # This arch is intentionally left blank continue fi + echo "Inside $(pwd)" echo -n "Processing $cfg ... "
- make ARCH=$arch KCONFIG_CONFIG=$cfgorig listnewconfig >& .listnewconfig + make -C ${srctree} ARCH=$arch KCONFIG_CONFIG=$cfgorig listnewconfig >& .listnewconfig grep -E 'CONFIG_' .listnewconfig > .newoptions if test -n "$NEWOPTIONS" && test -s .newoptions then @@ -230,7 +230,7 @@ function process_configs()
rm .listnewconfig
- make ARCH=$arch KCONFIG_CONFIG=$cfgorig olddefconfig > /dev/null || exit 1 + make -C ${srctree} ARCH=$arch KCONFIG_CONFIG=$cfgorig olddefconfig > /dev/null || exit 1 echo "# $arch" > ${cfgtmp} cat "${cfgorig}" >> ${cfgtmp} if test -n "$CHECKOPTIONS" diff --git a/scripts/mkmakefile b/scripts/mkmakefile index 1cb174751429..6689ed1f6331 100755 --- a/scripts/mkmakefile +++ b/scripts/mkmakefile @@ -7,6 +7,7 @@ # Usage # $1 - Kernel src directory
+echo "mkmakefile: $(pwd)" > /tmp/don.script if [ "${quiet}" != "silent_" ]; then echo " GEN Makefile" fi
On 8/24/20 11:52 AM, Don Zickus wrote:
make mrproper mkdir output make O=output dist-configs
Here's a simpler case:
make dist-config *works*.
However, make dist-configs-arch fails with
make[2]: *** redhat: No such file or directory. Stop. make[1]: *** [/home/prarit/git-kernel/kernel-ark/Makefile.dist:59: dist-configs-arch] Error 2 make: *** [Makefile.dist:59: dist-configs-arch] Error 2
What is interesting is if I do directly call the Makefile code for the dist-configs target, then 'make dist-configs-arch' magically *works*.
diff --git a/redhat/Makefile b/redhat/Makefile index 8c6a3a510768..2d1626920d08 100644 --- a/redhat/Makefile +++ b/redhat/Makefile @@ -154,7 +154,9 @@ dist-configs-prep: dist-clean-configs cd $(REDHAT)/configs; TARGET=$(DIST_TARGET) ./build_configs.sh $(PACKAGE_NAME) $(ARCH_MACH)
dist-configs-arch: ARCH_MACH = $(MACH) -dist-configs-arch: dist-configs +dist-configs-arch: dist-configs-prep + @cd $(REDHAT)/configs; VERSION=$(KVERSION) ./generate_all_configs.sh rhel 1; \ + ./process_configs.sh $(PROCESS_CONFIGS_OPTS) $(PACKAGE_NAME) $(KVERSION)
dist-clean-configs: cd $(REDHAT)/configs; rm -f kernel-*.config \
I suspect there is some subtlety around setting variables or something that is causing this problem.
P.
On Tue, Aug 25, 2020 at 09:51:17AM -0400, Prarit Bhargava wrote:
On 8/24/20 11:52 AM, Don Zickus wrote:
make mrproper mkdir output make O=output dist-configs
Here's a simpler case:
make dist-config *works*.
However, make dist-configs-arch fails with
Apply my patch and see if that resolves it.
make[2]: *** redhat: No such file or directory. Stop.
I suspect adding '$(srctree/redhat' to Makefile.dist will address the above problem.
Cheers, Don
make[1]: *** [/home/prarit/git-kernel/kernel-ark/Makefile.dist:59: dist-configs-arch] Error 2 make: *** [Makefile.dist:59: dist-configs-arch] Error 2
What is interesting is if I do directly call the Makefile code for the dist-configs target, then 'make dist-configs-arch' magically *works*.
diff --git a/redhat/Makefile b/redhat/Makefile index 8c6a3a510768..2d1626920d08 100644 --- a/redhat/Makefile +++ b/redhat/Makefile @@ -154,7 +154,9 @@ dist-configs-prep: dist-clean-configs cd $(REDHAT)/configs; TARGET=$(DIST_TARGET) ./build_configs.sh $(PACKAGE_NAME) $(ARCH_MACH)
dist-configs-arch: ARCH_MACH = $(MACH) -dist-configs-arch: dist-configs +dist-configs-arch: dist-configs-prep
@cd $(REDHAT)/configs; VERSION=$(KVERSION) ./generate_all_configs.shrhel 1; \
./process_configs.sh $(PROCESS_CONFIGS_OPTS) $(PACKAGE_NAME) $(KVERSION)dist-clean-configs: cd $(REDHAT)/configs; rm -f kernel-*.config \
I suspect there is some subtlety around setting variables or something that is causing this problem.
P. _______________________________________________ kernel mailing list -- kernel@lists.fedoraproject.org To unsubscribe send an email to kernel-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
From: Don Zickus on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/601#note_53515362...
@prarit - what to do here? should we close this and revisit later? Or move it back to WIP? I am trying to clear out backlog MRs.
kernel@lists.fedoraproject.org