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

Drop rsync(1) dependency #15

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

moviuro
Copy link

@moviuro moviuro commented Mar 19, 2021

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
Copy link

This is an excellent idea!

@Edu4rdSHL
Copy link

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
Copy link

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
Copy link
Author

moviuro commented Apr 15, 2021

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
Copy link

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
Copy link
Author

moviuro commented Apr 20, 2021

@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
Copy link

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
Copy link
Author

moviuro commented Apr 20, 2021

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

@PeterNerlich
Copy link

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

@moviuro
Copy link
Author

moviuro commented May 29, 2021

@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 ™️ (https://github.com/moviuro/mkmm)

Depends = rsync
Exec = /bin/sh -c 'KVER="${KVER:-$(uname -r)}"; if test -e "/usr/lib/modules/${KVER}"; then rsync -AHXal --delete-after "/usr/lib/modules/${KVER}" /usr/lib/modules/backup/; fi'
Depends = coreutils
Exec = /bin/sh -xc 'KVER="${KVER:-$(uname -r)}"; if test -e "/usr/lib/modules/${KVER}"; then mkdir -p /usr/lib/modules/backup; cp -ral "/usr/lib/modules/${KVER}" /usr/lib/modules/backup; fi'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With cp -ral you can actually drop the -r, as it is already included in the -a flag.

@WhyNotHugo
Copy link

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
Copy link

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
Copy link

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
Copy link

What failed with mkmm, any ideas?

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.

6 participants