View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001215 | channel: kernel/el8 | kernel-ml | public | 2022-03-29 16:13 | 2022-04-08 18:02 |
Reporter | akrherz | Assigned To | toracat | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | open | ||
Summary | 0001215: Fail to build dkms ZFS 2.1.4 on kernel-ml 5.17.0 due to Makefile bug? | ||||
Description | It is unclear to me where the exact issue here, but to cross reference my ZFS bug report https://github.com/openzfs/zfs/issues/13253 running dkms install -m zfs -v 2.1.4 -k 5.17.0-1.el8.elrepo.x86_64 results in: checking whether modules can be built... no configure: error: *** Unable to build an empty module. $ cat /var/lib/dkms/zfs/2.1.4/build/build/conftest/build.log make: Entering directory '/usr/src/kernels/5.17.0-1.el8.elrepo.x86_64' /bin/sh: -c: line 0: syntax error near unexpected token `(' /bin/sh: -c: line 0: `if [ "gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-10)" != ""gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-4)"" ]; then \' make: *** [Makefile:1717: prepare] Error 1 make: Target 'modules' not remade because of errors. make: Leaving directory '/usr/src/kernels/5.17.0-1.el8.elrepo.x86_64' So I needed to do the following patch to the /usr/src/kernels/5.17.0-1.el8.elrepo.x86_64/Makefile file --- a/Makefile +++ b/Makefile @@ -1714,9 +1714,9 @@ PHONY += prepare # now expand this into a simple variable to reduce the cost of shell evaluations prepare: CC_VERSION_TEXT := $(CC_VERSION_TEXT) prepare: - @if [ "$(CC_VERSION_TEXT)" != "$(CONFIG_CC_VERSION_TEXT)" ]; then \ + @if [ "$(CC_VERSION_TEXT)" != $(CONFIG_CC_VERSION_TEXT) ]; then \ echo >&2 "warning: the compiler differs from the one used to build the kernel"; \ - echo >&2 " The kernel was built by: $(CONFIG_CC_VERSION_TEXT)"; \ + echo >&2 " The kernel was built by: "$(CONFIG_CC_VERSION_TEXT); \ echo >&2 " You are using: $(CC_VERSION_TEXT)"; \ fi | ||||
Steps To Reproduce | 1. Install kernel-ml-devel-5.17.0-1 2. Attempt to dkms build ZFS via `dkms install -m zfs -v 2.1.4 -k 5.17.0-1.el8.elrepo.x86_64` | ||||
Additional Information | https://github.com/openzfs/zfs/issues/13253#issuecomment-1079742807 comment mentions commit 129ab0d2d9f38b9d43df35235fc66c6740d6928b Author: Masahiro Yamada <masahiroy@kernel.org> Date: Tue Dec 14 11:53:53 2021 +0900 kbuild: do not quote string values in include/config/auto.conf The previous commit fixed up all shell scripts to not include include/config/auto.conf. Now that include/config/auto.conf is only included by Makefiles, we can change it into a more Make-friendly form. Previously, Kconfig output string values enclosed with double-quotes (both in the .config and include/config/auto.conf): CONFIG_X="foo bar" Unlike shell, Make handles double-quotes (and single-quotes as well) verbatim. We must rip them off when used. | ||||
Tags | No tags attached. | ||||
|
Because CONFIG_CC_VERSION_TEXT isn't being expanded like CC_VERSION_TEXT, it is being double quoted and the test fails. @akrherz We build the source code as provided by kernel.org without any modification. A bug like this needs to be reported upstream at bugzilla.kernel.org. Your patch looks good to me. |
|
@akrherz Actually someone has already reported the bug with a patch that is basically the same as yours: https://lkml.org/lkml/2022/3/7/1896 The author of the original patch did not pick it up, so I added a note there. |
|
It is because ELrepo creates the kernel-devel package in a wrong way. You copied the .config to include/config/auto.conf $ cd /usr/src/kernels/5.17.0-1.el8.elrepo.x86_64/ && diff .config include/config/auto.conf Please do not do this. If you build the kernel normally, you will get the correct auto.conf |
|
This is the part of the kernel spec file that is relevant to the current issue: # Copy .config to include/config/auto.conf so "make prepare" is unnecessary. cp $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/.config $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include/config/auto.conf It originally came from RHEL's kernel.spec file we closely follow. While commit 129ab0d2d9f3 ("kbuild: do not quote string values in include/config/auto.conf") did not affect RHEL kernels because their version stays < 5.17, our kernel-ml needed adjustments when it was updated to 5.17. This is what Fedora has done as of kernel 5.17: https://www.spinics.net/linux/fedora/fedora-kernel/msg13900.html @akrherz Will you be able to test when we have an updated version of kernel-ml ready? |
|
@toracat, certainly. Thank you! |
|
@akrherz The updated set of kernel-ml is ready for you to test. It is in: https://elrepo.org/people/ajb/devel/kernel-ml/el8/x86_64/RPMS/ bpftool-5.17.1-2.el8.elrepo.bcat1.x86_64.rpm kernel-ml-5.17.1-2.el8.elrepo.bcat1.nosrc.rpm kernel-ml-5.17.1-2.el8.elrepo.bcat1.x86_64.rpm kernel-ml-core-5.17.1-2.el8.elrepo.bcat1.x86_64.rpm kernel-ml-devel-5.17.1-2.el8.elrepo.bcat1.x86_64.rpm kernel-ml-doc-5.17.1-2.el8.elrepo.bcat1.noarch.rpm kernel-ml-headers-5.17.1-2.el8.elrepo.bcat1.x86_64.rpm kernel-ml-modules-5.17.1-2.el8.elrepo.bcat1.x86_64.rpm kernel-ml-modules-extra-5.17.1-2.el8.elrepo.bcat1.x86_64.rpm kernel-ml-tools-5.17.1-2.el8.elrepo.bcat1.x86_64.rpm kernel-ml-tools-libs-5.17.1-2.el8.elrepo.bcat1.x86_64.rpm kernel-ml-tools-libs-devel-5.17.1-2.el8.elrepo.bcat1.x86_64.rpm perf-5.17.1-2.el8.elrepo.bcat1.x86_64.rpm python3-perf-5.17.1-2.el8.elrepo.bcat1.x86_64.rpm We'd appreciate your feedback. |
|
@toracat Awesome, thanks. I was able to install and dkms autobuilt ZFS without any known issues / manual patching. I am not able to reboot today to test the kernel / zfs module, but I see no reason to believe it would not be working. |
|
@akrherz That's great news. Thank you for reporting back. |
|
With the release of the kernel-ml-5.17.2-1.el8.elrepo set, this bug has been resolved. |
Date Modified | Username | Field | Change |
---|---|---|---|
2022-03-29 16:13 | akrherz | New Issue | |
2022-03-29 16:13 | akrherz | Status | new => assigned |
2022-03-29 16:13 | akrherz | Assigned To | => burakkucat |
2022-04-03 03:58 | toracat | Relationship added | related to 0001214 |
2022-04-03 04:19 | toracat | Note Added: 0008295 | |
2022-04-03 11:51 | toracat | Note Added: 0008297 | |
2022-04-03 12:45 | toracat | Assigned To | burakkucat => toracat |
2022-04-03 12:45 | toracat | Status | assigned => confirmed |
2022-04-04 07:01 | Masahiro Yamada | Note Added: 0008300 | |
2022-04-05 12:50 | toracat | Note Added: 0008317 | |
2022-04-05 12:52 | akrherz | Note Added: 0008318 | |
2022-04-05 14:13 | toracat | Note Added: 0008320 | |
2022-04-05 14:22 | burakkucat | Status | confirmed => feedback |
2022-04-05 14:24 | akrherz | Note Added: 0008322 | |
2022-04-05 14:24 | akrherz | Status | feedback => assigned |
2022-04-05 14:44 | toracat | Note Added: 0008323 | |
2022-04-08 18:02 | toracat | Status | assigned => resolved |
2022-04-08 18:02 | toracat | Note Added: 0008327 |