LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-27-2009, 04:21 AM   #1
Kesem
LQ Newbie
 
Registered: Jul 2009
Posts: 11

Rep: Reputation: 0
What do the configuration options in initramfs.conf mean?


The following wall of text exists in the initramfs-tools/initramfs.conf

Code:
#
# MODULES: [ most | netboot | dep | list ]
#
# most - Add all framebuffer, acpi, filesystem, and harddrive drivers.
#
# netboot - Add the base modules, network modules, but skip block devices.
#
# dep - Try and guess which modules to load.
#
# list - Only include modules from the 'additional modules' list
#

MODULES=most
Most seems to be the intuitive option of course, but what do each of these options actually do?

How does "try and guess which modules to load" work?
Does netboot include "most" (add the base modules...) and more, or is it
a different set of modules?
Does most actually mean 'all'?
Only include modules from the 'additional modules' list.. where is this list?

These options are very unclear, if anyone could please elaborate, go into detail about them, or link me to a FAQ (or man page? Neither of which I could find..) I'd appreciate it.

Thanks.
 
Old 07-27-2009, 09:41 AM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Jessie (Fluxbox WM)
Posts: 1,387
Blog Entries: 52

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
Quote:
These options are very unclear, if anyone could please elaborate, go into detail about them, or link me to a FAQ (or man page? Neither of which I could find..) I'd appreciate it.
Well, the man page for initramfs.conf is no more helpful!

The 'most' flag will not be all modules (since there are plenty of modules for peripheral devices that have no relevance to the boot). It is just all the modules that might be required for the boot (eg acpi driver modules in case the boot is a resume, block devices since they might contain the boot filesystem, etc).

The purpose of the 'netboot' flag is to leave out any of the storage devices (eg ide, scsi etc), since the intention here is to boot the system via the network, so none of these block devices will be required. Instead of block devices, it will include the network drivers.

The 'list' flag text is referring to the module list inside /etc/initramfs-tools/modules (see the man page for mkinitramfs). The idea of this is that you can build a minimal initramfs that is customized for a particular system (with only the modules that are really needed).

I don't know how the dep flag works.
 
Old 07-28-2009, 02:35 AM   #3
Kesem
LQ Newbie
 
Registered: Jul 2009
Posts: 11

Original Poster
Rep: Reputation: 0
Thanks for your answer.

I looked at the scripts for mkinitramfs with my minimal scripting knowledge and I came across these lines:

Code:
for d in bin conf/conf.d etc lib modules sbin scripts ${MODULESDIR}; do
mkdir -p "${DESTDIR}/${d}"
done

### here are the lines i'm talking about ###
# MODULES=list case. Always honour.
for x in "${CONFDIR}/modules" /usr/share/initramfs-tools/modules.d/*; do
if [ -f "${x}" ]; then
add_modules_from_file "${x}"
fi
done

if [ "${MODULES}" = "dep" ]; then
dep_add_modules
fi

if [ "${MODULES}" = "most" ]; then
auto_add_modules
fi

if [ "${MODULES}" = "netboot" ]; then
auto_add_modules base
auto_add_modules net
fi

### end of the lines i'm talking about ###
# Have to do each file, because cpio --dereference doesn't recurse down
# symlinks.
First of all I notice that it doesn't even check if $MODULES = "list" before adding the modules from the modules file, it -always- does it.

And then, for the three other cases, it uses dep_add_modules, auto_add_modules, and auto_add_modules PARAMETER.
While I do have only a minimal knowledge of bash scripting, I can usually figure things out from their context, whereas here I'm stumped - there are no such functions defined in the same script file, these are not programs.. I don't know where they're referenced, I don't know anything about them. What is this? I try to find the implementations for these but I don't know where to start.
 
Old 07-28-2009, 02:40 AM   #4
Kesem
LQ Newbie
 
Registered: Jul 2009
Posts: 11

Original Poster
Rep: Reputation: 0
I may have been a little hasty in asking my question. A quick search
on Google brought me to /initramfs-tools/hook-functions where I found
the definitions of all these functions.
 
Old 07-28-2009, 02:52 AM   #5
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Jessie (Fluxbox WM)
Posts: 1,387
Blog Entries: 52

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
Quote:
First of all I notice that it doesn't even check if $MODULES = "list" before adding the modules from the modules file, it -always- does it.
Yes, this makes sense - normally the modules list file is for additional modules that are required on a particular setup, but are not in the typical groups loaded. For example, you might add in modules for an experimental boot device. So normally it would be empty.

This is different to the case where the 'list' flag is specified, because then you are trying to build a minimal initramfs, and will probably specify a number of modules in the file. Arguably the file is being used for two different purposes, depending on the flag.

For the hook functions, have a look in /usr/share/initramfs-tools/hook-functions.

Last edited by neonsignal; 07-28-2009 at 03:03 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
pass options to modules in mkinitrd.conf bonaire Slackware 9 08-15-2009 12:15 AM
do I need these inetd.conf options rbees Linux - Security 4 01-05-2009 06:16 PM
xorg.conf Device/Screen Options Azizcoos Linux - Software 2 01-06-2007 05:35 PM
apt-build.conf....file options utanja Debian 4 02-26-2005 07:02 PM
modules.conf question, options gpeterson1 Linux - Hardware 6 02-24-2003 05:08 PM


All times are GMT -5. The time now is 06:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration