Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756137AbbEEW0t (ORCPT ); Tue, 5 May 2015 18:26:49 -0400 Received: from know-smtprelay-omc-7.server.virginmedia.net ([80.0.253.71]:38351 "EHLO know-smtprelay-omc-7.server.virginmedia.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752091AbbEEW0q (ORCPT ); Tue, 5 May 2015 18:26:46 -0400 X-Originating-IP: [81.106.150.188] X-Spam: 0 X-Authority: v=2.1 cv=cpwVkjIi c=1 sm=1 tr=0 a=DGj713NdaxKrsjjgQne7PA==:117 a=DGj713NdaxKrsjjgQne7PA==:17 a=J0QyKEt1u0cA:10 a=IkcTkHD0fZMA:10 a=NLZqzBF-AAAA:8 a=h1PgugrvaO0A:10 a=kcI5pybOL0BI91yQp7EA:9 a=QEXdDO2ut3YA:10 Date: Tue, 5 May 2015 23:26:44 +0100 From: Ken Moffat To: linux cbon Cc: Richard Weinberger , LKML Subject: Re: how to have the kernel do udev's job and autoload the right modules ? Message-ID: <20150505222644.GA27497@milliways> References: <5547B89B.5070502@nod.at> <5547FFB8.5050007@nod.at> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Clacks-Overhead: GNU Terry Pratchett Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3324 Lines: 66 On Tue, May 05, 2015 at 06:08:01PM +0000, linux cbon wrote: > On Mon, May 4, 2015 at 11:24 PM, Richard Weinberger wrote: > > You can build in the needed modules or just use udev... > > Sorry , but I don't want a monolithic or a huge kernel with many modules inside. > I want a minimal and modular kernel which only loads the needed modules. > If I understand, there are 2 choices left : > 1/ the kernel without modules has a minimal builtin support for my > network (RTL8111/8168B) > and my sound (RS780 and SBx00) ... but it doesn't seem the case. I don't think you have ever given any context about what you are trying to do. It looks to me as if there are two alternatives: 1. You are building for a particular machine. Either build everything into the kernel, or use an initscript to load the modules. For an x86 machine, the only reason to use modules in this situation (apart from giving them a compile-test in the kernel) would be to save memory, e.g. by not loading sound in runlevel 1. Using modules seems to offer minimal benefits in that situation. 2. You are building a distro. For most distros, the need to support as many users as possible is important. Limiting the network to juut 2 modules, and the same with audio, does not seem to make any sense. So, if this is a distro, the target is a tiny number of machines, and you got lucky in only having two different network drivers and two sound drivers. If this is a "one build will run on all my own machines" system, you could identify the particular machine in an initscript (check `uname -n`) and modprobe the required modules. Or, you could perhaps build both these options into a monolithic kernel. You said you don't want a huge kernel, but you appear to be saying that only two things differ. Personally, I think that using a *specific* .config for each of my machines is the way to go. But then, I happily use eudev (with some of my own initscripts, e.g. to control cpufreq). >From your comment, I assume you have already removed all the config options you do not use - if so, you are doing better than I am. My point here is that, at least on a machine from the last few years, you probably have enough RAM that wasting a little of it by building too much into your kernel is not a significant problem. ... > I don't add modprobes in my sysinit, because I find it's a dirty > workaround, it's manual, > it works only for one kind of hardware and not for another etc. If you think modprobe is a dirty workaround (really?) but you want to use a semi-generic kernel without a udev variant, you don't seem to leave yourself a lot of space to do things on a desktop machine. What is so dirty about modprobe ? Make a list of your hardware, per machine (by this stage I'm fairly sure you want to use one kernel for both, or all, your machines) and write a simple shell script to work out which machine it is running on, and load the correct modules. ĸen -- Nanny Ogg usually went to bed early. After all, she was an old lady. Sometimes she went to bed as early as 6 a.m. -- 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/