Commit Graph

64 Commits

Author SHA1 Message Date
Warren Togami
71afe645d7 Exclude i2o_scsi driver.
This kernel module is dangerous to load here.  It is meant only to allow direct
access to SCSI disks, which can destroy data.  The i2o_block driver gives you
access to the defined hardware RAID arrays.
2009-06-11 19:28:02 -04:00
Harald Hoyer
c1d71b7ea3 fix dracut logging 2009-06-04 13:17:57 +02:00
Victor Lowther
71a19ef6e0 Excise excess logging verbosity when installing kernel modules. 2009-05-30 12:04:33 -05:00
Victor Lowther
ac9a118354 Fix bug in kernel module loading
We were not loading all the required kernel modules due to a bug in the
dependency checking code.  This was causing us to load only the first
dependent module and ignore the rest.
2009-05-30 10:52:12 -05:00
Victor Lowther
4cf262689e Modify kernel module installation routine to respect --hostonly.
If dracut was run with --hostonly, instmods will only load a module
into the initramfs if it is already loaded on the host machine.

This really trims the fat out of a --hostonly  generated initramfs, and
eliminates the need for the kernel-modules-loaded hook.

This patch also allows a module to flag that it should only load as
a dependency by exiting 255 instead of 0.  Currently, only the network module
uses this functionality.
2009-05-29 23:07:56 -05:00
Victor Lowther
1a918b40b6 Log dracut output.
If we are installed, log to /var/log/dracut.log.
If we are not installed, log to /tmp/dracut.log
2009-05-28 21:41:05 -05:00
Victor Lowther
c93d9f6265 Fix firmware installation.
Instead of calling firmware checking once per instmods invocation,
call only when we install an actual module on the initramfs.
2009-05-28 21:13:16 -05:00
Warren Togami
e19d6bf603 Disambiguate modules and drivers. modules are dracutmodules. drivers are kernel modules. 2009-05-28 14:27:02 -04:00
Victor Lowther
0c2e3d1221 Add infrastructure for dracut module dependency checking.
This also eliminates --skip-missing.  Check scripts should now check
to ensure that any files and settings they will copy from the host
system actually exist when called without arguments.

The check scripts are also updated to not try to source dracut-functions
which(1) is a perfectly good way of checking if a command is on the path.
2009-05-25 17:49:39 +02:00
Harald Hoyer
b649f1c21b let find_rule find absolute path rules 2009-05-25 14:08:39 +02:00
Victor Lowther
cdad82fd14 Changed multiline conditional lists to if statements in dracut-functions
It seems that some people object to multiline conditional lists.
Oh, well, no accounting for taste.
2009-05-25 12:03:39 +02:00
David Dillow
5686cd41d6 dracut-funtions: fix 'instmods =modname'
Move srcmods definition into the function, as $kernel isn't defined yet when
dracut-functions is sourced from dracut.

Signed-off-by: David Dillow <dave@thedillows.org>
2009-05-25 11:51:36 +02:00
Andreas Thienemann
84ffb877fd dinfo print only when verbose defined 2009-05-20 12:30:22 +02:00
Andreas Thienemann
0053156804 Fix "--debug" parameter for dracut
remove "-d" as a short-alias for --debug. It collides with the
--driver short-alias.

If --debug is set, inst_script() spews binary "garbage" to the screen
which are interpreted as control characters by the terminal, prompting
the user to call "reset" after dracut has finished. This is related to
set -x  printing binary headers from files to stdout.
As inst_script() is only checking if it is a script it should copy by
reading the first 80chars of the file and checking for the shebang line,
it is safe to call tr on the read in data and remove all unprintable
chars if the debug switch is set.
2009-05-20 09:03:01 +02:00
Harald Hoyer
6fac46910c add derror(), dinfo() and dwarning() 2009-05-15 12:45:21 +02:00
Victor Lowther
8faaa8f082 Change default install target for udev rules.
Also make sure that udev does not complain about a missing rules.d directory.
2009-03-20 03:08:40 -05:00
Harald Hoyer
5c86253310 fixed bash error in inst_binary()
./dracut-functions: line 108: syntax error near unexpected token `<'
./dracut-functions: line 108: `    done < <(ldd $bin 2>/dev/null)'
2009-03-09 09:17:41 +01:00
Victor Lowther
496d08bb19 Some versions of udevd do not look for rules in /lib/udev/rules.d
For those versions, install rules to /etc/udev/rules.d instead.
2009-03-07 09:11:00 -06:00
Victor Lowther
47507b21a8 Added a comment for instmods. 2009-03-06 21:45:34 -06:00
Victor Lowther
3198f1711f Fix broken -c handling and give instmods a little optimization. 2009-03-06 21:41:31 -06:00
Victor Lowther
8d38524882 Fix formatting in instmods a bit. 2009-03-06 14:00:34 -06:00
Victor Lowther
c7b2624f2e Simplify inst_script a bit
We do not need separate source and target parameters, so do not use them.
2009-03-06 13:58:56 -06:00
Victor Lowther
6b25d71acd Rename find_file to find_binary and simplify it.
Since we are not using find_file as a general-purpose file existence
testing function anymore, it can be made simpler.
2009-03-06 13:56:06 -06:00
Victor Lowther
992acaa9d0 Make calling modprobe look prettier. 2009-03-06 13:51:28 -06:00
Victor Lowther
74534e19c9 Remove a useless use of cat in instmods
We also need to decide whenter we are going to support modules.* files.

Not only are they Fedora-specific, but doing so makes =* arguments to instmods
have two different and incompatible meanings depending on whether that file
exists.
2009-03-06 13:50:04 -06:00
Victor Lowther
34fffd88ce inst never takes 3 arguments anymore.
Remove the misleading help message and the 3 argument processing.
2009-03-06 13:44:48 -06:00
Harald Hoyer
8e7089689f add --ignore-install to modprobe calls 2009-03-06 15:39:02 +01:00
Harald Hoyer
2749c2f320 fixed the use of e.g. instmods =drivers/foobar 2009-03-06 15:37:16 +01:00
Harald Hoyer
cfee8a70c0 fixed the use of e.g. instmods =drivers/foobar 2009-03-06 15:25:04 +01:00
Harald Hoyer
52245267a4 fixed instmods 2009-03-06 15:11:42 +01:00
Harald Hoyer
86c9fa4847 add the special "=ata" case for instmods 2009-03-06 15:09:44 +01:00
Harald Hoyer
20122a83f8 used modules.<subsystem> if present for instmod =<subsystem> 2009-03-06 14:35:19 +01:00
Harald Hoyer
1e5527e3e2 fail, if install failed 2009-03-06 10:32:17 +01:00
Harald Hoyer
59dc373677 keep compat arguments for "inst" 2009-03-05 17:13:34 +01:00
Harald Hoyer
0f9c78c104 merge fix, find_binary 2009-03-04 17:29:42 +01:00
Victor Lowther
54b4419653 Fix several inst functions.
Move file existence checking into the individual inst functions. This makes
things a bit easier to understand and maintain.
2009-03-04 17:18:47 +01:00
Victor Lowther
09805e02b8 Get rid of some RedHat specific modules and udev rules
They are not needed to boot with dracut, so away they go.

Also rewrite inst_rules to automatically search likely rule locations when
installing udev rules.
2009-03-04 17:14:53 +01:00
Victor Lowther
ca7d88da13 Modify instmods to not rely on the existence of modules.* files
This patch series aims to make dracut more distro-independent.  It includes
some of the functionality that Seewer Philippe posted to the list to make
dracut work on Ubuntu.

depmod does not create these files on all distros (Debian, specifically),
so modify instmods to use pathname components and find to do what we want.

As a bonus, this removes the special-case for =ata.
2009-03-04 17:11:11 +01:00
Seewer Philippe
7bcacaaa5f Create directories for symlinked libraries if needed
Sometimes symlinks for libraries reside in weird places. Create those
weird places if necessary.

--
  dracut-functions |    1 +
  1 files changed, 1 insertions(+), 0 deletions(-)
2009-03-04 17:10:51 +01:00
Seewer Philippe
9f88fcd94b Canonicalize symlinks
When handling links sometimes one readlink isn't enough. Dracut doesn't
need to clone a whole link series, so just use readlink -f

--
  dracut-functions |    8 +++-----
  1 files changed, 3 insertions(+), 5 deletions(-)
2009-03-04 17:10:03 +01:00
Seewer Philippe
59e3c455b8 Make bash regexes behave
On some systems with newer or unpatched bash versions the whole right
portion of =~ is considered part of the regex. Means we need to get rid
of enclosing ''.

This patch fixes this.

--
  dracut-functions |    8 ++++----
  1 files changed, 4 insertions(+), 4 deletions(-)
2009-03-04 17:07:46 +01:00
Seewer Philippe
9b88534374 Fix find_binary always succeeding
find_binary inside dracut-functions always succeeds. Independent of
whether the file actually exists or not.

This patch fixes this.

And since we're using the function not only to find binaries at little
enhancement there shouldn't be that bad either.

--
dracut-functions |   21 ++++++++++++++++-----
  1 files changed, 16 insertions(+), 5 deletions(-)
2009-03-04 17:05:58 +01:00
Seewer Philippe
acf324172d Fix instmods recursing indefinitely
the instmod function inside dracut-functions starts to recurses indefinitely
if modprobe --show-depends is used and the output contains module options.

Example:

#modprobe --show-depends libata
insmod /lib/modules/2.6.27-11-generic/kernel/drivers/acpi/dock.ko
insmod /lib/modules/2.6.27-11-generic/kernel/drivers/scsi/scsi_mod.ko
insmod /lib/modules/2.6.27-11-generic/kernel/drivers/ata/libata.ko ignore_hpa=1

This patch fixes this.

--
 dracut-functions |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
2009-03-04 17:01:53 +01:00
Victor Lowther
53f954561a [PATCH 49/50] Modify hook loading to make it slightly easier to script.
Modules are now responsible for loading their hooks into the initrd.

This should be all the structure we need to make it easy for things
to integrate with dracut -- now to document and test it all.
2009-02-16 13:56:51 -05:00
Victor Lowther
f04dc5f312 [PATCH 48/50] Shift some functionality around, make modules maskable.
Most of our functionality is now in scripts that we source rather than in the
main dracut script.
2009-02-16 13:56:42 -05:00
Victor Lowther
f4fff04ef1 [PATCH 47/50] Split out the various things we load into their own modules.
This should make it easier for distros to customize things according to
their preferences.
2009-02-16 13:56:42 -05:00
Victor Lowther
bff8c33c2b [PATCH 46/50] fixed library-matching regex
Forgot about /lib64
2009-02-16 13:56:42 -05:00
Victor Lowther
aeaaa812d2 [PATCH 45/50] Really die if a library is not found.
Also explain how to find it.
2009-02-16 13:56:42 -05:00
Victor Lowther
7d18dca5c1 [PATCH 43/50] Use ldd to find shared library deps.
This replaces the eu-readelf and ld-linux.so.2 hackery.

As a bonus it will keep working if we (for some bizzare reason) need
to load a non-elf executable or shared library on the initrd.
2009-02-16 13:56:42 -05:00
Victor Lowther
1513676235 [PATCH 42/50] Add very basic module functionality to dracut.
Move the i18n stuff to it.
2009-02-16 13:56:42 -05:00