Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce output when installing/uninstalling #425

Merged
merged 4 commits into from
Aug 25, 2024
Merged

Reduce output when installing/uninstalling #425

merged 4 commits into from
Aug 25, 2024

Conversation

scaronni
Copy link
Collaborator

The output when installing and uninstalling modules is unbelievably long, and in most cases it prints useless information.

Make some changes to print additional information only when relevant to the context and shorten output in general. List of commits, in order:

  • Drop useless duplicate line when building.
  • When a task is set into background, dots are used to show progress. Add a "done." at the end of the dots when the task it's finished.
  • Reduce output when installing and uninstalling. Contexts like "Uninstallation" and "Original module" are no longer printed and instead lines with the detail about the topic are printed only if they are relevant. So if everything is simple (one module, not present, etc.) not much is printed. One-line outpus ("Installation aborted" etc. are separated by one line.

@scaronni
Copy link
Collaborator Author

scaronni commented Jun 25, 2024

Sample for commit 1 & 2. ll examples below taken with the xone DKMS modules as it contains a few modules which are a good representation of the output.

Before:

# dkms build -m xone/0.3
Sign command: /lib/modules/6.9.4-200.fc40.x86_64/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub

Building module:
Cleaning build area...
Building module(s)...
Signing module /var/lib/dkms/xone/0.3/build/xone-wired.ko
Signing module /var/lib/dkms/xone/0.3/build/xone-dongle.ko
Signing module /var/lib/dkms/xone/0.3/build/xone-gip.ko
Signing module /var/lib/dkms/xone/0.3/build/xone-gip-gamepad.ko
Signing module /var/lib/dkms/xone/0.3/build/xone-gip-headset.ko
Signing module /var/lib/dkms/xone/0.3/build/xone-gip-chatpad.ko
Signing module /var/lib/dkms/xone/0.3/build/xone-gip-madcatz-strat.ko
Signing module /var/lib/dkms/xone/0.3/build/xone-gip-madcatz-glam.ko
Signing module /var/lib/dkms/xone/0.3/build/xone-gip-pdp-jaguar.ko
Cleaning build area...

After:

# dkms build -m xone/0.3
Sign command: /lib/modules/6.9.4-200.fc40.x86_64/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Creating symlink /var/lib/dkms/xone/0.4/source -> /usr/src/xone-0.4

Cleaning build area... done.
Building module(s)... done.
Signing module /var/lib/dkms/xone/0.4/build/xone-wired.ko
Signing module /var/lib/dkms/xone/0.4/build/xone-dongle.ko
Signing module /var/lib/dkms/xone/0.4/build/xone-gip.ko
Signing module /var/lib/dkms/xone/0.4/build/xone-gip-gamepad.ko
Signing module /var/lib/dkms/xone/0.4/build/xone-gip-headset.ko
Signing module /var/lib/dkms/xone/0.4/build/xone-gip-chatpad.ko
Signing module /var/lib/dkms/xone/0.4/build/xone-gip-madcatz-strat.ko
Signing module /var/lib/dkms/xone/0.4/build/xone-gip-madcatz-glam.ko
Signing module /var/lib/dkms/xone/0.4/build/xone-gip-pdp-jaguar.ko
Cleaning build area... done.

@scaronni
Copy link
Collaborator Author

scaronni commented Jun 25, 2024

Sample for commit 3, again examples below are taken with the xone DKMS modules.

Before, with a simple situation:

# dkms install -m xone/0.3 --force

xone-wired.ko.xz:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.9.4-200.fc40.x86_64/extra/

xone-dongle.ko.xz:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.9.4-200.fc40.x86_64/extra/

xone-gip.ko.xz:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.9.4-200.fc40.x86_64/extra/

xone-gip-gamepad.ko.xz:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.9.4-200.fc40.x86_64/extra/

xone-gip-headset.ko.xz:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.9.4-200.fc40.x86_64/extra/

xone-gip-chatpad.ko.xz:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.9.4-200.fc40.x86_64/extra/

xone-gip-madcatz-strat.ko.xz:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.9.4-200.fc40.x86_64/extra/

xone-gip-madcatz-glam.ko.xz:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.9.4-200.fc40.x86_64/extra/

xone-gip-pdp-jaguar.ko.xz:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/6.9.4-200.fc40.x86_64/extra/
depmod....

Module xone-0.3 for kernel 6.9.4-200.fc40.x86_64 (x86_64).
Before uninstall, this module version was ACTIVE on this kernel.

xone-wired.ko.xz:
 - Uninstallation
   - Deleting from: /lib/modules/6.9.4-200.fc40.x86_64/extra/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

xone-dongle.ko.xz:
 - Uninstallation
   - Deleting from: /lib/modules/6.9.4-200.fc40.x86_64/extra/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

xone-gip.ko.xz:
 - Uninstallation
   - Deleting from: /lib/modules/6.9.4-200.fc40.x86_64/extra/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

xone-gip-gamepad.ko.xz:
 - Uninstallation
   - Deleting from: /lib/modules/6.9.4-200.fc40.x86_64/extra/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

xone-gip-headset.ko.xz:
 - Uninstallation
   - Deleting from: /lib/modules/6.9.4-200.fc40.x86_64/extra/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

xone-gip-chatpad.ko.xz:
 - Uninstallation
   - Deleting from: /lib/modules/6.9.4-200.fc40.x86_64/extra/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

xone-gip-madcatz-strat.ko.xz:
 - Uninstallation
   - Deleting from: /lib/modules/6.9.4-200.fc40.x86_64/extra/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

xone-gip-madcatz-glam.ko.xz:
 - Uninstallation
   - Deleting from: /lib/modules/6.9.4-200.fc40.x86_64/extra/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

xone-gip-pdp-jaguar.ko.xz:
 - Uninstallation
   - Deleting from: /lib/modules/6.9.4-200.fc40.x86_64/extra/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.
depmod....

Before, with a more complicated case where modules are already there:

# dkms install -m xone/0.3

xone-wired.ko.xz:
Running module version sanity check.
Module version 0.3 for xone-wired.ko.xz
exactly matches what is already found in kernel 6.9.4-200.fc40.x86_64.
DKMS will not replace this module.
You may override by specifying --force.

xone-dongle.ko.xz:
Running module version sanity check.
Module version 0.3 for xone-dongle.ko.xz
exactly matches what is already found in kernel 6.9.4-200.fc40.x86_64.
DKMS will not replace this module.
You may override by specifying --force.

xone-gip.ko.xz:
Running module version sanity check.
Module version 0.3 for xone-gip.ko.xz
exactly matches what is already found in kernel 6.9.4-200.fc40.x86_64.
DKMS will not replace this module.
You may override by specifying --force.

xone-gip-gamepad.ko.xz:
Running module version sanity check.
Module version 0.3 for xone-gip-gamepad.ko.xz
exactly matches what is already found in kernel 6.9.4-200.fc40.x86_64.
DKMS will not replace this module.
You may override by specifying --force.

xone-gip-headset.ko.xz:
Running module version sanity check.
Module version 0.3 for xone-gip-headset.ko.xz
exactly matches what is already found in kernel 6.9.4-200.fc40.x86_64.
DKMS will not replace this module.
You may override by specifying --force.

xone-gip-chatpad.ko.xz:
Running module version sanity check.
Module version 0.3 for xone-gip-chatpad.ko.xz
exactly matches what is already found in kernel 6.9.4-200.fc40.x86_64.
DKMS will not replace this module.
You may override by specifying --force.

xone-gip-madcatz-strat.ko.xz:
Running module version sanity check.
Module version 0.3 for xone-gip-madcatz-strat.ko.xz
exactly matches what is already found in kernel 6.9.4-200.fc40.x86_64.
DKMS will not replace this module.
You may override by specifying --force.

xone-gip-madcatz-glam.ko.xz:
Running module version sanity check.
Module version 0.3 for xone-gip-madcatz-glam.ko.xz
exactly matches what is already found in kernel 6.9.4-200.fc40.x86_64.
DKMS will not replace this module.
You may override by specifying --force.

xone-gip-pdp-jaguar.ko.xz:
Running module version sanity check.
Module version 0.3 for xone-gip-pdp-jaguar.ko.xz
exactly matches what is already found in kernel 6.9.4-200.fc40.x86_64.
DKMS will not replace this module.
You may override by specifying --force.
Error! Installation aborted.

After, simple case (this is what most users will ever see):

# dkms install -m xone/0.3
Installing /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-wired.ko.xz
Installing /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-dongle.ko.xz
Installing /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip.ko.xz
Installing /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip-gamepad.ko.xz
Installing /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip-headset.ko.xz
Installing /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip-chatpad.ko.xz
Installing /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip-madcatz-strat.ko.xz
Installing /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip-madcatz-glam.ko.xz
Installing /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip-pdp-jaguar.ko.xz

Running depmod.... done.

# dkms remove -m xone/0.3
Module xone-0.3 for kernel 6.9.4-200.fc40.x86_64 (x86_64).
Before uninstall, this module version was ACTIVE on this kernel.

Deleting /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-wired.ko.xz
Deleting /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-dongle.ko.xz
Deleting /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip.ko.xz
Deleting /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip-gamepad.ko.xz
Deleting /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip-headset.ko.xz
Deleting /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip-chatpad.ko.xz
Deleting /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip-madcatz-strat.ko.xz
Deleting /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip-madcatz-glam.ko.xz
Deleting /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip-pdp-jaguar.ko.xz

Running depmod.... done.

After, more complex case with the same module already installed:

# dkms install -m xone/0.3

Module /lib/modules/6.9.4-200.fc40.x86_64/extra/xone/xone-wired.ko.xz already installed at version 0.3, override by specifying --force
Module /lib/modules/6.9.4-200.fc40.x86_64/extra/xone/xone-dongle.ko.xz already installed at version 0.3, override by specifying --force
Module /lib/modules/6.9.4-200.fc40.x86_64/extra/xone/xone-gip.ko.xz already installed at version 0.3, override by specifying --force
Module /lib/modules/6.9.4-200.fc40.x86_64/extra/xone/xone-gip-gamepad.ko.xz already installed at version 0.3, override by specifying --force
Module /lib/modules/6.9.4-200.fc40.x86_64/extra/xone/xone-gip-headset.ko.xz already installed at version 0.3, override by specifying --force
Module /lib/modules/6.9.4-200.fc40.x86_64/extra/xone/xone-gip-chatpad.ko.xz already installed at version 0.3, override by specifying --force
Module /lib/modules/6.9.4-200.fc40.x86_64/extra/xone/xone-gip-madcatz-strat.ko.xz already installed at version 0.3, override by specifying --force
Module /lib/modules/6.9.4-200.fc40.x86_64/extra/xone/xone-gip-madcatz-glam.ko.xz already installed at version 0.3, override by specifying --force
Module /lib/modules/6.9.4-200.fc40.x86_64/extra/xone/xone-gip-pdp-jaguar.ko.xz already installed at version 0.3, override by specifying --force

Error! Installation aborted.

And with an original module being older:

# dkms install -m xone/0.4

Found pre-existing /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-wired.ko.xz, archiving for uninstallation
Installing /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-wired.ko.xz
Found pre-existing /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-dongle.ko.xz, archiving for uninstallation
Installing /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-dongle.ko.xz
Found pre-existing /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip.ko.xz, archiving for uninstallation
Installing /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip.ko.xz
Found pre-existing /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip-gamepad.ko.xz, archiving for uninstallation
Installing /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip-gamepad.ko.xz
Found pre-existing /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip-headset.ko.xz, archiving for uninstallation
Installing /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip-headset.ko.xz
Found pre-existing /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip-chatpad.ko.xz, archiving for uninstallation
Installing /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip-chatpad.ko.xz
Found pre-existing /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip-madcatz-strat.ko.xz, archiving for uninstallation
Installing /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip-madcatz-strat.ko.xz
Found pre-existing /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip-madcatz-glam.ko.xz, archiving for uninstallation
Installing /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip-madcatz-glam.ko.xz
Found pre-existing /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip-pdp-jaguar.ko.xz, archiving for uninstallation
Installing /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip-pdp-jaguar.ko.xz

Running depmod.... done.
# dkms uninstall -m xone/0.4
Module xone-0.4 for kernel 6.9.4-200.fc40.x86_64 (x86_64).
Before uninstall, this module version was ACTIVE on this kernel.

Deleting /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-wired.ko.xz
Restoring archived original module
Deleting /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-dongle.ko.xz
Restoring archived original module
Deleting /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip.ko.xz
Restoring archived original module
Deleting /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip-gamepad.ko.xz
Restoring archived original module
Deleting /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip-headset.ko.xz
Restoring archived original module
Deleting /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip-chatpad.ko.xz
Restoring archived original module
Deleting /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip-madcatz-strat.ko.xz
Restoring archived original module
Deleting /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip-madcatz-glam.ko.xz
Restoring archived original module
Deleting /lib/modules/6.9.4-200.fc40.x86_64/extra/xone-gip-pdp-jaguar.ko.xz
Restoring archived original module

Running depmod.... done.

Removing original_module from DKMS tree for kernel 6.9.4-200.fc40.x86_64 (x86_64)

@scaronni scaronni requested a review from evelikov June 25, 2024 09:42
@scaronni
Copy link
Collaborator Author

scaronni commented Jul 3, 2024

Just did my update for Nvidia with this:

# dkms build -m nvidia/555.58.02 -k 6.9.7-200.fc40.x86_64
Sign command: /lib/modules/6.9.7-200.fc40.x86_64/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub

Cleaning build area... done.
Building module(s)....................... done.
Signing module /var/lib/dkms/nvidia/555.58.02/build/kernel-open/nvidia.ko
Signing module /var/lib/dkms/nvidia/555.58.02/build/kernel-open/nvidia-modeset.ko
Signing module /var/lib/dkms/nvidia/555.58.02/build/kernel-open/nvidia-drm.ko
Signing module /var/lib/dkms/nvidia/555.58.02/build/kernel-open/nvidia-uvm.ko
Signing module /var/lib/dkms/nvidia/555.58.02/build/kernel-open/nvidia-peermem.ko
Cleaning build area... done.

@evelikov any chance you can review it?

dkms.in Outdated Show resolved Hide resolved
dkms.in Outdated Show resolved Hide resolved
dkms.in Outdated Show resolved Hide resolved
@evelikov
Copy link
Collaborator

evelikov commented Jul 5, 2024

Sorry for the delay, just catching up from being offline.

Personally I like the leading slashes, but I'm not strongly attached. Reeeeally like the "done" piece though.

Apart from the few comments, please update the test expectations.

@scaronni
Copy link
Collaborator Author

scaronni commented Jul 7, 2024

Adjusted for the review above, now checking the test expectations.

@scaronni scaronni force-pushed the output branch 20 times, most recently from a1a5f07 to 946b4a2 Compare July 7, 2024 14:33
@scaronni
Copy link
Collaborator Author

scaronni commented Jul 7, 2024

The tests apparently show some pre-existing race condition as I'm not able to get consistent output between Ubuntu and Alpine in a section I haven't touched. Will try to fix it soon.

@scaronni scaronni force-pushed the output branch 5 times, most recently from a47eff7 to 99860f7 Compare July 9, 2024 14:33
@scaronni
Copy link
Collaborator Author

scaronni commented Jul 9, 2024

@evelikov only on the Ubuntu VM Test, I get an extra newline, which does not seem to be there in the code, I guess it's some mangled output from the make command:

https://github.com/dell/dkms/actions/runs/9859049192/job/27221831634?pr=425

Everything else is green. Can't we consider all the container tests enough?

@scaronni scaronni changed the title Draft: Reduce output when installing/uninstalling Reduce output when installing/uninstalling Jul 9, 2024
@scaronni scaronni requested a review from xuzhen July 14, 2024 08:04
@scaronni scaronni mentioned this pull request Jul 14, 2024
@scaronni
Copy link
Collaborator Author

Temporarily rebased on the tests branch to move on...

@zeroepoch
Copy link
Collaborator

@evelikov only on the Ubuntu VM Test, I get an extra newline, which does not seem to be there in the code, I guess it's some mangled output from the make command

I proposed a possible solution to this at #428 (review)

dkms.in Show resolved Hide resolved
dkms.in Outdated Show resolved Hide resolved
@scaronni scaronni force-pushed the output branch 2 times, most recently from b3ef72f to cf56e98 Compare August 25, 2024 09:03
@scaronni scaronni force-pushed the output branch 5 times, most recently from e4342c8 to 1739319 Compare August 25, 2024 09:37
Also save multiple original modules on Debian/Ubuntu instead of just
silently leaving everything in place.
@scaronni scaronni merged commit fc6df60 into master Aug 25, 2024
54 checks passed
@scaronni scaronni deleted the output branch August 25, 2024 10:08
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.

3 participants