kernel-modules-hook icon indicating copy to clipboard operation
kernel-modules-hook copied to clipboard

Drop rsync(1) dependency

Open moviuro opened this issue 4 years ago • 14 comments

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.

moviuro avatar Mar 19 '21 07:03 moviuro

This is an excellent idea!

alexdewar avatar Mar 19 '21 08:03 alexdewar

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 avatar Mar 31 '21 22:03 Edu4rdSHL

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.

Edu4rdSHL avatar Apr 15 '21 01:04 Edu4rdSHL

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

moviuro avatar Apr 15 '21 06:04 moviuro

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.

Edu4rdSHL avatar Apr 15 '21 06:04 Edu4rdSHL

@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

moviuro avatar Apr 20 '21 15:04 moviuro

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

Edu4rdSHL avatar Apr 20 '21 16:04 Edu4rdSHL

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

moviuro avatar Apr 20 '21 19:04 moviuro

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

PeterNerlich avatar May 29 '21 08:05 PeterNerlich

@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)

moviuro avatar May 29 '21 12:05 moviuro

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

WhyNotHugo avatar Nov 17 '22 16:11 WhyNotHugo

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.

Edu4rdSHL avatar Nov 17 '22 16:11 Edu4rdSHL

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 avatar Nov 17 '22 17:11 WhyNotHugo

What failed with mkmm, any ideas?

WhyNotHugo avatar Nov 17 '22 17:11 WhyNotHugo