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: Sabrina Dubroca on gitlab.com
Merge Request: https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1619
This MR introduces a new kABI macro, RH_KABI_EXCLUDE_WITH_SIZE. The
implementation is identical to RH_KABI_EXTEND_WITH_SIZE, but the meaning is
more in line with RH_KABI_EXCLUDE. The size check and reserved space allows us
to exclude an element embedded inside a kABI-protected structure while
reserving space for it to grow in the future.
The size checks that are part of multiple kABI macros are currently not
enabled because the config option to turn them on is missing. Those size
checks only make sense on regular builds, so they're disabled on debug
kernels.
Signed-off-by: Sabrina Dubroca <sdubroca(a)redhat.com>
---
include/linux/rh_kabi.h | 26 ++++++++++
redhat/configs/ark/debug/CONFIG_RH_KABI_SIZE_ALIGN_CHECKS | 1 +
redhat/configs/ark/generic/CONFIG_RH_KABI_SIZE_ALIGN_CHECKS | 1 +
redhat/configs/ark/kgcov/CONFIG_RH_KABI_SIZE_ALIGN_CHECKS | 1 +
redhat/configs/common/generic/CONFIG_RH_KABI_SIZE_ALIGN_CHECKS | 1 +
Kconfig.redhat | 9 +++
6 files changed, 39 insertions(+), 0 deletions(-)
From: Don Zickus on gitlab.com
Merge Request: https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2654
Compiling for clang is getting trickier to do because the configs are
different than gcc in some cases. Mimic the kgcov framework to setup
clang to be easier to update their configs.
This framework is designed to blindly merge.py with any configs fed to
it. This is unlike the build_configs framework where it uses
priority.rhel|fedora rules to merge things.
This leads to strange cases where clang debug configs need different
settings than clang non-debug configs. For non-lto clang, due to clang
bugs it is easy to disable the debug features and get away with this.
But once resolved we will have to reinvestigate. For lto clang, I just
hack out the debug and kgcov config files due to clashing Kconfig depend
rules.
I don't expect this to be a long term solution. Perhaps when our config
rework is fully realized this just melts away. TBD.
Signed-off-by: Don Zickus <dzickus(a)redhat.com>
---
redhat/configs/common/clang/debug/CONFIG_KASAN_STACK | 1 +
redhat/configs/common/clang/debug/CONFIG_KMSAN | 1 +
redhat/configs/common/clang/generic/CONFIG_KASAN_STACK | 1 +
redhat/configs/common/clang/generic/CONFIG_KMSAN | 1 +
redhat/configs/common/clang_lto/debug/README | 0
redhat/configs/common/clang_lto/generic/arm/CONFIG_LTO_CLANG_THIN | 1 +
redhat/configs/common/clang_lto/generic/arm/CONFIG_LTO_NONE | 1 +
redhat/configs/common/clang_lto/generic/x86/CONFIG_LTO_CLANG_THIN | 1 +
redhat/configs/common/clang_lto/generic/x86/CONFIG_LTO_NONE | 1 +
redhat/configs/common/clang_lto/generic/README | 0
redhat/configs/priority.fedora | 4 -
redhat/configs/priority.rhel | 4 -
redhat/configs/priority.snip | 9 +
redhat/kernel.spec.template | 77 ++++++---
14 files changed, 70 insertions(+), 32 deletions(-)
From: CKI Gitlab on gitlab.com
Merge Request: https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2686
NOTE: Truncated patchset due to missing public @redhat.com email
address on your GitLab profile at https://gitlab.com/-/profile.
Once that is fixed, close and reopen the merge request to
retrigger sending the emails.
Hi,
As part of the ongoing rebase effort, the following configuration
options need to be reviewed.
As a reminder, the ARK configuration flow involves moving unreviewed
configuration options from the pending directory to the ark directory.
In the diff below, options are removed from the pending directory and
added to the ark hierarchy. The final options that need to be ACKed
are the files that are being added to the ark hierarchy.
If the value for a file that is added should be changed, please reply
with a better option.
Symbol: XFS_ONLINE_SCRUB_STATS [=y]
Type : bool
Defined at fs/xfs/Kconfig:146
Prompt: XFS online metadata check usage data collection
Depends on: BLOCK [=y] && XFS_ONLINE_SCRUB [=y]
Location:
-> File systems
-> XFS online metadata check support (XFS_ONLINE_SCRUB [=y])
-> XFS online metadata check usage data collection
(XFS_ONLINE_SCRUB_STATS [=y])
Selects: FS_DEBUG
---
Signed-off-by: Fedora Kernel Team <kernel-team(a)fedoraproject.org>
---
redhat/configs/pending-rhel/generic/CONFIG_XFS_ASSERT_FATAL | 13 ---------
redhat/configs/pending-rhel/generic/CONFIG_XFS_ONLINE_SCRUB_STATS | 14 ----------
redhat/configs/rhel/generic/CONFIG_XFS_ONLINE_SCRUB_STATS | 1 +
3 files changed, 1 insertions(+), 27 deletions(-)
From: Don Zickus on gitlab.com
Merge Request: https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2654
Compiling for clang is getting trickier to do because the configs are
different than gcc in some cases. Mimic the kgcov framework to setup
clang to be easier to update their configs.
This framework is designed to blindly merge.py with any configs fed to
it. This is unlike the build_configs framework where it uses
priority.rhel|fedora rules to merge things.
This leads to strange cases where clang debug configs need different
settings than clang non-debug configs. For non-lto clang, due to clang
bugs it is easy to disable the debug features and get away with this.
But once resolved we will have to reinvestigate. For lto clang, I just
hack out the debug and kgcov config files due to clashing Kconfig depend
rules.
I don't expect this to be a long term solution. Perhaps when our config
rework is fully realized this just melts away. TBD.
Signed-off-by: Don Zickus <dzickus(a)redhat.com>
---
redhat/configs/common/clang/debug/CONFIG_KASAN_STACK | 1 +
redhat/configs/common/clang/debug/CONFIG_KMSAN | 1 +
redhat/configs/common/clang/generic/CONFIG_KASAN_STACK | 1 +
redhat/configs/common/clang/generic/CONFIG_KMSAN | 1 +
redhat/configs/common/clang_lto/debug/README | 0
redhat/configs/common/clang_lto/generic/arm/CONFIG_LTO_CLANG_THIN | 1 +
redhat/configs/common/clang_lto/generic/arm/CONFIG_LTO_NONE | 1 +
redhat/configs/common/clang_lto/generic/x86/CONFIG_LTO_CLANG_THIN | 1 +
redhat/configs/common/clang_lto/generic/x86/CONFIG_LTO_NONE | 1 +
redhat/configs/common/clang_lto/generic/README | 0
redhat/configs/priority.fedora | 4 -
redhat/configs/priority.rhel | 4 -
redhat/configs/priority.snip | 9 +
redhat/kernel.spec.template | 78 ++++++---
14 files changed, 71 insertions(+), 32 deletions(-)
From: Don Zickus on gitlab.com
Merge Request: https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2732
This is an attempt to automate the rt and automotive devel branches
using the upstream linux-rt-devel tree as the base combined with
os-build.
The overall process isn't too complicated but there are enough steps to
make it compilicated.
Steps:
* map upstream linux-rt-devel to master-rt branch
* update os-build
* grab linux version from master-rt and os-build
* if version the same then merge os-build and master-rt to
os-build-rt-automated
* else merge linux-stable and master-rt to os-build-rt-automated until
master-rt is update to os-build
* merge os-build-rt-automated into os-build-rt-devel
* merge os-build-rt-automated into os-build-automotive-devel
* run the generate pending-rhel config scripts on rt-devel and
automotive-devel
The script has beginning logic to handle rebasing if necessary when the
rt-devel branch transitions from linux-stable to linux master again.
The script has no effect on the day-to-day operations of os-build. They
are designed to be run from a gitlab cron job and update in the
background. Once they are deemed stable, adding ARK MRs that target
either os-build-rt-devel or os-build-automotive-devel will be possible
and those branches can start proper parallel developement with os-build.
Signed-off-by: Don Zickus <dzickus(a)redhat.com>
---
redhat/scripts/ci/ark-ci-env.sh | 151 +++++++++++++++++++++++++++
redhat/scripts/ci/ark-merge-rt.sh | 96 +++++++++++++++++
redhat/scripts/ci/ark-update-configs.sh | 4 +-
redhat/scripts/genspec/gen_config_patches.sh | 12 +-
4 files changed, 258 insertions(+), 5 deletions(-)
From: Don Zickus <dzickus(a)redhat.com>
Add target_branch for gen_config_patches.sh
To support new config updates in other brances besides os-build, we need
to be more flexible with the staging branch. Currently new configs get
added to configs/$date/<new CONFIG>. This won't work when new branches
like os-build-rt-devel and os-build-automotive-devel get implemented as
they will have duplicate entries here and cause script problems. Add a
$branch name into the configs path to create separation.
configs/$date/<new CONFIG> -->
configs/$target_branch/$date/<new CONFIG>
This is not expected to impact anything else.
Signed-off-by: Don Zickus <dzickus(a)redhat.com>
diff --git a/redhat/scripts/ci/ark-update-configs.sh b/redhat/scripts/ci/ark-update-configs.sh
index blahblah..blahblah 100755
--- a/redhat/scripts/ci/ark-update-configs.sh
+++ b/redhat/scripts/ci/ark-update-configs.sh
@@ -73,7 +73,7 @@ new_head="$(git rev-parse HEAD)"
[ "$old_head" != "$new_head" ] && CONFIGS_ADDED="1" || CONFIGS_ADDED=""
if test "$CONFIGS_ADDED"; then
- ./redhat/scripts/genspec/gen_config_patches.sh
+ ./redhat/scripts/genspec/gen_config_patches.sh "${BRANCH}"
PUSH_VERB="Pushing"
else
printf "No new configuration values exposed from merging %s into $BRANCH\n" "$UPSTREAM_REF"
@@ -84,7 +84,7 @@ echo
PUSH_STR="branch ${BRANCH} to ${GITLAB_PROJECT_URL}"
PUSH_CMD="git push gitlab ${BRANCH}"
PUSH_CONFIG_STR="config update branches"
-PUSH_CONFIG_CMD="for branch in \$(git branch | grep configs/\"\$(date +%F)\"); do
+PUSH_CONFIG_CMD="for branch in \$(git branch | grep configs/${BRANCH}/\"\$(date +%F)\"); do
git push \\
-o merge_request.create \\
-o merge_request.target=\"$BRANCH\" \\
diff --git a/redhat/scripts/genspec/gen_config_patches.sh b/redhat/scripts/genspec/gen_config_patches.sh
index blahblah..blahblah 100755
--- a/redhat/scripts/genspec/gen_config_patches.sh
+++ b/redhat/scripts/genspec/gen_config_patches.sh
@@ -8,6 +8,10 @@
# information for the relevant maintainers using get_maintainers.pl. This
# requires that you have $RHMAINTAINERS pointing to a valid maintainer file.
+target_branch=$1
+prev_branch="$(git rev-parse --abbrev-ref HEAD)"
+git checkout "$target_branch"
+
if ! git show -s --oneline HEAD | grep -q "AUTOMATIC: New configs"; then
echo "The git HEAD doesn't look like the correct commit"
exit 1
@@ -116,12 +120,14 @@ for f in "$config_bundles_dir"/*; do
rm redhat/configs/pending-rhel/generic/"$line"
done < "$f"
# We do a separate branch per config commit
- if ! git checkout -b "configs/$(date +%F)/$_f"; then
- printf "Unable to check out configs/%s/%s branch!\n" "$(date +%F)" "$_f"
+ if ! git checkout -b "configs/$target_branch/$(date +%F)/$_f"; then
+ printf "Unable to check out configs/%s/%s/%s branch!\n" "$target_branch" "$(date +%F)" "$_f"
exit 1
fi
# One file path is done, time to commit!
git add redhat/configs
git commit -s -F "$tmpdir"/commit
- git checkout os-build
+ git checkout "$target_branch"
done
+
+git checkout "$prev_branch"
--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2731
From: Don Zickus on gitlab.com
Merge Request: https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2654
Compiling for clang is getting trickier to do because the configs are
different than gcc in some cases. Mimic the kgcov framework to setup
clang to be easier to update their configs.
This framework is designed to blindly merge.py with any configs fed to
it. This is unlike the build_configs framework where it uses
priority.rhel|fedora rules to merge things.
This leads to strange cases where clang debug configs need different
settings than clang non-debug configs. For non-lto clang, due to clang
bugs it is easy to disable the debug features and get away with this.
But once resolved we will have to reinvestigate. For lto clang, I just
hack out the debug and kgcov config files due to clashing Kconfig depend
rules.
I don't expect this to be a long term solution. Perhaps when our config
rework is fully realized this just melts away. TBD.
Signed-off-by: Don Zickus <dzickus(a)redhat.com>
---
redhat/configs/common/clang/debug/CONFIG_KASAN_STACK | 1 +
redhat/configs/common/clang/debug/CONFIG_KMSAN | 1 +
redhat/configs/common/clang/generic/CONFIG_KASAN_STACK | 1 +
redhat/configs/common/clang/generic/CONFIG_KMSAN | 1 +
redhat/configs/common/clang_lto/debug/README | 0
redhat/configs/common/clang_lto/generic/arm/CONFIG_LTO_CLANG_THIN | 1 +
redhat/configs/common/clang_lto/generic/arm/CONFIG_LTO_NONE | 1 +
redhat/configs/common/clang_lto/generic/x86/CONFIG_LTO_CLANG_THIN | 1 +
redhat/configs/common/clang_lto/generic/x86/CONFIG_LTO_NONE | 1 +
redhat/configs/common/clang_lto/generic/README | 0
redhat/configs/priority.fedora | 4 -
redhat/configs/priority.rhel | 4 -
redhat/configs/priority.snip | 9 +
redhat/kernel.spec.template | 78 ++++++---
14 files changed, 70 insertions(+), 33 deletions(-)