Skip to content

Enable using add, build and install with a directory again#178

Merged
scaronni merged 1 commit intodkms-project:masterfrom
fishilico:issue-177-make-module-version-args-optional
Nov 17, 2021
Merged

Enable using add, build and install with a directory again#178
scaronni merged 1 commit intodkms-project:masterfrom
fishilico:issue-177-make-module-version-args-optional

Conversation

@fishilico
Copy link
Contributor

Since commit e73f9bb ("dkms: fixup add/remove...uninstall permission checking"), it was no longer possible to use "dkms add" with a directory:

$ dkms add test/dkms_test-1.0
Error! Arguments <module> and <module-version> are not specified.
Usage: add <module>/<module-version> or
       add -m <module>/<module-version> or
       add -m <module> -v <module-version>

But when options -m and -v are given, the source directory is ignored.

Fix this issue by removing the check for -m and -v in add, build and install actions. This makes the following commands work again (for example on Arch Linux):

$ dkms add test/dkms_test-1.0
Creating symlink /var/lib/dkms/dkms_test/1.0/source -> /usr/src/dkms_test-1.0

$ dkms remove -m dkms_test -v 1.0 --all
...
$ dkms install -k 5.15.2-arch1-1 test/dkms_test-1.0
Creating symlink /var/lib/dkms/dkms_test/1.0/source -> /usr/src/dkms_test-1.0

Building module:
cleaning build area...
make -j8 KERNELRELEASE=5.15.2-arch1-1 -C /lib/modules/5.15.2-arch1-1/build M=/var/lib/dkms/dkms_test/1.0/build...
cleaning build area...

dkms_test.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.15.2-arch1-1/kernel/extra/
depmod...

$ dkms remove -m dkms_test -v 1.0 --all
...
$ dkms build -k 5.15.2-arch1-1 test/dkms_test-1.0
Creating symlink /var/lib/dkms/dkms_test/1.0/source -> /usr/src/dkms_test-1.0

Building module:
cleaning build area...
make -j8 KERNELRELEASE=5.15.2-arch1-1 -C /lib/modules/5.15.2-arch1-1/build M=/var/lib/dkms/dkms_test/1.0/build...
cleaning build area...

Fixes: #177

Since commit e73f9bb ("dkms: fixup add/remove...uninstall
permission checking"), it was no longer possible to use "dkms add" with
a directory:

    $ dkms add test/dkms_test-1.0
    Error! Arguments <module> and <module-version> are not specified.
    Usage: add <module>/<module-version> or
           add -m <module>/<module-version> or
           add -m <module> -v <module-version>

But when options -m and -v are given, the source directory is ignored.

Fix this issue by removing the check for -m and -v in add, build and
install actions. This makes the following commands work again (for
example on Arch Linux):

    $ dkms add test/dkms_test-1.0
    Creating symlink /var/lib/dkms/dkms_test/1.0/source -> /usr/src/dkms_test-1.0

    $ dkms remove -m dkms_test -v 1.0 --all
    ...
    $ dkms install -k 5.15.2-arch1-1 test/dkms_test-1.0
    Creating symlink /var/lib/dkms/dkms_test/1.0/source -> /usr/src/dkms_test-1.0

    Building module:
    cleaning build area...
    make -j8 KERNELRELEASE=5.15.2-arch1-1 -C /lib/modules/5.15.2-arch1-1/build M=/var/lib/dkms/dkms_test/1.0/build...
    cleaning build area...

    dkms_test.ko:
    Running module version sanity check.
     - Original module
       - No original module exists within this kernel
     - Installation
       - Installing to /lib/modules/5.15.2-arch1-1/kernel/extra/
    depmod...

    $ dkms remove -m dkms_test -v 1.0 --all
    ...
    $ dkms build -k 5.15.2-arch1-1 test/dkms_test-1.0
    Creating symlink /var/lib/dkms/dkms_test/1.0/source -> /usr/src/dkms_test-1.0

    Building module:
    cleaning build area...
    make -j8 KERNELRELEASE=5.15.2-arch1-1 -C /lib/modules/5.15.2-arch1-1/build M=/var/lib/dkms/dkms_test/1.0/build...
    cleaning build area...

Fixes: dkms-project#177
@scaronni scaronni merged commit 3f4869d into dkms-project:master Nov 17, 2021
@fishilico fishilico deleted the issue-177-make-module-version-args-optional branch November 17, 2021 15:35
fishilico added a commit to fishilico/chipsec that referenced this pull request Nov 17, 2021
DKMS 3.0 broke `dkms add drivers/linux` (cf.
chipsec#1305 (comment)).
This was fixed upstream in dkms-project/dkms#178.

While waiting for a new DKMS release which would be applied by Arch
Linux maintainers, it is possible to work around the issue by removing
some checks from the `dkms` script. Add a `sed` command which does that.

Signed-off-by: Nicolas Iooss <nicolas.iooss_git@polytechnique.org>
npmitche pushed a commit to chipsec/chipsec that referenced this pull request Nov 17, 2021
DKMS 3.0 broke `dkms add drivers/linux` (cf.
#1305 (comment)).
This was fixed upstream in dkms-project/dkms#178.

While waiting for a new DKMS release which would be applied by Arch
Linux maintainers, it is possible to work around the issue by removing
some checks from the `dkms` script. Add a `sed` command which does that.

Signed-off-by: Nicolas Iooss <nicolas.iooss_git@polytechnique.org>
BrentHoltsclaw pushed a commit to BrentHoltsclaw/chipsec that referenced this pull request Nov 24, 2021
DKMS 3.0 broke `dkms add drivers/linux` (cf.
chipsec#1305 (comment)).
This was fixed upstream in dkms-project/dkms#178.

While waiting for a new DKMS release which would be applied by Arch
Linux maintainers, it is possible to work around the issue by removing
some checks from the `dkms` script. Add a `sed` command which does that.

Signed-off-by: Nicolas Iooss <nicolas.iooss_git@polytechnique.org>
BrentHoltsclaw pushed a commit to BrentHoltsclaw/chipsec that referenced this pull request Dec 2, 2021
DKMS 3.0 broke `dkms add drivers/linux` (cf.
chipsec#1305 (comment)).
This was fixed upstream in dkms-project/dkms#178.

While waiting for a new DKMS release which would be applied by Arch
Linux maintainers, it is possible to work around the issue by removing
some checks from the `dkms` script. Add a `sed` command which does that.

Signed-off-by: Nicolas Iooss <nicolas.iooss_git@polytechnique.org>
npmitche pushed a commit to chipsec/chipsec that referenced this pull request Dec 3, 2021
DKMS 3.0 broke `dkms add drivers/linux` (cf.
#1305 (comment)).
This was fixed upstream in dkms-project/dkms#178.

While waiting for a new DKMS release which would be applied by Arch
Linux maintainers, it is possible to work around the issue by removing
some checks from the `dkms` script. Add a `sed` command which does that.

Signed-off-by: Nicolas Iooss <nicolas.iooss_git@polytechnique.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

<module>/<module-version> is not optional

2 participants