RemixVSL / iomemory-vsl4

Updated Fusion-io iomemory VSL4 Linux (version 4.3.7) driver for recent kernels.
55 stars 9 forks source link

DMKS make rpm boot disk fails #22

Closed snuf closed 2 years ago

snuf commented 4 years ago

Bug description

Describe the issue, or paste the full error encountered here.

How to reproduce

What are the steps to reproduce the reported issue.

1st part works flawlessly

git clone https://github.com/snuf/iomemory-vsl4 cd iomemory-vsl4/ git checkout v5.7.0 Branch 'v5.7.0' set up to track remote branch 'v5.7.0' from 'origin'. Switched to a new branch 'v5.7.0' make dkms [...] DKMS: install completed. make[1]: Leaving directory '/root/builds/iomemory-vsl4/root/usr/src/iomemory-vsl4-4.3.7'

dkms status iomemory-vsl4, v5.6.1-24-g9830822, 4.18.0-193.14.2.el8_2.x86_64, x86_64: installed

~issue fillows:

dkms mkdriverdisk -d redhat3 --media tar -m iomemory-vsl4 -v v5.6.1-24-g9830822

Using /etc/dkms/template-dkms-redhat-kmod.spec creating source tarball...iomemory-vsl4-v5.6.1-24-g9830822/ [...] iomemory-vsl4-v5.6.1-24-g9830822/include/fio/public/ iomemory-vsl4-v5.6.1-24-g9830822/include/fio/public/fioapi.h

rpmbuild...(bad exit status: 1)

Error! There was a problem creating your kmod. error: line 4: Illegal char '-' (0x2d) in: Version: v5.6.1-24-g9830822 Building target platforms: x86_64 Building for target x86_64

Possible solution

Environment information

Information about the system the module is used on 1.Linux drive3.localdomain 4.18.0-193.14.2.el8_2.x86_64 #1 SMP Sun Jul 26 03:54:29 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

  1. gcc (GCC) 8.3.1 20191121 (Red Hat 8.3.1-5)
  2. NAME="CentOS Linux" VERSION="8 (Core)" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="8" PLATFORM_ID="platform:el8" PRETTY_NAME="CentOS Linux 8 (Core)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:centos:centos:8" HOME_URL="https://www.centos.org/" BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-8" CENTOS_MANTISBT_PROJECT_VERSION="8" REDHAT_SUPPORT_PRODUCT="centos" REDHAT_SUPPORT_PRODUCT_VERSION="8"

  1. v5.7.0
  2. FIO device used, if applicable Dell ioDrive2 1205GB MLC, Product Number:DG1MH, SN:US0DG1MH760512810084 External Power: NOT connected PCIe Power limit threshold: 24.75W Connected ioMemory modules: fct0: Product Number:DG1MH,
    • lspci -b -nn 01:00.0 Mass storage controller [0180]: SanDisk ioDrive2 [1aed:2001] (rev 04)
snuf commented 4 years ago

hmm make rpm seems to work though, so it's specific to the rpmbuild done by dkms, and related to how it sets the version

Steven-Joles commented 4 years ago

when dkms generates the build initially it sets the version as " v5.6.1-24-g9830822".
In the fio-driver.spec file line 15 %define rpm_nice_kernel_version %(echo %{rpm_kernelversion} | sed -e 's/-//g') which should remove any dashes doesn't appear to be working, or at least not for the dkms build process.

Also where is it generating the tail end "g9830822" ?

snuf commented 4 years ago

@Steven-Joles so the dkms mkdeb has a similar issue, that it doesn't like the v in front of the version.

Building binary package...dpkg-buildpackage: warning: debian/changelog(l1): version 'v5.6.0-19-g67bac62' is invalid: version number does not start with digit LINE: iomemory-vsl-dkms (v5.6.0-19-g67bac62) stable; urgency=low dpkg-buildpackage: error: version number does not start with digit (bad exit status: 255)

The g9830822 is the hash your module came from, this is done in the module_operations.sh where we try to make an educated guess on which version/tag/branch you are and derive the version from that. This makes life easier when having to support people.

snuf commented 4 years ago

Also to note the dkms mkrpm just like dkms mkdeb does not use the fio-driver.spec file. It uses its own config:

snuf@hopper-one:~/Documents/Sources/iomemory-vsl$ sudo dkms mkdeb iomemory-vsl/5.6.0-19-g67bac62
**Using /etc/dkms/template-dkms-mkdeb**
copying template...
modifying debian/changelog...
modifying debian/compat...
modifying debian/control...
modifying debian/copyright...
modifying debian/dirs...
modifying debian/postinst...
modifying debian/prerm...
modifying debian/README.Debian...
modifying debian/rules...
copying legacy postinstall template...
Copying source tree...
Building binary package...dpkg-buildpackage: warning: using a gain-root-command while being root
 dpkg-source --before-build .
 fakeroot debian/rules clean
dh_clean: warning: Compatibility levels before 9 are deprecated (level 7 in use)
 debian/rules build
 fakeroot debian/rules binary
dh_installdirs: warning: Compatibility levels before 9 are deprecated (level 7 in use)
dh_strip: warning: Compatibility levels before 9 are deprecated (level 7 in use)
dh_compress: warning: Compatibility levels before 9 are deprecated (level 7 in use)
dh_installdeb: warning: Compatibility levels before 9 are deprecated (level 7 in use)
dh_shlibdeps: warning: Compatibility levels before 9 are deprecated (level 7 in use)
 dpkg-genbuildinfo --build=binary
 dpkg-genchanges --build=binary >../iomemory-vsl-dkms_5.6.0-19-g67bac62_amd64.changes
dpkg-genchanges: info: binary-only upload (no source code included)
 dpkg-source --after-build .

DKMS: mkdeb completed.
Moving built files to /var/lib/dkms/iomemory-vsl/5.6.0-19-g67bac62/deb...
Cleaning up temporary files...

On ubuntu the RPM version of that config is missing so won't allow for an RPM build, trying that on a centos8 vm atm.

snuf commented 4 years ago

A simple solution here could be to provide a spec file and mkdeb file for dkms specifically. The man page describes this here:

       mkrpm [module/module-version] [-k kernel/arch] [--source-only] [--binaries-only]

           This action allows you to create an RPM package for a specified module / version.  It uses a template .spec file found in /etc/dkms/template-dkms-mkrpm.spec as the basis for the
           RPM.   Alternatively, if DKMS finds a file called **/usr/src/<module>-<module-version>/<module>-dkms-mkrpm.spec** it will use that .spec file instead.  In general, a DKMS tarball is
           placed inside the contents of this RPM, and the RPM itself calls various DKMS commands to load this tarball, build and install modules on the end user's system.  If you  do  not
           want your RPM to contain any prebuilt binaries, be sure to specify --source-only in the mkrpm command.

       mkdeb [module/module-version] [-k kernel/arch]

           This  action  allows  you  to create a debian binary package for a specified module / version.  It uses a template debian directory found in /etc/dkms/template-dkms-mkdeb as the
           basis for the package. Alternatively, if DKMS finds a file called **/usr/src/<module>-<module-version>/<module>-dkms-mkdeb** it will use that folder instead. In general, a DKMS tar‐
           ball is placed inside the contents of this package, and the package itself calls various DKMS commands to load this tarball, build and install modules on the end user's system.
snuf commented 4 years ago

Even with modifying the module to use _ instead of - it fails with error: Arch dependent binaries in noarch package so my guess is the only option that is really feasible is to create the mkrpm.spec.

Error! DKMS tree does not contain: iomemory-vsl-5.6.0-19-g67bac62
Build cannot continue without the proper tree.
[vagrant@centos8 iomemory-vsl]$ sudo dkms mkrpm iomemory-vsl/5.6.0_19_g67bac62

Marking 4.18.0-193.14.2.el8_2.x86_64 (x86_64) for RPM...
copying legacy postinstall template...
Copying source tree...
rpmbuild...(bad exit status: 1)
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.7UKMVN
+ umask 022
+ cd /tmp/dkms.42ZOMO/BUILD
+ '[' '-k 4.18.0-193.14.2.el8_2.x86_64 -a x86_64 --binaries-only' '!=' none ']'
++ basename iomemory-vsl-5.6.0_19_g67bac62.dkms.tar.gz
+ /usr/sbin/dkms mktarball -m iomemory-vsl -v 5.6.0_19_g67bac62 -k 4.18.0-193.14.2.el8_2.x86_64 -a x86_64 --binaries-only --archive iomemory-vsl-5.6.0_19_g67bac62.dkms.tar.gz
Marking modules for 4.18.0-193.14.2.el8_2.x86_64 (x86_64) for archiving...

Creating tarball structure to specifically accomodate binaries.

Tarball location: /var/lib/dkms/iomemory-vsl/5.6.0_19_g67bac62/tarball//iomemory-vsl-5.6.0_19_g67bac62.dkms.tar.gz

DKMS: mktarball completed.
++ basename iomemory-vsl-5.6.0_19_g67bac62.dkms.tar.gz
+ cp -af /var/lib/dkms/iomemory-vsl/5.6.0_19_g67bac62/tarball/iomemory-vsl-5.6.0_19_g67bac62.dkms.tar.gz iomemory-vsl-5.6.0_19_g67bac62.dkms.tar.gz
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.OlDyUu
+ umask 022
+ cd /tmp/dkms.42ZOMO/BUILD
+ '[' /tmp/dkms.42ZOMO/BUILDROOT/iomemory-vsl-5.6.0_19_g67bac62-1dkms.x86_64 '!=' / ']'
+ rm -rf /tmp/dkms.42ZOMO/BUILDROOT/iomemory-vsl-5.6.0_19_g67bac62-1dkms.x86_64
++ dirname /tmp/dkms.42ZOMO/BUILDROOT/iomemory-vsl-5.6.0_19_g67bac62-1dkms.x86_64
+ mkdir -p /tmp/dkms.42ZOMO/BUILDROOT
+ mkdir /tmp/dkms.42ZOMO/BUILDROOT/iomemory-vsl-5.6.0_19_g67bac62-1dkms.x86_64
+ '[' /tmp/dkms.42ZOMO/BUILDROOT/iomemory-vsl-5.6.0_19_g67bac62-1dkms.x86_64 '!=' / ']'
+ rm -rf /tmp/dkms.42ZOMO/BUILDROOT/iomemory-vsl-5.6.0_19_g67bac62-1dkms.x86_64
+ mkdir -p /tmp/dkms.42ZOMO/BUILDROOT/iomemory-vsl-5.6.0_19_g67bac62-1dkms.x86_64//usr/src
+ mkdir -p /tmp/dkms.42ZOMO/BUILDROOT/iomemory-vsl-5.6.0_19_g67bac62-1dkms.x86_64//usr/share/iomemory-vsl
+ '[' -d /tmp/dkms.42ZOMO/SOURCES/iomemory-vsl-5.6.0_19_g67bac62 ']'
+ cp -Lpr /tmp/dkms.42ZOMO/SOURCES/iomemory-vsl-5.6.0_19_g67bac62 /tmp/dkms.42ZOMO/BUILDROOT/iomemory-vsl-5.6.0_19_g67bac62-1dkms.x86_64//usr/src
+ '[' -f iomemory-vsl-5.6.0_19_g67bac62.dkms.tar.gz ']'
+ install -m 644 iomemory-vsl-5.6.0_19_g67bac62.dkms.tar.gz /tmp/dkms.42ZOMO/BUILDROOT/iomemory-vsl-5.6.0_19_g67bac62-1dkms.x86_64//usr/share/iomemory-vsl
+ '[' -f /tmp/dkms.42ZOMO/SOURCES/common.postinst ']'
+ install -m 755 /tmp/dkms.42ZOMO/SOURCES/common.postinst /tmp/dkms.42ZOMO/BUILDROOT/iomemory-vsl-5.6.0_19_g67bac62-1dkms.x86_64//usr/share/iomemory-vsl/postinst
+ /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/redhat/brp-ldconfig
/sbin/ldconfig: Warning: ignoring configuration file that cannot be opened: /etc/ld.so.conf: No such file or directory
+ /usr/lib/rpm/brp-compress
+ /usr/lib/rpm/brp-strip /usr/bin/strip
+ /usr/lib/rpm/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
+ /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/brp-python-bytecompile '' 1
+ /usr/lib/rpm/brp-python-hardlink
+ PYTHON3=/usr/libexec/platform-python
+ /usr/lib/rpm/redhat/brp-mangle-shebangs
Processing files: iomemory-vsl-5.6.0_19_g67bac62-1dkms.noarch
warning: Deprecated external dependency generator is used!
Finding  Provides: /usr/lib/dkms/find-provides
Finding  Requires(interp): 
Finding  Requires(rpmlib): 
Finding  Requires(verify): 
Finding  Requires(pre): 
Finding  Requires(post): 
Finding  Requires(preun): 
Finding  Requires(postun): 
Finding  Requires(pretrans): 
Finding  Requires(posttrans): 
Finding  Requires: /usr/lib/rpm/find-requires
Finding  Conflicts: 
Finding  Obsoletes: 
Finding  Recommends: 
Finding  Suggests: 
Finding  Supplements: 
Finding  Enhances: 
Provides: iomemory-vsl = 5.6.0_19_g67bac62-1dkms
Requires(interp): /bin/sh /bin/sh
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires(post): /bin/sh
Requires(preun): /bin/sh
Requires: /bin/bash /bin/sh
error: Arch dependent binaries in noarch package

RPM build errors:
    Deprecated external dependency generator is used!
    Arch dependent binaries in noarch package
Error! There was a problem creating your rpm.
snuf commented 4 years ago

@Steven-Joles better late than never, can you try the SHA: ea8b56582e7d8e7a38c28785969e130e7d2e2a80 commit, it contains a mkrpm file and a fix for the version, if this works as expected we'll move that to master and it will be part of the next release..

@Tourman36 our versioning from a DKMS/build/compile perspective is going to move from vM.m.p-build-hash to M.m.p_build_hash, which is Red Hat "compliant", the pre-ended v is something dkms mkdeb complained about, so losing that seems like a good idea. For the git repo it means we can leave it as is, or for clarity remove the v in newer releases so the tag always matches the version, any thoughts?

Tourman36 commented 4 years ago

@snuf I think it's better to have versioning be consistent across.

Steven-Joles commented 4 years ago

@snuf no worries on timing, it's all good -- now if this thing would only cooperate, is this something I'm missing on my system? "%kernel_module_package_buildreqs" that it's searching for and I don't have installed?

git clone https://github.com/snuf/iomemory-vsl4 cd iomemory-vsl4 git checkout ea8b56582e7d8e7a38c28785969e130e7d2e2a80 make dkms ... DKMS: install completed.

dkms status iomemory-vsl4, 5.6.1_24_gea8b565, 4.18.0-193.14.2.el8_2.x86_64, x86_64: installed

dkms mkdriverdisk -d redhat3 --media tar -m iomemory-vsl4 -v 5.6.1_24_gea8b565 iomemory-vsl4-5.6.1_24_gea8b565/include/fio/public/fioapi.h

rpmbuild...(bad exit status: 1)

Error! There was a problem creating your kmod.
error: line 10: Dependency tokens must begin with alpha-numeric, '_' or '/': BuildRequires:     %kernel_module_package_buildreqs
Building target platforms: x86_64
Building for target x86_64
snuf commented 4 years ago

@Steven-Joles I was able to make the ubuntu driver disk work. The end result is just an iso/tgz with the kernel module in it and the sources, in places where the OS expects them when you load the driver disk in the installer. The redhat3 option in my case gives a very different failure result, so I can't reproduce that.

What is your intention with the driver disk, to use it for the installer? Would you be willing to try with an ubuntu iso/tgz just to see if it works (tm)?

Steven-Joles commented 4 years ago

@snuf Absolutely, Should be able to give it a shot within a few hours. Let me know how you'd like to proceed.

snuf commented 2 years ago

closing, there is an example EFI workaround for ubuntu atm.