Arun Raghavan posted on Sun, 30 Aug 2009 19:54:47 +0530 as excerpted:

> 2009/8/30 Matthias Schwarzott <z...@gentoo.org>:
>> Hi there!
>>
>> The new udev-145 and newer have some new kernel requirements. How
>> should the ebuild verify they are met?
>> Some possible ways:
>> 1. Check config under /usr/src/linux
>> 2. Check /proc/config.gz
>> 3. Print message for user in pkg_postinst
> 
> All of the above? Rationale being (1) is required to check against the
> kernel you're supposedly using, (2) for the kernel you definitely are
> using, and (3) to make sure people remember.

Indeed, all of the above, but not requiring the first two only giving 
their status in #3.

Some people don't have the kernel option enabling /proc/config.gz turned 
on, so #2 isn't reliable, and #1, /usr/src/linux, could point who /knows/ 
where, maybe something current, maybe not.  (Here, it points at my local 
kernel git repo... which may or may not correspond to the currently 
running kernel, tho it's usually reasonably close, and it's usually 
within a few days of upstream unless I'm git bisecting some bug.)

Thus, neither of the first two is reliable, but checking them and putting 
the status in #3 should be helpful.

Another alternative, ultimately safer: add another option, and require 
that at least one of the three pass:

1-2 as they are.

3. Check UDEV_ASSUME_KERNEL_OPTS in the environment (could be set in 
make.conf for portage and compatible PMs).

Then in the message corresponding to the original #3 except presumably in 
unpack or prepare, report status as a reminder, and die if none of the 
above tests pass.  #3, the env var, would allow users to override without 
hacking the ebuild itself, if for some reason they decided they needed 
to.  If it's the only one that passes, ewarn/eerror to the effect 
"Relying on UDEV_ASSUME_KERNEL_OPTS override.  If it breaks, you get to 
keep the pieces!"

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman


Reply via email to