Commit Graph

206 Commits

Author SHA1 Message Date
Cong Wang
426b68b20a Fix get_maj_min() to follow symlink
Otherwise get_maj_min /dev/mapper/vg_cr0-lv_home will return 0:0.

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
2012-01-13 11:35:49 +01:00
Cong Wang
1b7fd0fa3e Check module dependencies of mount points
Like -H, we need to poll every module to check if it is needed
to mount a specific device in '--mount'.

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
2012-01-13 11:35:49 +01:00
Colin Guthrie
62073c3048 udev: Attempt to install any programs used by udev rules. 2012-01-09 13:34:51 +01:00
Harald Hoyer
480d772f22 */module-setup.sh: use host_fs_types host_devs
For the $hostonly case, use $host_fs_types and $host_devs to determine,
if a module has to be included in the initramfs.
2011-12-15 14:49:03 +01:00
Harald Hoyer
7ae5d9d11d dracut: export host_fs_types host_devs
Determine devices and filesystems to be included in the host-only
initramfs image.

To get a minimal initramfs, which can mount
 /
 /etc
 /usr
 /usr/bin
 /usr/sbin
 /usr/lib
 /usr/lib64
 /boot
we look in fstab for the corresponding devices and determine their and
their slaves' filesystem type and put all that in $host_fs_types
and $host_devs.
2011-12-15 10:33:26 +01:00
Brian C. Lane
03cec38834 inst_script should call inst_simple (#750603)
inst_script checks for a shebang, if it doesn't exist it exits.
If it does it should not be calling inst_binary, it should call
inst_simple like it used to.
2011-11-02 08:18:26 +01:00
Harald Hoyer
f60995adb4 dracut-functions:inst_script() call inst_binary() with found bin
call inst_binary() with the already found executable to prevent
searching for the binary again
2011-10-21 12:33:05 +02:00
Harald Hoyer
4637c5c242 dracut-functions: do not install files from current directory
Protect against relative pathnames without a slash for all inst_*()
functions.
2011-10-21 10:57:13 +02:00
Harald Hoyer
b01885338b dracut-functions: inst_dir() handle relative symlinks 2011-10-20 13:06:53 +02:00
Michal Soltys
c32bda6bb9 bash3 compat patch
This patch replaces:

- {var}>... redirections with functionally identical eval construct +
  explicit FDs
- ^^ and ,, case modifiers with temporary shopt

This allows us to lower minimum required bash version
to at least 3.1 (with current code).

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-10-11 09:37:01 +02:00
Michal Soltys
c44e3cb4e5 dracut-functions: conv/normalize minor corrections
mostly with reference to earlier commit:

- bash doesn't need unsetting locals
- make normalize_path() a bit faster, also make sure we remove all
  trailing slashes
- normalize paths before tests

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-10-10 11:54:26 +02:00
Michal Soltys
c1609dd497 convert_abs_rel() fixups
- IFS was not preserved, and modified value could leak to outside functions

- the '.' relative path should be returned for arguments such as /x/y/z
  /x/y - but not for $1 == $2 ones

- $1 == $2 is self-looping link, so it returns final component of its
  name

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-10-10 11:54:25 +02:00
John Reiser
9e103df45e dracut [PATCH] Parameter expansion occurs before command evaluation.
Bash shell expands all ${parameter} before evaluating a command.
For multiple declarations and assignments within the same 'local' command,
then new variables or new values that appear towards the left
do not affect parameter expansion towards the right.

--
John Reiser, jreiser@BitWagon.com

>From 507ad6f66fc66f868a9e5fdd3806e012c4022baa Mon Sep 17 00:00:00 2001
From: John Reiser <jreiser@BitWagon.com>
Date: Fri, 23 Sep 2011 07:37:43 -0700
Subject: [PATCH] Parameter expansion occurs before command evaluation.

${parameter} on the right is expanded before evaluating "local var=value"
on the left.
2011-09-30 09:40:49 +02:00
Harald Hoyer
08769b7f8a dracut-functions: inst_rules() add missing "" 2011-09-22 16:14:38 +02:00
Harald Hoyer
76f5fa549c dracut-functions: inst_rules() do not check std dirs for abs path
if an absolute path is given, we should not check the standard udev rule
directories.
2011-09-22 15:43:34 +02:00
Harald Hoyer
59f288ce63 dracut: cp with sparse 2011-09-02 19:19:40 +02:00
John Reiser
f9708da223 instmods: factor out egrep of "FATAL: Module .* not found" 2011-09-01 10:30:59 +02:00
John Reiser
0024702fe7 instmods: sanity for _mpargs 2011-09-01 10:30:58 +02:00
John Reiser
881eda695e instmods: get filenames from stdin if no args; use it
Use bash  "[[ string =~ pattern ]]"  instead of "egrep -q".
Replace control-dominated serial fondling
	for var in $(proc1); do proc2 var; done
with data-dominated parallel pipeline
	proc1  |  while read var; do proc2 var; done
Together this is a large savings.

[harald@redhat.com: fixed network kernel module filter]
2011-09-01 10:30:29 +02:00
John Reiser
e6024e0030 install_kmod_with_fw: make fast case faster 2011-09-01 10:03:57 +02:00
John Reiser
ceebd9ac76 filter_kernel_modules is a specialized filter_kernel_modules_by_path 2011-09-01 10:03:54 +02:00
John Reiser
3f590c7840 inst_simple, inst_dir: make fast case faster
This small stuff saves 1.7% per dropped statement during "dracut --profile".
Fixing the comment about /lib -> lib64 is REQUIRED!
2011-09-01 10:03:54 +02:00
Harald Hoyer
5f06f0c367 dracut-functions: hmac checksum files can be symlinks, too
use inst() instead of inst_simple() to install the hmac files
2011-08-31 15:22:09 +02:00
John Reiser
f4ca564ba6 build initramfs: unclear _mpargs in instmods()
The local variable _mpargs in function instmods() in file dracut-functions
looks peculiar.  The documentation is non-existent, but still ...

First, $_mpargs is not passed to modprobe via for_each_kmod_dep.
This is strange because my guess is that "_mpargs" means
"extra arguments for modprobe".

Second, the leading "--" will be lopped when a leading pathname
is stripped via
	_mod=${_mod##*/}
It seems to me that a leading "--" should inhibit modification.

Here's the corresponding patch to current HEAD (from dracut-013.)
2011-08-30 13:58:45 +02:00
Harald Hoyer
8cf621ffd9 dracut-functions: fix inst_dir() for non-absolute dirs 2011-08-23 12:50:03 +02:00
Amadeusz Żołnowski
3378a54f15 dracut-functions: new function: inst_any [-d dest] f1 [f2 [f3 ...]] 2011-08-22 11:19:19 +02:00
Harald Hoyer
a76dc27801 dracut-functions: speed up inst_dir() 2011-08-19 10:24:49 +02:00
Harald Hoyer
d670e21998 dracut-functions: s/emergency-shutdown/shutdown-emergency/g 2011-08-17 17:40:59 +02:00
Harald Hoyer
2ae52e649b dracut-functions: fixed inst_dir for symbolic links 2011-08-12 15:56:14 +02:00
Harald Hoyer
1610a566c6 dracut-functions: use "type -P" for find_binary() 2011-08-12 13:22:17 +02:00
Harald Hoyer
e59f58f854 use inst_simple to install non-binary files 2011-08-12 13:11:30 +02:00
Harald Hoyer
4073c8159c add filter_kernel_modules_by_path() to speed up module search 2011-08-12 10:29:00 +02:00
Amerigo Wang
31f1c02dda dracut: add --force-add option
This patch adds a new option --force-add, which
can force dracut to load some module when -H
is specified.

Signed-off-by: Amerigo Wang <amwang@redhat.com>
2011-08-11 14:27:27 +02:00
Harald Hoyer
e51260e4fe dracut-functions: create relative symlinks for libraries 2011-08-10 18:43:54 +02:00
Harald Hoyer
626d9eba9c dracut-functions: remove double slashes, for symlink conversion
remove double slashes for symlink conversion from absolute to relative
2011-07-25 14:28:55 +02:00
Harald Hoyer
7b07f4e83f dracut-functions: resolve relative path and recursively install destination 2011-07-25 10:55:19 +02:00
Harald Hoyer
d4bb431621 dracut-functions: convert absolute symlinks to relative 2011-07-25 10:25:44 +02:00
Harald Hoyer
a4c235ed3a dracut-functions: only "dinfo" about missing optioal dracut_install 2011-07-22 14:20:27 +02:00
Harald Hoyer
168fa7e571 base: add shutdown script to be called from systemd 2011-05-31 15:50:43 +02:00
Harald Hoyer
c30c65c1b2 dracut-functions: do not redirect modprobe error output to /dev/null
filter modprobe error messages and log them. Very useful if modules.dep
is missing.
2011-05-23 17:40:44 +02:00
Harald Hoyer
2627d8a345 dracut-functions: make created directories writable 2011-05-20 20:08:59 +02:00
Harald Hoyer
7db18ccd13 dracut-functions: change search path for find_binary 2011-05-20 15:17:31 +02:00
Harald Hoyer
c3b0d83ddf dracut-functions: handle symlinked directories 2011-05-20 14:04:57 +02:00
Harald Hoyer
29b10e65b1 dracut-functions: make local vars local and prefix with "_" 2011-05-12 11:06:47 +02:00
Michal Soltys
6e43debe67 dracut-functions: remove find_rule()
Not used anymore.

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-05-10 14:46:06 +02:00
Michal Soltys
09a19bb1ba dracut-functions: update inst_binary()
This update adds support for sort-of corner case - when explicitly
specified binary (e.g. through dracut_install or inst) is a library
itself.

In such case, we would expect the binary to undergo typical
library-related handling (symlinks and such).

Apart from that, the patch cleans indenting and a few unused variables
in inst_binary() (probably leftovers from the past ?)

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-05-10 14:46:06 +02:00
Harald Hoyer
3b403b32fc removed trailing whitespaces 2011-05-10 11:56:09 +02:00
Harald Hoyer
e2cdb570ae dracut-functions: only dinfo() about missing firmware files
People are scared about those messages, so only dwarn() if the module
is actually loaded on the system.
2011-05-10 11:31:45 +02:00
Harald Hoyer
4c2a28c64b dracut-functions: ln -s with '-fn' 2011-04-08 10:42:42 +02:00
Harald Hoyer
a16ebfd56a dracut-functions: bashified ret=ret+$? to ret+=$? 2011-03-29 11:30:27 +02:00