Compare commits

..

119 Commits
022 ... 023

Author SHA1 Message Date
Harald Hoyer
6af5a4accf version 023 2012-08-01 15:30:30 +02:00
Frederic Crozat
ec8974914f ensure af_packet module is loaded (if not built-in) 2012-08-01 14:40:43 +02:00
Frederic Crozat
b9775297cd add package name for openSUSE 2012-08-01 14:40:28 +02:00
Harald Hoyer
4a6b33f1ee plymouth/plymouth-pretrigger.sh: s/! -n/-z/ 2012-08-01 14:36:58 +02:00
Harald Hoyer
7dd7ff0f33 base/dracut-lib.sh: make use of DRACUT_SYSTEMD 2012-08-01 14:36:38 +02:00
Dave Young
126732bcc1 split emergency_shell function
Kdump dracut hooks need to enter emergency shell, currently it directly call
"sh -i -l", with recent dracut this does not work anymore without proper ctty.

It will be convinient to seperate a standalone function _emergency_shell for
dracut modules to call.
2012-08-01 14:29:15 +02:00
Harald Hoyer
23d6dcd125 test: s/ib700wdt/i6300esbwdt/g 2012-08-01 12:53:39 +02:00
Harald Hoyer
9fd9e96130 test/Makefile: fixed TESTS parsing 2012-08-01 12:50:54 +02:00
Harald Hoyer
f0a7fc5b43 watchdog: set watchdog timeout with wdctl, if available
"wdctl -s" does not yet exist upstream. I patched
util-linux/sys-utils/wdctl.c to set the timeout.
2012-08-01 12:49:45 +02:00
Chao Wang
d82e0d7dd8 Revert "dracut-functions: $_x should exist, no need to test."
This reverts commit b2d225a669.

When there's no /sys/dev/block/$2/slaves/*/dev/ exists, $_x will
be assigned with '/sys/dev/block/$2/slaves/*/dev/', this is invalid.
That commit will lead to some warn msg like:
cat: /sys/dev/block/8:16/slaves/*/dev: No such file or directory
cat: /sys/dev/block/8:32/slaves/*/dev: No such file or directory
2012-08-01 09:24:12 +02:00
Harald Hoyer
5545fc3046 base/dracut-lib.sh:ismounted() check for block device rather than pathname 2012-07-31 14:44:50 +02:00
Harald Hoyer
a638056838 base/dracut-lib.sh: fixed ismounted() for "/dev" 2012-07-31 14:43:05 +02:00
Harald Hoyer
1f524c4544 Prevent testsuite runs from non-root users. 2012-07-31 13:49:04 +02:00
Harald Hoyer
47b8f66ced rootfs-block/mount-root.sh: corrected check for journaldev 2012-07-31 13:28:45 +02:00
Harald Hoyer
52da8a514a dracut.cmdline.7.asc: corrected rd.retry section 2012-07-31 13:28:07 +02:00
Harald Hoyer
5cd7c104bd document rd.retry and change the default value to 30s
Also start the timeout scripts after 2/3 of the time.
2012-07-31 12:37:35 +02:00
Amadeusz Żołnowski
173edca09e dracut.cmdline.7: add NOTE about how dracut pipes key to cryptsetup 2012-07-31 12:28:55 +02:00
Harald Hoyer
506b219237 dracut.sh: create relative symlinks for /var/lock and /var/run 2012-07-31 11:48:03 +02:00
Harald Hoyer
6c83d7d5bf dracut.sh: do not copy /var/run and /var/lock from the system
https://bugs.gentoo.org/show_bug.cgi?id=428142

If /var/run and /var/lock are real directories, we would end up with:
var/lock/lock -> /run/lock
var/run/run -> /run
2012-07-31 11:44:40 +02:00
Stefan Reimer
a059f72b09 i18n/module-setup.sh: fixed include parsing
Due to bug in module-setup.sh in the i18n module includes from the main
keymap are not working and not added to the initrd image.

Only one quotation per line is removed. Needs to remove all.
2012-07-31 11:36:17 +02:00
Amadeusz Żołnowski
afcebd136f 99shutdown: remove --no-wall argument for reboot, halt, etc...
In some distros (Gentoo, for example) these commands don't honor
--no-wall argument.
2012-07-31 10:55:17 +02:00
Harald Hoyer
3d3c192621 crypt/crypt-run-generator.sh: check if crypttab exists 2012-07-30 22:29:47 +02:00
Harald Hoyer
92b3ee855f removed finished-ask-password.sh 2012-07-30 22:29:42 +02:00
Harald Hoyer
650ab3b077 TEST-10-RAID/test.sh: comment debug options 2012-07-30 21:07:14 +02:00
Harald Hoyer
474cca1e9d TODO: update 2012-07-30 21:07:03 +02:00
Harald Hoyer
c0cae7f702 dmraid,mdraid,lvm,udev: don't process DM_MULTIPATH_DEVICE_PATH devs 2012-07-30 20:41:16 +02:00
Harald Hoyer
3f7e5358e5 crypt/crypt-run-generator.sh: do not add already existing luks 2012-07-30 20:41:16 +02:00
Harald Hoyer
3d352f5228 crypt: add systemd crypt support 2012-07-30 17:08:52 +02:00
Harald Hoyer
540eca9d9d plymouth/plymouth-pretrigger.sh: don't "exit 0" for a sourced script 2012-07-30 17:08:52 +02:00
Harald Hoyer
19cd47fd26 plymouth/plymouth-newroot.sh: don't "exit 0" for sourced scripts 2012-07-30 17:08:52 +02:00
Harald Hoyer
cf62cc435f virtfs/mount-virtfs.sh: don't exit != 0 2012-07-30 17:08:52 +02:00
Harald Hoyer
8b6bdafc39 systemd/module-setup.sh: install systemd udev rules 2012-07-30 17:08:52 +02:00
Harald Hoyer
27790828d1 base/dracut-lib.sh: fixed ismounted(<mountpoint>) 2012-07-30 17:08:52 +02:00
Harald Hoyer
d782ffb822 i18n/parse-i18n.sh: remove udev rules 2012-07-30 17:08:52 +02:00
Harald Hoyer
5a84ac3fe3 dracut-functions.sh: inst_hook() with [0-9]-<name> 2012-07-30 17:08:51 +02:00
Harald Hoyer
343b7d7488 kernel-modules/module-setup.sh: add missing "fi" 2012-07-30 17:08:51 +02:00
Harald Hoyer
aefea76cf8 set DRACUT_SYSTEMD for systemd mode in the initramfs 2012-07-30 17:08:51 +02:00
Harald Hoyer
4976edb1a6 dracut.spec: add Requires: kbd kbd-misc 2012-07-30 13:58:58 +02:00
Harald Hoyer
171ba532bc plymouth/plymouth-newroot.sh: fixed pre-pivot hook 2012-07-30 13:39:37 +02:00
Harald Hoyer
bfd2e8c25f dracut.sh: test if we can lazy resolve with ldd 2012-07-30 13:02:41 +02:00
Chao Wang
b2d225a669 dracut-functions: $_x should exist, no need to test.
Signed-off-by: Chao Wang <chaowang@redhat.com>
2012-07-30 12:23:32 +02:00
Will Woods
a5f01bbfb5 dracut-lib: add find_mount, use it to implement ismounted
find_mount is really the same thing as ismounted with two additions:

  1) uses "readlink" so "ismounted /dev/disk/by-label/LABEL" works
  2) returns the mountpoint of the device

And ismounted is now just "find_mount $dev >/dev/null".
2012-07-30 12:23:32 +02:00
Will Woods
7e2285a48a add comment for getargbool()
I always forget how getargbool works. Add a comment documenting it.
2012-07-30 12:23:32 +02:00
Harald Hoyer
3e964eeb96 dracut.sh: put $drivers and $filesystems back in export 2012-07-27 16:06:36 +02:00
Harald Hoyer
aec9f902f0 kernel-modules/module-setup.sh: move "$drivers" "$filesystems" and "$add_drivers" to dracut.sh 2012-07-27 16:03:42 +02:00
Harald Hoyer
764eb40cc9 TODO: update 2012-07-27 16:03:25 +02:00
Harald Hoyer
95a5b23a38 i18n,terminfo/module-setup.sh: fixed "cp -t" calls 2012-07-27 15:34:54 +02:00
Harald Hoyer
5d833a9f5b add "af_packet" kernel module to network testsuite tests 2012-07-27 15:11:01 +02:00
Harald Hoyer
3e51b2f6fc fixed i18n and plymouth for systemd 2012-07-27 14:15:48 +02:00
Harald Hoyer
852105dc44 i18n/console_init.sh: skip, if we use systemd and use systemd-vconsole-init 2012-07-27 14:11:22 +02:00
Harald Hoyer
a7473ef379 cifs/parse-cifsroot.sh: fixed more root/netroot parsing 2012-07-27 12:40:55 +02:00
Harald Hoyer
f7f3792390 iscsi/iscsiroot.sh: force link initiatorname 2012-07-27 12:18:08 +02:00
Harald Hoyer
2d674a9336 README.testsuite: add instructions on how to run the testsuite 2012-07-27 12:14:04 +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
82b1739dce cifs/parse-cifsroot.sh: do not unset netroot, we need it 2012-07-27 11:54:24 +02:00
Amadeusz Żołnowski
fc6b272f41 gitignore install/dracut-install 2012-07-27 09:55:06 +02:00
Amadeusz Żołnowski
c9baff669d Makefile: add dependencies for dracut-install (generated with gcc -MM) 2012-07-27 09:54:49 +02:00
Harald Hoyer
72ee74b9be dracut.spec: add cifs module 2012-07-27 06:26:26 +02:00
Harald Hoyer
cc21808764 dracut-functions.sh:inst_rule_programs() fix error messages 2012-07-26 19:35:12 +02:00
Harald Hoyer
78021eace1 install/dracut-install.c: convert destrootdir to realpath
otherwise we get strange errors if it ends with a slash and does not
exist.
2012-07-26 19:35:00 +02:00
Harald Hoyer
65d1a8a4ae dracut-functions.sh:inst_rule_programs() fixed IMPORT{program} 2012-07-26 19:12:40 +02:00
Amadeusz Żołnowski
187a8e08d5 gentoo.conf: enable ro_mnt 2012-07-26 19:07:28 +02:00
Harald Hoyer
c9a81c1f91 plymouth: do not start plymouth via dracut for systemd in the initramfs 2012-07-26 19:00:04 +02:00
Mike Gorse
d580636e97 Added cifs 2012-07-26 18:51:45 +02:00
Harald Hoyer
6ca264a151 nfs/module-setup.sh: check for "rpc.rpc" before running chown 2012-07-26 18:12:05 +02:00
Amadeusz Żołnowski
aa505d588f parse-root-opts: first check for ro, later for rw
This order is already in 98usrmount.
2012-07-26 17:35:59 +02:00
Harald Hoyer
96c6fa9202 base/module-setup.sh: removed mount-hook 2012-07-26 17:35:25 +02:00
Harald Hoyer
25706eafac README.testsuite updated with requirements for TEST-04-SYSTEMD 2012-07-26 17:26:31 +02:00
Harald Hoyer
8aa9926839 mv rootfs-block/module-setup.sh:search_option() in dracut-functions.sh
new function fs_get_option()
2012-07-26 17:24:01 +02:00
Amadeusz Żołnowski
ff3953efe1 ro_mnt - option at build time to force ro mount of / and /usr 2012-07-26 17:16:56 +02:00
Harald Hoyer
ec5e5ae27a dracut-functions.sh: corrected usage comment of find_mp_fstype() 2012-07-26 17:05:24 +02:00
Harald Hoyer
3cc4c8ba9b rootfs-block/module-setup.sh: add support for xfs / reiserfs separate journal device
xfs and reiserfs (among other) supports storing journal data to a
separate device. Unfortunately, XFS requires this information to boot
properly (reiserfs can embed the information in its metadata but you
might want to override it).

Frederic Crozat <fcrozat@suse.com>
2012-07-26 17:00:47 +02:00
Harald Hoyer
81672479af dracut-functions.sh: add find_mp_fstype() 2012-07-26 17:00:07 +02:00
Frederic Crozat
6a5170a15f PATCH: add support for xfs / reiserfs separate journal device
xfs and reiserfs (among other) supports storing journal data to a
separate device. Unfortunately, XFS requires this information to boot
properly (reiserfs can embed the information in its metadata but you
might want to override it).

Attached patch ensure host information are stored in initramfs and also
allows to give data over kernel commandline.

--
Frederic Crozat <fcrozat@suse.com>
SUSE

>From a7c592b9bb7de0d7874ae51d02944a7eee2ec75b Mon Sep 17 00:00:00 2001
From: Frederic Crozat <fcrozat@suse.com>
Date: Tue, 24 Jul 2012 18:52:17 +0200
Subject: [PATCH] Add support for separate journal on reiserfs and xfs
2012-07-26 16:38:14 +02:00
Amadeusz Żołnowski
1f4aaaeb5e modules.d/99base/mount-hook.sh is not used - removed 2012-07-26 16:35:13 +02:00
Amadeusz Żołnowski
79148c2945 apply "ro" and "rw" options from cmdline to / mount
rflags is no longer guaranteed to be non empty.  / is mounted according
to rootflags parameter but forced ro at first.  Later it is remounted
according to /etc/fstab + rootflags parameter and "ro"/"rw".  If
parameters are still the same as for first mount, / isn't remounted.

Conflicts:

    modules.d/95rootfs-block/mount-root.sh
    modules.d/99base/parse-root-opts.sh
2012-07-26 16:35:13 +02:00
Amadeusz Żołnowski
5767201eaf dracut-lib: new functions: listlist and are_lists_eq
listlist is like strstr for lists with specified separator and
are_lists_eq uses listlist to check equality of specified lists.
2012-07-26 16:35:13 +02:00
Amadeusz Żołnowski
221c342d50 98usrmount: [ "x$_usr_found" != "x" ] - removed redundant 'x' 2012-07-26 16:35:13 +02:00
Amadeusz Żołnowski
b56e174322 98usrmount: print mount options 2012-07-26 16:35:13 +02:00
Amadeusz Żołnowski
5afa957915 98usrmount: use rw and ro options instead of rd.usrmount.ro
In result /usr is forced to be mounted ro or rw along with /.
2012-07-26 16:35:13 +02:00
Amadeusz Żołnowski
af3b67b213 95rootfs-block: fix left fsck rel. checks 2012-07-26 16:35:13 +02:00
Harald Hoyer
93d7b823b4 systemd/dracut-cmdline.sh: output dracut version 2012-07-26 14:23:31 +02:00
Harald Hoyer
4a1255bc38 Makefile: use symlink for topsrcdir/dracut-install 2012-07-26 13:04:45 +02:00
Harald Hoyer
15976a0670 multipath/module-setup.sh: add dm dependency 2012-07-26 12:55:53 +02:00
Harald Hoyer
24ba78cb77 Makefile: fixed dracut-install make target 2012-07-26 12:15:16 +02:00
Amadeusz Żołnowski
15f0b1f624 90multipath: added kpartx.rules; multipath.rules - different prefix 2012-07-26 11:40:37 +02:00
Cong Wang
823311ea3b 90kernel-modules: remove unused variables in install()
The local variables in install() are unused, can be removed.

Cc: Harald Hoyer <harald@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
2012-07-26 10:10:04 +02:00
Amadeusz Żołnowski
f67a1f7f64 gentoo.conf: set udevdir 2012-07-26 10:10:04 +02:00
Amadeusz Żołnowski
e625eea4f9 Config file for systemd on Gentoo. 2012-07-26 10:10:04 +02:00
Amadeusz Żołnowski
f6297ebe73 Remove obsolete gentoo conf file. 2012-07-26 10:10:04 +02:00
Harald Hoyer
372c9b9647 dmsquash-live: do not eject medium for live_ram 2012-07-26 09:25:28 +02:00
Chao Wang
63c65b984a 90multipath: check() - Regexp fix to match multipath partition.
A multipath partition's uuid will be presented like:
 # cat /sys/dev/block/$_dev/dm/uuid
 part1-mpath-360060e801047103004f2c4b300000008

So in this case, change the match regexp from '^mpath-' to 'mpath-'.

Signed-off-by: Chao Wang <chaowang@redhat.com>
2012-07-26 08:35:02 +02:00
Chao Wang
06c6ea654f 95fstab-sys: Skip mounted filesystem.
Signed-off-by: Chao Wang <chaowang@redhat.com>
2012-07-26 08:35:02 +02:00
Amadeusz Żołnowski
ab8bfca794 Makefile: use implicit rules for install/dracut-install
Don't fail on install rule if install/dracut-install is not build - just
skip it.  $(strip) is not used by install rule, because it is nowhere
set.
2012-07-26 08:35:02 +02:00
Amadeusz Żołnowski
386579a45a Remove object file from repo: install/hashmap.o 2012-07-26 08:35:02 +02:00
Harald Hoyer
f1040fc470 qemu*/module-setup.sh: provide alternative for systemd-detect-virt 2012-07-25 16:03:49 +02:00
Harald Hoyer
585fd00624 TODO: update 2012-07-25 15:20:37 +02:00
Harald Hoyer
e045e1f386 Makefile: honor CFLAGS 2012-07-25 15:20:22 +02:00
Harald Hoyer
bf7883ebca network/module-setup.sh: instmods af_packet 2012-07-25 14:56:29 +02:00
Harald Hoyer
a844fb1552 dracut.asc: add doc about journalctl 2012-07-25 14:53:23 +02:00
Harald Hoyer
35022f987c iscsiroot.sh: do not source /etc/conf.d
this should have been done already.
2012-07-25 14:52:25 +02:00
Harald Hoyer
8a240aca9e require kpartx and partx for some modules 2012-07-25 13:00:08 +02:00
Harald Hoyer
68e7661ca7 deprecate old command line options 2012-07-25 10:32:42 +02:00
Leho Kraav
e88e3b2797 91crypt-loop: replace basename calls with string matching 2012-07-25 10:31:43 +02:00
Leho Kraav
df68781fca 91crypt-loop: use initqueue for cleanup strategy 2012-07-25 10:31:43 +02:00
Leho Kraav
f855f9daaf 91crypt-loop: open root device with a key inside encrypted loop container 2012-07-25 10:31:43 +02:00
Leho Kraav
c5758f2090 90crypt: enhance crypt-lib keydev mounting
Combining $keydev and $keypath should result in a unique, re-usable keydev
mountpoint. mkuniqdir doesn't seem to have any an advantage here and lacks
reusability. Is there ever a use case where these are true:

 * there are more than one rd.luks.key=$keypath:$keydev
 * one is actually different from the other
2012-07-25 10:31:43 +02:00
Leho Kraav
3e9b4330a9 90crypt: recognize .img as loop key container 2012-07-25 10:31:43 +02:00
Harald Hoyer
c072e13162 get rid of "basename" 2012-07-24 14:12:36 +02:00
Harald Hoyer
f2271428d4 dracut-functions.sh: small error print correction 2012-07-24 14:08:32 +02:00
Harald Hoyer
cef379bb03 i18n/10-console.rules: move console_init to the initqueue 2012-07-24 11:52:28 +02:00
Harald Hoyer
3e624cd9dc kernel-modules/module-setup.sh: just optionally install all modprobe.d 2012-07-23 15:40:20 +02:00
Harald Hoyer
5297d4f5b2 lvm/lvm_scan.sh: udevadm settle after lvm scan 2012-07-23 15:36:58 +02:00
Harald Hoyer
b7c8f59fef kernel-modules/module-setup.sh: fix modprobe.d install
if /lib/modprobe.d does not exist, it errors with:
find: `/lib/modprobe.d/': No such file or directory
2012-07-23 11:38:36 +02:00
Harald Hoyer
13f77e9fd5 add documentation for systemd services in the initramfs 2012-07-23 11:29:20 +02:00
Harald Hoyer
472189da15 dracut.sh: add -N option for --no-hostonly 2012-07-21 13:03:56 +02:00
Harald Hoyer
e5ec81a354 AUTHORS: update 2012-07-21 12:55:23 +02:00
Harald Hoyer
4c3be42cdf dracut.8: add more description about calling dracut 2012-07-21 12:52:01 +02:00
Harald Hoyer
24450a5ab7 resume: move resume in the initqueue/finished hook
this ensures, that resume is called as soon as possible
2012-07-20 14:47:41 +02:00
126 changed files with 1325 additions and 552 deletions

1
.gitignore vendored
View File

@@ -11,3 +11,4 @@ test*.img
/.buildpath
/.project
/dracut-version.sh
/install/dracut-install

26
AUTHORS
View File

@@ -1,16 +1,16 @@
Harald Hoyer <harald@redhat.com>
Victor Lowther <victor.lowther@gmail.com>
Amadeusz Żołnowski <aidecoe@aidecoe.name>
Philippe Seewer <philippe.seewer@bfh.ch>
Warren Togami <wtogami@redhat.com>
Amadeusz Żołnowski <aidecoe@aidecoe.name>
Will Woods <wwoods@redhat.com>
Jeremy Katz <katzj@redhat.com>
David Dillow <dave@thedillows.org>
Will Woods <wwoods@redhat.com>
Michal Soltys <soltys@ziu.info>
Dave Young <dyoung@redhat.com>
Amerigo Wang <amwang@redhat.com>
Andrey Borzenkov <arvidjaar@gmail.com>
Dave Young <dyoung@redhat.com>
Colin Guthrie <colin@mageia.org>
Andrey Borzenkov <arvidjaar@gmail.com>
Andreas Thienemann <andreas@bawue.net>
Hans de Goede <hdegoede@redhat.com>
Peter Jones <pjones@redhat.com>
@@ -18,30 +18,34 @@ John Reiser <jreiser@bitwagon.com>
Luca Berra <bluca@vodka.it>
Daniel Drake <dsd@laptop.org>
Marc Grimme <grimme@atix.de>
Brian C. Lane <bcl@redhat.com>
Dan Horák <dhorak@redhat.com>
Jesse Keating <jkeating@redhat.com>
Roberto Sassu <roberto.sassu@polito.it>
Anton Blanchard <anton@samba.org>
Bill Nottingham <notting@redhat.com>
Brian C. Lane <bcl@redhat.com>
David Cantrell <dcantrell@redhat.com>
Jon Ander Hernandez <jonan.h@gmail.com>
Juan RP <xtraeme@gmail.com>
Lance Albertson <lance@osuosl.org>
Marian Ganisin <mganisin@redhat.com>
Michael Ploujnikov <plouj@somanetworks.com>
Peter Rajnoha <prajnoha@redhat.com>
Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Alan Pevec <apevec@redhat.com>
Ian Dall <ian@beware.dropbear.id.au>
James Buren <ryuo@frugalware.org>
Joey Boggs <jboggs@redhat.com>
Jon Ander Hernandez <jonan.h@gmail.com>
Mike Snitzer <snitzer@redhat.com>
Peter Rajnoha <prajnoha@redhat.com>
Przemysław Rudy <prudy1@o2.pl>
Thomas Lange <lange@informatik.uni-koeln.de>
Vladislav Bogdanov <bubble@hoster-ok.com>
Alexander Todorov <atodorov@redhat.com>
Andy Lutomirski <luto@mit.edu>
Anssi Hannula <anssi@mageia.org>
Christian Heinz <christian.ch.heinz@gmail.com>
Dave Jones <davej@redhat.com>
Dennis Gilmore <dennis@ausil.us>
Duane Griffin <duaneg@dghda.com>
Frederic Crozat <fcrozat@mandriva.com>
Glen Gray <slaine@slaine.org>
@@ -50,20 +54,26 @@ James Laska <jlaska@redhat.com>
Jan Stodola <jstodola@redhat.com>
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Leho Kraav <leho@kraav.com>
Lennert Buytenhek <buytenh@wantstofly.org>
Lubomir Rintel <lkundrak@v3.sk>
Matt <smoothsailing72@hotmail.com>
Matt Smith <shadowfax@gmx.com>
Michal Schmidt <mschmidt@redhat.com>
Milan Broz <mbroz@redhat.com>
Munehiro Matsuda <haro@kgt.co.jp>
Nikoli <nikoli@lavabit.com>
Olivier Blin <dev@blino.org>
Paolo Bonzini <pbonzini@redhat.com>
Peter Robinson <pbrobinson@fedoraproject.org>
Pádraig Brady <P@draigBrady.com>
Quentin Armitage <quentin@armitage.org.uk>
Sergey Fionov <fionov@gmail.com>
Srinivasa T N <seenutn@linux.vnet.ibm.com>
Thilo Bangert <thilo.bangert@gmx.net>
Thomas Lange <lange@informatik.uni-koeln.de>
Tomasz Torcz <tomek@pipebreaker.pl>
Vadim Kuznetsov <vadimk@gentoo.org>
Ville Skyttä <ville.skytta@iki.fi>
Vivek Goyal <vgoyal@redhat.com>
Wim Muskee <wimmuskee@gmail.com>
Yanko Kaneti <yaneti@declera.com>
maximilian attems <max@stro.at>

View File

@@ -1,4 +1,4 @@
VERSION=022
VERSION=023
GITVERSION=$(shell [ -d .git ] && git rev-list --abbrev-commit -n 1 HEAD |cut -b 1-8)
prefix ?= /usr
@@ -8,32 +8,51 @@ pkglibdir ?= ${libdir}/dracut
sysconfdir ?= ${prefix}/etc
bindir ?= ${prefix}/bin
mandir ?= ${prefix}/share/man
CFLAGS ?= -O2 -g -Wall
CFLAGS += -std=gnu99
man1pages = lsinitrd.1
man5pages = dracut.conf.5
man7pages = dracut.cmdline.7
man8pages = dracut.8 \
dracut-catimages.8 \
mkinitrd.8 \
modules.d/98systemd/dracut-cmdline.service.8 \
modules.d/98systemd/dracut-initqueue.service.8 \
modules.d/98systemd/dracut-pre-pivot.service.8 \
modules.d/98systemd/dracut-pre-trigger.service.8 \
modules.d/98systemd/dracut-pre-udev.service.8 \
modules.d/98systemd/initrd-switch-root.service.8 \
modules.d/98systemd/udevadm-cleanup-db.service.8
manpages = $(man1pages) $(man5pages) $(man7pages) $(man8pages)
manpages = dracut.8 \
dracut.cmdline.7 \
dracut.conf.5 \
dracut-catimages.8 \
lsinitrd.1 \
mkinitrd.8
.PHONY: install clean archive rpm testimage test all check AUTHORS doc
all: syncheck dracut-version.sh dracut-install
DRACUT_INSTALL_SOURCE = \
install/dracut-install.c \
install/hashmap.c\
install/log.c \
install/util.c
DRACUT_INSTALL_OBJECTS = \
install/dracut-install.o \
install/hashmap.o\
install/log.o \
install/util.o
DRACUT_INSTALL_HEADER = \
install/hashmap.h \
install/log.h \
install/macro.h \
install/util.h
# deps generated with gcc -MM
install/dracut-install.o: install/dracut-install.c install/log.h install/macro.h \
install/hashmap.h install/util.h
install/hashmap.o: install/hashmap.c install/util.h install/macro.h install/log.h \
install/hashmap.h
install/log.o: install/log.c install/log.h install/macro.h install/util.h
install/util.o: install/util.c install/util.h install/macro.h install/log.h
dracut-install: $(DRACUT_INSTALL_SOURCE) $(DRACUT_INSTALL_HEADER)
gcc -std=gnu99 -O2 -g -Wall -o dracut-install $(DRACUT_INSTALL_SOURCE)
install/dracut-install: $(DRACUT_INSTALL_OBJECTS)
dracut-install: install/dracut-install
ln -fs $< $@
indent:
indent -i8 -nut -br -linux -l120 install/dracut-install.c
@@ -69,18 +88,15 @@ install: doc dracut-version.sh
mkdir -p $(DESTDIR)$(sysconfdir)/dracut.conf.d
install -m 0755 dracut-functions.sh $(DESTDIR)$(pkglibdir)/dracut-functions.sh
install -m 0755 dracut-version.sh $(DESTDIR)$(pkglibdir)/dracut-version.sh
ln -s dracut-functions.sh $(DESTDIR)$(pkglibdir)/dracut-functions
ln -fs dracut-functions.sh $(DESTDIR)$(pkglibdir)/dracut-functions
install -m 0755 dracut-logger.sh $(DESTDIR)$(pkglibdir)/dracut-logger.sh
install -m 0755 dracut-initramfs-restore.sh $(DESTDIR)$(pkglibdir)/dracut-initramfs-restore
cp -arx modules.d $(DESTDIR)$(pkglibdir)
install -m 0644 lsinitrd.1 $(DESTDIR)$(mandir)/man1/lsinitrd.1
install -m 0644 mkinitrd.8 $(DESTDIR)$(mandir)/man8/mkinitrd.8
install -m 0644 dracut.8 $(DESTDIR)$(mandir)/man8/dracut.8
install -m 0644 dracut-catimages.8 \
$(DESTDIR)$(mandir)/man8/dracut-catimages.8
install -m 0644 dracut.conf.5 $(DESTDIR)$(mandir)/man5/dracut.conf.5
install -m 0644 dracut.cmdline.7 $(DESTDIR)$(mandir)/man7/dracut.cmdline.7
ln -s dracut.cmdline.7 $(DESTDIR)$(mandir)/man7/dracut.kernel.7
for i in $(man1pages); do install -m 0644 $$i $(DESTDIR)$(mandir)/man1/$${i##*/}; done
for i in $(man5pages); do install -m 0644 $$i $(DESTDIR)$(mandir)/man5/$${i##*/}; done
for i in $(man7pages); do install -m 0644 $$i $(DESTDIR)$(mandir)/man7/$${i##*/}; done
for i in $(man8pages); do install -m 0644 $$i $(DESTDIR)$(mandir)/man8/$${i##*/}; done
ln -fs dracut.cmdline.7 $(DESTDIR)$(mandir)/man7/dracut.kernel.7
if [ -n "$(systemdsystemunitdir)" ]; then \
mkdir -p $(DESTDIR)$(systemdsystemunitdir); \
install -m 0644 dracut-shutdown.service $(DESTDIR)$(systemdsystemunitdir); \
@@ -88,7 +104,9 @@ install: doc dracut-version.sh
ln -s ../dracut-shutdown.service \
$(DESTDIR)$(systemdsystemunitdir)/shutdown.target.wants/dracut-shutdown.service; \
fi
install $(strip) -m 0755 dracut-install $(DESTDIR)$(pkglibdir)/dracut-install
if [ -f install/dracut-install ]; then \
install -m 0755 install/dracut-install $(DESTDIR)$(pkglibdir)/dracut-install; \
fi
dracut-version.sh:
@echo "DRACUT_VERSION=$(VERSION)-$(GITVERSION)" > dracut-version.sh
@@ -99,7 +117,7 @@ clean:
$(RM) */*/*~
$(RM) test-*.img
$(RM) dracut-*.rpm dracut-*.tar.bz2
$(RM) dracut-install
$(RM) dracut-install install/dracut-install $(DRACUT_INSTALL_OBJECTS)
$(RM) $(manpages) dracut.html
$(MAKE) -C test clean
@@ -138,7 +156,8 @@ syncheck:
done;exit $$ret
check: all syncheck
$(MAKE) -C test check
@[ "$$EUID" == "0" ] || { echo "'check' must be run as root! Please use 'sudo'."; exit 1; }
@$(MAKE) -C test check
testimage: all
./dracut.sh -l -a debug -f test-$(shell uname -r).img $(shell uname -r)

20
NEWS
View File

@@ -1,3 +1,23 @@
dracut-023
==========
- resume from hibernate fixes
- -N option for --no-hostonly
- support for systemd crypto handling
- new dracut module "crypt-loop"
- deprecate the old kernel command line options
- more documentation
- honor CFLAGS for dracut-install build
- multipath fixes
- / is mounted according to rootflags parameter but forced ro at first.
Later it is remounted according to /etc/fstab + rootflags parameter
and "ro"/"rw".
- support for xfs / reiserfs separate journal device
- new "ro_mnt" option to force ro mount of / and /usr
- root on cifs support
- dracut-install: fixed issue for /var/tmp containing a symlink
- only lazy resolve with ldd, if the /var/tmp partition is not mounted with "noexec"
- i18n: fixed inclusion of "include" keymaps
dracut-022
==========
- fixed host-only kernel module bug

View File

@@ -7,5 +7,24 @@ cryptsetup
nfs-utils
netbsd-iscsi
nbd
dhcp
dhcp (dhcp-server on openSUSE)
iscsi-initiator-utils
TEST-04-FULL-SYSTEMD: systemd >= 187
How to run the testsuite:
$ sudo make clean check
in verbose mode:
$ sudo make V=1 clean check
only specific test:
$ sudo make TESTS="01 20 40" clean check
only runs the 01, 20 and 40 tests.
debug a specific test case:
$ cd TEST-01-BASIC
$ sudo make clean setup run
... change some kernel parameters ...
$ sudo make run
to run the test without doing the setup

2
TODO
View File

@@ -6,6 +6,8 @@ Items are ordered in priority.
INITRAMFS TODO
- use info and warn prefix
- add sosreport
- generate systemd unit dracut-initramfs-restore in /run/systemd dynamically
- put "root=" parsing hooks in separate hook dir
- call "root=" parsing hooks after getting new rootpath from dhcp

View File

@@ -357,6 +357,33 @@ find_dev_fstype() {
return 1
}
# find_mp_fstype <mountpoint>
# Echo the filesystem type for a given mountpoint.
# /proc/self/mountinfo is taken as the primary source of information
# and /etc/fstab is used as a fallback.
# No newline is appended!
# Example:
# $ find_mp_fstype /;echo
# ext4
find_mp_fstype() {
local _x _mpt _majmin _dev _fs _maj _min
while read _x _x _majmin _x _mpt _x _x _fs _dev _x; do
[[ $_mpt = $1 ]] || continue
echo -n $_fs;
return 0;
done < /proc/self/mountinfo
# fall back to /etc/fstab
while read _dev _mpt _fs _x; do
[[ $_mpt = $1 ]] || continue
echo -n $_fs;
return 0;
done < /etc/fstab
return 1
}
# finds the major:minor of the block device backing the root filesystem.
find_root_block_device() { find_block_device /; }
@@ -427,6 +454,26 @@ check_vol_slaves() {
return 1
}
# fs_get_option <filesystem options> <search for option>
# search for a specific option in a bunch of filesystem options
# and return the value
fs_get_option() {
local _fsopts=$1
local _option=$2
local OLDIFS="$IFS"
IFS=,
set -- $_fsopts
IFS="$OLDIFS"
while [ $# -gt 0 ]; do
case $1 in
$_option=*)
echo ${1#${_option}=}
break
esac
shift
done
}
if [[ $DRACUT_INSTALL ]]; then
[[ $DRACUT_RESOLVE_LAZY ]] || export DRACUT_RESOLVE_DEPS=1
inst_dir() {
@@ -710,12 +757,12 @@ inst_rule_programs() {
_bin=${udevdir}/$_prog
else
_bin=$(find_binary "$_prog") || {
dinfo "Skipping program $_prog using in udev rule $(basename $1) as it cannot be found"
dinfo "Skipping program $_prog using in udev rule ${1##*/} as it cannot be found"
continue;
}
fi
#dinfo "Installing $_bin due to it's use in the udev rule $(basename $1)"
#dinfo "Installing $_bin due to it's use in the udev rule $(${1##*/})"
dracut_install "$_bin"
done
fi
@@ -725,27 +772,27 @@ inst_rule_programs() {
_bin=${udevdir}/$_prog
else
_bin=$(find_binary "$_prog") || {
dinfo "Skipping program $_prog using in udev rule $(basename $1) as it cannot be found"
dinfo "Skipping program $_prog using in udev rule ${1##*/} as it cannot be found"
continue;
}
fi
#dinfo "Installing $_bin due to it's use in the udev rule $(basename $1)"
#dinfo "Installing $_bin due to it's use in the udev rule $(${1##*/})"
dracut_install "$_bin"
done
fi
if grep -qE 'PROGRAM==?"[^ "]+' "$1"; then
for _prog in $(grep -E 'IMPORT==?"[^ "]+' "$1" | sed -r 's/.*IMPORT==?"([^ "]+).*/\1/'); do
if grep -qE 'IMPORT\{program\}==?"[^ "]+' "$1"; then
for _prog in $(grep -E 'IMPORT\{program\}==?"[^ "]+' "$1" | sed -r 's/.*IMPORT\{program\}==?"([^ "]+).*/\1/'); do
if [ -x ${udevdir}/$_prog ]; then
_bin=${udevdir}/$_prog
else
_bin=$(find_binary "$_prog") || {
dinfo "Skipping program $_prog using in udev rule $(basename $1) as it cannot be found"
dinfo "Skipping program $_prog using in udev rule ${1##*/} as it cannot be found"
continue;
}
fi
#dinfo "Installing $_bin due to it's use in the udev rule $(basename $1)"
#dinfo "Installing $_bin due to it's use in the udev rule $(${1##*/})"
dracut_install "$_bin"
done
fi
@@ -791,7 +838,7 @@ inst_hook() {
dfatal "No such hook type $1. Aborting initrd creation."
exit 1
fi
inst_simple "$3" "/lib/dracut/hooks/${1}/${2}${3##*/}"
inst_simple "$3" "/lib/dracut/hooks/${1}/${2}-${3##*/}"
}
# install any of listed files
@@ -1135,7 +1182,7 @@ for_each_module_dir() {
for _mod in $_modcheck; do
strstr "$mods_to_load" "$_mod" && continue
strstr "$omit_dracutmodules" "$_mod" && continue
derror "Dracut module \"$_mod\" cannot be found or installed."
derror "Dracut module '$_mod' cannot be found or installed."
done
}

View File

@@ -14,6 +14,12 @@ SYNOPSIS
DESCRIPTION
-----------
Create an initramfs <image> for the kernel with the version <kernel version>.
If <kernel version> is omitted, then the version of the actual running
kernel is used. If <image> is omitted or empty, then the default location
/boot/initramfs-<kernel version>.img is used.
dracut creates an initial image used by the kernel for preloading the block
device modules (such as IDE, SCSI or RAID) which are needed to access the root
filesystem, mounting the root filesystem and booting into the real system.
@@ -22,7 +28,55 @@ At boot time, the kernel unpacks that archive into RAM disk, mounts and uses it
as initial root file system. All finding of the root device happens in this
early userspace.
For a complete list of kernel command line options see *dracut.cmdline*(7)
For a complete list of kernel command line options see *dracut.cmdline*(7).
EXAMPLE
-------
To create a initramfs image, the most simple command is:
----
# dracut
----
This will generate a general purpose initramfs image, with all possible
functionality resulting of the combination of the installed dracut modules and
system tools. The image is /boot/initramfs-_++<kernel version>++_.img and
contains the kernel modules of the currently active kernel with version
_++<kernel version>++_.
If the initramfs image already exists, dracut will display an error message, and
to overwrite the existing image, you have to use the --force option.
----
# dracut --force
----
If you want to specify another filename for the resulting image you would issue
a command like:
----
# dracut foobar.img
----
To generate an image for a specific kernel version, the command would be:
----
# dracut foobar.img 2.6.40-1.rc5.f20
----
A shortcut to generate the image at the default location for a specific kernel
version is:
----
# dracut --kver 2.6.40-1.rc5.f20
----
If you want to create lighter, smaller initramfs images, you may want to specify
the --host-only or -H option. Using this option, the resulting image will
contain only those dracut modules, kernel modules and filesystems, which are
needed to boot this specific machine. This has the drawback, that you can't put
the disk on another controller or machine, and that you can't switch to another
root filesystem, without recreating the initramfs image. The usage of the
--host-only option is only for experts and you will have to keep the broken
pieces. At least keep a copy of a general purpose image (and corresponding
kernel) as a fallback to rescue your system.
OPTIONS
-------
@@ -254,7 +308,7 @@ If chrooted to another root other than the real root device, use "--fstab" and
provide a valid _/etc/fstab_.
====
**--no-hostonly**::
**-N, --no-hostonly**::
Disable Host-Only mode
**--fstab**::

View File

@@ -459,6 +459,13 @@ dracut shell commands are printed as they are executed
# less /run/initramfs/init.log
# dmesg | less
----
. With dracut >= 022 and systemd, you can inspect the rd.debug output with:
----
# journalctl -ab
----
If you want to save that output, simply mount /boot by hand or insert an USB stick and mount that.
Then you can store the output for later inspection.
[[information-to-include-in-your-report]]
=== Information to include in your report
@@ -472,7 +479,7 @@ configuration file (e.g. _/etc/grub.conf_) or from _/proc/cmdline_.
* A copy of your disk partition information from _/etc/fstab_, which might be
obtained booting an old working initramfs or a rescue medium.
* A device listing from device-mapper. This can be obtained by running the
command
command
+
----
# dmsetup ls --tree

View File

@@ -61,6 +61,14 @@ rootfstype=ext3
_/etc/fstab_ of the real root will be parsed for special mount options and
mounted accordingly.
**ro**::
force mounting _/_ and _/usr_ (if it is a separate device) read-only. If
none of ro and rw is present, both are mounted according to _/etc/fstab_.
**rw**::
force mounting _/_ and _/usr_ (if it is a separate device) read-write.
See also ro option.
**rd.fstab=0**::
do not honor special mount options for the root filesystem found in
_/etc/fstab_ of the real root.
@@ -81,10 +89,6 @@ resume=UUID=3f5ad593-4546-4a94-a374-bcfb68aa11f7
the init system performs fsck before remount, you might want to use this
option to avoid duplication.
**rd.usrmount.ro**:
force mounting _/usr_ read-only. Use this option if your init system
performs remount of _/usr_ the same as it does with rootfs.
Misc
~~~~
@@ -100,6 +104,12 @@ Misc
force loading kernel module <drivername> after all automatic loading modules
have been loaded. This parameter can be specified multiple times.
**rd.retry=**_<seconds>_::
specify how long dracut should wait for devices to appear.
The default is 30 seconds. After 2/3 of the time, degraded raids are force
started. If you have hardware, which takes a very long time to announce its
drives, you might want to extend this value.
[[dracutkerneldebug]]
Debug
~~~~~
@@ -229,6 +239,29 @@ rd.luks.key=/foo/bar.key
----
+
As you see, you can skip colons in such a case.
+
[NOTE]
===============================
Dracut pipes key to cryptsetup with _-d -_ argument, therefore you need to pipe
to crypsetup luksFormat with _-d -_, too!
Here follows example for key encrypted with GPG:
----
gpg --quiet --decrypt rootkey.gpg \
| cryptsetup -d - -v \
--cipher serpent-cbc-essiv:sha256 \
--key-size 256 luksFormat /dev/sda3
----
If you use plain keys, just add path to _-d_ option:
----
cryptsetup -d rootkey.key -v \
--cipher serpent-cbc-essiv:sha256 \
--key-size 256 luksFormat /dev/sda3
----
===============================
MD RAID
~~~~~~~
@@ -394,6 +427,21 @@ NFS
**rd.nfs.domain=**_<NFSv4 domain name>_::
Set the NFSv4 domain name. Will overwrite the settings in _/etc/idmap.conf_.
CIFS
~~~
**root=**cifs://[_<username>_[:_<password>_]@]_<server-ip>_:_<root-dir>_::
mount cifs share from <server-ip>:/<root-dir>, if no server-ip is given, use
dhcp next_server. if server-ip is an IPv6 address it has to be put in
brackets, e.g. [2001:DB8::1]. If a username or password are not specified
as part of the root, then they must be passed on the command line through
cifsuser/cifspass.
**cifsuser=_<username>_::
Set the cifs username, if not specified as part of the root.
**cifspass=_<password>_::
Set the cifs password, if not specified as part of the root.
iSCSI
~~~~~
**root=**iscsi:[_<username>_:_<password>_[:_<reverse>_:_<password>_]@][_<servername>_]:[_<protocol>_]:[_<port>_][:[_<iscsi_iface_name>_]:[_<netdev_name>_]]:[_<LUN>_]:_<targetname>_::

View File

@@ -43,6 +43,9 @@ lvmconf="yes"
# inhibit installation of any fsck tools
#nofscks="yes"
# mount / and /usr read-only by default
#ro_mnt="no"
# set the directory for temporary files
# default: /var/tmp
#tmpdir=/tmp

View File

@@ -97,6 +97,9 @@ If chrooted to another root other than the real root device, use --fstab and pro
*nofscks=*"__{yes|no}__"::
If specified, inhibit installation of any fsck tools.
*ro_mnt*
Mount _/_ and _/usr_ read-only by default.
*kernel_only=*"__{yes|no}__"::
Only install kernel drivers and firmware files. (default=no)

View File

@@ -1,9 +0,0 @@
# /etc/dracut.conf.d/gentoo-openrc.conf
# Dracut config file customized for Gentoo Base System release 2
#
# Modules
#
# i18n
i18n_vars="/etc/conf.d/keymaps:keymap-KEYMAP,extended_keymaps-EXT_KEYMAPS /etc/conf.d/consolefont:consolefont-FONT,consoletranslation-FONT_MAP /etc/rc.conf:unicode-UNICODE"

View File

@@ -0,0 +1,5 @@
# /etc/dracut.conf.d/gentoo-systemd.conf
# Paths of systemd dirs on Gentoo
systemdutildir=/usr/lib/systemd
systemdsystemunitdir=/usr/lib/systemd/system

View File

@@ -1,9 +1,12 @@
# /etc/dracut.conf.d/gentoo.conf
# Dracut config file customized for Gentoo Base System release 1
# /etc/dracut.conf.d/gentoo-openrc.conf
# Dracut config file customized for Gentoo Base System release 2
udevdir=/lib/udev
ro_mnt=yes
#
# Modules
#
# i18n
i18n_vars="/etc/conf.d/keymaps:KEYMAP,EXTENDED_KEYMAPS-EXT_KEYMAPS /etc/conf.d/consolefont:CONSOLEFONT-FONT,CONSOLETRANSLATION-FONT_MAP /etc/rc.conf:UNICODE"
i18n_vars="/etc/conf.d/keymaps:keymap-KEYMAP,extended_keymaps-EXT_KEYMAPS /etc/conf.d/consolefont:consolefont-FONT,consoletranslation-FONT_MAP /etc/rc.conf:unicode-UNICODE"

View File

@@ -101,6 +101,7 @@ Creates initial ramdisk images for preloading modules
--nolvmconf Do not include local /etc/lvm/lvm.conf
--fscks [LIST] Add a space-separated list of fsck helpers.
--nofscks Inhibit installation of any fsck helpers.
--ro-mnt Mount / and /usr read-only by default.
-h, --help This message
--debug Output debug information of the build process
--profile Output profile information of the build process
@@ -126,7 +127,7 @@ Creates initial ramdisk images for preloading modules
Useful when running dracut from a git checkout.
-H, --hostonly Host-Only mode: Install only what is needed for
booting the local host instead of a generic host.
--no-hostonly Disables Host-Only mode
-N, --no-hostonly Disables Host-Only mode
--fstab Use /etc/fstab to determine the root device.
--add-fstab [FILE] Add file to the initramfs fstab
--mount "[DEV] [MP] [FSTYPE] [FSOPTS]"
@@ -244,7 +245,7 @@ set -- "${@/--include/++include}"
set -- "${@/%-i/++include}"
TEMP=$(unset POSIXLY_CORRECT; getopt \
-o "a:m:o:d:I:k:c:L:fvqlHhM" \
-o "a:m:o:d:I:k:c:L:fvqlHhMN" \
--long kver: \
--long add: \
--long force-add: \
@@ -261,6 +262,7 @@ TEMP=$(unset POSIXLY_CORRECT; getopt \
--long add-fstab: \
--long mount: \
--long nofscks: \
--long ro-mnt \
--long kmoddir: \
--long conf: \
--long confdir: \
@@ -326,6 +328,7 @@ while :; do
--add-fstab) push add_fstab_l "$2"; shift;;
--mount) push fstab_lines "$2"; shift;;
--nofscks) nofscks_l="yes";;
--ro-mnt) ro_mnt_l="yes";;
-k|--kmoddir) drivers_dir_l="$2"; shift;;
-c|--conf) conffile="$2"; shift;;
--confdir) confdir="$2"; shift;;
@@ -356,7 +359,7 @@ while :; do
&& dracutbasedir="$(readlink -f ${0%/*})"
;;
-H|--hostonly) hostonly_l="yes" ;;
--no-hostonly) hostonly_l="no" ;;
-N|--no-hostonly) hostonly_l="no" ;;
--fstab) use_fstab_l="yes" ;;
-h|--help) long_usage; exit 1 ;;
-i|--include) push include_src "$2"
@@ -558,6 +561,7 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
[[ $compress_l ]] && compress=$compress_l
[[ $show_modules_l ]] && show_modules=$show_modules_l
[[ $nofscks_l ]] && nofscks="yes"
[[ $ro_mnt_l ]] && ro_mnt="yes"
# eliminate IFS hackery when messing with fw_dir
fw_dir=${fw_dir//:/ }
@@ -596,11 +600,18 @@ else
exit 1
fi
inst /bin/sh
if ! $DRACUT_INSTALL ${initdir+-D "$initdir"} -R "$initdir/bin/sh" &>/dev/null; then
unset DRACUT_RESOLVE_LAZY
export DRACUT_RESOLVE_DEPS=1
fi
rm -fr ${initdir}/*
if [[ -f $dracutbasedir/dracut-version.sh ]]; then
. $dracutbasedir/dracut-version.sh
fi
# Verify bash version, curret minimum is 3.1
# Verify bash version, current minimum is 3.1
if (( ${BASH_VERSINFO[0]} < 3 ||
( ${BASH_VERSINFO[0]} == 3 && ${BASH_VERSINFO[1]} < 1 ) )); then
dfatal 'You need at least Bash 3.1 to use dracut, sorry.'
@@ -776,14 +787,14 @@ if ! [[ -d "$systemdutildir" ]]; then
fi
[[ -d "$systemdsystemunitdir" ]] || systemdsystemunitdir=${systemdutildir}/system
export initdir dracutbasedir dracutmodules drivers \
export initdir dracutbasedir dracutmodules \
fw_dir drivers_dir debug no_kernel kernel_only \
add_drivers omit_drivers mdadmconf lvmconf filesystems \
use_fstab fstab_lines libdirs fscks nofscks \
omit_drivers mdadmconf lvmconf \
use_fstab fstab_lines libdirs fscks nofscks ro_mnt \
stdloglvl sysloglvl fileloglvl kmsgloglvl logfile \
debug host_fs_types host_devs sshkey add_fstab \
DRACUT_VERSION udevdir systemdutildir systemdsystemunitdir \
prefix
prefix filesystems drivers
# Create some directory structure first
[[ $prefix ]] && mkdir -m 0755 -p "${initdir}${prefix}"
@@ -799,7 +810,7 @@ if [[ $prefix ]]; then
fi
if [[ $kernel_only != yes ]]; then
for d in usr/bin usr/sbin bin etc lib sbin tmp usr var var/log var/run var/lock $libdirs; do
for d in usr/bin usr/sbin bin etc lib sbin tmp usr var var/log $libdirs; do
[[ -e "${initdir}${prefix}/$d" ]] && continue
if [ -L "/$d" ]; then
inst_symlink "/$d" "${prefix}/$d"
@@ -816,8 +827,8 @@ if [[ $kernel_only != yes ]]; then
fi
done
ln -sfn /run "$initdir/var/run"
ln -sfn /run/lock "$initdir/var/lock"
ln -sfn ../run "$initdir/var/run"
ln -sfn ../run/lock "$initdir/var/lock"
else
for d in lib "$libdir"; do
[[ -e "${initdir}${prefix}/$d" ]] && continue
@@ -894,6 +905,18 @@ dinfo "*** Including modules done ***"
## final stuff that has to happen
if [[ $no_kernel != yes ]]; then
if [[ $drivers ]]; then
hostonly='' instmods $drivers
fi
if [[ $add_drivers ]]; then
hostonly='' instmods -c $add_drivers
fi
if [[ $filesystems ]]; then
hostonly='' instmods -c $filesystems
fi
dinfo "*** Installing kernel module dependencies and firmware ***"
dracut_kernel_post
dinfo "*** Installing kernel module dependencies and firmware done ***"

View File

@@ -81,7 +81,9 @@ Requires: gzip xz
Requires: module-init-tools >= 3.7-9
Requires: sed
Requires: file
Requires: kpartx
Requires: udev > 166
Requires: kbd kbd-misc
%if 0%{?fedora} || 0%{?rhel} > 6
Requires: util-linux >= 2.21
Conflicts: systemd < 187
@@ -258,6 +260,7 @@ rm -rf $RPM_BUILD_ROOT
%endif
%dir /etc/dracut.conf.d
%{_mandir}/man8/dracut.8*
%{_mandir}/man8/*service.8*
%if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999
%{_mandir}/man8/mkinitrd.8*
%{_mandir}/man1/lsinitrd.1*
@@ -284,6 +287,7 @@ rm -rf $RPM_BUILD_ROOT
%{dracutlibdir}/modules.d/90multipath
%{dracutlibdir}/modules.d/90qemu
%{dracutlibdir}/modules.d/91crypt-gpg
%{dracutlibdir}/modules.d/91crypt-loop
%{dracutlibdir}/modules.d/95debug
%{dracutlibdir}/modules.d/95resume
%{dracutlibdir}/modules.d/95rootfs-block
@@ -325,6 +329,7 @@ rm -rf $RPM_BUILD_ROOT
%{dracutlibdir}/modules.d/95iscsi
%{dracutlibdir}/modules.d/90livenet
%{dracutlibdir}/modules.d/90qemu-net
%{dracutlibdir}/modules.d/95cifs
%{dracutlibdir}/modules.d/95nbd
%{dracutlibdir}/modules.d/95nfs
%{dracutlibdir}/modules.d/95ssh-client

View File

@@ -517,6 +517,7 @@ Install SOURCE to DEST in DESTROOTDIR with all needed dependencies.\n\
-h --help Show this help\n\
\n\
Example:\n\
# mkdir -p /var/tmp/test-root\n\
# %s -D /var/tmp/test-root --ldd -a sh tr\n\
# tree /var/tmp/test-root\n\
/var/tmp/test-root\n\
@@ -742,9 +743,17 @@ int main(int argc, char **argv)
if (strcmp(destrootdir, "/") == 0) {
log_error("Environment DESTROOTDIR or argument -D is set to '/'!");
usage(EXIT_FAILURE);
}
i = destrootdir;
destrootdir = realpath(destrootdir, NULL);
if (!destrootdir) {
log_error("Environment DESTROOTDIR or argument -D is set to '%s': %m", i);
r = EXIT_FAILURE;
goto finish;
}
free(i);
items = hashmap_new(string_hash_func, string_compare_func);
items_failed = hashmap_new(string_hash_func, string_compare_func);

Binary file not shown.

View File

@@ -21,7 +21,7 @@
usage()
{
echo "Usage: $(basename $0) [-s] [<initramfs file> [<filename>]]"
echo "Usage: $(${0##*/}) [-s] [<initramfs file> [<filename>]]"
}
[[ $# -le 2 ]] || { usage ; exit 1 ; }

View File

@@ -23,5 +23,6 @@ install() {
inst_hook cleanup 00 "$moddir/watchdog.sh"
inst_hook cleanup 99 "$moddir/watchdog.sh"
inst_hook emergency 02 "$moddir/watchdog-stop.sh"
dracut_install -o wdctl
}

View File

@@ -1,7 +1,12 @@
#!/bin/sh
if [ -e /dev/watchdog ]; then
if [ ! -e /tmp/watchdog_timeout ]; then
wdctl -s 60 /dev/watchdog &>/dev/null
> /tmp/watchdog_timeout
fi
info "Triggering watchdog"
>/dev/watchdog
else
modprobe ib700wdt
modprobe i6300esb
fi

View File

@@ -1,2 +1,2 @@
# Console initialization - keyboard, font, etc.
KERNEL=="tty0", RUN+="/lib/udev/console_init $root/$name"
KERNEL=="tty0", RUN+="/sbin/initqueue --unique --name console_init_$name /lib/udev/console_init $root/$name"

View File

@@ -2,7 +2,11 @@
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
[ -x /lib/systemd/systemd-vconsole-setup ] && exit 0
[ -n "$DRACUT_SYSTEMD" ] && exit 0
if [ -x /lib/systemd/systemd-vconsole-setup ]; then
/lib/systemd/systemd-vconsole-setup "$@"
fi
[ -e /etc/vconsole.conf ] && . /etc/vconsole.conf

View File

@@ -31,7 +31,7 @@ install() {
*) cmd=grep ;;
esac
for INCL in $($cmd "^include " $MAP | while read a a b; do echo ${a/\"/}; done); do
for INCL in $($cmd "^include " $MAP | while read a a b; do echo ${a//\"/}; done); do
for FN in $(find ${kbddir}/keymaps -type f -name $INCL\*); do
findkeymap $FN
done
@@ -96,7 +96,7 @@ install() {
for _src in $(eval echo ${kbddir}/{${KBDSUBDIRS}}); do
inst_dir "$_src"
cp --reflink=auto --sparse=auto -prfL -t "${initdir}/${_src%/*}" "$_src"
cp --reflink=auto --sparse=auto -prfL -t "${initdir}/${_src}" "$_src"/*
done
# remove unnecessary files

View File

@@ -19,10 +19,10 @@ inst_key_val() {
unset _value
}
inst_key_val '' /etc/vconsole.conf KEYMAP vconsole.keymap KEYTABLE
inst_key_val '' /etc/vconsole.conf FONT vconsole.font SYSFONT
inst_key_val '' /etc/vconsole.conf FONT_MAP vconsole.font.map CONTRANS
inst_key_val '' /etc/vconsole.conf FONT_UNIMAP vconsole.font.unimap UNIMAP
inst_key_val '' /etc/vconsole.conf KEYMAP vconsole.keymap -d KEYTABLE
inst_key_val '' /etc/vconsole.conf FONT vconsole.font -d SYSFONT
inst_key_val '' /etc/vconsole.conf FONT_MAP vconsole.font.map -d CONTRANS
inst_key_val '' /etc/vconsole.conf FONT_UNIMAP vconsole.font.unimap -d UNIMAP
inst_key_val 1 /etc/vconsole.conf UNICODE vconsole.unicode vconsole.font.unicode
inst_key_val '' /etc/vconsole.conf EXT_KEYMAP vconsole.keymap.ext
@@ -35,10 +35,8 @@ if [ -f /etc/locale.conf ]; then
export LC_ALL
fi
# FIXME: fix systemd-vconsole-setup
#if [ -x /lib/systemd/systemd-vconsole-setup ]; then
# /lib/systemd/systemd-vconsole-setup
# rm -f /{etc,lib}/udev/rules.d/10-console.rules
# rm -f /lib/udev/console_init
# ln -s /lib/systemd/systemd-vconsole-setup /lib/udev/console_init
#fi
if [ -n "$DRACUT_SYSTEMD" ]; then
rm -f /etc/udev/rules.d/10-console.rules
rm -f /lib/udev/rules.d/10-console.rules
rm -f /lib/udev/console_init
fi

View File

@@ -73,6 +73,7 @@ installkernel() {
instmods bonding
# vlan
instmods 8021q
instmods af_packet
}
install() {

View File

@@ -2,7 +2,7 @@
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
if getargbool 1 rd.splash -n rd_NO_SPLASH; then
if getargbool 1 rd.splash -d -n rd_NO_SPLASH; then
info "Starting Gentoo Splash"
[ -x /lib/udev/console_init ] && /lib/udev/console_init /dev/tty0

View File

@@ -76,9 +76,5 @@ install() {
inst_hook pre-trigger 10 "$moddir"/plymouth-pretrigger.sh
inst_hook emergency 50 "$moddir"/plymouth-emergency.sh
dracut_install readlink
if [[ -x $systemdutildir/systemd ]]; then
dracut_install -o $systemdsystemunitdir/plymouth-quit-wait.service
fi
}

View File

@@ -2,6 +2,6 @@
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
if [ -x /bin/plymouth ]; then
if [ -x /bin/plymouth -a -z "$DRACUT_SYSTEMD" ]; then
/bin/plymouth --newroot=$NEWROOT
fi

View File

@@ -2,8 +2,8 @@
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
if [ -x /bin/plymouthd ]; then
if getargbool 1 plymouth.enable && getargbool 1 rd.plymouth -n rd_NO_PLYMOUTH; then
if [ -x /bin/plymouthd -a -z "$DRACUT_SYSTEMD" ]; then
if getargbool 1 plymouth.enable && getargbool 1 rd.plymouth -d -n rd_NO_PLYMOUTH; then
# first trigger graphics subsystem
udevadm trigger --action=add --attr-match=class=0x030000 >/dev/null 2>&1
# first trigger graphics and tty subsystem

View File

@@ -33,6 +33,7 @@ install() {
inst_rules "$moddir/80-btrfs.rules"
inst_script "$moddir/btrfs_finished.sh" /sbin/btrfs_finished
inst_script "$moddir/btrfs_timeout.sh" /sbin/btrfs_timeout
dracut_install btrfs btrfsck
dracut_install btrfsck
inst $(command -v btrfs) /sbin/btrfs
}

View File

@@ -4,7 +4,7 @@
# close everything which is not busy
rm -f /etc/udev/rules.d/70-luks.rules >/dev/null 2>&1
if ! getarg rd.luks.uuid rd_LUKS_UUID >/dev/null 2>&1 && getargbool 1 rd.luks -n rd_NO_LUKS >/dev/null 2>&1; then
if ! getarg rd.luks.uuid -d rd_LUKS_UUID >/dev/null 2>&1 && getargbool 1 rd.luks -d -n rd_NO_LUKS >/dev/null 2>&1; then
while true; do
local do_break="y"
for i in /dev/mapper/luks-*; do

View File

@@ -165,8 +165,15 @@ readkey() {
local keydev="$2"
local device="$3"
local mntp=$(mkuniqdir /mnt keydev)
mount -r "$keydev" "$mntp" || die 'Mounting rem. dev. failed!'
# This creates a unique single mountpoint for *, or several for explicitly
# given LUKS devices. It accomplishes unlocking multiple LUKS devices with
# a single password entry.
local mntp="/mnt/$(str_replace "keydev-$keydev-$keypath" '/' '-')"
if [ ! -d "$mntp" ]; then
mkdir "$mntp"
mount -r "$keydev" "$mntp" || die 'Mounting rem. dev. failed!'
fi
case "${keypath##*.}" in
gpg)
@@ -177,9 +184,22 @@ readkey() {
die "No GPG support to decrypt '$keypath' on '$keydev'."
fi
;;
img)
if [ -f /lib/dracut-crypt-loop-lib.sh ]; then
. /lib/dracut-crypt-loop-lib.sh
loop_decrypt "$mntp" "$keypath" "$keydev" "$device"
initqueue --onetime --finished --unique --name "crypt-loop-cleanup-99-${mntp##*/}" \
$(command -v umount) "$mntp; " $(command -v rmdir) "$mntp"
return 0
else
die "No loop file support to decrypt '$keypath' on '$keydev'."
fi
;;
*) cat "$mntp/$keypath" ;;
esac
# General unmounting mechanism, modules doing custom cleanup should return earlier
# and install a pre-pivot cleanup hook
umount "$mntp"
rmdir "$mntp"
}

View File

@@ -0,0 +1,18 @@
#!/bin/sh
. /lib/dracut-lib.sh
dev=$1
luks=$2
if [ -f /etc/crypttab ]; then
while read l rest; do
strstr "${l##luks-}" "${luks##luks-}" && exit 0
done < /etc/crypttab
fi
echo "$luks $dev" >> /etc/crypttab
/lib/systemd/system-generators/systemd-cryptsetup-generator
systemctl daemon-reload
systemctl start cryptsetup.target
exit 0

View File

@@ -36,7 +36,7 @@ fi
numtries=${3:-10}
# TODO: improve to support what cmdline does
if [ -f /etc/crypttab ] && getargbool 1 rd.luks.crypttab -n rd_NO_CRYPTTAB; then
if [ -f /etc/crypttab ] && getargbool 1 rd.luks.crypttab -d -n rd_NO_CRYPTTAB; then
while read name dev luksfile luksoptions; do
# ignore blank lines and comments
if [ -z "$name" -o "${name#\#}" != "$name" ]; then

View File

@@ -49,5 +49,15 @@ install() {
inst_hook cleanup 30 "$moddir/crypt-cleanup.sh"
inst_simple /etc/crypttab
inst_simple "$moddir/crypt-lib.sh" "/lib/dracut-crypt-lib.sh"
}
dracut_install -o \
$systemdutildir/system-generators/systemd-cryptsetup-generator \
$systemdutildir/system-generators/systemd-cryptsetup-generator \
$systemdutildir/systemd-cryptsetup \
$systemdsystemunitdir/systemd-ask-password-console.path \
$systemdsystemunitdir/systemd-ask-password-console.service \
$systemdsystemunitdir/cryptsetup.target \
$systemdsystemunitdir/sysinit.target.wants/cryptsetup.target \
systemd-ask-password systemd-tty-ask-password-agent
inst_script "$moddir"/crypt-run-generator.sh /sbin/crypt-run-generator
}

View File

@@ -1,7 +1,8 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
if ! getargbool 1 rd.luks -n rd_NO_LUKS; then
if ! getargbool 1 rd.luks -d -n rd_NO_LUKS; then
info "rd.luks=0: removing cryptoluks activation"
rm -f /etc/udev/rules.d/70-luks.rules
else
@@ -10,19 +11,31 @@ else
echo 'ACTION!="add|change", GOTO="luks_end"'
} > /etc/udev/rules.d/70-luks.rules.new
LUKS=$(getargs rd.luks.uuid rd_LUKS_UUID)
LUKS=$(getargs rd.luks.uuid -d rd_LUKS_UUID)
tout=$(getarg rd.luks.key.tout)
if [ -n "$LUKS" ]; then
for luksid in $LUKS; do
luksid=${luksid##luks-}
{
printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", '
printf -- 'ENV{ID_FS_UUID}=="*%s*", ' $luksid
printf -- 'RUN+="%s --unique --onetime ' $(command -v initqueue)
printf -- '--name cryptroot-ask-%%k %s ' $(command -v cryptroot-ask)
printf -- '$env{DEVNAME} luks-$env{ID_FS_UUID} %s"\n' $tout
} >> /etc/udev/rules.d/70-luks.rules.new
if [ -z "$DRACUT_SYSTEMD" ]; then
{
printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", '
printf -- 'ENV{ID_FS_UUID}=="*%s*", ' $luksid
printf -- 'RUN+="%s --unique --onetime ' $(command -v initqueue)
printf -- '--name cryptroot-ask-%%k %s ' $(command -v cryptroot-ask)
printf -- '$env{DEVNAME} luks-$env{ID_FS_UUID} %s"\n' $tout
} >> /etc/udev/rules.d/70-luks.rules.new
else
{
printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", '
printf -- 'ENV{ID_FS_UUID}=="*%s*", ' $luksid
printf -- 'RUN+="%s --unique --onetime ' $(command -v initqueue)
printf -- '--name crypt-run-generator-%%k %s ' $(command -v crypt-run-generator)
printf -- '$env{DEVNAME} luks-$env{ID_FS_UUID}"\n'
} >> /etc/udev/rules.d/70-luks.rules.new
fi
uuid=$luksid
while [ "$uuid" != "${uuid#*-}" ]; do uuid=${uuid%%-*}${uuid#*-}; done
@@ -35,11 +48,19 @@ else
} >> $hookdir/emergency/90-crypt.sh
done
else
{
printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="%s ' $(command -v initqueue)
printf -- '--unique --onetime --name cryptroot-ask-%%k '
printf -- '%s $env{DEVNAME} luks-$env{ID_FS_UUID} %s"\n' $(command -v cryptroot-ask) $tout
} >> /etc/udev/rules.d/70-luks.rules.new
if [ -z "$DRACUT_SYSTEMD" ]; then
{
printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="%s ' $(command -v initqueue)
printf -- '--unique --onetime --name cryptroot-ask-%%k '
printf -- '%s $env{DEVNAME} luks-$env{ID_FS_UUID} %s"\n' $(command -v cryptroot-ask) $tout
} >> /etc/udev/rules.d/70-luks.rules.new
else
{
printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="%s ' $(command -v initqueue)
printf -- '--unique --onetime --name crypt-run-generator-%%k '
printf -- '%s $env{DEVNAME} luks-$env{ID_FS_UUID}"\n' $(command -v crypt-run-generator)
} >> /etc/udev/rules.d/70-luks.rules.new
fi
fi
echo 'LABEL="luks_end"' >> /etc/udev/rules.d/70-luks.rules.new

View File

@@ -4,6 +4,8 @@
SUBSYSTEM!="block", GOTO="dm_end"
ACTION!="add|change", GOTO="dm_end"
# Also don't process disks that are slated to be a multipath device
ENV{DM_MULTIPATH_DEVICE_PATH}=="?*", GOTO="dm_end"
ENV{ID_FS_TYPE}=="linux_raid_member", GOTO="dm_end"

View File

@@ -4,7 +4,7 @@
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
DM_RAIDS=$(getargs rd.dm.uuid rd_DM_UUID=)
DM_RAIDS=$(getargs rd.dm.uuid -d rd_DM_UUID=)
DM_CLEANUP="no"

View File

@@ -51,7 +51,9 @@ depends() {
install() {
local _i
dracut_install dmraid partx kpartx
dracut_install dmraid
dracut_install -o kpartx
inst $(command -v partx) /sbin/partx
inst "$moddir/dmraid.sh" /sbin/dmraid_scan

View File

@@ -2,17 +2,17 @@
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
# nodmraid for anaconda / rc.sysinit compatibility
if ! getargbool 1 rd.dm -n rd_NO_DM || getarg nodmraid; then
if ! getargbool 1 rd.dm -d -n rd_NO_DM || getarg "rd.dm=0" -d nodmraid; then
info "rd.dm=0: removing DM RAID activation"
udevproperty rd_NO_DM=1
fi
if ! command -v mdadm >/dev/null || ! getargbool 1 rd.md.imsm -n rd_NO_MDIMSM || getarg noiswmd; then
if ! command -v mdadm >/dev/null || ! getargbool 1 rd.md.imsm -d -n rd_NO_MDIMSM -n noiswmd; then
info "rd.md.imsm=0: no MD RAID for imsm/isw raids"
udevproperty rd_NO_MDIMSM=1
fi
if ! command -v mdadm >/dev/null || ! getargbool 1 rd.md.ddf -n rd_NO_MDDDF || getarg noddfmd; then
if ! command -v mdadm >/dev/null || ! getargbool 1 rd.md.ddf -n rd_NO_MDDDF -n noddfmd; then
info "rd.md.ddf=0: no MD RAID for SNIA ddf raids"
udevproperty rd_NO_MDDDF=1
fi

View File

@@ -6,7 +6,7 @@ type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
PATH=/usr/sbin:/usr/bin:/sbin:/bin
if getargbool 0 rd.live.debug -y rdlivedebug; then
if getargbool 0 rd.live.debug -n -y rdlivedebug; then
exec > /tmp/liveroot.$$.out
exec 2>> /tmp/liveroot.$$.out
set -x
@@ -17,19 +17,19 @@ livedev="$1"
# parse various live image specific options that make sense to be
# specified as their own things
live_dir=$(getarg rd.live.dir live_dir)
live_dir=$(getarg rd.live.dir -d live_dir)
[ -z "$live_dir" ] && live_dir="LiveOS"
getargbool 0 rd.live.ram -y live_ram && live_ram="yes"
getargbool 0 rd.live.overlay.reset -y reset_overlay && reset_overlay="yes"
getargbool 0 rd.live.overlay.readonly -y readonly_overlay && readonly_overlay="--readonly" || readonly_overlay=""
overlay=$(getarg rd.live.overlay overlay)
getargbool 0 rd.live.ram -d -y live_ram && live_ram="yes"
getargbool 0 rd.live.overlay.reset -d -y reset_overlay && reset_overlay="yes"
getargbool 0 rd.live.overlay.readonly -d -y readonly_overlay && readonly_overlay="--readonly" || readonly_overlay=""
overlay=$(getarg rd.live.overlay -d overlay)
# CD/DVD media check
[ -b $livedev ] && fs=$(blkid -s TYPE -o value $livedev)
if [ "$fs" = "iso9660" -o "$fs" = "udf" ]; then
check="yes"
fi
getarg rd.live.check check || check=""
getarg rd.live.check -d check || check=""
if [ -n "$check" ]; then
[ -x /bin/plymouth ] && /bin/plymouth --hide-splash
checkisomd5 --verbose $livedev
@@ -167,7 +167,6 @@ if [ -e "$SQUASHED" ] ; then
dd if=$SQUASHED of=/squashed.img bs=512 2> /dev/null
umount -n /run/initramfs/live
echo "Done copying live image to RAM."
eject -p $livedev || :
SQUASHED="/squashed.img"
fi

View File

@@ -21,7 +21,7 @@ installkernel() {
install() {
dracut_install umount dmsetup blkid dd losetup grep blockdev
dracut_install -o eject checkisomd5
dracut_install -o checkisomd5
inst_hook cmdline 30 "$moddir/parse-dmsquash-live.sh"
inst_hook pre-udev 30 "$moddir/dmsquash-live-genrules.sh"
inst_hook pre-udev 30 "$moddir/dmsquash-liveiso-genrules.sh"

View File

@@ -7,7 +7,7 @@
[ -z "$root" ] && root=$(getarg root=)
# support legacy syntax of passing liveimg and then just the base root
if getargbool 0 rd.live.image -y liveimg; then
if getargbool 0 rd.live.image -d -y liveimg; then
liveroot="live:$root"
fi

View File

@@ -4,7 +4,7 @@
. /lib/dracut-lib.sh
for modlist in $(getargs rd.driver.post rdinsmodpost=); do
for modlist in $(getargs rd.driver.post -d rdinsmodpost=); do
(
IFS=,
for m in $modlist; do

View File

@@ -61,23 +61,12 @@ installkernel() {
}
for_each_host_dev_fs inst_fs
fi
else
hostonly='' instmods $drivers
fi
if [[ $add_drivers ]]; then
hostonly='' instmods -c $add_drivers || return 1
fi
if [[ $filesystems ]]; then
hostonly='' instmods -c $filesystems || return 1
fi
}
install() {
local _f i
[ -f /etc/modprobe.conf ] && dracut_install /etc/modprobe.conf
dracut_install $(find -L /{etc,lib}/modprobe.d/ -maxdepth 1 -type f -name '*.conf')
dracut_install -o /{etc,lib}/modprobe.d/*.conf
inst_hook cmdline 01 "$moddir/parse-kernel.sh"
inst_simple "$moddir/insmodpost.sh" /sbin/insmodpost.sh
}

View File

@@ -2,7 +2,7 @@
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
for i in $(getargs rd.driver.pre rdloaddriver=); do
for i in $(getargs rd.driver.pre -d rdloaddriver=); do
(
IFS=,
for p in $i; do
@@ -11,7 +11,7 @@ for i in $(getargs rd.driver.pre rdloaddriver=); do
)
done
for i in $(getargs rd.driver.blacklist rdblacklist=); do
for i in $(getargs rd.driver.blacklist -d rdblacklist=); do
(
IFS=,
for p in $i; do
@@ -20,7 +20,7 @@ for i in $(getargs rd.driver.blacklist rdblacklist=); do
)
done
for p in $(getargs rd.driver.post rdinsmodpost=); do
for p in $(getargs rd.driver.post -d rdinsmodpost=); do
echo "blacklist $p" >> /etc/modprobe.d/initramfsblacklist.conf
_do_insmodpost=1
done

View File

@@ -6,6 +6,8 @@
SUBSYSTEM!="block", GOTO="lvm_end"
ACTION!="add|change", GOTO="lvm_end"
# Also don't process disks that are slated to be a multipath device
ENV{DM_MULTIPATH_DEVICE_PATH}=="?*", GOTO="lvm_end"
KERNEL=="dm-[0-9]*", ACTION=="add", GOTO="lvm_end"
ENV{ID_FS_TYPE}!="LVM?_member", GOTO="lvm_end"

View File

@@ -7,10 +7,10 @@
extraargs="$@"
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
VGS=$(getargs rd.lvm.vg rd_LVM_VG=)
LVS=$(getargs rd.lvm.lv rd_LVM_LV=)
SNAPSHOT=$(getargs rd.lvm.snapshot rd_LVM_SNAPSHOT=)
SNAPSIZE=$(getargs rd.lvm.snapsize rd_LVM_SNAPSIZE=)
VGS=$(getargs rd.lvm.vg -d rd_LVM_VG=)
LVS=$(getargs rd.lvm.lv -d rd_LVM_LV=)
SNAPSHOT=$(getargs rd.lvm.snapshot -d rd_LVM_SNAPSHOT=)
SNAPSIZE=$(getargs rd.lvm.snapsize -d rd_LVM_SNAPSIZE=)
[ -d /etc/lvm ] || mkdir -m 0755 -p /etc/lvm
# build a list of devices to scan
@@ -129,4 +129,6 @@ if [ "$lvmwritten" ]; then
fi
unset lvmwritten
udevadm settle
need_shutdown

View File

@@ -1,15 +1,15 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
if [ -e /etc/lvm/lvm.conf ] && ! getargbool 1 rd.lvm.conf -n rd_NO_LVMCONF; then
if [ -e /etc/lvm/lvm.conf ] && ! getargbool 1 rd.lvm.conf -d -n rd_NO_LVMCONF; then
rm -f /etc/lvm/lvm.conf
fi
if ! getargbool 1 rd.lvm -n rd_NO_LVM; then
if ! getargbool 1 rd.lvm -d -n rd_NO_LVM; then
info "rd.lvm=0: removing LVM activation"
rm -f /etc/udev/rules.d/64-lvm*.rules
else
for dev in $(getargs rd.lvm.vg rd_LVM_VG=) $(getargs rd.lvm.lv rd_LVM_LV=); do
for dev in $(getargs rd.lvm.vg -d rd_LVM_VG=) $(getargs rd.lvm.lv -d rd_LVM_LV=); do
wait_for_dev "/dev/$dev"
done
fi

View File

@@ -6,6 +6,8 @@ ACTION!="add|change", GOTO="md_end"
SUBSYSTEM!="block", GOTO="md_end"
ENV{rd_NO_MD}=="?*", GOTO="md_end"
KERNEL=="md*", GOTO="md_end"
# Also don't process disks that are slated to be a multipath device
ENV{DM_MULTIPATH_DEVICE_PATH}=="?*", GOTO="md_end"
ENV{ID_FS_TYPE}=="ddf_raid_member|isw_raid_member|linux_raid_member", GOTO="md_try"
GOTO="md_end"

View File

@@ -43,8 +43,10 @@ installkernel() {
}
install() {
dracut_install mdadm partx cat
dracut_install cat
dracut_install -o mdmon
inst $(command -v partx) /sbin/partx
inst $(command -v mdadm) /sbin/mdadm
# XXX: mdmon really needs to run as non-root?
# If so, write only the user it needs in the initrd's /etc/passwd (and maybe /etc/group)

View File

@@ -1,11 +1,11 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
if ! getargbool 1 rd.md -n rd_NO_MD; then
if ! getargbool 1 rd.md -d -n rd_NO_MD; then
info "rd.md=0: removing MD RAID activation"
udevproperty rd_NO_MD=1
else
MD_UUID=$(getargs rd.md.uuid rd_MD_UUID=)
MD_UUID=$(getargs rd.md.uuid -d rd_MD_UUID=)
# rewrite the md rules to only process the specified raid array
if [ -n "$MD_UUID" ]; then
@@ -29,25 +29,25 @@ else
fi
if [ -e /etc/mdadm.conf ] && getargbool 1 rd.md.conf -n rd_NO_MDADMCONF; then
if [ -e /etc/mdadm.conf ] && getargbool 1 rd.md.conf -d -n rd_NO_MDADMCONF; then
udevproperty rd_MDADMCONF=1
rm -f $hookdir/pre-pivot/*mdraid-cleanup.sh
fi
if ! getargbool 1 rd.md.conf -n rd_NO_MDADMCONF; then
if ! getargbool 1 rd.md.conf -d -n rd_NO_MDADMCONF; then
rm -f /etc/mdadm/mdadm.conf /etc/mdadm.conf
ln -s $(command -v mdraid-cleanup) $hookdir/pre-pivot/31-mdraid-cleanup.sh 2>/dev/null
fi
# noiswmd nodmraid for anaconda / rc.sysinit compatibility
# note nodmraid really means nobiosraid, so we don't want MDIMSM then either
if ! getargbool 1 rd.md.imsm -n rd_NO_MDIMSM || getarg noiswmd || getarg nodmraid; then
if ! getargbool 1 rd.md.imsm -d -n rd_NO_MDIMSM -n noiswmd -n nodmraid; then
info "no MD RAID for imsm/isw raids"
udevproperty rd_NO_MDIMSM=1
fi
# same thing with ddf containers
if ! getargbool 1 rd.md.ddf -n rd_NO_MDDDF || getarg noddfmd || getarg nodmraid; then
if ! getargbool 1 rd.md.ddf -n rd_NO_MDDDF -n noddfmd -n nodmraid; then
info "no MD RAID for SNIA ddf raids"
udevproperty rd_NO_MDDDF=1
fi

View File

@@ -11,7 +11,7 @@ check() {
local _dev
_dev=$(get_maj_min $1)
[ -e /sys/dev/block/$_dev/dm/uuid ] || return 1
[[ $(cat /sys/dev/block/$_dev/dm/uuid) =~ ^mpath- ]] && return 0
[[ $(cat /sys/dev/block/$_dev/dm/uuid) =~ mpath- ]] && return 0
return 1
}
@@ -24,6 +24,7 @@ check() {
depends() {
echo rootfs-block
echo dm
return 0
}
@@ -70,21 +71,23 @@ installkernel() {
install() {
local _f
dracut_install -o \
/sbin/dmsetup \
/sbin/kpartx \
/sbin/mpath_wait \
/sbin/multipath \
/sbin/multipathd \
/sbin/xdrgetuid \
/sbin/xdrgetprio \
dmsetup \
kpartx \
mpath_wait \
multipath \
multipathd \
xdrgetuid \
xdrgetprio \
/etc/xdrdevices.conf \
/etc/multipath.conf \
/etc/multipath/*
inst $(command -v partx) /sbin/partx
inst_libdir_file "libmultipath*" "multipath/*"
inst_hook pre-trigger 02 "$moddir/multipathd.sh"
inst_hook cleanup 02 "$moddir/multipathd-stop.sh"
inst_rules 40-multipath.rules
inst_rules 40-multipath.rules 62-multipath.rules 65-multipath.rules 66-kpartx.rules
}

View File

@@ -3,10 +3,21 @@
# ex: ts=8 sw=4 sts=4 et filetype=sh
check() {
vm=$(systemd-detect-virt --vm &>/dev/null)
(($? != 0)) && return 255
[[ $vm = "qemu" ]] && return 0
[[ $vm = "kvm" ]] && return 0
if type -P systemd-detect-virt &>/dev/null; then
vm=$(systemd-detect-virt --vm &>/dev/null)
(($? != 0)) && return 255
[[ $vm = "qemu" ]] && return 0
[[ $vm = "kvm" ]] && return 0
[[ $vm = "bochs" ]] && return 0
fi
for i in /sys/class/dmi/id/*_vendor; do
[[ -f $i ]] || continue
read vendor < $i
[[ "$vendor" == "QEMU" ]] && return 0
[[ "$vendor" == "Bochs" ]] && return 0
done
return 255
}

View File

@@ -3,10 +3,20 @@
# ex: ts=8 sw=4 sts=4 et filetype=sh
check() {
vm=$(systemd-detect-virt --vm &>/dev/null)
(($? != 0)) && return 255
[[ $vm = "qemu" ]] && return 0
[[ $vm = "kvm" ]] && return 0
if type -P systemd-detect-virt &>/dev/null; then
vm=$(systemd-detect-virt --vm &>/dev/null)
(($? != 0)) && return 255
[[ $vm = "qemu" ]] && return 0
[[ $vm = "kvm" ]] && return 0
[[ $vm = "bochs" ]] && return 0
fi
for i in /sys/class/dmi/id/*_vendor; do
[[ -f $i ]] || continue
read vendor < $i
[[ "$vendor" == "QEMU" ]] && return 0
[[ "$vendor" == "Bochs" ]] && return 0
done
return 255
}

View File

@@ -0,0 +1,45 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=4 sw=4 sts=0 et filetype=sh
command -v ask_for_password >/dev/null || . /lib/dracut-crypt-lib.sh
# loop_decrypt mnt_point keypath keydev device
#
# Decrypts symmetrically encrypted key to standard output.
#
# mnt_point - mount point where <keydev> is already mounted
# keypath - LUKS encrypted loop file path relative to <mnt_point>
# keydev - device on which key resides; only to display in prompt
# device - device to be opened by cryptsetup; only to display in prompt
loop_decrypt() {
local mntp="$1"
local keypath="$2"
local keydev="$3"
local device="$4"
local key="/dev/mapper/${mntp##*/}"
if [ ! -b $key ]; then
info "Keyfile has .img suffix, treating it as LUKS-encrypted loop keyfile container to unlock $device"
local loopdev=$(losetup -f "${mntp}/${keypath}" --show)
local opts="-d - luksOpen $loopdev ${key##*/}"
ask_for_password \
--cmd "cryptsetup $opts" \
--prompt "Password ($keypath on $keydev for $device)" \
--tty-echo-off
[ -b $key ] || die "Tried setting it up, but keyfile block device was still not found!"
initqueue --onetime --finished --unique --name "crypt-loop-cleanup-10-${key##*/}" \
$(command -v cryptsetup) "luksClose $key"
initqueue --onetime --finished --unique --name "crypt-loop-cleanup-20-${loopdev##*/}" \
$(command -v losetup) "-d $loopdev"
else
info "Existing keyfile found, re-using it for $device"
fi
cat $key
}

View File

@@ -0,0 +1,14 @@
check() {
type -P losetup >/dev/null || return 1
return 255
}
depends() {
echo crypt
}
install() {
dracut_install losetup
inst "$moddir/crypt-loop-lib.sh" "/lib/dracut-crypt-loop-lib.sh"
}

36
modules.d/95cifs/cifs-lib.sh Executable file
View File

@@ -0,0 +1,36 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
# cifs_to_var CIFSROOT
# use CIFSROOT to set $server, $path, and $options.
# CIFSROOT is something like: cifs://[<username>[:<password>]]@<host>/<path>
# NETIF is used to get information from DHCP options, if needed.
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
cifs_to_var() {
local cifsuser; local cifspass
# Check required arguments
server=${1##cifs://}
cifsuser=${server%@*}
cifspass=${cifsuser#*:}
if [ "$cifspass" != "$cifsuser" ]; then
cifsuser=${cifsuser%:*}
else
cifspass=$(getarg cifspass)
fi
if [ "$cifsuser" != "$server" ]; then
server="${server#*@}"
else
cifsuser=$(getarg cifsuser)
fi
path=${server#*/}
server=${server%/*}
if [ ! "$cifsuser" -o ! "$cifspass" ]; then
die "For CIFS support you need to specify a cifsuser and cifspass either in the cifsuser and cifspass commandline parameters or in the root= CIFS URL."
fi
options="user=$cifsuser,pass=$cifspass"
}

26
modules.d/95cifs/cifsroot.sh Executable file
View File

@@ -0,0 +1,26 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
. /lib/cifs-lib.sh
[ "$#" = 3 ] || exit 1
# root is in the form root=cifs://user:pass@[server]/[folder] either from
# cmdline or dhcp root-path
netif="$1"
root="$2"
NEWROOT="$3"
cifs_to_var $root
echo server: $server
echo path: $path
echo options: $options
mount.cifs //$server/$path $NEWROOT -o $options && { [ -e /dev/root ] || >/dev/root ; }
# inject new exit_if_exists
echo 'settle_exit_if_exists="--exit-if-exists=/dev/root"; rm "$job"' > $hookdir/initqueue/cifs.sh
# force udevsettle to break
> $hookdir/initqueue/work

View File

@@ -0,0 +1,46 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
check() {
# If our prerequisites are not met, fail anyways.
type -P mount.cifs >/dev/null || return 1
[[ $hostonly ]] || [[ $mount_needs ]] && {
for fs in ${host_fs_types[@]}; do
strstr "$fs" "\|cifs" && return 0
done
return 255
}
return 0
}
depends() {
# We depend on network modules being loaded
echo network
}
installkernel() {
instmods cifs ipv6
}
install() {
local _i
local _nsslibs
dracut_install -o mount.cifs
dracut_install /etc/services /etc/nsswitch.conf /etc/protocols
inst_libdir_file 'libcap-ng.so*'
_nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \
| tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|')
_nsslibs=${_nsslibs#|}
_nsslibs=${_nsslibs%|}
inst_libdir_file -n "$_nsslibs" 'libnss*.so*'
inst_hook cmdline 90 "$moddir/parse-cifsroot.sh"
inst "$moddir/cifsroot.sh" "/sbin/cifsroot"
inst "$moddir/cifs-lib.sh" "/lib/cifs-lib.sh"
}

View File

@@ -0,0 +1,52 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
#
# root=cifs://[user:pass@]<server>/<folder>
#
# This syntax can come from DHCP root-path as well.
#
# If a username or password are not specified as part of the root, then they
# will be pulled from cifsuser and cifspass on the kernel command line,
# respectively.
#
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
. /lib/cifs-lib.sh
#Don't continue if root is ok
[ -n "$rootok" ] && return
# This script is sourced, so root should be set. But let's be paranoid
[ -z "$root" ] && root=$(getarg root=)
[ -z "$netroot" ] && netroot=$(getarg netroot=)
# Root takes precedence over netroot
if [ "${root%%:*}" = "cifs" ] ; then
# Don't continue if root is ok
[ -n "$rootok" ] && return
if [ -n "$netroot" ] ; then
warn "root takes precedence over netroot. Ignoring netroot"
fi
netroot=$root
unset root
fi
# If it's not cifs we don't continue
[ "${netroot%%:*}" = "cifs" ] || return
# Check required arguments
cifs_to_var $netroot
# If we don't have a server, we need dhcp
if [ -z "$server" ] ; then
DHCPORSERVER="1"
fi;
# Done, all good!
rootok=1
echo '[ -e $NEWROOT/proc ]' > $hookdir/initqueue/finished/cifsroot.sh

View File

@@ -1,7 +1,7 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
for dasd_arg in $(getargs rd.dasd= rd_DASD= DASD=); do
for dasd_arg in $(getargs rd.dasd= -d rd_DASD= DASD=); do
(
IFS=","
set $dasd_arg

View File

@@ -3,7 +3,7 @@
# ex: ts=8 sw=4 sts=4 et filetype=sh
mod_args=""
for dasd_arg in $(getargs rd.dasd= rd_DASD= DASD=); do
for dasd_arg in $(getargs rd.dasd= -d rd_DASD= DASD=); do
mod_args="$mod_args,$dasd_arg"
done

View File

@@ -11,6 +11,7 @@ fstab_mount() {
info "Mounting from $1"
while read _dev _mp _fs _opts _dump _pass _rest; do
[ -z "${_dev%%#*}" ] && continue # Skip comment lines
ismounted $_mp && continue # Skip mounted filesystem
if [ "$_pass" -gt 0 ] && ! strstr "$_opts" _netdev; then
fsck_single "$_dev" "$_fs" "$_opts"
fi

View File

@@ -27,8 +27,6 @@ PATH=/usr/sbin:/usr/bin:/sbin:/bin
netif="$1"
iroot="$2"
source_all /etc/conf.d
# If it's not iscsi we don't continue
[ "${iroot%%:*}" = "iscsi" ] || exit 1
@@ -40,14 +38,14 @@ modprobe crc32c 2>/dev/null
[ -e /sys/module/bnx2i ] && iscsiuio
if getargbool 0 rd.iscsi.firmware -y iscsi_firmware ; then
if getargbool 0 rd.iscsi.firmware -d -y iscsi_firmware ; then
if [ -z "$root" -o -n "${root%%block:*}" ]; then
# if root is not specified try to mount the whole iSCSI LUN
printf 'ENV{DEVTYPE}!="partition", SYMLINK=="disk/by-path/*-iscsi-*-*", SYMLINK+="root"\n' >> /etc/udev/rules.d/99-iscsi-root.rules
udevadm control --reload
fi
for p in $(getargs rd.iscsi.param iscsi_param); do
for p in $(getargs rd.iscsi.param -d iscsi_param); do
iscsi_param="$iscsi_param --param $p"
done
@@ -66,25 +64,25 @@ handle_netroot()
local p
# override conf settings by command line options
arg=$(getargs rd.iscsi.initiator iscsi_initiator=)
arg=$(getargs rd.iscsi.initiator -d iscsi_initiator=)
[ -n "$arg" ] && iscsi_initiator=$arg
arg=$(getargs rd.iscsi.target.name iscsi_target_name=)
arg=$(getargs rd.iscsi.target.name -d iscsi_target_name=)
[ -n "$arg" ] && iscsi_target_name=$arg
arg=$(getargs rd.iscsi.target.ip iscsi_target_ip)
arg=$(getargs rd.iscsi.target.ip -d iscsi_target_ip)
[ -n "$arg" ] && iscsi_target_ip=$arg
arg=$(getargs rd.iscsi.target.port iscsi_target_port=)
arg=$(getargs rd.iscsi.target.port -d iscsi_target_port=)
[ -n "$arg" ] && iscsi_target_port=$arg
arg=$(getargs rd.iscsi.target.group iscsi_target_group=)
arg=$(getargs rd.iscsi.target.group -d iscsi_target_group=)
[ -n "$arg" ] && iscsi_target_group=$arg
arg=$(getargs rd.iscsi.username iscsi_username=)
arg=$(getargs rd.iscsi.username -d iscsi_username=)
[ -n "$arg" ] && iscsi_username=$arg
arg=$(getargs rd.iscsi.password iscsi_password)
arg=$(getargs rd.iscsi.password -d iscsi_password)
[ -n "$arg" ] && iscsi_password=$arg
arg=$(getargs rd.iscsi.in.username iscsi_in_username=)
arg=$(getargs rd.iscsi.in.username -d iscsi_in_username=)
[ -n "$arg" ] && iscsi_in_username=$arg
arg=$(getargs rd.iscsi.in.password iscsi_in_password=)
arg=$(getargs rd.iscsi.in.password -d iscsi_in_password=)
[ -n "$arg" ] && iscsi_in_password=$arg
for p in $(getargs rd.iscsi.param iscsi_param); do
for p in $(getargs rd.iscsi.param -d iscsi_param); do
iscsi_param="$iscsi_param --param $p"
done
@@ -130,7 +128,7 @@ handle_netroot()
fi
echo "InitiatorName='$iscsi_initiator'" > /run/initiatorname.iscsi
ln -s /run/initiatorname.iscsi /dev/.initiatorname.iscsi
ln -fs /run/initiatorname.iscsi /dev/.initiatorname.iscsi
# FIXME $iscsi_protocol??

View File

@@ -71,6 +71,8 @@ install() {
# rpc user needs to be able to write to this directory to save the warmstart
# file
chmod 770 "$initdir/var/lib/rpcbind"
chown rpc.rpc "$initdir/var/lib/rpcbind"
egrep -q '^rpc:' /etc/passwd \
&& egrep -q '^rpc:' /etc/group \
&& chown rpc.rpc "$initdir/var/lib/rpcbind"
}

View File

@@ -72,7 +72,7 @@ esac
# Check required arguments
if nfsdomain=$(getarg rd.nfs.domain rd_NFS_DOMAIN); then
if nfsdomain=$(getarg rd.nfs.domain -d rd_NFS_DOMAIN); then
if [ -f /etc/idmapd.conf ]; then
sed -i -e \
"s/^[[:space:]#]*Domain[[:space:]]*=.*/Domain = $nfsdomain/g" \

View File

@@ -21,14 +21,14 @@ if [ -n "$resume" ]; then
{
if [ -x /usr/sbin/resume ]; then
printf "KERNEL==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/sbin/initqueue /usr/sbin/resume %s '%s'\"\n" \
printf "KERNEL==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/sbin/initqueue --finished --unique --name 00resume /usr/sbin/resume %s \'%s\'\"\n" \
${resume#/dev/} "$a_splash" "$resume";
printf "SYMLINK==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/sbin/initqueue /usr/sbin/resume %s '%s'\"\n" \
printf "SYMLINK==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/sbin/initqueue --finished --unique --name 00resume /usr/sbin/resume %s \'%s\'\"\n" \
${resume#/dev/} "$a_splash" "$resume";
fi
printf "KERNEL==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/sbin/initqueue /bin/sh -c 'echo %%M:%%m > /sys/power/resume'\"\n" \
printf "KERNEL==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/sbin/initqueue --finished --unique --name 00resume echo %%M:%%m > /sys/power/resume\"\n" \
${resume#/dev/};
printf "SYMLINK==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/sbin/initqueue /bin/sh -c 'echo %%M:%%m > /sys/power/resume'\"\n" \
printf "SYMLINK==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/sbin/initqueue --finished --unique --name 00resume echo %%M:%%m > /sys/power/resume\"\n" \
${resume#/dev/};
} >> /etc/udev/rules.d/99-resume.rules
@@ -43,9 +43,9 @@ if [ -n "$resume" ]; then
elif ! getarg noresume; then
{
if [ -x /usr/sbin/resume ]; then
printf "SUBSYSTEM==\"block\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/sbin/initqueue /usr/sbin/resume %s '\$tempnode'\"\n" "$a_splash"
printf "SUBSYSTEM==\"block\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/sbin/initqueue --finished --unique --name 00resume /usr/sbin/resume %s \$tempnode\"\n" "$a_splash"
fi
echo "SUBSYSTEM==\"block\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\"," \
" RUN+=\"/sbin/initqueue /bin/sh -c 'echo %M:%m > /sys/power/resume'\"";
" RUN+=\"/sbin/initqueue --finished --unique --name 00resume echo %M:%m > /sys/power/resume\"";
} >> /etc/udev/rules.d/99-resume.rules
fi

View File

@@ -2,6 +2,30 @@
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
check() {
rootopts="defaults"
while read dev mp fs opts dump fsck; do
# skip comments
[ "${dev%%#*}" != "$dev" ] && continue
if [ "$mp" = "/" ]; then
# sanity - determine/fix fstype
rootfs=$(find_mp_fstype /)
rootfs=${rootfs:-$fs}
rootopts=$opts
break
fi
done < "$NEWROOT/etc/fstab"
[ "$rootfs" = "reiserfs" ] && journaldev=$(fs_get_option $rootopts "jdev")
[ "$rootfs" = "xfs" ] && journaldev=$(fs_get_option $rootopts "logdev")
if [ -n "$journaldev" ]; then
echo "root.journaldev=$journaldev" >> "${initdir}/etc/cmdline.d/95root-jurnaldev.conf"
fi
return 0
}
depends() {
echo fs-lib
}

View File

@@ -5,32 +5,30 @@
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
type det_fs >/dev/null 2>&1 || . /lib/fs-lib.sh
filter_rootopts() {
rootopts=$1
# strip ro and rw options
local OLDIFS="$IFS"
IFS=,
set -- $rootopts
IFS="$OLDIFS"
local v
while [ $# -gt 0 ]; do
case $1 in
defaults);;
*)
v="$v,${1}";;
esac
shift
done
rootopts=${v#,}
echo $rootopts
}
mount_root() {
local _ret
local _rflags_ro
# sanity - determine/fix fstype
rootfs=$(det_fs "${root#block:}" "$fstype")
while ! mount -t ${rootfs} -o "$rflags",ro "${root#block:}" "$NEWROOT"; do
warn "Failed to mount -t ${rootfs} -o $rflags,ro ${root#block:} $NEWROOT"
journaldev=$(getarg "root.journaldev=")
if [ -n "$journaldev" ]; then
case "$rootfs" in
xfs)
rflags="${rflags:+${rflags},}logdev=$journaldev"
;;
reiserfs)
fsckoptions="-j $journaldev $fsckoptions"
rflags="${rflags:+${rflags},}jdev=$journaldev"
;;
*);;
esac
fi
_rflags_ro="$rflags,ro"
while ! mount -t ${rootfs} -o "$_rflags_ro" "${root#block:}" "$NEWROOT"; do
warn "Failed to mount -t ${rootfs} -o $_rflags_ro ${root#block:} $NEWROOT"
fsck_ask_err
done
@@ -52,11 +50,11 @@ mount_root() {
fastboot=yes
fi
if [ -f "$NEWROOT"/fsckoptions ]; then
fsckoptions=$(cat "$NEWROOT"/fsckoptions)
fi
if ! getargbool 0 rd.skipfsck; then
if [ -f "$NEWROOT"/fsckoptions ]; then
fsckoptions=$(cat "$NEWROOT"/fsckoptions)
fi
if [ -f "$NEWROOT"/forcefsck ] || getargbool 0 forcefsck ; then
fsckoptions="-f $fsckoptions"
elif [ -f "$NEWROOT"/.autofsck ]; then
@@ -76,7 +74,7 @@ mount_root() {
fi
rootopts=
if getargbool 1 rd.fstab -n rd_NO_FSTAB \
if getargbool 1 rd.fstab -d -n rd_NO_FSTAB \
&& ! getarg rootflags \
&& [ -f "$NEWROOT/etc/fstab" ] \
&& ! [ -L "$NEWROOT/etc/fstab" ]; then
@@ -96,13 +94,13 @@ mount_root() {
break
fi
done < "$NEWROOT/etc/fstab"
rootopts=$(filter_rootopts $rootopts)
fi
# we want rootflags (rflags) to take precedence so prepend rootopts to
# them; rflags is guaranteed to not be empty
rflags="${rootopts:+${rootopts},}${rflags}"
# them
rflags="${rootopts},${rflags}"
rflags="${rflags#,}"
rflags="${rflags%,}"
# backslashes are treated as escape character in fstab
# esc_root=$(echo ${root#block:} | sed 's,\\,\\\\,g')
@@ -125,13 +123,15 @@ mount_root() {
if ! ismounted "$NEWROOT"; then
info "Mounting ${root#block:} with -o ${rflags}"
mount "$NEWROOT" 2>&1 | vinfo
else
elif ! are_lists_eq , "$rflags" "$_rflags_ro" defaults; then
info "Remounting ${root#block:} with -o ${rflags}"
mount -o remount "$NEWROOT" 2>&1 | vinfo
fi
[ -f "$NEWROOT"/forcefsck ] && rm -f "$NEWROOT"/forcefsck 2>/dev/null
[ -f "$NEWROOT"/.autofsck ] && rm -f "$NEWROOT"/.autofsck 2>/dev/null
if ! getargbool 0 rd.skipfsck; then
[ -f "$NEWROOT"/forcefsck ] && rm -f "$NEWROOT"/forcefsck 2>/dev/null
[ -f "$NEWROOT"/.autofsck ] && rm -f "$NEWROOT"/.autofsck 2>/dev/null
fi
}
if [ -n "$root" -a -z "${root%%block:*}" ]; then

View File

@@ -11,6 +11,6 @@ install() {
if [ -d ${_terminfodir} ]; then
inst_dir "$_terminfodir"
cp --reflink=auto --sparse=auto -prfL -t "${initdir}/${_terminfodir%/*}" "$_terminfodir"
cp --reflink=auto --sparse=auto -prfL -t "${initdir}/${_terminfodir}" "$_terminfodir"/*
fi
}

View File

@@ -1,8 +1,10 @@
SUBSYSTEM!="block", GOTO="ps_end"
ACTION!="add|change", GOTO="ps_end"
# Also don't process disks that are slated to be a multipath device
ENV{DM_MULTIPATH_DEVICE_PATH}=="?*", GOTO="ps_end"
KERNEL=="cciss[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode"
KERNEL=="nbd[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode"
KERNEL=="cciss[0-9]*", IMPORT{builtin}="blkid"
KERNEL=="nbd[0-9]*", IMPORT{builtin}="blkid"
KERNEL!="md[0-9]*|md_d[0-9]*|md/*", KERNEL!="md*", GOTO="md_end"
@@ -19,7 +21,7 @@ ATTR{md/array_state}=="|clear|inactive", GOTO="md_end"
LABEL="md_ignore_state"
IMPORT{program}="/sbin/mdadm --detail --export $tempnode"
IMPORT{program}="/sbin/blkid -o udev -p $tempnode"
IMPORT{builtin}="blkid"
OPTIONS+="link_priority=100"
OPTIONS+="watch"
LABEL="md_end"
@@ -32,7 +34,7 @@ ENV{DM_NAME}!="?*", GOTO="ps_end"
ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="ps_end"
ENV{DM_UUID}=="CRYPT-TEMP-?*", GOTO="ps_end"
ENV{DM_UUID}!="?*", ENV{DM_NAME}=="temporary-cryptsetup-?*", GOTO="ps_end"
IMPORT{program}="/sbin/blkid -o udev -p $tempnode"
IMPORT{builtin}="blkid"
LABEL="ps_end"

View File

@@ -1,5 +1,7 @@
SUBSYSTEM!="block", GOTO="pss_end"
ACTION!="add|change", GOTO="pss_end"
# Also don't process disks that are slated to be a multipath device
ENV{DM_MULTIPATH_DEVICE_PATH}=="?*", GOTO="pss_end"
ACTION=="change", KERNEL=="dm-[0-9]*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="do_pss"
KERNEL=="cciss[0-9]*", GOTO="do_pss"
@@ -10,7 +12,7 @@ GOTO="pss_end"
LABEL="do_pss"
# by-path (parent device path)
ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="", DEVPATH!="*/virtual/*", IMPORT{program}="path_id %p"
ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="", DEVPATH!="*/virtual/*", IMPORT{builtin}="path_id"
ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}"
ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n"

View File

@@ -8,7 +8,7 @@ install() {
# Fixme: would be nice if we didn't have to know which rules to grab....
# ultimately, /lib/initramfs/rules.d or somesuch which includes links/copies
# of the rules we want so that we just copy those in would be best
dracut_install udevadm cat uname basename blkid \
dracut_install udevadm cat uname blkid \
/etc/udev/udev.conf /etc/group
[ -d ${initdir}/lib/systemd ] || mkdir -p ${initdir}/lib/systemd

View File

@@ -73,3 +73,4 @@ mount_root() {
if [ -n "$root" -a -z "${root%%virtfs:*}" ]; then
mount_root
fi
:

View File

@@ -2,9 +2,9 @@
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
getargbool 1 rd.zfcp.conf -n rd_NO_ZFCPCONF || rm /etc/zfcp.conf
getargbool 1 rd.zfcp.conf -d -n rd_NO_ZFCPCONF || rm /etc/zfcp.conf
for zfcp_arg in $(getargs rd.zfcp 'rd_ZFCP='); do
for zfcp_arg in $(getargs rd.zfcp -d 'rd_ZFCP='); do
(
IFS=","
set $zfcp_arg

View File

@@ -2,7 +2,7 @@
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
for ccw_arg in $(getargs rd.ccw 'rd_CCW=') $(getargs rd.znet 'rd_ZNET='); do
for ccw_arg in $(getargs rd.ccw -d 'rd_CCW=') $(getargs rd.znet -d 'rd_ZNET='); do
echo $ccw_arg >> /etc/ccw.conf
done

View File

@@ -11,9 +11,9 @@
# Don't auto detect syslog but set it
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
syslogserver=$(getarg syslog.server syslog)
syslogfilters=$(getargs syslog.filter filter)
syslogtype=$(getarg syslog.type syslogtype)
syslogserver=$(getarg syslog.server -d syslog)
syslogfilters=$(getargs syslog.filter -d filter)
syslogtype=$(getarg syslog.type -d syslogtype)
[ -n "$syslogserver" ] && echo $syslogserver > /tmp/syslog.server
[ -n "$syslogfilters" ] && echo "$syslogfilters" > /tmp/syslog.filters

View File

@@ -9,6 +9,7 @@
[Unit]
Description=Dracut cmdline hook
Documentation=man:dracut-cmdline.service(8)
DefaultDependencies=no
Before=dracut-pre-udev.service
After=systemd-journald.socket

View File

@@ -0,0 +1,26 @@
DRACUT-CMDLINE.SERVICE(8)
=========================
:doctype: manpage
:man source: dracut
:man manual: dracut
NAME
----
dracut-cmdline.service - runs the dracut hooks to parse the kernel command line
SYNOPSIS
--------
dracut-cmdline.service
DESCRIPTION
-----------
This service runs all the dracut hooks to parse the kernel command line in
the initramfs.
AUTHORS
-------
Harald Hoyer
SEE ALSO
--------
*dracut*(8)

View File

@@ -2,7 +2,8 @@
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
NEWROOT="/sysroot"
export DRACUT_SYSTEMD=1
export NEWROOT="/sysroot"
[ -d $NEWROOT ] || mkdir -p -m 0755 $NEWROOT
[ -d /run/initramfs ] || mkdir -p -m 0755 /run/initramfs
[ -d /run/lock ] || mkdir -p -m 0755 /run/lock
@@ -12,10 +13,13 @@ if [ -f /dracut-state.sh ]; then
fi
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
[ -f /etc/initrd-release ] && . /etc/initrd-release
[ -n "$VERSION" ] && info "dracut-$VERSION"
source_conf /etc/conf.d
# run scriptlets to parse the command line
getarg 'rd.break=cmdline' 'rdbreak=cmdline' && emergency_shell -n cmdline "Break before cmdline"
getarg 'rd.break=cmdline' -d 'rdbreak=cmdline' && emergency_shell -n cmdline "Break before cmdline"
source_hook cmdline
[ -z "$root" ] && die "No or empty root= argument"

View File

@@ -9,6 +9,7 @@
[Unit]
Description=Dracut initqueue hook
Documentation=man:dracut-initqueue.service(8)
DefaultDependencies=no
After=systemd-udev-trigger.service
Wants=systemd-udev-trigger.service

View File

@@ -0,0 +1,25 @@
DRACUT-INITQUEUE.SERVICE(8)
===========================
:doctype: manpage
:man source: dracut
:man manual: dracut
NAME
----
dracut-initqueue.service - runs the dracut main loop to find the real root
SYNOPSIS
--------
dracut-initqueue.service
DESCRIPTION
-----------
This service runs all the main loop of dracut in the initramfs to find the real root.
AUTHORS
-------
Harald Hoyer
SEE ALSO
--------
*dracut*(8)

View File

@@ -2,6 +2,7 @@
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
export DRACUT_SYSTEMD=1
if [ -f /dracut-state.sh ]; then
. /dracut-state.sh 2>/dev/null
fi
@@ -9,10 +10,10 @@ type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
source_conf /etc/conf.d
getarg 'rd.break=initqueue' 'rdbreak=initqueue' && emergency_shell -n initqueue "Break before initqueue"
getarg 'rd.break=initqueue' -d 'rdbreak=initqueue' && emergency_shell -n initqueue "Break before initqueue"
RDRETRY=$(getarg rd.retry 'rd_retry=')
RDRETRY=${RDRETRY:-20}
RDRETRY=$(getarg rd.retry -d 'rd_retry=')
RDRETRY=${RDRETRY:-30}
RDRETRY=$(($RDRETRY*2))
export RDRETRY
@@ -51,7 +52,7 @@ while :; do
sleep 0.5
if [ $main_loop -gt $(($RDRETRY/2)) ]; then
if [ $main_loop -gt $((2*$RDRETRY/3)) ]; then
for job in $hookdir/initqueue/timeout/*.sh; do
[ -e "$job" ] || break
job=$job . $job
@@ -71,11 +72,11 @@ unset RDRETRY
# pre-mount happens before we try to mount the root filesystem,
# and happens once.
getarg 'rd.break=pre-mount' 'rdbreak=pre-mount' && emergency_shell -n pre-mount "Break pre-mount"
getarg 'rd.break=pre-mount' -d 'rdbreak=pre-mount' && emergency_shell -n pre-mount "Break pre-mount"
source_hook pre-mount
getarg 'rd.break=mount' 'rdbreak=mount' && emergency_shell -n mount "Break mount"
getarg 'rd.break=mount' -d 'rdbreak=mount' && emergency_shell -n mount "Break mount"
# mount scripts actually try to mount the root filesystem, and may
# be sourced any number of times. As soon as one suceeds, no more are sourced.
i=0

View File

@@ -9,6 +9,7 @@
[Unit]
Description=Dracut pre-pivot and cleanup hook
Documentation=man:dracut-pre-pivot.service(8)
DefaultDependencies=no
After=dracut-initqueue.service
ConditionPathExists=/etc/initrd-release

View File

@@ -0,0 +1,25 @@
DRACUT-PRE-PIVOT.SERVICE(8)
===========================
:doctype: manpage
:man source: dracut
:man manual: dracut
NAME
----
dracut-pre-pivot.service - runs the dracut hooks before switching root
SYNOPSIS
--------
dracut-pre-pivot.service
DESCRIPTION
-----------
This service runs all dracut hooks before the system switched to the real root.
AUTHORS
-------
Harald Hoyer
SEE ALSO
--------
*dracut*(8)

View File

@@ -2,6 +2,7 @@
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
export DRACUT_SYSTEMD=1
if [ -f /dracut-state.sh ]; then
. /dracut-state.sh 2>/dev/null
fi
@@ -37,6 +38,6 @@ echo "NEWROOT=\"$NEWROOT\"" >> /run/initramfs/switch-root.conf
# remove helper symlink
[ -h /dev/root ] && rm -f /dev/root
getarg rd.break rdbreak && emergency_shell -n switch_root "Break before switch_root"
getarg rd.break -d rdbreak && emergency_shell -n switch_root "Break before switch_root"
exit 0

View File

@@ -9,6 +9,7 @@
[Unit]
Description=Dracut pre-trigger hook
Documentation=man:dracut-pre-trigger.service(8)
DefaultDependencies=no
Before=systemd-udev-trigger.service dracut-initqueue.service
After=dracut-pre-udev.service systemd-udevd.service

View File

@@ -0,0 +1,25 @@
DRACUT-PRE-TRIGGER.SERVICE(8)
=============================
:doctype: manpage
:man source: dracut
:man manual: dracut
NAME
----
dracut-pre-trigger.service - runs the dracut hooks before udevd is triggered
SYNOPSIS
--------
dracut-pre-trigger.service
DESCRIPTION
-----------
This service runs all dracut hooks before udevd is triggered in the initramfs.
AUTHORS
-------
Harald Hoyer
SEE ALSO
--------
*dracut*(8)

View File

@@ -2,6 +2,7 @@
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
export DRACUT_SYSTEMD=1
if [ -f /dracut-state.sh ]; then
. /dracut-state.sh 2>/dev/null
fi
@@ -9,8 +10,8 @@ type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
source_conf /etc/conf.d
getargbool 0 rd.udev.info -y rdudevinfo && udevadm control --log-priority=info
getargbool 0 rd.udev.debug -y rdudevdebug && udevadm control --log-priority=debug
getargbool 0 rd.udev.info -n -y rdudevinfo && udevadm control --log-priority=info
getargbool 0 rd.udev.debug -n -y rdudevdebug && udevadm control --log-priority=debug
udevproperty "hookdir=$hookdir"
source_hook pre-trigger

View File

@@ -9,6 +9,7 @@
[Unit]
Description=Dracut pre-udev hook
Documentation=man:dracut-pre-udev.service(8)
DefaultDependencies=no
Before=systemd-udevd.service dracut-pre-trigger.service
After=dracut-cmdline.service

View File

@@ -0,0 +1,25 @@
DRACUT-PRE-UDEV.SERVICE(8)
==========================
:doctype: manpage
:man source: dracut
:man manual: dracut
NAME
----
dracut-pre-udev.service - runs the dracut hooks before udevd is started
SYNOPSIS
--------
dracut-pre-udev.service
DESCRIPTION
-----------
This service runs all dracut hooks before udevd is started in the initramfs.
AUTHORS
-------
Harald Hoyer
SEE ALSO
--------
*dracut*(8)

View File

@@ -1,7 +1,7 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
export DRACUT_SYSTEMD=1
if [ -f /dracut-state.sh ]; then
. /dracut-state.sh 2>/dev/null
fi

View File

@@ -7,6 +7,7 @@
[Unit]
Description=Switch Root
Documentation=man:initrd-switch-root.service(8)
DefaultDependencies=no
ConditionPathExists=/etc/initrd-release
OnFailure=emergency.service

View File

@@ -0,0 +1,25 @@
INITRD-SWITCH-ROOT.SERVICE(8)
=============================
:doctype: manpage
:man source: dracut
:man manual: dracut
NAME
----
initrd-switch-root.service - switches root to the real root
SYNOPSIS
--------
initrd-switch-root.service
DESCRIPTION
-----------
This service triggers systemd to switch root from the initramfs to the real root.
AUTHORS
-------
Harald Hoyer
SEE ALSO
--------
*dracut*(8)

View File

@@ -141,5 +141,6 @@ install() {
ln -fs ../udevadm-cleanup-db.service "${initdir}${dracutsystemunitdir}/initrd-switch-root.target.requires/udevadm-cleanup-db.service"
inst_script "$moddir/service-to-run.sh" "${systemdutildir}/system-generators/service-to-run"
inst_rules 99-systemd.rules
}

View File

@@ -7,6 +7,7 @@
[Unit]
Description=Cleanup udevd DB
Documentation=man:udevadm-cleanup-db.service(8)
DefaultDependencies=no
ConditionPathExists=/etc/initrd-release
Conflicts=systemd-udevd.service systemd-udevd-control.socket systemd-udevd-kernel.socket

View File

@@ -0,0 +1,25 @@
UDEVADM-CLEANUP-DB.SERVICE(8)
=============================
:doctype: manpage
:man source: dracut
:man manual: dracut
NAME
----
udevadm-cleanup-db.service - clean up the udev database
SYNOPSIS
--------
udevadm-cleanup-db.service
DESCRIPTION
-----------
Cleans up the udev database for later import in the real root by calling "udevadm info --cleanup-db".
AUTHORS
-------
Harald Hoyer
SEE ALSO
--------
*dracut*(8)

Some files were not shown because too many files have changed in this diff Show More