Commit Graph

43 Commits (e1e4ee9d7c005f61b6ad88d92ef8993d2cfe92be)

Author SHA1 Message Date
Harald Hoyer 967cc19ab1 remove all vim and emacs code format comments 2014-08-29 13:38:47 +02:00
Harald Hoyer 5a57582050 Add rd.hostonly kernel command line parameters
rd.hostonly=0 will remove all configuration compiled in the initramfs
from the host on which it was build
2014-06-27 13:59:44 +02:00
Harald Hoyer 19bb14c346 mdraid/module-setup.sh: fixed print-cmdline for empty UUID
fixes

/usr/lib/dracut/modules.d/90mdraid/module-setup.sh: line 60:
_activated["${UUID}"]: bad array subscript

Thanks to Jan ONDREJ for spotting this!
2014-05-14 16:38:49 +02:00
Harald Hoyer ab9457efd7 Add flag to toggle hostonly cmdline storing in the initramfs
--hostonly-cmdline:
    Store kernel command line arguments needed in the initramfs

--no-hostonly-cmdline:
    Do not store kernel command line arguments needed in the initramfs
2014-02-26 15:01:55 +01:00
Harald Hoyer 30e6e809ed Factor out all the "type -V" commands
Add new functions require_binaries() and require_any_binary() to be used
in the check() section of module-setup.sh.

These functions print a warning line telling the user, which binary is
missing for the specific dracut module.

This unifies the way of checking for binaries and makes the life of an
initramfs creator easier, if he wants to find out why a specific dracut
module is not included in the initramfs.
2014-02-06 16:45:20 +01:00
Harald Hoyer 8bcfd683bd */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
Alexander Tsoy ecc13ef17e mdraid/module-setup.sh: fixes for mdadm-3.2.6+
mdadm-3.2.6+:
Incremental assembly rule contains "--offroot" arg. Update
regexp to catch this variant.

mdadm-3.3+:
Rules was splitted into two files: 63-md-raid-arrays.rules
and 64-md-raid-assembly.rules. Install them both and edit
the latter.
2013-10-04 13:56:41 +02:00
Alexander Tsoy 5bcf262d59 mdraid/module-setup.sh: install configs from /etc/mdadm.conf.d
/etc/mdadm.conf.d directory is supported since mdadm-3.3
2013-10-04 13:56:41 +02:00
Harald Hoyer 281327f72c dmraid/mdraid: improve hostonly recognition
Factor out get_devpath_block(), which also fixes a dmraid hostonly bug.

Also only include dmraid and mdraid, if they are actually in use.
2013-08-26 14:04:56 +02:00
Harald Hoyer 575733aa25 add newline to cmdline config files 2013-08-20 13:08:52 +02:00
Harald Hoyer 1743473b2b add parameter --print-cmdline
This prints the kernel command line parameters for the current disk
layout.

$ dracut --print-cmdline
rd.luks.uuid=luks-e68c8906-6542-4a26-83c4-91b4dd9f0471
rd.lvm.lv=debian/root rd.lvm.lv=debian/usr root=/dev/mapper/debian-root
rootflags=rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=ordered
rootfstype=ext4
2013-08-15 16:06:37 +02:00
Harald Hoyer af11946054 dracut-functions.sh: inst_multiple == dracut_install 2013-08-07 10:33:15 +02:00
Harald Hoyer 6c6d805765 use systemd*dir variables everywhere 2013-03-26 16:19:00 +01:00
Harald Hoyer d351541ee6 make host_fs_types a hashmap
This requires bash >= 4, but hash maps are so much more comfortable
2013-03-11 18:58:32 +01:00
Harald Hoyer cf24ac8c19 crypt, dmraid, mdraid: use for_each_host_dev_and_slaves_all()
To catch _all_ UUIDs and not only the first one, use
for_each_host_dev_and_slaves_all
2013-03-07 16:00:00 +01:00
Harald Hoyer c46cda8260 split 95udev-rules/59-persistent-storage.rules to md and dm modules 2013-03-07 15:01:47 +01:00
Harald Hoyer 6320d072a1 mdmon: renamed mdmon-offroot@.service to mdmon@.service 2013-02-05 10:58:06 +01:00
Harald Hoyer ffc4f173b6 mdraid: add mdmon-offroot@.service and takeover mdmon in shutdown 2013-01-22 15:31:41 +01:00
Harald Hoyer aa09b74a41 dash compat: use "2>&1" rather than "&>" 2012-09-20 10:26:14 +02:00
Harald Hoyer e4297a66b1 mdraid: always create need_shutdown, if we have assembled a raid 2012-08-14 17:44:46 +02:00
Harald Hoyer 24a38bc1cb fixed install locations for udev rules and change to IMPORT{builtin} 2012-07-27 11:55:31 +02:00
Harald Hoyer 8a240aca9e require kpartx and partx for some modules 2012-07-25 13:00:08 +02:00
Harald Hoyer 53fe81e752 modules.d/*/module-setup.sh: combine and specify type for installs
To speedup image creation, combine dracut_install calls and specify the exact type.
E.g. inst_script instead of the generic inst.
2012-06-29 12:41:27 +02:00
Harald Hoyer 4d0f1d7b28 modules.d/*/module-setup.sh: no more sourcing of dracutfunctions 2012-06-29 12:41:26 +02:00
Harald Hoyer 604d1eb21a use pkg-config to determine the udev directory 2012-06-04 12:58:42 +02:00
Harald Hoyer cce69be668 removed old udev "vol_id" 2012-05-07 16:27:48 +02:00
Harald Hoyer 004fd0557d host-only checks corrected and kernel_only mode
In kernel_only mode, we don't want to write /etc/cmdline.d

Correctly return the check functions, so we have a valid return of
for_each_host_dev_fs().

mdraid and dmraid functions had wrong checkings for the filesystem
type.
2012-02-22 19:29:57 +01:00
Harald Hoyer 96b8d60a9b dracut: precreate "${initdir}/etc/cmdline.d" 2012-02-07 18:48:04 +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
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 a1abd64aff 90mdraid: wait for md devices to become clean
After assembling all devices, just wait for the raid devices to become
clean, before booting further.
2011-11-17 10:14:23 +01:00
Harald Hoyer 54ffd5447d 90mdraid/module-setup.sh: fixed sed arguments 2011-10-04 13:30:35 +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
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 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 657d68cfff mdraid: add shutdown script 2011-05-31 15:50:45 +02:00
Harald Hoyer 29b10e65b1 dracut-functions: make local vars local and prefix with "_" 2011-05-12 11:06:47 +02:00
Harald Hoyer 3b403b32fc removed trailing whitespaces 2011-05-10 11:56:09 +02:00
Harald Hoyer 71df3c4329 renamed module-info.sh to module-setup.sh 2011-02-02 16:35:18 +01:00