From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ob0-f174.google.com ([209.85.214.174]:34215 "EHLO mail-ob0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753884AbaIPPsn (ORCPT ); Tue, 16 Sep 2014 11:48:43 -0400 MIME-Version: 1.0 In-Reply-To: <20140914185631.GB18506@kroah.com> References: <20140914100545.3745.23394.stgit@localhost> <20140914153832.GC4064@kroah.com> <5415D10E.90809@yandex.ru> <20140914173919.GA10059@kroah.com> <5415D8FA.8040305@yandex.ru> <20140914181353.GA12497@kroah.com> <5415E00E.1000706@yandex.ru> <20140914185631.GB18506@kroah.com> From: Lucas De Marchi Date: Tue, 16 Sep 2014 12:40:16 -0300 Message-ID: Subject: Re: [PATCH 0/3] Implement /proc/built-in file similar to /proc/modules Content-Type: text/plain; charset=UTF-8 Sender: linux-kbuild-owner@vger.kernel.org List-ID: To: Kirill Tkhai , Greg KH Cc: Michal Marek , arnd@arndb.de, linux-kbuild@vger.kernel.org, lkml , oleg , grant.likely@secretlab.ca, ebiederm@xmission.com, Andrew Morton , ktkhai@parallels.com, sam@ravnborg.org, linux-modules On Sun, Sep 14, 2014 at 3:56 PM, Greg KH wrote: > On Sun, Sep 14, 2014 at 10:35:58PM +0400, Kirill Tkhai wrote: >> >> It's just an unification with /proc/modules. Why should we do any >> difference between external and built-in modules? It's the same, >> it's similar, it's better to parse when they can be shown similar. > > /proc/modules is for loaded modules, and it includes lots of information > that tools rely on. It is also a very old file, no new > non-process-related proc/ files should be created anymore. It's been > that way since sysfs was created (and one of the reasons for sysfs.) Yeah. And let me add that kmod treats /proc/modules as deprecated. It's way nicer to get the information from sysfs. See https://git.kernel.org/cgit/utils/kernel/kmod/kmod.git/tree/README#n116 >> > No, they want the functionality that a module provides, not the module >> > name, or some random configuation option. >> > >> > It seems like you are trying to solve a problem that isn't there. What >> > program is broken right now that this new proc file (or sysfs directory) >> > would fix? >> >> The initial reason was I'm building custom kernels for more than 10 >> years (not so long, I agree), and every boot I see a big list of modules >> from distribution /etc/module, which can't be autoloaded. I prefer to >> build drivers in kernel. I tried to find is there a way for userspace to >> understand that a module are present, but there is no a way. So this is >> a reason. you're probably using ancient userspace. kmod checks the modules.builtin file generated by the kernel buildsys so "modprobe buitin-module" doesn't return an error. > Again, focus on kernel functionality, not module names or config > options, and you should be fine. Yeah... and if you do this way you may not even bother about the module itself. See the output of "kmod static-nodes". These nodes are created by init even if the module itself is not loaded. The right module will be loaded when the node is first accessed. And that includes the "loop" module you mention. $ kmod static-nodes | grep -A3 loop Module: loop Device node: /dev/loop-control Type: character device Major: 10 Minor: 237 -- Lucas De Marchi