You are not logged in.
Hello,
I would like to increase verbosity for dkms and mkinitcpio in pacman so that when I # pacman -Syu I can see more information regarding their current operations.
My laptop's / drive is on ZFS. Sometimes ZFS modules or initramfs fail to build and I need to debug, otherwise I won't be able to boot.
I have been able to increase the verbosity in both using --verbose tag when running manually
I have increased the verbosity in pacman.conf so that it lists details of files by default, but this has no effect on dkms or mkinitcpio
However
I have not been able to find a way to increase the verbosity of dkms or mkinitcpio when running from pacman
I have checked:
pacman.conf
dkms.conf
alpm-hooks
dkms hooks in dkms dir
mkinitcpio hooks in mkinitcpio dir
Is there anything else in the configuration of pacman that will increase verbosity for these other programs it invokes?
Edit: clarity
Last edited by AveryFreeman (2017-12-22 19:55:48)
Offline
Both hooks already show what's happening, what specific info are you looking for?
Offline
I would just like the info generated from running either dkms or mkinitcpio with --verbose flag
Offline
OK, so modify/override the hooks that run those commands.
Offline
I've been at this for days now.
I have a post I wrote Dec 15 in the only thread on the forum I've found regarding this issue and nobody replied: https://bbs.archlinux.org/viewtopic.php?id=207889
Seems futile. Maybe I'm asking the wrong question ...
Last edited by AveryFreeman (2017-12-22 20:16:39)
Offline
https://wiki.archlinux.org/index.php/Pacman#Hooks
I searched the mkinitcpio hook on my own because I was interested on learning how to do this:
cat /usr/share/libalpm/hooks/90-linux.hook
What Scimmia meant was (I hope I got it clear): override *that* hook and change whatever you want.
Regarding dkms: I really don't know where to look for that, but I think you could do this on your own now.
Offline
Ok, well I tracked down what needs to be edited, but it's a little complicated for dkms, which is what I'm most concerned about. Probably why I've been travelling in circles.
libalpm and alpm-hooks are the man pages I consulted
/usr/share/libalpm/hooks is where alpm-hooks are located
looked at 70-dkms-install.hook and tried to add --verbose both before and after install in the last line, exec
seemed reasonable to me since running it manually provides the desired response. For example:
# dkms --verbose install spl/0.7.4 -k 4.9.70-1-lts
adding -v before -k in the last line of 90-linux.hook works because it directly invokes mkinitcpio in the hook, but adding --verbose to 70-dkms-install.hook exec line prevents dkms from building in pacman.
I wasn't paying close enough attention, because apparently, unlike 90-linux.hook where it invokes the underlying command, it execs another script called /usr/lib/dkms/alpm-hook. Earlier I had replaced this one with dkms-sorted in the aur: https://aur.archlinux.org/packages/dkms-sorted/ because it the original randomly tries to build ZFS modules before SPL, resulting in failure.
OK, so I'm analyzing the script and I'm not very good at bash, but I think I found where it runs the actual command on line 104:
run dkms "${DKMS_ACTION[$nvk]}" "$mod" -k "$kver"
I added the '--verbose' flag before "${DKMS_ACTION}" string. Will downgrade and then upgrade my kernel and see if it works, and report back.
Last edited by AveryFreeman (2017-12-22 21:22:21)
Offline
OK. I figured it out. Apparently adding --verbose was not a good idea. Shows how new I am to bash! The script actually creates output that is echoed to /dev/null in the beginning of the script.
From some of the things I read on stackexchange, It looks as if it should also be outputting stderr info, but I've had errors occur and never seen any resulting codes echoed.
so I just commented out the > /dev/null portion in the beginning of the alpm-hooks script in /usr/lib/dkms and now I get all the dkms output in pacman. I like to see all that stuff anyway.
# /usr/lib/dkms/alpm-hook
# display what to run and run it quietly
run() {
echo "==> $*"
"$@" # > /dev/null
}
Resources: http://www.tldp.org/LDP/Bash-Beginners- … Guide.html
Last edited by AveryFreeman (2017-12-22 21:50:52)
Offline
By the way, if you copy your edited files to /etc/pacman.d/hooks/ , then they won't be overwritten when you update a package and should still work.
man alpm-hooks
OVERRIDING HOOKS
Hooks may be overridden by placing a file with the same name in a
higher priority hook directory. Hooks may be disabled by overriding
them with a symlink to /dev/null.
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Offline
Oh, yeah I noticed that, thanks. Good to know.
However, the solution for me wasn't modifying a hook, it was modifying the script referred to by the hook, which for me is installed using an AUR package which makes sure SPL is compiled before ZFS when doing pacman upgrades: https://aur.archlinux.org/packages/dkms-sorted/
Offline