Compare commits

...

410 Commits
032 ... RHEL-6

Author SHA1 Message Date
Chad Dupuis
b490820a67 fcoe: Allow more time for the bnx2x link negotiation before brining up fcoe interfaces.
bnx2x can take no longer than 3 seconds to initialize the link in some setups
which can cause fipvlan to fail and thus the fcoe interface(s) won't be
created.

Add another 10 seconds to give the link enough time to initialize.

Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>

Cherry-picked from: 3966a1e1ee
Resolves: #1482185
2017-12-07 15:54:19 +01:00
Harald Hoyer
3178e5d9e6 iscsi: iscsistart -b does not like to be started in parallel
running two instances of "iscistart -b" does not work apparently.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1322209
2016-04-29 13:40:43 +02:00
Harald Hoyer
7ceaad3400 iscsi/iscsiroot: don't evaluate iscsistart -N return value
Start iscsistart -b in the background and wait for the forked shell to
set the marker in tmp in initqueue-finished.
2016-04-07 14:19:04 +02:00
Harald Hoyer
d8caac65a7 crypt/installkernel: install more crypto modules
https://bugzilla.redhat.com/show_bug.cgi?id=1322893
2016-04-06 10:29:51 +02:00
Harald Hoyer
d2846fdcce plymouth/plymouth-pretrigger.sh: also trigger acpi subsystem
Trigger the acpi subsystem. This will ensure hv_vmbus gets loaded before
plymouth is started, which will make the graphics device become
available before plymouth is started too (and the keyboard ! which might
also be important for plymouth in some setups).

https://bugzilla.redhat.com/show_bug.cgi?id=1218130
2016-04-06 10:24:58 +02:00
Harald Hoyer
6414f18c34 network/ifup: fix vlan get_vid() 2016-03-10 14:34:20 +01:00
Harald Hoyer
77359602a2 dracut.spec: remove trailing whitespace 2016-03-10 11:47:20 +01:00
Harald Hoyer
e318a113be fix typo 2016-03-10 11:44:09 +01:00
Harald Hoyer
cba4eac067 iscsiroot: for iscsi_firmware retry, if iscsistart -N fails
If "iscsistart -N" fails, do not continue and declare iscsi started.
2016-03-09 14:13:49 +01:00
Harald Hoyer
6e49e06cfe network/ifup: use the correct interface name for the vlan parent
There is no $phydevice. Use $netif instead.
2016-03-09 14:10:00 +01:00
Harald Hoyer
faa3920f1d network/net-genrules.sh: add physical vlan network interfaces
due to the removal of vlan.info, parse all vlan.*.phy files
2016-03-07 15:44:20 +01:00
Harald Hoyer
44678ee989 dracut: add strglob 2016-02-18 15:45:07 +01:00
Harald Hoyer
386875cc9e add more hyperv kernel modules 2016-01-19 20:00:20 +01:00
Harald Hoyer
ac607d92dc wait_for_if_up(): check for <UP> rather than "state UP"
or LOWER_UP if "state UNKNOWN" or "state DORMANT"
2016-01-19 19:45:32 +01:00
Harald Hoyer
8d32f7965f nfs/install: also add group "nobody" for rpc.idmapd 2016-01-19 19:44:54 +01:00
Harald Hoyer
945b5334ca dracut.8: mention vlan can be specified multiple times 2016-01-19 17:46:56 +01:00
Harald Hoyer
fa870823fe network: handle multiple vlan parameters 2016-01-19 17:06:37 +01:00
Harald Hoyer
6b06a771cf network: handle macaddr and mtu 2016-01-19 17:05:48 +01:00
Harald Hoyer
89cd64a635 dracut: use cpio with -R root:root rather than -R 0:0
if a user with name "0" exists, there is a problem, but who would do
such a thing??

Resolves: rhbz#1049763
2016-01-13 14:24:20 +01:00
Harald Hoyer
e953f9e688 network/ifup: create bond interface, if it does not yet exist
Resolves: rhbz#1263013
2016-01-13 14:20:13 +01:00
Harald Hoyer
5b276e8015 plymouth: add hyperv_fb kernel module 2016-01-13 14:12:24 +01:00
Harald Hoyer
0314ef5451 dracut: set pipefail in the final initramfs creation step
so any error in the last creation step is caught and dracut errors out,
if e.g. there isn't enough space.

Resolves: rhbz#1252449
2016-01-11 10:59:34 +01:00
Harald Hoyer
1984bb42e3 crypt/installkernel: add all kernel modules, regardless of hostonly 2015-07-08 19:24:24 +02:00
Harald Hoyer
417ae3f1ad crypt: add drbg kernel module
https://bugzilla.redhat.com/show_bug.cgi?id=1233683
2015-06-23 13:19:48 +02:00
Harald Hoyer
210431852f base: add "hostname=<hostname>" kernel cmdline parameter
For e.g. lvm, the hostname has to be set, so let there be a kernel
command line parameter for it.
2015-06-05 16:48:10 +02:00
Harald Hoyer
82bafb320b lvm: optionally install thin tools 2015-06-03 15:19:51 +02:00
Harald Hoyer
a3e2bb4eba dracut-functions: degrade message about optional missing install
degrade the message about missing optional install items from a warning
to an info.
2015-06-03 15:19:51 +02:00
Harald Hoyer
6dfff71f85 network: remove ibft parsing from parse-ip-opts 2015-05-28 14:23:58 +02:00
Harald Hoyer
3860f27881 ibft: correct device name 2015-05-28 13:58:23 +02:00
Harald Hoyer
fa3638a353 network: move ibft parsing to own script before main ip opt parsing
This way ibft can generate cmdline params for vlan to be parsed by
parse-vlan.
2015-05-27 13:18:09 +02:00
Harald Hoyer
cf729a109d lvm: install all lvm_*.conf files from /etc/lvm
https://bugzilla.redhat.com/show_bug.cgi?id=1130565
2015-05-11 17:03:07 +02:00
Harald Hoyer
7b991e9702 .dir-locals.el: fixup 2015-05-08 13:50:53 +02:00
Harald Hoyer
936bd1e05f iscsi: start iscsi only for iscsi netroot 2015-05-08 13:50:53 +02:00
Harald Hoyer
1e7a5c2617 iscsi: install timeout jobs for every iscsi netroot 2015-05-08 13:50:53 +02:00
Harald Hoyer
0aa4e3149f iscsi: kill iscsistart after 10 seconds
starting several iscsistart in parallel does not work reliably
2015-05-08 13:48:58 +02:00
Harald Hoyer
bd49ce86ec Defer modprobe of HW modules, until udev is running
Some HW modules need to load firmware via udev.

https://bugzilla.redhat.com/show_bug.cgi?id=1213077

(cherry picked from commit 8fa11b1e58a60d645c065ac20c02263f6c873d62)
2015-04-24 12:00:20 +02:00
Harald Hoyer
75cc5ac016 Add hyperv-keyboard kernel module for Hyper-V Gen2 VM
https://bugzilla.redhat.com/show_bug.cgi?id=1205095
2015-04-24 11:32:48 +02:00
Harald Hoyer
25c7c10c58 ifcfg/write-ifcfg.sh: depend on dhcpopts for dhcp mode 2015-03-17 11:59:01 +01:00
Harald Hoyer
c1b5163c29 ifcfg/write-ifcfg.sh: do not source net.*.override, if it doesn't exist 2015-03-17 11:57:43 +01:00
Harald Hoyer
a8fb48486c ifcfg/write-ifcfg.sh: use the correct interface name for dhcp files
fix a copy & paste error
2015-03-05 10:50:00 +01:00
Harald Hoyer
841fc1e3a7 base/init: don't exit the main loop with waiting jobs
unfinished jobs in the queue can cause unforseen side effects
2015-03-03 18:20:44 +01:00
Harald Hoyer
ec3fd83dc1 TEST-40-NBD: check for nbd kernel module 2015-03-03 18:20:01 +01:00
Harald Hoyer
284c8be768 netroot: do not bail out early 2015-03-03 18:19:44 +01:00
Harald Hoyer
f3763b75dd ifcfg/write-ifcfg.sh: copy over all dhcp lease files
copy over the lease files, regardless of netroot succeeding with that
interface
2015-03-03 15:38:54 +01:00
Harald Hoyer
9877bf26df ifcfg/write-ifcfg.sh: if a lease file is found, BOOTPROTO=dhcp
For all dhcp interfaces, regardless if the root mount was done via this
interface, write out the correct ifcfg file
2015-03-03 12:43:17 +01:00
Harald Hoyer
20b51b686b network/netroot: setup interface correctly, before bailing out
at least setup the interface, even if no netroot has to be done
2015-03-03 12:33:30 +01:00
Harald Hoyer
d3fd23a1e1 45ifcfg/write-ifcfg.sh: clarify DHCPV6 case 2015-03-03 12:31:17 +01:00
Harald Hoyer
97ff4a0003 fips: nss-softokn-freebl has its own dracut module now
https://bugzilla.redhat.com/show_bug.cgi?id=1182297
2015-03-03 11:16:11 +01:00
Harald Hoyer
3559c0b6cf crypt/cryptroot-ask.sh: handle crypttab without ending newline
https://bugzilla.redhat.com/show_bug.cgi?id=1085562
2015-03-03 11:16:11 +01:00
Harald Hoyer
2822eb855a ifcfg/write-ifcfg.sh: write vlan ifcfg files
https://bugzilla.redhat.com/show_bug.cgi?id=1111358
2015-03-03 09:57:30 +01:00
Harald Hoyer
53c46459df dracut.logrotate: remove yearly and increase size
In /etc/logrotate.d/dracut, as currently configured, the 'time' option
will always win out over the 'size' option.

https://bugzilla.redhat.com/show_bug.cgi?id=1005886
2015-03-03 09:41:34 +01:00
Fedora dracut team
adf1849bf9 lvm: also install /etc/lvm/lvm_hostname.conf
enabling hosttags in /etc/lvm/lvm.conf causes new ramdisks to fail to
boot, if no lvm_hostname.conf is specified.

https://bugzilla.redhat.com/show_bug.cgi?id=1130565
2015-03-03 09:28:20 +01:00
Harald Hoyer
197e35b75b fips: add drbg kernel module 2015-02-19 11:10:27 +01:00
Harald Hoyer
ba0b653658 iscsiroot: start iscsistart in the background
Start iscsistart in the background and wait for all instances to exit.
2015-01-08 13:00:50 +01:00
Harald Hoyer
f22abb4b3e dracut-lib: error out on empty parm for parse_iscsi_root() 2015-01-08 12:53:44 +01:00
Harald Hoyer
f53a0f20fd proper debug for netroot and ifup 2014-09-05 16:05:42 +02:00
Harald Hoyer
724674d178 iscsi/iscsiroot: call iscsiroot in the background only once 2014-09-05 14:56:50 +02:00
Harald Hoyer
d65cf005bb iscsi/parse-iscsiroot.sh: honor blacklist for modprobe 2014-09-05 14:56:50 +02:00
Harald Hoyer
def98684d4 init: remove debug log pipe, if loginit process killed 2014-09-05 14:38:10 +02:00
Harald Hoyer
d1e6cd0f30 parse-ip-opts: fixed ibft parsing 2014-09-05 14:37:42 +02:00
Harald Hoyer
d3b8ab7783 fcoe: support multiple fcoe parameters
Fixed rule generation by appending to the rules file.
Allow additional fcoe parameters after fcoe=edd.
2014-09-05 11:32:44 +02:00
Harald Hoyer
f0c92896e7 add kate and emacs per directory config files 2014-09-05 11:21:34 +02:00
Harald Hoyer
95dfe9d02b rootfs-block/install: it's initqueue-timeout not initqueue/timeout 2014-06-02 09:53:02 +02:00
Harald Hoyer
1c5b7848e1 dracut: precreate initqueue hook dirs
modules might want to use the initqueue-timeout to install hooks
2014-06-02 09:52:03 +02:00
Harald Hoyer
40586a2b7b rootfs-block: add support for the rootfallback= kernel cmdline option
backport of the rootfallback= kernel cmdline option

https://bugzilla.redhat.com/show_bug.cgi?id=737687
2014-05-28 15:58:42 +02:00
Harald Hoyer
7ea1b49819 dracut.conf.5: add install_items to man page
also fixed whitespace stuff

https://bugzilla.redhat.com/show_bug.cgi?id=1041484
2014-05-28 15:58:42 +02:00
Harald Hoyer
cb9f6af094 iscsi/parse-iscsiroot.sh: call iscsistart regardless
call iscsistart, even if no network config is given or
- link down temporarily down
- changed MAC address
- replaced/swapped NIC
- misconfigured kernel command line

https://bugzilla.redhat.com/show_bug.cgi?id=1099603
2014-05-28 15:58:42 +02:00
Harald Hoyer
faa17f0921 kernel-modules/installkernel: s/blk_init_queue/blk_cleanup_queue/g
using "blk_cleanup_queue" will pickup also the nvme driver

https://bugzilla.redhat.com/show_bug.cgi?id=1041484
2014-05-28 15:58:42 +02:00
Harald Hoyer
2413fcbc60 git2spec.pl: no signature 2014-05-28 15:58:42 +02:00
Harald Hoyer
a0aeaa381f base/init: set the firmware loading timeout to 600
Kernel defaults to 60, but this might be too low, if the machine is
under heavy load, so we increase this to the udev timeout.
2014-05-28 15:58:12 +02:00
Harald Hoyer
cfc02869e4 base/init: create /dev/btrfs-control
This enables btrfs module auto loading.
2014-02-28 09:27:53 +01:00
Harald Hoyer
b75196ac27 network/parse-ifname.sh: define parse_ifname_opts()
if no "ifname=" parameter was given on the kernel command line, and only
later injected via cmdline.d (e.g. with iBFT), the parse_ifname_opts()
function would not be defined in ifname-genrules.sh .
2014-02-24 15:28:58 +01:00
Harald Hoyer
9a2f5592c5 dracut: create all hookdirs
https://bugzilla.redhat.com/show_bug.cgi?id=1051448
2014-01-20 16:23:22 +01:00
Harald Hoyer
1d85a6fe6d multipath: add rd_NO_MULTIPATH option 2013-11-27 13:18:15 +01:00
Harald Hoyer
dd9b5df3b9 fips: fix RHEV vmlinuz check 2013-11-08 15:06:18 +01:00
Harald Hoyer
afd17a3ec5 fips: install /etc/system-fips and additional hmac files 2013-11-04 17:17:31 +01:00
Harald Hoyer
dbd8c68b7a network/ifname-genrules.sh: fixed DRIVERS udev condition
DRIVERS!="?*" matches any empty string in DRIVERS
DRIVERS=="?*" matches any non-empty string in DRIVERS

So, we can't use != in the conditions
2013-10-15 09:26:32 +02:00
Harald Hoyer
a22c502d86 fcoe: add --link-retry=100 to fipvlan call
Resolves: rhbz#1012316
2013-10-14 17:59:18 +02:00
Harald Hoyer
ee2cd169bd ldd: redirect error to /dev/null 2013-10-14 10:24:46 +02:00
Harald Hoyer
9a35a62bf1 do not turn off biosdevname, if not given on kernel cmdline
https://bugzilla.redhat.com/show_bug.cgi?id=1011508#c10
2013-10-07 16:11:14 +02:00
Harald Hoyer
93d3f433fe network: fixed ibft parsing
https://bugzilla.redhat.com/show_bug.cgi?id=1011508#c2
2013-10-07 16:11:12 +02:00
Harald Hoyer
de176906ff rename /etc/redhat-fips to /etc/system-fips 2013-10-02 12:29:53 +02:00
Harald Hoyer
b9ec6563e7 add /etc/redhat-fips 2013-10-02 12:29:41 +02:00
Harald Hoyer
76fa8652d2 crypt/cryptroot-ask: negate rd_NO_CRYPTTAB
Thanks  Michal Kovarik

https://bugzilla.redhat.com/show_bug.cgi?id=886194
2013-09-03 10:49:01 +02:00
Harald Hoyer
158fab27b7 selinux: give emergency shell, if selinux failed 2013-08-29 14:37:45 +02:00
Harald Hoyer
81134e54ad fcoe: honor "autovlan=yes" 2013-08-29 14:31:27 +02:00
Harald Hoyer
77d76bad4d fcoe: use -f "-fcoe" for fipvlan
https://bugzilla.redhat.com/show_bug.cgi?id=866150
2013-08-29 14:28:41 +02:00
Harald Hoyer
1d71152bd1 crypt/cryptroot-ask.sh: do not use getargbool 2013-08-28 10:08:36 +02:00
Harald Hoyer
754beeddf2 network: rename interfaces properly
https://bugzilla.redhat.com/show_bug.cgi?id=910605
2013-08-14 12:20:00 +02:00
Harald Hoyer
92d595398f dracut.8: add bond and bridge documentation 2013-07-26 12:15:02 +02:00
Harald Hoyer
85dde6406d base: install poweroff and reboot and set aliases with "-f" 2013-07-26 10:25:28 +02:00
Harald Hoyer
7decd80f44 rootfs-block/mount-root.sh: make v really local and unset 2013-07-26 10:17:44 +02:00
Harald Hoyer
e0459b1e97 fips: cope with module aliases, when checking modules
Also do not fail, if module aliases try to load CPU specific modules
like crc32c_intel.
2013-07-26 10:17:35 +02:00
Harald Hoyer
64eb996323 fips: update kernel module list 2013-07-25 11:07:47 +02:00
Harald Hoyer
991a8728d0 plymouth: remove cryptroot-ask.sh, which is provided by 90crypt 2013-07-22 10:38:05 +02:00
Harald Hoyer
3b4bc498e1 git2spec.pl: format-patch on RHEL-6 does not understand --no-signature 2013-07-18 15:19:04 +02:00
Harald Hoyer
e654485a8e Improve lsinitrd and add lsinitrd manpage 2013-07-18 15:19:04 +02:00
Harald Hoyer
1636712f09 dracut: add xhci-hcd driver
https://bugzilla.redhat.com/show_bug.cgi?id=960729
2013-07-18 15:19:04 +02:00
Harald Hoyer
581452062f fips: handle checksum checks for RHEV kernels
https://bugzilla.redhat.com/show_bug.cgi?id=947729
2013-07-18 15:19:04 +02:00
Harald Hoyer
a2c0b852a0 Install multipath module only, when root is multipath in generic mode
Even in the generic mode, we don't want to install the multipath module,
if the root device is not multipathed, because it would always have to
be synced with the real root.

Also install /etc/multipath-root.conf /etc/multipath-root/*
/etc/xdrdevices-root.conf, if present, in the initramfs as the files
without "-root", taking priority over the normal files.

https://bugzilla.redhat.com/show_bug.cgi?id=916144
2013-07-18 15:19:04 +02:00
Harald Hoyer
1cb33f3954 Start iscsi regardless of network, if requested
https://bugzilla.redhat.com/show_bug.cgi?id=813687
2013-07-18 15:19:04 +02:00
Harald Hoyer
f2c3a039da crypt: add support for keyfiles in the initramfs
https://bugzilla.redhat.com/show_bug.cgi?id=886194
2013-07-18 15:19:03 +02:00
Harald Hoyer
e1fd8dd119 lvm: add "--yes" to lvchange
https://bugzilla.redhat.com/show_bug.cgi?id=720684
2013-07-18 15:19:03 +02:00
Vladislav Bogdanov
93950912ea add bonding
Format:
bond=<bondname>[:<bondslaves>:[:<options>]]

bondslaves is a comma-separated list of physical (ethernet) interfaces.

options is a comma-separated list on bonding options (modinfo bonding for
details) in format compatible with initscripts.

If options include multi-valued arp_ip_target option, then its values
should be separated by semicolon.

bond without parameters assumes bond=bond0:eth0,eth1:balance-rr

Conflicts:
	modules.d/40network/check
	modules.d/40network/install
	modules.d/40network/installkernel
	modules.d/40network/parse-bridge.sh
	modules.d/45ifcfg/write-ifcfg.sh

https://bugzilla.redhat.com/show_bug.cgi?id=851666
2013-07-18 15:19:03 +02:00
Harald Hoyer
0fa047fcf1 add mkinitrd man page
https://bugzilla.redhat.com/show_bug.cgi?id=610462
2013-07-18 11:35:06 +02:00
Harald Hoyer
36d52d765e dracut: unset LD_LIBRARY_PATH and GREP_OPTIONS
LD_LIBRARY_PATH and GREP_OPTIONS can influence the image creation,
if set to user defined values, so unset it.

https://bugzilla.redhat.com/show_bug.cgi?id=912299
2013-02-18 12:31:16 +01:00
Harald Hoyer
5f99314801 base/initqueue: exit 0 2013-02-12 10:22:27 +01:00
Harald Hoyer
a77208565d dracut.sh: create the initramfs non-world readable 2013-02-11 12:05:31 +01:00
Harald Hoyer
a74acc38e2 kernel-modules/installkernel: adding scsi_dh_alua to hardcoded list of drivers
https://bugzilla.redhat.com/show_bug.cgi?id=890081
2013-01-09 14:18:57 +01:00
Harald Hoyer
f52ee9073e add VLAN support 2012-10-19 12:14:56 +02:00
Harald Hoyer
9ea87dfdad dmsquash-live/parse-dmsquash-live.sh: fixed typo 2012-10-19 12:14:55 +02:00
Harald Hoyer
8485c3205f dracut: only 'warn' not 'error', if we don't strip 2012-10-19 12:14:55 +02:00
Harald Hoyer
e92ca555bf dracut.spec: add 02-fips.conf with 'do_strip=no' 2012-10-19 12:14:51 +02:00
Harald Hoyer
ff53445872 testsuite fixups 2012-10-12 11:59:41 +02:00
Harald Hoyer
dbc92d85f2 nfs/install: don't install nss3.so
nss3.so has nothing to do with the desired nss_*.so files
2012-10-12 11:59:41 +02:00
Harald Hoyer
90e189b042 network/netroot: don't copy empty dhcp files 2012-10-12 11:59:41 +02:00
Harald Hoyer
8a3fe63a08 network/netroot: only netroot for bootdev, if present 2012-10-12 11:59:41 +02:00
Harald Hoyer
0ec43d7a56 network/netroot: activate debug output for rddebug 2012-10-12 11:59:41 +02:00
Harald Hoyer
3bbd0c7764 network/parse-ip-opts.sh: relax bootdev handling 2012-10-12 11:59:41 +02:00
Harald Hoyer
00056957bf dmsquash-live/dmsquash-live-root: add "no_eject" parameter
https://bugzilla.redhat.com/show_bug.cgi?id=843105
2012-10-12 11:59:41 +02:00
Harald Hoyer
6bc37a9952 Convert MAC addresses to lowercase with "tr"
https://bugzilla.redhat.com/show_bug.cgi?id=835646
2012-10-12 11:59:40 +02:00
Harald Hoyer
019b3f0277 Document "rd_retry" parameter and set default to 40 seconds.
https://bugzilla.redhat.com/show_bug.cgi?id=823507
2012-10-12 11:59:40 +02:00
Harald Hoyer
0147a3be17 fcoe/fcoe-up: sleep for 3s to allow dcb negotiation
https://bugzilla.redhat.com/show_bug.cgi?id=813057
2012-10-12 11:59:40 +02:00
Harald Hoyer
6dd298ff9b dracut-functions: create relative symlinks in the initramfs
Resolves: rhbz#857048
2012-10-12 11:59:40 +02:00
Harald Hoyer
90689543da strip kernel modules in the initramfs by default
https://bugzilla.redhat.com/show_bug.cgi?id=854416

Do not strip binaries which have a .<bin>.hmac file
2012-10-12 11:59:29 +02:00
Harald Hoyer
7596b72b39 dmsquash-live: enable live boot with "netroot:iscsi:..." 2012-09-20 14:26:22 +02:00
Harald Hoyer
f22f08d857 fips: set /boot as symlink to /sysroot/boot if no boot= parameter
otherwise sha512hmac will error out with:

sha512hmac -c /sysroot/boot/.vmlinuz-2.6.32-220.el6.x86_64.hmac
Error opening "/boot/vmlinuz-2.6.32-220.el6.x86_64": No such file or directory.
2012-08-21 15:04:30 +02:00
Harald Hoyer
6efc9e13be Revert "99base/init: mount with sane defaults"
This reverts commit 0269b775fc.

https://bugzilla.redhat.com/show_bug.cgi?id=831338
2012-07-16 10:24:19 +02:00
Harald Hoyer
39086d914f mdraid: fix raid assembly for timeout
array_state was never "|incomplete" but the raid was not active/running
on a degraded array, so the timeout hook was never installed
2012-04-27 11:05:30 +02:00
Harald Hoyer
51b048c3e4 use git to apply specfile patches 2012-04-19 11:31:27 +02:00
Harald Hoyer
d2ea3cac52 iscsi/iscsiroot: do not check for interfaces
https://bugzilla.redhat.com/show_bug.cgi?id=813687
2012-04-19 11:21:22 +02:00
Harald Hoyer
cfe414dce8 iscsi/iscsiroot: fixed iface.iscsi_ifacename param 2012-03-29 10:05:58 +02:00
Harald Hoyer
c76de095b2 iscsi/parse-iscsiroot.sh: don't fail for "netroot=iscsi iscsi_firmware" 2012-03-28 17:25:02 +02:00
Harald Hoyer
1587cc7724 TEST-50-MULTINIC: refine error message 2012-03-28 16:09:21 +02:00
Harald Hoyer
15097b4ab9 TEST-40-NBD: add check for nbd-server binary 2012-03-28 16:09:21 +02:00
Harald Hoyer
f3516c8db5 TEST-12-RAID-DEG: start with fresh copies of the test disk 2012-03-28 16:09:21 +02:00
Harald Hoyer
3c12f005f8 iscsi: add support for interface binding
The iscsi root parameter can now have "<iscsi_iface_name>" and
"<netdev_name>".

netroot=iscsi:[<servername>]:[<protocol>]:[<port>]:[<iscsi_iface_name>]:[<netdev_name>]:[<LUN>]:<targetname>
2012-03-28 16:09:21 +02:00
Harald Hoyer
2cfbfbba06 iscsiroot: whitespace cleanup 2012-03-28 12:31:04 +02:00
Harald Hoyer
6410b72af6 90kernel-modules/installkernel: fixed module filtering 2012-03-05 12:31:11 +01:00
Harald Hoyer
2396effc41 99base/dracut-lib.sh: wait_for_if_up() increase wait time to 10s 2012-03-02 11:07:43 +01:00
Harald Hoyer
0269b775fc 99base/init: mount with sane defaults 2012-03-01 18:21:11 +01:00
Harald Hoyer
dd8d25ba3e lsinitrd: require "file" and test for xz 2012-03-01 17:59:57 +01:00
Harald Hoyer
1fd259f340 dracut: add "--omit-driver"
https://bugzilla.redhat.com/show_bug.cgi?id=722879
2012-03-01 17:52:18 +01:00
Harald Hoyer
96bfc02133 50plymouth/plymouth-pretrigger.sh: respect primary console setting
The kernel's primary console device is determined by the last "console="
argument on the kernel command line. This setting should be respected by
dracut-generated initial RAM disks.

Steps to Reproduce:
(Easiest using a KVM VM, virt-manager and "virsh console")
1. Boot with a kernel command line ending in
 console=tty0 console=ttyS0,115200
2. Observe both tty0 and ttyS0.

The output of init scripts is sent to ttyS0, as the final "console="
argument determines the primary console device as per
Documentation/serial-console.txt in the kernel sources.

https://bugzilla.redhat.com/show_bug.cgi?id=752073
2012-02-15 09:15:55 +01:00
Harald Hoyer
8cdad31667 lsinitrd: update to upstream version
https://bugzilla.redhat.com/show_bug.cgi?id=752005
2012-02-15 09:15:55 +01:00
Harald Hoyer
0cd9406149 redirect "udevadm settle" output to /dev/null
https://bugzilla.redhat.com/show_bug.cgi?id=747840
2012-02-15 09:14:19 +01:00
Harald Hoyer
2e1cccc9ca fcoe: do not require vconfig
https://bugzilla.redhat.com/show_bug.cgi?id=714039
2012-02-15 09:14:06 +01:00
Harald Hoyer
418b762dc2 dracut.8: fixed FILES section
https://bugzilla.redhat.com/show_bug.cgi?id=703164
2012-02-15 09:13:41 +01:00
Harald Hoyer
8e08cf65ab test/TEST-12-RAID-DEG: refine test 2012-02-15 09:13:41 +01:00
Harald Hoyer
d3b8373f4a 90mdraid/65-md-incremental-imsm.rules: do not depend on rd_MDADMCONF for
timeout
2012-02-15 09:13:41 +01:00
Harald Hoyer
655d9cb4a3 90mdraid/mdcontainer_start.sh: do not start with "-I" 2012-02-15 09:13:41 +01:00
Harald Hoyer
386d61d344 dracut: only source "install", if available
If "install" is not there or executable, do not source it.
2012-02-15 09:13:41 +01:00
Harald Hoyer
c99fbb55e4 Revert "90mdraid/mdadm_auto.sh: incrementally autoassemble"
This reverts commit 6b08647649.
2012-02-15 09:13:41 +01:00
Harald Hoyer
cbc8b70f7a 95iscsi/iscsiroot: unset used variables before starting
If iscsiroot is called multiple times, then some variables can hold the
values of a previous call, so unset all variables before using them.

https://bugzilla.redhat.com/show_bug.cgi?id=752066
https://bugzilla.redhat.com/show_bug.cgi?id=752005
2012-02-15 09:13:08 +01:00
Harald Hoyer
b405725794 40network/ifup: add "brd +" to "ip addr add"
Unlike "ifconfig", the "ip" command does not set a broadcast address
unless explicitly requested.

add "brd +" to make "ip" calculate the broadcast address on the fly

backport of commit d1b7efd578

https://bugzilla.redhat.com/show_bug.cgi?id=75258
2011-11-15 11:57:59 +01:00
Harald Hoyer
76766f9fab 40network/ifup: increase RDRETRY, if we do dhcp to wait longer
https://bugzilla.redhat.com/show_bug.cgi?id=742920
2011-11-04 16:12:17 +01:00
Harald Hoyer
dfd0775ce1 45ifcfg/write-ifcfg.sh: check for existance of /tmp/net.$netif.override
check for existance of /tmp/net.$netif.override before sourcing it

https://bugzilla.redhat.com/show_bug.cgi?id=696980
2011-11-04 10:22:59 +01:00
Harald Hoyer
69c9fb1122 95iscsi: hardcode modprobe a bunch of iscsi offload kernel drivers 2011-10-18 10:04:42 +02:00
Harald Hoyer
278cc2e163 99base/dracut-lib.sh: fixed killproc() 2011-10-18 10:04:27 +02:00
Harald Hoyer
76904bf6d2 iscsi: install iscsi_boot_sysfs kernel module 2011-10-10 13:32:30 +02:00
Harald Hoyer
4fa79aedff fcoe/iscsi: udevadm settle after module loading 2011-10-10 13:31:42 +02:00
Harald Hoyer
9db27c4679 TEST-40-NBD: relax check for fsoptions 2011-10-07 09:05:41 +02:00
Harald Hoyer
531df99049 95fcoe/fcoe-up: load 8021q module before fipvlan
https://bugzilla.redhat.com/show_bug.cgi?id=736094
2011-10-06 11:44:40 +02:00
Harald Hoyer
676a8c4262 10redhat-i18n: optionally install console_init 2011-10-06 11:44:17 +02:00
Harald Hoyer
584ee33fa0 iscsi: kill iscsiuio
https://bugzilla.redhat.com/show_bug.cgi?id=701864
2011-09-28 16:03:40 +02:00
Harald Hoyer
94b12823ad dracut-lib.sh: add killproc() 2011-09-28 16:02:59 +02:00
Harald Hoyer
b3d287ae35 99base/selinux-loadpolicy.sh: use "-F" for restorecon
https://bugzilla.redhat.com/show_bug.cgi?id=741430
2011-09-28 15:45:24 +02:00
Harald Hoyer
011800434a create var/log
https://bugzilla.redhat.com/show_bug.cgi?id=701864
2011-09-23 14:15:24 +02:00
Harald Hoyer
c1cb0de4d5 02fips-aesni: add fips with aesni-intel 2011-09-23 14:15:24 +02:00
Harald Hoyer
bb2981ef4e dm/dmsquash-live: check for dmsetup 2011-09-21 13:11:27 +02:00
Harald Hoyer
e88e72e77e network: allow multiple ip autoconf options
it should now be able to configure IPv6 autoconfiguration and run a IPv4
dhcp client "ip=eth0:auto6,dhcp"
2011-09-20 20:43:19 +02:00
Harald Hoyer
6794a14d78 dm/lvm/dmraid: cleanup installation 2011-09-20 17:49:50 +02:00
Harald Hoyer
108d50e915 mdraid+lvm: order timeout queue execution 2011-09-20 16:59:09 +02:00
Harald Hoyer
6b08647649 90mdraid/mdadm_auto.sh: incrementally autoassemble
moved "mdadm -As --run" to the timeout script
2011-09-20 16:36:19 +02:00
Harald Hoyer
02762f03af 95iscsi/parse-iscsiroot.sh: fixed iscsi_tcp module loading
modprobing bnx2i provided the sysfs dir, the iscsi_tcp modprobing was
testing for, so iscsi_tcp was never loaded.

https://bugzilla.redhat.com/show_bug.cgi?id=737479
2011-09-19 10:57:56 +02:00
Harald Hoyer
b74e7abd6c 95fcoe: support bnx2fc
To start bnx2fc, we need to run fipvlan only and not dcbtool.  DCBX is run
automatically in the hardware, but VLAN discovery needs to be started by
fipvlan.

https://bugzilla.redhat.com/show_bug.cgi?id=736094
2011-09-09 14:02:00 -07:00
Harald Hoyer
dd8a1899b7 selinux-loadpolicy: hide info message, if selinux is disabled
https://bugzilla.redhat.com/show_bug.cgi?id=659076
2011-09-09 14:02:00 -07:00
Harald Hoyer
2e03ba69ee 90mdraid/65-md-incremental-imsm.rules: incremental run to settled
move incremental run to settled queue again

https://bugzilla.redhat.com/show_bug.cgi?id=732967
2011-08-24 17:07:15 +02:00
Harald Hoyer
229525f896 modules.d/90dm: use "dmsetup" to find lib dir
https://bugzilla.redhat.com/show_bug.cgi?id=732686
2011-08-23 14:53:15 +02:00
Harald Hoyer
5678b583f3 iscsi: bnx2i 2011-08-18 15:52:32 +02:00
Harald Hoyer
112cd50eba 90dm/dm-pre-udev.sh: load dm-mirror module 2011-08-05 14:24:32 +02:00
Harald Hoyer
9ee1b78fcb modules.d/90dm: install libdevmapper-event* for 90dm 2011-08-05 14:24:31 +02:00
Harald Hoyer
d239bca13f 99base/selinux-loadpolicy.sh: execute chrooted commands with LANG=C
the console is not yet setup correctly to display e.g. japanese

https://bugzilla.redhat.com/show_bug.cgi?id=712254
2011-08-05 14:24:31 +02:00
Harald Hoyer
f5e4937240 01fips/installkernel: add dm-mod and dm-crypt to the fipsmodules
https://bugzilla.redhat.com/show_bug.cgi?id=707609
2011-08-05 14:24:31 +02:00
Ian Dall
0f5b9bad74 95fstab-sys: mount all /etc/fstab.sys volumes before switch_root
A new dracut module to implement fstab.sys handling

This module implements fstab.sys handling. This has to happen after the root
mount and before the nfsroot-cleanup pre-pivot at least. I've made to happen at
the beginning of the pre-pivot scripts, although it should maybe be at the end
of the mount scripts. This latter would be harder to do because the actual
mount is currently done by 99mount-root.sh and there is no 2 digit integer
higher than 99 :-(

There are perhaps other ways of achieving this end, such as having the
nfsroot-cleanup trawl through the newroot's /etc/fstab and auto-magically
figure out if there are any mounts which are pre-requisites for the
/var/lib/nfs/rpc_pipefs mount and do them first. Likewise post pivot,
/etc/rc.sysinit could figure out of there are any pre-requisite mounts for
/var/lib/stateless/{writeable,state} before doing those mounts. In short, make
it the responsibility of anything doing a mount to check if there are any
pre-requisites in /etc/fstab and mount them first. However, this spreads the
changes needed over more places, so I favour the fstab.sys approach. Also, who
knows what other uses administartors may have put fstab.sys to? and this undoes
a regression caused by the move from mkinitrd to dracut.
2011-08-05 14:24:31 +02:00
Harald Hoyer
edcd4c2bd7 90lvm/lvm_scan.sh: use "--partial" to force assembly incomplete VGs
If our internal loop counter is bigger than half of the maximum
count, try to assemble lvm device partially with the "--partial"
option.

https://bugzilla.redhat.com/show_bug.cgi?id=723548
2011-08-05 14:24:31 +02:00
Harald Hoyer
89f35f9df1 90lvm/lvm_scan.sh: fixed lvm version parsing 2011-08-05 14:24:31 +02:00
Harald Hoyer
25e1d28d75 lvm: use --sysinit, if lvm version >= v2.02.65 2011-08-05 14:24:30 +02:00
Harald Hoyer
c0f212dbbc 90mdraid: move force assembly to timeout initqueue 2011-08-05 14:24:30 +02:00
Harald Hoyer
ff349b0812 99base: add timeout queue
timeout queue is executed after half of the maximum retry count and if
jobs are found there, the counter is reset to zero.
2011-08-05 14:24:30 +02:00
Harald Hoyer
a223be3c54 inc TEST disk size 2011-08-05 14:24:30 +02:00
Harald Hoyer
28b5496083 Makefile: add "rpm" and "syncheck" target 2011-08-05 14:24:30 +02:00
Harald Hoyer
0a5ac37bc3 iscsi: find iscsi kernel modules by symbol names 2011-05-04 10:20:47 +02:00
Harald Hoyer
ba4b902a70 doc: clarify iscsi_firmware parameter usage 2011-04-27 09:10:45 +02:00
Harald Hoyer
a0ea3ac575 network/parse-ip-opts.sh: fix ifname for ibft with all args 2011-04-26 23:22:41 +02:00
Harald Hoyer
1444e3e777 network/net-genrules.sh: also honor rename events 2011-04-26 23:21:58 +02:00
Marian Ganisin
f9833db0ca don't overwrite ifname=
[Harald Hoyer <harald@redhat.com>: replaced grep with strstr]
[Harald Hoyer <harald@redhat.com>: handle multiple ifname= arguments]
2011-04-26 16:45:04 +02:00
Marian Ganisin
c0d440be71 skip condition fixed 2011-04-26 16:45:04 +02:00
Marian Ganisin
c1d82f2cac correct module name 2011-04-26 16:45:04 +02:00
Harald Hoyer
9259945f93 fixed testsuite 2011-04-20 15:49:30 +02:00
Harald Hoyer
ab6977f0a6 mdraid/mdraid_start.sh: removed "local" in non-function
https://bugzilla.redhat.com/show_bug.cgi?id=698215
2011-04-20 15:37:21 +02:00
Harald Hoyer
40104e4a2b mdraid: do not call mdadm -I with "--no-degraded"
https://bugzilla.redhat.com/show_bug.cgi?id=698165
2011-04-20 15:37:21 +02:00
Harald Hoyer
a10364d4ee let rpc user own /var/lib/rpcbind
https://bugzilla.redhat.com/show_bug.cgi?id=698160
2011-04-20 15:37:21 +02:00
Harald Hoyer
18a6ce9d25 dracut, fips: pre_un_link binaries, if fips module was included 2011-04-20 12:11:36 +02:00
Harald Hoyer
6b3248074b network: only require bootdev for netroot=dhcp or netroot=dhcp6 2011-04-20 12:11:36 +02:00
Harald Hoyer
d31ba0f55e iscsi: set initiator from ibft, if possible 2011-04-20 12:11:32 +02:00
Harald Hoyer
ead064e33d fcoe: moved edd detection to settled initqueue
At the time of modprobing edd, all pci devices must exist and have to be
initialized for the symlinks to work.
2011-04-19 13:54:33 +02:00
Harald Hoyer
5018463c5e fips: also support FIPS on separate LVM partition 2011-04-19 13:54:33 +02:00
Harald Hoyer
13e2ceeed9 fips: use small settle loop to get /boot 2011-04-13 14:35:57 +02:00
Harald Hoyer
22f07c112d fips: "set -e" has no effect, if we use "||" 2011-04-13 14:35:54 +02:00
Harald Hoyer
6ff9d5e086 fips: make fips work with encrypted root and seperate boot 2011-04-11 12:05:22 +02:00
Harald Hoyer
592dabba90 fips: moved to pre-pivot to support /boot in / 2011-04-08 12:28:42 +02:00
Harald Hoyer
bf57d7f563 dracut.spec: update 2011-04-08 12:10:11 +02:00
Harald Hoyer
c61cec19fa fcoe/parse-fcoe.sh: s#source#.#g
dash does not understand "source"
2011-04-08 10:21:14 +02:00
Harald Hoyer
42720f51f0 dracut.8: add fips documentation 2011-04-06 11:32:43 +02:00
Harald Hoyer
412ff7139b fips: add "rd.fips.skipkernel" boot option 2011-04-06 11:32:24 +02:00
Harald Hoyer
d350485721 dracut: fix path to strip kernel modules
https://bugzilla.redhat.com/show_bug.cgi?id=691944
2011-04-06 10:52:30 +02:00
Harald Hoyer
6d3cc779c6 iscsi: add additional hardcoded modules
https://bugzilla.redhat.com/show_bug.cgi?id=692781
https://bugzilla.redhat.com/show_bug.cgi?id=689694
2011-04-06 10:51:47 +02:00
Harald Hoyer
4ac0cbad25 fips: fixed "boot=<dev>" handling 2011-03-30 15:29:05 +02:00
Harald Hoyer
3bc65506b0 add caps module, to drop capabilities
This adds the following parameters:
rd.caps=1
	turn the caps module on/off
rd.caps.initdrop=cap_sys_module,cap_sys_rawio
	drop the specified comma seperated capabilities
rd.caps.disablemodules=1
	turn off module loading
rd.caps.disablekexec=1
	turn off the kexec functionality

If module loading is turned off, all modules have to be loaded in the
initramfs, which are used later on. This can be done with
"rdloaddriver="
rdloaddriver=autofs4,sunrpc,ipt_REJECT,nf_conntrack_ipv4,....

Because the kernel command line would get huge with all those drivers, I
recommend to make use of $initramfs/etc/cmdline.

So, all rd.caps.* and rdloaddriver arguments are in caps.conf can be
copied to $initramfs/etc/cmdline with "-i caps.conf /etc/cmdline".

Also all modules have to be loaded in the initramfs via "--add-drivers".

The resulting initramfs creation would look like this:

  --add-drivers "autofs4 sunrpc ipt_REJECT nf_conntrack_ipv4 \
  nf_defrag_ipv4 iptable_filter ip_tables
  ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack
  ip6table_filter ip6_tables dm_mirror dm_region_hash dm_log uinput ppdev
  parport_pc parport ipv6 sg 8139too 8139cp mii i2c_piix4 i2c_core ext3
  jbd mbcache sd_mod crc_t10dif sr_mod cdrom ata_generic pata_acpi ata_piix
  dm_mod" \
  /boot/initramfs-caps.img
2011-03-10 13:05:39 +01:00
Harald Hoyer
60e4486b53 rdblacklist, rdinsmodpost, rdloaddriver: accept comma separated list 2011-03-09 21:54:13 +01:00
Harald Hoyer
bea581515c dracut: make "-i, --include SOURCE TARGET" work for files, too 2011-03-09 21:54:12 +01:00
Harald Hoyer
6fa9f8b150 init: cause a kernel panic, rather than sleep forever in emergency 2011-03-04 11:38:08 +01:00
Harald Hoyer
cda0d40758 init: display emergency warning with "warn()" instead of "echo" 2011-03-04 11:37:19 +01:00
Harald Hoyer
85d7ac93e9 init: die if /.die is present 2011-03-04 11:36:35 +01:00
Harald Hoyer
0ce3429c6b init: turn off "-e" mode in emergency 2011-03-04 11:35:57 +01:00
Harald Hoyer
902dc2cb20 base/dracut-lib.sh: fix "die()"
die() now enters emergency mode and displays message there after
plymouth was stopped.
2011-03-04 11:34:44 +01:00
Harald Hoyer
1817cb215d selinux: on failure "die" rather than sleep
This ensures, that plymouth is stopped and the message can be seen.
2011-03-04 11:33:23 +01:00
Harald Hoyer
cfb4747e57 lvm: move emergency script from 00 to 90 2011-03-04 11:32:58 +01:00
Harald Hoyer
e45a2dba9d crypt: fix emergency script generation 2011-03-04 11:32:32 +01:00
Harald Hoyer
c4634f5bb4 plymouth: execute emergency script first
The boot screen has to be shown on emergency first.
2011-03-04 11:31:36 +01:00
Harald Hoyer
cf3d51ba6a fips: only trigger udev, if boot device is not yet present 2011-03-04 11:31:02 +01:00
Harald Hoyer
2af86a7080 fips: hardcode install of libcrypto.* and libssl.* 2011-03-02 16:47:58 +01:00
Harald Hoyer
44e90e5c5a install .hmac files if present 2011-03-02 16:06:04 +01:00
Harald Hoyer
b5b5ff12a8 fips: install fipscheck 2011-03-02 15:00:34 +01:00
Harald Hoyer
e2f1c1f88c fips/fips.sh: unbashify if clause 2011-03-02 14:59:36 +01:00
Harald Hoyer
5a2034943d fips/installkernel: turn off hostonly mode for fipsmodules 2011-03-02 14:59:01 +01:00
Harald Hoyer
7e7308158c fips: do not load tcrypt with "noexit" parameter
"noexit=1" is the default mode for the tcrypt module now.
2011-03-02 11:17:22 +01:00
Christian Heinz
663ea6df17 fix installation of `modules.builtin.bin'
`modules.builtin.bin' is installed like a regular file, thereby ending
up in the wrong place when `--kmoddir' is in effect. Fix this by
specifying the installation destination.
2011-03-02 11:17:21 +01:00
Amadeusz Żołnowski
3901c9c45a suppress modprobe errors on builtins (credits to Kay Sievers)
Install /lib/modules/$kv/modules.builtin.bin to suppress modprobe error
messages saying module was not found, while it's built-in.

Credits go to Kay Sievers who enlighten us about meaning of this cool
file.
2011-03-02 11:17:21 +01:00
Harald Hoyer
33b00dd5d3 dracut-functions: fail instmods() for fips module
instmods should return != 0, if no module was installed in the
initramfs.
2011-03-02 11:09:52 +01:00
Harald Hoyer
ae35574230 fips: add "xts gf128mul" to FIPSMODULES
https://bugzilla.redhat.com/show_bug.cgi?id=670925
2011-02-28 09:13:41 +01:00
Harald Hoyer
8a886909d0 fix "install" execution bit 2011-02-25 13:00:14 +01:00
Harald Hoyer
75cffbd155 dracut.spec: add logrotate file 2011-02-25 13:00:08 +01:00
Harald Hoyer
a9ebf4e13c dracut: log more messages 2011-02-25 12:50:31 +01:00
Harald Hoyer
3539eec0c1 dracut-functions: add date to logfile messages 2011-02-25 12:48:25 +01:00
Harald Hoyer
dc3066da86 dracut-functions: check if logfile dir is writable 2011-02-25 12:47:50 +01:00
Harald Hoyer
c73bba03f8 parse-biosdevname: put parenthesis around BIOSDEVNAME env var 2011-02-25 12:06:15 +01:00
Harald Hoyer
c3a4119beb dracut-rhel6.xml: update 2011-02-18 09:07:51 +01:00
Harald Hoyer
e8a848333f add dracut html documentation 2011-02-17 11:56:56 +01:00
Harald Hoyer
8a6939656f dracut-functions: write to $HOME/dracut.log instead of /tmp/dracut.log 2011-02-08 18:05:41 +01:00
Harald Hoyer
a735202636 biosdevname: unbashify parse-biosdevname.sh 2011-02-08 12:28:37 +01:00
Harald Hoyer
8c4549ff18 multipath: use new "-B" parameter 2011-02-03 12:18:28 +01:00
Harald Hoyer
ca77f36f8e fips: add aes-xts module 2011-02-03 12:17:42 +01:00
Harald Hoyer
f4dad88085 base: install "less" optionally 2011-01-28 13:26:03 +01:00
Harald Hoyer
cbea975b98 fips: install .hmac files for cryptsetup and libs 2011-01-26 13:53:43 +01:00
Harald Hoyer
26c4321fa9 add 97biosdevname dracut module 2011-01-26 13:39:07 +01:00
Harald Hoyer
2f25c3f4a5 fcoe/parse-fcoe.sh: removed second else 2010-12-08 13:46:25 +01:00
Harald Hoyer
0828d4c357 network: add iBFT interface configuration 2010-12-08 13:08:40 +01:00
Harald Hoyer
70dfe537d2 fcoe: add EDD parsing 2010-12-08 13:08:39 +01:00
Harald Hoyer
810270eb00 multipath: install by default, but run only if wwids are present 2010-12-08 13:08:39 +01:00
Harald Hoyer
aee0e16994 multipath/install: install the complete /etc/multipath directory
Resolves: rhbz#630911
2010-12-08 13:08:39 +01:00
Harald Hoyer
d084697710 mkinitrd-dracut.sh: add "--force"
Resolves: rhbz#626389

Conflicts:

	mkinitrd-dracut.sh
2010-12-08 13:08:39 +01:00
Harald Hoyer
1d942b8875 dracut-functions: filter_kernel_modules() search in extra dirs
search also in "extra" and "weak-updates" for kernel modules
https://bugzilla.redhat.com/show_bug.cgi?id=622641
2010-12-08 13:08:37 +01:00
Harald Hoyer
f8dd8dcf14 mdraid/parse-md.sh: create new rules, then mv to old one
If udevd is already running, then we should assemble the new rules files
in a seperate file first, before calling it *.rules

Resolves: rhbz#595096
2010-12-07 11:01:42 +01:00
Peter Rajnoha
d3898996b0 *.rules: honor DM_UDEV_DISABLE_OTHER_RULES_FLAG
honour the DM_UDEV_DISABLE_OTHER_RULES_FLAG which is set by
libdevmapper/LVM directly for devices that should be skipped.
2010-12-07 11:00:13 +01:00
Harald Hoyer
7cfd77a0f1 add 96insmodpost dracut module
due to popular demand, this module loads a custom kernel module, after the
first udev settle (all basic device drivers loaded)
2010-12-07 10:54:49 +01:00
Harald Hoyer
e48ff7a5ef dmraid: switch to rd_NO_MDIMSM, if no mdadm installed 2010-08-23 14:57:56 +02:00
Harald Hoyer
a2c1759356 dm: install all md/dm* kernel modules 2010-08-23 11:01:04 +02:00
Harald Hoyer
d06ffa49ac mkinitrd: do not call dracut in host only mode 2010-08-23 10:36:46 +02:00
Harald Hoyer
63de73ece6 dracut-functions: filter_kernel_modules() search in extra dirs
search also in updates and weak-updates for kernel modules
https://bugzilla.redhat.com/show_bug.cgi?id=622641
2010-08-10 15:54:03 +02:00
Harald Hoyer
5ee37e0ab4 crypt: strip "luks-" from rd_LUKS_UUID 2010-07-29 17:47:17 +02:00
Harald Hoyer
f35ef174ca selinux: fixed error handling for load-policy
{} | cmd opens a subshell for {}
2010-07-29 17:47:17 +02:00
Harald Hoyer
46b58d1eef init: do not umask 2010-07-29 17:47:17 +02:00
Harald Hoyer
a35aefbf1a fcoe: add sleeps to fcoe-up 2010-07-29 16:53:58 +02:00
Harald Hoyer
1c1f927e29 lvm: wait for all rd_LVM_LV and rd_LVM_VG specified to appear 2010-07-29 16:53:57 +02:00
Harald Hoyer
2a951b1010 mknod with mode and set umask for the rest 2010-07-29 16:53:57 +02:00
Harald Hoyer
c30d8d49cd crypt: wait for all rd_LUKS_UUID disks to appear
Also give a hint in emergency, if one disk is not found.
2010-07-29 16:53:57 +02:00
Harald Hoyer
2df596227c crypt/parse-crypt.sh: fix end label for luks udev rules 2010-07-29 16:53:57 +02:00
Harald Hoyer
863e5f75a7 crypt: removed default 70-luks.rules 2010-07-29 16:53:57 +02:00
Harald Hoyer
b30302eba2 crypt: assemble 70-luks.rules dynamically 2010-07-29 16:53:56 +02:00
Harald Hoyer
e0c31e098e plymouth: depend on crypt, if cryptsetup exists 2010-07-29 16:53:56 +02:00
Harald Hoyer
92f0589585 dmsquash-live: do not umount /dev/.initramfs/live for cdrom_id to work 2010-07-29 16:53:56 +02:00
Harald Hoyer
9426b6be6a dm: load dm_mod if device-mapper not in /proc/misc 2010-07-29 16:53:56 +02:00
Harald Hoyer
711e599ee3 dmsquash-live: depend on dm module 2010-07-29 16:53:56 +02:00
Harald Hoyer
6e42a506b5 fcoe: moved fcoeup to initqueue (udev timeouts) 2010-07-29 16:53:55 +02:00
Harald Hoyer
179acdbf1e dmsquash-live: mount live image at /dev/.initramfs/live 2010-07-29 16:53:55 +02:00
Harald Hoyer
81160d216e dmsquash, resume: do not name the /dev/.udev/rules like the /etc ones 2010-07-29 16:53:55 +02:00
Harald Hoyer
94d70b3724 dracut-functions: use LC_ALL=C rather than LANG=C 2010-07-29 16:53:55 +02:00
Harald Hoyer
77818e694f dracut-functions: set LANG=C for ldd output parsing 2010-07-29 16:53:55 +02:00
Harald Hoyer
52ce3484e3 Write rules for symlinks to /dev/.udev/rules.d for later usage
We want some symlinks to persist in the real root, so we write them to
/dev/.udev/rules.d, that they survive a retrigger.
2010-07-29 16:53:54 +02:00
Harald Hoyer
e7a2d1951e crypt: add fpu kernel module 2010-07-29 16:53:54 +02:00
Harald Hoyer
d4974c3452 fips: fixes copy&paste error for "check" 2010-07-29 16:53:54 +02:00
Harald Hoyer
336f147365 dracut.8: changed IPv6 addresses to the documentation address space 2010-07-29 16:53:54 +02:00
Harald Hoyer
9fd0454107 dracut.8: add note about putting IPv6 addresses in brackets 2010-07-29 16:53:54 +02:00
Harald Hoyer
8d03d1d597 fixed "ip=dhcp6" 2010-07-29 16:53:54 +02:00
Harald Hoyer
d344f44317 network: strip pxelinux hardware type field from BOOTIF 2010-07-29 16:53:53 +02:00
Harald Hoyer
a6688b76a6 crypt: install more aes modules 2010-07-29 16:53:53 +02:00
Harald Hoyer
1113178730 network: depend on ifcfg, if /etc/sysconfig/network-scripts exist 2010-07-29 16:53:53 +02:00
Harald Hoyer
13c5bb8e63 lvm: install lvm mirror and snaphot libs 2010-07-29 16:53:53 +02:00
Harald Hoyer
6b9bc307d7 iscsi: add support for multiple netroot=iscsi:
The whole netdisk concept should be reviewed though!
2010-07-29 16:53:53 +02:00
Harald Hoyer
3626f8270a plymouth/cryptroot-ask.sh: beautify password prompt 2010-07-29 16:53:52 +02:00
Amadeusz Żołnowski
b01d764b5a 90crypt: 'crypto_LUKS' identifier corrected 2010-07-29 16:53:52 +02:00
Victor Lowther
3eb019d36b Have cryptroot-ask load dm_crypt if needed. 2010-07-29 16:53:52 +02:00
Victor Lowther
3fef20c9c5 Just look for cryptroot instead of /sbin/cryptroot
We know what the path is and what it contains in the initrd, and
not everyone puts cryptroot in /sbin
2010-07-29 16:53:52 +02:00
Harald Hoyer
a2a62799f2 multipath: remove multipath udev rules, if no multipath.conf was found 2010-07-29 16:53:52 +02:00
Harald Hoyer
1e42363dfd multipath: simplify and install wwids (rhbz 595719)
install /etc/multipath/wwids

With the proper 40-multipath.rules and new udev device-mapper mechanism,
we don't need the multipath scan anymore.

rhbz#595719
2010-07-29 16:53:51 +02:00
Harald Hoyer
619a609bea dracut-functions: beautified warnings 2010-07-29 16:53:51 +02:00
Harald Hoyer
60953678c2 dracut-functions: check if specific dracut module is missing 2010-07-29 16:53:51 +02:00
Harald Hoyer
6fd000939e selinux-loadpolicy.sh: exit for "selinux=0" 2010-07-29 16:53:51 +02:00
Harald Hoyer
08c9da4c2c get rid of rdnetdebug
set PS4 and output to /dev/initlog.pipe
2010-07-29 16:53:51 +02:00
Harald Hoyer
b0908bcc6f 95fcoe/fcoe-up: wait_for_if_up 2010-07-29 16:53:51 +02:00
Harald Hoyer
afef8f701f 40network/ifup: be more verbose 2010-07-29 16:53:50 +02:00
Harald Hoyer
e06063284c 40network/dhclient-script: be more verbose 2010-07-29 16:53:50 +02:00
Harald Hoyer
90ff109156 40network/parse-ip-opts.sh: add "ip=auto6" to valid options 2010-07-29 16:53:50 +02:00
Andy Lutomirski
13df047b8e 90mdraid dracut-functions: fix md raid hostonly detection
check_block_and_slaves looks at slaves but not parents.
2010-07-29 16:53:50 +02:00
Harald Hoyer
ee5bdb2a55 dracut: get rid of the "file" command 2010-07-29 16:53:50 +02:00
Harald Hoyer
2ad6b48506 plymouth/plymouth-populate-initrd: get rid of awk 2010-07-29 16:53:50 +02:00
Harald Hoyer
fd7c4d2834 use "grep" directly without "nm" to drop binutils requirement 2010-07-29 16:53:49 +02:00
Harald Hoyer
d207cf3a74 dracut.spec: remove elfutils-libelf requirement 2010-07-29 16:53:49 +02:00
Harald Hoyer
7085fee2e0 plymouth: only display luksname and device for multiple luks
https://bugzilla.redhat.com/show_bug.cgi?id=561092
2010-07-29 16:53:49 +02:00
Alexander Todorov
855adf33de dracut.8: fix rd_LVM_LV description 2010-07-29 16:53:49 +02:00
Harald Hoyer
f30a0b78b8 fcoe: add /sbin/vconfig and the 8021q kernel module 2010-07-29 16:53:49 +02:00
Harald Hoyer
bff7ebeb0c znet: renamed rd_CCW to rd_ZNET
but parse old rd_CCW anyway
2010-07-29 16:53:48 +02:00
Dan Horák
6cb85f40fb znet: use ccw-init and ccw rules from s390utils in dracut 2010-07-29 16:53:48 +02:00
Harald Hoyer
5c57cf40d8 dracut.conf: use "+=" as default for config variables 2010-07-29 16:53:48 +02:00
Harald Hoyer
5fc1eb3820 kernel-modules: add more hardcoded modules 2010-07-29 16:53:48 +02:00
Harald Hoyer
1e4ba0739b btfrs: load btrfs module and updated NEWS 2010-07-29 16:53:48 +02:00
Matt
acf43f032a Needs btrfsctl, not btrfs module 2010-07-29 16:53:48 +02:00
Harald Hoyer
24e0eb7247 NEWS: update 2010-07-29 16:53:47 +02:00
Harald Hoyer
7803caa833 dracut.spec: removed e2fsprogs requirement 2010-07-29 16:53:47 +02:00
Harald Hoyer
919efa1894 add rd_retry kernel command line parameter
rd_retry=<seconds to retry in the main loop>

speeds up internal test suite
2010-07-29 16:53:47 +02:00
Harald Hoyer
459cbc4075 run-qemu: add /usr/libexec/qemu-kvm to search 2010-07-29 16:53:47 +02:00
Harald Hoyer
bd087db248 loginit: turn off debugging 2010-07-29 16:53:47 +02:00
Harald Hoyer
e632ecf64a init: do not redirect to - 2010-07-29 16:53:47 +02:00
Harald Hoyer
f180f9f344 init: fix cdrom polling loop 2010-07-29 16:53:46 +02:00
Harald Hoyer
b609cf0255 mdraid: try to start container childs manually with "mdadm -R" 2010-07-29 16:53:46 +02:00
Harald Hoyer
0aa41e0a47 dracut-lib: turn of shell debug mode in strstr and getarg(s) 2010-07-29 16:53:46 +02:00
Harald Hoyer
88d3b8bcee udev-rules: be more careful about md devices and blkid runs 2010-07-29 16:53:46 +02:00
Harald Hoyer
eff7f5adf6 nfs: add missing nfsidmap libs 2010-07-29 16:53:46 +02:00
Harald Hoyer
73bbcaaacf network: correct rules for multiple nics 2010-07-29 16:53:46 +02:00
Harald Hoyer
45e48d41d8 network: removed bogus udev rules 2010-07-29 16:53:46 +02:00
Harald Hoyer
3ff8c64d56 nfs: fixed nsswitch.conf parsing
based on a patch of Ian Dall.
https://bugzilla.redhat.com/show_bug.cgi?id=578060
2010-07-29 16:53:46 +02:00
Ville Skyttä
ed3b393b7b Use pigz for gzipping if available. 2010-07-29 16:53:45 +02:00
Harald Hoyer
aaed7a7abb dracut.spec: add btrfs module 2010-07-29 16:53:45 +02:00
Harald Hoyer
0b860653be kernel-modules: only remove ocfs2, if all filesystems are installed 2010-07-29 16:53:45 +02:00
Harald Hoyer
ebede24bd4 kernel-modules: hardcode sr_mod 2010-07-29 16:53:45 +02:00
Harald Hoyer
871085b8b2 AUTHORS: updated 2010-07-29 16:53:45 +02:00
Harald Hoyer
a553865994 dracut: add_drivers from the command line should add up to the conffile 2010-07-29 16:53:45 +02:00
Harald Hoyer
a748da9c27 manpage addition for kernel drivers
The kernel modules have to be specified without the ".ko" suffix.
2010-07-29 16:53:45 +02:00
Harald Hoyer
29502af63d add missing paragraph for --add-drivers 2010-07-29 16:53:45 +02:00
Harald Hoyer
1b02a85be8 init: trigger with --action=add 2010-07-29 16:53:45 +02:00
Joey Boggs
3e592297cd teach dmsquash-live-root to use rootflags 2010-07-29 16:53:44 +02:00
Harald Hoyer
e20777d90e add module btrfs 2010-07-29 16:53:44 +02:00
Harald Hoyer
9ec50d3dbb init: add hacky cdrom polling mechanism 2010-07-29 16:53:44 +02:00
Harald Hoyer
41594890af dmraid: parse different error messages 2010-07-29 16:53:44 +02:00
Harald Hoyer
6bb1a78b81 dracut.8: add information, which parameter can be specified multiple times 2010-07-29 16:53:44 +02:00
Harald Hoyer
97c25fe67d dracut.8: fixed LUKS paragraph 2010-07-29 16:53:44 +02:00
Harald Hoyer
ee7820d04c updated NEWS, moved tag 005 2010-07-29 16:53:44 +02:00
Harald Hoyer
0df77fb0e9 dracut.spec: remove libselinux, libsepol requirement 2010-07-29 16:53:44 +02:00
Harald Hoyer
1b8636aa8e lvm/lvm_scan.sh: silence lvm version check 2010-07-29 16:53:44 +02:00
Harald Hoyer
a621fc0be8 fcoe: soft install fcoe bins 2010-07-29 16:53:43 +02:00
Hans de Goede
eeee01e534 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-07-29 16:53:43 +02:00
Mike Snitzer
4e558ef5ca 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-07-29 16:53:43 +02:00
Harald Hoyer
95d580507e kernel-modules/installkernel: force install some modules even in
hostonly mode
2010-07-29 16:53:43 +02:00
Luca Berra
3d81d725e5 silence xen-detect detection
Signed-off-by: Luca Berra <bluca@comedia.it>
2010-07-29 16:53:43 +02:00
Philippe Seewer
3a6a6b7a05 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-07-29 16:53:43 +02:00
Philippe Seewer
cf6a399dc8 test: use ldconfig processing for roots as well 2010-07-29 16:53:43 +02:00
Harald Hoyer
162cfd6be4 dracut: move ldconfig after include 2010-07-29 16:53:42 +02:00
Harald Hoyer
d2f762de55 dracut: do a full ldconfig in the initramfs 2010-07-29 16:53:42 +02:00
Harald Hoyer
2403d615f6 rpmversion/install: add shebang 2010-07-29 16:53:42 +02:00
Harald Hoyer
f32cc501ae dmsquash-live-root: use blockdev with --getsz
Thanks Karel for pointing this out.. again :)
2010-07-29 16:53:42 +02:00
Andrey Borzenkov
c00d8dc143 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-07-29 16:53:42 +02:00
Andrey Borzenkov
2edc0d682c 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-07-29 16:53:42 +02:00
Harald Hoyer
2979071476 dmsquash-live: use --getsize64 instead of --getsize 2010-07-29 16:53:42 +02:00
Joey Boggs
98b9ab580a 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-07-29 16:53:42 +02:00
Harald Hoyer
cee6b34456 udev-rules: choose between several firmware upload tools
debian: firmware.agent hotplug.functions
old fedora: firmware.sh
new udev upstream: firmware
2010-07-29 16:53:42 +02:00
Harald Hoyer
d44a916dd1 kernel-modules: add keyboard kernel modules 2010-07-29 16:53:42 +02:00
Philippe Seewer
e3e6814eee parse-kernel.sh must have a shebang 2010-07-29 16:53:41 +02:00
Peter Jones
071cba4de2 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-07-29 16:53:41 +02:00
Harald Hoyer
c2d781453d dracut: add check, if we can write to the output image file 2010-07-29 16:53:41 +02:00
Harald Hoyer
3501a9be20 mount-root: also filter "defaults" from mount options 2010-07-29 16:53:41 +02:00
Harald Hoyer
f01253ac3a mount-root: skip comments 2010-07-29 16:53:41 +02:00
Harald Hoyer
aafa510eb0 dracut: removed "local" not inside of function 2010-07-29 16:53:41 +02:00
Harald Hoyer
29f9e9ad4b fix IFS restoring 2010-07-29 16:53:41 +02:00
Harald Hoyer
5db3f2daca selinux: fix "selinux=0" handling 2010-07-29 16:53:41 +02:00
Harald Hoyer
af39a960a4 mount-root: do not pollute init arguments
and do not remount if no new rootopts set in /etc/fstab
2010-07-29 16:53:41 +02:00
Harald Hoyer
2a9b5f1070 fix lib64 check
on ppc we can have libc in /lib64/power6/
2010-07-29 16:53:41 +02:00
Harald Hoyer
e0869cc42d s390: *_cio_free needs "seq" 2010-07-29 16:53:40 +02:00
Harald Hoyer
0376e6c0f1 fix selinux disabled state
Execute load-policy when the config file contains SELINUX=disabled.
2010-07-29 16:53:40 +02:00
Harald Hoyer
ae7d963f24 nfs4: rpc.idmapd does not accept parameters anymore
modify /etc/idmapd.conf instead
2010-07-29 16:53:40 +02:00
Harald Hoyer
bec946f131 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-07-29 16:53:40 +02:00
Harald Hoyer
05e42bd49b dracut.conf: added add_dracutmodules 2010-07-29 16:53:40 +02:00
Harald Hoyer
fe57e7f43c add /etc/dracut.conf.d 2010-07-29 16:53:40 +02:00
Harald Hoyer
e05dff553c Fixed: Move multipath scan earlier. It must go before any other dm rules.
Also changed the filename in the install file.
2010-07-29 16:53:40 +02:00
Harald Hoyer
7d0a30088e nfs: suppress error message about missing passwd 2010-07-29 16:53:40 +02:00
Harald Hoyer
e99d30edf8 make nfs4 work 2010-07-29 16:53:40 +02:00
Peter Jones
23c6493093 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-07-29 16:53:40 +02:00
Harald Hoyer
95cad9133a add preliminary IPv6 support 2010-07-29 16:53:40 +02:00
Harald Hoyer
3092987a7f zfcp: install s390utils script rather than local one 2010-07-29 16:53:39 +02:00
Harald Hoyer
6083ccf000 rootfs-block: strip "ro|rw" options from fstab options
https://bugzilla.redhat.com/show_bug.cgi?id=560424
2010-07-29 16:53:39 +02:00
Harald Hoyer
4d85598c4b test/iSCSI: fixed test script 2010-07-29 16:53:39 +02:00
Harald Hoyer
33d1be3fa2 dasd_mod: changed prio of cmdline hook to be executed after dasd 2010-07-29 16:53:39 +02:00
Harald Hoyer
37646c0f76 init: dashified $[] -> $(()) 2010-07-29 16:53:39 +02:00
Harald Hoyer
8bb18dd465 beautified man pages 2010-07-29 16:53:39 +02:00
Harald Hoyer
d0ad543882 fixed permissions for the check files 2010-07-29 16:53:39 +02:00
Peter Jones
c4b4668b38 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-07-29 16:53:39 +02:00
Harald Hoyer
e484218385 base: fix selinux handling if .autorelabel is present
rhbz#557744
2010-07-29 16:53:39 +02:00
Harald Hoyer
833de7c70a 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-07-29 16:53:38 +02:00
Harald Hoyer
707fb5982c init: fixed emergency_shell argument parsing 2010-07-29 16:53:38 +02:00
182 changed files with 7623 additions and 1861 deletions

3
.dir-locals.el Normal file
View File

@@ -0,0 +1,3 @@
((nil . ((setq sh-basic-offset: 4)
(setq indent-tabs-mode nil)
)))

1
.kateconfig Normal file
View File

@@ -0,0 +1 @@
kate: space-indent on; tab-width 4; indent-width 4; replace-tabs on; eol unix;

9
.kateproject Normal file
View File

@@ -0,0 +1,9 @@
{
"name": "Kate"
, "files": [ { "git": 1 } ]
, "build": {
"directory": "build"
, "build": "make -j $(getconf _NPROCESSORS_ONLN) all"
, "clean": "make clean"
}
}

View File

@@ -1,7 +1,7 @@
Harald Hoyer <harald@redhat.com>
Victor Lowther <victor.lowther@gmail.com>
Warren Togami <wtogami@redhat.com>
Philippe Seewer <philippe.seewer@bfh.ch>
Warren Togami <wtogami@redhat.com>
Jeremy Katz <katzj@redhat.com>
David Dillow <dave@thedillows.org>
Andreas Thienemann <andreas@bawue.net>
@@ -9,6 +9,7 @@ Hans de Goede <hdegoede@redhat.com>
Peter Jones <pjones@redhat.com>
Luca Berra <bluca@comedia.it>
Marc Grimme <grimme@atix.de>
Andrey Borzenkov <arvidjaar@mail.ru>
Bill Nottingham <notting@redhat.com>
Daniel Drake <dsd@laptop.org>
David Cantrell <dcantrell@redhat.com>
@@ -16,12 +17,13 @@ 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>
Joey Boggs <jboggs@redhat.com>
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>
Mike Snitzer <snitzer@redhat.com>
Munehiro Matsuda <haro@kgt.co.jp>
Peter Rajnoha <prajnoha@redhat.com>
Quentin Armitage <quentin@armitage.org.uk>

View File

@@ -17,7 +17,13 @@ else
targets =
endif
all: $(targets)
all: $(targets) dracut-rhel6.html
dracut-rhel6.html: dracut-rhel6.xml
xsltproc -o dracut-rhel6.html --xinclude -nonet \
--stringparam draft.mode yes \
--stringparam html.stylesheet http://docs.redhat.com/docs/en-US/Common_Content/css/default.css \
http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl dracut-rhel6.xml
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
@@ -27,7 +33,7 @@ install:
mkdir -p $(DESTDIR)$(sbindir)
mkdir -p $(DESTDIR)$(sysconfdir)
mkdir -p $(DESTDIR)$(pkglibdir)/modules.d
mkdir -p $(DESTDIR)$(mandir)/man{5,8}
mkdir -p $(DESTDIR)$(mandir)/man{1,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
@@ -37,9 +43,12 @@ 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 mkinitrd.8 $(DESTDIR)$(mandir)/man8
install -m 0644 lsinitrd.1 $(DESTDIR)$(mandir)/man1
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
@@ -61,28 +70,33 @@ dist: dracut-$(VERSION).tar.bz2
dracut-$(VERSION).tar.bz2:
git archive --format=tar $(VERSION) --prefix=dracut-$(VERSION)/ |bzip2 > dracut-$(VERSION).tar.bz2
dracut-$(VERSION).tar.gz:
git archive --format=tar $(VERSION) --prefix=dracut-$(VERSION)/ |gzip > dracut-$(VERSION).tar.gz
dracut-$(VERSION)-$(GITVERSION).tar.bz2:
git archive --format=tar HEAD --prefix=dracut-$(VERSION)-$(GITVERSION)/ |bzip2 > dracut-$(VERSION)-$(GITVERSION).tar.bz2
rpm: clean dracut-$(VERSION).tar.bz2
rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" --define "_specdir $$PWD" --define "_srcrpmdir $$PWD" --define "_rpmdir $$PWD" -ba dracut.spec
rm -fr BUILD BUILDROOT
rpm: dracut-$(VERSION).tar.bz2
rpmbuild=$$(mktemp -d -t rpmbuild-dracut.XXXXXX); src=$$(pwd); \
cp dracut-$(VERSION).tar.bz2 "$$rpmbuild"; \
$$src/git2spec.pl $(VERSION) "$$rpmbuild" < dracut.spec > $$rpmbuild/dracut.spec; \
(cd "$$rpmbuild"; rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" \
--define "_specdir $$PWD" --define "_srcrpmdir $$PWD" \
--define "_rpmdir $$PWD" -ba dracut.spec; ) && \
( mv "$$rpmbuild"/noarch/*.rpm .; mv "$$rpmbuild"/*.src.rpm .;rm -fr "$$rpmbuild"; ls *.rpm )
gitrpm: dracut-$(VERSION)-$(GITVERSION).tar.bz2
echo "%define gittag $(GITVERSION)" > dracut.spec.git
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 || :
mv dracut.spec.bak dracut.spec
rm -fr BUILD BUILDROOT
check: all
syncheck:
@ret=0;for i in modules.d/99base/init modules.d/*/*.sh; do \
[ "$${i##*/}" = "caps.sh" ] && continue; \
dash -n "$$i" ; ret=$$(($$ret+$$?)); \
done;exit $$ret
make -C test check
@ret=0;for i in dracut modules.d/02caps/caps.sh modules.d/*/install modules.d/*/installkernel modules.d/*/check; do \
bash -n "$$i" ; ret=$$(($$ret+$$?)); \
done;exit $$ret
check: all syncheck
$(MAKE) -C test check
testimage: all
./dracut -l -a debug -f test-$(shell uname -r).img $(shell uname -r)

25
NEWS
View File

@@ -1,3 +1,28 @@
dracut-006
==========
- fixed mdraid with IMSM
- fixed dracut manpages
- dmraid parse different error messages
- add cdrom polling mechanism for slow cdroms
- add module btrfs
- add btrfsctl scan for btrfs multi-devices (raid)
- teach dmsquash live-root to use rootflags
- trigger udev with action=add
- fixed add_drivers handling
- add sr_mod
- use pigz instead of gzip, if available
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

143
dracut
View File

@@ -21,6 +21,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# store for logging
dracut_args="$@"
usage() {
# 80x25 linebreak here ^
@@ -37,6 +39,8 @@ 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.
--omit-drivers [LIST] Specify a space-separated list of kernel
modules not to add to the initramfs.
--filesystems [LIST] Specify a space-separated list of kernel filesystem
modules to exclusively include in the generic
initramfs.
@@ -79,6 +83,7 @@ while (($# > 0)); do
-a|--add) add_dracutmodules_l="$2"; shift;;
-d|--drivers) drivers_l="$2"; shift;;
--add-drivers) add_drivers_l="$2"; shift;;
--omit-drivers) omit_drivers_l+="$2"; shift;;
--filesystems) filesystems_l="$2"; shift;;
-k|--kmoddir) drivers_dir_l="$2"; shift;;
--fwdir) fw_dir_l="$2"; shift;;
@@ -94,6 +99,7 @@ while (($# > 0)); do
--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;;
@@ -106,6 +112,8 @@ done
PATH=/sbin:/bin:/usr/sbin:/usr/bin
export PATH
unset LD_LIBRARY_PATH
unset GREP_OPTIONS
[[ $debug ]] && {
export PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): ';
@@ -122,15 +130,30 @@ if [[ ! -f $conffile ]]; then
[[ $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"
# these optins add to the stuff in the config file
[[ $add_dracutmodules_l ]] && add_dracutmodules+=" $add_dracutmodules_l"
[[ $add_drivers_l ]] && add_drivers+=" $add_drivers_l"
[[ $omit_drivers_l ]] && omit_drivers+=" $omit_drivers_l"
# these options override the stuff in the config file
[[ $dracutmodules_l ]] && dracutmodules=$dracutmodules_l
[[ $omit_dracutmodules_l ]] && omit_dracutmodules=$omit_dracutmodules_l
[[ $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
@@ -158,29 +181,52 @@ fi
dracutfunctions=$dracutbasedir/dracut-functions
export dracutfunctions
dinfo "Executing $0 $dracut_args"
omit_drivers_corrected=""
for d in $omit_drivers; do
strstr " $drivers $add_drivers " " $d " && continue
omit_drivers_corrected+="$d|"
done
omit_drivers="${omit_drivers_corrected%|}"
unset omit_drivers_corrected
# This is kinda legacy -- eventually it should go away.
case $dracutmodules in
""|auto) dracutmodules="all" ;;
esac
[[ $2 ]] && kernel=$2 || kernel=$(uname -r)
[[ $1 ]] && outfile=$(readlink -f $1) || outfile="/boot/initramfs-$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"
export srcmods
if [[ -f $outfile && ! $force ]]; then
echo "Will not override existing initramfs ($outfile) without --force"
derror "Will not override existing initramfs ($outfile) without --force"
exit 1
fi
if ! [[ -w $(dirname $outfile) ]]; then
echo "No permission to write $outfile."
outdir=$(dirname "$outfile")
if ! [[ -d "$outdir" ]]; then
derror "Can't write $outfile: Directory $outdir does not exist."
exit 1
fi
hookdirs="cmdline pre-udev pre-trigger netroot pre-mount pre-pivot mount emergency"
if ! [[ -w "$outdir" ]]; then
derror "No permission to write $outdir."
exit 1
fi
if [[ -f "$outfile" ]] && ! [[ -w "$outfile" ]]; then
derror "No permission to write $outfile."
exit 1
fi
hookdirs="cmdline pre-udev pre-trigger netroot pre-mount pre-pivot mount emergency initqueue initqueue-finished initqueue-settled initqueue-timeout
"
[[ -n "$TMPDIR" ]] && ! [[ -w "$TMPDIR" ]] && unset TMPDIR
readonly initdir=$(mktemp -d -t initramfs.XXXXXX)
@@ -193,32 +239,33 @@ chmod 755 "$initdir"
export initdir hookdirs dracutbasedir dracutmodules drivers \
fw_dir drivers_dir debug beverbose no_kernel kernel_only \
add_drivers mdadmconf lvmconf filesystems
add_drivers omit_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
inst_dir "/$d";
for d in bin sbin usr/bin usr/sbin usr/lib etc proc sys sysroot tmp dev/pts var/log var/run $hookdirs; do
inst_dir "/$d"
done
fi
# check all our modules to see if they should be sourced.
# This builds a list of modules that we will install next.
check_modules
modules_loaded=" "
# 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
_d_mod=${moddir##*/}; _d_mod=${_d_mod#[0-9][0-9]}
if strstr "$mods_to_load" " $_d_mod "; then
if [[ $kernel_only = yes ]]; then
[[ -x $moddir/installkernel ]] && . "$moddir/installkernel"
else
. "$moddir/install"
[[ -x "$moddir/install" ]] && . "$moddir/install"
if [[ $no_kernel != yes && -x $moddir/installkernel ]]; then
. "$moddir/installkernel"
fi
fi
mods_to_load=${mods_to_load// $mod /}
modules_loaded+="$_d_mod "
mods_to_load=${mods_to_load// $_d_mod /}
fi
done
unset moddir
@@ -233,12 +280,13 @@ if [[ -d $initdir/lib/modules/$kernel ]]; then
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"/*
if [[ -f $include_src ]]; then
inst $include_src $include_target
else
mkdir -p "$initdir$include_target"
cp -a -t "$initdir$include_target" "$include_src"/*
fi
fi
for item in $install_items; do
@@ -246,44 +294,53 @@ 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
if [[ $do_strip = yes ]] ; then
for p in strip objdump sed grep find; do
for p in strip grep find; do
if ! which $p >/dev/null 2>&1; then
derror "Could not find '$p'. You should run $0 with '--nostrip'."
dwarn "Could not find '$p'. Not stripping binaries in the initramfs."
do_strip=no
fi
done
fi
if [[ $do_strip = yes ]] ; then
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"
strip -g "$f" || :
#
# FIXME: only strip -g for now
#
#strip -g --strip-unneeded "$f" || :
#note="-R .note"
#if objdump -h $f | grep '^[ ]*[0-9]*[ ]*.note[ ]' -A 1 | \
# grep -q ALLOC; then
# note=
#fi
#strip -R .comment $note "$f" || :
for f in $(find "$initdir" -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 -or -path '*/lib/modules/*.ko' \) ); do
# do not strip files with a .hmac file,
# because that would alter the checksum
if ! [[ -f "${f%/*}/.${f##*/}.hmac" ]]; then
dinfo "Stripping '$f'"
strip -g "$f" 2>/dev/null|| :
else
dinfo "Not stripping '$f', because it has a hmac checksum file."
fi
done
fi
( 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
if strstr "$modules_loaded" " fips " && command -v prelink >/dev/null; then
for i in $initdir/bin/* \
$initdir/bin/* \
$initdir/usr/bin/* \
$initdir/usr/sbin/*; do
[ -x $i ] && prelink -u $i &>/dev/null
done
fi
[[ $beverbose = yes ]] && ls -lh "$outfile"
type pigz &>/dev/null && gzip=pigz || gzip=gzip
if ! ( set -o pipefail; umask 077; cd "$initdir"; find . |cpio -R root:root -H newc -o --quiet| \
$gzip -9 > "$outfile"; ); then
derror "dracut: creation of $outfile failed"
rm -f "$outfile"
exit 1
fi
dinfo "Wrote $outfile"
dinfo $(ls -l "$outfile")
exit 0

View File

@@ -102,7 +102,8 @@ fi
if [[ ! $no_overlay ]]; then
ofile="$imagedir/90-overlay.img"
dinfo "Creating image $ofile from directory $overlay"
( cd "$overlay"; find . |cpio --quiet -H newc -o |gzip -9 > "$ofile"; )
type pigz &>/dev/null && gzip=pigz || gzip=gzip
( cd "$overlay"; find . |cpio --quiet -H newc -o |$gzip -9 > "$ofile"; )
fi
if [[ ! $no_imagedir ]]; then

View File

@@ -28,26 +28,111 @@ strstr() { [[ $1 =~ $2 ]]; }
if ! [[ $dracutlogfile ]]; then
[[ $dracutbasedir = /usr/share/dracut ]] && \
dracutlogfile=/var/log/dracut.log || \
dracutlogfile=/tmp/dracut.log
# [[ -w $dracutlogfile ]] || dracutlogfile=/tmp/dracut.log
if [[ -w $dracutlogfile ]]; then
>"$dracutlogfile"
dracutlogfile=$HOME/dracut.log
if [[ -w ${dracutlogfile%/*} ]]; then
>>"$dracutlogfile"
fi
fi
dwarning() {
echo "W: $@" >&2
[[ -w $dracutlogfile ]] && echo "W: $@" >>"$dracutlogfile"
[[ -w $dracutlogfile ]] && echo $(date) "Warn:" $@ >>"$dracutlogfile"
}
dinfo() {
[[ $beverbose ]] && echo "I: $@" >&2
[[ -w $dracutlogfile ]] && echo "I: $@" >>"$dracutlogfile"
[[ -w $dracutlogfile ]] && echo $(date) "Info:" $@ >>"$dracutlogfile"
}
derror() {
echo "E: $@" >&2
[[ -w $dracutlogfile ]] && echo "E: $@" >>"$dracutlogfile"
[[ -w $dracutlogfile ]] && echo $(date) "Err:" $@ >>"$dracutlogfile"
}
# normalize_path <path>
# Prints the normalized path, where it removes any duplicated
# and trailing slashes.
# Example:
# $ normalize_path ///test/test//
# /test/test
normalize_path() {
shopt -q -s extglob
set -- "${1//+(\/)//}"
shopt -q -u extglob
echo "${1%/}"
}
# convert_abs_rel <from> <to>
# Prints the relative path, when creating a symlink to <to> from <from>.
# Example:
# $ convert_abs_rel /usr/bin/test /bin/test-2
# ../../bin/test-2
# $ ln -s $(convert_abs_rel /usr/bin/test /bin/test-2) /usr/bin/test
convert_abs_rel() {
local __current __absolute __abssize __cursize __newpath
local -i __i __level
set -- "$(normalize_path "$1")" "$(normalize_path "$2")"
# corner case #1 - self looping link
[[ "$1" == "$2" ]] && { echo "${1##*/}"; return; }
# corner case #2 - own dir link
[[ "${1%/*}" == "$2" ]] && { echo "."; return; }
IFS="/" __current=($1)
IFS="/" __absolute=($2)
__abssize=${#__absolute[@]}
__cursize=${#__current[@]}
while [[ ${__absolute[__level]} == ${__current[__level]} ]]
do
(( __level++ ))
if (( __level > __abssize || __level > __cursize ))
then
break
fi
done
for ((__i = __level; __i < __cursize-1; __i++))
do
if ((__i > __level))
then
__newpath=$__newpath"/"
fi
__newpath=$__newpath".."
done
for ((__i = __level; __i < __abssize; __i++))
do
if [[ -n $__newpath ]]
then
__newpath=$__newpath"/"
fi
__newpath=$__newpath${__absolute[__i]}
done
echo "$__newpath"
}
# returns OK if $1 contains $2 at the beginning
str_starts() {
[ "${1#$2*}" != "$1" ]
}
ln_r() {
local _source=$1
local _dest=$2
if ! str_starts "$_source" "/"; then
ln -sfn "$_source" "${initdir}/${_dest}"
else
[[ -d "${_dest%/*}" ]] && _dest=$(readlink -f "${_dest%/*}")/${_dest##*/}
ln -sfn $(convert_abs_rel "${_dest}" "${_source}") "${initdir}/${_dest}"
fi
}
get_fs_env() {
@@ -94,6 +179,9 @@ check_block_and_slaves() {
[[ -b /dev/block/$2 ]] || return 1 # Not a block device? So sorry.
"$1" $2 && return
check_vol_slaves "$@" && return 0
if [[ -f "/sys/dev/block/$2/../dev" ]]; then
check_block_and_slaves $1 $(cat "/sys/dev/block/$2/../dev") && return 0
fi
[[ -d /sys/dev/block/$2/slaves ]] || return 1
for x in /sys/dev/block/$2/slaves/*/dev; do
[[ -f $x ]] || continue
@@ -132,31 +220,28 @@ check_vol_slaves() {
}
# Install a directory, keeping symlinks as on the original system.
# Example: if /lib64 points to /lib on the host, "inst_dir /lib/file"
# Example: if /lib points to /lib64 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
[[ -e ${initdir}/"$1" ]] && return 0 # already there
# iterate over parent directories
local file=""
local IFS="/"
for part in $dir; do
[ -z "$part" ] && continue
file="$file/$part"
[[ -e "${initdir}$file" ]] && continue
local _dir="$1" _part="${1%/*}" _file
while [[ "$_part" != "${_part%/*}" ]] && ! [[ -e "${initdir}/${_part}" ]]; do
_dir="$_part $_dir"
_part=${_part%/*}
done
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"
# iterate over parent directories
for _file in $_dir; do
[[ -e "${initdir}/$_file" ]] && continue
if [[ -L $_file ]]; then
inst_symlink "$_file"
else
# create directory
mkdir -p "${initdir}$file" || return 1
mkdir -m 0755 -p "${initdir}/$_file" || return 1
[[ -e "$_file" ]] && chmod --reference="$_file" "${initdir}/$_file"
chmod u+w "${initdir}/$_file"
fi
done
}
@@ -166,13 +251,17 @@ inst_dir() {
# Location of the image dir is assumed to be $initdir
# We never overwrite the target if it exists.
inst_simple() {
local src target
local src target
[[ -f $1 ]] || return 1
src=$1 target="${2:-$1}"
if ! [[ -d ${initdir}$target ]]; then
[[ -e ${initdir}$target ]] && return 0
inst_dir "${target%/*}"
fi
# install checksum files also
if [[ -e "${src%/*}/.${src##*/}.hmac" ]]; then
inst "${src%/*}/.${src##*/}.hmac" "${target%/*}/.${target##*/}.hmac"
fi
dinfo "Installing $src"
cp -pfL "$src" "${initdir}$target"
}
@@ -184,11 +273,15 @@ inst_library() {
local src=$1 dest=${2:-$1}
[[ -e $initdir$dest ]] && return 0
if [[ -L $src ]]; then
# install checksum files also
if [[ -e "${src%/*}/.${src##*/}.hmac" ]]; then
inst "${src%/*}/.${src##*/}.hmac" "${dest%/*}/.${dest##*/}.hmac"
fi
reallib=$(readlink -f "$src")
lib=${src##*/}
inst_simple "$reallib" "$reallib"
inst_dir "${dest%/*}"
(cd "${initdir}${dest%/*}" && ln -s "$reallib" "$lib")
ln_r "$reallib" "$dest"
else
inst_simple "$src" "$dest"
fi
@@ -215,7 +308,7 @@ inst_binary() {
local LDSO NAME IO FILE ADDR I1 n f TLIBDIR
[[ -e $initdir$target ]] && return 0
# I love bash!
ldd $bin 2>/dev/null | while read line; do
LC_ALL=C ldd $bin 2>/dev/null | while read line; do
[[ $line = 'not a dynamic executable' ]] && return 1
if [[ $line =~ not\ found ]]; then
derror "Missing a shared library required by $bin."
@@ -262,12 +355,22 @@ inst_script() {
# same as above, but specialized for symlinks
inst_symlink() {
local src=$1 target=$initdir${2:-$1} realsrc
local _src=$1 _target=${2:-$1} _realsrc
strstr "$1" "/" || return 1
[[ -L $1 ]] || return 1
[[ -L $target ]] && return 0
realsrc=$(readlink -f "$src")
[[ $realsrc = ${realsrc##*/} ]] && realsrc=${src%/*}/$realsrc
inst "$realsrc" && ln -s "$realsrc" "$target"
[[ -L $initdir/$_target ]] && return 0
_realsrc=$(readlink -f "$_src")
[[ ${_realsrc#/} = ${_realsrc} ]] && _realsrc="${_src%/*}/${_realsrc}"
if ! [[ -e $initdir/$_realsrc ]]; then
if [[ -d $_realsrc ]]; then
inst_dir "$_realsrc"
else
inst "$_realsrc"
fi
fi
[[ ! -e $initdir/${_target%/*} ]] && inst_dir "${_target%/*}"
ln_r "${_realsrc}" "${_target}"
}
# find a udev rule in the usual places.
@@ -338,7 +441,7 @@ dracut_install() {
while (($# > 0)); do
if ! inst "$1" ; then
if [[ $optional = yes ]]; then
dwarning "Skipping program $1 as it cannot be found and is flagged to be optional"
dinfo "Skipping program $1 as it cannot be found and is flagged to be optional"
else
derror "Failed to install $1"
exit 1
@@ -381,12 +484,14 @@ should_source_module() {
"$1/check" $hostonly || return 1
for dep in $("$1/check" -d); do
check_module_deps "$dep" && continue
dwarning "Cannot load $mod, dependencies failed."
dwarning "Cannot load dracut module \"$mod\", dependencies failed."
return 1
done
}
check_modules() {
local modcheck;
local mod;
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.
@@ -401,6 +506,14 @@ check_modules() {
fi
mods_to_load+=" $mod "
done
modcheck=$add_dracutmodules
[[ $dracutmodules != all ]] && modcheck="$m $dracutmodules"
for mod in $modcheck; do
strstr "$mods_to_load" "$mod" && continue
strstr "$omit_dracutmodules" "$mod" && continue
dwarning "Dracut module \"$mod\" cannot be found."
done
}
# Install a single kernel module along with any firmware it may require.
@@ -408,8 +521,26 @@ check_modules() {
install_kmod_with_fw() {
local modname=${1##*/} fwdir found
modname=${modname%.ko*}
# no need to go further if the module is already installed
[[ -e "${initdir}/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" ]] && return 0
if [[ $omit_drivers ]]; then
local _kmod=${1##*/}
_kmod=${_kmod%.ko}
_kmod=${_kmod/-/_}
if [[ "$_kmod" =~ $omit_drivers ]]; then
dinfo "Omitting driver $_kmod"
return 1
fi
if [[ "${1##*/lib/modules/$kernel/}" =~ $omit_drivers ]]; then
dinfo "Omitting driver $_kmod"
return 1
fi
fi
inst_simple "$1" "/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" || \
return 0 # no need to go further if the module is already installed
return $?
for fw in $(modinfo -k $kernel -F firmware $1 2>/dev/null); do
found=''
for fwdir in $fw_dir; do
@@ -419,9 +550,10 @@ install_kmod_with_fw() {
fi
done
if [[ $found != yes ]]; then
dinfo "Possible missing firmware ${fw} for module ${mod}.ko"
dinfo "Possible missing firmware \"${fw}\" for kernel module \"${mod}.ko\""
fi
done
return 0
}
# Do something with all the dependencies of a kernel module.
@@ -431,13 +563,16 @@ install_kmod_with_fw() {
# $2 = module to get dependencies for
# rest of args = arguments to modprobe
for_each_kmod_dep() {
local func=$1 kmod=$2 cmd modpapth options
local func=$1 kmod=$2 cmd modpapth options
shift 2
modprobe "$@" --ignore-install --show-depends $kmod 2>/dev/null | \
modprobe "$@" --ignore-install --show-depends $kmod 2>/dev/null | ( \
local found=0;
while read cmd modpath options; do
[[ $cmd = insmod ]] || continue
$func $modpath
done
$func ${modpath} || exit $?
found=1
done; [[ $found -eq 0 ]] && exit 1; exit 0;)
return $?
}
# filter kernel modules to install certain modules that meet specific
@@ -450,7 +585,7 @@ for_each_kmod_dep() {
# This function returns the full filenames of modules that match $1
filter_kernel_modules () (
if ! [[ $hostonly ]]; then
filtercmd='find "$srcmods/kernel/drivers" -name "*.ko" -o -name "*.ko.gz"'
filtercmd='find "$srcmods/kernel/drivers" "$srcmods/updates" "$srcmods/extra" "$srcmods/weak-updates" -name "*.ko" -o -name "*.ko.gz" 2>/dev/null'
else
filtercmd='cut -d " " -f 1 </proc/modules|xargs modinfo -F filename -k $kernel'
fi
@@ -472,6 +607,7 @@ filter_kernel_modules () (
instmods() {
[[ $no_kernel = yes ]] && return
local mod mpargs modpath modname cmd
local ret=0
while (($# > 0)); do
mod=${1%.ko*}
case $mod in
@@ -493,10 +629,17 @@ instmods() {
shift; continue;
;;
*)
mod=${mod##*/}
# if we are already installed, skip this module and go on
# to the next one.
[[ -f $initdir/$1 ]] && { shift; continue; }
mod=${mod##*/}
if [[ $omit_drivers ]] && [[ "$1" =~ $omit_drivers ]]; then
dinfo "Omitting driver ${mod##$srcmods}"
shift; continue;
fi
# 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 && \
@@ -507,10 +650,12 @@ instmods() {
# it may require
for_each_kmod_dep install_kmod_with_fw $mod \
--set-version $kernel -d ${srcmods%%/lib/modules/*}/
;;
ret=$((ret+$?))
;;
esac
shift
done
return $ret
}
# vim:ts=8:sw=4:sts=4:et

1764
dracut-rhel6.xml Normal file

File diff suppressed because it is too large Load Diff

591
dracut.8
View File

@@ -10,7 +10,7 @@ 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,12 +28,27 @@ 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.
The kernel modules have to be specified without the ".ko" suffix.
.TP
.BR \-\-add-drivers " \fILIST\fR"
specify a space-separated list of kernel modules to add to the initramfs.
The kernel modules have to be specified without the ".ko" suffix.
.TP
.BR \-\-omit-drivers " \fILIST\fR"
specify a space-separated list of kernel modules to omit from the initramfs.
The kernel modules have to be specified without the ".ko" suffix.
Regular expressions are also allowed like ".*/fs/ocfs/.*".
If [LIST] has multiple arguments, then you have to put these in quotes.
example:
# dracut --omit "module1 module2" ...
.TP
.BR \-\-filesystems " \fILIST\fR"
specify a space-separated list of kernel filesystem modules to exclusively include in the generic initramfs.
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
@@ -73,6 +88,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
@@ -90,7 +110,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
@@ -99,245 +119,50 @@ 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 blockdevice to use as root filesystem.
e.g. \fI/dev/sda1\fR
e.g. \fI/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1\fR
.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 rootfstype=<filesystem type>
"auto" if not specified, e.g. \fIrootfstype=ext3\fR
.BR rootfstype= "<filesystem type>"
"auto" if not specified, e.g. rootfstype=ext3
.TP
.B rootflags=<mount options>
.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
\fBrootfallback=\fR\fI<path to blockdevice>\fR
specify the block device to use as the root filesystem, if the normal root cannot be found\&. This can only be a simple block device with a simple file system, for which the filesystem driver is either compiled in, or added manually to the initramfs\&. This parameter can be specified multiple times\&.
.TP
.B rd_NO_FSTAB
do not honor special mount options for the root filesystem found in
/etc/fstab of the real root.
.SH I18N
.ad l
e.g. LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=de-latin1-nodeadkeys
.ad
.SS Misc
.TP
.B KEYBOARDTYPE=sun|pc
will be written to /etc/sysconfig/keyboard in the initramfs
.BR hostname= "<hostname>"
set the initial hostname
.TP
.B KEYTABLE=<keytable filename>
will be written to /etc/sysconfig/keyboard in the initramfs
.TP
.B SYSFONT= Console font
will be written to /etc/sysconfig/i18n in the initramfs
.TP
.B SYSFONTACM= Unicode font map
will be written to /etc/sysconfig/i18n in the initramfs
.TP
.B UNIMAP= Unicode font map
will be written to /etc/sysconfig/i18n in the initramfs
.TP
.B LANG=<locale>
will be written to /etc/sysconfig/i18n in the initramfs
.SH LVM
.TP
.B rd_NO_LVM
disable LVM detection
.TP
.B rd_LVM_VG=<volume group name>
only activate the volume groups with the given name
rd_LVM_VG can be specified multiple times on the kernel command line.
.TP
.B 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
.B rd_NO_LVMCONF
remove any /etc/lvm/lvm.conf, which may exist in the initramfs
.SH crypto LUKS
.TP
.B rd_NO_LUKS
disable crypto LUKS detection
.TP
.B 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.
.B rd_NO_CRYPTTAB
do not check if LUKS partition is in /etc/crypttab
.SH MD
.TP
.B rd_NO_MD
disable MD RAID detection
.TP
.B rd_NO_MDIMSM
no MD RAID for imsm/isw raids, use dmraid instead
.TP
.B rd_NO_MDADMCONF
ignore mdadm.conf included in initramfs
.TP
.B rd_MD_UUID=<md uuid>
only activate the raid sets with the given UUID
.SH DMRAID
.TP
.B rd_NO_DM
disable DM RAID detection
.TP
.B rd_DM_UUID=<dmraid uuid>
only activate the raid sets with the given UUID
.SH DASD
.TP
.B rd_DASD_MOD=....
same syntax as the kernel module parameter (s390 only)
.TP
.B rd_DASD=<dasd adaptor device bus ID>[,readonly=X][,use_diag=X][,erplog=X][,failfast=X]
activate DASD device with the given adaptor device bus ID and setting the sysfs attributes
to the specified values
.SH ZFCP
.TP
.B 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
.B rd_NO_ZFCPCONF
ignore zfcp.conf included in the initramfs
.SH CCW
.TP
.B 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
.SH DHCP
.TP
.B root=dhcp
get IP from dhcp server, root-path option from dhcp specifies root location
.SH NFS
.TP
.B 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 ","
.TP
.B root=nfs:[<server-ip>:]<root-dir>[:<nfs-options>]
.TP
.B root=nfs4:[<server-ip>:]<root-dir>[:<nfs-options>]
.TP
.B root=dhcp
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>]
\fBDeprecated!\fR kernel Documentation/filesystems/nfsroot.txt defines
this method.
This is supported by dracut but not recommended.
.TP
.B rd_NFS_DOMAIN=<NFSv4 domain name>
Set the NFSv4 domain name. Will overwrite the settings in /etc/idmap.conf.
.SH iSCSI
.TP
.B root=iscsi:[username:password[:reverse:password]@][<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname>
protocol defaults to "6", LUN defaults to "0".
If the "servername" field is provided by BOOTP or DHCP, then that
field is used in conjunction with other associated fields to contact
the boot server in the Boot stage (Section 7). However, if the
"servername" field is not provided, then the "targetname" field is
then used in the Discovery Service stage in conjunction with other
associated fields.
http://tools.ietf.org/html/rfc4173
.TP
.B root=iscsi:[username:password[:reverse:password]@][<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname>
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
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!
.ad
.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=
.TP
.B root=??? iscsi_firmware
will read the iscsi parameter from the BIOS firmware
.SH FCoE
.TP
.B 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
.TP
.B 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.
.SH Network
.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
.ad l
.B ip=<client-IP>:[<server-id>]:<gateway-IP>:<netmask>:<client\%hostname>:<interface>:{none|off}
.ad
explicit network configuration
.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
.TP
.B bootdev=<interface>
specify network interface to use routing and netroot information from. Required if multiple ip= lines are used.
.SH Plymouth Boot Splash
.TP
.B rd_NO_PLYMOUTH
do not start plymouth. This will not work with encrypted partitions.
.SH Misc
.TP
.B rdblacklist=<drivername>
.BR rdblacklist= "<drivername>"
do not load kernel module <drivername>
This parameter can be specified multiple times.
.TP
.B rdloaddriver=<drivername>
.BR rdloaddriver= "<drivername>"
force loading kernel module <drivername>
This parameter can be specified multiple times.
.TP
.BR rd_retry= "<seconds>"
wait <seconds> until dracut tries to force assemble LVM or RAID volumes. If the root device is not found within <seconds>*2 then dracut fails and either drops to a shell, if rdshell is on the kernel command line, or exits with 1, which normally causes a kernel panic.
.SH Debug
Default: rd_retry=40
.SS Debug
.TP
.B rdinfo
print informational output though "quiet" is set
@@ -351,7 +176,9 @@ set -x for the dracut shell and logs to dmesg, console and /init.log
.B rdbreak
drop to a shell at the end
.TP
.B rdbreak={cmdline | pre-udev | pre-trigger | initqueue | pre-mount | mount | pre-pivot}
.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
@@ -359,27 +186,313 @@ 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
.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.
.SS I18N
e.g.
LANG=en_US.UTF-8
SYSFONT=latarcyrheb-sun16
KEYTABLE=de-latin1-nodeadkeys
.TP
.B /etc/cmdline
Can contain additional command line options.
.BR KEYBOARDTYPE= sun|pc
will be written to /etc/sysconfig/keyboard in the initramfs
.TP
.BR KEYTABLE= "<keytable filename>"
will be written to /etc/sysconfig/keyboard in the initramfs
.TP
.BR SYSFONT= "Console font"
will be written to /etc/sysconfig/i18n in the initramfs
.TP
.BR SYSFONTACM= "Unicode font map"
will be written to /etc/sysconfig/i18n in the initramfs
.TP
.BR UNIMAP= "Unicode font map"
will be written to /etc/sysconfig/i18n in the initramfs
.TP
.BR LANG= <locale>
will be written to /etc/sysconfig/i18n in the initramfs
.SS LVM
.TP
.BR rd_NO_LVM
disable LVM detection
.TP
.BR rd_LVM_VG= "<volume group name>"
only activate the volume groups with the given name
rd_LVM_VG can be specified multiple times on the kernel command line.
.TP
.BR rd_LVM_LV= "<logical volume name>"
only activate the logical volumes 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
.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.
This parameter can be specified multiple times.
.TP
.BR rd_NO_CRYPTTAB
do not check, if LUKS partition is in /etc/crypttab
.SS MD
.TP
.BR rd_NO_MD
disable MD RAID detection
.TP
.BR rd_NO_MDIMSM
no MD RAID for imsm/isw raids, use dmraid instead
.TP
.BR rd_NO_MDADMCONF
ignore mdadm.conf included in initramfs
.TP
.BR rd_MD_UUID= "<md uuid>"
only activate the raid sets with the given UUID.
This parameter can be specified multiple times.
.SS DMRAID
.TP
.BR rd_NO_DM
disable DM RAID detection
.TP
.BR rd_DM_UUID= "<dmraid uuid>"
only activate the raid sets with the given UUID.
This parameter can be specified multiple times.
.SS MULTIPATH
.TP
.BR rd_NO_MULTIPATH
disable multipath in the initramfs
.SS FIPS
.TP
.BR fips=1
enable FIPS
.TP
.BR boot=<boot device>
specify the device, where /boot is located
e.g.
boot=/dev/sda1
boot=/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1
boot=UUID=<uuid>
boot=LABEL=<label>
If the root device is encrypted, the /boot partition must reside on a seperate partition and has to be specified.
.SS Network
.TP
.BR ip= {dhcp|on|any|dhcp6|auto6|ibft}
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.
.sp
\fBauto6\fR: IPv6 autoconfiguration
.sp
\fBdhcp6\fR: IPv6 DHCP
.sp
\fBibft\fR: iBFT autoconfiguration
.TP
.BR ip= <interface>:{dhcp|on|any|dhcp6|auto6}
dhcp|on|any|dhcp6: get ip from dhcp server on a specific interface
auto6: do IPv6 autoconfiguration
This parameter can be specified multiple times.
.TP
.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]).
This parameter can be specified multiple times.
.TP
.BR ifname= <interface>:<MAC>
Assign network device name <interface> (ie eth0) to the NIC with MAC <MAC>.
Note that if you use this option you \fBmust\fR specify an ifname= argument
for all interfaces used in ip= or fcoe= arguments
This parameter can be specified multiple times.
.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
.TP
.BR vlan= "<vlanname>:<phydevice>"
Setup vlan device named <vlanname> on <phydeivce>.
We support the four styles of vlan names: VLAN_PLUS_VID (vlan0005), VLAN_PLUS_VID_NO_PAD (vlan5),
DEV_PLUS_VID (eth0.0005), DEV_PLUS_VID_NO_PAD (eth0.5)
This parameter can be specified multiple times.
.TP
.BR bridge= "<bridgename>:<ethnames>"
Setup bridge <bridgename> with <ethnames>\&. <ethnames> is a comma\-separated list of physical (ethernet) interfaces\&. Bridge without parameters assumes bridge=br0:eth0
.TP
.BR bond= "<bondname>[:<bondslaves>:[:<options>]]"
Setup bonding device <bondname> on top of <bondslaves>\&. <bondslaves> is a comma\-separated list of physical (ethernet) interfaces\&. <options> is a comma\-separated list on bonding options (modinfo bonding for details) in format compatible with initscripts\&. If <options> includes multi\-valued arp_ip_target option, then its values should be separated by semicolon\&. Bond without parameters assumes bond=bond0:eth0,eth1:mode=balance\-rr
.TP
.BR biosdevname={0|1]}
turn off/on biosdevname network interface renaming
.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. if server-ip is an IPv6 address it has to be put in brackets, e.g. [2001:DB8::1].
NFS options can be appended with the prefix ":" or "," and are seperated by ",".
.TP
.BR root= "nfs:[<server-ip>:]<root-dir>[:<nfs-options>]"
.TP
.BR root= "nfs4:[<server-ip>:]<root-dir>[:<nfs-options>]"
.TP
.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
.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.
.TP
.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>]\:[:[<iscsi_iface_name>]:[<netdev_name>]]\::[<LUN>]\::<targetname>"
.ad
protocol defaults to "6", LUN defaults to "0".
If the "servername" field is provided by BOOTP or DHCP, then that
field is used in conjunction with other associated fields to contact
the boot server in the Boot stage (Section 7). However, if the
"servername" field is not provided, then the "targetname" field is
then used in the Discovery Service stage in conjunction with other
associated fields.
http://tools.ietf.org/html/rfc4173
.TP
.ad l
.BR root= "\%iscsi:[username:password\:[:reverse:password]@]\:[<servername>]\::[<protocol>]\::[<port>]\:[:[<iscsi_iface_name>]:[<netdev_name>]]\::[<LUN>]\::<targetname>"
.ad
e.g. root=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0
.ad l
If servername is an IPv6 address, it has to be put in brackets.
e.g.
root=iscsi:[2001:DB8::1]::::iqn.2009-06.dracut:target0
.TP
.ad l
.BR root= ??? " netroot=" "\%iscsi:[username:password[:reverse:password]@]\:[<servername>]\::[<protocol>]\::[<port>]\:[:[<iscsi_iface_name>]:[<netdev_name>]]\::[<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
.ad l
If servername is an IPv6 address, it has to be put in brackets.
e.g.
netroot=iscsi:[2001:DB8::1]::::iqn.2009-06.dracut:target0
.TP
.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
.BR root= ??? " netroot=iscsi iscsi_firmware"
will read the iscsi parameter from the BIOS firmware
.TP
.BR iscsi_param= <param>
<param> will be passed as "--param <param>" to iscsistart.
This parameter can be specified multiple times.
e.g.:
"netroot=iscsi iscsi_firmware iscsi_param=node.session.timeo.replacement_timeout=30"
will result in
iscsistart -b --param node.session.timeo.replacement_timeout=30
.SS FCoE
.TP
.BR fcoe=<edd|interface|MAC>:<dcb|nodcb>
Try to connect to a FCoE SAN through the NIC specified by <interface> or <MAC> or EDD settings.
This parameter can be specified multiple times.
.SS NBD
.TP
.BR root= nbd:<server>:<port>[:<fstype>][:<mountopts>]
mount nbd share from <server>
.TP
.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.
.SS DASD
.TP
.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
This parameter can be specified multiple times.
.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 ZNET
.TP
.BR rd_ZNET= "<nettype>,<subchannels>,<options>"
rd_ZNET can be specified multiple times on the kernel command line. Examples:
rd_ZNET=qeth,0.0.0600,0.0.0601,0.0.0602,layer2=1,portname=foo
rd_ZNET=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 /var/log/dracut.log
.TP
.B /tmp/dracut.log
.TP
.B /etc/dracut.conf
see \fBdracut.conf\fR(5)
.SS "Configuration in the Initramfs"
.TP
.B /etc/conf.d/
Any files found in /etc/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

View File

@@ -1,16 +1,19 @@
# Sample dracut config file
# Specific list of dracut modules to use
#dracutmodules=""
#dracutmodules+=""
# Dracut modules to omit
#omit_dracutmodules=""
#omit_dracutmodules+=""
# Dracut modules to add to the default
#add_dracutmodules+=""
# additional kernel modules to the default
#add_drivers=""
#add_drivers+=""
# list of kernel filesystem modules to be included in the generic initramfs
#filesystems=""
#filesystems+=""
# build initrd only to boot current hardware
#hostonly="yes"

View File

@@ -12,54 +12,66 @@ Command line parameter will overwrite any values set here.
.SH OPTIONS
.TP
.BR dracutmodules="[LIST]"
.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]"
.BR omit_dracutmodules+= \%"\ [LIST]\ "
Omit a space-separated list of dracut modules.
.TP
.BR add_dracutmodules="[LIST]"
.BR add_dracutmodules+= \%"\ [LIST]\ "
Add a space-separated list of dracut modules.
.TP
.BR drivers="[LIST]"
.BR drivers+= \%"\ [LIST]\ "
Specify a space-separated list of kernel modules to
exclusively include in the initramfs.
The kernel modules have to be specified without the ".ko" suffix.
.TP
.BR add_drivers="[LIST]"
.BR add_drivers+= \%"\ [LIST]\ "
Specify a space-separated list of kernel
modules to add to the initramfs.
The kernel modules have to be specified without the ".ko" suffix.
.TP
.BR filesystems="[LIST]"
.BR omit_drivers+= \%"\ [LIST]\ "
Specify a space-separated list of kernel
modules to omit from the initramfs.
The kernel modules have to be specified without the ".ko" suffix.
Regular expressions are also allowed like ".*/fs/foo/.* .*/fs/bar/.*".
.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>"
.BR drivers_dir= \%"<dir>"
Specify the directory, where to look for kernel modules
.TP
.BR fw_dir="<dir>[:<dir> ...]"
.BR fw_dir+= \%":<dir>[:<dir>\ ...]"
Specify additional directories, where to look for firmwares, separated by :
.TP
.BR do_strip="yes|no"
.BR do_strip= \%"yes|no"
Strip binaries in the initramfs (default=yes)
.TP
.BR hostonly="yes|no"
.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"
.BR mdadmconf= \%"yes|no"
Include local /etc/mdadm.conf (default=yes)
.TP
.BR lvmconf="yes|no"
.BR lvmconf= \%"yes|no"
Include local /etc/lvm/lvm.conf (default=yes)
.TP
.BR kernel_only="yes|no"
.BR kernel_only= \%"yes|no"
Only install kernel drivers and firmware files. (default=no)
.TP
.BR no_kernel="yes|no"
.BR no_kernel= \%"yes|no"
Do not install kernel drivers and firmware files (default=no)
.TP
\fBinstall_items+=\fR"\ \&\fI<file>\fR[ \fI<file>\fR\ \&\&...]\ \&"
Specify additional files to include in the initramfs, separated by spaces.
.SH SEE ALSO
.BR dracut (8)

9
dracut.logrotate Normal file
View File

@@ -0,0 +1,9 @@
/var/log/dracut.log {
missingok
notifempty
compress
delaycompress
copytruncate
size 1M
create 0600 root root
}

BIN
dracut.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

@@ -11,23 +11,16 @@
%define with_nbd 0
%endif
%if %{defined gittag}
%define rdist .git%{gittag}%{?dist}
%define dashgittag -%{gittag}
%else
%define rdist %{?dist}
%endif
Name: dracut
Version: 004
Release: 1%{?rdist}
Release: 1%{?dist}
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
Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%if 0%{?fedora} > 12 || 0%{?rhel} >= 6
@@ -39,46 +32,44 @@ Obsoletes: nash <= 6.0.93
Obsoletes: libbdevid-python <= 6.0.93
%endif
Requires: udev
Requires: util-linux-ng
Requires: module-init-tools >= 3.7-9
Requires: cpio
Requires: coreutils
Requires: findutils
Requires: binutils
Requires: grep
Requires: which
Requires: mktemp >= 1.5-5
Requires: mount
Requires: bash
Requires: dash
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
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
Requires: dmraid
Requires: coreutils
Requires: cpio
Requires: dash
Requires: filesystem >= 2.1.0
Requires: findutils
Requires: grep
Requires: gzip
Requires: initscripts >= 8.63-1
Requires: kbd
Requires: mktemp >= 1.5-5
Requires: module-init-tools >= 3.7-9
Requires: mount
Requires: plymouth >= 0.8.0-0.2009.29.09.19.1
Requires: plymouth-scripts
Requires: sed
Requires: tar
Requires: udev
Requires: util-linux-ng >= 2.16
Requires: which
Requires: file
%if ! 0%{?with_switch_root}
Requires: util-linux-ng >= 2.16
BuildArch: noarch
%endif
BuildRequires: docbook-style-xsl docbook-dtds libxslt
BuildRequires: dash bash git
%description
dracut is a new, event-driven initramfs infrastructure based around udev.
%package network
Summary: Dracut modules to build a dracut initramfs with network support
Requires: %{name} = %{version}-%{release}
Requires: rpcbind nfs-utils
Requires: dhclient rpcbind nfs-utils
Requires: iscsi-initiator-utils
%if %{with_nbd}
Requires: nbd
@@ -91,21 +82,39 @@ 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.
Summary: Dracut modules to build a dracut initramfs with an integrity check
Requires: %{name} = %{version}-%{release}
Requires: hmaccalc
Requires: hmaccalc fipscheck
%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
Requires: nss-softokn-freebl >= 3.14.3-22.el6_6
%description fips
This package requires everything which is needed to build an
all purpose initramfs with dracut, which does an integrity check.
%package fips-aesni
Summary: Dracut modules to build a dracut initramfs with an integrity check with aesni-intel
Requires: %{name}-fips = %{version}-%{release}
%description fips-aesni
This package requires everything which is needed to build an
all purpose initramfs with dracut, which does an integrity check
and adds the aesni-intel kernel module.
%package caps
Summary: Dracut modules to build a dracut initramfs which drops capabilities
Requires: %{name} = %{version}-%{release}
Requires: libcap
%description caps
This package requires everything which is needed to build an
all purpose initramfs with dracut, which drops capabilities.
%package generic
Summary: Metapackage to build a generic initramfs with dracut
Requires: %{name} = %{version}-%{release}
@@ -119,11 +128,6 @@ 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
@@ -131,6 +135,7 @@ kernel modules and firmware files needed by dracut modules.
%package tools
Summary: Dracut tools to build the local initramfs
Requires: %{name} = %{version}-%{release}
Requires: coreutils cryptsetup-luks device-mapper
Requires: diffutils dmraid findutils gawk grep lvm2
Requires: module-init-tools sed
@@ -140,7 +145,24 @@ Requires: cpio gzip
This package contains tools to assemble the local initrd and host configuration.
%prep
%setup -q -n %{name}-%{version}%{?dashgittag}
%setup -q -n %{name}-%{version}
%if %{defined PATCH1}
git init
git config user.email "dracut-maint@redhat.com"
git config user.name "Fedora dracut team"
git add .
git commit -a -q -m "%{version} baseline."
# Apply all the patches.
git am -p1 %{patches}
%endif
chmod 0755 modules.d/*/check
# make rpmlint happy
chmod 0755 modules.d/*/install
chmod 0755 modules.d/*/installkernel
chmod 0755 modules.d/*/*.sh
%build
make WITH_SWITCH_ROOT=0%{?with_switch_root}
@@ -152,6 +174,7 @@ make install DESTDIR=$RPM_BUILD_ROOT sbindir=/sbin \
echo %{name}-%{version}-%{release} > $RPM_BUILD_ROOT/%{_datadir}/dracut/modules.d/10rpmversion/dracut-version
rm $RPM_BUILD_ROOT/%{_datadir}/dracut/modules.d/01fips/check
rm $RPM_BUILD_ROOT/%{_datadir}/dracut/modules.d/02fips-aesni/check
mkdir -p $RPM_BUILD_ROOT/boot/dracut
mkdir -p $RPM_BUILD_ROOT/var/lib/dracut/overlay
@@ -163,12 +186,18 @@ rm $RPM_BUILD_ROOT/sbin/mkinitrd
rm $RPM_BUILD_ROOT/sbin/lsinitrd
%endif
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
install -m 0644 dracut.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/dracut
echo 'do_strip=no' > $RPM_BUILD_ROOT/etc/dracut.conf.d/02-fips.conf
> $RPM_BUILD_ROOT/etc/system-fips
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,0755)
%doc README HACKING TODO COPYING AUTHORS NEWS
%doc README HACKING TODO COPYING AUTHORS NEWS dracut-rhel6.html
/sbin/dracut
%if 0%{?with_switch_root}
/sbin/switch_root
@@ -180,6 +209,10 @@ rm -rf $RPM_BUILD_ROOT
%dir %{_datadir}/dracut
%{_datadir}/dracut/dracut-functions
%config(noreplace) /etc/dracut.conf
%dir /etc/dracut.conf.d
%config(noreplace) /etc/logrotate.d/dracut
%{_mandir}/man1/lsinitrd.1*
%{_mandir}/man8/mkinitrd.8*
%{_mandir}/man8/dracut.8*
%{_mandir}/man5/dracut.conf.5*
%{_datadir}/dracut/modules.d/00dash
@@ -187,6 +220,7 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/dracut/modules.d/10rpmversion
%{_datadir}/dracut/modules.d/50plymouth
%{_datadir}/dracut/modules.d/60xen
%{_datadir}/dracut/modules.d/90btrfs
%{_datadir}/dracut/modules.d/90crypt
%{_datadir}/dracut/modules.d/90dm
%{_datadir}/dracut/modules.d/90dmraid
@@ -196,6 +230,7 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/dracut/modules.d/90mdraid
%{_datadir}/dracut/modules.d/90multipath
%{_datadir}/dracut/modules.d/95debug
%{_datadir}/dracut/modules.d/95fstab-sys
%{_datadir}/dracut/modules.d/95resume
%{_datadir}/dracut/modules.d/95rootfs-block
%{_datadir}/dracut/modules.d/95dasd
@@ -205,13 +240,15 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/dracut/modules.d/95terminfo
%{_datadir}/dracut/modules.d/95udev-rules
%{_datadir}/dracut/modules.d/95uswsusp
%{_datadir}/dracut/modules.d/96insmodpost
%{_datadir}/dracut/modules.d/97biosdevname
%{_datadir}/dracut/modules.d/98syslog
%{_datadir}/dracut/modules.d/99base
%attr(0644,root,root) %ghost %config(missingok,noreplace) %{_localstatedir}/log/dracut.log
%files network
%doc README HACKING TODO COPYING AUTHORS NEWS
%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
@@ -223,8 +260,20 @@ rm -rf $RPM_BUILD_ROOT
%defattr(-,root,root,0755)
%doc COPYING
%{_datadir}/dracut/modules.d/01fips
%config(noreplace) /etc/dracut.conf.d/02-fips.conf
%config(missingok) /etc/system-fips
%files kernel
%files fips-aesni
%defattr(-,root,root,0755)
%doc COPYING
%{_datadir}/dracut/modules.d/02fips-aesni
%files caps
%defattr(-,root,root,0755)
%doc COPYING
%{_datadir}/dracut/modules.d/02caps
%files kernel
%defattr(-,root,root,0755)
%doc README.kernel
@@ -232,7 +281,7 @@ rm -rf $RPM_BUILD_ROOT
%defattr(-,root,root,0755)
%doc README.generic
%files tools
%files tools
%defattr(-,root,root,0755)
%doc COPYING NEWS
%{_mandir}/man8/dracut-gencmdline.8*
@@ -244,222 +293,3 @@ 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
- workaround for broken mdmon implementation
* Wed Sep 16 2009 Harald Hoyer <harald@redhat.com> 001-12
- removed lvm/mdraid/dmraid lock files
- add missing ifname= files
* Wed Sep 16 2009 Harald Hoyer <harald@redhat.com> 001-11
- generate dracut-version during rpm build time
* Tue Sep 15 2009 Harald Hoyer <harald@redhat.com> 001-10
- add ifname= argument for persistent netdev names
- new /initqueue-finished to check if the main loop can be left
- copy mdadm.conf if --mdadmconf set or mdadmconf in dracut.conf
* Wed Sep 09 2009 Harald Hoyer <harald@redhat.com> 001-9
- added Requires: plymouth-scripts
* Wed Sep 09 2009 Harald Hoyer <harald@redhat.com> 001-8
- plymouth: use plymouth-populate-initrd
- add add_drivers for dracut and dracut.conf
- do not mount /proc and /selinux manually in selinux-load-policy
* Wed Sep 09 2009 Harald Hoyer <harald@redhat.com> 001-7
- add scsi_wait_scan to be sure everything was scanned
* Tue Sep 08 2009 Harald Hoyer <harald@redhat.com> 001-6
- fixed several problems with md raid containers
- fixed selinux policy loading
* Tue Sep 08 2009 Harald Hoyer <harald@redhat.com> 001-5
- patch does not honor file modes, fixed them manually
* Mon Sep 07 2009 Harald Hoyer <harald@redhat.com> 001-4
- fixed mdraid for IMSM
* Mon Sep 07 2009 Harald Hoyer <harald@redhat.com> 001-3
- fixed bug, which prevents installing 61-persistent-storage.rules (bug #520109)
* Thu Sep 03 2009 Harald Hoyer <harald@redhat.com> 001-2
- fixed missing grep for md
- reorder cleanup
* Wed Sep 02 2009 Harald Hoyer <harald@redhat.com> 001-1
- version 001
- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS
* Fri Aug 14 2009 Harald Hoyer <harald@redhat.com> 0.9-1
- version 0.9
* Thu Aug 06 2009 Harald Hoyer <harald@redhat.com> 0.8-1
- version 0.8
- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS
* Fri Jul 24 2009 Harald Hoyer <harald@redhat.com> 0.7-1
- version 0.7
- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS
* Wed Jul 22 2009 Harald Hoyer <harald@redhat.com> 0.6-1
- version 0.6
- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS
* Fri Jul 17 2009 Harald Hoyer <harald@redhat.com> 0.5-1
- version 0.5
- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS
* Sat Jul 04 2009 Harald Hoyer <harald@redhat.com> 0.4-1
- version 0.4
- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS
* Thu Jul 02 2009 Harald Hoyer <harald@redhat.com> 0.3-1
- version 0.3
- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS
* Wed Jul 01 2009 Harald Hoyer <harald@redhat.com> 0.2-1
- version 0.2
* Fri Jun 19 2009 Harald Hoyer <harald@redhat.com> 0.1-1
- first release
* Thu Dec 18 2008 Jeremy Katz <katzj@redhat.com> - 0.0-1
- Initial build

1701
dracut.svg Normal file

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 68 KiB

61
git2spec.pl Executable file
View File

@@ -0,0 +1,61 @@
#!/usr/bin/perl
sub last_tag {
open( GIT, 'git log --pretty=format:%H |');
LINE: while( <GIT> ) {
open( GIT2, "git tag --contains $_ |");
while( <GIT2> ) {
chomp;
last LINE if /..*/;
}
close GIT2;
}
$tag=$_;
close GIT2;
close GIT; # be done
return $tag;
};
sub create_patches {
my $tag=shift;
my $pdir=shift;
my $num=0;
open( GIT, 'git format-patch -M -N --no-signature -o "'.$pdir.'" '.$tag.' |');
@lines=<GIT>;
close GIT; # be done
return @lines;
};
use POSIX qw(strftime);
my $datestr = strftime "%Y%m%d", gmtime;
my $tag=shift;
my $pdir=shift;
$tag=&last_tag if not defined $tag;
my @patches=&create_patches($tag, $pdir);
my $num=$#patches + 2;
$tag=~s/[^0-9]+?([0-9]+)/$1/;
my $release="$num.git$datestr";
$release="1" if $num == 1;
while(<>) {
if (/^Version:/) {
print "Version: $tag\n";
}
elsif (/^Release:/) {
print "Release: $release%{?dist}\n";
}
elsif ((/^Source0:/) || (/^Source:/)) {
print $_;
$num=1;
for(@patches) {
s/.*\///g;
print "Patch$num: $_";
$num++;
}
print "\n";
}
else {
print $_;
}
}

1
install/.kateconfig Normal file
View File

@@ -0,0 +1 @@
kate: space-indent on; tab-width 8; indent-width 8; replace-tabs on; eol unix;

148
lsinitrd
View File

@@ -1,11 +1,141 @@
#!/bin/bash
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
#
# Copyright 2005-2010 Harald Hoyer <harald@redhat.com>
# Copyright 2005-2010 Red Hat, Inc. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
[[ $# -eq 1 ]] || { echo "Usage: $(basename $0) <initramfs file>" ; exit 1 ; }
[[ -f $1 ]] || { echo "$1 does not exist" ; exit 1 ; }
usage()
{
{
echo "Usage: ${0##*/} [options] [<initramfs file> [<filename> [<filename> [...] ]]]"
echo "Usage: ${0##*/} [options] -k <kernel version>"
echo
echo "-h, --help print a help message and exit."
echo "-s, --size sort the contents of the initramfs by size."
echo "-f, --file <filename> print the contents of <filename>."
echo "-k, --kver <kernel version> inspect the initramfs of <kernel version>."
echo
} >&2
}
echo "$1:"
echo "========================================================================"
zcat $1 | cpio --extract --verbose --quiet --to-stdout 'dracut-*' 2>/dev/null
echo "========================================================================"
zcat $1 | cpio --extract --verbose --quiet --list
echo "========================================================================"
sorted=0
declare -A filenames
unset POSIXLY_CORRECT
TEMP=$(getopt \
-o "shf:k:" \
--long kver: \
--long file: \
--long help \
--long size \
-- "$@")
if (( $? != 0 )); then
usage
exit 1
fi
eval set -- "$TEMP"
while (($# > 0)); do
case $1 in
-k|--kver) KERNEL_VERSION="$2"; shift;;
-f|--file) filenames[${2#/}]=1; shift;;
-s|--size) sorted=1;;
-h|--help) usage; exit 0;;
--) shift;break;;
*) usage; exit 1;;
esac
shift
done
[[ $KERNEL_VERSION ]] || KERNEL_VERSION="$(uname -r)"
if [[ $1 ]]; then
image="$1"
if ! [[ -f "$image" ]]; then
{
echo "$image does not exist"
echo
} >&2
usage
exit 1
fi
else
image="/boot/initramfs-${KERNEL_VERSION}.img"
fi
shift
while (($# > 0)); do
filenames[${1#/}]=1;
shift
done
if ! [[ -f "$image" ]]; then
{
echo "No <initramfs file> specified and the default image '$image' cannot be accessed!"
echo
} >&2
usage
exit 1
fi
read -N 6 bin < "$image"
case $bin in
$'\x1f\x8b'*)
CAT="zcat";;
BZh*)
CAT="bzcat";;
070701)
CAT="cat";;
*)
CAT="xzcat";
if echo "test"|xz|xzcat --single-stream >/dev/null 2>&1; then
CAT="xzcat --single-stream"
fi
;;
esac
ret=0
if (( ${#filenames[@]} > 0 )); then
(( ${#filenames[@]} == 1 )) && nofileinfo=1
for f in ${!filenames[@]}; do
[[ $nofileinfo ]] || echo "initramfs:/$f"
[[ $nofileinfo ]] || echo "========================================================================"
$CAT -- $image | cpio --extract --verbose --quiet --to-stdout $f 2>/dev/null
((ret+=$?))
[[ $nofileinfo ]] || echo "========================================================================"
[[ $nofileinfo ]] || echo
done
else
echo "Image: $image: $(du -h $image | while read a b; do echo $a;done)"
echo "========================================================================"
$CAT -- "$image" | cpio --extract --verbose --quiet --to-stdout -- 'dracut-*' 2>/dev/null
((ret+=$?))
echo "========================================================================"
if [ "$sorted" -eq 1 ]; then
$CAT -- "$image" | cpio --extract --verbose --quiet --list | sort -n -k5
else
$CAT -- "$image" | cpio --extract --verbose --quiet --list | sort -k9
fi
((ret+=$?))
echo "========================================================================"
fi
exit $ret

73
lsinitrd.1 Normal file
View File

@@ -0,0 +1,73 @@
'\" t
.\" Title: lsinitrd
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 07/17/2013
.\" Manual: dracut
.\" Source: dracut
.\" Language: English
.\"
.TH "LSINITRD" "1" "07/17/2013" "dracut" "dracut"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
lsinitrd \- tool to show the contents of an initramfs image
.SH "SYNOPSIS"
.sp
\fBlsinitrd\fR [\fIOPTION\&...\fR] [<image> [<filename> [<filename> [\&...] ]]]
.sp
\fBlsinitrd\fR [\fIOPTION\&...\fR] \-k <kernel\-version>
.SH "DESCRIPTION"
.sp
lsinitrd shows the contents of an initramfs image\&. if <image> is omitted, then lsinitrd uses the default image \fI/boot/<machine\-id>/<kernel\-version>/initrd\fR or \fI/boot/initramfs\-<kernel\-version>\&.img\fR\&.
.SH "OPTIONS"
.PP
\fB\-h, \-\-help\fR
.RS 4
print a help message and exit\&.
.RE
.PP
\fB\-s, \-\-size\fR
.RS 4
sort the contents of the initramfs by size\&.
.RE
.PP
\fB\-f, \-\-file\fR\ \&\fI<filename>\fR
.RS 4
print the contents of <filename>\&.
.RE
.PP
\fB\-k, \-\-kver\fR\ \&\fI<kernel version>\fR
.RS 4
inspect the initramfs of <kernel version>\&.
.RE
.SH "AVAILABILITY"
.sp
The lsinitrd command is part of the dracut package and is available from \m[blue]\fBhttps://dracut\&.wiki\&.kernel\&.org\fR\m[]
.SH "AUTHORS"
.sp
Harald Hoyer
.sp
Amerigo Wang
.sp
Nikoli
.SH "SEE ALSO"
.sp
\fBdracut\fR(8)

View File

@@ -68,7 +68,7 @@ while [ $# -gt 0 ]; do
-v|--verbose)
dracut_args="${dracut_args} -v"
;;
-f)
-f|--force)
dracut_args="${dracut_args} -f"
;;
--preload*)
@@ -142,9 +142,9 @@ if [ -n "$img_vers" ]; then
fi
if [ -n "$basicmodules" ]; then
dracut -H $dracut_args --add-drivers "$basicmodules" "$target" "$kernel"
dracut $dracut_args --add-drivers "$basicmodules" "$target" "$kernel"
else
dracut -H $dracut_args "$target" "$kernel"
dracut $dracut_args "$target" "$kernel"
fi
# vim:ts=8:sw=4:sts=4:et

103
mkinitrd.8 Normal file
View File

@@ -0,0 +1,103 @@
'\" t
.\" Title: mkinitrd
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 07/17/2013
.\" Manual: dracut
.\" Source: dracut
.\" Language: English
.\"
.TH "MKINITRD" "8" "07/17/2013" "dracut" "dracut"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
mkinitrd \- is a compat wrapper, which calls dracut to generate an initramfs
.SH "SYNOPSIS"
.sp
\fBmkinitrd\fR [\fIOPTION\&...\fR] [<initrd\-image>] <kernel\-version>
.SH "DESCRIPTION"
.sp
mkinitrd creates an initramfs image <initrd\-image> for the kernel with version <kernel\-version> by calling "dracut"\&.
.if n \{\
.sp
.\}
.RS 4
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBImportant\fR
.ps -1
.br
.sp
If a more fine grained control over the resulting image is needed, "dracut" should be called directly\&.
.sp .5v
.RE
.SH "OPTIONS"
.PP
\fB\-\-version\fR
.RS 4
print info about the version
.RE
.PP
\fB\-v, \-\-verbose\fR
.RS 4
increase verbosity level
.RE
.PP
\fB\-f, \-\-force\fR
.RS 4
overwrite existing initramfs file\&.
.RE
.PP
\fB*\-\-image\-version\fR
.RS 4
append the kernel version to the target image <initrd\-image>\-<kernel\-version>\&.
.RE
.PP
\fB\-\-with=<module>\fR
.RS 4
add the kernel module <module> to the initramfs\&.
.RE
.PP
\fB\-\-preload=<module>\fR
.RS 4
preload the kernel module <module> in the initramfs before any other kernel modules are loaded\&. This can be used to ensure a certain device naming, which should in theory be avoided and the use of symbolic links in /dev is encouraged\&.
.RE
.PP
\fB\-\-nocompress\fR
.RS 4
do not compress the resulting image\&.
.RE
.PP
\fB\-\-help\fR
.RS 4
print a help message and exit\&.
.RE
.SH "AVAILABILITY"
.sp
The mkinitrd command is part of the dracut package and is available from \m[blue]\fBhttps://dracut\&.wiki\&.kernel\&.org\fR\m[]
.SH "AUTHORS"
.sp
Harald Hoyer
.SH "SEE ALSO"
.sp
\fBdracut\fR(8)

View File

@@ -1,19 +1,5 @@
#!/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
[[ $1 = -d ]] && exit 0
exit 255

12
modules.d/01fips/fips-boot.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
if ! fipsmode=$(getarg fips) || [ $fipsmode = "0" ]; then
rm -f /etc/modprobe.d/fips.conf >/dev/null 2>&1
elif getarg boot= >/dev/null; then
. /sbin/fips.sh
if mount_boot; then
do_fips || die "FIPS integrity test failed"
fi
fi

11
modules.d/01fips/fips-noboot.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
if ! fipsmode=$(getarg fips) || [ $fipsmode = "0" ]; then
rm -f /etc/modprobe.d/fips.conf >/dev/null 2>&1
elif ! [ -f /tmp/fipsdone ]; then
. /sbin/fips.sh
mount_boot
do_fips || die "FIPS integrity test failed"
fi

View File

@@ -1,70 +1,124 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
mount_boot()
{
boot=$(getarg boot=)
if [ -n "$boot" ]; then
case "$boot" in
LABEL=*)
boot="$(echo $boot | sed 's,/,\\x2f,g')"
boot="/dev/disk/by-label/${boot#LABEL=}"
;;
UUID=*)
boot="/dev/disk/by-uuid/${boot#UUID=}"
;;
/dev/*)
;;
*)
die "You have to specify boot=<boot device> as a boot option for fips=1" ;;
esac
if ! [ -e "$boot" ]; then
udevadm trigger --action=add >/dev/null 2>&1
[ -z "$UDEVVERSION" ] && UDEVVERSION=$(udevadm --version)
i=0
while ! [ -e $boot ]; do
if [ $UDEVVERSION -ge 143 ]; then
udevadm settle --exit-if-exists=$boot >/dev/null 2>&1
else
udevadm settle --timeout=30 >/dev/null 2>&1
fi
[ -e $boot ] && break
modprobe scsi_wait_scan && rmmod scsi_wait_scan
[ -e $boot ] && break
sleep 0.5
i=$(($i+1))
[ $i -gt 40 ] && break
done
fi
[ -e "$boot" ] || return 1
mkdir /boot
info "Mounting $boot as /boot"
mount -oro "$boot" /boot || return 1
elif [ -d "$NEWROOT/boot" ]; then
rm -fr /boot
ln -sf "$NEWROOT/boot" /boot
fi
}
do_rhevh_check()
{
KERNEL=$(uname -r)
kpath=${1}
# If we're on RHEV-H, the kernel is in /dev/.initramfs/live/vmlinuz0
HMAC_SUM_ORIG=$(cat $NEWROOT/boot/.vmlinuz-${KERNEL}.hmac | while read a b; do printf "%s\n" $a; done)
HMAC_SUM_CALC=$(sha512hmac $kpath | while read a b; do printf "%s\n" $a; done || return 1)
if [ -z "$HMAC_SUM_ORIG" ] || [ -z "$HMAC_SUM_CALC" ] || [ "${HMAC_SUM_ORIG}" != "${HMAC_SUM_CALC}" ]; then
warn "HMAC sum mismatch"
return 1
fi
info "rhevh_check OK"
return 0
}
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
local _v
local _s
local _v
local _module
info "Checking integrity of kernel"
KERNEL=$(uname -r)
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
if [ -e "/dev/.initramfs/live/vmlinuz0" ]; then
do_rhevh_check /dev/.initramfs/live/vmlinuz0 || return 1
elif [ -e "/dev/.initramfs/live/isolinux/vmlinuz0" ]; then
do_rhevh_check /dev/.initramfs/live/isolinux/vmlinuz0 || return 1
else
sha512hmac -c "/boot/.vmlinuz-${KERNEL}.hmac" || return 1
fi
info "Umounting /boot"
umount /boot
FIPSMODULES=$(cat /etc/fipsmodules)
info "Loading and integrity checking all crypto modules"
for module in $FIPSMODULES; do
if [ "$module" != "tcrypt" ]; then
modprobe ${module} || return 1
mv /etc/modprobe.d/fips.conf /etc/modprobe.d/fips.conf.bak
for _module in $FIPSMODULES; do
if [ "$_module" != "tcrypt" ]; then
if ! modprobe "${_module}"; then
# check if kernel provides generic algo
_found=0
while read _k _s _v; do
[ "$_k" != "name" -a "$_k" != "driver" ] && continue
[ "$_k" = "driver" ] && _v=$(str_replace "$_v" "_" "-")
[ "$_v" != "$_module" ] && continue
_found=1
break
done </proc/crypto
[ "$_found" = "0" ] && return 1
fi
fi
done
mv /etc/modprobe.d/fips.conf.bak /etc/modprobe.d/fips.conf
info "Self testing crypto algorithms"
modprobe tcrypt noexit=1 || return 1
modprobe tcrypt || return 1
rmmod tcrypt
info "All initrd crypto checks done"
info "All initrd crypto checks done"
> /tmp/fipsdone
umount /boot >/dev/null 2>&1
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

View File

@@ -1,23 +1,35 @@
#!/bin/bash
inst_hook pre-trigger 01 "$moddir/fips.sh"
inst_hook pre-trigger 01 "$moddir/fips-boot.sh"
inst_hook pre-pivot 01 "$moddir/fips-noboot.sh"
inst "$moddir/fips.sh" /sbin/fips.sh
dracut_install sha512hmac rmmod insmod mount uname umount
libdir="lib"
if ldd $(find_binary sha512hmac) |grep -q /lib64/libc; then
if ldd $(find_binary sha512hmac) 2>/dev/null | 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
/usr/$libdir/libsoftokn3.so /usr/$libdir/libsoftokn3.chk
else
dracut_install \
/$libdir/libsoftokn3.so /$libdir/libsoftokn3.chk \
/$libdir/libfreebl3.so /$libdir/libfreebl3.chk
/$libdir/libsoftokn3.so /$libdir/libsoftokn3.chk
fi
dracut_install /usr/$libdir/hmaccalc/sha512hmac.hmac
for i in /{usr,}/$libdir/libssl.so* /{usr,}/$libdir/libcrypto.so* \
/{usr,}/$libdir/.libssl.so*.hmac /{usr,}/$libdir/.libcrypto.so*.hmac; do
[ -e $i ] || continue
dracut_install $i
done
dracut_install -o /usr/$libdir/hmaccalc/sha*hmac.hmac
dracut_install fipscheck
dracut_install /etc/system-fips
if command -v prelink >/dev/null; then
dracut_install prelink
fi
# vim:ts=8:sw=4:sts=4:et

View File

@@ -1,13 +1,15 @@
#!/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"
_fipsmodules="aead aes_generic aes-x86_64 ansi_cprng arc4 blowfish camellia cast6 cbc ccm "
_fipsmodules+="chainiv crc32c cryptomgr crypto_null ctr cts deflate des des3_ede dm-crypt dm-mod drbg "
_fipsmodules+="ecb eseqiv fcrypt gcm ghash_generic hmac khazad lzo md4 md5 michael_mic rmd128 "
_fipsmodules+="rmd160 rmd256 rmd320 rot13 salsa20 seed seqiv serpent sha1 sha224 sha256 sha256_generic "
_fipsmodules+="sha384 sha512 sha512_generic tcrypt tea tnepres twofish wp256 wp384 wp512 xeta xtea xts zlib"
mkdir -p "${initdir}/etc/modprobe.d"
for mod in $FIPSMODULES; do
if instmods $mod; then
for mod in $_fipsmodules; do
if hostonly='' instmods $mod; then
echo $mod >> "${initdir}/etc/fipsmodules"
echo "blacklist $mod" >> "${initdir}/etc/modprobe.d/fips.conf"
fi

33
modules.d/02caps/README Normal file
View File

@@ -0,0 +1,33 @@
This adds the following parameters:
rd.caps=1
turn the caps module on/off
rd.caps.initdrop=cap_sys_module,cap_sys_rawio
drop the specified comma seperated capabilities
rd.caps.disablemodules=1
turn off module loading
rd.caps.disablekexec=1
turn off the kexec functionality
If module loading is turned off, all modules have to be loaded in the
initramfs, which are used later on. This can be done with
"rdloaddriver="
rdloaddriver=autofs4,sunrpc,ipt_REJECT,nf_conntrack_ipv4,....
Because the kernel command line would get huge with all those drivers, I
recommend to make use of $initramfs/etc/cmdline.
So, all rd.caps.* and rdloaddriver arguments are in caps.conf can be
copied to $initramfs/etc/cmdline with "-i caps.conf /etc/cmdline".
Also all modules have to be loaded in the initramfs via "--add-drivers".
The resulting initramfs creation would look like this:
--add-drivers "autofs4 sunrpc ipt_REJECT nf_conntrack_ipv4 \
nf_defrag_ipv4 iptable_filter ip_tables
ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack
ip6table_filter ip6_tables dm_mirror dm_region_hash dm_log uinput ppdev
parport_pc parport ipv6 sg 8139too 8139cp mii i2c_piix4 i2c_core ext3
jbd mbcache sd_mod crc_t10dif sr_mod cdrom ata_generic pata_acpi ata_piix
dm_mod" \
/boot/initramfs-caps.img

36
modules.d/02caps/caps.sh Executable file
View File

@@ -0,0 +1,36 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
capsmode=$(getarg rd.caps)
if [ "$capsmode" = "1" ]; then
CAPS_INIT_DROP=$(getarg rd.caps.initdrop=)
CAPS_USERMODEHELPER_BSET=$(capsh --drop="$CAPS_INIT_DROP" -- -c 'while read a b ; do [ "$a" = "CapBnd:" ] && echo $((0x${b:$((${#b}-8)):8})) $((0x${b:$((${#b}-16)):8})) && break; done < /proc/self/status')
CAPS_MODULES_DISABLED=$(getarg rd.caps.disablemodules=)
CAPS_KEXEC_DISABLED=$(getarg rd.caps.disablekexec=)
info "Loading CAPS_MODULES $CAPS_MODULES"
for i in $CAPS_MODULES;do modprobe $i 2>&1 >/dev/null | vinfo; done
if [ "$CAPS_MODULES_DISABLED" = "1" -a -e /proc/sys/kernel/modules_disabled ]; then
info "Disabling module loading."
echo $CAPS_MODULES_DISABLED > /proc/sys/kernel/modules_disabled
fi
if [ "$CAPS_KEXEC_DISABLED" = "1" -a -e /proc/sys/kernel/kexec_disabled ]; then
info "Disabling kexec."
echo $CAPS_KEXEC_DISABLED > /proc/sys/kernel/kexec_disabled
fi
info "CAPS_USERMODEHELPER_BSET=$CAPS_USERMODEHELPER_BSET"
if [ -e /proc/sys/kernel/usermodehelper/bset ]; then
info "Setting usermode helper bounding set."
echo $CAPS_USERMODEHELPER_BSET > /proc/sys/kernel/usermodehelper/bset
echo $CAPS_USERMODEHELPER_BSET > /proc/sys/kernel/usermodehelper/inheritable
fi
echo "CAPS_INIT_DROP=\"$CAPS_INIT_DROP\"" > /etc/capsdrop
info "Will drop capabilities $CAPS_INIT_DROP from init."
fi

8
modules.d/02caps/check Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
[[ $1 = -d ]] && exit 0
type -P capsh >/dev/null 2>&1 || exit 1
exit 0

10
modules.d/02caps/install Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
inst_hook pre-pivot 99 "$moddir/caps.sh"
dracut_install capsh
# capsh wants bash and we need bash also
inst /bin/bash && ln -sf bash "${initdir}/bin/sh"

5
modules.d/02fips-aesni/check Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/bash
[[ $1 = -d ]] && exit 0
exit 255

View File

@@ -0,0 +1,14 @@
#!/bin/bash
FIPSMODULES="aesni-intel"
mkdir -p "${initdir}/etc/modprobe.d"
for mod in $FIPSMODULES; do
if hostonly='' 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

@@ -94,7 +94,7 @@ else
dracut_install gzip bzip2
fi
dracut_install /lib/udev/console_init
[ -x /lib/udev/console_init ] && dracut_install /lib/udev/console_init
dracut_install setfont loadkeys
inst_rules 10-console.rules
inst_hook cmdline 20 "$moddir/parse-i18n.sh"

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

@@ -1,5 +1,10 @@
#!/bin/bash
if [[ $1 = -d ]]; then
[ -d /etc/sysconfig/network-scripts/ ] && echo ifcfg
exit 0
fi
. $dracutfunctions
for program in ip arping; do
@@ -9,11 +14,14 @@ for program in ip arping; do
exit 1
fi
done
for program in dhclient brctl; do
for program in dhclient brctl ifenslave tr; 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

View File

@@ -20,15 +20,17 @@ setup_interface() {
# 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
if ! ip link set $netif mtu $mtu ; then
ip link set $netif down
ip link set $netif mtu $mtu
ip link set $netif up
wait_for_if_up $netif
fi
fi
echo ip addr add $ip${mask:+/$mask} ${bcast:+broadcast $bcast} dev $netif >> /tmp/net.$netif.up
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
@@ -44,26 +46,21 @@ setup_interface() {
PATH=$PATH:/sbin:/usr/sbin
export PS4="dhclient.$interface.$$ + "
exec >>/dev/initlog.pipe 2>>/dev/initlog.pipe
. /lib/dracut-lib.sh
if getarg rdnetdebug ; then
exec >/tmp/dhclient.$interface.$$.out
exec 2>>/tmp/dhclient.$interface.$$.out
set -x
fi
# We already need a set netif here
netif=$interface
# Huh? Interface configured?
[ -f "/tmp/net.$netif.up" ] && exit 0
case $reason in
PREINIT)
echo "dhcp: PREINIT $netif up"
ip link set $netif up
wait_for_if_up $netif
;;
BOUND)
echo "dhcp: BOND setting $netif"
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
@@ -76,7 +73,7 @@ case $reason in
echo online > /sys/class/net/$netif/uevent
/sbin/initqueue --onetime --name netroot-$netif /sbin/netroot $netif
;;
*) ;;
*) echo "dhcp: $reason";;
esac
exit 0

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"

View File

@@ -2,20 +2,26 @@
# if there are no ifname parameters, just use NAME=KERNEL
if ! getarg ifname= >/dev/null ; then
echo 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="?*", ATTR{type}=="1", NAME="%k"' \
> /etc/udev/rules.d/50-ifname.rules
return
fi
{
echo 'SUBSYSTEM!="net", GOTO="ifname_end"'
echo 'ACTION!="add", GOTO="ifname_end"'
echo 'ATTR{type}!="1", GOTO="ifname_end"'
for p in $(getargs ifname=); do
parse_ifname_opts $p
printf 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="%s", ATTR{type}=="1", NAME="%s"\n' "$ifname_mac" "$ifname_if"
printf 'DRIVERS=="?*", ATTR{address}=="%s", NAME="%s", GOTO="ifname_end"\n' "$ifname_mac" "$ifname_if"
done
# Rename non named interfaces out of the way for named ones.
for p in $(getargs ifname=); do
parse_ifname_opts $p
printf 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="?*", ATTR{type}=="1", NAME!="?*", KERNEL=="%s", NAME="%%k-renamed"\n' "$ifname_if"
printf 'DRIVERS=="?*", ATTR{address}!="%s", KERNEL=="%s", NAME="rename$attr{ifindex}", GOTO="ifname_end"\n' "$ifname_mac" "$ifname_if"
done
echo 'LABEL="ifname_end"'
} > /etc/udev/rules.d/50-ifname.rules

View File

@@ -3,58 +3,111 @@
# 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
export PS4="ifup.$1.$$ + "
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
[ "$RDDEBUG" = "yes" ] \
&& [ -e /dev/initlog.pipe ] \
&& exec >>/dev/initlog.pipe 2>>/dev/initlog.pipe
# 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
#echo "Starting dhcp for interface $netif"
ip link set $netif up
wait_for_if_up $netif
[ -n "$macaddr" ] && ip link set address $macaddr dev $netif
[ -n "$mtu" ] && ip link set mtu $mtu dev $netif
dhclient "$@" -1 -q -cf /etc/dhclient.conf -pf /tmp/dhclient.$netif.pid -lf /tmp/dhclient.$netif.lease $netif &
# increase wait time for DHCP
echo '[ $(($RDRETRY-$main_loop)) -lt 720 ] && RDRETRY=$(($main_loop+720)); rm -f "$job"' > /initqueue/rd_retry_inc_dhclient.$netif.sh
#|| echo "dhcp failed"
}
# Handle static ip configuration
do_static() {
{
echo ip link set $netif up
echo wait_for_if_up $netif
echo ip addr flush dev $netif
echo ip addr add $ip/$mask dev $netif
} > /tmp/net.$netif.up
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
ip link set $netif up
wait_for_if_up $netif
[ -n "$macaddr" ] && ip link set address $macaddr dev $netif
[ -n "$mtu" ] && ip link set mtu $mtu dev $netif
}
> /tmp/net.$netif.up
[ -n "$gw" ] && echo ip route add default via $gw dev $netif > /tmp/net.$netif.gw
[ -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
# Handle static ip configuration
do_static() {
strstr $ip '*:*:*' && load_ipv6
. /lib/dracut-lib.sh
{
ip link set $netif up
wait_for_if_up $netif
[ -n "$macaddr" ] && ip link set address $macaddr dev $netif
[ -n "$mtu" ] && ip link set mtu $mtu dev $netif
# do not flush addr for ipv6
#strstr $ip '*:*:*' || \
# ip addr flush dev $netif
ip addr add $ip/$mask brd + dev $netif
}
> /tmp/net.$netif.up
if getarg rdnetdebug ; then
exec >/tmp/ifup.$1.$$.out
exec 2>>/tmp/ifup.$1.$$.out
set -x
fi
[ -n "$gw" ] && echo ip route add default via $gw dev $netif > /tmp/net.$netif.gw
[ -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
}
get_vid() {
case "$1" in
vlan*)
echo ${1#vlan}
;;
*.*)
echo ${1##*.}
;;
esac
}
# Huh? No $1?
[ -z "$1" ] && exit 1
@@ -62,14 +115,47 @@ fi
# $netif reads easier than $1
netif=$1
# check, if we need VLAN's for this interface
if [ -z "$DO_VLAN_PHY" ] && [ -e /tmp/vlan.${netif}.phy ]; then
NO_AUTO_DHCP=yes DO_VLAN_PHY=yes ifup "$netif"
modprobe -b -q 8021q
for i in /tmp/vlan.*.${netif}; do
[ -e "$i" ] || continue
read vlanname < "$i"
if [ -n "$vlanname" ]; then
ip link set "$netif" up
wait_for_if_up "$netif"
ip link add dev "$vlanname" link "$netif" type vlan id "$(get_vid $vlanname)"
ifup "$vlanname"
fi
done
exit 0
fi
# enslave this interface to bond?
if [ -e /tmp/bond.info ]; then
. /tmp/bond.info
for slave in $bondslaves ; do
if [ "$netif" = "$slave" ] ; then
netif=$bondname
fi
done
fi
# bridge this interface?
if [ -e /tmp/bridge.info ]; then
. /tmp/bridge.info
if [ "$netif" = "$ethname" ]; then
netif="$bridgename"
if [ "$netif" = "$bondname" ] && [ -n "$DO_BOND_SETUP" ] ; then
: # We need to really setup bond (recursive call)
else
netif="$bridgename"
fi
fi
fi
# bail immediately if the interface is already up
# or we don't need the network
[ -f "/tmp/net.$netif.up" ] && exit 0
@@ -85,11 +171,63 @@ if [ "$netif" = "lo" ] ; then
exit 0
fi
# start bond if needed
if [ -e /tmp/bond.info ]; then
. /tmp/bond.info
if [ "$netif" = "$bondname" ] && [ ! -e /tmp/net.$bondname.up ] ; then # We are master bond device
modprobe bonding
echo "+$netif" > /sys/class/net/bonding_masters
ip link set $netif down
# Stolen from ifup-eth
# add the bits to setup driver parameters here
for arg in $bondoptions ; do
key=${arg%%=*};
value=${arg##*=};
# %{value:0:1} is replaced with non-bash specific construct
if [ "${key}" = "arp_ip_target" -a "${#value}" != "0" -a "+${value%%+*}" != "+" ]; then
OLDIFS=$IFS;
IFS=',';
for arp_ip in $value; do
echo +$arp_ip > /sys/class/net/${netif}/bonding/$key
done
IFS=$OLDIFS;
else
echo $value > /sys/class/net/${netif}/bonding/$key
fi
done
ip link set $netif up
for slave in $bondslaves ; do
ip link set $slave down
ifenslave $bondname $slave
ip link set $slave up
wait_for_if_up $slave
done
# add the bits to setup the needed post enslavement parameters
for arg in $BONDING_OPTS ; do
key=${arg%%=*};
value=${arg##*=};
if [ "${key}" = "primary" ]; then
echo $value > /sys/class/net/${netif}/bonding/$key
fi
done
fi
fi
# XXX need error handling like dhclient-script
# start bridge if necessary
if [ "$netif" = "$bridgename" ] && [ ! -e /tmp/net.$bridgename.up ]; then
ip link set $ethname up
if [ "$ethname" = "$bondname" ] ; then
DO_BOND_SETUP=yes /sbin/ifup $bondname
else
ip link set $ethname up
fi
wait_for_if_up $ethname
# Create bridge and add eth to bridge
brctl addbr $bridgename
@@ -97,27 +235,57 @@ if [ "$netif" = "$bridgename" ] && [ ! -e /tmp/net.$bridgename.up ]; then
brctl addif $bridgename $ethname
fi
# No ip lines default to dhcp
ip=$(getarg ip)
[ -z "$ip" ] && do_dhcp;
if [ -z "$NO_AUTO_DHCP" ] && [ -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
for p in $(getargs ip=); do
ip_to_var $p
# If this option isn't directed at our interface, skip it
[ -n "$dev" ] && [ "$dev" != "$netif" ] && continue
# skip ibft
if [ "$autoconf" = "ibft" ]; then
if [ -n "$mtu" ] || mtu=$(getarg "mtu="); then
ip link set mtu $mtu dev $netif
fi
continue
fi
# Store config for later use
for i in ip srv gw mask hostname; do
for i in ip srv gw mask hostname macaddr mtu; do
eval '[ "$'$i'" ] && echo '$i'="$'$i'"'
done > /tmp/net.$netif.override
case $autoconf in
dhcp|on|any) do_dhcp ;;
*) do_static ;;
esac
OLDIFS="$IFS"
IFS=,
set -- $autoconf
IFS="$OLDIFS"
for autoconf in "$@"; do
case $autoconf in
dhcp|on|any)
do_dhcp -4 ;;
dhcp6)
do_dhcp -6 ;;
auto6)
do_ipv6auto ;;
*)
do_static ;;
esac
done
break
done
exit 0

View File

@@ -1,13 +1,36 @@
#!/bin/bash
dracut_install ip dhclient brctl arping
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
dracut_install ip dhclient brctl arping ifenslave tr
inst "$moddir/ifup" "/sbin/ifup"
inst "$moddir/netroot" "/sbin/netroot"
inst "$moddir/dhclient-script" "/sbin/dhclient-script"
inst "$moddir/dhclient.conf" "/etc/dhclient.conf"
inst "$moddir/dhclient.conf" "/etc/dhclient.conf"
inst_hook pre-udev 50 "$moddir/ifname-genrules.sh"
inst_hook pre-udev 60 "$moddir/net-genrules.sh"
inst_hook cmdline 91 "$moddir/dhcp-root.sh"
inst_hook cmdline 99 "$moddir/parse-ip-opts.sh"
inst_hook cmdline 94 "$moddir/parse-ibft.sh"
inst_hook cmdline 95 "$moddir/parse-vlan.sh"
inst_hook cmdline 97 "$moddir/parse-bond.sh"
inst_hook cmdline 98 "$moddir/parse-bridge.sh"
inst_hook cmdline 99 "$moddir/parse-ip-opts.sh"
inst_hook cmdline 99 "$moddir/parse-ifname.sh"
inst_hook pre-pivot 10 "$moddir/kill-dhclient.sh"
if ldd $(which sh) 2>/dev/null | 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

@@ -4,13 +4,20 @@
net_module_test() {
local net_drivers='eth_type_trans|register_virtio_device'
local unwanted_drivers='/(wireless|isdn|uwb)/'
nm -uPA "$1" | egrep -q $net_drivers && \
nm -uPA "$1" | egrep -qv 'iw_handler_get_spy' && \
egrep -q $net_drivers "$1" && \
egrep -qv 'iw_handler_get_spy' "$1" && \
[[ ! $1 =~ $unwanted_drivers ]]
}
instmods $(filter_kernel_modules net_module_test)
instmods ecb arc4
# bridge modules
instmods bridge stp llc
instmods ipv6
# vlan
instmods 8021q
# bonding
instmods bonding
# hyperv
hostonly='' instmods hv_netvsc

View File

@@ -1,4 +1,6 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
# pxelinux provides macaddr '-' separated, but we need ':'
fix_bootif() {
@@ -6,7 +8,9 @@ fix_bootif() {
local IFS='-'
macaddr=$(for i in ${macaddr} ; do echo -n $i:; done)
macaddr=${macaddr%:}
echo $macaddr
# strip hardware type field from pxelinux
[ -n "${macaddr%??:??:??:??:??:??}" ] && macaddr=${macaddr#??:}
echo $macaddr | tr '[:upper:]' '[:lower:]'
}
# Don't continue if we don't need network
@@ -17,24 +21,36 @@ fix_bootif() {
# bridge: attempt only the defined interface
if [ -e /tmp/bridge.info ]; then
. /tmp/bridge.info
IFACES=$ethname
IFACES="$IFACES $ethname"
fi
for i in /tmp/vlan.*.phy; do
[ -e "$i" ] || continue
IFACES="$IFACES $(cat "$i")"
done
# bond: attempt only the defined interface (override bridge defines)
if [ -e /tmp/bond.info ]; then
. /tmp/bond.info
# It is enough to fire up only one
IFACES=${bondslaves%% *}
fi
# BOOTIF says everything, use only that one
BOOTIF=$(getarg 'BOOTIF=')
if [ -n "$BOOTIF" ] ; then
BOOTIF=$(fix_bootif "$BOOTIF")
printf 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="%s", RUN+="/sbin/ifup $env{INTERFACE}"\n' "$BOOTIF"
printf 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="%s", RUN+="/sbin/initqueue --onetime --unique --name ifup-$env{INTERFACE} /sbin/ifup $env{INTERFACE}"\n' "$BOOTIF"
# If we have to handle multiple interfaces, handle only them.
elif [ -n "$IFACES" ] ; then
for iface in $IFACES ; do
printf 'ACTION=="add", SUBSYSTEM=="net", NAME=="%s", RUN+="/sbin/ifup $env{INTERFACE}"\n' "$iface"
printf 'SUBSYSTEM=="net", ENV{INTERFACE}=="%s", RUN+="/sbin/initqueue --onetime --unique --name ifup-$env{INTERFACE} /sbin/ifup $env{INTERFACE}"\n' "$iface"
done
# Default: We don't know the interface to use, handle all
else
printf 'ACTION=="add", SUBSYSTEM=="net", RUN+="/sbin/ifup $env{INTERFACE}"\n'
printf 'SUBSYSTEM=="net", ENV{INTERFACE}=="?*", RUN+="/sbin/initqueue --onetime --unique --name ifup-$env{INTERFACE} /sbin/ifup $env{INTERFACE}"\n'
fi
} > /etc/udev/rules.d/60-net.rules

View File

@@ -4,18 +4,17 @@ PATH=$PATH:/sbin:/usr/sbin
. /lib/dracut-lib.sh
[ "$RDDEBUG" = "yes" ] \
&& [ -e /dev/initlog.pipe ] \
&& exec >>/dev/initlog.pipe 2>>/dev/initlog.pipe
# Huh? Empty $1?
[ -z "$1" ] && exit 1
# Huh? No interface config?
[ ! -e /tmp/net.$1.up ] && exit 1
# 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
. /tmp/root.info
[ -d $NEWROOT/proc ] && exit 0
[ -z "$netroot" ] && exit 1
# Let's see if we have to wait for other interfaces
# Note: exit works just fine, since the last interface to be
@@ -27,11 +26,15 @@ done
# Set or override primary interface
netif=$1
[ -e "/tmp/net.bootdev" ] && read netif < /tmp/net.bootdev
if [ -e "/tmp/net.bootdev" ]; then
read netif < /tmp/net.bootdev
# only boot from $netif
[ -n "$1" ] && [ -n "$netif"] && [ "$netif" != "$1" ] && exit 1
fi
# 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
@@ -56,22 +59,8 @@ else
rootok="1"
fi
# Check: do we really know how to handle (net)root?
[ -z "$root" ] && die "No or empty root= argument"
[ -z "$rootok" ] && die "Don't know how to handle 'root=$root'"
handler=${netroot%%:*}
handler=${handler%%4}
handler="/sbin/${handler}root"
if [ -z "$netroot" ] || [ ! -e "$handler" ] ; then
die "No handler for netroot type '$netroot'"
fi
# We're here, so we can assume that upping interfaces is now ok
[ -z "$IFACES" ] && IFACES="$netif"
for iface in $IFACES ; do
. /tmp/net.$iface.up
done
[ -e /tmp/net.$netif.gw ] && . /tmp/net.$netif.gw
[ -e /tmp/net.$netif.hostname ] && . /tmp/net.$netif.hostname
@@ -96,8 +85,20 @@ if [ -z "$dest" ] ; then
[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"
[ -n "$dest" ] && arping -q -f -w 60 -I $netif $dest
[ -d $NEWROOT/proc ] && exit 0
[ -z "$netroot" ] && exit 1
# Check: do we really know how to handle (net)root?
[ -z "$root" ] && die "No or empty root= argument"
[ -z "$rootok" ] && die "Don't know how to handle 'root=$root'"
handler=${netroot%%:*}
handler=${handler%%4}
handler="/sbin/${handler}root"
if [ -z "$netroot" ] || [ ! -e "$handler" ] ; then
die "No handler for netroot type '$netroot'"
fi
# Source netroot hooks before we start the handler
@@ -108,20 +109,20 @@ source_all netroot
if $handler $netif $netroot $NEWROOT; then
# Network rootfs mount successful
for iface in $IFACES ; do
[ -f /tmp/dhclient.$iface.lease ] && cp /tmp/dhclient.$iface.lease /tmp/net.$iface.lease
[ -f /tmp/dhclient.$iface.dhcpopts ] && cp /tmp/dhclient.$iface.dhcpopts /tmp/net.$iface.dhcpopts
[ -s /tmp/dhclient.$iface.lease ] && cp /tmp/dhclient.$iface.lease /tmp/net.$iface.lease
[ -s /tmp/dhclient.$iface.dhcpopts ] && cp /tmp/dhclient.$iface.dhcpopts /tmp/net.$iface.dhcpopts
done
# Save used netif for later use
[ ! -f /tmp/net.ifaces ] && echo $netif > /tmp/net.ifaces
else
warn "Mounting root via '$netif' failed"
echo $netif >> /tmp/net.ifaces
#else
# warn "Mounting root via '$netif' failed"
# If we're trying with multiple interfaces, put that one down.
# ip down/flush ensures that routeing info goes away as well
if [ -z "$BOOTDEV" ] ; then
ip link set $netif down
ip addr flush dev $netif
echo "#empty" > /etc/resolv.conf
fi
# if [ -z "$BOOTDEV" ] ; then
# ip link set $netif down
# ip addr flush dev $netif
# echo "#empty" > /etc/resolv.conf
# fi
fi
exit 0

View File

@@ -0,0 +1,63 @@
#!/bin/sh
#
# Format:
# bond=<bondname>[:<bondslaves>:[:<options>]]
#
# bondslaves is a comma-separated list of physical (ethernet) interfaces
# options is a comma-separated list on bonding options (modinfo bonding for details) in format compatible with initscripts
# if options include multi-valued arp_ip_target option, then its values should be separated by semicolon.
#
# bond without parameters assumes bond=bond0:eth0,eth1:mode=balance-rr
#
# return if bond already parsed
[ -n "$bondname" ] && return
# Check if bond parameter is valid
if getarg bond= >/dev/null ; then
if [ -z "$netroot" ] ; then
die "No netboot configured, bond is invalid"
fi
fi
# We translate list of slaves to space-separated here to mwke it easier to loop over them in ifup
# Ditto for bonding options
parsebond() {
local v=${1}:
set --
while [ -n "$v" ]; do
set -- "$@" "${v%%:*}"
v=${v#*:}
done
unset bondname bondslaves bondoptions
case $# in
0) bondname=bond0; bondslaves="eth0 eth1" ;;
1) bondname=$1; bondslaves="eth0 eth1" ;;
2) bondname=$1; bondslaves=$(echo $2|tr "," " ") ;;
3) bondname=$1; bondslaves=$(echo $2|tr "," " "); bondoptions=$(echo $3|tr "," " ") ;;
*) die "bond= requires zero to four parameters" ;;
esac
}
unset bondname bondslaves bondoptions
# Parse bond for bondname, bondslaves, bondmode and bondoptions
if getarg bond >/dev/null; then
# Read bond= parameters if they exist
bond="$(getarg bond=)"
if [ ! "$bond" = "bond" ]; then
parsebond "$(getarg bond=)"
fi
# Simple default bond
if [ -z "$bondname" ]; then
bondname=bond0
bondslaves="eth0 eth1"
fi
# Make it suitable for initscripts export
bondoptions=$(echo $bondoptions|tr ";" ",")
echo "bondname=$bondname" > /tmp/bond.info
echo "bondslaves=\"$bondslaves\"" >> /tmp/bond.info
echo "bondoptions=\"$bondoptions\"" >> /tmp/bond.info
return
fi

View File

@@ -26,26 +26,34 @@ parsebridge() {
unset bridgename ethname
case $# in
0) bridgename=br0; ethname=eth0 ;;
1) die "bridge= requires two parameters" ;;
2) bridgename=$1; ethname=$2 ;;
*) die "bridge= requires two parameters" ;;
0) bridgename=br0; ethname=$iface ;;
1) die "bridge= requires two parameters" ;;
2) bridgename=$1; ethname=$2 ;;
*) die "bridge= requires two parameters" ;;
esac
}
unset bridgename ethname
iface=eth0
if [ -e /tmp/bond.info ]; then
. /tmp/bond.info
if [ -n "$bondname" ] ; then
iface=$bondname
fi
fi
# Parse bridge for bridgename and ethname
if getarg bridge >/dev/null; then
# Read bridge= parameters if they exist
bridge="$(getarg bridge=)"
if [ ! "$bridge" = "bridge" ]; then
if [ ! "$bridge" = "bridge" ]; then
parsebridge "$(getarg bridge=)"
fi
# Simple default bridge
if [ -z "$bridgename" ]; then
bridgename=br0
ethname=eth0
ethname=$iface
fi
echo "bridgename=$bridgename" > /tmp/bridge.info
echo "ethname=$ethname" >> /tmp/bridge.info

View File

@@ -0,0 +1,85 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
. /lib/dracut-lib.sh
for p in $(getargs ip=); do
[ "ibft" = "$p" ] || continue
modprobe iscsi_ibft
num=0
(
for iface in /sys/firmware/ibft/ethernet*; do
unset ifname_mac
unset ifname_if
unset dhcp
unset ip
unset gw
unset mask
unset hostname
unset vlan
unset dns1
unset dns2
[ -e ${iface}/mac ] || continue
ifname_mac=$(read a < ${iface}/mac; echo $a)
[ -z "$ifname_mac" ] && continue
unset dev
for ifname in $(getargs ifname=); do
if strstr "$ifname" "$ifname_mac"; then
dev=${ifname%%:*}
break
fi
done
if [ -z "$dev" ]; then
ifname_if=ibft$num
num=$(( $num + 1 ))
echo "ifname=$ifname_if:$ifname_mac"
dev=$ifname_if
fi
if [ -e ${iface}/vlan ]; then
vlan=$(read a < ${iface}/vlan; echo $a)
if [ "$vlan" -ne "0" ]; then
case "$vlan" in
[0-9]*)
[ -e /tmp/net.${dev}.${vlan}.has_ibft_config ] && continue
echo "vlan=$dev.$vlan:$dev"
dev="${dev}.${vlan}"
;;
*)
[ -e /tmp/net.${vlan}.has_ibft_config ] && continue
echo "vlan=$vlan:$dev"
dev="${vlan}"
;;
esac
fi
fi
[ -e /tmp/net.${dev}.has_ibft_config ] && continue
[ -e ${iface}/dhcp ] && dhcp=$(read a < ${iface}/dhcp; echo $a)
if [ -n "$dhcp" ]; then
echo "ip=$dev:dhcp"
else
[ -e ${iface}/ip-addr ] && ip=$(read a < ${iface}/ip-addr; echo $a)
[ "$ip" = "0.0.0.0" ] && unset ip
[ -e ${iface}/gateway ] && gw=$(read a < ${iface}/gateway; echo $a)
[ -e ${iface}/subnet-mask ] && mask=$(read a < ${iface}/subnet-mask; echo $a)
[ -e ${iface}/hostname ] && hostname=$(read a < ${iface}/hostname; echo $a)
[ -n "$ip" ] && echo "ip=$ip::$gw:$mask:$hostname:$dev:none"
[ -e ${iface}/primary-dns ] && dns1=$(read a < ${iface}/primary-dns; echo $a) \
&& echo "nameserver=${dns1}"
[ -e ${iface}/secondary-dns ] && dns2=$(read a < ${iface}/secondary-dns; echo $a) \
&& echo "nameserver=${dns2}"
fi
echo $mac > /tmp/net.${dev}.has_ibft_config
done
) >> /etc/cmdline
# reread cmdline
unset CMDLINE
done

View File

@@ -3,7 +3,6 @@
# Format:
# ifname=<interface>:<mac>
#
# Note letters in the macaddress must be lowercase!
#
# Examples:
# ifname=eth0:4a:3f:4c:04:f8:d7
@@ -11,11 +10,6 @@
# Note when using ifname= to get persistent interface names, you must specify
# an ifname= argument for each interface used in an ip= or fcoe= argument
# check if there are any ifname parameters
if ! getarg ifname= >/dev/null ; then
return
fi
parse_ifname_opts() {
local IFS=:
set $1
@@ -23,7 +17,8 @@ parse_ifname_opts() {
case $# in
7)
ifname_if=$1
ifname_mac=$2:$3:$4:$5:$6:$7
# udev requires MAC addresses to be lower case
ifname_mac=$(echo $2:$3:$4:$5:$6:$7 | tr '[:upper:]' '[:lower:]')
;;
*)
die "Invalid arguments for ifname="
@@ -31,6 +26,11 @@ parse_ifname_opts() {
esac
}
# check if there are any ifname parameters
if ! getarg ifname= >/dev/null ; then
return
fi
# Check ifname= lines
for p in $(getargs ifname=); do
parse_ifname_opts $p

View File

@@ -1,4 +1,6 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
#
# Format:
# ip=[dhcp|on|any]
@@ -12,23 +14,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
@@ -51,18 +37,21 @@ if [ -n "$netroot" ] && [ -z "$(getarg ip=)" ] ; then
fi
# Count ip= lines to decide whether we need bootdev= or not
if [ -z "$NEEDBOOTDEV" ] ; then
local count=0
for p in $(getargs ip=); do
count=$(( $count + 1 ))
done
[ $count -gt 1 ] && NEEDBOOTDEV=1
if [ "$netroot" = "dhcp" ] || [ "$netroot" = "dhcp6" ]; then
if [ -z "$NEEDBOOTDEV" ] ; then
local count=0
for p in $(getargs ip=); do
count=$(( $count + 1 ))
done
[ $count -gt 1 ] && NEEDBOOTDEV=1
fi
fi
# If needed, check if bootdev= contains anything usable
BOOTDEV=$(getarg bootdev=)
if [ -n "$NEEDBOOTDEV" ] ; then
BOOTDEV=$(getarg bootdev=) || die "Please supply bootdev argument for multiple ip= lines"
[ -z "$BOOTDEV" ] && die "Bootdev argument is empty"
[ -z "$BOOTDEV" ] && warn "Please supply bootdev argument for multiple ip= lines"
fi
# Check ip= lines
@@ -70,6 +59,9 @@ fi
for p in $(getargs ip=); do
ip_to_var $p
# skip ibft
[ "$autoconf" = "ibft" ] && continue
# We need to have an ip= line for the specified bootdev
[ -n "$NEEDBOOTDEV" ] && [ "$dev" = "$BOOTDEV" ] && BOOTDEVOK=1
@@ -78,40 +70,44 @@ for p in $(getargs ip=); do
warn "Empty autoconf values default to dhcp"
autoconf="dhcp"
fi
# Error checking for autoconf in combination with other values
case $autoconf in
error) die "Error parsing option 'ip=$p'";;
bootp|rarp|both) die "Sorry, ip=$autoconf is currenty unsupported";;
none|off) \
[ -z "$ip" ] && \
OLDIFS="$IFS"
IFS=,
set -- $autoconf
IFS="$OLDIFS"
for autoconf in "$@"; do
# Error checking for autoconf in combination with other values
case $autoconf in
error) die "Error parsing option 'ip=$p'";;
bootp|rarp|both) die "Sorry, ip=$autoconf is currenty unsupported";;
none|off) \
[ -z "$ip" ] && \
die "For argument 'ip=$p'\nValue '$autoconf' without static configuration does not make sense"
[ -z "$mask" ] && \
die "Sorry, automatic calculation of netmask is not yet supported"
;;
dhcp|on|any) \
[ -n "$NEEDBOOTDEV" ] && [ -z "$dev" ] && \
[ -z "$mask" ] && \
die "Sorry, automatic calculation of netmask is not yet supported"
;;
auto6);;
dhcp|dhcp6|on|any) \
[ -n "$NEEDBOOTDEV" ] && [ -z "$dev" ] && \
die "Sorry, 'ip=$p' does not make sense for multiple interface configurations"
[ -n "$ip" ] && \
die "For argument 'ip=$p'\nSorry, setting client-ip does not make sense for '$autoconf'"
;;
*) die "For argument 'ip=$p'\nSorry, unknown value '$autoconf'";;
esac
[ -n "$ip" ] && \
die "For argument 'ip=$p'\nSorry, setting client-ip does not make sense for '$autoconf'"
;;
*) die "For argument 'ip=$p'\nSorry, unknown value '$autoconf'";;
esac
_part=${_part%,*}
done
if [ -n "$dev" ] ; then
# We don't like duplicate device configs
if [ -n "$IFACES" ] ; then
for i in $IFACES ; do
[ "$dev" = "$i" ] && die "For argument 'ip=$p'\nDuplication configurations for '$dev'"
[ "$dev" = "$i" ] && warn "For argument 'ip=$p'\nDuplication configurations for '$dev'"
done
fi
# IFACES list for later use
IFACES="$IFACES $dev"
fi
# Small optimization for udev rules
[ -z "$NEEDBOOTDEV" ] && [ -n "$dev" ] && BOOTDEV=$dev
# Do we need to check for specific options?
if [ -n "$NEEDDHCP" ] || [ -n "$DHCPORSERVER" ] ; then
# Correct device? (Empty is ok as well)

View File

@@ -0,0 +1,32 @@
#!/bin/sh
#
# Format:
# vlan=<vlanname>:<phydevice>
#
parsevlan() {
local v=${1}:
set --
while [ -n "$v" ]; do
set -- "$@" "${v%%:*}"
v=${v#*:}
done
case $# in
2) vlanname=$1; phydevice=$2 ; return 0 ;;
*) die "vlan= requires two parameters" ;;
esac
return 1
}
unset vlanname phydevice
for vlan in $(getargs vlan); do
[ "$vlan" = "vlan" ] && continue
unset vlanname phydevice
if parsevlan "$(getarg vlan=)"; then
echo "$phydevice" > /tmp/vlan.${phydevice}.phy
echo "$phydevice" >> /tmp/net.ifaces
echo "$vlanname" > /tmp/vlan.${vlanname}.${phydevice}
fi
done

4
modules.d/45ifcfg/check Normal file → Executable file
View File

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

0
modules.d/45ifcfg/install Normal file → Executable file
View File

View File

@@ -1,4 +1,6 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
# NFS root might have reached here before /tmp/net.ifaces was written
udevadm settle --timeout=30
@@ -7,47 +9,153 @@ udevadm settle --timeout=30
read IFACES < /tmp/net.ifaces
if [ -e /tmp/bond.info ]; then
. /tmp/bond.info
fi
if [ -e /tmp/bridge.info ]; then
. /tmp/bridge.info
fi
mkdir -p /tmp/ifcfg/
for netif in $IFACES ; do
mkdir -p /tmp/ifcfg/
# bridge?
unset bridge
unset bond
unset vlan
unset phydevice
unset vlanname
unset uuid
unset ip
unset gw
unset mtu
unset mask
unset macaddr
# 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
elif [ "$netif" = "$bondname" ]; then
# $netif can't be bridge and bond at the same time
bond=yes
fi
for i in /tmp/vlan.${netif}.*; do
[ ! -e "$i" ] && continue
. "$i"
vlan=yes
break
done
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/dhclient.${netif}.dhcpopts ]; then
strstr "$ip" '*:*:*' && echo "DHCPV6C=yes"
echo "BOOTPROTO=dhcp"
[ -f /tmp/dhclient.${netif}.lease ] && cp /tmp/dhclient.${netif}.lease /tmp/net.${netif}.lease
[ -f /tmp/dhclient.${netif}.dhcpopts ] && cp /tmp/dhclient.${netif}.dhcpopts /tmp/net.${netif}.dhcpopts
else
echo "BOOTPROTO=none"
# If we've booted with static ip= lines, the override file is there
[ -e /tmp/net.${netif}.override ] && . /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
if [ -z "$bridge" ] && [ -z "$bond" ] && [ -z "$vlan" ]; 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
{
echo "HWADDR=$(cat /sys/class/net/$netif/address)"
echo "TYPE=Ethernet"
echo "NAME=\"Boot Disk\""
} >> /tmp/ifcfg/ifcfg-$netif
fi
if [ -n "$vlan" ] ; then
{
echo "TYPE=Vlan"
echo "NAME=\"$netif\""
echo "VLAN=yes"
echo "PHYSDEV=\"$phydevice\""
} >> /tmp/ifcfg/ifcfg-$netif
fi
if [ -n "$bond" ] ; then
# bond interface
{
# This variable is an indicator of a bond interface for initscripts
echo "BONDING_OPTS=\"$bondoptions\""
echo "NAME=\"Boot Disk\""
} >> /tmp/ifcfg/ifcfg-$netif
for slave in $bondslaves ; do
# write separate ifcfg file for the raw eth interface
{
echo "# Generated by dracut initrd"
echo "DEVICE=$slave"
echo "TYPE=Ethernet"
echo "ONBOOT=yes"
echo "NETBOOT=yes"
echo "HWADDR=$(cat /sys/class/net/$slave/address)"
echo "SLAVE=yes"
echo "MASTER=$netif"
echo "NAME=$slave"
} >> /tmp/ifcfg/ifcfg-$slave
done
fi
if [ -n "$bridge" ] ; then
# 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
{
echo "TYPE=Bridge"
echo "NAME=\"Boot Disk\""
} >> /tmp/ifcfg/ifcfg-$netif
if [ "$ethname" = "$bondname" ] ; then
{
# This variable is an indicator of a bond interface for initscripts
echo "# Generated by dracut initrd"
echo "DEVICE=$bondname"
echo "ONBOOT=yes"
echo "NETBOOT=yes"
echo "BONDING_OPTS=\"$bondoptions\""
echo "BRIDGE=$netif"
echo "NAME=\"$bondname\""
} >> /tmp/ifcfg/ifcfg-$bondname
for slave in $bondslaves ; do
# write separate ifcfg file for the raw eth interface
# yes, duplicated code at this moment
{
echo "# Generated by dracut initrd"
echo "DEVICE=$slave"
echo "TYPE=Ethernet"
echo "ONBOOT=yes"
echo "NETBOOT=yes"
echo "HWADDR=$(cat /sys/class/net/$slave/address)"
echo "SLAVE=yes"
echo "MASTER=$bondname"
echo "NAME=$slave"
} >> /tmp/ifcfg/ifcfg-$slave
done
else
# write separate ifcfg file for the raw eth interface
{
echo "# Generated by dracut initrd"
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
fi
done

View File

@@ -1,3 +1,3 @@
#!/bin/bash
[[ $1 = -d ]] && echo crypt
[[ $1 = -d ]] && which cryptsetup &>/dev/null && echo crypt
[[ -x /sbin/plymouthd && -x /bin/plymouth && -x /usr/sbin/plymouth-set-default-theme ]]

View File

@@ -1,83 +0,0 @@
#!/bin/sh
# do not ask, if we already have root
[ -f /sysroot/proc ] && exit 0
# check if destination already exists
[ -b /dev/mapper/$2 ] && exit 0
# we already asked for this device
[ -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
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 $device $luksname"
# flock against other interactive activities
{ flock -s 9;
/bin/plymouth ask-for-password \
--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
exit 0
# vim:ts=8:sw=4:sts=4:et

View File

@@ -11,6 +11,5 @@ fi
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
inst_hook emergency 00 "$moddir"/plymouth-emergency.sh
inst readlink

View File

@@ -1,5 +1,7 @@
#!/bin/bash
# Include KMS capable drm drivers
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
grep -q drm_crtc_init $modname && instmods $modname
done
hostonly='' instmods hyperv_fb

View File

@@ -1,5 +1,5 @@
#!/bin/bash
if ldd /sbin/plymouthd |grep -q lib64; then
if ldd /sbin/plymouthd 2>/dev/null | grep -q lib64; then
LIBDIR="/usr/lib64"
else
LIBDIR="/usr/lib"
@@ -30,7 +30,7 @@ if [[ $hostonly ]]; then
if [ -L /usr/share/plymouth/themes/default.plymouth ]; then
inst /usr/share/plymouth/themes/default.plymouth
# Install plugin for this theme
PLYMOUTH_PLUGIN=$(grep "^ModuleName=" /usr/share/plymouth/themes/default.plymouth |awk -F= {'print $2'})
PLYMOUTH_PLUGIN=$(grep "^ModuleName=" /usr/share/plymouth/themes/default.plymouth | while read a b c; do echo $b; done;)
inst ${LIBDIR}/plymouth/${PLYMOUTH_PLUGIN}.so
fi
else

View File

@@ -1,21 +1,26 @@
#!/bin/sh
if ! getarg rd_NO_PLYMOUTH; then
[ -c /dev/null ] || mknod /dev/null c 1 3
[ -c /dev/null ] || mknod -m 0666 /dev/null c 1 3
# first trigger graphics subsystem
udevadm trigger --attr-match=class=0x030000 >/dev/null 2>&1
# first trigger graphics and tty subsystem
udevadm trigger --subsystem-match=graphics --subsystem-match=drm --subsystem-match=tty >/dev/null 2>&1
udevadm trigger --subsystem-match=graphics --subsystem-match=drm --subsystem-match=tty --subsystem-match=acpi >/dev/null 2>&1
udevadm settle --timeout=30 2>&1 | vinfo
[ -c /dev/zero ] || mknod /dev/zero c 1 5
[ -c /dev/systty ] || mknod /dev/systty c 4 0
[ -c /dev/fb ] || mknod /dev/fb c 29 0
[ -c /dev/hvc0 ] || mknod /dev/hvc0 c 229 0
udevadm settle --timeout=30 >/dev/null 2>&1
[ -c /dev/zero ] || mknod -m 0666 /dev/zero c 1 5
[ -c /dev/tty0 ] || mknod -m 0620 /dev/tty0 c 4 0
[ -e /dev/systty ] || ln -s tty0 /dev/systty
[ -c /dev/fb0 ] || mknod -m 0660 /dev/fb0 c 29 0
[ -e /dev/fb ] || ln -s fb0 /dev/fb
[ -c /dev/hvc0 ] || mknod -m 0600 /dev/hvc0 c 229 0
info "Starting plymouth daemon"
consoledev=$(getarg console= | sed -e 's/,.*//')
consoledev=${consoledev:-tty0}
[ -x /lib/udev/console_init ] && /lib/udev/console_init "/dev/$consoledev"
[ -x /bin/plymouthd ] && /bin/plymouthd --attach-to-session
/lib/udev/console_init tty0
/bin/plymouth --show-splash 2>&1 | vinfo
fi

6
modules.d/60xen/check Normal file → Executable file
View File

@@ -1,12 +1,14 @@
#!/bin/bash
# No Xen-detect? Boo!!
which xen-detect >/dev/null 2>&1 || exit 1
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.
xen-detect | egrep -q -v 'PV' || exit 0
$XENDETECT | egrep -q -v 'PV' || exit 0
exit 1

4
modules.d/60xen/install Normal file → Executable file
View File

@@ -1,4 +1,6 @@
#!/bin/bash
inst xen-detect
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"

View File

@@ -0,0 +1,8 @@
SUBSYSTEM!="block", GOTO="btrfs_end"
ACTION!="add|change", GOTO="btrfs_end"
ENV{ID_FS_TYPE}=="btrfs", RUN+="/sbin/modprobe btrfs"
ENV{ID_FS_TYPE}=="btrfs", RUN+="/sbin/btrfsctl -A $env{DEVNAME}"
LABEL="btrfs_end"

10
modules.d/90btrfs/check Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
# We depend on udev-rules being loaded
[ "$1" = "-d" ] && exit 0
# if we don't have btrfs (btrfsctl) installed on the host system,
# no point in trying to support it in the initramfs.
which btrfsctl >/dev/null 2>&1 || exit 1
exit 0

4
modules.d/90btrfs/install Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
inst_rules "$moddir/40-btrfs.rules"
dracut_install btrfsctl

View File

@@ -1,12 +0,0 @@
# hacky rules to try to try unlocking dm-crypt devs
#
# Copyright 2008, Red Hat, Inc.
# Jeremy Katz <katzj@redhat.com>
SUBSYSTEM!="block", GOTO="luks_end"
ACTION!="add|change", GOTO="luks_end"
ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="/sbin/initqueue --unique --onetime --name cryptroot-ask-%k /sbin/cryptroot-ask $env{DEVNAME} luks-$env{ID_FS_UUID}"
LABEL="luks_end"

View File

@@ -19,7 +19,7 @@ is_crypt() { [[ $(get_fs_type /dev/block/$1) = crypto_LUKS ]]; }
check_block_and_slaves is_crypt "$rootdev" || exit 1
else
# root is not on a block device, use the shotgun approach
blkid | grep -q crypt_LUKS || exit 1
blkid | grep -q crypto\?_LUKS || exit 1
fi
}

View File

@@ -1,5 +1,7 @@
#!/bin/sh
# close everything which is not busy
rm -f /etc/udev/rules.d/70-luks.rules >/dev/null 2>&1
for i in /dev/mapper/luks-*; do
cryptsetup luksClose $i >/dev/null 2>&1
done

View File

@@ -0,0 +1,222 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
command -v getarg >/dev/null || . /lib/dracut-lib.sh
# ask_for_password
#
# Wraps around plymouth ask-for-password and adds fallback to tty password ask
# if plymouth is not present.
#
# --cmd command
# Command to execute. Required.
# --prompt prompt
# Password prompt. Note that function already adds ':' at the end.
# Recommended.
# --tries n
# How many times repeat command on its failure. Default is 3.
# --ply-[cmd|prompt|tries]
# Command/prompt/tries specific for plymouth password ask only.
# --tty-[cmd|prompt|tries]
# Command/prompt/tries specific for tty password ask only.
# --tty-echo-off
# Turn off input echo before tty command is executed and turn on after.
# It's useful when password is read from stdin.
ask_for_password() {
local cmd; local prompt; local tries=3
local ply_cmd; local ply_prompt; local ply_tries=3
local tty_cmd; local tty_prompt; local tty_tries=3
local ret
while [ $# -gt 0 ]; do
case "$1" in
--cmd) ply_cmd="$2"; tty_cmd="$2" shift;;
--ply-cmd) ply_cmd="$2"; shift;;
--tty-cmd) tty_cmd="$2"; shift;;
--prompt) ply_prompt="$2"; tty_prompt="$2" shift;;
--ply-prompt) ply_prompt="$2"; shift;;
--tty-prompt) tty_prompt="$2"; shift;;
--tries) ply_tries="$2"; tty_tries="$2"; shift;;
--ply-tries) ply_tries="$2"; shift;;
--tty-tries) tty_tries="$2"; shift;;
--tty-echo-off) tty_echo_off=yes;;
esac
shift
done
{ flock -s 9;
# Prompt for password with plymouth, if installed and running.
if [ -x /bin/plymouth ] && /bin/plymouth --ping; then
/bin/plymouth ask-for-password \
--prompt "$ply_prompt" --number-of-tries=$ply_tries \
--command="$ply_cmd"
ret=$?
else
if [ "$tty_echo_off" = yes ]; then
stty_orig="$(stty -g)"
stty -echo
fi
local i=1
while [ $i -le $tty_tries ]; do
[ -n "$tty_prompt" ] && \
printf "$tty_prompt [$i/$tty_tries]:" >&2
eval "$tty_cmd" && ret=0 && break
ret=$?
i=$(($i+1))
[ -n "$tty_prompt" ] && printf '\n' >&2
done
[ "$tty_echo_off" = yes ] && stty $stty_orig
fi
} 9>/.console_lock
[ $ret -ne 0 ] && echo "Wrong password" >&2
return $ret
}
# Try to mount specified device (by path, by UUID or by label) and check
# the path with 'test'.
#
# example:
# test_dev -f LABEL="nice label" /some/file1
test_dev() {
local test_op=$1; local dev="$2"; local f="$3"
local ret=1; local mount_point=$(mkuniqdir /mnt testdev)
local path
[ -n "$dev" -a -n "$*" ] || return 1
[ -d "$mount_point" ] || die 'Mount point does not exist!'
if mount -r "$dev" "$mount_point" >/dev/null 2>&1; then
test $test_op "${mount_point}/${f}"
ret=$?
umount "$mount_point"
fi
rmdir "$mount_point"
return $ret
}
# Get kernel name for given device. Device may be the name too (then the same
# is returned), a symlink (full path), UUID (prefixed with "UUID=") or label
# (prefixed with "LABEL="). If just a beginning of the UUID is specified or
# even an empty, function prints all device names which UUIDs match - every in
# single line.
#
# NOTICE: The name starts with "/dev/".
#
# Example:
# devnames UUID=123
# May print:
# /dev/dm-1
# /dev/sdb1
# /dev/sdf3
devnames() {
local dev="$1"; local d; local names
case "$dev" in
UUID=*)
dev="$(foreach_uuid_until '! blkid -U $___' "${dev#UUID=}")" \
&& return 255
[ -z "$dev" ] && return 255
;;
LABEL=*) dev="$(blkid -L "${dev#LABEL=}")" || return 255 ;;
/dev/?*) ;;
*) return 255 ;;
esac
for d in $dev; do
names="$names
$(readlink -e -q "$d")" || return 255
done
echo "${names#
}"
}
# match_dev devpattern dev
#
# Returns true if 'dev' matches 'devpattern'. Both 'devpattern' and 'dev' are
# expanded to kernel names and then compared. If name of 'dev' is on list of
# names of devices matching 'devpattern', the test is positive. 'dev' and
# 'devpattern' may be anything which function 'devnames' recognizes.
#
# If 'devpattern' is empty or '*' then function just returns true.
#
# Example:
# match_dev UUID=123 /dev/dm-1
# Returns true if /dev/dm-1 UUID starts with "123".
match_dev() {
[ -z "$1" -o "$1" = '*' ] && return 0
local devlist; local dev
devlist="$(devnames "$1")" || return 255
dev="$(devnames "$2")" || return 255
strstr "
$devlist
" "
$dev
"
}
# getkey keysfile for_dev
#
# Reads file <keysfile> produced by probe-keydev and looks for first line to
# which device <for_dev> matches. The successful result is printed in format
# "<keydev>:<keypath>". When nothing found, just false is returned.
#
# Example:
# getkey /tmp/luks.keys /dev/sdb1
# May print:
# /dev/sdc1:/keys/some.key
getkey() {
local keys_file="$1"; local for_dev="$2"
local luks_dev; local key_dev; local key_path
[ -z "$keys_file" -o -z "$for_dev" ] && die 'getkey: wrong usage!'
[ -f "$keys_file" ] || return 1
local IFS=:
while read luks_dev key_dev key_path; do
if match_dev "$luks_dev" "$for_dev"; then
echo "${key_dev}:${key_path}"
return 0
fi
done < "$keys_file"
return 1
}
# readkey keypath keydev device
#
# Mounts <keydev>, reads key from file <keypath>, optionally processes it (e.g.
# if encrypted with GPG) and prints to standard output which is supposed to be
# read by cryptsetup. <device> is just passed to helper function for
# informational purpose.
readkey() {
local keypath="$1"
local keydev="$2"
local device="$3"
local mntp=$(mkuniqdir /mnt keydev)
mount -r "$keydev" "$mntp" || die 'Mounting rem. dev. failed!'
case "${keypath##*.}" in
gpg)
if [ -f /lib/dracut-crypt-gpg-lib.sh ]; then
. /lib/dracut-crypt-gpg-lib.sh
gpg_decrypt "$mntp" "$keypath" "$keydev" "$device"
else
die "No GPG support to decrypt '$keypath' on '$keydev'."
fi
;;
*) cat "$mntp/$keypath" ;;
esac
umount "$mntp"
rmdir "$mntp"
}

View File

@@ -1,7 +1,12 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
PATH=/usr/sbin:/usr/bin:/sbin:/bin
NEWROOT=${NEWROOT:-"/sysroot"}
# do not ask, if we already have root
[ -f /sysroot/proc ] && exit 0
[ -f $NEWROOT/proc ] && exit 0
# check if destination already exists
[ -b /dev/mapper/$2 ] && exit 0
@@ -9,11 +14,17 @@
# we already asked for this device
[ -f /tmp/cryptroot-asked-$2 ] && exit 0
. /lib/dracut-lib.sh
# load dm_crypt if it is not already loaded
[ -d /sys/module/dm_crypt ] || modprobe dm_crypt
. /lib/dracut-crypt-lib.sh
# default luksname - luks-UUID
luksname=$2
# fallback to passphrase
ask_passphrase=1
# 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")"
@@ -21,59 +32,91 @@ else
device="$1"
fi
# TODO: improve to support what cmdline does
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
while read name dev luksfile rest || [ -n "$name" ] ; 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
# 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
luks=${luks##luks-}
if [ "${luuid##$luks}" != "$luuid" ] || [ "$luksname" = "$luks" ]; then
ask=1
break
fi
#
# Open LUKS device
#
info "luksOpen $device $luksname $luksfile"
if [ -n "$luksfile" -a "$luksfile" != "none" -a -e "$luksfile" ]; then
if cryptsetup --key-file "$luksfile" luksOpen "$device" "$luksname"; then
ask_passphrase=0
fi
else
while [ -n "$(getarg rd.luks.key)" ]; do
if tmp=$(getkey /tmp/luks.keys $device); then
keydev="${tmp%%:*}"
keypath="${tmp#*:}"
else
if [ $# -eq 3 ]; then
if [ $3 -eq 0 ]; then
info "No key found for $device. Fallback to passphrase mode."
break
fi
info "No key found for $device. Will try $3 time(s) more later."
set -- "$1" "$2" "$(($3 - 1))"
else
info "No key found for $device. Will try later."
fi
initqueue --unique --onetime --settled \
--name cryptroot-ask-$luksname \
$(command -v cryptroot-ask) "$@"
exit 0
fi
unset tmp
info "Using '$keypath' on '$keydev'"
readkey "$keypath" "$keydev" "$device" \
| cryptsetup -d - luksOpen "$device" "$luksname"
unset keypath keydev
ask_passphrase=0
break
done
fi
unset LUKS luks luuid
if [ $ask -gt 0 ]; then
info "luksOpen $device $luksname"
# flock against other interactive activities
{ flock -s 9;
echo -n "$device ($luksname) is password protected"
/sbin/cryptsetup luksOpen -T1 $1 $luksname
} 9>/.console.lock
if [ $ask_passphrase -ne 0 ]; then
luks_open="$(command -v cryptsetup) luksOpen"
ask_for_password --ply-tries 5 \
--ply-cmd "$luks_open -T1 $device $luksname" \
--ply-prompt "Password ($device)" \
--tty-tries 1 \
--tty-cmd "$luks_open -T5 $device $luksname"
unset luks_open
fi
unset device luksname luksfile
# mark device as asked
>> /tmp/cryptroot-asked-$2
udevsettle
exit 0
# vim:ts=8:sw=4:sts=4:et

View File

@@ -1,8 +1,11 @@
#!/bin/bash
inst cryptsetup
inst_rules "$moddir/70-luks.rules"
inst rmdir
inst readlink
inst umount
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 "$moddir/crypt-lib.sh" "/lib/dracut-crypt-lib.sh"
inst /etc/crypttab

View File

@@ -1,2 +1,6 @@
#!/bin/bash
instmods dm_crypt cbc aes sha256 xts
hostonly="" instmods \
dm_crypt cbc sha256 xts aes aes_generic aesni-intel aes-x86_64 fpu \
drbg ecb ctr
instmods =crypto

View File

@@ -2,5 +2,26 @@
if getarg rd_NO_LUKS; then
info "rd_NO_LUKS: removing cryptoluks activation"
rm -f /etc/udev/rules.d/70-luks.rules
else
{
echo 'SUBSYSTEM!="block", GOTO="luks_end"'
echo 'ACTION!="add|change", GOTO="luks_end"'
} > /etc/udev/rules.d/70-luks.rules
LUKS=$(getargs rd_LUKS_UUID=)
if [ -n "$LUKS" ]; then
echo '. /lib/dracut-lib.sh' > /emergency/90-crypt.sh
for luksid in $LUKS; do
luksid=${luksid##luks-}
printf 'ENV{ID_FS_TYPE}=="crypto_LUKS", ENV{ID_FS_UUID}=="%s*", RUN+="/sbin/initqueue --unique --onetime --name cryptroot-ask-%%k /sbin/cryptroot-ask $env{DEVNAME} luks-$env{ID_FS_UUID}"\n' $luksid \
>> /etc/udev/rules.d/70-luks.rules
printf '[ -e /dev/disk/by-uuid/*%s* ] || exit 1 \n' $luksid >> /initqueue-finished/crypt.sh
printf '[ -e /dev/disk/by-uuid/*%s* ] || warn "crypto LUKS UUID "%s" not found" \n' $luksid $luksid >> /emergency/90-crypt.sh
done
else
echo 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="/sbin/initqueue --unique --onetime --name cryptroot-ask-%k /sbin/cryptroot-ask $env{DEVNAME} luks-$env{ID_FS_UUID}"' \
>> /etc/udev/rules.d/70-luks.rules
fi
echo 'LABEL="luks_end"' >> /etc/udev/rules.d/70-luks.rules
fi

View File

@@ -1,4 +1,6 @@
#!/bin/bash
which dmsetup >/dev/null 2>&1 || exit 1
exit 255

View File

@@ -1 +1,2 @@
modprobe dm_mod
strstr "$(cat /proc/misc)" device-mapper || modprobe dm_mod
modprobe dm_mirror 2>/dev/null

View File

@@ -6,4 +6,15 @@ modinfo -k $kernel dm_mod >/dev/null 2>&1 && \
inst dmsetup
inst dmeventd
inst_rules 10-dm.rules 95-dm-notify.rules
if ldd $(which dmsetup) 2>/dev/null | grep -q lib64; then
LIBDIR="/lib64"
else
LIBDIR="/lib"
fi
for i in $(ls /{usr,}/$LIBDIR/libdevmapper-event.so* 2>/dev/null); do
dracut_install $i
done
inst_rules 10-dm.rules 13-dm-disk.rules 95-dm-notify.rules

View File

@@ -1,9 +1,5 @@
#!/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
instmods =drivers/md

View File

@@ -13,6 +13,8 @@ ENV{ID_FS_TYPE}=="isw_raid_member", ENV{rd_NO_MDIMSM}!="?*", GOTO="dm_end"
ENV{rd_NO_DM}=="?*", GOTO="dm_end"
ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="dm_end"
PROGRAM=="/bin/sh -c 'for i in $sys/$devpath/holders/dm-[0-9]*; do [ -e $$i ] && exit 0; done; exit 1;' ", \
GOTO="dm_end"

View File

@@ -10,7 +10,7 @@ DM_CLEANUP="no"
info "Scanning for dmraid devices $DM_RAIDS"
SETS=$(dmraid -c -s)
if [ "$SETS" = "no raid disks" ]; then
if [ "$SETS" = "no raid disks" -o "$SETS" = "no raid sets" ]; then
return
fi

View File

@@ -1,9 +1,9 @@
#!/bin/bash
dracut_install dmraid partx kpartx
dracut_install dmraid partx kpartx
inst dmeventd
if ldd $(which dmraid) | grep -q lib64; then
if ldd $(which dmraid) 2>/dev/null | grep -q lib64; then
LIBDIR="/lib64"
else
LIBDIR="/lib"
@@ -13,8 +13,7 @@ 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_rules 13-dm-disk.rules
inst "$moddir/dmraid.sh" /sbin/dmraid_scan

View File

@@ -3,3 +3,9 @@ if getarg rd_NO_DM || getarg nodmraid; then
info "rd_NO_DM: removing DM RAID activation"
udevproperty rd_NO_DM=1
fi
if [ ! -x /sbin/mdadm ] || getarg rd_NO_MDIMSM || getarg noiswmd; then
info "rd_NO_MDIMSM: no MD RAID for imsm/isw raids"
udevproperty rd_NO_MDIMSM=1
fi

View File

@@ -1,6 +0,0 @@
#!/bin/sh
[ -e /dev/sr0 ] && {
blkid /dev/sr0;
blkid /dev/sr0;
} 2>/dev/null

View File

@@ -1,8 +1,12 @@
#!/bin/sh
which dmsetup >/dev/null 2>&1 || exit 1
# if dmsetup is not installed, then we cannot support fedora/red hat
# style live images
which dmsetup >/dev/null 2>&1 || exit 1
if [ "$1" = "-d" ]; then
echo dm
exit 0
fi
# a live host-only image doesn't really make a lot of sense
if [ "$1" = "-h" ] ; then

View File

@@ -1,14 +0,0 @@
if [ "${root%%:*}" = "live" ]; then
(
printf 'KERNEL=="%s", SYMLINK+="live"\n' \
${root#live:/dev/}
printf 'SYMLINK=="%s", SYMLINK+="live"\n' \
${root#live:/dev/}
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 --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

@@ -19,7 +19,9 @@ livedev="$1"
live_dir=$(getarg live_dir)
[ -z "$live_dir" ] && live_dir="LiveOS"
getarg live_ram && live_ram="yes"
getarg no_eject && no_eject="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
@@ -40,7 +42,8 @@ getarg ro && liverw=ro
getarg rw && liverw=rw
[ -z "$liverw" ] && liverw=ro
# mount the backing of the live image first
mount -n -t $fstype -o $liverw $livedev $NEWROOT
mkdir -p /dev/.initramfs/live
mount -n -t $fstype -o $liverw $livedev /dev/.initramfs/live
RES=$?
if [ "$RES" != "0" ]; then
die "Failed to mount block device of live image"
@@ -95,7 +98,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
@@ -104,8 +107,8 @@ do_live_from_base_loop() {
}
# we might have a genMinInstDelta delta file for anaconda to take advantage of
if [ -e $NEWROOT/${live_dir}/osmin.img ]; then
OSMINSQFS=$NEWROOT/${live_dir}/osmin.img
if [ -e /dev/.initramfs/live/${live_dir}/osmin.img ]; then
OSMINSQFS=/dev/.initramfs/live/${live_dir}/osmin.img
fi
if [ -n "$OSMINSQFS" ]; then
@@ -121,21 +124,20 @@ if [ -n "$OSMINSQFS" ]; then
fi
# we might have just an embedded ext3 to use as rootfs (uncompressed live)
if [ -e $NEWROOT/${live_dir}/ext3fs.img ]; then
EXT3FS="$NEWROOT/${live_dir}/ext3fs.img"
if [ -e /dev/.initramfs/live/${live_dir}/ext3fs.img ]; then
EXT3FS="/dev/.initramfs/live/${live_dir}/ext3fs.img"
fi
if [ -n "$EXT3FS" ] ; then
BASE_LOOPDEV=$( losetup -f )
losetup -r $BASE_LOOPDEV $EXT3FS
umount -l $NEWROOT
do_live_from_base_loop
fi
# we might have an embedded ext3 on squashfs to use as rootfs (compressed live)
if [ -e $NEWROOT/${live_dir}/squashfs.img ]; then
SQUASHED="$NEWROOT/${live_dir}/squashfs.img"
if [ -e /dev/.initramfs/live/${live_dir}/squashfs.img ]; then
SQUASHED="/dev/.initramfs/live/${live_dir}/squashfs.img"
fi
if [ -e "$SQUASHED" ] ; then
@@ -143,9 +145,11 @@ if [ -e "$SQUASHED" ] ; then
echo "Copying live image to RAM..."
echo "(this may take a few minutes)"
dd if=$SQUASHED of=/squashed.img bs=512 2> /dev/null
umount -n $NEWROOT
umount -n /dev/.initramfs/live
echo "Done copying live image to RAM."
eject -p $livedev || :
if [ ! -n "$no_eject" ]; then
eject -p $livedev || :
fi
SQUASHED="/squashed.img"
fi
@@ -158,9 +162,6 @@ if [ -e "$SQUASHED" ] ; then
losetup -r $BASE_LOOPDEV /squashfs/LiveOS/ext3fs.img
umount -l /squashfs
if [ -z "$live_ram" ] ; then
umount -l $NEWROOT
fi
do_live_from_base_loop
fi
@@ -168,10 +169,15 @@ 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
printf '/bin/mount /dev/mapper/live-rw %s\n' "$NEWROOT" > /mount/01-$$-live.sh
ROOTFLAGS="$(getarg rootflags)"
if [ -n "$ROOTFLAGS" ]; then
ROOTFLAGS="-o $ROOTFLAGS"
fi
ln -fs /dev/mapper/live-rw /dev/root
printf '/bin/mount %s /dev/mapper/live-rw %s\n' "$ROOTFLAGS" "$NEWROOT" > /mount/01-$$-live.sh
exit 0

View File

@@ -1,7 +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
} >> /etc/udev/rules.d/99-liveiso-mount.rules
echo '[ -e /dev/root ]' > /initqueue-finished/dmsquash.sh
fi

View File

@@ -16,9 +16,7 @@ fi
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
inst "$moddir/cdrom-hack.sh" /sbin/cdrom-hack.sh

View File

@@ -39,7 +39,21 @@ case "$liveroot" in
esac
info "root was $root, liveroot is now $liveroot"
[ $rootok = "1" ] && initqueue --settled /sbin/cdrom-hack.sh
# make sure that init doesn't complain
[ -z "$root" ] && root="live"
if [ "${root##live:/dev/}" != "$root" ]; then
[ -d /dev/.udev/rules.d ] || mkdir -p /dev/.udev/rules.d
{
printf 'KERNEL=="%s", SYMLINK+="live"\n' \
${root#live:/dev/}
printf 'SYMLINK=="%s", SYMLINK+="live"\n' \
${root#live:/dev/}
} >> /dev/.udev/rules.d/99-live-mount.rules
{
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 --settled --onetime --unique /sbin/dmsquash-live-root $env{DEVNAME}"\n' \
${root#live:/dev/}
} >> /etc/udev/rules.d/98-dracut-20-live-squash.rules
echo '[ -e /dev/live ]' > /initqueue-finished/dmsquash.sh
root=/dev/mapper/live-rw
unset rootok
fi

View File

@@ -2,3 +2,4 @@
[ -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"
inst "$srcmods/modules.builtin.bin" "/lib/modules/$kernel/modules.builtin.bin"

View File

@@ -1,35 +1,41 @@
#!/bin/bash
if [[ -z $drivers ]]; then
block_module_test() {
local blockfuncs='ata_scsi_ioctl|scsi_add_host|blk_init_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device'
local blockfuncs='ata_scsi_ioctl|scsi_add_host|blk_cleanup_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device'
nm -uPA "$1" | egrep -q "$blockfuncs"
egrep -q "$blockfuncs" "$1"
}
instmods pcmcia sd_mod scsi_dh scsi_dh_rdac scsi_dh_emc
instmods firewire-ohci
hostonly='' instmods sr_mod sd_mod scsi_dh scsi_dh_rdac scsi_dh_emc scsi_dh_alua
hostonly='' instmods pcmcia firewire-ohci
hostonly='' instmods usb_storage sdhci sdhci-pci
# install keyboard support
hostonly='' instmods atkbd i8042 usbhid hid-apple ehci-hcd ohci-hcd uhci-hcd xhci-hcd hyperv_keyboard hid-hyperv
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'
n_omit_drivers=".*/fs/ocfs/.*|$omit_drivers"
n_omit_drivers=${n_omit_drivers%%|}
omit_drivers="$n_omit_drivers" instmods '=fs'
unset n_omit_drivers
# hardcoded list of exceptions
# to save a lot of space
rm -fr ${initdir}/lib/modules/*/kernel/fs/ocfs2
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 $filesystems
hostonly='' instmods $drivers $filesystems
fi
[[ $add_drivers ]] && instmods $add_drivers
[[ $add_drivers ]] && hostonly='' instmods $add_drivers
# force install of scsi_wait_scan
old_hostonly=$hostonly
hostonly=''
instmods scsi_wait_scan
hostonly=$old_hostonly
hostonly='' instmods scsi_wait_scan

View File

@@ -1,3 +1,11 @@
for p in $(getargs rdloaddriver=); do
modprobe $p
#!/bin/sh
for i in $(getargs rdloaddriver=); do
(
IFS=,
for p in $i; do
modprobe $p 2>&1 | vinfo
done
)
done

View File

@@ -14,6 +14,7 @@ PROGRAM=="/bin/sh -c 'for i in $sys/$devpath/holders/dm-[0-9]*; do [ -e $$i ] &&
GOTO="lvm_end"
RUN+="/sbin/initqueue --settled --onetime --unique /sbin/lvm_scan"
RUN+="/sbin/initqueue --timeout --onetime --unique --name 51-lvm_scan /sbin/lvm_scan --partial"
RUN+="/bin/sh -c '>/tmp/.lvm_scan-%k;'"
LABEL="lvm_end"

View File

@@ -3,16 +3,36 @@ inst lvm
inst_rules "$moddir/64-lvm.rules" 64-lvm.rules
if [[ $hostonly ]] || [[ $lvmconf = "yes" ]]; then
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
for f in /etc/lvm/lvm.conf /etc/lvm/lvm_*.conf; do
[ -e "$f" ] || continue
inst "$f"
# FIXME: near-term hack to establish read-only locking;
# use command-line lvm.conf editor once it is available
[ -f "${initdir}/$f" ] && \
sed -i -e \
's/\(^[[:space:]]*\)locking_type[[:space:]]*=[[:space:]]*[[:digit:]]/\1locking_type = 4/' \
"${initdir}/$f"
done
fi
fi
inst_rules 10-dm.rules 13-dm-disk.rules 95-dm-notify.rules 11-dm-lvm.rules
inst_rules 11-dm-lvm.rules
inst "$moddir/lvm_scan.sh" /sbin/lvm_scan
inst_hook cmdline 30 "$moddir/parse-lvm.sh"
if ldd $(which lvm) 2>/dev/null | grep -q lib64; then
LIBDIR="/lib64"
else
LIBDIR="/lib"
fi
for i in $(ls /{usr,}/$LIBDIR/libdevmapper-event-lvm*.so 2>/dev/null); do
dracut_install $i
done
dracut_install -o thin_dump thin_restore thin_check thin_repair \
cache_dump cache_restore cache_check cache_repair \
era_check era_dump era_invalidate era_restore

View File

@@ -2,6 +2,7 @@
# run lvm scan if udev has settled
extraargs="$@"
. /lib/dracut-lib.sh
VGS=$(getargs rd_LVM_VG=)
@@ -34,39 +35,58 @@ if [ ! -e /etc/lvm/lvm.conf ]; then
fi
check_lvm_ver() {
maj=$1
min=$2
ver=$3
# --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
[ $4 -lt $maj ] && return 1
[ $4 -gt $maj ] && return 0
[ $5 -lt $min ] && return 1
[ $5 -gt $min ] && return 0
[ $6 -ge $ver ] && 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 "))
# hopefully this output format will never change, e.g.:
# LVM version: 2.02.53(1) (2009-09-25)
OLDIFS=$IFS
IFS=.
set $(lvm version 2>/dev/null)
IFS=$OLDIFS
maj=${1##*:}
min=$2
sub=${3%% *}
sub=${sub%%\(*};
check_lvm_ver 2 2 57 $maj $min $sub && \
nopoll="--poll n"
if check_lvm_ver 2 2 65 $maj $min $sub; then
sysinit=" --sysinit $extraargs"
fi
unset extraargs
export LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES=1
if [ -n "$LVS" ] ; then
info "Scanning devices $lvmdevs for LVM logical volumes $LVS"
lvm lvscan --ignorelockingfailure 2>&1 | vinfo
lvm lvchange -ay --ignorelockingfailure $nopoll --monitor n $LVS 2>&1 | vinfo
if [ -z "$sysinit" ]; then
lvm lvchange -ay --ignorelockingfailure $nopoll --ignoremonitoring $LVS 2>&1 | vinfo
else
lvm lvchange --yes -ay $sysinit $LVS 2>&1 | vinfo
fi
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 --monitor n $VGS 2>&1 | vinfo
if [ -z "$sysinit" ]; then
lvm vgchange -ay --ignorelockingfailure $nopoll --ignoremonitoring $VGS 2>&1 | vinfo
else
lvm vgchange -ay $sysinit $VGS 2>&1 | vinfo
fi
fi
if [ "$lvmwritten" ]; then

View File

@@ -1,10 +1,18 @@
if getarg rd_NO_LVM; then
info "rd_NO_LVM: removing LVM activation"
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
if getarg rd_NO_LVM; then
info "rd_NO_LVM: removing LVM activation"
rm -f /etc/udev/rules.d/64-lvm*.rules
else
for dev in $(getargs rd_LVM_VG=) $(getargs rd_LVM_LV=); do
printf '[ -e "/dev/%s" ] || exit 1\n' $dev \
>> /initqueue-finished/lvm.sh
{
printf '[ -e "/dev/%s" ] || ' $dev
printf 'warn "LVM "%s" not found"\n' $dev
} >> /emergency/90-lvm.sh
done
fi

View File

@@ -22,22 +22,12 @@ KERNEL!="md*", IMPORT{program}="/sbin/mdadm --examine --export $tempnode"
LABEL="do_md_inc"
#
# if rd_MDADMCONF do not assemble incrementally
# defer auto assembly until the udev queue is settled
#
ENV{rd_MDADMCONF}!="?*", GOTO="md_auto_end"
RUN+="/bin/sh -c 'ln -s /sbin/md_finished.sh /initqueue-finished/md_finished.sh;/sbin/initqueue --settled --onetime --unique /sbin/mdadm_auto'"
GOTO="md_inc_end"
LABEL="md_auto_end"
#
# Incrementally build the md array
#
RUN+="/sbin/mdadm -I --no-degraded $env{DEVNAME}"
RUN+="/sbin/mdadm -I $env{DEVNAME}"
RUN+="/bin/ln -s /sbin/md_finished.sh /initqueue-finished/md_finished.sh"
@@ -50,7 +40,6 @@ ACTION=="add|change", \
KERNEL=="md[0-9]*|md/*", \
ENV{MD_LEVEL}!="container", \
ENV{MD_CONTAINER}!="?*", \
ENV{rd_MDADMCONF}!="?*", \
ENV{rd_NO_MD}!="?*", \
GOTO="do_raidstart"
@@ -58,10 +47,12 @@ GOTO="end_raidstart"
LABEL="do_raidstart"
# check if array is not inactive anymore
TEST=="md/array_state", ATTR{md/array_state}!="|inactive", GOTO="end_raidstart"
RUN+="/bin/ln -sf /sbin/md_finished.sh /initqueue-finished/md_finished.sh"
RUN+="/bin/sh -c 'ln -s /sbin/md_finished.sh /initqueue-finished/md_finished.sh;/sbin/initqueue --settled --onetime --unique /sbin/mdraid_start'"
# check if array is not inactive anymore
TEST=="md/array_state", ATTR{md/array_state}=="clean", ENV{MD_UUID}=="?*", GOTO="end_raidstart"
RUN+="/sbin/initqueue --timeout --onetime --name 51-mdraid_start --unique /sbin/mdraid_start"
LABEL="end_raidstart"
@@ -72,7 +63,6 @@ ACTION=="add|change", \
KERNEL=="md[0-9]*|md/*", \
ENV{DEVTYPE}!="partition", \
ENV{MD_LEVEL}=="container", \
ENV{rd_MDADMCONF}!="?*", \
ENV{rd_NO_MD}!="?*", \
GOTO="do_container"
@@ -80,6 +70,10 @@ GOTO="end_container"
LABEL="do_container"
RUN+="/bin/sh -c 'ln -s /sbin/md_finished.sh /initqueue-finished/md_finished.sh;/sbin/initqueue --settled --onetime --unique --name mdcontainer_start-%k /sbin/mdcontainer_start $env{DEVNAME}'"
RUN+="/bin/sh -c 'ln -s /sbin/md_finished.sh /initqueue-finished/md_finished.sh"
TEST=="md/array_state", ATTR{md/array_state}=="clean", ENV{MD_UUID}=="?*", GOTO="end_container"
RUN+="/sbin/initqueue --timeout --onetime --name 50-mdcontainer_start --unique --name mdcontainer_start-%k /sbin/mdcontainer_start $env{DEVNAME}"
LABEL="end_container"

View File

@@ -6,7 +6,7 @@ which mdadm >/dev/null 2>&1 || exit 1
. $dracutfunctions
[[ $debug ]] && set -x
is_mdraid() { get_fs_type /dev/block/$1 |egrep -q '(linux|isw)_raid'; }
is_mdraid() { [[ -d "/sys/dev/block/$1/md" ]]; }
[[ $1 = '-h' ]] && {
rootdev=$(find_root_block_device)
@@ -16,7 +16,7 @@ is_mdraid() { get_fs_type /dev/block/$1 |egrep -q '(linux|isw)_raid'; }
check_block_and_slaves is_mdraid "$rootdev" || exit 1
else
# root is not on a block device, use the shotgun approach
blkid | grep -q linux_raid || exit 1
blkid | egrep -q '(linux|isw)_raid' || exit 1
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

View File

@@ -4,7 +4,7 @@
md=$1
udevadm control --stop-exec-queue
# and activate any containers
mdadm -IR $md 2>&1 | vinfo
mdadm -R $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

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