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.
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.
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>
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>
- 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>
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.
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]
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.)
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>
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>