You are not logged in.

#1 2012-08-16 15:50:12

axs
Member
Registered: 2009-01-23
Posts: 71
Website

kmod and /lib

(Just a random thought after building a custom kernel from an outdated PKGBUILD)

Building kmod --with-rootprefix=/usr is a Bad Idea™

It breaks the package irreversibly.
With rootprefix=/, one still can run depmod -b /usr . Even without -b, depmod/modprobe built with rootprefix=/ will work on any Arch system as long as /lib is a symlink to /usr/lib.
But rootprefix=/usr can't be undone. depmod will prepend /usr whether or not you ask it to.

I understand it's mostly to force /usr/lib as the only lib.
But why do so if /lib remains a symlink?
Or if /lib is going to be removed completely, why it's not the other way around? (/lib without /usr/lib as some people do)

Offline

#2 2012-08-16 17:49:09

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: kmod and /lib

Why not just update the PKGBUILD instead?

edit: and the symlink might not stick around forever.

Last edited by Mr.Elendig (2012-08-16 17:49:40)


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#3 2012-08-16 17:51:06

progandy
Member
Registered: 2012-05-17
Posts: 5,184

Re: kmod and /lib

But why do so if /lib remains a symlink?

Because the loader/linker in executables is hard coded as /lib/ld-linux, so this path must exist. Also this ensures compatibility with foreign binary packages without source code.

Or if /lib is going to be removed completely, why it's not the other way around? (/lib without /usr/lib as some people do)

Because the /usr-Merge was startet this way by other distributions. Also, now /usr will contain the linux system, /etc the configuration, /home the user data, ...


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#4 2012-08-16 19:10:21

ZekeSulastin
Member
Registered: 2010-09-20
Posts: 266

Re: kmod and /lib

https://mailman.archlinux.org/pipermail … 22625.html

For why /usr over /:
https://mailman.archlinux.org/pipermail … 22629.html

Last edited by ZekeSulastin (2012-08-16 19:16:47)

Offline

#5 2012-08-16 23:42:54

axs
Member
Registered: 2009-01-23
Posts: 71
Website

Re: kmod and /lib

Oh my. Ok, I see, so the idea was to patch it to support both, but people decided to move on without doing that.

And yep, /boot/modules/VER, or /kernel/VER, or /kernel/modules/VER (in that order) makes more sense to me than /usr/lib/modules.

Ok, thanks, I was unaware of the maillist discussion.

progandy: if /lib remains a symlink (for compatibility etc.) it's ok to have kmod built with rootprefix=/ , there's no need to change it to /usr, that's what I meant.

Mr. Elendig: it's not about PKGBUILDs. It's about crippling the package.
Think of fixing a system with /usr on a separate partition and modules in /usr/lib/modules.

Last edited by axs (2012-08-16 23:43:31)

Offline

#6 2012-08-17 00:01:47

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: kmod and /lib

axs wrote:

Think of fixing a system with /usr on a separate partition and modules in /usr/lib/modules.

How does building kmod with prefix=/ help in that case?   /lib is still on usr....


And the /lib symlink will stay around forever.

Offline

#7 2012-08-17 07:08:58

axs
Member
Registered: 2009-01-23
Posts: 71
Website

Re: kmod and /lib

Allan wrote:

How does building kmod with prefix=/ help in that case?   /lib is still on usr....

depmod -b /mnt/mounted-usr-partition 3.4.3-ARCH-1

I know there are (ugly) workarounds, but the points stays: with rootprefix=/usr kmod loses flexibility.

Last edited by axs (2012-08-17 07:11:06)

Offline

#8 2012-08-17 09:42:02

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: kmod and /lib

This seems like a bad bug. kmod should be able to work with any directory. The problem existed before: depmod would only work on /lib/modules/$VERSION/, and now it only works on /usr/lib/modules/$VERSION/. I would expect an option to give it ANY module folder to load.

Offline

#9 2012-08-17 19:29:06

axs
Member
Registered: 2009-01-23
Posts: 71
Website

Re: kmod and /lib

Yeah, that option is (kind of) broken by design, and it's exagerrated by the fact Arch people decided to use it.
I think a good approach here would be to supply a full path to -b, i.e. depmod -b /usr/lib/modules, or depmod -b /lib/modules, with ROOTPREFIX acting as an overrideable default value. But current -b semantics is already in kernel makefiles, so it's not that easy to change.

I checked the code and tweaked it a bit, here's the patch: http://pastebin.ca/raw/2194143
The idea was to have modules in ${rootprefix:-}/${modulesdir:-/lib/modules}/$kversion, and use -b $modulesdir -m $rootprefix to override them.
Among other thing, it would allow placing modules in /boot/$kversion or something like that.

I don't like it yet, internally there's absolutely no reason to have two different variables ($rootprefix and $modulesdir) for the path.

Offline

Board footer

Powered by FluxBB