Commit Graph

2445 Commits (cfe32ef5ba0be76fecd024b702997d1f46d45e2d)

Author SHA1 Message Date
Harald Hoyer c2801d0938 99base/dracut-lib.sh: add /etc/cmdline/*.conf parsing
modules and overlay images can set default kernel command line
parameters in /etc/cmdline/*.conf in the initramfs.
2011-10-20 13:06:52 +02:00
Harald Hoyer 15a5dc5b89 99base/init: fix check for in kernel polling 2011-10-20 13:06:52 +02:00
Harald Hoyer e2d92b5adf */module-setup.sh: turn off debugging for module search
turn off debugging for module search, because it clutters the debug log
2011-10-20 13:06:37 +02:00
Harald Hoyer 6f00044317 95udev-rules/module-setup.sh: correctly create udevd symlink 2011-10-20 13:06:34 +02:00
Harald Hoyer d3be5a89e5 netroot: do not die, if arping failed 2011-10-19 14:24:07 +02:00
Michal Soltys f8342dd5f2 check root candidates more carefully
This is from the following thread:

http://thread.gmane.org/gmane.linux.raid/35753/focus=35795

Additional tests + more specific info.

Signed-off-by: Michal Soltys <soltys@ziu.info>

[harald@redhat.com: usable_root(): relaxed check for root]
2011-10-19 14:23:54 +02:00
Will Woods 54ba7acba1 dmsquash-live: fix log message about root/liveroot 2011-10-18 17:13:50 +02:00
Will Woods 2cd4a8065a dracut-lib.sh: fix dropped backslashes in CMDLINE
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.
2011-10-18 17:13:48 +02:00
Michal Soltys 7e8228cf5a dracut: remove duplicate options
'-I' and '--fwdir' were both read_arg and push_arg, and the latter has
priority.

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-10-18 11:33:56 +02:00
Michal Soltys d239b550ce explicitly verify bash version
A simple check in main dracut script.

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-10-11 09:37:02 +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
Dave Young 61bc3bbc0e dracut.conf.5.xml: tag mismatch fix
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>
2011-10-11 09:37:01 +02:00
Harald Hoyer 450f5d6694 95udev-rules/module-setup.s: fixed symlink for udevd to initdir 2011-10-10 20:17:16 +02:00
Harald Hoyer ffcfc0e432 dracut.*.xml: s/exisiting/existing/g 2011-10-10 11:55:52 +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 4c5da0157f manuals: add info about fs-lib (fsck) configuration
in dracut.8.xml & dracut.conf.5.xml

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-10-10 11:54:26 +02:00
Michal Soltys 25b45979f2 fs-lib: add ability to choose fsck tools
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>
2011-10-10 11:54:26 +02:00
Michal Soltys 77270329ba dracut.8: add missing lvmconf info
Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-10-10 11:54:25 +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
Dave Young 88b3e00515 dracut: check mktemp return value
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
2011-10-10 11:41:14 +02:00
WANG Cong 0c3a8dea88 update the documentation of '--[no]prefix'
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>
2011-10-07 10:13:17 +02:00
Harald Hoyer e0f9ecc6a4 95udev-rules/module-setup.sh: also search in /lib/udev and /usr/lib/udev 2011-10-06 10:25:08 +02:00
Harald Hoyer 54ffd5447d 90mdraid/module-setup.sh: fixed sed arguments 2011-10-04 13:30:35 +02:00
Harald Hoyer e0e9221e23 90mdraid/mdraid_start.sh: fix path to md sysfs 2011-10-04 13:06:33 +02:00
Harald Hoyer 77a57d5eaf order mdadm and lvm timeout operations 2011-10-04 13:03:45 +02:00
John Reiser d23159a69c dracut [PATCH]es: parallelize block_module filter and net_module_filter
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
2011-09-30 09:40:49 +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
Michal Soltys 9fc3f04520 90mdraid: adjust /dev/md loops
Include '_' to also handle old partitionable arrays (pre-2.6.28).

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-09-22 17:34:51 +02:00
Michal Soltys ae816bb6aa 90mdraid: more thorough 64-md-raid.rules edit
Catch more variations of incremental assembly.

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-09-22 17:24:16 +02:00
Michal Soltys db9b9f396e 90mdraid: check precisely for supported contaiers
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>
2011-09-22 17:14:42 +02:00
Harald Hoyer 08769b7f8a dracut-functions: inst_rules() add missing "" 2011-09-22 16:14:38 +02:00
Michal Soltys f07aaccd06 99fs-lib: export FSTAB_FILE before fsck call
Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-09-22 15:53:51 +02:00
Amadeusz Żołnowski 7c14b3688c dracut: create /dev besides /proc, /sys and so
How it worked without it?  The issue only manifests itself with
initramfs integrated into kernel.
2011-09-22 15:53:50 +02:00
Harald Hoyer 69063507d4 dracut-logger: bail out early, if we don't have to log anything 2011-09-22 15:49:25 +02:00
Michal Soltys cb28815405 str_replace() fix
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>
2011-09-22 15:46:11 +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 662ed0a13f 99fs-lib/fs-lib.sh: fsck btrfs via mounting like xfs
btrfsck is only for manual repairing your filesystem
2011-09-22 15:37:28 +02:00
Harald Hoyer 75e8f476e7 TEST-40-NBD: relaxed check on ext3 filesystem options
onerror=continue does not seem to be displayed for new kernels
2011-09-22 15:37:27 +02:00
Michal Soltys a025cc17f0 90mdraid: fix/adjust 65-md* rules and related scripts
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>
2011-09-22 15:37:26 +02:00
Michal Soltys cf5891424e 90(md|dm)raid: recognize ddf container
This patch adds ddf support, consistently with imsm/isw options.

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-09-22 15:37:26 +02:00
Michal Soltys 66426469d0 90mdraid: fix/adjust force-run script
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>
2011-09-22 15:37:25 +02:00
Michal Soltys 9383421c1c 90mdraid: fix/adjust mdraid-cleanup
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>
2011-09-22 15:37:25 +02:00
Michal Soltys 5f6a71b38a 90mdraid: containers are not runnable
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>
2011-09-22 15:37:23 +02:00
Michal Soltys e3e5128cf2 90mdraid: adjust stock mdadm udev rules
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>
2011-09-22 15:37:23 +02:00
Harald Hoyer 6d385c7111 mount securityfs in a seperate dracut module 2011-09-22 15:37:23 +02:00
Harald Hoyer 16457c869d mount securityfs in a seperate dracut module 2011-09-20 11:16:53 +02:00
Harald Hoyer d63fdc1198 99base/init: mount securityfs with source "securityfs" instead of dest 2011-09-20 10:10:29 +02:00
Harald Hoyer ca8d4e8933 Do not use /run/udev/rules.d for udev rules
for rules, which should not be called in the real root.

Stale rules can cause this:
https://bugzilla.redhat.com/show_bug.cgi?id=734096
2011-09-19 12:21:51 +02:00
Harald Hoyer 6d82a0470e 99base/init: remove /dev/root helper symlink
Any tool relying on /dev/root has to be fixed.
2011-09-19 12:20:55 +02:00
Harald Hoyer e41e5b78c6 90dmsquash-live: do not symlink to /dev/live
/dev/live should not be used anyway
2011-09-19 12:20:11 +02:00