From: Don Zickus <dzickus(a)redhat.com>
Add wildcard macros -baseonly -gcov
There are multiple usecases for -baseonly and -gcov on various
targets in the Makefile. Instead of calling those targets out
repeatedly, lets generalize them a bit.
Allow adding -baseonly and -gcov to:
dist-rpm
dist-srpm
dist-brew
dist-koji
distg-brew
distg-koji
Gcov is useful for adding code coverage. Baseonly is useful to only
build the kernel for debugging purposes without userspace tools.
Signed-off-by: Don Zickus <dzickus(a)redhat.com>
diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -297,6 +297,12 @@ dist-sources: dist-kabi dist-kabi-dup sources-rh
dist-test-patch: generate-testpatch-tmp
@mv $(TESTPATCH).tmp $(TESTPATCH);
+%-baseonly: RPMBUILDOPTS=--target $(MACH) --without debug --without debuginfo --without vdso_install --without bpftool --without perf --without tools --without selftests -bb
+%-baseonly: BUILDOPTS+=-debug -debuginfo -vdso_install -bpftool -perf -tools -selftests
+
+%-gcov: BUILDID=".gcov"
+%-gcov: BUILDOPTS+="+gcov"
+
do-rpmbuild: dist-sources
$(RPMBUILD) --define "_sourcedir $(SOURCES)" --define "_builddir $(RPM)/BUILD" --define "_srcrpmdir $(RPM)/SRPMS" --define "_rpmdir $(RPM)/RPMS" --define "_specdir $(RPM)/SPECS" --define "dist $(DIST)" $(RPMBUILDOPTS) $(RPM)/SOURCES/$(PACKAGE_NAME).spec
@@ -306,9 +312,9 @@ dist-all-rpms: dist-sources do-rpmbuild
dist-srpm: RPMBUILDOPTS=--nodeps -bs
dist-srpm: dist-sources do-rpmbuild
-dist-srpm-gcov: BUILDID=".gcov"
-dist-srpm-gcov: BUILDOPTS+="+gcov"
-dist-srpm-gcov: dist-srpm
+dist-srpm-%: dist-srpm
+ @# phony command to force this to be a target and not variable
+ @FOO=BAR
dist-rpms: RPMBUILDOPTS=--target $(MACH) -bb
dist-rpms: dist-sources do-rpmbuild
@@ -322,8 +328,7 @@ dist-prep: dist-sources do-rpmbuild
dist-perf: RPMBUILDOPTS=--without up --without smp --without zfcpdump --without debug --without doc --without headers --without --without doc --without debuginfo --target $(MACH) -bb
dist-perf: dist-sources do-rpmbuild
-dist-rpm-baseonly: RPMBUILDOPTS=--target $(MACH) --without debug --without debuginfo --without vdso_install --without bpftool --without perf --without tools -bb
-dist-rpm-baseonly: dist-sources do-rpmbuild
+dist-rpm-%: dist-sources do-rpmbuild
# unless you know what you're doing, you don't want to use the next four ones
dist-release-finish: setup-source
@@ -388,9 +393,25 @@ distg-koji: BUILD_FLAGS ?= $(KOJI_FLAGS) $(TEST_FLAGS)
dist-brew dist-koji: dist-%: dist-srpm
$* $(BUILD_PROFILE) build $(BUILD_FLAGS) $(BUILD_TARGET) $(SRPMS)/$(PACKAGE_NAME)-$(KVERSION)-$(PKGRELEASE)$(DIST).src.rpm $(OUTPUT_FILE)
+dist-brew-%: dist-brew
+ @# phony command to force this to be a target and not variable
+ @FOO=BAR
+
+dist-koji-%: dist-koji
+ @# phony command to force this to be a target and not variable
+ @FOO=BAR
+
distg-brew distg-koji: distg-%:
$* $(BUILD_PROFILE) build $(BUILD_FLAGS) $(BUILD_TARGET) "$(RHGITURL)?redhat/koji#$(RHGITCOMMIT)"
+distg-brew-%: dist-brew
+ @# phony command to force this to be a target and not variable
+ @FOO=BAR
+
+distg-koji-%: dist-koji
+ @# phony command to force this to be a target and not variable
+ @FOO=BAR
+
.PHONY: $(REDHAT)/rpm/SOURCES/$(PACKAGE_NAME).spec
$(REDHAT)/rpm/SOURCES/$(PACKAGE_NAME).spec:
@echo "dist-sources"
@@ -469,34 +490,30 @@ dist-full-help:
@echo 'Building targets:'
@echo ' All RPM/SRPM files will be put under the redhat/rpm/ directory.'
@echo ''
- @echo ' dist-srpm - Create a source RPM and put it into the redhat/rpm/SRPMS/'
+ @echo ' dist-srpm@ - Create a source RPM and put it into the redhat/rpm/SRPMS/'
@echo ' directory. See the dist-brew target for available options.'
- @echo ' dist-srpm-gcov - Create a source RPM with gcov enabled and put it into the'
- @echo ' redhat/rpm/SRPMS/ directory.'
- @echo ' dist-brew - Create a kernel SRPM and then call brew to build the'
+ @echo ' dist-brew@ - Create a kernel SRPM and then call brew to build the'
@echo ' created SRPM. Add BUILDOPTS="+<opt> -<opt> [...]" to'
@echo ' enable/disable build options.'
@echo ' Available <opt>s and their default values:' \
$$(sed -n -e 's/^%define with_\([^ \t]*\).*\?_without_.*/+\1/p' \
-e 's/^%define with_\([^ \t]*\).*\?_with_.*/-\1/p' kernel.spec.template | \
grep -v 'only$$') | fmt -80
- @echo ' dist-koji - Create a kernel SRPM and then call koji to build the'
+ @echo ' dist-koji@ - Create a kernel SRPM and then call koji to build the'
@echo ' created SRPM. See the dist-brew target for available'
@echo ' options.'
- @echo ' distg-brew - Pass HEAD of the current git branch to brew to build an'
+ @echo ' distg-brew@ - Pass HEAD of the current git branch to brew to build an'
@echo ' RPM set. Do not forget to push to the remote repository'
@echo ' first. Preceed make command by RHGITCOMMIT=<commitID>'
@echo ' specify commit ID to use.'
@echo ' To set the remote repo, invoke:'
@echo ' git config rhg.url git://<repo_path>'
- @echo ' distg-koji - Pass HEAD of the current git branch to koji to build an'
+ @echo ' distg-koji@ - Pass HEAD of the current git branch to koji to build an'
@echo ' RPM set. Do not forget to push to the remote repository'
@echo ' first. See the distg-brew target for options and'
@echo ' configuration.'
- @echo ' dist-rpms - Create the binary RPMS for the kernel.'
+ @echo ' dist-rpms@ - Create the binary RPMS for the kernel.'
@echo ' See the dist-brew target for available options.'
- @echo ' dist-rpm-baseonly - Create the binary RPMS for the kernel and modules'
- @echo ' (no userspace tools or debuginfo).'
@echo ' dist-kernel-<type> - Create binary RPMS for a particular kernel type.'
@echo ' Available <type>s:'\
$$(sed -n 's/^%define with_\([^ ]*only\).*/\1/p' kernel.spec.template)
@@ -524,6 +541,12 @@ dist-full-help:
@echo ' dist-rhel-configs - build ELN configs'
@echo ' dist-fedora-configs - build Fedora configs'
+ @echo ''
+ @echo 'Wildcard targets: [indicated by '@' above]'
+ @echo ' *-baseonly - builds only the kernel (disables userspace and debuginfo)'
+ @echo ' - Examples: dist-srpm-baseonly, dist-brew-baseonly'
+ @echo ' *-gcov - builds a kernel with gcov enabled'
+ @echo ' - Examples: dist-srpm-gcov, dist-brew-gcov'
@echo ''
@echo 'kABI targets:'
@echo ' dist-kabi - Create kABI stablelist files in redhat/kabi/kabi-rhel*/'
--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1444
From: Jan Stancek <jstancek(a)redhat.com>
redhat/configs/evaluate_configs: walk cfgvariants line by line
get_subdirs() code suggests it should walk cfgvariants line by line,
but with quotes it passes everything to inner loop.
Signed-off-by: Jan Stancek <jstancek(a)redhat.com>
diff --git a/redhat/configs/evaluate_configs b/redhat/configs/evaluate_configs
index blahblah..blahblah 100755
--- a/redhat/configs/evaluate_configs
+++ b/redhat/configs/evaluate_configs
@@ -125,7 +125,7 @@ get_subdirs() { # uses $cfgvariants and $toplevels
do
max=0
count=0
- OLDIFS=$IFS; IFS=$'\n'; for LINE in "$cfgvariants"
+ OLDIFS=$IFS; IFS=$'\n'; for LINE in $cfgvariants
do
LINE=$(echo "$LINE" | cut -d "|" -f 2)
count=0
--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1436
From: Jan Stancek <jstancek(a)redhat.com>
redhat/configs/evaluate_configs: insert EMPTY tags at correct place
evaluate_configs currently inserts empty tags always at the end
of cfgvariants line, which breaks the table if a new variant
is introduced (which is not a super-set of debug variant).
Let's walk cfgvariants to discover all toplevel directories
and give each an ordering number. Then during addition of EMPTY
tags walk through existing tags and compare ordering number of
toplevel portion of each tag. This number determines where
to insert new tag.
Signed-off-by: Jan Stancek <jstancek(a)redhat.com>
diff --git a/redhat/configs/evaluate_configs b/redhat/configs/evaluate_configs
index blahblah..blahblah 100755
--- a/redhat/configs/evaluate_configs
+++ b/redhat/configs/evaluate_configs
@@ -25,6 +25,7 @@ numorder=
longheader=
weightorig=
weight=
+declare -A toplevel_order
tempdir=$(mktemp -d)
@@ -141,9 +142,35 @@ get_subdirs() { # uses $cfgvariants and $toplevels
done
}
+# Walk through cfgvariants and give each toplevel dir an ordering number.
+# This number is later used to insert EMPTY tags at correct place.
+create_toplevel_order() { # uses toplevel_order
+
+while read -r cfgvariant
+do
+ local i
+ local max
+ local order
+ local topname
+
+ LINE=$(echo "$cfgvariant" | cut -d "|" -f 2)
+
+ for i in $LINE; do
+ topname="${i%%-*}"
+ order=${toplevel_order[$topname]}
+ if [ -z "$order" ]; then
+ max=$(echo "${toplevel_order[@]}" | wc -w)
+ max=$((max + 1))
+ toplevel_order[$topname]=$max
+ $DEBUG && echo "toplevel_order[$topname] = $max"
+ fi
+ done
+done <<< "$cfgvariants"
+}
+
# For each config-variant, find missing sub-directories and mark them as "EMPTY"
# This is very helpful for stage 3.
-fix_config_variants() { # uses $toplevels, $subdirs, $cfgvariants
+fix_config_variants() { # uses $toplevels, $subdirs, $cfgvariants, $toplevel_order
for toplevel in $toplevels
do
@@ -157,6 +184,8 @@ do
local found
local dashcount
local new
+ local topname
+ local new_topname
subdircnt=$(echo "$subdirs" | grep "$toplevel" | awk -F "subdirs" ' { print $2 } ')
linenum=0
@@ -218,12 +247,25 @@ do
if echo "$LINE" | grep -q "$toplevel"; then
new=${cfgvariant//$oldentry/$newentry}
else
- # Assuming that there is always a generic entry
- # followed by a debug entry. If a debug only config
- # variant exists, there is a possibility that this
- # screws up badly because the EMPTY tags are always
- # added the end of the string. #FIXME
- new="$cfgvariant $newentry"
+ # Find out toplevel name of new EMPTY entries and use
+ # toplevel_order to figure out where to insert those.
+ found=0
+ new_topname="${newentry%%-*}"
+ new="$(echo "$cfgvariant" | cut -d "|" -f 1)|"
+ LINE=$(echo "$cfgvariant" | cut -d "|" -f 2)
+
+ for i in $LINE; do
+ topname="${i%%-*}"
+ if [ $found -eq 1 -o ${toplevel_order[$topname]} -lt ${toplevel_order[$new_topname]} ]; then
+ new="$new $i"
+ else
+ found=1
+ new="$new $newentry $i"
+ fi
+ done
+ if [ $found -eq 0 ]; then
+ new="$new $newentry"
+ fi
fi
$DEBUG && echo "REPLACED:"
@@ -818,6 +860,9 @@ subdirs=$(get_subdirs)
$DEBUG && echo "Top-level sub-directories:"
$DEBUG && echo "$subdirs"
+# Create ordering for toplevel dirs
+create_toplevel_order
+
# Add EMPTY entries for each missing subdirectory level in the config
# variants
echo "$cfgvariants" > "$tempdir"/cfgvariants
--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1437
From: Coiby Xu <coxu(a)redhat.com>
redhat/configs: enable KEXEC_SIG for aarch64 RHEL
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1994858
KEXEC_SIG needs to enabled for aarch64 so the kernel image's signature
can be verified when loading a kernel image via kexec with secureboot
enabled. Note this option has already been enabled for aarch64 Fedora.
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/redhat/configs/fedora/generic/arm/aarch64/CONFIG_KEXEC_SIG b/redhat/configs/common/generic/arm/aarch64/CONFIG_KEXEC_SIG
rename from redhat/configs/fedora/generic/arm/aarch64/CONFIG_KEXEC_SIG
rename to redhat/configs/common/generic/arm/aarch64/CONFIG_KEXEC_SIG
index blahblah..blahblah 100644
--- a/redhat/configs/fedora/generic/arm/aarch64/CONFIG_KEXEC_SIG
+++ b/redhat/configs/common/generic/arm/aarch64/CONFIG_KEXEC_SIG
--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1442
From: Joel Savitz <jsavitz(a)redhat.com>
redhat/configs: enable CONFIG_BCMGENET as module
The genet driver enables the use of ethernet on SOCs including
that of the Raspberry Pi 4B.
Upstream Status: RHEL-only
Tested: on a physical Raspberry Pi 4B
Signed-off-by: Joel Savitz <jsavitz(a)redhat.com>
diff --git a/redhat/configs/ark/generic/CONFIG_BCMGENET b/redhat/configs/ark/generic/CONFIG_BCMGENET
index blahblah..blahblah 100644
--- a/redhat/configs/ark/generic/CONFIG_BCMGENET
+++ b/redhat/configs/ark/generic/CONFIG_BCMGENET
@@ -1 +1 @@
-# CONFIG_BCMGENET is not set
+CONFIG_BCMGENET=m
--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1440