Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 274942 - [tracker] sys-apps/module-init-tools-3.9: WARNING: All config files need .conf: /etc/modprobe.d/foo will be ignored in a future releases
Summary: [tracker] sys-apps/module-init-tools-3.9: WARNING: All config files need .con...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords: Tracker
Depends on: 274934 275151 275155 275157 275158 275910 278204 302413 302415
Blocks: 323031
  Show dependency tree
 
Reported: 2009-06-21 13:12 UTC by Martin von Gagern
Modified: 2010-06-07 09:59 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
module-init-tools-3.11.1.ebuild.patch (module-init-tools-3.11.1.ebuild.patch,630 bytes, patch)
2010-01-28 19:48 UTC, Peter Volkov (RETIRED)
Details | Diff
module-init-tools-3.11.1.ebuild.patch (module-init-tools-3.11.1.ebuild.patch,803 bytes, patch)
2010-01-29 09:25 UTC, Peter Volkov (RETIRED)
Details | Diff
module-init-tools-3.11.1.ebuild.patch (module-init-tools-3.11.1.ebuild.patch,835 bytes, patch)
2010-01-29 11:28 UTC, Peter Volkov (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin von Gagern 2009-06-21 13:12:23 UTC
With sys-apps/module-init-tools-3.9, many modprobe invocations by init scripts will result in messages like this:

  WARNING: All config files need .conf: /etc/modprobe.d/foo,
           it will be ignored in a future release.

So I would expect Gentoo to replace all files foo in /etc/modprobe.d with foo.conf in a way that allows for wasy upgrading. A fully updated system should imho not issue any warnings of this kind.

Right now, there are still some packages that haven't switched to .conf files. Looking at the portage tree, these seem to be:
 * app-emulation/kqemu
 * net-dialup/misdn
 * net-dialup/mwavem
 * net-misc/ifenslave
 * net-wireless/ipw3945d
 * net-wireless/irda-utils
 * sys-apps/x86info

But even those that have been switched over will simply create the new foo.conf file, not migrate any existing foo file. This can lead to config changes not noticed by etc-update, as well as conflicting options for some modules. The only exception to this seems to be media-video/em8300-modules which actually does migrate config files in pkg_preinst.

I would wish for every package to use the new foo.conf file names, and to use some migration technique similar to em8300-modules. Given the number of packages affected, maybe an eclass function would be prudent.
Comment 1 Martin von Gagern 2009-06-21 15:44:25 UTC
Possibly related to bug #215626. A proper migration function should take that migration into account as well, as the one from em8300-modules does.
Comment 2 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2009-06-22 19:13:19 UTC
Let's make this a tracker bug for all packages who need adjustment of their files in /etc/modprobe.d/
Comment 3 André Terpstra 2009-06-27 20:51:12 UTC
This happens to the alsa package too, so add media-sound/alsa-utils to the list. It took me some time before I found this out. The problem exists because /usr/sbin/alsaconf creates/edits a file /etc/modules.d/alsa, I think. Adding the relevant lines from this file to /etc/modprobe.d/alsa.conf and subsequently deleting it solves the problem.
Comment 4 Martin von Gagern 2009-07-05 08:14:57 UTC
(In reply to comment #3)
> add media-sound/alsa-utils to the list.

The list is about "packages that haven't switched to .conf files", which doesn't apply to alsa-utils. Instead it belongs to the even larger list of ebuilds that don't migrate old config files properly. A command like "fgrep modprobe.d /usr/portage/*-*/*/*.ebuild" will give you the hopefully complete list, including em8300-modules as a false positive.

I'd like to see one bug report for every such ebuild eventually, but if there is going to be some eclass function to deal with this, it should get written first, so that maintainers taking care of the bugs can immediately build on the eclass. Is this going to happen?
Comment 5 Martin Mokrejš 2010-01-26 23:48:03 UTC
Two more packages: slmodem and madwifi-ng
Comment 6 SpanKY gentoo-dev 2010-01-26 23:59:02 UTC
this is a tracker bug, not a place for you to note packages.  please file a bug for each package.
Comment 7 Peter Volkov (RETIRED) gentoo-dev 2010-01-27 16:04:29 UTC
What shall we do with old files? As noted in bug 302413 and bug 302415 after reemerging new files exist, but old one are still in place too. Should we add ewarn to ask people remove them manually, remove them or... what?
Comment 8 Martin von Gagern 2010-01-27 17:09:06 UTC
Imho the proper approach would be migrating files in pkg_preinst, as I mentioned in comment #0 giving media-video/em8300-modules as an example. I would have liked to see an eclass function for it, as I wrote in comment #4.

Now that plenty of packages have been moved over without such an eclass function, writing such a function would become much messier, as it would have to properly deal with the now common case of both the old and the new file existing. Given the effort it might take to get that right, maybe an ewarn and manual interaction is the proper solution, but I believe you really missed an opportunity there of giving users a clean smooth migration.

Unless those packages have already been stabilized (haven't checked), there is still a chance. Write an eclass function now, migrate old files if the new ones don't exist, or are equal to the new files about to be merged. Only if both old and new files exist, and the new files differ from those about to be installed, then ewarn about the issue and ask users to manually merge them and delete the old one.
Comment 9 SpanKY gentoo-dev 2010-01-28 00:10:01 UTC
we could add a general routine to module-init-tools when it upgrades to compare files in the dir and auto delete non-.conf files when they're duplicated, or rename them to magic ._cfg_xxxx style so that they show up in etc-update automatically.

we could also add a pkg_setup() check that scans the modprobe.d dir and refuses to upgrade if a config file was found that didnt have a .conf version at all.
Comment 10 Peter Volkov (RETIRED) gentoo-dev 2010-01-28 19:48:06 UTC
Created attachment 217766 [details, diff]
module-init-tools-3.11.1.ebuild.patch

This patch does the first part: in case there are both file and file.conf it'll rename file into ._cfg_????_file.conf. I think this is rather safe and should cover cases in bugs I've mentioned. For other cases I'm sure manual intervention will be required, but it's better to postpone this until support for files without .conf will be dropped.

Please, review and if this code is ok, commit.
Comment 11 Martin von Gagern 2010-01-28 20:14:23 UTC
(In reply to comment #10)
> Please, review and if this code is ok, commit.

This might confuse users, as their etc merging tools will compare files in the reverse order of how they are usually handled:
1. old version of package foo merges "foo"
2. user maybe edits "foo"
3. newer version of package merges "foo.conf"
4. etc-update doesn't notice the duplicate config files at all
5. updating module-init-tools moves "foo" to "._cfg_0000_foo.conf"
6. now the old ex-"foo" is considered a new replacement for the new "foo.conf"
Users pressing well-known keys for "simply keep my stuff" or "simply use new stuff" will get unexpected results in this scenario.

Furthermore, there are some issues with the patch. First and foremost, it checks the existence of ${cfg} but moves to ${cfg}.conf. I guess you'd want to use ${cfg}.conf in all cases, or include the .conf in ${cfg}.

I'm not sure if it would be worth the effort to check whether there are any filles called ._cfg_*_foo not ending in .conf. If so, the users might miss some reconfigurations, but I doubt that should be an issue. I'm more worried about stale config files, and how config merging tools would deal with them.

It seems to me slightly inconsistent to use ${f%/*} for the dir part but {f/*\/} for the basename part; I'd personally prefer ${#*/} for the latter. Minor cosmetic issue, though.

I also believe that occurrences of ${f} and derived values should be quoted in the mv invocation. Both ROOT and the file basename might contain spaces.
Comment 12 SpanKY gentoo-dev 2010-01-28 20:52:12 UTC
agreed, you want to rename the newer ".conf" version to the _cfg_xxx and rename the older non-.conf version with a .conf suffix

your patch also has a little odd style ...
 - to chop the tail, use: ${f%.conf}
 - might want to create a local "d" variable to hold the dir to clarify things
 - the final `mv` needs quoting around variables
 - i'm guessing "f" is already declared local earlier on in the func
Comment 13 Peter Volkov (RETIRED) gentoo-dev 2010-01-29 09:25:07 UTC
Created attachment 217797 [details, diff]
module-init-tools-3.11.1.ebuild.patch

Many thanks Martin and Mike. This is an updated version of patch. I hope this version is clearer (and bug free). Please, review another time.
Comment 14 Martin von Gagern 2010-01-29 09:41:38 UTC
(In reply to comment #13)
> Created an attachment (id=217797) [details]
> module-init-tools-3.11.1.ebuild.patch
> 
> Many thanks Martin and Mike. This is an updated version of patch. I hope this
> version is clearer (and bug free). Please, review another time.

Looks much better. I guess I'd use "cd ..." and "cd - > /dev/null" instead of "pushd" and "popd", but that's mostly a matter of taste.

I also believe that the first cd should die on error. Or maybe not die, but eerror and return. Yes, ${ROOT}/etc/modprobe.d/ should exist, but if anything strange happens and it doesn't, we don't want to garble the current directory (which according to PMS is undefined).
Comment 15 Peter Volkov (RETIRED) gentoo-dev 2010-01-29 11:28:24 UTC
Created attachment 217824 [details, diff]
module-init-tools-3.11.1.ebuild.patch

Let's just do nothing in case such dir does not exist.
Comment 17 Martin von Gagern 2010-02-15 07:02:25 UTC
(In reply to comment #16)
> ive implemented support [...]

I'd suggest elog instead of einfo when asking users to etc-update, but besides that it looks fine to me. Yes, I should have spotted the einfo earlier, sorry.
Comment 19 Martin Mokrejš 2010-02-18 21:29:54 UTC
The patches work as intended (http://bugs.gentoo.org/show_bug.cgi?id=302413#c6). It is a pity that there is no way to just rename user's current foo file to foo.conf and install the default file under ._cfg*foo.conf instead.
Comment 20 SpanKY gentoo-dev 2010-06-07 09:59:30 UTC
no more open issues i believe