saber-nyan / kernel-modules-hook

Keeps your Arch Linux fully functional after a kernel upgrade
The Unlicense
343 stars 25 forks source link

Drop rsync(1) dependency #15

Open moviuro opened 3 years ago

moviuro commented 3 years ago

This deals with @alexdewar 's and @PeterNerlich 's speed concerns in #11 and #14 respectively. On my machine, it made the (pre) hook run 10x faster.

alexdewar commented 3 years ago

This is an excellent idea!

Edu4rdSHL commented 3 years ago

I agree with this as well, the improvement is appreciable. I hope that @saber-nyan merge this soon, I have used @moviuro's github to build the package currently and not the AUR one.

Edu4rdSHL commented 3 years ago

Hey, @moviuro. I have found this problem for the fisrt time:

:: Running post-transaction hooks...
( 1/10) Restoring Linux kernel modules...
++ uname -r
+ KVER=5.11.11-144-tkg-MuQSS
+ test -e /usr/lib/modules/backup/5.11.11-144-tkg-MuQSS
+ cp -ral /usr/lib/modules/backup/5.11.11-144-tkg-MuQSS /usr/lib/modules/
cp: cannot create hard link '/usr/lib/modules/5.11.11-144-tkg-MuQSS/modules.dep' to '/usr/lib/modules/backup/5.11.11-144-tkg-MuQSS/modules.dep': File exists
cp: cannot create hard link '/usr/lib/modules/5.11.11-144-tkg-MuQSS/modules.dep.bin' to '/usr/lib/modules/backup/5.11.11-144-tkg-MuQSS/modules.dep.bin': File exists
cp: cannot create hard link '/usr/lib/modules/5.11.11-144-tkg-MuQSS/modules.alias' to '/usr/lib/modules/backup/5.11.11-144-tkg-MuQSS/modules.alias': File exists
cp: cannot create hard link '/usr/lib/modules/5.11.11-144-tkg-MuQSS/modules.alias.bin' to '/usr/lib/modules/backup/5.11.11-144-tkg-MuQSS/modules.alias.bin': File exists
cp: cannot create hard link '/usr/lib/modules/5.11.11-144-tkg-MuQSS/modules.softdep' to '/usr/lib/modules/backup/5.11.11-144-tkg-MuQSS/modules.softdep': File exists
cp: cannot create hard link '/usr/lib/modules/5.11.11-144-tkg-MuQSS/modules.symbols' to '/usr/lib/modules/backup/5.11.11-144-tkg-MuQSS/modules.symbols': File exists
cp: cannot create hard link '/usr/lib/modules/5.11.11-144-tkg-MuQSS/modules.symbols.bin' to '/usr/lib/modules/backup/5.11.11-144-tkg-MuQSS/modules.symbols.bin': File exists
cp: cannot create hard link '/usr/lib/modules/5.11.11-144-tkg-MuQSS/modules.builtin.bin' to '/usr/lib/modules/backup/5.11.11-144-tkg-MuQSS/modules.builtin.bin': File exists
cp: cannot create hard link '/usr/lib/modules/5.11.11-144-tkg-MuQSS/modules.builtin.alias.bin' to '/usr/lib/modules/backup/5.11.11-144-tkg-MuQSS/modules.builtin.alias.bin': File exists
cp: cannot create hard link '/usr/lib/modules/5.11.11-144-tkg-MuQSS/modules.devname' to '/usr/lib/modules/backup/5.11.11-144-tkg-MuQSS/modules.devname': File exists
+ rm -rf /usr/lib/modules/backup
( 2/10) Reloading device manager configuration...
( 3/10) Arming ConditionNeedsUpdate...
( 4/10) Updating module dependencies...
( 5/10) Install DKMS modules

Seems that the /usr/lib/modules/5.11.11-144-tkg-MuQSS/* where created in a previous kernel update and cp can't simply overwrite them.

moviuro commented 3 years ago

That's weird, I can't reproduce. Would you have a short script that could trigger this?

Also, there could be some better logic... If the backup for the current kernel exists AND the current kernel's module don't, THEN restore them from backup. In any case, rm -r the backups.

KVER="${KVER:-$(uname -r)}"; if test -e "/usr/lib/modules/backup/${KVER}" && ! test -e "/usr/lib/modules/$KVER"; then cp -ral "/usr/lib/modules/backup/${KVER}" /usr/lib/modules/; fi; rm -rf /usr/lib/modules/backup
Edu4rdSHL commented 3 years ago

I actually don't have any kind of script that would have triggered it, anyways I have had several kernel updates without rebooting. Maybe that's what actually is causing the problem? That's a common scenario.

moviuro commented 3 years ago

@Edu4rdSHL @alexdewar I've been working on https://github.com/moviuro/mkmm ; the PKGBUILD can be found here https://git.sr.ht/~moviuro/mkmm.PKGBUILD

Edu4rdSHL commented 3 years ago

Hi @moviuro, thank you, I will take a look. Just a question, why don't you put the PKGBUILD in the same Github repo?

moviuro commented 3 years ago

Foxboron's suggestion on IRC. Also, I'm not pushing the PKGBUILD to AUR until I have battle-tested it a bit.

PeterNerlich commented 3 years ago

Sorry to ping everyone, what is the status? How is the battle testing going?

moviuro commented 3 years ago

@PeterNerlich works great on my machine, @edu4rdSHL seems to have some issues with dkms, but I don't use it. Maybe try it yourself? It shouldn't blow up :tm: (https://github.com/moviuro/mkmm)

WhyNotHugo commented 1 year ago

This repo hasn't had any movement in over a year, and the author seems to have been inactive for over half a year. I guess this project is unmaintained at this point?

Any thoughts on replacing the upstream for the kernel-modules-hook package in [community] with an upstream that's still active and has some of these valuable fixes? Or maybe simply replacing it with mkmm in the official repos?

It feels weird that [community] has the slower, unmaintained upstream, and the AUR has the improved version (which also has little activity, but mostly because all fixes are already merged in).

cc: @shibumi

Edu4rdSHL commented 1 year ago

mkmm didn't worked well for me when I tried while kernel-modules-hooks works just fine. I don't see any point on replacing something that works just fine just because the repo "haven't had any movement", there is not need to move anything here.

WhyNotHugo commented 1 year ago

I don't see any point on replacing something that works just fine just because the repo "haven't had any movement"

I'm not suggesting replacing it because of the lack of movement, but rather because of bugs that will never be fixed like the slowness bug being fixed by this patch.

WhyNotHugo commented 1 year ago

What failed with mkmm, any ideas?