The "read" shell builtin consumes backslashes, which is a problem if
your root device is something like "LABEL=Fedora\x2016".
Using "read -r" tells the shell to leave backslashes alone.
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>
build failed with:
xsltproc -o dracut.conf.5 -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl dracut.conf.5.xml
dracut.conf.5.xml:169: parser error : Opening and ending tag mismatch: para line 168 and listitem
</listitem>
Fix it by change to </para> at the end
Signed-off-by: Dave Young <dyoung@redhat.com>
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>
in dracut.conf:
fscks="<tools>"
nofscks="yes"
and similary on command line:
--fscks [LIST] (in addition to conf's, if defined there)
--nofscks
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>
in slackware the default mktemp is not from coreutils.
A simply make in test directory mangled my rootfs due
to initdir is blank
Also mktemp could failed with other reason like ENOSPC or EPERM
In
commit fd786adcf5
Author: Harald Hoyer <harald@redhat.com>
Date: Wed Apr 20 16:47:40 2011 +0200
dracut: make prefix configurable
Harald changed the meaning of --prefix/--noprefix, but
forgot to update their documentation. This patch
fixes that.
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
Filtering modules requires enough work that instmods() in the
next pipeline stage was rarely busy. Parallelize the two
filters which do the most work. Also fix a filename-vs-contents
mistake in net_module_filter.
--
John Reiser, jreiser@BitWagon.com
>From f4533a2ceca52c443ddebec01eeaa35d51c39c1b Mon Sep 17 00:00:00 2001
From: John Reiser <jreiser@BitWagon.com>
Date: Tue, 13 Sep 2011 17:41:43 -0700
Subject: [PATCH 1/3] Parallelize block_module_filter
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.
ID_FS_TYPE can be much more than just ddf/imsm/linux raid member, so
do the proper checks.
This reverts certain changes from:
cf5891424e
Signed-off-by: Michal Soltys <soltys@ziu.info>
Whitespace removal in:
out="${out}${chop# }$r"
will damage certain strings, for example the following call:
str_replace ' aax aaxaa' x y
would return 'aayaayaa' instead of ' aay aayaa'.
Signed-off-by: Michal Soltys <soltys@ziu.info>
Reworked the flow of the rules file a bit, removed redundant tests, also
should be easier to follow. It's much shorter now as well, a bit more
similar to 90lvm script - both revolve around same concepts after all.
There's no reason to treat conf-assembled arrays differently from
incremental ones. Once we hit timeout in init's udev loop, we can use
common script (mdraid_start.sh) to try force inactive arrays
into degraded mode.
md-finished.sh was kind-of out of place - it didn't really wait for any
particular device(s) to show up, just watched if onetime mdadm scripts
are still in place. Furthermore, after moving mdraid_start to --timeout
initqueue, it didn't really have too much to watch at all, besides
mdadm_auto (and that served no purpose, as we do wait for concrete
devices).
Either way, with stock 64-md fixes, current version of 65-md*.rules does
the following:
- limits assembly to certain uuids, if specified
- watch for no ddf/imsm
- if mdadm.conf => setup onetime -As script, without forced --run option
- if !mdadm.conf => incrementally assemble
- for both cases, setup timeout script, run-forcing arrays as a last resort
Signed-off-by: Michal Soltys <soltys@ziu.info>
1) mdadm -As --auto=yes --run 2>&1 | vinfo (removed)
Currently such auto assembly will not complete or force-run partially
assembled arrays. It might assemble "concurrent" separate array and
force-run it, if possible (though the chances of suddenly showing
missing components in this scenario - a script run after udev timeout -
are pretty thin). See [1] for details. Also see #3 below.
2) mdadm -Is --run 2>&1 (removed)
This will only force-run native arrays - arrays in containers will not
be affected. See [1] for details. Also see #3 below.
3) mdadm -R run loop (implicitly handles #1 & #2)
This loop does everywthing that #1 & #2 are expected to do. Thus, the
above invocations are simply redundant and this is the most safe and
flexible option.
Also, it shouldn't be necessary to go under md/ directory, as those are
just symlinks to /dev/md[0-9]*.
Certain checks were changed to strict ones (array state, degraded state)
instead of relying on env tricks.
'cat' was added explicitly to installed programs (it has been used
implicitly in shutdown script either way)
4) mdmon bug
See [1] for details as well. In short - force-run arrays in containers
will not have mdmon started, so we do that manually.
5) stop/run queue magic
Also removed. mdadm -R will only cause change events to the array
itself, and they should not be an issue.
[1] http://article.gmane.org/gmane.linux.raid/35133
Signed-off-by: Michal Soltys <soltys@ziu.info>
Stop both arrays (first pass) and containers (second pass).
Loop only over /dev/md[0-9]*
Call cleanup script only once, make sure it's after crypt cleanup.
Signed-off-by: Michal Soltys <soltys@ziu.info>
Remove whole "start a container logic".
Containers once assembled, always remain in 'inactive' state.
Any attempt to run a container with mdadm -IR is a no-op, and any
attempt with just mdadm -R ends with an error.
Signed-off-by: Michal Soltys <soltys@ziu.info>
Currently shipped mdadm rules incrementally assemble all imsm and native
raids, and do so unconditionally. This causes few issues:
- fine-grained controls in 65-md* are shadowed - for example,
mdadm.conf's presence tests or uuid checks
- 90dmraid might also conflict with 90mdraid, if user prefers the former
to handle containers
- possibly other subtle issues
This patch adjusts the behaviour.
Signed-off-by: Michal Soltys <soltys@ziu.info>