Messages in this thread | | | Date | Fri, 26 May 2006 09:35:30 -0600 | From | "Brian F. G. Bidulock" <> | Subject | Re: How to check if kernel sources are installed on a system? |
| |
Arjan,
On Fri, 26 May 2006, Arjan van de Ven wrote:
> On Thu, 2006-05-25 at 18:29 -0400, Lee Revell wrote: > > On Thu, 2006-05-25 at 21:19 +0000, devmazumdar wrote: > > > How does one check the existence of the kernel source RPM (or deb) on > > > every single distribution?. > > > > > > We know that rpm -qa | grep kernel-source works on Redhat, Fedora, > > > SuSE, Mandrake and CentOS - how about other RPM based distros? How > > > about debian based distros?. There doesn't seem to be a a single > > > conherent naming scheme. > > > > I'd really like to see a distro-agnostic way to retrieve the kernel > > configuration. /proc/config.gz has existed for soem time but many > > distros inexplicably don't enable it. > > /boot/config-`uname -r` >
Redhat and SuSE put /boot/config- files of the same name for different architectures (i386, i586) in the same file. If multiple architecture kernels of the same verion are installed, there is no guarantee that the /boot/config-`uname -r` is not for, say, i686 instead of i386. It takes
rpm -q --qf "%{ARCH}" --whatprovides /boot/config-`uname -r`
complared with
uname -m
to see if the mismatch occurs.
Debian (Woody), OTOH strips extra names of their kernels, so 3 or 4 different releases of the same upstream kernel version all install with the same name and report `uname -r` the same. If multiple of these kernels and a vanilla kernel are installed, their config files will be difficult to distinguish. dpkg can be used (similar to above for rpm) to test the condition.
/boot/config-`uname -r`
works reliability only on Mandrake.
--brian
-- Brian F. G. Bidulock ¦ The reasonable man adapts himself to the ¦ bidulock@openss7.org ¦ world; the unreasonable one persists in ¦ http://www.openss7.org/ ¦ trying to adapt the world to himself. ¦ ¦ Therefore all progress depends on the ¦ ¦ unreasonable man. -- George Bernard Shaw ¦ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |