Compare commits

...

280 Commits
002 ... 005

Author SHA1 Message Date
Harald Hoyer
e876763655 updated NEWS, moved tag 005 2010-03-19 17:35:47 +01:00
Harald Hoyer
ab56546dc7 version 005 2010-03-19 16:51:05 +01:00
Harald Hoyer
3592d8683b dracut.spec: rpmlint cosmetics 2010-03-19 16:51:05 +01:00
Harald Hoyer
c55b20803a dracut.spec: change description and summaries 2010-03-19 16:51:05 +01:00
Harald Hoyer
7095aab4a2 dracut.spec: remove libselinux, libsepol requirement 2010-03-19 16:51:05 +01:00
Harald Hoyer
8ef5ade737 dracut.spec: remove dracut-kernel subpackage 2010-03-19 16:51:05 +01:00
Harald Hoyer
b3561ee15f lvm/lvm_scan.sh: silence lvm version check 2010-03-19 16:51:05 +01:00
Harald Hoyer
16b046d5da fcoe: soft install fcoe bins 2010-03-19 16:51:04 +01:00
Hans de Goede
37b14e7295 Add dcb support to dracut's FCoE support (rh563794)
Note that there are still some patches queued upstream for fcoe-utils to
enable it to work with the new lldpad and to add support to fipvlan to
bring up FCoE connections without requiring fcoemon to run.

The invocations of the various tools as in this patch should be final though,
see the discussion in:
http://bugzilla.redhat.com/show_bug.cgi?id=563794

This is the second revision of this patch, which no longer adds /etc/fcoe
to the initrd as that is not needed.
2010-03-19 15:03:21 +01:00
Mike Snitzer
f6458b80ef lvm_scan: use '--ignoremonitoring' rather than '--monitor n'
lvchange and vgchange '--monitor n' will not prevent lvm from
attempting to dlopen the libdevmapper-event library.

dracut git commit 47ab3b6c5e introduced the use of '--monitor n' but
'--ignoremonitoring' is needed now that the libdevmapper-event library
isn't copied into the initramfs (ever since 0fae59d6eb)

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2010-03-17 11:59:38 +01:00
Harald Hoyer
3b0f71921d kernel-modules/installkernel: force install some modules even in
hostonly mode
2010-03-17 11:50:18 +01:00
Luca Berra
df54ef1390 silence xen-detect detection
Signed-off-by: Luca Berra <bluca@comedia.it>
2010-03-17 11:50:18 +01:00
Philippe Seewer
16add2aac7 debian: add dracut-gencmdline 2010-03-05 15:01:18 +01:00
Philippe Seewer
501cc2458c debian: Add manpage for dracut-catimages 2010-03-05 14:58:59 +01:00
Philippe Seewer
ee7eb10523 debian: add dracut.conf.d 2010-03-05 14:55:37 +01:00
Philippe Seewer
232c082cbc debian: Add xen and uswsusp modules 2010-03-05 11:57:14 +01:00
Philippe Seewer
58659bf221 xen: try harder to locate xen-detect
On debian systems xen-detect does not resite somewhere in $PATH,
but under /usr/lib/xen-default/bin. This patch ensures that this
is searched as well when locating and installing xen-detect.
2010-03-05 11:51:56 +01:00
Philippe Seewer
8a08012764 test: use ldconfig processing for roots as well 2010-03-05 11:42:04 +01:00
Harald Hoyer
fdc421dbac dracut: move ldconfig after include 2010-03-05 11:14:28 +01:00
Harald Hoyer
70aaa95d52 dracut: do a full ldconfig in the initramfs 2010-03-05 11:07:10 +01:00
Harald Hoyer
80a6943fc4 ifcfg: set mode 0755 for scripts 2010-03-04 18:03:36 +01:00
Harald Hoyer
72011255e0 rpmversion/install: add shebang 2010-03-04 18:02:27 +01:00
Harald Hoyer
de50046cd7 dmsquash-live-root: use blockdev with --getsz
Thanks Karel for pointing this out.. again :)
2010-03-04 16:49:51 +01:00
Harald Hoyer
e606012ce6 udev-rules: hotplug.functions is not executable, so use -e instead of -x 2010-03-04 14:21:56 +01:00
Andrey Borzenkov
b63fd4d905 Pass init argument(s) to real init
Common wisdom to enter single user on Linux is to edit command
line and add "single". This was not possible because switch_root
was always called with empty init arguments. Collect them from
command line and pass to real init when switching root.

Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
2010-03-04 14:06:48 +01:00
Andrey Borzenkov
01b8cdffca Fix boot with user suspend and no resume= kernel argument
Mandriva bug https://qa.mandriva.com/show_bug.cgi?id=57924. Check
if dracut got resume= argument before calling /usr/sbin/resume
2010-03-04 14:06:48 +01:00
Harald Hoyer
aab70adc0b dmsquash-live: use --getsize64 instead of --getsize 2010-03-04 14:06:48 +01:00
Joey Boggs
7baade2b87 add readonly overlay support for dmsquash
Adds the readonly_overlay karg for cases where the dm snapshot should be set to readonly. Use case would be a livecd that is configured to have a readonly root where filling up the dm snapshot would cause a problem.
2010-03-04 14:06:47 +01:00
Harald Hoyer
b686095f99 udev-rules: choose between several firmware upload tools
debian: firmware.agent hotplug.functions
old fedora: firmware.sh
new udev upstream: firmware
2010-03-04 14:06:47 +01:00
Harald Hoyer
a56e93c10c kernel-modules: add keyboard kernel modules 2010-03-04 14:06:46 +01:00
Philippe Seewer
465f223905 fix permissions: should be +x 2010-03-03 17:29:39 +01:00
Philippe Seewer
3121677949 parse-kernel.sh must have a shebang 2010-03-03 17:29:26 +01:00
Philippe Seewer
a65914b4a2 debian: update Standards-Version 2010-03-03 16:49:10 +01:00
Philippe Seewer
cff621603c debian: dracut package should at least suggest dracut-network 2010-03-03 16:48:43 +01:00
Philippe Seewer
259872feac debian: complete s/dracut-net/dracut-network/g
When changing package names, corresponding files must be renamed
as well.
2010-03-03 16:48:16 +01:00
Peter Jones
43f2533977 Use multipath if it's installed and being used for the root fs.
Don't conditionalize on hostonly; use multipath if it's installed and in
use.
2010-02-25 10:24:14 -05:00
Harald Hoyer
454771cd86 dracut: add check, if we can write to the output image file 2010-02-18 18:27:39 +01:00
Harald Hoyer
0ec519f8a4 mount-root: also filter "defaults" from mount options 2010-02-18 18:05:51 +01:00
Harald Hoyer
d793fc2e8b mount-root: skip comments 2010-02-18 17:46:01 +01:00
Harald Hoyer
26999d6ddb dracut: removed "local" not inside of function 2010-02-18 17:28:41 +01:00
Harald Hoyer
9232cab470 fix IFS restoring 2010-02-18 09:46:19 +01:00
Harald Hoyer
a15935c143 selinux: fix "selinux=0" handling 2010-02-18 08:46:57 +01:00
Harald Hoyer
11ce36d78e mount-root: do not pollute init arguments
and do not remount if no new rootopts set in /etc/fstab
2010-02-17 20:18:10 +01:00
Harald Hoyer
4819ae98ac fix lib64 check
on ppc we can have libc in /lib64/power6/
2010-02-17 17:02:04 +01:00
Harald Hoyer
8c8cd69d32 s390: *_cio_free needs "seq" 2010-02-15 18:08:11 +01:00
Harald Hoyer
7800cc247e fix selinux disabled state
Execute load-policy when the config file contains SELINUX=disabled.
2010-02-15 12:58:00 +01:00
Harald Hoyer
21a74b32b2 nfs4: rpc.idmapd does not accept parameters anymore
modify /etc/idmapd.conf instead
2010-02-15 10:43:51 +01:00
Harald Hoyer
1cf0b1750b removed cdrom hack for live CDs
The hack does not work reliable for CDROMs with the firmware bug.
We have really to fix cdrom_id.
2010-02-15 09:55:20 +01:00
Harald Hoyer
94d2148707 dracut.conf: added add_dracutmodules 2010-02-12 12:19:33 +01:00
Harald Hoyer
2c2c45800c add /etc/dracut.conf.d 2010-02-12 11:12:37 +01:00
Harald Hoyer
edb511860c Fixed: Move multipath scan earlier. It must go before any other dm rules.
Also changed the filename in the install file.
2010-02-12 11:00:21 +01:00
Harald Hoyer
a39ea24f10 nfs: suppress error message about missing passwd 2010-02-10 18:54:31 +01:00
Harald Hoyer
93bc3d440c make nfs4 work 2010-02-10 17:21:46 +01:00
Peter Jones
7e22ab0891 Move multipath scan earlier. It must go before any other dm rules.
multipath scan needs to go before lvm, or else lvm may grab the device
multipath would activate, and multipath will be unable to claim it.
2010-02-05 14:23:20 -05:00
Harald Hoyer
c98bcec89c add preliminary IPv6 support 2010-02-04 16:05:19 +01:00
Harald Hoyer
b456ab777d zfcp: install s390utils script rather than local one 2010-02-04 16:03:35 +01:00
Harald Hoyer
d43036ffeb rootfs-block: strip "ro|rw" options from fstab options
https://bugzilla.redhat.com/show_bug.cgi?id=560424
2010-02-03 17:24:51 +01:00
Harald Hoyer
54aaad9dad test/iSCSI: fixed test script 2010-02-03 16:42:43 +01:00
Harald Hoyer
c88b219410 dasd_mod: changed prio of cmdline hook to be executed after dasd 2010-02-03 10:17:58 +01:00
Harald Hoyer
bab749e23e init: dashified $[] -> $(()) 2010-02-02 15:21:51 +01:00
Harald Hoyer
d54a0e5ae8 beautified man pages 2010-02-02 15:11:59 +01:00
Harald Hoyer
4dc4cc3fc6 fixed permissions for the check files 2010-01-27 16:11:19 +01:00
Peter Jones
3d45f9bba9 Add a check file for multipath.
If multipath isn't installed, don't use it.  If we're in hostonly mode,
only install the multipath module if it's used for / .  Otherwise, if
the user was dumb enough to install it, they get it during bootup.
2010-01-27 16:10:43 +01:00
Harald Hoyer
97c97ff6d5 base: fix selinux handling if .autorelabel is present
rhbz#557744
2010-01-27 16:09:15 +01:00
Harald Hoyer
d8231fa5c2 mdraid: prefer /etc/mdadm.conf over /etc/mdadm/mdadm.conf
see https://bugzilla.redhat.com/show_bug.cgi?id=557339
https://bugzilla.redhat.com/show_bug.cgi?id=559073
2010-01-27 15:59:10 +01:00
Harald Hoyer
5db587d7c1 init: fixed emergency_shell argument parsing 2010-01-20 16:04:55 +01:00
Harald Hoyer
3ee26913e7 version 004 2010-01-15 14:09:06 +01:00
Harald Hoyer
4bb570c9a4 dracut-lib: do not leave debug mode in getarg and getargs 2010-01-15 14:07:54 +01:00
Harald Hoyer
0e8b76a57e test: remove lvm.conf in create-root.sh 2010-01-15 12:58:46 +01:00
Harald Hoyer
2dfdcbf4e7 dracut-lib: read multiple lines from $init/etc/cmdline 2010-01-15 12:33:41 +01:00
Harald Hoyer
1b3bdcc1a6 dracut.spec: only obsolete for rhel >= 6 and fedora > 12
and do not provide lsinitrd and mkinitrd
2010-01-15 10:28:44 +01:00
Warren Togami
dc5bb506ff dracut.spec: nbd is Fedora only 2010-01-14 18:11:52 +01:00
Harald Hoyer
074d12c1fa add lsinitrd 2010-01-14 17:20:43 +01:00
Harald Hoyer
80deff7c4b lvm: remove lvm-cleanup 2010-01-14 17:04:06 +01:00
Harald Hoyer
b7b6c6e1c6 test: remove lvm.conf in create-root.sh 2010-01-14 17:02:18 +01:00
Munehiro Matsuda
651f3f3d1a dmsquash: add support for loopmounted *.iso files
https://bugzilla.redhat.com/show_bug.cgi?id=548283
2010-01-14 16:47:16 +01:00
Harald Hoyer
0bc4ef1caf dracut.spec: update plymouth requirements 2010-01-14 15:54:17 +01:00
Harald Hoyer
dc0a0f6c93 lvm: add rd_LVM_LV and "--poll n" 2010-01-13 17:59:14 +01:00
Harald Hoyer
63d8d27b03 install lsinitrd/mkinitrd 2010-01-13 17:13:20 +01:00
Harald Hoyer
dc40ea7fa1 crypt/dm: move dmeventd to dm module 2010-01-13 16:33:40 +01:00
Mike Snitzer
0fae59d6eb lvm: lvm.conf (locking_type = 4)
- the use of sed is placeholder "hack" until lvm2 provides a proper
  tool for changing lvm.conf
- lvm_scan.sh should run lvm commands with --ignorelockingfailure to
  re-use lvm's existing initrd-specific logic; future lvm2 changes
  will split this flag out into various new command-line switches
- no monitoring should be started from within initramfs
- NOTE: the same should apply to 90dmraid/install
- the correct types would be: '[ "blkext", 1 , "cciss0", 16 ]'
  but lvm2 (>= 2.02.52) already properly supports both 'blkext' and
  'cciss' (including cciss0 -> cciss7)
2010-01-13 16:29:12 +01:00
Andrey Borzenkov
5c7821b6c5 Add user suspend support
This patch adds support for user mode suspend to disk. It is installed
in parallel to kernel mode suspend module; either will fail if
system was not suspended using correct tool so next one can be tried.

Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
2010-01-13 16:08:22 +01:00
Luca Berra
f5745ec58b Ensure UNICODE keyboard layout is functional in emergency shell
/lib/udev/cosole_init will load either non-unicode or unicode versions
of keyboard layout for the same value of KEYMAP depending on language
setting. The simplest solution is to install both versions in initrd;
it does not take much space.

While on it, copy some additional maps to ensure emergency shell
has the same keyboard layout as full system.

Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
Signed-off-by: Luca Berra <bluca@vodka.it>
2010-01-13 16:06:11 +01:00
Luca Berra
b21d5cb2dc add mkinitrd-dracut.sh wrapper
a wrapper around dracut with the syntax from mkinitrd, could
help transition to dracut.
2010-01-13 16:03:32 +01:00
Luca Berra
74c5dd2158 dracut-functions: add additional drivers in host-only mode, too
this makes dracut load kernel module specified in add-drivers even
if building an host-only mkinitrd, it is useful in cases where we
might change some storage drivers and still don't want to build
an enormous initrd (e.g. ahci/ata_piix)
2010-01-13 16:02:10 +01:00
Luca Berra
b5664d5d02 base: improve emergency shell
for some unknown reason the emergency shell
starts with stderr closed, at first I even tought it was not working at
all, then I came up with this hack, which seems to work properly. I also
change the prompt to remind which step are we breaking to.
2010-01-13 16:01:36 +01:00
Luca Berra
506c7f2ab0 install umount for the modules, which use it 2010-01-13 15:57:32 +01:00
Luca Berra
17dcc1a801 base: do not force load policy if selinux is not installed at all 2010-01-13 15:56:34 +01:00
Luca Berra
9b37edbff5 dracut-functions: add support for compressed kernel modules 2010-01-13 15:53:17 +01:00
Luca Berra
e22cdb9ef8 terminfo: search also for /usr/share/terminfo 2010-01-13 15:50:52 +01:00
Luca Berra
636fa8bea8 redhat-i18n: search also in /usr/lib
we have kbd data in /usr/lib, so this patch will
search for /lib/kbd and /usr/lib/kbd and use the existing one
2010-01-13 15:50:02 +01:00
Konrad Rzeszutek Wilk
9799e0ad8e 60xen: add support for loading Xen modules 2010-01-13 15:37:05 +01:00
Harald Hoyer
6ca1d346be kernel: add rdloaddriver kernel command line parameter
rdloaddriver=<drivername>
force loading kernel module <drivername>
2010-01-13 15:34:18 +01:00
Harald Hoyer
e1603bf7e4 s390: add call to *_cio_free and use current s390utils udev rules 2010-01-13 14:26:46 +01:00
Harald Hoyer
5c554bd278 dracut.spec: add Obsoletes of mkinitrd/nash/libbdevid-python 2010-01-13 14:16:49 +01:00
Harald Hoyer
71cfa2e225 dmsquash: add nasty hack for cdroms
Some CDROMs do not generate a label symlink and have to be read from.
2010-01-12 15:08:54 +01:00
Harald Hoyer
bb2200ffca cryptroot-ask.sh: fixed luks handling
see https://bugzilla.redhat.com/show_bug.cgi?id=530898#c16
2010-01-12 14:55:09 +01:00
Harald Hoyer
66e45737e1 add man pages for dracut-catimages and dracut-gencmdline 2010-01-12 14:51:17 +01:00
Harald Hoyer
695de8493d dracut-lib: prevent double log output 2010-01-12 10:37:27 +01:00
Harald Hoyer
c5488692d4 multipath: check for existance before trying to install 2010-01-12 10:31:51 +01:00
Harald Hoyer
0a19e31886 plymouth-pretrigger: force initializing of console (bug #526570) 2009-12-21 15:15:38 +01:00
Harald Hoyer
2c2e3ad860 cryptroot-ask.sh: s/==/=/g (bug #542081) 2009-12-21 15:15:23 +01:00
Harald Hoyer
938dbad1e8 multipath: supress warnings, if multipath not installed on system 2009-11-30 15:24:47 +01:00
Harald Hoyer
ff0bfa28d3 .mailmap: updated 2009-11-27 15:38:37 +01:00
Harald Hoyer
d3e11cf813 AUTHORS: updated 2009-11-27 15:38:21 +01:00
Harald Hoyer
9993392f6d version 003 2009-11-27 15:25:46 +01:00
Harald Hoyer
e891618572 debian: s/dracut-net/dracut-network/g 2009-11-27 15:03:34 +01:00
Philippe Seewer
96f8e314b3 Debian support: Add necessary control files for packaging
This patch adds all necessary files to build dracut debian packages.

- I've split dracut into two parts: The dracut package for booting from block
  devices and dracut-net for netroot.
- I've deliberately left out all redhat specific modules, they do not make any
  sense on debian at all
2009-11-27 15:02:41 +01:00
Philippe Seewer
0edcf5fa8b Debian support: Add dracut-update-initramfs
This script is necessary to integrate dracut into the initramfs-
infrastructure of debian.

The file itself is just a copy from initramfs-tools' update-initramfs,
with a few lines modified to run dracut instead of mkinitramfs.
2009-11-27 15:02:38 +01:00
Harald Hoyer
0cd23d778e Makefile: gitrpm: cleanup on failed rpmbuild 2009-11-27 14:57:37 +01:00
Harald Hoyer
14f6ad921b dracut.spec: removed ubuntu module 2009-11-27 14:57:28 +01:00
Harald Hoyer
8e93970944 fips: do not activate fips module by default 2009-11-27 14:55:02 +01:00
Harald Hoyer
b65f499f60 fips: more shebang 2009-11-27 14:32:28 +01:00
Harald Hoyer
c2bcc5be2f fips: add shebang to fips.sh 2009-11-27 14:31:05 +01:00
Harald Hoyer
ba67b9239b changed hostonly documentation and handling 2009-11-27 14:29:32 +01:00
Harald Hoyer
f4f45af792 dracut.spec: add comment how to get source for a git snapshot 2009-11-27 14:17:53 +01:00
Philippe Seewer
9cce5af5af Remove Ubuntu 8.10 support
This is outdated and no longer needed
2009-11-27 14:07:21 +01:00
Philippe Seewer
2e6b98c7f6 All module scripts should have a shebang 2009-11-27 14:07:21 +01:00
Philippe Seewer
a8dbfbb8ce Fix manpage display errors
Some lines in dracut's manpage are just too long for justified
display on 80c terminals. These small corrections fix this. In addition
man --warnings does not complain anymore about anything at all.
2009-11-27 14:07:21 +01:00
Philippe Seewer
a68c99c94e loginit: Fix shebang 2009-11-27 14:07:21 +01:00
Philippe Seewer
00da3293e2 initqueue: Remove trailing ;
dash -n complains about the trailing ';' and somehow I think this
really isn't needed.
2009-11-27 14:07:21 +01:00
Philippe Seewer
6a0ce0a518 Module scripts should be executable 2009-11-27 14:07:20 +01:00
Philippe Seewer
7ce55fd6b7 syslog-genrules.sh: Shebang should be /bin/sh not /bin/dash 2009-11-27 14:07:20 +01:00
Harald Hoyer
6cc96b358a add dracut.conf man page 2009-11-27 10:53:28 +01:00
Harald Hoyer
4d6660c2ed dracut: fix no_kernel typo 2009-11-27 10:52:55 +01:00
Harald Hoyer
f5b01e3c57 test: set PATH 2009-11-26 19:12:20 +01:00
Harald Hoyer
57c6b805ce rootfs-block/mount-root: remount root with /etc/fstab filesystem options 2009-11-26 19:12:10 +01:00
Harald Hoyer
17ed15182a multipath: corrected initqueue parameter 2009-11-26 11:41:53 +01:00
Harald Hoyer
77eaa2fea1 dm: install dmsetup 2009-11-26 11:02:34 +01:00
Harald Hoyer
3c56f37265 dracut-functions: inst_simple(): do not bail out if target is a dir and exists 2009-11-26 10:56:53 +01:00
Harald Hoyer
4073e3a325 nfs: add rd_NFS_DOMAIN parameter to set the NFSv4 domain name
https://bugzilla.redhat.com/show_bug.cgi?id=537969
2009-11-26 10:38:40 +01:00
Harald Hoyer
48df9fcc11 nfs: install passwd entries for nobody and nfsnobody 2009-11-26 10:38:06 +01:00
Harald Hoyer
bad6113059 lvm/dmraid: make LIBDIR depend on the binary 2009-11-25 20:08:22 +01:00
Yanko Kaneti
9e7ac6982a Wildcards need dracut_install 2009-11-25 19:55:17 +01:00
Harald Hoyer
47ab3b6c5e lvm: scan without monitor
https://bugzilla.redhat.com/show_bug.cgi?id=540289
2009-11-25 19:55:17 +01:00
Peter Jones
c761b26aef Handle modules with hyphens in their names properly.
If a module has a hyphen in its name, it will show up as an underscore
in /proc/modules.  Because of this, when we're testing /proc/modules,
we have to munge our module filename expression to match.
2009-11-25 13:40:22 -05:00
Peter Jones
4ee9ce444b This has to be executable.
multipath-scan.sh has to be executable, of course.
2009-11-25 11:26:38 -05:00
Peter Jones
01ba5f2192 Fix missing shell variables.
Somehow copy+paste from one machine to the other removed all the shell
variables from this line.  Oops.
2009-11-25 11:06:35 -05:00
Peter Jones
b869710aff Bring up multipath devices that are configured in multipath.conf.
This brings up multipath devices which are configured in multipath.conf
as we find them.
2009-11-25 10:54:12 -05:00
Peter Jones
323428ced5 Make sure and get all the multipath related modules.
Install all modules that are any of:
- scsi device handler
- dm log handler
- dm path selector
- dm target

It would be nice if we could tell which log handlers and targets are
multipath related, but we really can't.
2009-11-25 10:54:12 -05:00
Peter Jones
8f99a7f6e3 Add #!/bin/bash for consistency.
Most install scripts seem to have it there, may as well make this one
like the rest...
2009-11-25 10:54:12 -05:00
Peter Jones
aff873923c Use glob for libdir when installing multipath libraries.
Use "/lib*/" not "/lib/" so it works when they're in /lib/multipath as
well as when they're in /lib64/multipath
2009-11-25 10:54:09 -05:00
Harald Hoyer
4d1661d39a specfile update 2009-11-23 15:19:19 +01:00
Harald Hoyer
a34a0df207 90dm: install more device mapper kernel modules 2009-11-23 12:28:58 +01:00
Harald Hoyer
5841610c7f kernel-modules: add firewire-ohci to hardcoded modules list 2009-11-23 12:28:58 +01:00
Harald Hoyer
557ea7a8da fips: search different lib paths 2009-11-23 12:28:57 +01:00
Harald Hoyer
7f1282834f Makefile: add WITH_SWITCH_ROOT 2009-11-23 12:28:53 +01:00
Harald Hoyer
4e0ef1d982 dracut: create initramfs-$(kernelversion).img by default 2009-11-19 15:47:06 +01:00
Harald Hoyer
734a0d9ebc dracut: check more return codes, check for permissions and use derror 2009-11-19 15:46:09 +01:00
Harald Hoyer
4d66861107 dracut.8: fixed formatting for rootfs and mount options 2009-11-18 10:24:08 +01:00
Harald Hoyer
44a6a0d941 specfile update 2009-11-17 15:00:56 +01:00
Harald Hoyer
95940758e9 multipath: install multipath kernel module 2009-11-17 14:58:51 +01:00
Harald Hoyer
bfd98ad44b multipath: install xdr utils 2009-11-17 14:58:42 +01:00
Harald Hoyer
b59d3549fd NEWS update 2009-11-13 10:36:27 +01:00
Harald Hoyer
5f7149068e multipath: install udev rules and helper tools 2009-11-13 10:27:09 +01:00
Harald Hoyer
8ec6bfcbe7 specfile update 2009-11-13 10:26:50 +01:00
Dan Horák
200e59149c move dasd initialization script and rules to s390utils
The primary source for dasd initialization script and udev rules is
now in s390utils package. The s390utils-base subpackage, that carries
the required files, is always installed on s390/s390x, because it's
part of the Core group in comps.

Signed-off-by: Dan Horák <dan@danny.cz>
2009-11-12 15:56:58 +01:00
Harald Hoyer
978d78f7b2 add module 90multipath 2009-11-12 15:12:18 +01:00
Harald Hoyer
03d8ec2601 add module fips 2009-11-12 14:59:28 +01:00
Harald Hoyer
b941e8fb9f renamed module 95ccw to 95znet 2009-11-12 14:59:28 +01:00
Harald Hoyer
394f30d8d4 crypt: ignore devices in /etc/crypttab (root is not in there) 2009-11-12 14:56:36 +01:00
Harald Hoyer
1e0eb68b69 dasd: only install /etc/dasd.conf in hostonly mode 2009-11-12 14:55:30 +01:00
Harald Hoyer
f791957ae3 zfcp: only install /etc/zfcp.conf in hostonly mode 2009-11-12 14:55:04 +01:00
Harald Hoyer
f21b3f874f kernel-modules: add scsi_dh scsi_dh_rdac scsi_dh_emc 2009-11-12 13:50:12 +01:00
Dan Horák
8fa510d483 control filesystems included in the generic initramfs
New "filesystems" command line/config file option is added with the ability to
control the list of kernel filesystem modules that are included in the generic
initramfs.

Signed-off-by: Dan Horák <dan@danny.cz>
2009-11-10 11:16:50 +01:00
Harald Hoyer
ff777576d8 dracut.8: add FILES section 2009-11-10 11:15:22 +01:00
Harald Hoyer
3b6c1c661e dracut.spec: update 2009-11-06 08:51:50 +01:00
Harald Hoyer
8686bd554b 95dasd: fixed rd_DASD argument handling 2009-11-06 08:44:01 +01:00
Harald Hoyer
62cfb5c161 dracut.8: add more documentation to rd_LUKS_UUID 2009-11-05 17:06:27 +01:00
Harald Hoyer
349bac4214 crypt: install /etc/crypttab and honor crypttab entries 2009-11-05 17:06:26 +01:00
Harald Hoyer
c3844cbf4a crypt: refix rd_LUKS_UUID handling
https://bugzilla.redhat.com/show_bug.cgi?id=533177
2009-11-05 17:06:26 +01:00
Harald Hoyer
556e4ccb42 dracut-gencmdline: do not use full path for readlink 2009-11-05 17:06:26 +01:00
Harald Hoyer
116cb137fe dracut-functions: dinfo() on missing firmware, rather than dwarning() 2009-11-05 17:06:26 +01:00
Harald Hoyer
d7b97367b2 udev-rules: do not run blkid on temporary device mapper devices 2009-11-05 17:06:26 +01:00
Harald Hoyer
b82e22dcaf kernel-modules: install all usb storage modules also 2009-11-05 17:06:26 +01:00
Alan Jenkins
95bde7588c Tidy up some comments
Fix a few typos.
2009-11-03 17:47:38 +01:00
Alan Jenkins
13425eb243 dracut-gencmdline: fix regex quoting in findstoragedriver()
On my LVM system this changes the relevant output from "rd_NO_LVM" to
"rd_LVM_VG=alan-desktop.Linux"

Note that on my newer system, it now reaches moduledep() and complains.
I don't know enough awk to tell whose fault it is :).

    awk: line 2: function gensub never defined
    awk: line 2: function gensub never defined
    rd_NO_MD rd_NO_LVM rd_NO_LUKS LANG=en_GB.UTF-8 root=/dev/sda2

Both my systems (old ubuntu and debian unstable) agree that bash
regexes should not be quoted:

    $ [[ 'a' =~ a ]] && echo match
    match
    $ [[ 'a' =~ ^a$ ]] && echo match
    match
    $ [[ 'a' =~ '^a$' ]] && echo match
    $

(and yes, it is safe against globbing)

    $ touch 9
    $ echo [0-9]
    9
    $ [[ 1 =~ [0-9] ]] && echo match
    match
2009-11-03 17:47:38 +01:00
Harald Hoyer
5bde13f927 specfile update 2009-11-03 17:42:51 +01:00
David Cantrell
78b52181bd Update dracut.8 with new rd_DASD parameter information.
Rename existing rd_DASD parameter to rd_DASD_MOD.  Document new rd_DASD
parameter handling.
2009-11-03 10:43:23 +01:00
David Cantrell
a790547896 Support new rd_DASD parameter for s390 systems.
The new rd_DASD parameter allows dracut to handle multiple rd_DASD
options.  One parameter per DASD.  The syntax is:

    rd_DASD=<device path>[,readonly=X][,erplog=X][,use_diag=X][,failfast=X]

The device path is a CCW device path, such as 0.0.0200.  The optional
parameters are sysfs attributes for the DASD.  The X value can be 0 or
1.  Dracut will write out each of the rd_DASD settings to
/etc/dasd.conf and on bootup, the dasdconf.sh script will parse this
file and bring each DASD online with the specified attribute settings.
2009-11-03 10:43:15 +01:00
David Cantrell
fe32b77f87 Rename existing 95dasd handling to 95dasd_mod.
Rename the existing rd_DASD module handler to rd_DASD_MOD.
2009-11-03 10:43:03 +01:00
Harald Hoyer
dd854ea985 dracut.spec: update 2009-10-27 16:02:57 +01:00
Harald Hoyer
121e7b3e2d TEST-14-IMSM/create-root.sh: wait until md0 is ready synced 2009-10-27 16:02:56 +01:00
Harald Hoyer
15c82415c2 90dmraid,90lvm: device mapper upstream rules got renamed 2009-10-27 16:02:56 +01:00
Harald Hoyer
5d791c0ea9 join $dsrc and $dracutbasedir 2009-10-27 16:02:56 +01:00
Harald Hoyer
07db0defa7 specfile update 2009-10-27 16:02:56 +01:00
Philippe Seewer
41f8a4f14f Add dm_mod loader
Some kernel configurations might build base dm support as a module.
Add module dm which ensures that dm_mod is there and loaded.
2009-10-27 16:02:56 +01:00
Philippe Seewer
778d2ba28b test: Add compatibility for different kernel configs
Some distros, including debian unstable with 2.6.30, still shop
style ide drivers and/or have important filesystems like ext3 as
modules.

This patch ensures that all test cases work on these configurations
by including the necessary modules and adding a simple udev rule
file that provides /dev/sd* symlinks for the case where old style
ide drivers are still in use.
2009-10-27 16:02:56 +01:00
Philippe Seewer
dc490a0f08 Add old style ide drivers if available
Some distros, including debian unstable with 2.6.30, still ship
old style ide drivers. These should be installed as well.

Sadly there are no symbols to use for nm, so a simple =ide needs
to suffice.
2009-10-27 16:02:56 +01:00
Harald Hoyer
641eae0f5a dracut.spec: reverse switch_root logic 2009-10-27 16:02:55 +01:00
Harald Hoyer
2cc8cbeaf4 test/TEST-20-NFS: kill server if pid file present on run() 2009-10-27 16:02:54 +01:00
Warren Togami
24dcacc78f dmsquash-live-root requires grep 2009-10-13 16:23:56 -04:00
Warren Togami
157a8ddf5c Revert to per-device resolv.conf by Seewer's suggestion. 2009-10-13 14:19:49 -04:00
Warren Togami
08d82be71d Better check if writing ifcfg files is necessary. 2009-10-13 13:20:07 -04:00
Harald Hoyer
ba54a4c747 test: add rdinfo 2009-10-09 13:57:35 +02:00
Harald Hoyer
b26260a0b9 dracut-lib: fixed wait_for_if_up() 2009-10-09 13:18:59 +02:00
Harald Hoyer
ffd0861b7c test/*/hard-off.sh: do not powerdown on rdshell 2009-10-09 13:18:05 +02:00
Harald Hoyer
e5ccf5eb93 run-qemu: specify PATH 2009-10-09 13:17:45 +02:00
Harald Hoyer
67307075d1 dmraid: only install libdmraid-events-isw.so
the symlink will trigger install of the real lib file
2009-10-09 13:16:02 +02:00
Harald Hoyer
42c719474e dracut: if called with "-l" read only local dracut.conf 2009-10-09 13:15:32 +02:00
Harald Hoyer
4d9b6060d4 dmraid: do not fail if /usr/lib/libdmraid-events-isw.so is not present 2009-10-09 10:16:08 +02:00
Harald Hoyer
2331d1ff15 ccw: s/layer1/layer2/g 2009-10-08 18:19:11 +02:00
Harald Hoyer
218292f6b1 add s390 network support 2009-10-08 18:10:02 +02:00
Harald Hoyer
95c07b4659 dracut.8: correct typo 2009-10-08 18:09:37 +02:00
Harald Hoyer
186b9c9aac network/parse-bridge: check for bridge parameter not ip 2009-10-08 18:08:34 +02:00
Harald Hoyer
1ccc0fad27 add zfcp support for s390 2009-10-08 14:21:32 +02:00
Harald Hoyer
3e0f415fc6 dasd: rename dasd= to rd_DASD= 2009-10-08 14:21:32 +02:00
Harald Hoyer
5af0cf0ce6 dracut: exit traps with original exitcode 2009-10-08 14:21:31 +02:00
Harald Hoyer
8aa36728f5 plymouth: suppress "find" errors 2009-10-08 14:21:31 +02:00
Harald Hoyer
f2a716d47c base/init: make link /dev/fd, mount devpts,tmpfs with correct dev parm 2009-10-08 14:21:31 +02:00
Warren Togami
4431431c23 Fix comment typo 2009-10-07 16:23:52 -04:00
Harald Hoyer
13ef589dc8 dracut.8: fixed typos 2009-10-07 16:53:59 +02:00
Harald Hoyer
ac36d5db7e base/init: kill loginit after one second of waiting 2009-10-07 16:09:20 +02:00
Harald Hoyer
cdc74b198e dmsquash-live: run dmsquash-live-root after udev settle 2009-10-07 12:49:52 +02:00
Harald Hoyer
8d0a55cfac do not use init= arg as first argument 2009-10-07 12:48:47 +02:00
Harald Hoyer
3f793c91f4 AUTHORS: generated by git-shortlog
add AUTHORS target to Makefile

only list main authors in man page
2009-10-07 10:11:55 +02:00
Harald Hoyer
2dc4a31b6c add .mailmap 2009-10-07 10:03:47 +02:00
Harald Hoyer
40ef4325d9 test: run all tests with rdinitdebug by default 2009-10-06 19:09:22 +02:00
Harald Hoyer
16da29bf9d 99base/initqueue: make operations more atomic 2009-10-06 19:09:22 +02:00
Harald Hoyer
9fbe8a001b TEST-50-MULTINIC/test.sh: add selinux=0 2009-10-06 19:09:21 +02:00
Harald Hoyer
f12b432efd test: add "failme" parameter for failing tests 2009-10-06 19:09:17 +02:00
Harald Hoyer
e71a5ca5f2 test/*/hard-off.sh: poweroff, if failme specified 2009-10-06 16:37:20 +02:00
Harald Hoyer
837a5a6021 dracut.spec: update changelog and filelists 2009-10-06 15:24:31 +02:00
Philippe Seewer
7a6e646c83 Move write-ifcfg to its own module
ifcfg config style is redhat specific, this should be in its own
module.
2009-10-06 15:23:52 +02:00
Philippe Seewer
a71f1b4917 Add multinic test suite
This is a start a test suite for the multinic support of dracut
2009-10-06 15:17:39 +02:00
Philippe Seewer
5fb4ac2286 Add DAD to dhclient-script
The manpage for dhclient-script says:

Before actually configuring the address, dhclient-script should
somehow ARP for it and exit with a nonzero status if it receives a
reply.

By using arping in dracut this is very easy, since arping has a
specific option to do just that.
2009-10-06 15:17:39 +02:00
Philippe Seewer
98f25e9694 Add simple STP timeout handler
This patch adds STP timeout error handling with arping. It's rather
simple since it only cares about the primary interface and blindly
assumes that if no gateway is available the root server is on the
same subnet.
2009-10-06 15:16:52 +02:00
Philippe Seewer
d92ca28b16 Get rid of hostname utility
dracut doesn't really need a utility to set the hostname. It only
saves a few ks of space, but every bit is good.
2009-10-06 15:14:04 +02:00
Seewer Philippe
d1dd6bb746 Be a bit more optimistic when setting mtus
The usual approach to setting mtus is to set the interface down,
set the mtu then set the interface back up again. Modern hardware
and/or drivers may support setting this on the fly, so we try
this and fall back to the old behaviour it it doesn't work.

In addition this patch only allows mtus greater than 576, this is
taken from debian/ubuntu dhclient-script.
2009-10-06 15:09:34 +02:00
Harald Hoyer
bf87d252f3 network: wait for interfaces to come up, before proceeding 2009-10-06 15:07:52 +02:00
Harald Hoyer
8f397a9be7 base: add missing loginit 2009-10-06 14:43:53 +02:00
Michal Schmidt
ca270f7c17 dracut.8: removed switch_root relicts and changed URL 2009-10-06 10:30:43 +02:00
Harald Hoyer
a8a3ca5102 updated NEWS 2009-10-01 19:59:43 +02:00
Harald Hoyer
2c78a5a5a0 dracut-gencmdline: fixed rd_NO_LUKS case 2009-10-01 19:52:48 +02:00
Harald Hoyer
2521f714f9 fixed UUID= and LABEL= handling 2009-10-01 19:38:14 +02:00
Harald Hoyer
95b4875c8a updated NEWS 2009-10-01 18:57:23 +02:00
Harald Hoyer
ec01ab23fb dmsquash: use info() and die() rather than echo 2009-10-01 18:43:35 +02:00
Harald Hoyer
34debf18bf dracut: strip kernel modules which have no x bit set 2009-10-01 18:41:04 +02:00
Harald Hoyer
4592b6983a base: add logger for rdinitdebug
initlog logs to /init.log /dev/kmsg and /dev/console
2009-10-01 18:11:24 +02:00
Harald Hoyer
a0e44f97bd iscsi/iscsiroot: remove redirection on rdnetdebug
iscsiroot is now executed in the initqueue
2009-10-01 15:21:55 +02:00
Harald Hoyer
de439e24d7 base/init: stop udev exec queue before killing it 2009-10-01 15:17:59 +02:00
Harald Hoyer
187d04ccb0 syslog: use initqueue to start syslog 2009-10-01 14:46:16 +02:00
Harald Hoyer
f214273fd6 nfs/nfsroot: do not redirect output on rdnetdebug
nfsroot is now in the initqueue
2009-10-01 14:46:16 +02:00
Harald Hoyer
52aeb3f312 base/dracut-lib: add setdebug
do not clutter rdinitdebug output with getarg and getargs debug
2009-10-01 14:46:16 +02:00
Harald Hoyer
d84c1df906 nbd/nbdroot: add better check if nbd0 is ready to be mounted 2009-10-01 14:46:15 +02:00
Harald Hoyer
a1dd79d4fe network/netroot: remove flock
netroot is now in the initqueue
2009-10-01 14:46:15 +02:00
Harald Hoyer
0519556070 network/netroot: do not redirect output on rdnetdebug
netroot is now in the initqueue
2009-10-01 14:46:15 +02:00
Harald Hoyer
d64d04df39 nbd/nbdroot: do not redirect debug output on rdnetdebug
nbdroot is now in the initqueue and rdinitdebug should cover that
2009-10-01 14:46:15 +02:00
Harald Hoyer
cf476dbc41 nbd/nbdroot: use udevsettle to wait for /dev/nbd0
nbdroot is now in the initqueue, so we can use udevsettle
2009-10-01 14:46:15 +02:00
Harald Hoyer
8bfed103d8 mdraid: do not cleanup on auto assembly with mdadm.conf 2009-10-01 14:46:14 +02:00
Harald Hoyer
e9b6e4e839 nbd: finish on /dev/root rather than on nbd0 2009-10-01 14:46:14 +02:00
Harald Hoyer
1dc53cfd1e nfs: specify nfs version 3 explicitly and retry with nfs version 2 2009-10-01 14:46:13 +02:00
Harald Hoyer
f57b5bc735 network: move netroot to initqueue
Schedule netroot for the initqueue inside ifup and dhclient.
2009-10-01 14:45:24 +02:00
Harald Hoyer
d46c2e8b0a dracut-functions: let inst*() honor and handle symlinks correctly 2009-09-30 15:35:33 +02:00
Harald Hoyer
f6d1cb89de dracut-functions: inst_simple() with cp -p to preserver timestamps, etc. 2009-09-30 15:34:12 +02:00
Harald Hoyer
0e0031dc61 init: start udevd with --resolve-names=never 2009-09-30 15:04:50 +02:00
Harald Hoyer
2168327bfa init: mount /dev/shm 2009-09-30 15:04:36 +02:00
Harald Hoyer
5cf5569d6e Makefile: reorder targets 2009-09-30 10:18:25 +02:00
Lance Albertson
b4391067ff dracut-gencmdline: check for keyboard & i18n files 2009-09-29 19:02:05 +02:00
Lance Albertson
1961248339 dir symlinks
On amd64 multilib Gentoo, /lib is a symlink to /lib64, and dracut creates
duplicate files in /lib and /lib64 in a resulting cpio image. Other files are
missing in /lib64 but exists in /lib in that image. So /usr/sbin/lvm fails to
run from initrd due to missing libraries.  A possible solution is to create in
the initrd the same /lib symlink as in host system, if /lib is a symlink.

http://bugs.gentoo.org/show_bug.cgi?id=278442#c10
2009-09-29 19:01:29 +02:00
Lance Albertson
13d942e163 custom paths
Fix Makefile so that it allows us to install the root in a sane location (which
is needed in Gentoo).
2009-09-29 19:00:48 +02:00
Harald Hoyer
99fd62e3be dm/lvm: make usage of new udev event rules optionally 2009-09-29 18:29:34 +02:00
Harald Hoyer
0cded44025 95dasd: add dasd_diag_mod module 2009-09-29 18:20:48 +02:00
Harald Hoyer
a8aad9de61 dracut.8: fixed ifname position 2009-09-29 17:12:03 +02:00
Harald Hoyer
ffe53c91c5 95dasd: use 'uname -m' instead of 'arch' 2009-09-29 17:10:22 +02:00
Harald Hoyer
9a2860a3ee 95dasd: fixed typo in modules.conf generation 2009-09-29 14:51:21 +02:00
Harald Hoyer
896199c652 95dasd: do not install zfcp kernel module 2009-09-29 14:48:06 +02:00
Harald Hoyer
5fcc6b4a0a rename 95s390 to 95dasd 2009-09-29 14:47:29 +02:00
Harald Hoyer
678b3605e8 dmraid: add missing dso 2009-09-23 17:16:31 -07:00
Harald Hoyer
b9c4654a63 devicemapper: add dmeventd and new rules for device mapper 2009-09-23 16:52:14 -07:00
Warren Togami
845dd50275 Removing umount appears to be a mistake, it seems to have been OK prior. 2009-09-23 15:16:59 -04:00
Warren Togami
23aa204856 Fix LiveCD boot regression caused by bf55e2c5d3
FIXME: There is still something wrong with this boot where it wants to use umount, but doing so breaks live boot.
2009-09-21 18:14:27 -04:00
Harald Hoyer
8eb16b0827 selinux: bail out if policy could not be loaded and selinux=0 not
specified
2009-09-21 17:44:14 +02:00
Harald Hoyer
fc1abcfa1f dmsquash-live: add initqueue-finished 2009-09-19 10:51:34 +02:00
Harald Hoyer
c53acc3015 lvm: add rd_NO_LVMCONF 2009-09-18 12:28:36 +02:00
Harald Hoyer
7a34efa5c4 md/dm/lvm: install pre-pivot cleanup hooks only if actually needed
- removed dmraid cleanup
- only call lvm cleanup, if no lvm.conf provided
- copy over lvm.conf by default
- add --nolvmconf --lvmconf parameters
2009-09-18 12:20:21 +02:00
Harald Hoyer
2727e45b43 kernel-modules: force install of scsi_wait_scan in hostonly mode 2009-09-18 12:20:04 +02:00
Harald Hoyer
5e5ec023be dracut-gencmdline: add missing functions 2009-09-18 09:08:23 +02:00
Hans de Goede
d6a5b04043 Recognize nodmraid and noiswmd kernel cmdline options
Recognize nodmraid and noiswmd kernel cmdline options, for anaconda /
rc.sysinit / mkinitrd compatibility.
2009-09-18 08:58:14 +02:00
Hans de Goede
1de9edc06e Do not stop / start udev exec-queue around "mdadm -As --run"
When assembling containers + embedded arrays from mdadm.conf,
mdadm needs the /dev/md# node for the container to assemble the
arrays within the container. Stopping the udev exec queue, results in
this node not getting created and mdadm failing to online the
arrays within the container.

Not having stop / start udev exec-queue around "mdadm -As --run" should
be safe as the exact same command is run from rc.sysinit without
any queue locking.
2009-09-18 08:15:59 +02:00
190 changed files with 3944 additions and 762 deletions

6
.mailmap Normal file
View File

@@ -0,0 +1,6 @@
Philippe Seewer <philippe.seewer@bfh.ch> <philippe.seewer-omB+W0Dpw2o@public.gmane.org>
Seewer Philippe <philippe.seewer@bfh.ch> <philippe.seewer@bfh.ch>
Philippe Seewer <philippe.seewer@bfh.ch> <philippe.seewer@bfh.ch>
Victor Lowther <victor.lowther@gmail.com> <victor.lowther-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Harald Hoyer <harald@redhat.com> <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Harald Hoyer <harald@redhat.com> <harald@eeepc.(none)>

35
AUTHORS
View File

@@ -1,11 +1,30 @@
Andreas Thienemann <andreas@bawue.net>
Bill Nottingham <notting@redhat.com>
Dave Jones <davej@redhat.com>
David Dillow <dave@thedillows.org>
Harald Hoyer <harald@redhat.com>
Jeremy Katz <katzj@redhat.com>
Peter Jones <pjones@redhat.com>
Seewer Philippe <philippe.seewer@bfh.ch>
Victor Lowther <victor.lowther@gmail.com>
Warren Togami <wtogami@redhat.com>
Philippe Seewer <philippe.seewer@bfh.ch>
Jeremy Katz <katzj@redhat.com>
David Dillow <dave@thedillows.org>
Andreas Thienemann <andreas@bawue.net>
Hans de Goede <hdegoede@redhat.com>
Peter Jones <pjones@redhat.com>
Luca Berra <bluca@comedia.it>
Marc Grimme <grimme@atix.de>
Bill Nottingham <notting@redhat.com>
Daniel Drake <dsd@laptop.org>
David Cantrell <dcantrell@redhat.com>
Lance Albertson <lance@osuosl.org>
Michael Ploujnikov <plouj@somanetworks.com>
Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Dan Horák <dan@danny.cz>
Andrey Borzenkov <arvidjaar@mail.ru>
Dave Jones <davej@redhat.com>
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Luca Berra <bluca@vodka.it>
Michal Schmidt <mschmidt@redhat.com>
Mike Snitzer <msnitzer@redhat.com>
Munehiro Matsuda <haro@kgt.co.jp>
Peter Rajnoha <prajnoha@redhat.com>
Quentin Armitage <quentin@armitage.org.uk>
Sergey Fionov <fionov@gmail.com>
Thilo Bangert <thilo.bangert@gmx.net>
Yanko Kaneti <yaneti@declera.com>

View File

@@ -1,35 +1,52 @@
VERSION=002
VERSION=005
GITVERSION=$(shell [ -d .git ] && git rev-list --abbrev-commit -n 1 HEAD |cut -b 1-8)
prefix = /usr
datadir = ${prefix}/share
pkglibdir = ${datadir}/dracut
sysconfdir = ${prefix}/etc
sbindir = ${prefix}/sbin
mandir = ${prefix}/share/man
prefix ?= /usr
datadir ?= ${prefix}/share
pkglibdir ?= ${datadir}/dracut
sysconfdir ?= ${prefix}/etc
sbindir ?= ${prefix}/sbin
mandir ?= ${prefix}/share/man
.PHONY: install clean archive rpm testimage test all check AUTHORS
ifeq (1,${WITH_SWITCH_ROOT})
targets = modules.d/99base/switch_root
else
targets =
endif
all: $(targets)
modules.d/99base/switch_root: switch_root.c
gcc -D _GNU_SOURCE -D 'PACKAGE_STRING="dracut"' -std=gnu99 -fsigned-char -g -O2 -o modules.d/99base/switch_root switch_root.c
all: modules.d/99base/switch_root
.PHONY: install clean archive rpm testimage test all check
install:
mkdir -p $(DESTDIR)$(pkglibdir)
mkdir -p $(DESTDIR)$(sbindir)
mkdir -p $(DESTDIR)$(sysconfdir)
mkdir -p $(DESTDIR)$(pkglibdir)/modules.d
mkdir -p $(DESTDIR)$(mandir)/man8
mkdir -p $(DESTDIR)$(mandir)/man{5,8}
install -m 0755 dracut $(DESTDIR)$(sbindir)/dracut
install -m 0755 dracut-gencmdline $(DESTDIR)$(sbindir)/dracut-gencmdline
install -m 0755 dracut-catimages $(DESTDIR)$(sbindir)/dracut-catimages
install -m 0755 mkinitrd-dracut.sh $(DESTDIR)$(sbindir)/mkinitrd
install -m 0755 lsinitrd $(DESTDIR)$(sbindir)/lsinitrd
ifeq (1,${WITH_SWITCH_ROOT})
install -m 0755 modules.d/99base/switch_root $(DESTDIR)$(sbindir)/switch_root
endif
install -m 0644 dracut.conf $(DESTDIR)$(sysconfdir)/dracut.conf
mkdir -p $(DESTDIR)$(sysconfdir)/dracut.conf.d
install -m 0755 dracut-functions $(DESTDIR)$(pkglibdir)/dracut-functions
cp -arx modules.d $(DESTDIR)$(pkglibdir)
install -m 0644 dracut.8 $(DESTDIR)$(mandir)/man8
install -m 0644 dracut-catimages.8 $(DESTDIR)$(mandir)/man8
install -m 0644 dracut-gencmdline.8 $(DESTDIR)$(mandir)/man8
install -m 0644 dracut.conf.5 $(DESTDIR)$(mandir)/man5
ifeq (1,${WITH_SWITCH_ROOT})
rm $(DESTDIR)$(pkglibdir)/modules.d/99base/switch_root
endif
clean:
rm -f *~
@@ -58,7 +75,7 @@ gitrpm: dracut-$(VERSION)-$(GITVERSION).tar.bz2
cat dracut.spec >> dracut.spec.git
mv dracut.spec dracut.spec.bak
mv dracut.spec.git dracut.spec
rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" --define "_specdir $$PWD" --define "_srcrpmdir $$PWD" --define "_rpmdir $$PWD" --define "gittag $(GITVERSION)" -ba dracut.spec
rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" --define "_specdir $$PWD" --define "_srcrpmdir $$PWD" --define "_rpmdir $$PWD" --define "gittag $(GITVERSION)" -ba dracut.spec || :
mv dracut.spec.bak dracut.spec
rm -fr BUILD BUILDROOT
@@ -77,9 +94,10 @@ testimages: all
@echo wrote test-$(shell uname -r).img
./dracut -l -a debug --no-kernel -f test-dracut.img $(shell uname -r)
@echo wrote test-dracut.img
hostimage: all
./dracut -H -l -a debug -f test-$(shell uname -r).img $(shell uname -r)
@echo wrote test-$(shell uname -r).img
AUTHORS:
git shortlog --numbered --summary -e |while read a rest; do echo $$rest;done > AUTHORS

72
NEWS
View File

@@ -1,3 +1,75 @@
dracut-005
==========
- dcb support to dracut's FCoE support
- add readonly overlay support for dmsquash
- add keyboard kernel modules
- dracut.conf: added add_dracutmodules
- add /etc/dracut.conf.d
- add preliminary IPv6 support
- bugfixes
dracut-004
==========
- dracut-lib: read multiple lines from $init/etc/cmdline
- lsinitrd and mkinitrd
- dmsquash: add support for loopmounted *.iso files
- lvm: add rd_LVM_LV and "--poll n"
- user suspend support
- add additional drivers in host-only mode, too
- improved emergency shell
- support for compressed kernel modules
- support for loading Xen modules
- rdloaddriver kernel command line parameter
- man pages for dracut-catimages and dracut-gencmdline
- bugfixes
dracut-003
==========
- add debian package modules
- add dracut.conf manpage
- add module 90multipath
- add module 01fips
- crypt: ignore devices in /etc/crypttab (root is not in there)
unless rd_NO_CRYPTTAB is specified
- kernel-modules: add scsi_dh scsi_dh_rdac scsi_dh_emc
- add multinic support
- add s390 zfcp support
- add s390 dasd support
- add s390 network support
- fixed dracut-gencmdline for root=UUID or LABEL
- do not destroy assembled raid arrays if mdadm.conf present
- mount /dev/shm
- let udevd not resolve group and user names
- moved network from udev to initqueue
- improved debug output: specifying "rdinitdebug" now logs
to dmesg, console and /init.log
- strip kernel modules which have no x bit set
- redirect stdin, stdout, stderr all RW to /dev/console
so the user can use "less" to view /init.log and dmesg
- add new device mapper udev rules and dmeventd
- fixed dracut-gencmdline for root=UUID or LABEL
- do not destroy assembled raid arrays if mdadm.conf present
- mount /dev/shm
- let udevd not resolve group and user names
- preserve timestamps of tools on initramfs generation
- generate symlinks for binaries correctly
- moved network from udev to initqueue
- mount nfs3 with nfsvers=3 option and retry with nfsvers=2
- fixed nbd initqueue-finished
- improved debug output: specifying "rdinitdebug" now logs
to dmesg, console and /init.log
- strip kernel modules which have no x bit set
- redirect stdin, stdout, stderr all RW to /dev/console
so the user can use "less" to view /init.log and dmesg
- make install of new dm/lvm udev rules optionally
- add new device mapper udev rules and dmeventd
- Fix LiveCD boot regression
- bail out if selinux policy could not be loaded and
selinux=0 not specified on kernel command line
- do not cleanup dmraids
- copy over lvm.conf
dracut-002
==========
- add ifname= argument for persistent netdev names

53
debian/changelog vendored Normal file
View File

@@ -0,0 +1,53 @@
dracut (2.26) unstable; urgency=low
[ Harald Hoyer ]
* multipath: install udev rules and helper tools
* NEWS update
* multipath: install xdr utils
* multipath: install multipath kernel module
* specfile update
* dracut.8: fixed formatting for rootfs and mount options
* dracut: check more return codes, check for permissions and use
derror
* dracut: create initramfs-$(kernelversion).img by default
* Makefile: add WITH_SWITCH_ROOT
* fips: search different lib paths
* kernel-modules: add firewire-ohci to hardcoded modules list
* 90dm: install more device mapper kernel modules
* specfile update
[ Peter Jones ]
* Use glob for libdir when installing multipath libraries.
* Add #!/bin/bash for consistency.
* Make sure and get all the multipath related modules.
* Bring up multipath devices that are configured in multipath.conf.
* Fix missing shell variables.
* This has to be executable.
* Handle modules with hyphens in their names properly.
[ Harald Hoyer ]
* lvm: scan without monitor
[ Yanko Kaneti ]
* Wildcards need dracut_install
[ Harald Hoyer ]
* lvm/dmraid: make LIBDIR depend on the binary
* nfs: install passwd entries for nobody and nfsnobody
* nfs: add rd_NFS_DOMAIN parameter to set the NFSv4 domain name
* dracut-functions: inst_simple(): do not bail out if target is a dir
and exists
* dm: install dmsetup
* multipath: corrected initqueue parameter
* rootfs-block/mount-root: remount root with /etc/fstab filesystem
options
* test: set PATH
-- Philippe Seewer <philippe.seewer@.bfh.ch> Fri, 27 Nov 2009 10:58:26 +0100
dracut (2.21) unstable; urgency=low
[ Harald Hoyer ]
* fix rd_DASD argument handling (bug #531720)
* Resolves: rhbz#531720
-- Philippe Seewer <philippe.seewer@.bfh.ch> Fri, 06 Nov 2009 15:52:00 +0100

1
debian/compat vendored Normal file
View File

@@ -0,0 +1 @@
5

41
debian/control vendored Normal file
View File

@@ -0,0 +1,41 @@
Source: dracut
Section: utils
Priority: optional
Maintainer: Philippe Seewer <philippe.seewer@bfh.ch>
Build-Depends: debhelper (>= 5.0), cdbs
Standards-Version: 3.8.4
Vcs-Browser: http://dracut.git.sourceforge.net/git/gitweb-index.cgi
Vcs-Git: git://dracut.git.sourceforge.net/gitroot/dracut/dracut
Package: dracut
Architecture: all
Recommends: cryptsetup, dmsetup, dmraid, lvm2, mdadm
Suggests: dracut-network
Depends: cpio, module-init-tools, udev, ${misc:Depends}
Provides: linux-initramfs-tool
Description: A new initramfs infrastructure
Unlike existing initramfs's, this is an attempt at having as little as
possible hard-coded into the initramfs as possible. The initramfs has
(basically) one purpose in life -- getting the rootfs mounted so that
we can transition to the real rootfs. This is all driven off of
device availability. Therefore, instead of scripts hard-coded to do
various things, we depend on udev to create device nodes for us and
then when we have the rootfs's device node, we mount and carry on.
Having the root on MD, LVM2, LUKS is supported as well as NFS, iSCSI,
NBD and FCOE with dracut-network.
Package: dracut-network
Architecture: all
Recommends: nfs-common, open-iscsi, nbd-client
Depends: dracut, iputils-arping, dhcp3-client, ${misc:Depends}
Description: A new initramfs infrastucture
Unlike existing initramfs's, this is an attempt at having as little as
possible hard-coded into the initramfs as possible. The initramfs has
(basically) one purpose in life -- getting the rootfs mounted so that
we can transition to the real rootfs. This is all driven off of
device availability. Therefore, instead of scripts hard-coded to do
various things, we depend on udev to create device nodes for us and
then when we have the rootfs's device node, we mount and carry on.
Having the root on MD, LVM2, LUKS is supported as well as NFS, iSCSI,
NBD and FCOE with dracut-network.

39
debian/copyright vendored Normal file
View File

@@ -0,0 +1,39 @@
This package was debianized by Philippe Seewer <philippe.seewer@bfh.ch> on
Fri Nov 20 15:45:00 +0100
Sources can be downloaded from:
https://sourceforge.net/projects/dracut/
Upstream Maintainer:
Harald Hoyer <harald@redhat.com>
Updstream Authors:
Victor Lowther <victor.lowther@gmail.com>
Warren Togami <wtogami@redhat.com>
Jeremy Katz <katzj@redhat.com>
Philippe Seewer <philippe.seewer@bfh.ch>
David Dillow <dave@thedillows.org>
Andreas Thienemann <andreas@bawue.net>
Hans de Goede <hdegoede@redhat.com>
Marc Grimme <grimme@atix.de>
Bill Nottingham <notting@redhat.com>
Daniel Drake <dsd@laptop.org>
Lance Albertson <lance@osuosl.org>
Michael Ploujnikov <plouj@somanetworks.com>
Peter Jones <pjones@redhat.com>
Dave Jones <davej@redhat.com>
Michal Schmidt <mschmidt@redhat.com>
Peter Rajnoha <prajnoha@redhat.com>
Quentin Armitage <quentin@armitage.org.uk>
Sergey Fionov <fionov@gmail.com>
Thilo Bangert <thilo.bangert@gmx.net>
Copyright:
Copyright 2009 Harald Hoyer <harald@redhat.com>
License: GPLv2
On Debian systems, the complete text of the GNU General Public
License version 2 can be found in `/usr/share/common-licenses/GPL-2'.

5
debian/dracut-network.dirs vendored Normal file
View File

@@ -0,0 +1,5 @@
usr/share/dracut/modules.d/40network
usr/share/dracut/modules.d/95fcoe
usr/share/dracut/modules.d/95iscsi
usr/share/dracut/modules.d/95nbd
usr/share/dracut/modules.d/95nfs

5
debian/dracut-network.install vendored Normal file
View File

@@ -0,0 +1,5 @@
modules.d/40network usr/share/dracut/modules.d
modules.d/95fcoe usr/share/dracut/modules.d
modules.d/95iscsi usr/share/dracut/modules.d
modules.d/95nbd usr/share/dracut/modules.d
modules.d/95nfs usr/share/dracut/modules.d

25
debian/dracut.dirs vendored Normal file
View File

@@ -0,0 +1,25 @@
usr/share/dracut
usr/share/dracut/modules.d/00dash
usr/share/dracut/modules.d/01fips
usr/share/dracut/modules.d/60xen
usr/share/dracut/modules.d/90crypt
usr/share/dracut/modules.d/90dm
usr/share/dracut/modules.d/90dmraid
usr/share/dracut/modules.d/90kernel-modules
usr/share/dracut/modules.d/90lvm
usr/share/dracut/modules.d/90mdraid
usr/share/dracut/modules.d/90multipath
usr/share/dracut/modules.d/95dasd
usr/share/dracut/modules.d/95dasd_mod
usr/share/dracut/modules.d/95debug
usr/share/dracut/modules.d/95resume
usr/share/dracut/modules.d/95rootfs-block
usr/share/dracut/modules.d/95terminfo
usr/share/dracut/modules.d/95udev-rules
usr/share/dracut/modules.d/95uswsusp
usr/share/dracut/modules.d/95zfcp
usr/share/dracut/modules.d/95znet
usr/share/dracut/modules.d/98syslog
usr/share/dracut/modules.d/99base
/var/lib/dracut
/etc/dracut.conf.d

4
debian/dracut.docs vendored Normal file
View File

@@ -0,0 +1,4 @@
HACKING
README.generic
README.kernel
README.modules

28
debian/dracut.install vendored Normal file
View File

@@ -0,0 +1,28 @@
dracut usr/sbin
dracut-catimages usr/sbin
dracut-update-initramfs usr/sbin
dracut-gencmdline usr/sbin
dracut-functions usr/share/dracut
dracut.conf etc
modules.d/00dash usr/share/dracut/modules.d
modules.d/01fips usr/share/dracut/modules.d
modules.d/60xen usr/share/dracut/modules.d
modules.d/90crypt usr/share/dracut/modules.d
modules.d/90dm usr/share/dracut/modules.d
modules.d/90dmraid usr/share/dracut/modules.d
modules.d/90kernel-modules usr/share/dracut/modules.d
modules.d/90lvm usr/share/dracut/modules.d
modules.d/90mdraid usr/share/dracut/modules.d
modules.d/90multipath usr/share/dracut/modules.d
modules.d/95dasd usr/share/dracut/modules.d
modules.d/95dasd_mod usr/share/dracut/modules.d
modules.d/95debug usr/share/dracut/modules.d
modules.d/95resume usr/share/dracut/modules.d
modules.d/95rootfs-block usr/share/dracut/modules.d
modules.d/95terminfo usr/share/dracut/modules.d
modules.d/95udev-rules usr/share/dracut/modules.d
modules.d/95uswsusp usr/share/dracut/modules.d
modules.d/95zfcp usr/share/dracut/modules.d
modules.d/95znet usr/share/dracut/modules.d
modules.d/98syslog usr/share/dracut/modules.d
modules.d/99base usr/share/dracut/modules.d

4
debian/dracut.manpages vendored Normal file
View File

@@ -0,0 +1,4 @@
dracut.8
dracut.conf.5
dracut-catimages.8
dracut-gencmdline.8

8
debian/dracut.postinst vendored Normal file
View File

@@ -0,0 +1,8 @@
#!/bin/sh
set -e
# Regenerate initramfs when we're `installed`
DPKG_MAINTSCRIPT_PACKAGE='' dracut-update-initramfs -u
#DEBHELPER#

1
debian/dracut.triggers vendored Normal file
View File

@@ -0,0 +1 @@
interest update-initramfs

3
debian/rules vendored Executable file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/make -f
include /usr/share/cdbs/1/rules/debhelper.mk

96
dracut
View File

@@ -37,6 +37,9 @@ Creates initial ramdisk images for preloading modules
exclusively include in the initramfs.
--add-drivers [LIST] Specify a space-separated list of kernel
modules to add to the initramfs.
--filesystems [LIST] Specify a space-separated list of kernel filesystem
modules to exclusively include in the generic
initramfs.
-k, --kmoddir [DIR] Specify the directory, where to look for kernel
modules
--fwdir [DIR] Specify additional directories, where to look for
@@ -47,6 +50,8 @@ Creates initial ramdisk images for preloading modules
--nostrip Do not strip binaries in the initramfs
--mdadmconf Include local /etc/mdadm.conf
--nomdadmconf Do not include local /etc/mdadm.conf
--lvmconf Include local /etc/lvm/lvm.conf
--nolvmconf Do not include local /etc/lvm/lvm.conf
-h, --help This message
--debug Output debug information of the build process
-v, --verbose Verbose output during the build process
@@ -74,18 +79,22 @@ while (($# > 0)); do
-a|--add) add_dracutmodules_l="$2"; shift;;
-d|--drivers) drivers_l="$2"; shift;;
--add-drivers) add_drivers_l="$2"; shift;;
--filesystems) filesystems_l="$2"; shift;;
-k|--kmoddir) drivers_dir_l="$2"; shift;;
--fwdir) fw_dir_l="$2"; shift;;
--kernel-only) kernel_only="yes"; nokernel="no";;
--kernel-only) kernel_only="yes"; no_kernel="no";;
--no-kernel) kernel_only="no"; no_kernel="yes";;
--strip) do_strip_l="yes";;
--nostrip) do_strip_l="no";;
--mdadmconf) mdadmconf_l="yes";;
--nomdadmconf) mdadmconf_l="no";;
--lvmconf) lvmconf_l="yes";;
--nolvmconf) lvmconf_l="no";;
-h|--help) usage; exit 1 ;;
--debug) debug="yes";;
-v|--verbose) beverbose="yes";;
-c|--conf) conffile="$2"; shift;;
--confdir) confdir="$2"; shift;;
-l|--local) allowlocal="yes" ;;
-H|--hostonly) hostonly_l="yes" ;;
-i|--include) include_src="$2"; include_target="$3"; shift 2;;
@@ -104,8 +113,27 @@ export PATH
set -x
}
[[ $dracutbasedir ]] || dracutbasedir=/usr/share/dracut
[[ $allowlocal && -f "$(readlink -f $(dirname $0))/dracut-functions" ]] && dracutbasedir="$(dirname $0)"
# if we were not passed a config file, try the default one
[[ ! -f $conffile ]] && conffile="/etc/dracut.conf"
if [[ ! -f $conffile ]]; then
[[ $allowlocal ]] || conffile="/etc/dracut.conf"
[[ $allowlocal ]] && conffile="$dracutbasedir/dracut.conf"
fi
if [[ ! -d $confdir ]]; then
[[ $allowlocal ]] || confdir="/etc/dracut.conf.d"
[[ $allowlocal ]] && confdir="$dracutbasedir/dracut.conf.d"
fi
# source our config dir
if [ "$confdir" ] && [ -d "$confdir" ]; then
for f in "$confdir"/*.conf; do
[ -e "$f" ] && . "$f"
done
fi
# source our config file
[[ -f $conffile ]] && . "$conffile"
@@ -116,11 +144,13 @@ export PATH
[[ $add_dracutmodules_l ]] && add_dracutmodules="$add_dracutmodules $add_dracutmodules_l"
[[ $drivers_l ]] && drivers=$drivers_l
[[ $add_drivers_l ]] && add_drivers=$add_drivers_l
[[ $filesystems_l ]] && filesystems=$filesystems_l
[[ $drivers_dir_l ]] && drivers_dir=$drivers_dir_l
[[ $fw_dir_l ]] && fw_dir=$fw_dir_l
[[ $do_strip_l ]] && do_strip=$do_strip_l
[[ $hostonly_l ]] && hostonly=$hostonly_l
[[ $mdadmconf_l ]] && mdadmconf=$mdadmconf_l
[[ $lvmconf_l ]] && lvmconf=$lvmconf_l
[[ $dracutbasedir ]] || dracutbasedir=/usr/share/dracut
[[ $fw_dir ]] || fw_dir=/lib/firmware
[[ $do_strip ]] || do_strip=yes
@@ -128,18 +158,17 @@ export PATH
fw_dir=${fw_dir//:/ }
[[ $hostonly = yes ]] && hostonly="-h"
[[ $hostonly != "-h" ]] && unset hostonly
[[ $allowlocal && -f "$(readlink -f $(dirname $0))/dracut-functions" ]] && dsrc="$(dirname $0)" || dsrc=$dracutbasedir
if [[ -f $dsrc/dracut-functions ]]; then
. $dsrc/dracut-functions
if [[ -f $dracutbasedir/dracut-functions ]]; then
. $dracutbasedir/dracut-functions
else
echo "Cannot find $dsrc/dracut-functions. Are you running from a git checkout?"
echo "Cannot find $dracutbasedir/dracut-functions. Are you running from a git checkout?"
echo "Try passing -l as an argument to $0"
exit 1
fi
dracutfunctions=$dsrc/dracut-functions
dracutfunctions=$dracutbasedir/dracut-functions
export dracutfunctions
# This is kinda legacy -- eventually it should go away.
@@ -148,7 +177,8 @@ case $dracutmodules in
esac
[[ $2 ]] && kernel=$2 || kernel=$(uname -r)
[[ $1 ]] && outfile=$(readlink -f $1) || outfile="/boot/initrd-$kernel.img"
[[ $1 ]] && outfile=$1 || outfile="/boot/initramfs-$kernel.img"
abs_outfile=$(readlink -f "$outfile") && outfile="$abs_outfile"
srcmods="/lib/modules/$kernel/"
[[ $drivers_dir ]] && srcmods="$drivers_dir"
@@ -159,22 +189,41 @@ if [[ -f $outfile && ! $force ]]; then
exit 1
fi
outdir=$(dirname "$outfile")
if ! [[ -d "$outdir" ]]; then
echo "Can't write $outfile: Directory $outdir does not exist."
exit 1
fi
if ! [[ -w "$outdir" ]]; then
echo "No permission to write $outdir."
exit 1
fi
if [[ -f "$outfile" ]] && ! [[ -w "$outfile" ]]; then
echo "No permission to write $outfile."
exit 1
fi
hookdirs="cmdline pre-udev pre-trigger netroot pre-mount pre-pivot mount emergency"
[[ -n "$TMPDIR" ]] && ! [[ -w "$TMPDIR" ]] && unset TMPDIR
readonly initdir=$(mktemp -d -t initramfs.XXXXXX)
trap 'rm -rf "$initdir"' 0 # clean up after ourselves no matter how we die.
trap 'ret=$?;rm -rf "$initdir";exit $ret;' EXIT # clean up after ourselves no matter how we die.
trap 'exit 1;' SIGINT # clean up after ourselves no matter how we die.
# Need to be able to have non-root users read stuff (rpcbind etc)
chmod 755 "$initdir"
export initdir hookdirs dsrc dracutmodules drivers \
export initdir hookdirs dracutbasedir dracutmodules drivers \
fw_dir drivers_dir debug beverbose no_kernel kernel_only \
add_drivers mdadmconf
add_drivers mdadmconf lvmconf filesystems
if [[ $kernel_only != yes ]]; then
# Create some directory structure first
for d in bin sbin usr/bin usr/sbin usr/lib etc proc sys sysroot tmp dev/pts var/run; do
mkdir -p "$initdir/$d";
inst_dir "/$d";
done
fi
@@ -182,8 +231,8 @@ fi
# This builds a list of modules that we will install next.
check_modules
#source our modules.
for moddir in "$dsrc/modules.d"/[0-9][0-9]*; do
# source our modules.
for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
mod=${moddir##*/}; mod=${mod#[0-9][0-9]}
if strstr "$mods_to_load" " $mod "; then
if [[ $kernel_only = yes ]]; then
@@ -204,14 +253,11 @@ unset moddir
# generate module dependencies for the initrd
if [[ -d $initdir/lib/modules/$kernel ]]; then
if ! depmod -a -b "$initdir" $kernel; then
echo "\"depmod -a $kernel\" failed."
derror "\"depmod -a $kernel\" failed."
exit 1
fi
fi
# make sure that library links are correct and up to date
ldconfig -n -r "$initdir" /lib* /usr/lib*
if [[ $include_src && $include_target ]]; then
mkdir -p "$initdir$include_target"
cp -a -t "$initdir$include_target" "$include_src"/*
@@ -222,6 +268,10 @@ for item in $install_items; do
done
unset item
# make sure that library links are correct and up to date
cp -ar /etc/ld.so.conf* "$initdir"/etc
ldconfig -r "$initdir" || [[ $(id -u) != "0" ]] && dinfo "ldconfig might need uid=0 (root) for chroot()"
[[ $beverbose = yes ]] && (du -c "$initdir" | sort -n)
# strip binaries
@@ -235,7 +285,7 @@ if [[ $do_strip = yes ]] ; then
fi
if [[ $do_strip = yes ]] ; then
for f in $(find "$initdir" -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; |
for f in $(find "$initdir" -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 -or -path '/lib/modules/*.ko' \) -exec file {} \; |
grep -v ' shared object,' |
sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'); do
dinfo "Stripping $f"
@@ -253,7 +303,11 @@ if [[ $do_strip = yes ]] ; then
done
fi
( cd "$initdir"; find . |cpio -R 0:0 -H newc -o --quiet |gzip -9 > "$outfile"; )
( cd "$initdir"; find . |cpio -R 0:0 -H newc -o --quiet |gzip -9 > "$outfile"; )
if [ $? -ne 0 ]; then
derror "dracut: creation of $outfile failed"
exit 1
fi
[[ $beverbose = yes ]] && ls -lh "$outfile"

52
dracut-catimages.8 Normal file
View File

@@ -0,0 +1,52 @@
.TH DRACUT-CATIMAGES 8 "June 2009" "Linux"
.SH NAME
dracut-catimages \- creates initial ramdisk image by concatenating images
.SH SYNOPSIS
\fBdracut-catimages\fR [\fIOPTION\fR]... \fI<initramfs base image>\fR \fI[<image>...]\fR
.SH DESCRIPTION
.B dracut-catimages
creates an initial ramdisk image by concatenating several images from the command
line and /boot/dracut/*.img
.SH OPTIONS
.TP
.BR \-f ", " \-\-force
overwrite existing initramfs file.
.TP
.BR \-i ", " \-\-imagedir
Directory with additional images to add (default: /boot/dracut/)
.TP
.BR \-o ", " \-\-overlaydir
Overlay directory, which contains additional files that will be used to create an additional image
.TP
.BR \-\-nooverlay
Do not use the overlay directory
.TP
.BR \-\-noimagedir
Do not use the additional image directory
.TP
.BR \-h ", " \-\-help
display help text and exit.
.TP
.B \-\-debug
output debug information of the build process
.TP
.BR \-v ", " \-\-verbose
verbose output during the build process
.SH FILES
.TP
.B /boot/dracut/*.img
.TP
.B
.SH AUTHORS
.nf
Harald Hoyer <harald@redhat.com>
.fi
.SH AVAILABILITY
The dracut-catimages command is part of the dracut package and is available from
http://sourceforge.net/apps/trac/dracut/wiki
.SH SEE ALSO
.BR dracut (8)

View File

@@ -26,7 +26,7 @@ strstr() { [[ $1 =~ $2 ]]; }
# Log initrd creation.
if ! [[ $dracutlogfile ]]; then
[[ $dsrc = /usr/share/dracut ]] && \
[[ $dracutbasedir = /usr/share/dracut ]] && \
dracutlogfile=/var/log/dracut.log || \
dracutlogfile=/tmp/dracut.log
# [[ -w $dracutlogfile ]] || dracutlogfile=/tmp/dracut.log
@@ -111,7 +111,7 @@ get_numeric_dev() {
# so, there are no slave devices for volume groups.
# Logical volumes only have the slave devices they really live on,
# but you cannot create the logical volume without the volume group.
# And the volume group might be bigger than the devices the LV needes.
# And the volume group might be bigger than the devices the LV needs.
check_vol_slaves() {
for i in /dev/mapper/*; do
lv=$(get_numeric_dev $i)
@@ -131,6 +131,36 @@ check_vol_slaves() {
return 1
}
# Install a directory, keeping symlinks as on the original system.
# Example: if /lib64 points to /lib on the host, "inst_dir /lib/file"
# will create ${initdir}/lib64, ${initdir}/lib64/file,
# and a symlink ${initdir}/lib -> lib64.
inst_dir() {
local dir="$1"
[[ -e "${initdir}$dir" ]] && return 0
# iterate over parent directories
local file=""
local IFS="/"
for part in $dir; do
[ -z "$part" ] && continue
file="$file/$part"
[[ -e "${initdir}$file" ]] && continue
if [ -L "$file" ]; then
# create link as the original
local target=$(readlink "$file")
ln -sfn "$target" "${initdir}$file" || return 1
# resolve relative path and recursively install destionation
[[ "$target" = "${target##*/}" ]] && target="${file%/*}/$target"
inst_dir "$target"
else
# create directory
mkdir -p "${initdir}$file" || return 1
fi
done
}
# $1 = file to copy to ramdisk
# $2 (optional) Name for the file on the ramdisk
# Location of the image dir is assumed to be $initdir
@@ -138,24 +168,26 @@ check_vol_slaves() {
inst_simple() {
local src target
[[ -f $1 ]] || return 1
src=$1 target=${initdir}${2:-$1}
[[ -f $target ]] && return 0
mkdir -p "${target%/*}"
src=$1 target="${2:-$1}"
if ! [[ -d ${initdir}$target ]]; then
[[ -e ${initdir}$target ]] && return 0
inst_dir "${target%/*}"
fi
dinfo "Installing $src"
cp -pfL "$src" "$target"
cp -pfL "$src" "${initdir}$target"
}
# Same as above, but specialzed to handle dynamic libraries.
# Same as above, but specialized to handle dynamic libraries.
# It handles making symlinks according to how the original library
# is referenced.
inst_library() {
local src=$1 dest=${2:-$1}
[[ -f $initdir$dest ]] && return 0
[[ -e $initdir$dest ]] && return 0
if [[ -L $src ]]; then
reallib=$(readlink -f "$src")
lib=${src##*/}
inst_simple "$reallib" "$reallib"
mkdir -p "${initdir}${dest%/*}"
inst_dir "${dest%/*}"
(cd "${initdir}${dest%/*}" && ln -s "$reallib" "$lib")
else
inst_simple "$src" "$dest"
@@ -179,8 +211,9 @@ inst_binary() {
local bin target
bin=$(find_binary "$1") || return 1
target=${2:-$bin}
inst_symlink $bin $target && return 0
local LDSO NAME IO FILE ADDR I1 n f TLIBDIR
[[ -f $initdir$target ]] && return 0
[[ -e $initdir$target ]] && return 0
# I love bash!
ldd $bin 2>/dev/null | while read line; do
[[ $line = 'not a dynamic executable' ]] && return 1
@@ -193,7 +226,7 @@ inst_binary() {
so_regex='([^ ]*/lib[^/]*/[^ ]*\.so[^ ]*)'
[[ $line =~ $so_regex ]] || continue
FILE=${BASH_REMATCH[1]}
[[ -f ${initdir}$FILE ]] && continue
[[ -e ${initdir}$FILE ]] && continue
# see if we are loading an optimized version of a shared lib.
lib_regex='^(/lib[^/]*).*'
if [[ $FILE =~ $lib_regex ]]; then
@@ -201,7 +234,7 @@ inst_binary() {
BASE=${FILE##*/}
# prefer nosegneg libs, then unoptimized ones.
for f in "$TLIBDIR/i686/nosegneg" "$TLIBDIR"; do
[[ -f $f/$BASE ]] || continue
[[ -e $f/$BASE ]] || continue
FILE=$f/$BASE
break
done
@@ -237,10 +270,10 @@ inst_symlink() {
inst "$realsrc" && ln -s "$realsrc" "$target"
}
# find a rule in the usual places.
# find a udev rule in the usual places.
find_rule() {
[[ -f $1 ]] && { echo "$1"; return 0; }
for r in . /lib/udev/rules.d /etc/udev/rules.d $dsrc/rules.d; do
for r in . /lib/udev/rules.d /etc/udev/rules.d $dracutbasedir/rules.d; do
[[ -f $r/$1 ]] && { echo "$r/$1"; return 0; }
done
return 1
@@ -250,7 +283,8 @@ find_rule() {
# create a function to install them to make life simpler.
inst_rules() {
local target=/etc/udev/rules.d
mkdir -p "$initdir/lib/udev/rules.d" "$initdir$target"
inst_dir "/lib/udev/rules.d"
inst_dir "$target"
for rule in "$@"; do
rule=$(find_rule "$rule") && \
inst_simple "$rule" "$target/${rule##*/}"
@@ -319,7 +353,7 @@ check_module_deps() {
# if we are already set to be loaded, we do not have to be checked again.
strstr "$mods_to_load" " $1 " && return
# turn a module name into a directory, if we can.
moddir=$(echo ${dsrc}/modules.d/??${1})
moddir=$(echo ${dracutbasedir}/modules.d/??${1})
[[ -d $moddir && -x $moddir/install ]] || return 1
# if we do not have a check script, we are unconditionally included
if [[ -x $moddir/check ]]; then
@@ -353,7 +387,7 @@ should_source_module() {
}
check_modules() {
for moddir in "$dsrc/modules.d"/[0-9][0-9]*; do
for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
local mod=${moddir##*/}; mod=${mod#[0-9][0-9]}
# If we are already scheduled to be loaded, no need to check again.
strstr "$mods_to_load" " $mod " && continue
@@ -373,7 +407,7 @@ check_modules() {
# $1 = full path to kernel module to install
install_kmod_with_fw() {
local modname=${1##*/} fwdir found
modname=${modname%.ko}
modname=${modname%.ko*}
inst_simple "$1" "/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" || \
return 0 # no need to go further if the module is already installed
for fw in $(modinfo -k $kernel -F firmware $1 2>/dev/null); do
@@ -385,7 +419,7 @@ install_kmod_with_fw() {
fi
done
if [[ $found != yes ]]; then
dwarning "Possible missing firmware ${fw} for module ${mod}.ko"
dinfo "Possible missing firmware ${fw} for module ${mod}.ko"
fi
done
}
@@ -406,7 +440,7 @@ for_each_kmod_dep() {
done
}
# filter kernel modules to install certian modules that meet specific
# filter kernel modules to install certain modules that meet specific
# requirements.
# $1 = function to call with module name to filter.
# This function will be passed the full path to the module to test.
@@ -415,13 +449,22 @@ for_each_kmod_dep() {
# If it is not, we will look at all kernel modules
# This function returns the full filenames of modules that match $1
filter_kernel_modules () (
if [[ $hostonly = '' ]]; then
filtercmd='find "$srcmods/kernel/drivers" -name "*.ko"'
if ! [[ $hostonly ]]; then
filtercmd='find "$srcmods/kernel/drivers" -name "*.ko" -o -name "*.ko.gz"'
else
filtercmd='cut -d " " -f 1 </proc/modules|xargs modinfo -F filename -k $kernel'
fi
for modname in $(eval $filtercmd); do
"$1" "$modname" && echo "$modname"
case $modname in
*.ko)
"$1" "$modname" && echo "$modname"
;;
*.ko.gz)
gzip -dc "$modname" > $initdir/$$.ko
$1 $initdir/$$.ko && echo "$modname"
rm -f $initdir/$$.ko
;;
esac
done
)
@@ -430,7 +473,7 @@ instmods() {
[[ $no_kernel = yes ]] && return
local mod mpargs modpath modname cmd
while (($# > 0)); do
mod=${1%.ko}
mod=${1%.ko*}
case $mod in
=*) # This introduces 2 incompatible meanings for =* arguments
# to instmods. We need to decide which one to keep.
@@ -456,7 +499,8 @@ instmods() {
[[ -f $initdir/$1 ]] && { shift; continue; }
# If we are building a host-specific initramfs and this
# module is not already loaded, move on to the next one.
[[ $hostonly ]] && ! grep -q "$mod" /proc/modules && {
[[ $hostonly ]] && ! grep -q "${mod//-/_}" /proc/modules && \
! echo $add_drivers | grep -qe "\<${mod}\>" && {
shift; continue;
}
# ok, load the module, all its dependencies, and any firmware

View File

@@ -19,6 +19,39 @@
#
#. /usr/libexec/initrd-functions
IF_verbose=""
function set_verbose() {
case $1 in
1|true|yes|on)
IF_verbose="-v"
;;
0|false|no|off)
IF_verbose=""
;;
esac
}
function is_verbose() {
[ -n "$IF_verbose" ] && return 0
return 1
}
function get_verbose() {
echo "$IF_verbose"
is_verbose
}
function get_numeric_dev() {
(
fmt="%d:%d"
if [ "$1" == "hex" ]; then
fmt="%x:%x"
fi
ls -lH "$2" | awk '{ sub(/,/, "", $5); printf("'"$fmt"'", $5, $6); }'
) 2>/dev/null
}
function error() {
echo "$@" >&2
@@ -119,13 +152,21 @@ qpopd() {
popd >/dev/null 2>&1
}
resolve_device_name() {
echo "$1"
# echo "resolve_device_name $1" 1>&2
}
freadlink() {
/usr/bin/readlink -f "$1"
readlink -f "$1"
}
resolve_device_name() {
if [ -z "${1##UUID=*}" ]; then
real=$(freadlink /dev/disk/by-uuid/${1##UUID=})
[ -b $real ] && { echo $real; return; }
fi
if [ -z "${1##LABEL=*}" ]; then
real=$(freadlink /dev/disk/by-label/${1##LABEL=})
[ -b $real ] && { echo $real; return; }
fi
echo "$1"
}
finddevnoinsys() {
@@ -171,7 +212,7 @@ findstoragedriverinsys () {
sysfs=$(freadlink ${sysfs%/*})
fi
if [[ ! "$sysfs" =~ '^/sys/.*block/.*$' ]]; then
if [[ ! "$sysfs" =~ ^/sys/.*block/.*$ ]]; then
#error "WARNING: $sysfs is a not a block sysfs path, skipping"
return
fi
@@ -182,12 +223,12 @@ findstoragedriverinsys () {
*) handleddevices="$handleddevices $sysfs" ;;
esac
if [[ "$sysfs" =~ '^/sys/.*block/md[0-9]+$' ]]; then
if [[ "$sysfs" =~ ^/sys/.*block/md[0-9]+$ ]]; then
local raid=${sysfs##*/}
vecho "Found MDRAID component $raid"
handleraid $raid
fi
if [[ "$sysfs" =~ '^/sys/.*block/dm-[0-9]+$' ]]; then
if [[ "$sysfs" =~ ^/sys/.*block/dm-[0-9]+$ ]]; then
vecho "Found DeviceMapper component ${sysfs##*/}"
handledm $(cat $sysfs/dev |cut -d : -f 1) $(cat $sysfs/dev |cut -d : -f 2)
fi
@@ -571,9 +612,7 @@ done
else
# check if it's root by label
rdev=$rootdev
if [[ "$rdev" =~ ^(UUID=|LABEL=) ]]; then
rdev=$(resolve_device_name "$rdev")
fi
rdev=$(resolve_device_name "$rdev")
rootopts=$(echo $rootopts | sed -e 's/^r[ow],//' -e 's/,_netdev//' -e 's/_netdev//' -e 's/,r[ow],$//' -e 's/,r[ow],/,/' -e 's/^r[ow]$/defaults/' -e 's/$/,ro/')
findstoragedriver "$rdev"
fi
@@ -582,9 +621,7 @@ done
[ -z "$thawdev" ] && thawdev=$(awk '/^[ \t]*[^#]/ { if ($3 == "swap") { print $1; exit }}' $fstab)
swsuspdev="$thawdev"
if [ -n "$swsuspdev" ]; then
if [[ "$swsuspdev" =~ ^(UUID=|LABEL=) ]]; then
swsuspdev=$(resolve_device_name "$swsuspdev")
fi
swsuspdev=$(resolve_device_name "$swsuspdev")
findstoragedriver "$swsuspdev"
fi
@@ -629,35 +666,37 @@ emitcrypto()
echo -n "rd_LUKS_UUID=$luksuuid "
}
for cryptdev in ${!cryptopart@} ; do
emitcrypto `eval echo '$'$cryptdev`
done
if [ -n "$raiddevices" ]; then
for dev in $raiddevices; do
uid=$(udevadm info --query=all --name=/dev/${dev}|grep MD_UUID)
uid=$(IFS="=";set $uid;echo $2)
echo -n "rd_MD_UUID=$uid "
uid=$(udevadm info --query=env --name /dev/${dev}|grep MD_UUID)
uid=${uid##MD_UUID=}
[ -n "$uid" ] && echo -n "rd_MD_UUID=$uid "
done
else
echo -n "rd_NO_MD "
fi
for cryptdev in ${!cryptoraid@} ; do
emitcrypto `eval echo '$'$cryptdev`
done
if [ -z "$nolvm" -a -n "$vg_list" ]; then
for vg in $vg_list; do
echo -n "rd_LVM_VG=$vg "
done
else
echo -n "rd_NO_LVM "
fi
for cryptdev in ${!cryptolv@} ; do
emitcrypto `eval echo '$'$cryptdev`
done
cryptdevs="$(echo ${!cryptoraid@} ${!cryptopart@} ${!cryptolv@})"
if [ -z "$cryptdevs" ]; then
echo -n "rd_NO_LUKS "
else
for cryptdev in ${!cryptoraid@} ${!cryptopart@} ${!cryptolv@} ; do
emitcrypto `eval echo '$'$cryptdev`
done
fi
# output local keyboard/18n settings
. /etc/sysconfig/keyboard
. /etc/sysconfig/i18n
[ -e /etc/sysconfig/keyboard ] && . /etc/sysconfig/keyboard
[ -e /etc/sysconfig/i18n ] && . /etc/sysconfig/i18n
for i in KEYTABLE SYSFONT SYSFONTACM UNIMAP LANG; do
val=$(eval echo \$$i)
@@ -672,13 +711,5 @@ if [ -n "$rootdev" ]; then
echo -n "root=$rootdev "
fi
if [ -L /usr/share/plymouth/themes/default.plymouth ]; then
theme=$(basename \
$(dirname \
$(readlink -f \
/usr/share/plymouth/themes/default.plymouth)))
[ -n "$theme" ] && echo -n "rd_plytheme=$theme "
fi
echo
# vim:ts=8:sw=4:sts=4:et

20
dracut-gencmdline.8 Normal file
View File

@@ -0,0 +1,20 @@
.TH DRACUT-GENCMDLINE 8 "June 2009" "Linux"
.SH NAME
dracut-gencmdline \- generates kernel command line parameters for the dracut generated initramfs
.SH SYNOPSIS
.BR dracut-gencmdline
.SH DESCRIPTION
.B dracut-gencmdline
generates kernel command line parameters for the dracut generated initramfs, which are very specific to the host system.
.SH AUTHORS
.nf
Harald Hoyer <harald@redhat.com>
.fi
.SH AVAILABILITY
The dracut-gencmdline command is part of the dracut package and is available from
http://sourceforge.net/apps/trac/dracut/wiki
.SH SEE ALSO
.BR dracut (8)

558
dracut-update-initramfs Executable file
View File

@@ -0,0 +1,558 @@
#!/bin/sh
STATEDIR=/var/lib/dracut
BOOTDIR=/boot
CONF=/etc/dracut.conf
KPKGCONF=/etc/kernel-img.conf
USETRIGGERS=true
mode=""
version=""
set -e
if $USETRIGGERS \
&& [ x"$DPKG_MAINTSCRIPT_PACKAGE" != x ] \
&& [ $# = 1 ] \
&& [ x"$1" = x-u ] \
&& dpkg-trigger --check-supported 2>/dev/null
then
if dpkg-trigger --no-await update-initramfs; then
echo "dracut-update-initramfs: deferring update (trigger activated)"
exit 0
fi
fi
usage()
{
if [ -n "${1}" ]; then
printf "${@}\n\n" >&2
fi
cat >&2 << EOF
Usage: ${0} [OPTION]...
Options:
-k [version] Specify kernel version or 'all'
-c Create a new initramfs
-u Update an existing initramfs
-d Remove an existing initramfs
-t Take over a custom initramfs with this one
-b Set alternate boot directory
-v Be verbose
-h This message
EOF
exit 1
}
# chroot check
chrooted()
{
# borrowed from udev's postinst
if [ "$(stat -c %d/%i /)" = "$(stat -Lc %d/%i /proc/1/root 2>/dev/null)" ]; then
# the devicenumber/inode pair of / is the same as that of
# /sbin/init's root, so we're *not* in a chroot and hence
# return false.
return 1
fi
return 0
}
mild_panic()
{
if [ -n "${1}" ]; then
printf "${@}\n" >&2
fi
exit 0
}
panic()
{
if [ -n "${1}" ]; then
printf "${@}\n" >&2
fi
exit 1
}
verbose()
{
if [ "${verbose}" = 1 ]; then
printf "${@}\n"
fi
}
version_exists()
{
[ -e "${STATEDIR}/${1}" ] && [ -e "${initramfs}" ]
return $?
}
set_initramfs()
{
initramfs="${BOOTDIR}/dracut.img-${version}"
}
# backup initramfs while running
backup_initramfs()
{
[ ! -r "${initramfs}" ] && return 0
initramfs_bak="${initramfs}.dpkg-bak"
[ -r "${initramfs_bak}" ] && rm -f "${initramfs_bak}"
ln -f "${initramfs}" "${initramfs_bak}" \
|| cp -a "${initramfs}" "${initramfs_bak}"
verbose "Keeping ${initramfs_bak}"
}
# keep booted initramfs
backup_booted_initramfs()
{
initramfs_bak="${initramfs}.dpkg-bak"
# first time run thus no backup
[ ! -r "${initramfs_bak}" ] && return 0
# chroot with no /proc
[ ! -r /proc/uptime ] && rm -f "${initramfs_bak}" && return 0
# no kept backup wanted
[ "${backup_initramfs}" = "no" ] && rm -f "${initramfs_bak}" && return 0
# no backup yet
if [ ! -r "${initramfs}.bak" ]; then
mv -f ${initramfs_bak} "${initramfs}.bak"
verbose "Backup ${initramfs}.bak"
return 0
fi
# keep booted initramfs
uptime_days=$(awk '{printf "%d", $1 / 3600 / 24}' /proc/uptime)
if [ -n "$uptime_days" ]; then
boot_initramfs=$(find "${initramfs}.bak" -mtime +${uptime_days})
fi
if [ -n "${boot_initramfs}" ]; then
mv -f "${initramfs_bak}" "${initramfs}.bak"
verbose "Backup ${initramfs}.bak"
return 0
fi
verbose "Removing current backup ${initramfs_bak}"
rm -f ${initramfs_bak}
}
# nuke generated copy
remove_initramfs()
{
[ -z "${initramfs_bak}" ] && return 0
rm -f "${initramfs_bak}"
verbose "Removing ${initramfs_bak}"
}
generate_initramfs()
{
echo "dracut-update-initramfs: Generating ${initramfs}"
OPTS=""
if [ "${verbose}" = 1 ]; then
OPTS="-v ${OPTS}"
fi
##WORK HERE!
if dracut ${OPTS} "${initramfs}.new" "${version}"; then
mv -f "${initramfs}.new" "${initramfs}"
set_sha1
else
mkinitramfs_return="$?"
remove_initramfs
rm -f "${initramfs}.new"
if [ "$mkinitramfs_return" = "2" ]; then
# minversion wasn't met, exit 0
exit 0
fi
echo "update-initramfs: failed for ${initramfs}"
exit $mkinitramfs_return
fi
}
# lilo call
run_lilo()
{
# show lilo errors on failure
if ! lilo -t > /dev/null 2>&1 ; then
echo "ERROR lilo fails for new ${initramfs}:"
echo
lilo -t
fi
lilo
}
# check if lilo is on mbr
mbr_check()
{
# try to discover grub|grub2 and be happy
[ -r /boot/grub/grub.cfg ] \
&& groot=$(awk '/^set root=/{print substr($2, 7, 3); exit}' \
/boot/grub/grub.cfg)
[ -r /boot/grub/menu.lst ] \
&& groot=$(awk '/^root/{print substr($2, 2, 3); exit}' \
/boot/grub/menu.lst)
[ -e /boot/grub/device.map ] && [ -n "${groot}" ] \
&& dev=$(awk "/${groot}/{ print \$NF}" /boot/grub/device.map)
[ -n "${dev}" ] && [ -r ${dev} ] \
&& dd if="${dev}" bs=512 skip=0 count=1 2> /dev/null \
| grep -q GRUB && return 0
# check out lilo.conf for validity
boot=$(awk -F = '/^boot=/{ print $2}' /etc/lilo.conf)
[ -z "${boot}" ] && return 0
case ${boot} in
/dev/md/*)
if [ -r /proc/mdstat ]; then
MD=${boot#/dev/md/}
boot="/dev/$(awk "/^md${MD}/{print substr(\$5, 1, 3)}" \
/proc/mdstat)"
fi
;;
/dev/md*)
if [ -r /proc/mdstat ]; then
MD=${boot#/dev/}
boot="/dev/$(awk "/^${MD}/{print substr(\$5, 1, 3)}" \
/proc/mdstat)"
fi
;;
esac
[ ! -r "${boot}" ] && return 0
dd if="${boot}" bs=512 skip=0 count=1 2> /dev/null | grep -q LILO \
&& run_lilo && return 0
# no idea which bootloader is used
echo
echo "WARNING: grub and lilo installed."
echo "If you use grub as bootloader everything is fine."
echo "If you use lilo as bootloader you must run lilo!"
echo
}
# Invoke bootloader
run_bootloader()
{
# if both lilo and grub around, figure out if lilo needs to be run
if ( command -v update-grub >/dev/null 2>&1 \
|| [ -e /boot/grub/menu.lst ] || [ -e /boot/grub/grub.cfg ] ) \
&& ( [ -e /etc/lilo.conf ] && command -v lilo >/dev/null 2>&1 ); then
[ -r "${KPKGCONF}" ] && \
do_b=$(awk '/^do_bootloader/{print $3}' "${KPKGCONF}")
if [ "${do_b}" = "yes" ] || [ "${do_b}" = "Yes" ] \
|| [ "${do_b}" = "YES" ]; then
run_lilo
return 0
elif [ "${do_b}" = "no" ] || [ "${do_b}" = "No" ] \
|| [ "${do_b}" = "NO" ]; then
return 0
fi
# do_bootloader unconfigured
mbr_check
return 0
fi
if [ -r /etc/lilo.conf ] && command -v lilo >/dev/null 2>&1; then
run_lilo
return 0
fi
if command -v elilo >/dev/null 2>&1; then
elilo
return 0
fi
if [ -r /etc/zipl.conf ]; then
zipl
fi
if flash-kernel --supported >/dev/null 2>&1; then
flash-kernel ${version}
fi
}
compare_sha1()
{
sha1sum "${initramfs}" | diff "${STATEDIR}/${version}" - >/dev/null 2>&1
return $?
}
# Note that this must overwrite so that updates work.
set_sha1()
{
sha1sum "${initramfs}" > "${STATEDIR}/${version}"
}
delete_sha1()
{
rm -f "${STATEDIR}/${version}"
}
# ro /boot is not modified
ro_boot_check()
{
# check irrelevant inside of a chroot
if [ ! -r /proc/mounts ] || chrooted; then
return 0
fi
boot_opts=$(awk '/boot/{if ((match($4, /^ro/) || match($4, /,ro/)) \
&& $2 == "/boot") print "ro"}' /proc/mounts)
if [ -n "${boot_opts}" ]; then
echo "WARNING: /boot is ro mounted."
echo "update-initramfs: Not updating ${initramfs}"
exit 0
fi
}
get_sorted_versions()
{
version_list=""
for gsv_x in "${STATEDIR}"/*; do
gsv_x="$(basename "${gsv_x}")"
if [ "${gsv_x}" = '*' ]; then
return 0
fi
worklist=""
for gsv_i in $version_list; do
if dpkg --compare-versions "${gsv_x}" '>' "${gsv_i}"; then
worklist="${worklist} ${gsv_x} ${gsv_i}"
gsv_x=""
else
worklist="${worklist} ${gsv_i}"
fi
done
if [ "${gsv_x}" != "" ]; then
worklist="${worklist} ${gsv_x}"
fi
version_list="${worklist}"
done
verbose "Available versions: ${version_list}"
}
set_current_version()
{
if [ -f /boot/dracut.img-`uname -r` ]; then
version=`uname -r`
fi
}
set_linked_version()
{
if [ -e /initrd.img ] && [ -L /initrd.img ]; then
linktarget="$(basename "$(readlink /initrd.img)")"
fi
if [ -e /boot/initrd.img ] && [ -L /boot/initrd.img ]; then
linktarget="$(basename "$(readlink /boot/initrd.img)")"
fi
if [ -z "${linktarget}" ]; then
return
fi
version="${linktarget##*img-}"
}
set_highest_version()
{
get_sorted_versions
set -- ${version_list}
version=${1}
}
create()
{
if [ -z "${version}" ]; then
usage "Create mode requires a version argument"
fi
set_initramfs
if [ "${takeover}" = 0 ]; then
if version_exists "${version}"; then
panic "Cannot create version ${version}: already exists"
fi
if [ -e "${initramfs}" ]; then
panic "${initramfs} already exists, cannot create."
fi
fi
generate_initramfs
}
update()
{
if [ "${update_initramfs}" = "no" ]; then
echo "update-initramfs: Not updating initramfs."
exit 0
fi
if [ -z "${version}" ]; then
set_highest_version
fi
if [ -z "${version}" ]; then
set_linked_version
fi
if [ -z "${version}" ]; then
set_current_version
fi
if [ -z "${version}" ]; then
verbose "Nothing to do, exiting."
exit 0
fi
set_initramfs
ro_boot_check
altered_check
backup_initramfs
generate_initramfs
run_bootloader
backup_booted_initramfs
}
delete()
{
if [ -z "${version}" ]; then
usage "Delete mode requires a version argument"
fi
set_initramfs
if [ ! -e "${initramfs}" ]; then
panic "Cannot delete ${initramfs}, doesn't exist."
fi
if ! version_exists "${version}"; then
panic "Cannot delete version ${version}: Not created by this utility."
fi
altered_check
echo "update-initramfs: Deleting ${initramfs}"
delete_sha1
rm -f "${initramfs}"
}
# Check for update mode on existing and modified initramfs
altered_check()
{
# No check on takeover
[ "${takeover}" = 1 ] && return 0
if [ ! -e "${initramfs}" ]; then
mild_panic "${initramfs} does not exist. Cannot update."
fi
if ! compare_sha1; then
echo "update-initramfs: ${initramfs} has been altered." >&2
mild_panic "update-initramfs: Cannot update. Override with -t option."
fi
}
# Defaults
verbose=0
yes=0
# We default to takeover=1 in Ubuntu, but not Debian
takeover=0
##
while getopts "k:cudyvtb:h?" flag; do
case "${flag}" in
k)
version="${OPTARG}"
;;
c)
mode="c"
;;
d)
mode="d"
;;
u)
mode="u"
;;
v)
verbose="1"
;;
y)
yes="1"
;;
t)
takeover="1"
;;
b)
BOOTDIR="${OPTARG}"
if [ ! -d "${BOOTDIR}" ]; then
echo "Error: ${BOOTDIR} is not a directory."
exit 1
fi
;;
h|?)
usage
;;
esac
done
shift $((${OPTIND} - 1))
if [ $# -ne 0 ]; then
echo "Invalid argument for option -k."
usage
fi
# Validate arguments
if [ -z "${mode}" ]; then
usage "You must specify at least one of -c, -u, or -d."
fi
if [ "${version}" = "all" ] \
|| ( [ "${update_initramfs}" = "all" ] && [ -z "${version}" ] ); then
: FIXME check for --yes, and if not ask are you sure
get_sorted_versions
if [ -z "${version_list}" ]; then
verbose "Nothing to do, exiting."
exit 0
fi
OPTS="-b ${BOOTDIR}"
if [ "${verbose}" = "1" ]; then
OPTS="${OPTS} -v"
fi
if [ "${takeover}" = "1" ]; then
OPTS="${OPTS} -t"
fi
if [ "${yes}" = "1" ]; then
OPTS="${OPTS} -y"
fi
for u_version in ${version_list}; do
# Don't stop if one version doesn't work.
set +e
verbose "Execute: ${0} -${mode} -k \"${u_version}\" ${OPTS}"
"${0}" -${mode} -k "${u_version}" ${OPTS}
set -e
done
exit 0
fi
case "${mode}" in
c)
create
;;
d)
delete
;;
u)
update
;;
esac

356
dracut.8
View File

@@ -1,16 +1,16 @@
.TH DRACUT 8 "June 2009" "Linux"
.SH NAME
switch_root \- switch to another filesystem as the root of the mount tree.
dracut \- create initial ramdisk images for preloading modules
.SH SYNOPSIS
\fBdracut\fR [\fIOPTION\fR]... \fI<image>\fR \fI<kernel-version>\fR
.SH DESCRIPTION
.B switch_root
\fBdracut\fR creates an initial image used by the kernel for
.B 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.
.SH OPTIONS
.SS Options
.TP
.BR \-f ", " \-\-force
overwrite existing initramfs file.
@@ -28,10 +28,15 @@ omit a space-separated list of dracut modules.
add a space-separated list of dracut modules.
.TP
.BR \-d ", " \-\-drivers " \fILIST\fR"
specify a space-separated list of kernel modules to exclusively include in the initramfs.
specify a space-separated list of kernel modules to exclusively include#
in the initramfs.
.BR \-\-add-drivers " \fILIST\fR"
specify a space-separated list of kernel modules to add to the initramfs.
.TP
.BR \-\-filesystems " \fILIST\fR"
specify a space-separated list of kernel filesystem modules to exclusively
include in the generic initramfs.
.TP
.BR \-k ", " \-\-kmoddir " \fI{DIR}\fR
specify the directory, where to look for kernel modules
.TP
@@ -70,6 +75,11 @@ specify configuration file to use.
Default:
.IR /etc/dracut.conf
.TP
.BR \-\-confdir " \fIDIR\fR"
specify configuration directory to use.
Default:
.IR /etc/dracut.conf.d
.TP
.BR \-l ", " \-\-local
local mode. Use modules from the current working
directory instead of the system-wide installed in
@@ -87,7 +97,7 @@ target directory in the final initramfs.
.BR \-I ", " \-\-install " \fILIST\fR"
install the space separated list of files into the initramfs.
.SH KERNEL COMMAND LINE
.SH "KERNEL COMMAND LINE"
The root filesystem used by the kernel is specified in the boot configuration
file, as always. The traditional \fBroot=/dev/hda1\fR style device
specification is allowed. If a label is used, as in \fBroot=LABEL=rootPart\fR
@@ -96,112 +106,202 @@ with the appropriate label, and mount that device as the root filesystem.
\fBroot=UUID=uuidnumber\fR will mount the partition with that UUID as the
root filesystem.
.SH Standard
.SS Standard
.TP
.B init=<path to real init>
.BR init= "<path to real init>"
.TP
.B root=<path to blockdevice>
specify e.g. \fI/dev/sda1\fR or
\fI/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1\fR
.B rootfstype=<filesystem type>
"auto" if not specified, e.g. \fIrootfstype=ext3\fR
.B rootflags=<mount options>
specify additional mount options for the root filesystem
.SH I18N
e.g. LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=de-latin1-nodeadkeys
.BR root= "<path to blockdevice>"
specify blockdevice to use as root filesystem.
e.g.
root=/dev/sda1
root=/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1
.TP
.B KEYBOARDTYPE=sun|pc
.BR rootfstype= "<filesystem type>"
"auto" if not specified, e.g. rootfstype=ext3
.TP
.BR rootflags "=<mount options>"
specify additional mount options for the root filesystem. If not set, /etc/fstab
of the real root will be parsed for special mount options and mounted
accordingly.
.TP
.B rd_NO_FSTAB
do not honor special mount options for the root filesystem found in
/etc/fstab of the real root.
.SS Misc
.TP
.BR rdblacklist= <drivername>
do not load kernel module <drivername>
.TP
.BR rdloaddriver= <drivername>
force loading kernel module <drivername>
.SS Debug
.TP
.B rdinfo
print informational output though "quiet" is set
.TP
.B rdshell
allow dropping to a shell, if root mounting fails
.TP
.B rdinitdebug
set -x for the dracut shell and logs to dmesg, console and /init.log
.TP
.B rdbreak
drop to a shell at the end
.TP
.ad l
.BR rdbreak= \%{cmdline\:|pre-udev\:|pre-trigger\:|initqueue\:|pre-mount\:|mount\:|pre-pivot}
.ad
drop to a shell on defined breakpoint
.TP
.B rdudevinfo
set udev to loglevel info
.TP
.B rdudevdebug
set udev to loglevel debug
.TP
.B rdnetdebug
debug network scripts in dracut. Output is written to /tmp/
.SS I18N
e.g.
LANG=en_US.UTF-8
SYSFONT=latarcyrheb-sun16
KEYTABLE=de-latin1-nodeadkeys
.TP
.BR KEYBOARDTYPE= sun|pc
will be written to /etc/sysconfig/keyboard in the initramfs
.TP
.B KEYTABLE=<keytable filename>
.BR KEYTABLE= "<keytable filename>"
will be written to /etc/sysconfig/keyboard in the initramfs
.TP
.B SYSFONT= Console font
.BR SYSFONT= "Console font"
will be written to /etc/sysconfig/i18n in the initramfs
.TP
.B SYSFONTACM= Unicode font map
.BR SYSFONTACM= "Unicode font map"
will be written to /etc/sysconfig/i18n in the initramfs
.TP
.B UNIMAP= Unicode font map
.BR UNIMAP= "Unicode font map"
will be written to /etc/sysconfig/i18n in the initramfs
.TP
.B LANG=<locale>
.BR LANG= <locale>
will be written to /etc/sysconfig/i18n in the initramfs
.SH LVM
.SS LVM
.TP
.B rd_NO_LVM
.BR rd_NO_LVM
disable LVM detection
.TP
.B rd_LVM_VG=<volume group name>
.BR rd_LVM_VG= "<volume group name>"
only activate the volume groups with the given name
.SH crypto LUKS
rd_LVM_VG can be specified multiple times on the kernel command line.
.TP
.B rd_NO_LUKS
.BR rd_LVM_LV= "<logical volume name>"
only activate the volume groups with the given name
rd_LVM_LV can be specified multiple times on the kernel command line.
.TP
.BR rd_NO_LVMCONF
remove any /etc/lvm/lvm.conf, which may exist in the initramfs
.SS "crypto LUKS"
.TP
.BR rd_NO_LUKS
disable crypto LUKS detection
.TP
.B rd_LUKS_UUID=<luks uuid>
.BR rd_LUKS_UUID= "<luks uuid>"
only activate the LUKS partitions with the given UUID
Any "luks-" of the LUKS UUID is removed before comparing to <luks uuid>.
The comparisons also matches, if <luks uuid> is only the beginning of the
LUKS UUID, so you don't have to specify the full UUID.
.BR rd_NO_CRYPTTAB
do not check if LUKS partition is in /etc/crypttab
.SH MD
.SS MD
.TP
.B rd_NO_MD
.BR rd_NO_MD
disable MD RAID detection
.TP
.B rd_NO_MDIMSM
.BR rd_NO_MDIMSM
no MD RAID for imsm/isw raids, use dmraid instead
.TP
.B rd_NO_MDADMCONF
.BR rd_NO_MDADMCONF
ignore mdadm.conf included in initramfs
.TP
.B rd_MD_UUID=<md uuid>
.BR rd_MD_UUID= "<md uuid>"
only activate the raid sets with the given UUID
.SH DMRAID
.SS DMRAID
.TP
.B rd_NO_DM
.BR rd_NO_DM
disable DM RAID detection
.TP
.B rd_DM_UUID=<dmraid uuid>
.BR rd_DM_UUID= "<dmraid uuid>"
only activate the raid sets with the given UUID
.SH DASD
.SS Network
.TP
.B dasd=....
same syntax as the kernel module parameter (s390 only)
.BR ip= {dhcp|on|any|dhcp6|auto6}
dhcp|on|any: get ip from dhcp server from all interfaces. If root=dhcp,
loop sequentially through all interfaces (eth0, eth1, ...) and use the first
with a valid DHCP root-path.
.SH DHCP
auto6: do IPv6 autoconfiguration
.TP
.B root=dhcp
get IP from dhcp server, root-path option from dhcp specifies root location
.BR ip= <interface>:{dhcp|on|any|dhcp6|auto6}
dhcp|on|any|dhcp6: get ip from dhcp server on a specific interface
.SH NFS
auto6: do IPv6 autoconfiguration
.TP
.B root=[<server-ip>:]<root-dir>[:<nfs-options>]
.ad l
.BR ip= "\%<client-IP>\::[<server-id>]\::<gateway-IP>\::<netmask>\::<client\%hostname>\::<interface>\::{none|off}"
.ad
explicit network configuration. If you want do define a IPv6 address, put it in brackets (e.g. [2001:DB8::1]).
.TP
.BR ifname= <interface>:<MAC>
Assign network device name <interface> (ie eth0) to the NIC with MAC <MAC>.
Note letters in the MAC-address must be lowercase!
Note that if you use this option you \fBmust\fR specify an ifname= argument
for all interfaces used in ip= or fcoe= arguments
.TP
.BR bootdev= <interface>
specify network interface to use routing and netroot information from.
Required if multiple ip= lines are used.
.TP
.BR nameserver= "<IP> [nameserver=<IP> ...]"
specify nameserver(s) to use
.SS NFS
.TP
.BR root= "[<server-ip>:]<root-dir>[:<nfs-options>]"
mount nfs share from <server-ip>:/<root-dir>, if no server-ip is given,
use dhcp next_server.
NFS options can be appended with the prefix "." or ","
NFS options can be appended with the prefix ":" or "," and are seperated by ",".
.TP
.B root=nfs:[<server-ip>:]<root-dir>[:<nfs-options>]
.BR root= "nfs:[<server-ip>:]<root-dir>[:<nfs-options>]"
.TP
.B root=nfs4:[<server-ip>:]<root-dir>[:<nfs-options>]
.BR root= "nfs4:[<server-ip>:]<root-dir>[:<nfs-options>]"
.TP
.B root=dhcp
.BR root= dhcp|dhcp6
root=dhcp alone directs initrd to look at the DHCP root-path where NFS
options can be specified.
root-path=<server-ip>:<root-dir>[,<nfs-options>]
root-path=nfs:<server-ip>:<root-dir>[,<nfs-options>]
root-path=nfs4:<server-ip>:<root-dir>[,<nfs-options>]
.TP
.B root=/dev/nfs nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>]
.BR root= /dev/nfs " nfsroot=" "[<server-ip>:]<root-dir>[,<nfs-options>]"
\fBDeprecated!\fR kernel Documentation/filesystems/nfsroot.txt defines
this method.
This is supported by dracut but not recommended.
.SH iSCSI
.TP
.B root=iscsi:[username:password[reverse:password]@][<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname>
.BR rd_NFS_DOMAIN= "<NFSv4 domain name>"
Set the NFSv4 domain name. Will overwrite the settings in /etc/idmap.conf.
.SS iSCSI
.TP
.ad l
.BR root= "\%iscsi:[username:password\:[:reverse:password]@]\:[<servername>]\::[<protocol>]\::[<port>]\::[<LUN>]\::<targetname>"
.ad
protocol defaults to "6", LUN defaults to "0".
If the "servername" field is provided by BOOTP or DHCP, then that
@@ -214,115 +314,115 @@ associated fields.
http://tools.ietf.org/html/rfc4173
.TP
.B root=iscsi:[username:password[:reverse:password]@][<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname>
.ad l
.BR root= "\%iscsi:[username:password\:[:reverse:password]@]\:[<servername>]\::[<protocol>]\::[<port>]\::[<LUN>]\::<targetname>"
.ad
e.g. root=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0
.TP
.B root=??? netroot=iscsi:[username:password[:reverse:password]@][<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname> ...
.ad l
.BR root= ??? " netroot=" "\%iscsi:[username:password[:reverse:password]@]\:[<servername>]\::[<protocol>]\::[<port>]\::[<LUN>]\::<targetname> ..."
.ad
multiple netroot options allow setting up multiple iscsi disks
e.g.
root=UUID=12424547 netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0 netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target1
.B not yet implemented
.B Not yet implemented!
e.g.
root=UUID=12424547
netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0
netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target1
.TP
.B root=??? iscsi_initiator= iscsi_target_name= iscsi_target_ip= iscsi_target_port= iscsi_target_group= iscsi_username= iscsi_password= iscsi_in_username= iscsi_in_password=
.ad l
.BR \%root= \%??? " \%iscsi_initiator=" \%<initiator> " \%iscsi_target_name=" "<target name>" " \%iscsi_target_ip=" "<target ip>" " \%iscsi_target_port=" "<target port>" " \%iscsi_target_group=" "<target group>" " \%iscsi_username=" "<username>" " \%iscsi_password=" <password> " \%iscsi_in_username=" "<in username>" " \%iscsi_in_password=" "<in password>"
.ad
manually specify all iscsistart parameter (see \fIiscsistart\ --help\fR)
.TP
.B root=??? iscsi_firmware
.BR root= ??? " iscsi_firmware"
will read the iscsi parameter from the BIOS firmware
.SH FCoE
.SS FCoE
.TP
.B netroot=fcoe:<interface|MAC>:<dcb|nodcb>
.BR netroot= fcoe:<interface|MAC>:<dcb|nodcb>
Try to connect to a FCoE SAN through the NIC specified by <interface> or <MAC>,
for the second argument, currently only nodcb is supported. Note letters in
the MAC-address must be lowercase!
.SH NBD
.SS NBD
.TP
.B root=nbd:<server>:<port>[:<fstype>][:<mountopts>]
.BR root= nbd:<server>:<port>[:<fstype>][:<mountopts>]
mount nbd share from <server>
.TP
.B root=dhcp
with dhcp root-path=nbd:<server>:<port>[:<fstype>][:<mountopts>]
root=dhcp alone directs initrd to look at the DHCP root-path where NBD options can be specified.
This syntax is only usable in cases where you are directly mounting the volume as the rootfs.
.BR root= dhcp
with dhcp root-path=nbd:<server>:<port>[:<fstype>][:<mountopts>]
root=dhcp alone directs initrd to look at the DHCP root-path where NBD
options can be specified.
This syntax is only usable in cases where you are directly mounting the volume
as the rootfs.
.SH Network
.TP bootdev=<interface>
.B specify the network interface to boot from
.TP
.B ip={dhcp|on|any}
get ip from dhcp server from all interfaces. If root=dhcp, loop sequentially through all interfaces (eth0, eth1, ...) and use the first with a valid DHCP root-path.
.TP
.B ip=<interface>:{dhcp|on|any}
get ip from dhcp server on a specific interface
.TP
.B ip=<client-IP-number>:[<server-id>]:<gateway-IP-number>:<netmask>:<client-hostname>:<interface>:{none|off}
explicit network configuration
.SH Plymouth Boot Splash
.SS DASD
.TP
.B rd_NO_PLYMOUTH
.BR rd_DASD_MOD= ....
same syntax as the kernel module parameter (s390 only)
.TP
.ad l
.BR rd_DASD= "\%<dasd adaptor device bus ID>\:[,readonly=X]\:[,use_diag=X]\:[,erplog=X]\:[,failfast=X]"
.ad
activate DASD device with the given adaptor device bus ID and setting the sysfs attributes
to the specified values
.SS ZFCP
.TP
.BR rd_ZFCP= "<zfcp adaptor device bus ID>,\:<WWPN>,\:<FCPLUN>"
rd_ZFCP can be specified multiple times on the kernel command line.
example: rd_ZFCP=0.0.4000,0x5005076300C213e9,0x5022000000000000
.TP
.BR rd_NO_ZFCPCONF
ignore zfcp.conf included in the initramfs
.SS CCW
.TP
.BR rd_CCW= "<nettype>,<subchannels>,<options>"
rd_CCW can be specified multiple times on the kernel command line. Examples:
rd_CCW=qeth,0.0.0600,0.0.0601,0.0.0602,layer2=1,portname=foo
rd_CCW=ctc,0.0.0600,0.0.0601,0.0.0602,protocol=bar
.SS "Plymouth Boot Splash"
.TP
.BR rd_NO_PLYMOUTH
do not start plymouth. This will not work with encrypted partitions.
.SH FILES
.TP
.B ifname=<interface>:<MAC>
Assign network device name <interface> (ie eth0) to the NIC with MAC <MAC>.
Note letters in the MAC-address must be lowercase!
Note that if you use this option you \fBmust\fR specify an ifname= argument
for all interfaces used in ip= or fcoe= arguments
.SH Misc
.B /var/log/dracut.log
.TP
.B rdblacklist=<drivername>
do not load kernel module <drivername>
.SH Debug
.B /tmp/dracut.log
see \fBdracut.conf\fR(5)
.TP
.B rdinfo
print informational output though "quiet" is set
.TP
.B rdshell
allow dropping to a shell, if root mounting fails
.TP
.B rdinitdebug
set -x for the dracut shell
.TP
.B rdbreak
drop to a shell at the end
.TP
.B rdbreak={cmdline|pre-udev|pre-trigger|initqueue|pre-mount|mount|pre-pivot}
drop to a shell on defined breakpoint
.TP
.B rdudevinfo
set udev to loglevel info
.TP
.B rdudevdebug
set udev to loglevel debug
.TP
.B rdnetdebug
debug network scripts in dracut. Output is written to /tmp/
.SH CONFIGURATION IN INITRAMFS
.B /etc/dracut.conf
.SS "Configuration in the Initramfs"
.TP
.B /conf/conf.d/
Any files found in /conf/conf.d/ will be sourced in the initramfs to
set initial values. Command line options will override these values
set in the configuration files.
.TP
.B /etc/cmdline
Can contain additional command line options.
.SH AUTHORS
.nf
Andreas Thienemann <andreas@bawue.net>
Bill Nottingham <notting@redhat.com>
Dave Jones <davej@redhat.com>
David Dillow <dave@thedillows.org>
Harald Hoyer <harald@redhat.com>
Jeremy Katz <katzj@redhat.com>
Peter Jones <pjones@redhat.com>
Seewer Philippe <philippe.seewer@bfh.ch>
Victor Lowther <victor.lowther@gmail.com>
Warren Togami <wtogami@redhat.com>
Jeremy Katz <katzj@redhat.com>
Philippe Seewer <philippe.seewer@bfh.ch>
David Dillow <dave@thedillows.org>
.fi
.SH AVAILABILITY
The dracut command is part of the dracut package and is available from
https://sourceforge.net/apps/trac/dracut/wiki
http://sourceforge.net/apps/trac/dracut/wiki
.SH SEE ALSO
.BR dracut.conf (5)

View File

@@ -6,12 +6,21 @@
# Dracut modules to omit
#omit_dracutmodules=""
# Dracut modules to add to the default
#add_dracutmodules=""
# additional kernel modules to the default
#add_drivers=""
# list of kernel filesystem modules to be included in the generic initramfs
#filesystems=""
# build initrd only to boot current hardware
#hostonly="-h"
#hostonly="yes"
#
# install local /etc/mdadm.conf
mdadmconf="yes"
# install local /etc/lvm/lvm.conf
lvmconf="yes"

66
dracut.conf.5 Normal file
View File

@@ -0,0 +1,66 @@
.TH DRACUT.CONF 5 "NOV 2009" "Linux"
.SH NAME
dracut.conf \- configuration file for dracut
.SH SYNOPSIS
\fB/etc/dracut.conf\fR
.SH DESCRIPTION
.B dracut.conf
is loaded during the initialisation phase of dracut.
Command line parameter will overwrite any values set here.
.SH OPTIONS
.TP
.BR dracutmodules= \%"[LIST]"
Specify a space-separated list of dracut modules to
call when building the initramfs. Modules are located
in /usr/share/dracut/modules.d.
.TP
.BR omit_dracutmodules= \%"[LIST]"
Omit a space-separated list of dracut modules.
.TP
.BR add_dracutmodules= \%"[LIST]"
Add a space-separated list of dracut modules.
.TP
.BR drivers= \%"[LIST]"
Specify a space-separated list of kernel modules to
exclusively include in the initramfs.
.TP
.BR add_drivers= \%"[LIST]"
Specify a space-separated list of kernel
modules to add to the initramfs.
.TP
.BR filesystems= \%"[LIST]"
Specify a space-separated list of kernel filesystem
modules to exclusively include in the generic
initramfs.
.TP
.BR drivers_dir= \%"<dir>"
Specify the directory, where to look for kernel modules
.TP
.BR fw_dir= \%"<dir>[:<dir>\ ...]"
Specify additional directories, where to look for firmwares, separated by :
.TP
.BR do_strip= \%"yes|no"
Strip binaries in the initramfs (default=yes)
.TP
.BR hostonly= \%"yes|no"
Host-Only mode: Install only what is needed for booting
the local host instead of a generic host.
.TP
.BR mdadmconf= \%"yes|no"
Include local /etc/mdadm.conf (default=yes)
.TP
.BR lvmconf= \%"yes|no"
Include local /etc/lvm/lvm.conf (default=yes)
.TP
.BR kernel_only= "yes|no"
Only install kernel drivers and firmware files. (default=no)
.TP
.BR no_kernel= \%"yes|no"
Do not install kernel drivers and firmware files (default=no)
.SH SEE ALSO
.BR dracut (8)

View File

@@ -1,8 +1,15 @@
%if 0%{?fedora} < 12
%define with_switch_root 1
%else
# Variables must be defined
%define with_switch_root 1
%define with_nbd 1
# switchroot provided by util-linux-ng in F-12+
%if 0%{?fedora} > 11 || 0%{?rhel} >= 6
%define with_switch_root 0
%endif
# nbd in Fedora only
%if 0%{?rhel} >= 6
%define with_nbd 0
%endif
%if %{defined gittag}
%define rdist .git%{gittag}%{?dist}
@@ -12,14 +19,28 @@
%endif
Name: dracut
Version: 002
Version: 005
Release: 1%{?rdist}
Summary: Initramfs generator using udev
Group: System Environment/Base
License: GPLv2+
Group: System Environment/Base
License: GPLv2+
URL: http://apps.sourceforge.net/trac/dracut/wiki
# Source can be generated by
# http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=snapshot;h=%{?dashgittag};sf=tgz
Source0: dracut-%{version}%{?dashgittag}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%if 0%{?fedora} > 12 || 0%{?rhel} >= 6
# no "provides", because dracut does not offer
# all functionality of the obsoleted packages
Obsoletes: mkinitrd <= 6.0.93
Obsoletes: mkinitrd-devel <= 6.0.93
Obsoletes: nash <= 6.0.93
Obsoletes: libbdevid-python <= 6.0.93
%endif
Obsoletes: dracut-kernel < 005
Provides: dracut-kernel = %{version}-%{release}
Requires: udev
Requires: util-linux-ng
Requires: module-init-tools >= 3.7-9
@@ -37,8 +58,10 @@ Requires: /bin/sh
Requires: fileutils, gzip, tar
Requires: lvm2 >= 2.02.33-9, dhclient
Requires: filesystem >= 2.1.0, cpio, device-mapper, initscripts >= 8.63-1
Requires: e2fsprogs >= 1.38-12, libselinux, libsepol, coreutils
Requires: mdadm, elfutils-libelf, plymouth >= 0.7.0
Requires: e2fsprogs >= 1.38-12, coreutils
Requires: mdadm, elfutils-libelf
Requires(pre): plymouth >= 0.8.0-0.2009.29.09.19.1
Requires: plymouth >= 0.8.0-0.2009.29.09.19.1
Requires: cryptsetup-luks
Requires: file
Requires: bzip2
@@ -52,14 +75,20 @@ BuildArch: noarch
%endif
%description
dracut is a new, event-driven initramfs infrastructure based around udev.
Dracut contains tools to create a bootable initramfs for 2.6 Linux kernels.
Unlike existing implementations, dracut does hard-code as little as possible
into the initramfs. Dracut contains various modules which are driven by the
event-based udev. Having root on MD, DM, LVM2, LUKS is supported as well as
NFS, iSCSI, NBD, FCoE with the dracut-network package.
%package network
Summary: dracut modules to build a dracut initramfs with network support
Summary: Dracut modules to build a dracut initramfs with network support
Requires: %{name} = %{version}-%{release}
Requires: rpcbind nfs-utils
Requires: iscsi-initiator-utils
%if %{with_nbd}
Requires: nbd
%endif
Requires: net-tools iproute
Requires: bridge-utils
@@ -67,6 +96,22 @@ Requires: bridge-utils
This package requires everything which is needed to build a generic
all purpose initramfs with network support with dracut.
%package fips
Summary: Dracut modules to build a dracut initramfs with an integrity check
Requires: %{name} = %{version}-%{release}
Requires: hmaccalc
%if 0%{?rhel} > 5
# For Alpha 3, we want nss instead of nss-softokn
Requires: nss
%else
Requires: nss-softokn
%endif
Requires: nss-softokn-freebl
%description fips
This package requires everything which is needed to build an
all purpose initramfs with dracut, which does an integrity check.
%package generic
Summary: Metapackage to build a generic initramfs with dracut
Requires: %{name} = %{version}-%{release}
@@ -76,22 +121,8 @@ Requires: %{name}-network = %{version}-%{release}
This package requires everything which is needed to build a generic
all purpose initramfs with dracut.
%package kernel
Summary: Metapackage to build generic initramfs with dracut with only kernel modules
Requires: %{name} = %{version}-%{release}
Requires: ql2100-firmware
Requires: ql2200-firmware
Requires: ql23xx-firmware
Requires: ql2400-firmware
Requires: ql2500-firmware
%description kernel
This package requires everything which is needed to build a initramfs with all
kernel modules and firmware files needed by dracut modules.
%package tools
Summary: dracut tools to build the local initramfs
Summary: Dracut tools to build the local initramfs
Requires: coreutils cryptsetup-luks device-mapper
Requires: diffutils dmraid findutils gawk grep lvm2
Requires: module-init-tools sed
@@ -104,21 +135,25 @@ This package contains tools to assemble the local initrd and host configuration.
%setup -q -n %{name}-%{version}%{?dashgittag}
%build
make
make WITH_SWITCH_ROOT=0%{?with_switch_root}
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT sbindir=/sbin \
sysconfdir=/etc mandir=%{_mandir}
sysconfdir=/etc mandir=%{_mandir} WITH_SWITCH_ROOT=0%{?with_switch_root}
echo %{name}-%{version}-%{release} > $RPM_BUILD_ROOT/%{_datadir}/dracut/modules.d/10rpmversion/dracut-version
%if ! 0%{?with_switch_root}
rm -f $RPM_BUILD_ROOT/sbin/switch_root
%endif
rm $RPM_BUILD_ROOT/%{_datadir}/dracut/modules.d/01fips/check
mkdir -p $RPM_BUILD_ROOT/boot/dracut
mkdir -p $RPM_BUILD_ROOT/var/lib/dracut/overlay
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log
touch $RPM_BUILD_ROOT%{_localstatedir}/log/dracut.log
%if 0%{?fedora} <= 12 && 0%{?rhel} < 6
rm $RPM_BUILD_ROOT/sbin/mkinitrd
rm $RPM_BUILD_ROOT/sbin/lsinitrd
%endif
%clean
rm -rf $RPM_BUILD_ROOT
@@ -130,41 +165,59 @@ rm -rf $RPM_BUILD_ROOT
%if 0%{?with_switch_root}
/sbin/switch_root
%endif
%if 0%{?fedora} > 12 || 0%{?rhel} >= 6
/sbin/mkinitrd
/sbin/lsinitrd
%endif
%dir %{_datadir}/dracut
%{_datadir}/dracut/dracut-functions
%config(noreplace) /etc/dracut.conf
%dir /etc/dracut.conf.d
%{_mandir}/man8/dracut.8*
%{_mandir}/man5/dracut.conf.5*
%{_datadir}/dracut/modules.d/00dash
%{_datadir}/dracut/modules.d/10redhat-i18n
%{_datadir}/dracut/modules.d/10rpmversion
%{_datadir}/dracut/modules.d/50plymouth
%{_datadir}/dracut/modules.d/60xen
%{_datadir}/dracut/modules.d/90crypt
%{_datadir}/dracut/modules.d/90dm
%{_datadir}/dracut/modules.d/90dmraid
%{_datadir}/dracut/modules.d/90dmsquash-live
%{_datadir}/dracut/modules.d/90kernel-modules
%{_datadir}/dracut/modules.d/90lvm
%{_datadir}/dracut/modules.d/90mdraid
%{_datadir}/dracut/modules.d/90multipath
%{_datadir}/dracut/modules.d/95debug
%{_datadir}/dracut/modules.d/95resume
%{_datadir}/dracut/modules.d/95rootfs-block
%{_datadir}/dracut/modules.d/95s390
%{_datadir}/dracut/modules.d/95dasd
%{_datadir}/dracut/modules.d/95dasd_mod
%{_datadir}/dracut/modules.d/95zfcp
%{_datadir}/dracut/modules.d/95znet
%{_datadir}/dracut/modules.d/95terminfo
%{_datadir}/dracut/modules.d/95udev-rules
%{_datadir}/dracut/modules.d/95udev-rules.ub810
%{_datadir}/dracut/modules.d/95uswsusp
%{_datadir}/dracut/modules.d/98syslog
%{_datadir}/dracut/modules.d/99base
# logfile needs no logrotate, because it gets overwritten
# for every dracut run
%attr(0644,root,root) %ghost %config(missingok,noreplace) %{_localstatedir}/log/dracut.log
%files network
%defattr(-,root,root,0755)
%doc README HACKING TODO COPYING AUTHORS NEWS
%{_datadir}/dracut/modules.d/40network
%{_datadir}/dracut/modules.d/95fcoe
%{_datadir}/dracut/modules.d/95iscsi
%{_datadir}/dracut/modules.d/95nbd
%{_datadir}/dracut/modules.d/95nfs
%{_datadir}/dracut/modules.d/45ifcfg
%files kernel
%files fips
%defattr(-,root,root,0755)
%doc README.kernel
%doc COPYING
%{_datadir}/dracut/modules.d/01fips
%files generic
%defattr(-,root,root,0755)
@@ -173,6 +226,8 @@ rm -rf $RPM_BUILD_ROOT
%files tools
%defattr(-,root,root,0755)
%doc COPYING NEWS
%{_mandir}/man8/dracut-gencmdline.8*
%{_mandir}/man8/dracut-catimages.8*
/sbin/dracut-gencmdline
/sbin/dracut-catimages
%dir /boot/dracut
@@ -180,6 +235,140 @@ rm -rf $RPM_BUILD_ROOT
%dir /var/lib/dracut/overlay
%changelog
* Fri Jan 15 2010 Harald Hoyer <harald@redhat.com> 004-1
- version 004
- Resolves: rhbz#529339 rhbz#533494 rhbz#548550
- Resolves: rhbz#548555 rhbz#553195
* Wed Jan 13 2010 Harald Hoyer <harald@redhat.com> 003-3
- add Obsoletes of mkinitrd/nash/libbdevid-python
- Related: rhbz#543948
* Wed Jan 13 2010 Warren Togami <wtogami@redhat.com> 003-2
- nbd is Fedora only
* Fri Nov 27 2009 Harald Hoyer <harald@redhat.com> 003-1
- version 003
* Mon Nov 23 2009 Harald Hoyer <harald@redhat.com> 002-26
- add WITH_SWITCH_ROOT make flag
- add fips requirement conditional
- add more device mapper modules (bug #539656)
* Fri Nov 20 2009 Dennis Gregorovic <dgregor@redhat.com> - 002-25.1
- nss changes for Alpha 3
* Thu Nov 19 2009 Harald Hoyer <harald@redhat.com> 002-25
- add more requirements for dracut-fips (bug #539257)
* Tue Nov 17 2009 Harald Hoyer <harald@redhat.com> 002-24
- put fips module in a subpackage (bug #537619)
* Tue Nov 17 2009 Harald Hoyer <harald@redhat.com> 002-23
- install xdr utils for multipath (bug #463458)
* Thu Nov 12 2009 Harald Hoyer <harald@redhat.com> 002-22
- add module 90multipath
- add module 01fips
- renamed module 95ccw to 95znet (bug #533833)
- crypt: ignore devices in /etc/crypttab (root is not in there)
- dasd: only install /etc/dasd.conf in hostonly mode (bug #533833)
- zfcp: only install /etc/zfcp.conf in hostonly mode (bug #533833)
- kernel-modules: add scsi_dh scsi_dh_rdac scsi_dh_emc (bug #527750)
- dasd: use dasdconf.sh from s390utils (bug #533833)
* Fri Nov 06 2009 Harald Hoyer <harald@redhat.com> 002-21
- fix rd_DASD argument handling (bug #531720)
- Resolves: rhbz#531720
* Wed Nov 04 2009 Harald Hoyer <harald@redhat.com> 002-20
- fix rd_DASD argument handling (bug #531720)
- Resolves: rhbz#531720
* Tue Nov 03 2009 Harald Hoyer <harald@redhat.com> 002-19
- changed rd_DASD to rd_DASD_MOD (bug #531720)
- Resolves: rhbz#531720
* Tue Oct 27 2009 Harald Hoyer <harald@redhat.com> 002-18
- renamed lvm/device-mapper udev rules according to upstream changes
- fixed dracut search path issue
* Mon Oct 26 2009 Harald Hoyer <harald@redhat.com> 002-17
- load dm_mod module (bug #530540)
* Fri Oct 09 2009 Jesse Keating <jkeating@redhat.com> - 002-16
- Upgrade plymouth to Requires(pre) to make it show up before kernel
* Thu Oct 08 2009 Harald Hoyer <harald@redhat.com> 002-15
- s390 ccw: s/layer1/layer2/g
* Thu Oct 08 2009 Harald Hoyer <harald@redhat.com> 002-14
- add multinic support
- add s390 zfcp support
- add s390 network support
* Wed Oct 07 2009 Harald Hoyer <harald@redhat.com> 002-13
- fixed init=<command> handling
- kill loginit if "rdinitdebug" specified
- run dmsquash-live-root after udev has settled (bug #527514)
* Tue Oct 06 2009 Harald Hoyer <harald@redhat.com> 002-12
- add missing loginit helper
- corrected dracut manpage
* Thu Oct 01 2009 Harald Hoyer <harald@redhat.com> 002-11
- fixed dracut-gencmdline for root=UUID or LABEL
* Thu Oct 01 2009 Harald Hoyer <harald@redhat.com> 002-10
- do not destroy assembled raid arrays if mdadm.conf present
- mount /dev/shm
- let udevd not resolve group and user names
- preserve timestamps of tools on initramfs generation
- generate symlinks for binaries correctly
- moved network from udev to initqueue
- mount nfs3 with nfsvers=3 option and retry with nfsvers=2
- fixed nbd initqueue-finished
- improved debug output: specifying "rdinitdebug" now logs
to dmesg, console and /init.log
- stop udev before killing it
- add ghost /var/log/dracut.log
- dmsquash: use info() and die() rather than echo
- strip kernel modules which have no x bit set
- redirect stdin, stdout, stderr all RW to /dev/console
so the user can use "less" to view /init.log and dmesg
* Tue Sep 29 2009 Harald Hoyer <harald@redhat.com> 002-9
- make install of new dm/lvm udev rules optionally
- correct dasd module typo
* Fri Sep 25 2009 Warren Togami <wtogami@redhat.com> 002-8
- revert back to dracut-002-5 tarball 845dd502
lvm2 was reverted to pre-udev
* Wed Sep 23 2009 Harald Hoyer <harald@redhat.com> 002-7
- build with the correct tarball
* Wed Sep 23 2009 Harald Hoyer <harald@redhat.com> 002-6
- add new device mapper udev rules and dmeventd
bug 525319, 525015
* Wed Sep 23 2009 Warren Togami <wtogami@redaht.com> 002-5
- Revert back to -3, Add umount back to initrd
This makes no functional difference to LiveCD. See Bug #525319
* Mon Sep 21 2009 Warren Togami <wtogami@redhat.com> 002-4
- Fix LiveCD boot regression
* Mon Sep 21 2009 Harald Hoyer <harald@redhat.com> 002-3
- bail out if selinux policy could not be loaded and
selinux=0 not specified on kernel command line
(bug #524113)
- set finished criteria for dmsquash live images
* Fri Sep 18 2009 Harald Hoyer <harald@redhat.com> 002-2
- do not cleanup dmraids
- copy over lvm.conf
* Thu Sep 17 2009 Harald Hoyer <harald@redhat.com> 002-1
- version 002
- set correct PATH

11
lsinitrd Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/bash
[[ $# -eq 1 ]] || { echo "Usage: $(basename $0) <initramfs file>" ; exit 1 ; }
[[ -f $1 ]] || { echo "$1 does not exist" ; exit 1 ; }
echo "$1:"
echo "========================================================================"
zcat $1 | cpio --extract --verbose --quiet --to-stdout 'dracut-*' 2>/dev/null
echo "========================================================================"
zcat $1 | cpio --extract --verbose --quiet --list
echo "========================================================================"

150
mkinitrd-dracut.sh Normal file
View File

@@ -0,0 +1,150 @@
#!/bin/bash --norc
error() {
local NONL=""
if [ "$1" == "-n" ]; then
NONL="-n"
shift
fi
echo $NONL "$@" > /dev/stderr
}
usage () {
if [ "$1" == "-n" ]; then
cmd=echo
else
cmd=error
fi
$cmd "usage: `basename $0` [--version] [--help] [-v] [-f] [--preload <module>]"
$cmd " [--image-version] [--with=<module>]"
$cmd " <initrd-image> <kernel-version>"
$cmd ""
$cmd " (ex: `basename $0` /boot/initramfs-$(uname -r).img $(uname -r))"
if [ "$1" == "-n" ]; then
exit 0
else
exit 1
fi
}
while [ $# -gt 0 ]; do
case $1 in
--with-usb*)
if [ "$1" != "${1##--with-usb=}" ]; then
usbmodule=${1##--with-usb=}
else
usbmodule="usb-storage"
fi
basicmodules="$basicmodules $usbmodule"
unset usbmodule
;;
--with-avail*)
if [ "$1" != "${1##--with-avail=}" ]; then
modname=${1##--with-avail=}
else
modname=$2
shift
fi
basicmodules="$basicmodules $modname"
;;
--with*)
if [ "$1" != "${1##--with=}" ]; then
modname=${1##--with=}
else
modname=$2
shift
fi
basicmodules="$basicmodules $modname"
;;
--version)
echo "mkinitrd: dracut compatibility wrapper"
exit 0
;;
-v|--verbose)
dracut_args="${dracut_args} -v"
;;
-f)
dracut_args="${dracut_args} -f"
;;
--preload*)
if [ "$1" != "${1##--preload=}" ]; then
modname=${1##--preload=}
else
modname=$2
shift
fi
basicmodules="$basicmodules $modname"
;;
--image-version)
img_vers=yes
;;
--rootfs*)
if [ "$1" != "${1##--rootfs=}" ]; then
rootfs="${1##--rootfs=}"
else
rootfs="$2"
shift
fi
dracut_args="${dracut_args} --filesystems $rootfs"
;;
--builtin*) ;;
--without*) ;;
--without-usb) ;;
--fstab*) ;;
--nocompress) ;;
--ifneeded) ;;
--omit-scsi-modules) ;;
--omit-ide-modules) ;;
--omit-raid-modules) ;;
--omit-lvm-modules) ;;
--omit-dmraid) ;;
--allow-missing) ;;
--net-dev*) ;;
--noresume) ;;
--rootdev*) ;;
--thawdev*) ;;
--rootopts*) ;;
--root*) ;;
--loopdev*) ;;
--loopfs*) ;;
--loopopts*) ;;
--looppath*) ;;
--dsdt*) ;;
--bootchart) ;;
--help)
usage -n
;;
*)
if [ -z "$target" ]; then
target=$1
elif [ -z "$kernel" ]; then
kernel=$1
else
usage
fi
;;
esac
shift
done
if [ -z "$target" -o -z "$kernel" ]; then
usage
fi
if [ -n "$img_vers" ]; then
target="$target-$kernel"
fi
if [ -n "$basicmodules" ]; then
dracut -H $dracut_args --add-drivers "$basicmodules" "$target" "$kernel"
else
dracut -H $dracut_args "$target" "$kernel"
fi
# vim:ts=8:sw=4:sts=4:et

19
modules.d/01fips/check Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
. $dracutfunctions
for program in ip arping; do
which $program >/dev/null 2>&1
if [ $? -ne 0 ]; then
dwarning "Could not find program \"$program\" required by network."
exit 1
fi
done
for program in dhclient brctl; do
which $program >/dev/null 2>&1
if [ $? -ne 0 ]; then
dwarning "Could not find program \"$program\" it might be required by network."
fi
done
exit 255

70
modules.d/01fips/fips.sh Executable file
View File

@@ -0,0 +1,70 @@
#!/bin/sh
do_fips()
{
FIPSMODULES=$(cat /etc/fipsmodules)
BOOT=$(getarg boot=)
KERNEL=$(uname -r)
udevadm trigger >/dev/null 2>&1
case "$boot" in
block:LABEL=*|LABEL=*)
boot="${boot#block:}"
boot="$(echo $boot | sed 's,/,\\x2f,g')"
boot="/dev/disk/by-label/${boot#LABEL=}"
bootok=1 ;;
block:UUID=*|UUID=*)
boot="${boot#block:}"
boot="/dev/disk/by-uuid/${root#UUID=}"
bootok=1 ;;
/dev/*)
bootok=1 ;;
esac
[ -z "$UDEVVERSION" ] && UDEVVERSION=$(udevadm --version)
if [ $UDEVVERSION -ge 143 ]; then
udevadm settle --exit-if-exists=$boot
else
udevadm settle --timeout=30
fi
[ -e "$boot" ]
mkdir /boot
info "Mounting $boot as /boot"
mount -oro "$boot" /boot
info "Checking integrity of kernel"
if ! [ -e "/boot/.vmlinuz-${KERNEL}.hmac" ]; then
warn "/boot/.vmlinuz-${KERNEL}.hmac does not exist"
return 1
fi
sha512hmac -c "/boot/.vmlinuz-${KERNEL}.hmac" || return 1
info "Umounting /boot"
umount /boot
info "Loading and integrity checking all crypto modules"
for module in $FIPSMODULES; do
if [ "$module" != "tcrypt" ]; then
modprobe ${module} || return 1
fi
done
info "Self testing crypto algorithms"
modprobe tcrypt noexit=1 || return 1
rmmod tcrypt
info "All initrd crypto checks done"
return 0
}
if ! fipsmode=$(getarg fips) || [ $fipsmode == "0" ]; then
rm -f /etc/modprobe.d/fips.conf >/dev/null 2>&1
else
set -e
do_fips || die "FIPS integrity test failed"
set +e
fi
# vim:ts=8:sw=4:sts=4:et

23
modules.d/01fips/install Executable file
View File

@@ -0,0 +1,23 @@
#!/bin/bash
inst_hook pre-trigger 01 "$moddir/fips.sh"
dracut_install sha512hmac rmmod insmod mount uname umount
libdir="lib"
if ldd $(find_binary sha512hmac) |grep -q /lib64/; then
libdir="lib64"
fi
if [ -e /usr/$libdir/libsoftokn3.so ]; then
dracut_install \
/usr/$libdir/libsoftokn3.so /usr/$libdir/libsoftokn3.chk \
/usr/$libdir/libfreebl3.so /usr/$libdir/libfreebl3.chk
else
dracut_install \
/$libdir/libsoftokn3.so /$libdir/libsoftokn3.chk \
/$libdir/libfreebl3.so /$libdir/libfreebl3.chk
fi
dracut_install /usr/$libdir/hmaccalc/sha512hmac.hmac
# vim:ts=8:sw=4:sts=4:et

16
modules.d/01fips/installkernel Executable file
View File

@@ -0,0 +1,16 @@
#!/bin/bash
FIPSMODULES="aead aes_generic aes-x86_64 ansi_cprng cbc ccm chainiv ctr"
FIPSMODULES="$FIPSMODULES des deflate ecb eseqiv hmac seqiv sha256 sha512"
FIPSMODULES="$FIPSMODULES cryptomgr crypto_null tcrypt"
mkdir -p "${initdir}/etc/modprobe.d"
for mod in $FIPSMODULES; do
if instmods $mod; then
echo $mod >> "${initdir}/etc/fipsmodules"
echo "blacklist $mod" >> "${initdir}/etc/modprobe.d/fips.conf"
fi
done
# vim:ts=8:sw=4:sts=4:et

View File

@@ -3,7 +3,7 @@
findkeymap () {
local MAP=$1
[[ ! -f $MAP ]] && \
MAP=$(find /lib/kbd/keymaps -type f -name $MAP -o -name $MAP.\* | head -n1)
MAP=$(find ${kbddir}/keymaps -type f -name $MAP -o -name $MAP.\* | head -n1)
[[ " $KEYMAPS " = *" $MAP "* ]] && return
KEYMAPS="$KEYMAPS $MAP"
case $MAP in
@@ -13,7 +13,7 @@ findkeymap () {
esac
for INCL in $($cmd "^include " $MAP | cut -d' ' -f2 | tr -d '"'); do
for FN in $(find /lib/kbd/keymaps -type f -name $INCL\*); do
for FN in $(find ${kbddir}/keymaps -type f -name $INCL\*); do
findkeymap $FN
done
done
@@ -27,12 +27,20 @@ install_local()
KEYMAP=/etc/sysconfig/console/default.kmap
else
. /etc/sysconfig/keyboard
[[ $KEYTABLE && -d /lib/kbd/keymaps ]] && KEYMAP="$KEYTABLE.map"
if [[ $KEYTABLE && -d ${kbddir}/keymaps ]]; then
[[ $KEYTABLE =~ *.uni ]] && UNIKEYMAP="$KEYTABLE.map" \
|| UNIKEYMAP="$KEYTABLE.uni.map"
KEYMAP="$KEYTABLE.map"
fi
fi
if [[ $KEYMAP ]]; then
[ -f /etc/sysconfig/keyboard ] && inst /etc/sysconfig/keyboard
inst loadkeys
findkeymap $KEYMAP
[[ $UNIKEYMAP ]] && findkeymap $UNIKEYMAP
[[ $GRP_TOGGLE ]] && findkeymap $GRP_TOGGLE.map
findkeymap delete.map
findkeymap backspace.map
for FN in $KEYMAPS; do
if [ -L $FN ]; then
@@ -58,27 +66,31 @@ install_local()
[[ $SYSFONT ]] || SYSFONT=latarcyrheb-sun16
inst setfont
for FN in /lib/kbd/consolefonts/$SYSFONT.* ; do
for FN in ${kbddir}/consolefonts/$SYSFONT.* ; do
inst "$FN"
case $FN in
*.gz) gzip -d "$initdir$FN" ;;
*.bz2) bzip2 -d "$initdir$FN" ;;
esac
done
[[ $SYSFONTACM ]] && inst /lib/kbd/consoletrans/$SYSFONTACM
[[ $UNIMAP ]] && inst /lib/kbd/unimaps/$UNIMAP
[[ $SYSFONTACM ]] && inst ${kbddir}/consoletrans/$SYSFONTACM
[[ $UNIMAP ]] && inst ${kbddir}/unimaps/$UNIMAP
fi
}
for kbddir in /usr/lib/kbd /lib/kbd; do
[[ -d ${kbddir} ]] && break
done
if [[ $hostonly ]]; then
install_local
else
for i in $(find /lib/kbd -type f -print); do
for i in $(find ${kbddir} -type f -print); do
dracut_install $i
done
# remove unnecessary files
rm -f "$initdir/lib/kbd/consoletrans/utflist" 2>/dev/null
find "$initdir/lib/kbd/" -name README\* -exec rm -f '{}' \;
rm -f "$initdir${kbddir}/consoletrans/utflist" 2>/dev/null
find "$initdir${kbddir}/" -name README\* -exec rm -f '{}' \;
dracut_install gzip bzip2
fi

View File

@@ -1,3 +1,5 @@
#!/bin/bash
if [ -e "$moddir/dracut-version" ]; then
dracut_rpm_version=$(cat "$moddir/dracut-version")
inst "$moddir/dracut-version" /$dracut_rpm_version

View File

@@ -2,7 +2,7 @@
. $dracutfunctions
for program in ip hostname; do
for program in ip arping; do
which $program >/dev/null 2>&1
if [ $? -ne 0 ]; then
dwarning "Could not find program \"$program\" required by network."

View File

@@ -13,24 +13,33 @@ setup_interface() {
[ -f /tmp/net.$netif.override ] && . /tmp/net.$netif.override
if [ -n "$mtu" ] ; then
echo ip link set $netif down
echo ip link set $netif mtu $mtu
echo ip link set $netif up
# Taken from debian dhclient-script:
# The 576 MTU is only used for X.25 and dialup connections
# where the admin wants low latency. Such a low MTU can cause
# problems with UDP traffic, among other things. As such,
# disallow MTUs from 576 and below by default, so that broken
# MTUs are ignored, but higher stuff is allowed (1492, 1500, etc).
if [ -n "$mtu" ] && [ $mtu -gt 576 ] ; then
echo "if ! ip link set $netif mtu $mtu ; then"
echo "ip link set $netif down"
echo "ip link set $netif mtu $mtu"
echo "ip link set $netif up"
echo wait_for_if_up $netif
echo "fi"
fi > /tmp/net.$netif.up
echo ip addr add $ip${mask:+/$mask} ${bcast:+broadcast $bcast} dev $netif >> /tmp/net.$netif.up
[ -n "$gw" ] && echo ip route add default via $gw dev $netif > /tmp/net.$netif.gw
[ -n "${search}${domain}" ] && echo "search $search $domain" > /tmp/resolv.conf
[ -n "${search}${domain}" ] && echo "search $search $domain" > /tmp/net.$netif.resolv.conf
if [ -n "$namesrv" ] ; then
for s in $namesrv; do
echo nameserver $s
done
fi >> /tmp/resolv.conf
fi >> /tmp/net.$netif.resolv.conf
[ -n "$hostname" ] && echo hostname $hostname > /tmp/net.$netif.hostname
[ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
}
PATH=$PATH:/sbin:/usr/sbin
@@ -52,14 +61,20 @@ netif=$interface
case $reason in
PREINIT)
ip link set $netif up
wait_for_if_up $netif
;;
BOUND)
if ! arping -q -D -c 2 -I $netif $new_ip_address ; then
warn "Duplicate address detected for $new_ip_address while doing dhcp. retrying"
exit 1
fi
setup_interface
set | while read line; do
[ "${line#new_}" = "$line" ] && continue
echo "$line"
done >/tmp/dhclient.$netif.dhcpopts
echo online > /sys/class/net/$netif/uevent
/sbin/initqueue --onetime --name netroot-$netif /sbin/netroot $netif
;;
*) ;;
esac

View File

@@ -7,13 +7,15 @@
[ -z "$root" ] && root=$(getarg root=)
[ -z "$netroot" ] && netroot=$(getarg netroot=)
if [ "$root" = "dhcp" ] || [ "$netroot" = "dhcp" ] ; then
if [ "$root" = "dhcp" ] || [ "$root" = "dhcp6" ] || [ "$netroot" = "dhcp" ] ; then
# Tell ip= checker that we need dhcp
NEEDDHCP="1"
# Done, all good!
rootok=1
netroot=dhcp
if [ "$netroot" != "dhcp" ] ; then
netroot=$root
fi
# Shut up init error check
[ -z "$root" ] && root="dhcp"

0
modules.d/40network/ifname-genrules.sh Normal file → Executable file
View File

View File

@@ -3,45 +3,77 @@
# We don't need to check for ip= errors here, that is handled by the
# cmdline parser script
#
PATH=$PATH:/sbin:/usr/sbin
# Sadly there's no easy way to split ':' separated lines into variables
ip_to_var() {
local v=${1}:
set --
while [ -n "$v" ]; do
set -- "$@" "${v%%:*}"
v=${v#*:}
done
unset ip srv gw mask hostname dev autoconf
case $# in
0) autoconf="error" ;;
1) autoconf=$1 ;;
2) dev=$1; autoconf=$2 ;;
*) ip=$1; srv=$2; gw=$3; mask=$4; hostname=$5; dev=$6; autoconf=$7 ;;
esac
}
. /lib/dracut-lib.sh
# Run dhclient
do_dhcp() {
# /sbin/dhclient-script will mark the netif up and generate the online
# event for nfsroot
# XXX add -V vendor class and option parsing per kernel
dhclient -1 -q -cf /etc/dhclient.conf -pf /tmp/dhclient.$netif.pid -lf /tmp/dhclient.$netif.lease $netif
dhclient "$@" -1 -q -cf /etc/dhclient.conf -pf /tmp/dhclient.$netif.pid -lf /tmp/dhclient.$netif.lease $netif
}
load_ipv6() {
modprobe ipv6
i=0
while [ ! -d /proc/sys/net/ipv6 ]; do
i=$(($i+1))
[ $i -gt 10 ] && break
sleep 0.1
done
}
do_ipv6auto() {
load_ipv6
{
echo 0 > /proc/sys/net/ipv6/conf/$netif/forwarding
echo 1 > /proc/sys/net/ipv6/conf/$netif/accept_ra
echo 1 > /proc/sys/net/ipv6/conf/$netif/accept_redirects
echo ip link set $netif up
echo wait_for_if_up $netif
} > /tmp/net.$netif.up
[ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
namesrv=$(getargs nameserver)
if [ -n "$namesrv" ] ; then
for s in $namesrv; do
echo nameserver $s
done
fi >> /tmp/net.$netif.resolv.conf
echo online > /sys/class/net/$netif/uevent
/sbin/initqueue --onetime --name netroot-$netif /sbin/netroot $netif
}
# Handle static ip configuration
do_static() {
{
strstr $ip '*:*:*' && load_ipv6
{
echo ip link set $netif up
echo ip addr flush dev $netif
echo wait_for_if_up $netif
# do not flush addr for ipv6
strstr $ip '*:*:*' || \
echo ip addr flush dev $netif
echo ip addr add $ip/$mask dev $netif
} > /tmp/net.$netif.up
[ -n "$gw" ] && echo ip route add default via $gw dev $netif > /tmp/net.$netif.gw
[ -n "$hostname" ] && echo hostname $hostname > /tmp/net.$netif.hostname
[ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
namesrv=$(getargs nameserver)
if [ -n "$namesrv" ] ; then
for s in $namesrv; do
echo nameserver $s
done
fi >> /tmp/net.$netif.resolv.conf
echo online > /sys/class/net/$netif/uevent
/sbin/initqueue --onetime --name netroot-$netif /sbin/netroot $netif
}
PATH=$PATH:/sbin:/usr/sbin
@@ -88,6 +120,7 @@ fi
# start bridge if necessary
if [ "$netif" = "$bridgename" ] && [ ! -e /tmp/net.$bridgename.up ]; then
ip link set $ethname up
wait_for_if_up $ethname
# Create bridge and add eth to bridge
brctl addbr $bridgename
brctl setfd $bridgename 0
@@ -96,7 +129,14 @@ fi
# No ip lines default to dhcp
ip=$(getarg ip)
[ -z "$ip" ] && do_dhcp;
if [ -z "$ip" ]; then
if [ "$netroot" = "dhcp6" ]; then
do_dhcp -6
else
do_dhcp -4
fi
fi
# Specific configuration, spin through the kernel command line
# looking for ip= lines
@@ -112,9 +152,16 @@ for p in $(getargs ip=); do
done > /tmp/net.$netif.override
case $autoconf in
dhcp|on|any) do_dhcp ;;
*) do_static ;;
dhcp|on|any)
do_dhcp -4 ;;
dhcp6)
do_dhcp -6 ;;
auto6)
do_ipv6auto ;;
*)
do_static ;;
esac
break
done
exit 0

View File

@@ -1,5 +1,5 @@
#!/bin/bash
dracut_install ip dhclient hostname brctl
dracut_install ip dhclient brctl arping
inst "$moddir/ifup" "/sbin/ifup"
inst "$moddir/netroot" "/sbin/netroot"
inst "$moddir/dhclient-script" "/sbin/dhclient-script"
@@ -12,6 +12,17 @@ inst_hook cmdline 98 "$moddir/parse-bridge.sh"
inst_hook cmdline 99 "$moddir/parse-ifname.sh"
inst_hook pre-pivot 10 "$moddir/kill-dhclient.sh"
# TODO ifcfg config style is redhat specific, this should probably
# go into its own module at one time
inst_hook pre-pivot 85 "$moddir/write-ifcfg.sh"
if ldd $(which sh) | grep -q lib64; then
LIBDIR="/lib64"
else
LIBDIR="/lib"
fi
ARCH=$(uname -m)
for dir in /usr/$LIBDIR/tls/$ARCH/ /usr/$LIBDIR/tls/ /usr/$LIBDIR/$ARCH/ /usr/$LIBDIR/ /$LIBDIR/; do
for i in $(ls $dir/libnss_dns.so.* $dir/libnss_mdns4_minimal.so.* 2>/dev/null); do
dracut_install $i
done
done

View File

@@ -14,3 +14,4 @@ instmods $(filter_kernel_modules net_module_test)
instmods ecb arc4
# bridge modules
instmods bridge stp llc
instmods ipv6

View File

@@ -37,7 +37,4 @@ fix_bootif() {
printf 'ACTION=="add", SUBSYSTEM=="net", RUN+="/sbin/ifup $env{INTERFACE}"\n'
fi
# Udev event 'online' only gets fired from ifup/dhclient-script.
# No special rules required
printf 'ACTION=="online", SUBSYSTEM=="net", RUN+="/sbin/netroot $env{INTERFACE}"\n'
} > /etc/udev/rules.d/60-net.rules

View File

@@ -4,27 +4,12 @@ PATH=$PATH:/sbin:/usr/sbin
. /lib/dracut-lib.sh
if getarg rdnetdebug ; then
exec >/tmp/netroot.$1.$$.out
exec 2>>/tmp/netroot.$1.$$.out
set -x
fi
# Huh? Empty $1?
[ -z "$1" ] && exit 1
# Huh? No interface config?
[ ! -e /tmp/net.$1.up ] && exit 1
# Only try to configure from one network interface at a time
#
if [ -z "$NETROOT_LOCKED" ] ; then
NETROOT_LOCKED=true
export NETROOT_LOCKED
exec flock -xo /tmp/netroot.lock -c "$0 $*"
exit 1
fi
# There's no sense in doing something if no (net)root info is available
# or root is already there
[ -e /tmp/root.info ] || exit 1
@@ -46,7 +31,7 @@ netif=$1
# Figure out the handler for root=dhcp by recalling all netroot cmdline
# handlers
if [ "$netroot" = "dhcp" ] ; then
if [ "$netroot" = "dhcp" ] || [ "$netroot" = "dhcp6" ] ; then
# Unset root so we can check later
unset root
@@ -90,7 +75,30 @@ done
[ -e /tmp/net.$netif.gw ] && . /tmp/net.$netif.gw
[ -e /tmp/net.$netif.hostname ] && . /tmp/net.$netif.hostname
[ -e /tmp/resolv.conf ] && cp -f /tmp/resolv.conf /etc/resolv.conf
[ -e /tmp/net.$netif.resolv.conf ] && cp -f /tmp/net.$netif.resolv.conf /etc/resolv.conf
# Load interface options
[ -e /tmp/net.$netif.override ] && . /tmp/net.$netif.override
[ -e /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts
# Handle STP Timeout: arping default router or if not available the
# root server. Note: This assumes that if no router is present the
# root server is on the same subnet.
#
# TODO There's some netroot variants that don't (yet) have their
# server-ip netroot
[ -n "$new_routers" ] && dest=${new_routers%%,*}
[ -n "$gw" ] && dest=$gw
if [ -z "$dest" ] ; then
dummy=${netroot#*:}
dummy=${dummy%%:*}
case "$dummy" in
[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*) dest=$dummy;;
esac
fi
if [ -n "$dest" ] && ! arping -q -f -w 60 -I $netif $dest ; then
die "Resolving $dest via ARP on $netif failed"
fi
# Source netroot hooks before we start the handler
source_all netroot

2
modules.d/40network/parse-bridge.sh Normal file → Executable file
View File

@@ -10,7 +10,7 @@
[ -n "$bridgename" ] && return
# Check if bridge parameter is valid
if getarg ip= >/dev/null ; then
if getarg bridge= >/dev/null ; then
if [ -z "$netroot" ] ; then
die "No netboot configured, bridge is invalid"
fi

0
modules.d/40network/parse-ifname.sh Normal file → Executable file
View File

View File

@@ -12,23 +12,7 @@
# routing,dns,dhcp-options,etc.
#
# Sadly there's no easy way to split ':' separated lines into variables
ip_to_var() {
local v=${1}:
set --
while [ -n "$v" ]; do
set -- "$@" "${v%%:*}"
v=${v#*:}
done
unset ip srv gw mask hostname dev autoconf
case $# in
0) autoconf="error" ;;
1) autoconf=$1 ;;
2) dev=$1; autoconf=$2 ;;
*) ip=$1; srv=$2; gw=$3; mask=$4; hostname=$5; dev=$6; autoconf=$7 ;;
esac
}
. /lib/dracut-lib.sh
# Check if ip= lines should be used
if getarg ip= >/dev/null ; then

View File

@@ -1,52 +0,0 @@
#!/bin/sh
# NFS root might have reached here before /tmp/net.ifaces was written
udevadm settle --timeout=30
# Don't write anything if we don't know our bootdev
[ -f /tmp/net.ifaces ] || return 1
read IFACES < /tmp/net.ifaces
for netif in $IFACES ; do
mkdir -p /tmp/ifcfg/
# bridge?
unset bridge
if [ "$netif" = "$bridgename" ]; then
bridge=yes
fi
cat /sys/class/net/$netif/address > /tmp/net.$netif.hwaddr
echo "# Generated by dracut initrd" > /tmp/ifcfg/ifcfg-$netif
echo "DEVICE=$netif" >> /tmp/ifcfg/ifcfg-$netif
echo "ONBOOT=yes" >> /tmp/ifcfg/ifcfg-$netif
echo "NETBOOT=yes" >> /tmp/ifcfg/ifcfg-$netif
if [ -f /tmp/net.$netif.lease ]; then
echo "BOOTPROTO=dhcp" >> /tmp/ifcfg/ifcfg-$netif
else
echo "BOOTPROTO=none" >> /tmp/ifcfg/ifcfg-$netif
# If we've booted with static ip= lines, the override file is there
. /tmp/net.$netif.override
echo "IPADDR=$ip" >> /tmp/ifcfg/ifcfg-$netif
echo "NETMASK=$mask" >> /tmp/ifcfg/ifcfg-$netif
[ -n "$gw" ] && echo "GATEWAY=$gw" >> /tmp/ifcfg/ifcfg-$netif
fi
# bridge needs differente things written to ifcfg
if [ -z "$bridge" ]; then
# standard interface
echo "HWADDR=$(cat /sys/class/net/$netif/address)" >> /tmp/ifcfg/ifcfg-$netif
echo "TYPE=Ethernet" >> /tmp/ifcfg/ifcfg-$netif
echo "NAME=\"Boot Disk\"" >> /tmp/ifcfg/ifcfg-$netif
else
# bridge
echo "TYPE=Bridge" >> /tmp/ifcfg/ifcfg-$netif
echo "NAME=\"Boot Disk\"" >> /tmp/ifcfg/ifcfg-$netif
# write separate ifcfg file for the raw eth interface
echo "DEVICE=$ethname" >> /tmp/ifcfg/ifcfg-$ethname
echo "TYPE=Ethernet" >> /tmp/ifcfg/ifcfg-$ethname
echo "ONBOOT=yes" >> /tmp/ifcfg/ifcfg-$ethname
echo "NETBOOT=yes" >> /tmp/ifcfg/ifcfg-$ethname
echo "HWADDR=$(cat /sys/class/net/$ethname/address)" >> /tmp/ifcfg/ifcfg-$ethname
echo "BRIDGE=$netif" >> /tmp/ifcfg/ifcfg-$ethname
echo "NAME=$ethname" >> /tmp/ifcfg/ifcfg-$ethname
fi
done

6
modules.d/45ifcfg/check Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/sh
[ -d /etc/sysconfig/network-scripts/ ] || exit 1
[[ $1 = -d ]] && echo network
exit 255

2
modules.d/45ifcfg/install Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/bash
inst_hook pre-pivot 85 "$moddir/write-ifcfg.sh"

View File

@@ -0,0 +1,70 @@
#!/bin/sh
# NFS root might have reached here before /tmp/net.ifaces was written
udevadm settle --timeout=30
# Don't write anything if we don't know our bootdev
[ -f /tmp/net.ifaces ] || return 1
read IFACES < /tmp/net.ifaces
for netif in $IFACES ; do
mkdir -p /tmp/ifcfg/
# bridge?
unset bridge
if [ "$netif" = "$bridgename" ]; then
bridge=yes
fi
cat /sys/class/net/$netif/address > /tmp/net.$netif.hwaddr
{
echo "# Generated by dracut initrd"
echo "DEVICE=$netif"
echo "ONBOOT=yes"
echo "NETBOOT=yes"
if [ -f /tmp/net.$netif.lease ]; then
strstr "$ip" '*:*:*' &&
echo "DHCPV6C=yes"
echo "BOOTPROTO=dhcp"
else
echo "BOOTPROTO=none"
# If we've booted with static ip= lines, the override file is there
. /tmp/net.$netif.override
echo "IPADDR=$ip"
echo "NETMASK=$mask"
[ -n "$gw" ] && echo "GATEWAY=$gw"
fi
} > /tmp/ifcfg/ifcfg-$netif
# bridge needs different things written to ifcfg
if [ -z "$bridge" ]; then
# standard interface
{
echo "HWADDR=$(cat /sys/class/net/$netif/address)"
echo "TYPE=Ethernet"
echo "NAME=\"Boot Disk\""
} >> /tmp/ifcfg/ifcfg-$netif
else
# bridge
{
echo "TYPE=Bridge"
echo "NAME=\"Boot Disk\""
} >> /tmp/ifcfg/ifcfg-$netif
# write separate ifcfg file for the raw eth interface
{
echo "DEVICE=$ethname"
echo "TYPE=Ethernet"
echo "ONBOOT=yes"
echo "NETBOOT=yes"
echo "HWADDR=$(cat /sys/class/net/$ethname/address)"
echo "BRIDGE=$netif"
echo "NAME=$ethname"
} >> /tmp/ifcfg/ifcfg-$ethname
fi
done
# Pass network opts
mkdir /dev/.initramfs/
cp /tmp/net.* /dev/.initramfs/ >/dev/null 2>&1
mkdir -p /dev/.initramfs/state/etc/sysconfig/network-scripts/
cp /tmp/net.$netif.resolv.conf /dev/.initramfs/state/etc/ >/dev/null 2>&1
echo "files /etc/sysconfig/network-scripts" > /dev/.initramfs/rwtab
cp -a /tmp/ifcfg/* /dev/.initramfs/state/etc/sysconfig/network-scripts/ >/dev/null 2>&1

View File

@@ -10,36 +10,74 @@
[ -f /tmp/cryptroot-asked-$2 ] && exit 0
. /lib/dracut-lib.sh
# default luksname - luks-UUID
luksname=$2
# if device name is /dev/dm-X, convert to /dev/mapper/name
if [ "${1##/dev/dm-}" != "$1" ]; then
device="/dev/mapper/$(dmsetup info -c --noheadings -o name "$1")"
else
device="$1"
fi
if [ -f /etc/crypttab ] && ! getargs rd_NO_CRYPTTAB; then
while read name dev rest; do
# ignore blank lines and comments
if [ -z "$name" -o "${name#\#}" != "$name" ]; then
continue
fi
# UUID used in crypttab
if [ "${dev%%=*}" = "UUID" ]; then
if [ "luks-${dev##UUID=}" = "$2" ]; then
luksname="$name"
break
fi
# path used in crypttab
else
cdev=$(readlink -f $dev)
mdev=$(readlink -f $device)
if [ "$cdev" = "$mdev" ]; then
luksname="$name"
break
fi
fi
done < /etc/crypttab
unset name dev rest
fi
LUKS=$(getargs rd_LUKS_UUID=)
ask=1
if [ -n "$LUKS" ]; then
ask=0
luuid=${2##luks-}
for luks in $LUKS; do
if [ "${luuid##$luks}" != "$2" ]; then
luks=${luks##luks-}
if [ "${luuid##$luks}" != "$luuid" ] || [ "$luksname" = "$luks" ]; then
ask=1
break
fi
done
fi
unset LUKS luks luuid
if [ $ask -gt 0 ]; then
info "luksOpen $1 $2"
info "luksOpen $device $luksname"
# flock against other interactive activities
{ flock -s 9;
/bin/plymouth ask-for-password \
--prompt "$1 is password protected" \
--command="/sbin/cryptsetup luksOpen -T1 $1 $2"
--prompt "$device ($luksname) is password protected" \
--command="/sbin/cryptsetup luksOpen -T1 $device $luksname"
} 9>/.console.lock
fi
unset ask device luksname
# mark device as asked
>> /tmp/cryptroot-asked-$2
udevsettle
unset LUKS
unset ask
unset luks
exit 0
# vim:ts=8:sw=4:sts=4:et

View File

@@ -13,3 +13,4 @@ inst_hook pre-pivot 90 "$moddir"/plymouth-newroot.sh
inst_hook pre-trigger 10 "$moddir"/plymouth-pretrigger.sh
inst_hook emergency 50 "$moddir"/plymouth-emergency.sh
inst "$moddir"/cryptroot-ask.sh /sbin/cryptroot-ask
inst readlink

View File

@@ -1,5 +1,5 @@
#!/bin/bash
# Include KMS capable drm drivers
for modname in $(find "$srcmods/kernel/drivers/gpu/drm" -name '*.ko'); do
for modname in $(find "$srcmods/kernel/drivers/gpu/drm" -name '*.ko' 2>/dev/null); do
nm -uPA $modname | grep -q drm_crtc_init && instmods $modname
done

View File

@@ -15,6 +15,7 @@ if ! getarg rd_NO_PLYMOUTH; then
info "Starting plymouth daemon"
[ -x /bin/plymouthd ] && /bin/plymouthd --attach-to-session
/lib/udev/console_init tty0
/bin/plymouth --show-splash 2>&1 | vinfo
fi

14
modules.d/60xen/check Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/bash
# No Xen-detect? Boo!!
XENDETECT=$(which xen-detect 2>/dev/null)
[ -z "$XENDETECT" ] && [ -d "/usr/lib/xen-default" ] && XENDETECT="/usr/lib/xen-default/bin/xen-detect"
[ -z "$XENDETECT" ] && exit 1
. $dracutfunctions
[[ $debug ]] && set -x
# Yes, we are under Xen PV env.
$XENDETECT | egrep -q -v 'PV' || exit 0
exit 1

6
modules.d/60xen/install Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/bash
XENDETECT=$(which xen-detect)
[ -z "$XENDETECT" ] && [ -d "/usr/lib/xen-default" ] && XENDETECT="/usr/lib/xen-default/bin/xen-detect"
inst $XENDETECT /sbin/xen-detect
inst_hook pre-udev 40 "$moddir/xen-pre-udev.sh"

9
modules.d/60xen/installkernel Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/bash
for i in \
xenbus_probe_frontend xen-pcifront \
xen-fbfront xen-kbdfront xen-blkfront xen-netfront \
; do
modinfo -k $kernel $i >/dev/null 2>&1 && instmods $i
done

View File

@@ -0,0 +1,10 @@
xen-detect
RC=$?
if [ "$RC" = "1" ] ; then
modprobe xenbus_probe_frontend
modprobe xen-kbdfront
modprobe xen-fbfront
modprobe xen-blkfront
modprobe xen-netfront
modprobe xen-pcifront
fi

View File

@@ -1,3 +1,4 @@
#!/bin/sh
# close everything which is not busy
for i in /dev/mapper/luks-*; do
cryptsetup luksClose $i >/dev/null 2>&1

View File

@@ -10,25 +10,65 @@
[ -f /tmp/cryptroot-asked-$2 ] && exit 0
. /lib/dracut-lib.sh
# default luksname - luks-UUID
luksname=$2
# if device name is /dev/dm-X, convert to /dev/mapper/name
if [ "${1##/dev/dm-}" != "$1" ]; then
device="/dev/mapper/$(dmsetup info -c --noheadings -o name "$1")"
else
device="$1"
fi
if [ -f /etc/crypttab ] && ! getargs rd_NO_CRYPTTAB; then
while read name dev rest; do
# ignore blank lines and comments
if [ -z "$name" -o "${name#\#}" != "$name" ]; then
continue
fi
# UUID used in crypttab
if [ "${dev%%=*}" = "UUID" ]; then
if [ "luks-${dev##UUID=}" = "$2" ]; then
luksname="$name"
break
fi
# path used in crypttab
else
cdev=$(readlink -f $dev)
mdev=$(readlink -f $device)
if [ "$cdev" = "$mdev" ]; then
luksname="$name"
break
fi
fi
done < /etc/crypttab
unset name dev rest
fi
LUKS=$(getargs rd_LUKS_UUID=)
ask=1
if [ -n "$LUKS" ]; then
ask=0
luuid=${2##luks-}
for luks in $LUKS; do
if [ "${luuid##$luks}" != "$2" ]; then
luks=${luks##luks-}
if [ "${luuid##$luks}" != "$luuid" ] || [ "$luksname" = "$luks" ]; then
ask=1
break
fi
done
fi
unset LUKS luks luuid
if [ $ask -gt 0 ]; then
info "luksOpen $1 $2"
info "luksOpen $device $luksname"
# flock against other interactive activities
{ flock -s 9;
echo -n "$1 is password protected "
/sbin/cryptsetup luksOpen -T1 $1 $2
echo -n "$device ($luksname) is password protected"
/sbin/cryptsetup luksOpen -T1 $1 $luksname
} 9>/.console.lock
fi
@@ -36,3 +76,4 @@ fi
>> /tmp/cryptroot-asked-$2
exit 0
# vim:ts=8:sw=4:sts=4:et

View File

@@ -1,7 +1,8 @@
#!/bin/bash
inst cryptsetup
inst cryptsetup
inst_rules "$moddir/70-luks.rules"
inst "$moddir"/cryptroot-ask.sh /sbin/cryptroot-ask
inst_hook cmdline 30 "$moddir/parse-crypt.sh"
inst_hook pre-pivot 30 "$moddir/crypt-cleanup.sh"
inst_hook pre-pivot 31 "$moddir/crypt-cleanup.sh"
inst /etc/crypttab

View File

@@ -1,3 +1,4 @@
#!/bin/sh
if getarg rd_NO_LUKS; then
info "rd_NO_LUKS: removing cryptoluks activation"
rm -f /etc/udev/rules.d/70-luks.rules

4
modules.d/90dm/check Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
exit 255

View File

@@ -0,0 +1 @@
modprobe dm_mod

9
modules.d/90dm/install Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/bash
modinfo -k $kernel dm_mod >/dev/null 2>&1 && \
inst_hook pre-udev 30 "$moddir/dm-pre-udev.sh"
inst dmsetup
inst dmeventd
inst_rules 10-dm.rules 95-dm-notify.rules

9
modules.d/90dm/installkernel Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/bash
for i in \
dm-snapshot dm-delay dm-mirror dm-mod dm-queue-length \
dm-region-hash dm-round-robin dm-service-time dm-snapshot \
; do
modinfo -k $kernel $i >/dev/null 2>&1 && instmods $i
done

View File

@@ -1,5 +1,8 @@
#!/bin/bash
# We depend on dm_mod being loaded
[ "$1" = "-d" ] && echo dm
# if we don't have dmraid installed on the host system, no point
# in trying to support it in the initramfs.
which dmraid >/dev/null 2>&1 || exit 1

View File

@@ -1,2 +0,0 @@
# close everything which is not busy
dmraid -an >/dev/null 2>&1

View File

@@ -4,6 +4,8 @@
DM_RAIDS=$(getargs rd_DM_UUID=)
DM_CLEANUP="no"
# run dmraid if udev has settled
info "Scanning for dmraid devices $DM_RAIDS"
SETS=$(dmraid -c -s)
@@ -35,3 +37,4 @@ else
[ -e "/dev/mapper/$s" ] && kpartx -a -p p "/dev/mapper/$s" 2>&1 | vinfo
done
fi

View File

@@ -1,5 +1,21 @@
#!/bin/bash
dracut_install dmraid partx kpartx
dracut_install dmraid partx kpartx
inst dmeventd
if ldd $(which dmraid) | grep -q lib64; then
LIBDIR="/lib64"
else
LIBDIR="/lib"
fi
for i in $(ls /{usr,}/$LIBDIR/libdmraid-events*.so 2>/dev/null); do
dracut_install $i
done
inst_rules 10-dm.rules 13-dm-disk.rules 95-dm-notify.rules
inst "$moddir/dmraid.sh" /sbin/dmraid_scan
if [ ! -x /lib/udev/vol_id ]; then
@@ -7,7 +23,6 @@ if [ ! -x /lib/udev/vol_id ]; then
fi
inst_rules "$moddir/61-dmraid-imsm.rules"
inst_hook pre-pivot 30 "$moddir/dmraid-cleanup.sh"
inst_hook pre-pivot 31 "$moddir/dmraid-cleanup.sh"
inst "$moddir/dmraid-cleanup.sh" /sbin/dmraid-cleanup
inst_hook pre-trigger 30 "$moddir/parse-dm.sh"

View File

@@ -1,4 +1,5 @@
if getarg rd_NO_DM; then
# nodmraid for anaconda / rc.sysinit compatibility
if getarg rd_NO_DM || getarg nodmraid; then
info "rd_NO_DM: removing DM RAID activation"
udevproperty rd_NO_DM=1
fi

View File

@@ -4,10 +4,11 @@ if [ "${root%%:*}" = "live" ]; then
${root#live:/dev/}
printf 'SYMLINK=="%s", SYMLINK+="live"\n' \
${root#live:/dev/}
printf 'KERNEL=="%s", RUN+="/sbin/initqueue --onetime --unique /sbin/dmsquash-live-root $env{DEVNAME}"\n' \
printf 'KERNEL=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root $env{DEVNAME}"\n' \
${root#live:/dev/}
printf 'SYMLINK=="%s", RUN+="/sbin/initqueue --onetime --unique /sbin/dmsquash-live-root $env{DEVNAME}"\n' \
printf 'SYMLINK=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root $env{DEVNAME}"\n' \
${root#live:/dev/}
) >> /etc/udev/rules.d/99-live-mount.rules
echo '[ -e /dev/root ]' > /initqueue-finished/dmsquash.sh
fi

View File

@@ -20,6 +20,7 @@ live_dir=$(getarg live_dir)
[ -z "$live_dir" ] && live_dir="LiveOS"
getarg live_ram && live_ram="yes"
getarg reset_overlay && reset_overlay="yes"
getarg readonly_overlay && readonly_overlay="--readonly" || readonly_overlay=""
overlay=$(getarg overlay)
# FIXME: we need to be able to hide the plymouth splash for the check really
@@ -31,7 +32,7 @@ getarg check || check=""
if [ -n "$check" ]; then
checkisomd5 --verbose $livedev || :
if [ $? -ne 0 ]; then
echo "CD check failed!"
die "CD check failed!"
exit 1
fi
fi
@@ -43,7 +44,7 @@ getarg rw && liverw=rw
mount -n -t $fstype -o $liverw $livedev $NEWROOT
RES=$?
if [ "$RES" != "0" ]; then
echo "Failed to mount block device of live image"
die "Failed to mount block device of live image"
exit 1
fi
@@ -86,7 +87,7 @@ do_live_overlay() {
if [ -z "$setup" ]; then
if [ -n "$devspec" -a -n "$pathspec" ]; then
echo "Unable to find persistent overlay; using temporary"
warn "Unable to find persistent overlay; using temporary"
sleep 5
fi
@@ -95,7 +96,7 @@ do_live_overlay() {
fi
# set up the snapshot
echo 0 `blockdev --getsize $BASE_LOOPDEV` snapshot $BASE_LOOPDEV $OVERLAY_LOOPDEV p 8 | dmsetup create live-rw
echo 0 `blockdev --getsz $BASE_LOOPDEV` snapshot $BASE_LOOPDEV $OVERLAY_LOOPDEV p 8 | dmsetup create $readonly_overlay live-rw
}
# live cd helper function
@@ -168,7 +169,7 @@ fi
if [ -b "$OSMIN_LOOPDEV" ]; then
# set up the devicemapper snapshot device, which will merge
# the normal live fs image, and the delta, into a minimzied fs image
echo "0 $( blockdev --getsize $BASE_LOOPDEV ) snapshot $BASE_LOOPDEV $OSMIN_LOOPDEV p 8" | dmsetup create --readonly live-osimg-min
echo "0 $( blockdev --getsz $BASE_LOOPDEV ) snapshot $BASE_LOOPDEV $OSMIN_LOOPDEV p 8" | dmsetup create --readonly live-osimg-min
fi
ln -s /dev/mapper/live-rw /dev/root

View File

@@ -0,0 +1,7 @@
if [ "${root%%:*}" = "liveiso" ]; then
(
printf 'KERNEL=="loop0", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root `/sbin/losetup -f --show %s`"\n' \
${root#liveiso:}
) >> /etc/udev/rules.d/99-liveiso-mount.rules
echo '[ -e /dev/root ]' > /initqueue-finished/dmsquash.sh
fi

View File

@@ -4,6 +4,7 @@ inst dmsetup
inst blkid
inst dd
inst losetup
inst grep
# eject might be a symlink to consolehelper
if [ -L /usr/bin/eject ]; then
@@ -16,6 +17,7 @@ inst blockdev
which checkisomd5 >/dev/null 2>&1 && inst 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"
inst "$moddir/dmsquash-live-root" "/sbin/dmsquash-live-root"
# should probably just be generally included
inst_rules 60-cdrom_id.rules

View File

@@ -1,3 +1,4 @@
#!/bin/sh
# live images are specified with
# root=live:backingdev
@@ -29,12 +30,14 @@ case "$liveroot" in
root="${root#live:}"
root="live:/dev/disk/by-uuid/${root#UUID=}"
rootok=1 ;;
/dev/*)
root="live:${root}"
live:/*.[Ii][Ss][Oo]|/*.[Ii][Ss][Oo])
root="${root#live:}"
root="liveiso:${root}"
rootok=1 ;;
live:/dev/*)
rootok=1 ;;
esac
echo "root was $root, liveroot is now $liveroot"
info "root was $root, liveroot is now $liveroot"
# make sure that init doesn't complain
[ -z "$root" ] && root="live"

View File

@@ -1,3 +1,4 @@
#!/bin/bash
[ -f /etc/modprobe.conf ] && dracut_install /etc/modprobe.conf
dracut_install $(find /etc/modprobe.d/ -type f -name '*.conf')
inst_hook cmdline 01 "$moddir/parse-kernel.sh"

View File

@@ -5,19 +5,32 @@ if [[ -z $drivers ]]; then
nm -uPA "$1" | egrep -q "$blockfuncs"
}
instmods pcmcia sd_mod $(filter_kernel_modules block_module_test) "=drivers/pcmcia"
# if not on hostonly mode, install all known filesystems.
if [[ $hostonly = '' ]]; then
instmods '=fs'
hostonly='' instmods pcmcia sd_mod scsi_dh scsi_dh_rdac scsi_dh_emc
hostonly='' instmods firewire-ohci
# install keyboard support
hostonly='' instmods atkbd i8042 usbhid hid-apple ehci-hcd ohci-hcd uhci-hcd
instmods "=drivers/pcmcia" =ide "=drivers/usb/storage"
instmods $(filter_kernel_modules block_module_test)
# if not on hostonly mode, install all known filesystems if the required list is not set via the filesystems variable
if ! [[ $hostonly ]]; then
if [[ -z $filesystems ]]; then
instmods '=fs'
else
instmods $filesystems
fi
else
instmods $(get_fs_type "/dev/block/$(find_root_block_device)")
hostonly='' instmods $(get_fs_type "/dev/block/$(find_root_block_device)")
fi
# hardcoded list of exceptions
rm -fr ${initdir}/lib/modules/*/kernel/fs/ocfs2
else
instmods $drivers
hostonly='' instmods $drivers $filesystems
fi
[[ $add_drivers ]] && instmods $add_drivers
[[ $add_drivers ]] && hostonly='' instmods $add_drivers
# force install of scsi_wait_scan
hostonly='' instmods scsi_wait_scan
instmods scsi_wait_scan

View File

@@ -0,0 +1,5 @@
#!/bin/sh
for p in $(getargs rdloaddriver=); do
modprobe $p
done

View File

@@ -1,5 +1,8 @@
#!/bin/bash
# We depend on dm_mod being loaded
[ "$1" = "-d" ] && echo dm
# No point trying to support lvm if the binaries are missing
which lvm >/dev/null 2>&1 || exit 1

View File

@@ -3,11 +3,16 @@ inst lvm
inst_rules "$moddir/64-lvm.rules" 64-lvm.rules
if [[ $hostonly ]]; then
[ -f /etc/lvm/lvm.conf ] && inst /etc/lvm/lvm.conf
if [[ $hostonly ]] || [[ $lvmconf = "yes" ]]; then
if [ -f /etc/lvm/lvm.conf ]; then
inst /etc/lvm/lvm.conf
# FIXME: near-term hack to establish read-only locking;
# use command-line lvm.conf editor once it is available
sed -i -e 's/\(^[[:space:]]*\)locking_type[[:space:]]*=[[:space:]]*[[:digit:]]/\1locking_type = 4/' ${initdir}/etc/lvm/lvm.conf
fi
fi
inst_rules 10-dm.rules 13-dm-disk.rules 95-dm-notify.rules 11-dm-lvm.rules
inst "$moddir/lvm_scan.sh" /sbin/lvm_scan
inst_hook cmdline 30 "$moddir/parse-lvm.sh"
inst_hook pre-pivot 30 "$moddir/lvm-cleanup.sh"
inst_hook pre-pivot 31 "$moddir/lvm-cleanup.sh"

View File

@@ -1,2 +0,0 @@
# stop everything which is not busy
lvm vgchange -a n >/dev/null 2>&1

View File

@@ -5,6 +5,7 @@
. /lib/dracut-lib.sh
VGS=$(getargs rd_LVM_VG=)
LVS=$(getargs rd_LVM_LV=)
[ -d /etc/lvm ] || mkdir -p /etc/lvm
# build a list of devices to scan
@@ -23,13 +24,54 @@ if [ ! -e /etc/lvm/lvm.conf ]; then
printf '"a|^/dev/%s$|", ' $dev;
done;
echo '"r/.*/" ]';
echo 'types = [ "blkext", 1024 , "cciss0", 1024 ]'
echo '}';
# establish read-only locking
echo 'global {';
echo ' locking_type = 4';
echo '}';
} > /etc/lvm/lvm.conf
lvmwritten=1
fi
info "Scanning devices $lvmdevs for LVM volume groups $VGS"
lvm vgscan 2>&1 | vinfo
lvm vgchange -ay $VGS 2>&1 | vinfo
[ "$lvmwritten" ] && rm -f /etc/lvm/lvm.conf
check_lvm_ver() {
# --poll is supported since 2.2.57
[ $1 -lt 2 ] && return 1
[ $1 -gt 2 ] && return 0
# major is 2
[ $2 -lt 2 ] && return 1
[ $2 -gt 2 ] && return 0
# minor is 2, check for
# greater or equal 57
[ $3 -ge 57 ] && return 0
return 1
}
nopoll=$(
# hopefully this output format will never change, e.g.:
# LVM version: 2.02.53(1) (2009-09-25)
lvm version 2>/dev/null | \
(
IFS=. read maj min sub;
maj=${maj##*:};
sub=${sub%% *}; sub=${sub%%\(*};
check_lvm_ver $maj $min $sub && \
echo " --poll n ") 2>/dev/null )
if [ -n "$LVS" ] ; then
info "Scanning devices $lvmdevs for LVM logical volumes $LVS"
lvm lvscan --ignorelockingfailure 2>&1 | vinfo
lvm lvchange -ay --ignorelockingfailure $nopoll --ignoremonitoring $LVS 2>&1 | vinfo
fi
if [ -z "$LVS" -o -n "$VGS" ]; then
info "Scanning devices $lvmdevs for LVM volume groups $VGS"
lvm vgscan --ignorelockingfailure 2>&1 | vinfo
lvm vgchange -ay --ignorelockingfailure $nopoll --ignoremonitoring $VGS 2>&1 | vinfo
fi
if [ "$lvmwritten" ]; then
rm -f /etc/lvm/lvm.conf
ln -s /sbin/lvm-cleanup /pre-pivot/30-lvm-cleanup.sh 2>/dev/null
ln -s /sbin/lvm-cleanup /pre-pivot/31-lvm-cleanup.sh 2>/dev/null
fi
unset lvmwritten

View File

@@ -3,3 +3,8 @@ if getarg rd_NO_LVM; then
rm -f /etc/udev/rules.d/64-lvm*.rules
fi
if [ -e /etc/lvm/lvm.conf ] && getarg rd_NO_LVMCONF; then
rm -f /etc/lvm/lvm.conf
fi

View File

@@ -22,8 +22,11 @@ if ! mdadm -Q -e imsm /dev/null &> /dev/null; then
fi
if [[ $hostonly ]] || [[ $mdadmconf = "yes" ]]; then
[ -f /etc/mdadm/mdadm.conf ] && inst /etc/mdadm/mdadm.conf /etc/mdadm.conf
[ -f /etc/mdadm.conf ] && inst /etc/mdadm.conf
if [ -f /etc/mdadm.conf ]; then
inst /etc/mdadm.conf
else
[ -f /etc/mdadm/mdadm.conf ] && inst /etc/mdadm/mdadm.conf /etc/mdadm.conf
fi
fi
if [ -x /sbin/mdmon ] ; then
@@ -36,5 +39,4 @@ inst "$moddir/mdcontainer_start.sh" /sbin/mdcontainer_start
inst "$moddir/mdadm_auto.sh" /sbin/mdadm_auto
inst "$moddir/md_finished.sh" /sbin/md_finished.sh
inst_hook pre-trigger 30 "$moddir/parse-md.sh"
inst_hook pre-pivot 30 "$moddir/mdraid-cleanup.sh"
inst_hook pre-pivot 31 "$moddir/mdraid-cleanup.sh"
inst "$moddir/mdraid-cleanup.sh" /sbin/mdraid-cleanup

View File

@@ -2,6 +2,4 @@
. /lib/dracut-lib.sh
info "Autoassembling MD Raid"
udevadm control --stop-exec-queue
/sbin/mdadm -As --auto=yes --run 2>&1 | vinfo
udevadm control --start-exec-queue

View File

@@ -5,4 +5,6 @@ md=$1
udevadm control --stop-exec-queue
# and activate any containers
mdadm -IR $md 2>&1 | vinfo
ln -s /sbin/mdraid-cleanup /pre-pivot/30-mdraid-cleanup.sh 2>/dev/null
ln -s /sbin/mdraid-cleanup /pre-pivot/31-mdraid-cleanup.sh 2>/dev/null
udevadm control --start-exec-queue

View File

@@ -1,3 +1,4 @@
#!/bin/sh
# stop everything which is not busy
for i in /dev/md* /dev/md/*; do
[ -b $i ] || continue

View File

@@ -5,4 +5,6 @@
info "Assembling MD RAID arrays"
udevadm control --stop-exec-queue
mdadm -IRs 2>&1 | vinfo
ln -s /sbin/mdraid-cleanup /pre-pivot/30-mdraid-cleanup.sh 2>/dev/null
ln -s /sbin/mdraid-cleanup /pre-pivot/31-mdraid-cleanup.sh 2>/dev/null
udevadm control --start-exec-queue

View File

@@ -30,7 +30,9 @@ if [ -e /etc/mdadm.conf ] && ! getarg rd_NO_MDADMCONF; then
rm -f /pre-pivot/*mdraid-cleanup.sh
fi
if getarg rd_NO_MDIMSM; then
# noiswmd nodmraid for anaconda / rc.sysinit compatibility
# note nodmraid really means nobiosraid, so we don't want MDIMSM then either
if getarg rd_NO_MDIMSM || getarg noiswmd || getarg nodmraid; then
info "rd_NO_MDIMSM: no MD RAID for imsm/isw raids"
udevproperty rd_NO_MDIMSM=1
fi

View File

@@ -0,0 +1,9 @@
# scan for multipath devices
SUBSYSTEM!="block", GOTO="end_mpath_scan"
KERNEL!="sd*", GOTO="end_mpath_scan"
PROGRAM=="/bin/sh -c 'for i in $sys/$devpath/holders/dm-[0-9]*; do [ -e $$i ] && exit 0; done; exit 1;' ", GOTO="end_mpath_scan"
RUN+="/sbin/modprobe dm-multipath"
RUN+="/bin/echo 'queuing multipath scan'"
RUN+="/sbin/initqueue --settled --onetime --unique --name mpscan /sbin/multipath-scan"
RUN+="/bin/sh -c '>/tmp/.multipath-scan-%k;'"
LABEL="end_mpath_scan"

23
modules.d/90multipath/check Executable file
View File

@@ -0,0 +1,23 @@
#!/bin/bash
# if there's no multipath binary, no go.
which multipath >/dev/null 2>&1 || exit 1
[[ $1 = -d ]] && exit 0
. $dracutfunctions
[[ $debug ]] && set -x
is_mpath() {
[ -e /sys/dev/block/$1/dm/uuid ] || return 1
[[ $(cat /sys/dev/block/$1/dm/uuid) =~ ^mpath- ]] && return 0
return 1
}
# Do mpath if we appear to be using it for /
rootdev=$(find_root_block_device)
if [[ $rootdev ]]; then
check_block_and_slaves is_mpath "$rootdev" && exit 0
fi
exit 1

32
modules.d/90multipath/install Executable file
View File

@@ -0,0 +1,32 @@
#!/bin/bash
if [ -f /etc/multipath.conf ]; then
inst /etc/multipath.conf
fi
if ldd $(which multipath) 2>/dev/null |grep -q lib64; then
LIBDIR="/lib64"
else
LIBDIR="/lib"
fi
for f in \
/sbin/dmsetup \
/sbin/kpartx \
/sbin/mpath_wait \
/sbin/multipath \
/sbin/multipathd \
/sbin/xdrgetuid \
/sbin/xdrgetprio \
/etc/xdrdevices.conf \
$(ls $LIBDIR/libmultipath* $LIBDIR/multipath/* 2>/dev/null) \
;do
[ -e "$f" ] && inst "$f"
done
inst_hook pre-trigger 02 "$moddir/multipathd.sh"
inst_hook pre-pivot 02 "$moddir/multipathd-stop.sh"
inst_rules 40-multipath.rules
inst "$moddir/multipath-scan.sh" /sbin/multipath-scan
inst_rules "$moddir/9-multipath-scan.rules"

View File

@@ -0,0 +1,8 @@
#!/bin/bash
mp_mod_test() {
local mpfuncs='scsi_register_device_handler|dm_dirty_log_type_register|dm_register_path_selector|dm_register_target'
nm -uPA "$1" | egrep -q "$mpfuncs"
}
instmods $(filter_kernel_modules mp_mod_test)

View File

@@ -0,0 +1,16 @@
#!/bin/sh
# scan for multipaths if udev has settled
. /lib/dracut-lib.sh
[ -d /etc/multipath ] || mkdir -p /etc/multipath
mpdevs=$(
for f in /tmp/.multipath-scan-* ; do
[ -e "$f" ] || continue
echo -n "${f##/tmp/.multipath-scan-} "
done
)
[ -e /etc/multipath.conf ] || exit 1
multipath ${mpdevs}

View File

@@ -0,0 +1,12 @@
#!/bin/sh
if [ -e /etc/multipath.conf ]; then
HARD=""
while pidof multipathd >/dev/null 2>&1; do
for pid in $(pidof multipathd); do
kill $HARD $pid >/dev/null 2>&1
done
HARD="-9"
done
fi

View File

@@ -0,0 +1,6 @@
#!/bin/sh
if [ -e /etc/multipath.conf ]; then
multipathd
fi

5
modules.d/95dasd/check Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/bash
arch=$(uname -m)
[ "$arch" = "s390" -o "$arch" = "s390x" ] || exit 1
exit 0

8
modules.d/95dasd/install Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
inst_hook cmdline 30 "$moddir/parse-dasd.sh"
dracut_install tr dasdinfo dasdconf.sh
if [[ $hostonly ]]; then
inst /etc/dasd.conf
fi
inst_rules 56-dasd.rules
inst_rules 59-dasd.rules

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