Compare commits

...

828 Commits
0.7 ... 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
Harald Hoyer
3ee26913e7 version 004 2010-01-15 14:09:06 +01:00
Harald Hoyer
4bb570c9a4 dracut-lib: do not leave debug mode in getarg and getargs 2010-01-15 14:07:54 +01:00
Harald Hoyer
0e8b76a57e test: remove lvm.conf in create-root.sh 2010-01-15 12:58:46 +01:00
Harald Hoyer
2dfdcbf4e7 dracut-lib: read multiple lines from $init/etc/cmdline 2010-01-15 12:33:41 +01:00
Harald Hoyer
1b3bdcc1a6 dracut.spec: only obsolete for rhel >= 6 and fedora > 12
and do not provide lsinitrd and mkinitrd
2010-01-15 10:28:44 +01:00
Warren Togami
dc5bb506ff dracut.spec: nbd is Fedora only 2010-01-14 18:11:52 +01:00
Harald Hoyer
074d12c1fa add lsinitrd 2010-01-14 17:20:43 +01:00
Harald Hoyer
80deff7c4b lvm: remove lvm-cleanup 2010-01-14 17:04:06 +01:00
Harald Hoyer
b7b6c6e1c6 test: remove lvm.conf in create-root.sh 2010-01-14 17:02:18 +01:00
Munehiro Matsuda
651f3f3d1a dmsquash: add support for loopmounted *.iso files
https://bugzilla.redhat.com/show_bug.cgi?id=548283
2010-01-14 16:47:16 +01:00
Harald Hoyer
0bc4ef1caf dracut.spec: update plymouth requirements 2010-01-14 15:54:17 +01:00
Harald Hoyer
dc0a0f6c93 lvm: add rd_LVM_LV and "--poll n" 2010-01-13 17:59:14 +01:00
Harald Hoyer
63d8d27b03 install lsinitrd/mkinitrd 2010-01-13 17:13:20 +01:00
Harald Hoyer
dc40ea7fa1 crypt/dm: move dmeventd to dm module 2010-01-13 16:33:40 +01:00
Mike Snitzer
0fae59d6eb lvm: lvm.conf (locking_type = 4)
- the use of sed is placeholder "hack" until lvm2 provides a proper
  tool for changing lvm.conf
- lvm_scan.sh should run lvm commands with --ignorelockingfailure to
  re-use lvm's existing initrd-specific logic; future lvm2 changes
  will split this flag out into various new command-line switches
- no monitoring should be started from within initramfs
- NOTE: the same should apply to 90dmraid/install
- the correct types would be: '[ "blkext", 1 , "cciss0", 16 ]'
  but lvm2 (>= 2.02.52) already properly supports both 'blkext' and
  'cciss' (including cciss0 -> cciss7)
2010-01-13 16:29:12 +01:00
Andrey Borzenkov
5c7821b6c5 Add user suspend support
This patch adds support for user mode suspend to disk. It is installed
in parallel to kernel mode suspend module; either will fail if
system was not suspended using correct tool so next one can be tried.

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

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

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

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

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

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

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

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

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

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

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

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

(and yes, it is safe against globbing)

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

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

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

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

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

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

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

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

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

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

Not having stop / start udev exec-queue around "mdadm -As --run" should
be safe as the exact same command is run from rc.sysinit without
any queue locking.
2009-09-18 08:15:59 +02:00
Harald Hoyer
9a99c974a4 version 002 2009-09-17 17:52:00 +02:00
Quentin Armitage
bf84ee3c7c dracut : remove extraneous output to screen during execution 2009-09-17 17:48:02 +02:00
Harald Hoyer
f8545d04b7 dracut: use and export PATH=/sbin:/bin:/usr/sbin:/usr/bin
There's no need for /usr/local to be in our paths at all, nor to
include a :$PATH at the end. The path should be exported though,
so modules don't have to worry about finding things.
2009-09-17 16:36:08 +02:00
Harald Hoyer
e73c975bad dracut.spec: inc release 2009-09-17 16:36:08 +02:00
Harald Hoyer
0f7e10cef4 mdraid: save state dir for mdmon/mdadm for the real root 2009-09-17 12:13:54 +02:00
Harald Hoyer
689f9b8af7 create /var/run in 99base 2009-09-17 12:10:48 +02:00
Harald Hoyer
654cbf0687 dracut.spec: removed gittags 2009-09-16 16:25:47 +02:00
Harald Hoyer
041b0d76ca dracut.spec: update changelog 2009-09-16 16:24:54 +02:00
Harald Hoyer
24bac034d1 65-md-incremental-imsm.rules: check if md raid is already running 2009-09-16 16:10:09 +02:00
Harald Hoyer
094097fab3 lvm/dm/md: switch from lockfiles to $sys/$devpath/holders/*
This is a more sane solution, than ignoring subsequent "change" events.

The only danger is that we could loop, if a lvm scan triggers a broken
md partition, which triggers a broken PV and so on.

Better fix the scanning tools, not to emit change events for devices,
if no action was taken.
2009-09-16 15:34:13 +02:00
Harald Hoyer
26fbe9a101 TEST-14-IMSM: rd_NO_DM rd_NO_MDIMSM rd_NO_MDADMCONF succeeds now
This test succeeds, because the mirror parts are found without
assembling the mirror itsself, which is what we want

client_run rd_NO_DM rd_NO_MDIMSM rd_NO_MDADMCONF || return 1
2009-09-16 15:32:55 +02:00
Harald Hoyer
f8ddafcca2 TEST-11-LVM: add rdinfo 2009-09-16 15:32:29 +02:00
Hans de Goede
04a8f224c1 Add ifname= argument for persistent netdev names
ifname=<interface>:<MAC>
Assign network device name <interface> (ie eth0) to the NIC
with MAC <MAC>.
Note that if you use this option you *must* specify an ifname=
argument for all interfaces used in ip= or fcoe= arguments
2009-09-16 15:01:08 +02:00
Harald Hoyer
597839331c dmraid: use and install kpartx for dmraids 2009-09-16 11:21:24 +02:00
Hans de Goede
26b72485cf 90dmraid: use kpartx to scan for partitions 2009-09-16 11:20:57 +02:00
Harald Hoyer
7dbaf59ccf 10rpmversion/install: fix non-rpm install 2009-09-16 11:18:22 +02:00
Harald Hoyer
95cf0a8803 10rpmversion,dracut.spec: generate version file and install it 2009-09-16 10:43:50 +02:00
Harald Hoyer
1dd5bc3fba add udevproperty() to dracut-lib and use it
newer versions of udev use --property instead of --env
2009-09-16 10:43:50 +02:00
Warren Togami
bf55e2c5d3 dmsquash-live-root requires umount 2009-09-15 17:17:57 -04:00
Harald Hoyer
4d92475240 changelog/NEWS update 2009-09-15 15:54:14 +02:00
Harald Hoyer
a52586e8ea network: break udevsettle early 2009-09-15 15:38:53 +02:00
Hans de Goede
5759574b26 Document that MAC addresses must be lowercase 2009-09-15 15:14:19 +02:00
Hans de Goede
56580efe68 Document netroot=fcoe:.... 2009-09-15 15:14:19 +02:00
Hans de Goede
68f28d6976 Add ifname= argument for persistent netdev names
ifname=<interface>:<MAC>
Assign network device name <interface> (ie eth0) to the NIC with MAC <MAC>.
Note that if you use this option you *must* specify an ifname= argument
for all interfaces used in ip= or fcoe= arguments
2009-09-15 15:13:21 +02:00
Harald Hoyer
5c3f5746bb 90mdraid/65-md-incremental-imsm.rules: first set initqueue-finished,
then initqueue-settled

also introduce md_finished.sh to check for all md activity to be settled
2009-09-15 15:00:25 +02:00
Harald Hoyer
54a73cbb2b dracut-lib.sh: change -f to -e to allow symlinks 2009-09-15 15:00:24 +02:00
Harald Hoyer
ab0f04844b 10rpmversion: try to get the correct dracut rpm version during %post 2009-09-15 15:00:24 +02:00
Harald Hoyer
ad8f03af22 TEST-14-IMSM: "rd_NO_DM rd_NO_MDIMSM rd_NO_MDADMCONF" fails 2009-09-15 15:00:24 +02:00
Harald Hoyer
3329f92136 90crypt/70-luks.rules: set unique name for initqueue job 2009-09-15 15:00:24 +02:00
Harald Hoyer
c27ec060da 95rootfs-block/block-genrules.sh: beautify code 2009-09-15 15:00:24 +02:00
Harald Hoyer
82b2189d01 initqueue-finished: fail also on empty queue 2009-09-15 15:00:24 +02:00
Harald Hoyer
4ce52970c0 initqueue: first remove the job, then execute it 2009-09-15 15:00:24 +02:00
Harald Hoyer
99433dd289 90mdraid: only switch mdmon to new root, if an instance is running 2009-09-15 15:00:23 +02:00
Harald Hoyer
b94c520660 plymouth: add rd_NO_PLYMOUTH 2009-09-15 15:00:23 +02:00
Harald Hoyer
2f02ae9d45 mdraid: add rd_NO_MDADMCONF --mdadmconf --nomdadmconf
Copy /etc/mdadm.conf to initramfs (even for non-hostonly) if
mdadmconf="yes" is set in dracut.conf or --mdadmconf is specified on the
dracut command line.

This was done, because there seems _no_ sane way to autoassemble md raid
arrays.

also moved rd_NO_MD to an udev ENV
2009-09-15 15:00:18 +02:00
Harald Hoyer
11fcc8c8f9 95resume/install: give resume higher prio than mount 2009-09-15 11:17:28 +02:00
Harald Hoyer
e8cf498dcc 95rootfs-block/mount-root.sh: ignore /.resume 2009-09-15 11:17:28 +02:00
Harald Hoyer
2178a00eea 95resume: simplyfy rules and also recognize blkid typo 2009-09-15 11:17:27 +02:00
Harald Hoyer
33ff830c1b 90dmraid: switch rd_NO_DM to udev ENV 2009-09-15 11:17:27 +02:00
Harald Hoyer
5a8d8dfbb6 switch modules to initqueue-finished 2009-09-15 11:17:22 +02:00
Harald Hoyer
8238850caa init: add initqueue-finished
/initqueue-finished/*.sh are scripts, which return != 0, if the main
loop still has pending jobs to do.
2009-09-15 08:47:47 +02:00
Harald Hoyer
fc3c64c8d4 dracut: determine path to dracut-functions 2009-09-14 19:35:18 +02:00
Harald Hoyer
1888e57bf9 plymouth: grep for PLYMOUTH_POPULATE_SOURCE_FUNCTIONS 2009-09-14 19:34:30 +02:00
Harald Hoyer
94dcc5b8d8 fix backwards inst() compat 2009-09-14 19:33:54 +02:00
Harald Hoyer
4839a7995e add pcmcia adapter 2009-09-14 19:30:20 +02:00
Harald Hoyer
1aca526cb4 90dmraid: install parse-dm.sh 2009-09-14 16:47:30 +02:00
Harald Hoyer
9541165d33 dracut-functions: fixed inst() for mkinitrd compat 2009-09-14 15:53:55 +02:00
Harald Hoyer
600131fe85 selinux-loadpolicy: do not check for selinux config files
leave it up to load_policy
2009-09-11 16:30:10 +02:00
Harald Hoyer
8c45b484ce plymouth: removed rd_plytheme 2009-09-11 16:29:40 +02:00
Harald Hoyer
650da7bada removed initrdargs from parse-*.sh 2009-09-10 17:34:15 +02:00
Harald Hoyer
247c9f70bf init: fixed command line handling for /sbin/init and init=<custom init> 2009-09-10 16:48:36 +02:00
Harald Hoyer
233f79df99 selinux-loadpolicy.sh: also check for /etc/selinux/config 2009-09-10 15:49:03 +02:00
Harald Hoyer
236852c109 dracut.spec: require plymouth-scripts 2009-09-09 21:16:01 +02:00
Harald Hoyer
6f0e469d79 selinux-loadpolicy: set initial ret=0 2009-09-09 19:50:44 +02:00
Harald Hoyer
f9749f368f plymouth: use /usr/libexec/plymouth/plymouth-populate-initrd if possible 2009-09-09 18:05:00 +02:00
Harald Hoyer
f165864f09 dracut-functions: make inst() mkinitrd compatible 2009-09-09 18:05:00 +02:00
Harald Hoyer
dc077a52c9 dracut.spec: do not require policycoreutils
since might do load_policy with chroot, we don't need to require it
2009-09-09 18:05:00 +02:00
Harald Hoyer
0b2de1f895 99base/init: output more info() 2009-09-09 18:04:55 +02:00
Harald Hoyer
94eb3cf222 selinux-loadpolicy: do not mount /proc and /selinux
load_policy already does these things for us
2009-09-09 17:06:21 +02:00
Harald Hoyer
cb47caf786 add parameter to specify additional kernel modules to include
--add-drivers for dracut
add_drivers for dracut.conf
2009-09-09 17:02:37 +02:00
Harald Hoyer
d9f0633878 selinux-loadpolicy: do not mount /proc and /selinux
load_policy mounts it for us
2009-09-09 14:41:40 +02:00
Harald Hoyer
71094bee63 base/init: add scsi_wait_scan to wait for host adapter scans 2009-09-09 11:09:04 +02:00
Harald Hoyer
f5c4374d2c selinux-loadpolicy.sh: mount /proc and /selinux before loading the
policies

also check for /sbin/load_policy
2009-09-08 16:26:37 +02:00
Harald Hoyer
aa297ca6b6 65-md-incremental-imsm.rules: refine rules 2009-09-08 15:33:19 +02:00
Harald Hoyer
4712e4ece6 initqueue: add --name parameter to give a name for --unique 2009-09-08 15:31:48 +02:00
Harald Hoyer
e51b607189 TEST-14-IMSM: create raid5 inside isw raid container 2009-09-08 15:31:27 +02:00
Harald Hoyer
fdf2a763d4 TEST-14-IMSM: more test cases 2009-09-08 15:31:00 +02:00
Harald Hoyer
f25c9697f8 mdraid: stop udev queue until mdraid assembled 2009-09-08 15:30:17 +02:00
Harald Hoyer
7e282f5df1 dmraid: only install 64-md-raid.rules if no vol_id present 2009-09-08 15:29:30 +02:00
Harald Hoyer
0e9bb3f30c TEST-14-IMSM: no test for a isw raid array 2009-09-08 13:43:21 +02:00
Harald Hoyer
3bb5b261c7 65-md-incremental-imsm: add additional check for md-non-containers 2009-09-08 13:42:31 +02:00
Harald Hoyer
273b197d75 added initqueue-settled and refactored code 2009-09-07 19:12:01 +02:00
Harald Hoyer
906dedf4d5 mdraid-cleanup: do not stop mdraid container 2009-09-07 19:12:00 +02:00
Harald Hoyer
4f4a79b1a1 add scp to debug module 2009-09-07 17:10:19 +02:00
Harald Hoyer
587b3497c1 mdraid_start.sh: fixed raid activation 2009-09-07 16:18:12 +02:00
Harald Hoyer
1753a63081 TEST-12-RAID-DEG: check with root=LABEL=root 2009-09-07 11:41:38 +02:00
Harald Hoyer
96f3cf1d27 95udev-rules: fixed c&p bug which did not install 61-persistent-storage.rules 2009-09-07 11:40:20 +02:00
Harald Hoyer
e4dec3d6b6 {crypt,dmraid,lvm,mdraid}: cleanup with pre-pivot 30 and 31 2009-09-03 17:11:57 +02:00
Harald Hoyer
429aa1a2c2 mdraid: add grep for convenience 2009-09-03 17:11:03 +02:00
Harald Hoyer
d889c019e7 version 001 2009-09-02 15:55:35 +02:00
Harald Hoyer
52168b7b9d reordered blkid/vol_id rules 2009-09-02 15:55:34 +02:00
Peter Rajnoha
d6462323d6 LVM/DM rules in dracut
I've looked at the LVM rules used in dracut just recently
and it needs fixing - we should react to change events only
for DM devices, so we have to skip vol_id/blkid call on ADD:

KERNEL=="dm-[0-9]*", ACTION=="add", GOTO="lvm_end"

Also, MD devices have their own rules, where vol_id/blkid
is called and where the symlinks are created (when looking
into raw initrd, this is in  64-md-raid.rules).

Also, if those rules are meant to be for DM devices only,
maybe we should skip symlink creation for the other devices
there, to keep the rules clean and straightforward. I think
we shouldn't create/recreate symlinks for non-dm devices in
LVM/DM rules (..should be in appropriate rules for that type
of device):

KERNEL!="dm-[0-9]*", GOTO="lvm_end"
2009-09-02 15:55:34 +02:00
Victor Lowther
1d368457e3 Merge commit 'origin/master' 2009-09-02 07:40:28 -05:00
Victor Lowther
7c3fe07ac0 Made hostonly checking for fcoe fail for now.
Having it unconditionally pass pulls in all the networking cruft even
for systems that do not need it, and that sorta defeats the purpose of
hostonly mode.
2009-09-02 07:37:33 -05:00
Harald Hoyer
194f7d125f 90*/*cleanup.sh: fixed redirection to /dev/null 2009-09-01 15:59:31 +02:00
Harald Hoyer
8ef0be5671 dracut-lib: try to set UDEVVERSION, if not set 2009-09-01 15:51:51 +02:00
Harald Hoyer
b809e77f54 plymouth: in the generic case, only install text and details themes 2009-09-01 15:51:51 +02:00
Harald Hoyer
780afa9876 release any raid/crypt/lvm device assembled, but not in use 2009-09-01 15:51:51 +02:00
Harald Hoyer
5ebc1acb7f selinux-loadpolicy.sh: redirect output of selinux load_policy 2009-09-01 15:51:50 +02:00
Harald Hoyer
59580f28a1 dracut-functions: do not try to clear logfile, if not writable 2009-09-01 15:42:28 +02:00
Harald Hoyer
533d7dc4ab dracut-function: add check for volume group members
see https://bugzilla.redhat.com/show_bug.cgi?id=506189

not all members of a linear volume group are listed in /sys slaves
2009-09-01 15:42:28 +02:00
Harald Hoyer
ec74fa8789 split dracut in network / non-network 2009-09-01 15:42:28 +02:00
Harald Hoyer
988061a5ee dracut.spec: removed s390 conditionals 2009-09-01 15:42:28 +02:00
Harald Hoyer
c10d53bf0c dracut.spec: fixed gittag 2009-09-01 15:42:28 +02:00
Harald Hoyer
54b87586aa fixed gitrpm 2009-09-01 15:42:27 +02:00
Harald Hoyer
461ff22cd5 new test/TEST-13-ENC-RAID-LVM 2009-09-01 15:42:27 +02:00
Harald Hoyer
b1a4919cb2 TEST-12-RAID-DEG/test.sh: add rdinfo 2009-09-01 15:42:27 +02:00
Harald Hoyer
c1d670a893 65-md-incremental-imsm.rules: also check on "change" 2009-09-01 15:42:27 +02:00
Harald Hoyer
b6bf29b054 lvm.rules: blkid for cciss devices 2009-09-01 15:42:27 +02:00
Harald Hoyer
5c6a593f2e add udevsettle function and settle after raid/lvm/crypto activities 2009-09-01 15:42:27 +02:00
Harald Hoyer
f4c36b28f6 mdraid_start: check if raid is already active before trying to run it 2009-09-01 15:42:27 +02:00
Harald Hoyer
73e649b5f5 dracut.spec: require policycoreutils 2009-09-01 15:42:26 +02:00
Harald Hoyer
ba72631039 add hostonly to dracut.conf 2009-09-01 15:42:26 +02:00
Warren Togami
a89fb6daa5 Write netboot config for passing to OS as requested in https://bugzilla.redhat.com/show_bug.cgi?id=515771#c18 2009-08-31 19:34:27 -04:00
Harald Hoyer
6568d86aec instmods(): fixed "instmods =drivers/md" 2009-08-28 13:33:57 +02:00
Hans de Goede
3508cc816e Add fcoe booting support
Supported cmdline formats:
fcoe=<networkdevice>:<dcb|nodcb>
fcoe=<macaddress>:<dcb|nodcb>

Note currently only nodcb is supported, the dcb option is reserved for
future use.

Note letters in the macaddress must be lowercase!

Examples:
fcoe=eth0:nodcb
fcoe=4A:3F:4C:04:F8:D7:nodcb
2009-08-28 12:53:56 +02:00
Harald Hoyer
ffa264f077 dracut.8: document rootfstype and rootflags 2009-08-28 12:53:03 +02:00
Harald Hoyer
84c2266f1a network/installkernel: it's eth_type_trans and not eth_type_transfer 2009-08-27 13:06:46 +02:00
Harald Hoyer
973c23b0d6 should_source_module(): refined check
Do not bail out early if no install exists.
Check also for installkernel.
2009-08-27 12:53:38 +02:00
Victor Lowther
9ede1929b2 Oops, clean up broken get_fs_type implementation.
While we are at it, make a couple of other fixups.
2009-08-22 12:04:11 -05:00
Victor Lowther
054e038512 Add accurate --hostonly checking for 95iscsi 2009-08-21 22:22:40 -05:00
Victor Lowther
fb8923f681 Minor fixups to kernel module loading
Also rewrite filter_kernel_modules to make it a little easier to read.
2009-08-20 22:21:33 -05:00
Victor Lowther
240cc7c480 Abstract out hostonly vs. generic module installation differences.
This introduces filter_kernel_modules, which should be used to install
all kernel modules that match whatever criteria you want.

If running in --hostonly, filter_kernel_modules will only consider
modules that are loaded in the kernel, otherwise it will consider
all the modules installed on the system for the appropriate kernel.

This drastically reduces initramfs generation time when using --hostonly
by eliminating lots of unneeded filesystem activity.
2009-08-20 15:52:45 -05:00
Victor Lowther
8d04a1287d Some updates to the README files 2009-08-20 14:14:21 -05:00
Victor Lowther
16df64ef1f Abstract out vol_id vs. blkid usage.
vol_id seems to be going away, and blkid can be used as a drop-in replacement
for it.
2009-08-20 07:28:04 -05:00
Victor Lowther
f76ef3aa3d Speed up loading block drivers when running with --hostonly
Instead of grovelling through all the modules available for the
kernel looking for block devices, only look at the modules that are
actually loaded. This speeds things up by a rather large amount
when generating the initramfs with --hostonly.

While we are at it, only load the filesystem module that will actually
be used for the root filesystem when running in --hostonly instead
of all the filesystem modules that happen to be loaded at the time.
2009-08-19 22:21:29 -05:00
Victor Lowther
59c88f499f Abstract out vol_id vs. blkid usage
Since different distros may or may not use vol_id in udev, and blkid
is generally replacing vol_id, abstract them out into a function which
tries to use vol_id first and blkid second, on the assumption that
blkid can take over for vol_id if vol_id is no longer there.
2009-08-19 22:21:07 -05:00
Harald Hoyer
afe25d0ccc {crypt,dmraid,,lvm,mdraid}/check use blkid if no vol_id found 2009-08-19 17:11:29 +02:00
Harald Hoyer
bdccc34e7e Makefile: add hostimage target for a hostonly image
call it with root priviledges
2009-08-19 17:10:38 +02:00
Harald Hoyer
495a964322 nbd/check: moved host-only checks and added ";" 2009-08-19 17:09:53 +02:00
Harald Hoyer
9defc609e8 dracut-functions: check for existance of slave devices before opening it 2009-08-19 17:08:57 +02:00
Harald Hoyer
68b26290f0 udev-rules: install vol_id 2009-08-19 11:12:42 +02:00
Harald Hoyer
d41f7ae750 rsyslogd-start.sh: read correct filters file 2009-08-19 10:59:37 +02:00
Marc Grimme
e15bc1f330 Syslog support for dracut
This module provides syslog functionality in the initrd.
This is especially interesting when complex configuration being
used to provide access to the device the rootfs resides on.

When this module is installed into the ramfs it is triggered by
the udev event from the nic being setup (online).

Then if syslog is configured it is started and will forward all
kernel messages to the given syslog server.

The syslog implementation is detected automatically by finding the
apropriate binary with the following order:
rsyslogd
syslogd
syslog-ng
Then if detected the syslog.conf is generated and syslog is started.

Bootparameters:
syslogserver=ip    Where to syslog to
sysloglevel=level  What level has to be logged
syslogtype=rsyslog|syslog|syslogng
                   Don't auto detect syslog but set it
2009-08-19 10:40:02 +02:00
Jeremy Katz
a607b7d4b8 Fix syntax error in conditional
Fix a typo in the conditionals.  Not sure how I didn't notice these
before
2009-08-19 10:34:06 +02:00
Victor Lowther
1a4c4015bc Modify nbd hostonly checking to use check_block_and_slaves.
This allows hostonly nbd checking to work in more exotic situations,
such as mdraid/dmraid/lvm/crypt on top of nbd.
2009-08-16 18:22:21 -05:00
Victor Lowther
d7df77d172 Modified lvm hostonly checking to use dracut-functions 2009-08-16 15:29:59 -05:00
Victor Lowther
7e2b4f8367 Make mdraid checking use common functionality in dracut-functions 2009-08-16 15:29:59 -05:00
Victor Lowther
bc9ae19deb Make dmraid checking use common functionality in dracut-functions 2009-08-16 15:29:50 -05:00
Victor Lowther
17829e94aa Move common rootfs finding and backing store tree checking to dracut-functions 2009-08-16 15:29:50 -05:00
Victor Lowther
e0dca0e43c Minor spacing fixups in dracut-finctions 2009-08-16 15:29:49 -05:00
Victor Lowther
4e207ec862 The network check script sources , so it must use /bin/bash 2009-08-16 15:29:49 -05:00
Victor Lowther
b5ccf21d2b Make the lvm check script really check to see if root is on an lvm device
somehow when run in hostonly mode.
2009-08-16 15:29:42 -05:00
Victor Lowther
62bde8ed7e make mdraid check script really check to see of the rootfs is on an
mdraid block device when run in hostonly mode.
2009-08-16 15:29:27 -05:00
Victor Lowther
dc670134f8 Make hostonly check for dmraid only pass if root is really on
a dmraid volume somehow.
2009-08-16 15:29:18 -05:00
Victor Lowther
39d6cb5df4 Make hostonly checking in 90crypt only pass if root is really on an
encrypted block device somewhere along the chain.
2009-08-16 15:28:56 -05:00
Victor Lowther
ddfd1d10a0 Split kernel module loading into smaller chunks.
This prepares to more tightly integrate dracut-gencmdline with the
rest of the dracut scripts
2009-08-16 15:28:45 -05:00
Victor Lowther
0c1a8ebc37 More quotation fixups in dracut-functions 2009-08-15 10:56:36 -05:00
Victor Lowther
bd4c4bcb76 Simplify dracut_install a bit, an make a minor fixup to check_module_deps 2009-08-15 07:55:59 -05:00
Victor Lowther
161efa1f40 Some quotation cleanups in dracut-functions.
Quotes are generally not needed in when assigning one variable to another,
and are also not needed inside [[ ]] comaprisons, as word splitting and
pathname expansion are not performed in these cases.
2009-08-15 07:38:26 -05:00
Victor Lowther
ebdddd29d3 Get rid of redundant NONL stuff in dracut-gencmdline 2009-08-14 22:54:38 -05:00
Victor Lowther
2790d5b2ed Update dracut-catimages to make it much more robust in the face of
image filenames with spaces, carriage returns, and other such nasty
characters in them.  Bash arrays are very useful for these sorts of things.
2009-08-14 22:51:25 -05:00
Victor Lowther
98adb06ea3 No need to quote variable expansion in [[ ]] 2009-08-14 22:36:41 -05:00
Victor Lowther
0b90cfaa9f Bashify drivers_dir check 2009-08-14 22:31:04 -05:00
Harald Hoyer
ded38dbfbd dracut.spec add NEWS to dracut and dracut-tools 2009-08-14 18:03:33 +02:00
Harald Hoyer
5d12f1a485 version 0.9 2009-08-14 17:59:43 +02:00
Harald Hoyer
7addf9d430 rpmversion: dash does not want as I do 2009-08-14 17:47:07 +02:00
Harald Hoyer
6d0480426d rpmversion: fixed rpm query 2009-08-14 17:37:00 +02:00
Harald Hoyer
5a8b143888 TEST-10-RAID: new mdadm is picky about partitions 2009-08-14 17:27:50 +02:00
Michael Ploujnikov
5bf0b329c9 update the rdbreak breakpoint list 2009-08-14 17:27:50 +02:00
Harald Hoyer
51123629d7 dracut.spec: add more plymouth themes 2009-08-14 17:27:50 +02:00
Harald Hoyer
0ad78ae8e7 dracut.spec: requieres dash
how could we forget to add that?? :-)
2009-08-14 17:27:50 +02:00
Harald Hoyer
1c6e9e5c0a new module 10rpmversion
outputs rpm version of dracut
2009-08-14 17:27:50 +02:00
Harald Hoyer
0b610a002c removed 90dmsetup 2009-08-14 17:27:49 +02:00
Harald Hoyer
0f1361ee1c udev-rules: hardcode helper binaries 2009-08-14 17:27:49 +02:00
Harald Hoyer
b806825d2a nfs: only install libnfsidmap_nsswitch.so of all libnfsidmap_*.so 2009-08-14 17:27:49 +02:00
Harald Hoyer
f905c1d7d6 dmsquash-live: install the "real" eject
eject might be a symlink to consolehelper
2009-08-14 17:27:49 +02:00
Harald Hoyer
926b2c3337 dracut: set ownership to root.root for all files 2009-08-14 17:27:49 +02:00
Harald Hoyer
fc900b8be4 dracut-gencmdline: fix LUKS_UUID and MD_UUID output 2009-08-14 16:21:03 +02:00
Harald Hoyer
88838bf238 network: exclude kernel modules, which need iw_handler_get_spy 2009-08-14 16:21:03 +02:00
Harald Hoyer
ed2de829e1 cryptroot-ask.sh: fix rd_LUKS_UUID handling 2009-08-14 16:21:03 +02:00
Harald Hoyer
ff34c9dcd4 10redhat-i18n: remove unnecessary files 2009-08-14 16:21:03 +02:00
Harald Hoyer
3d4641fd98 add rdinfo command line parameter
print informational output though "quiet" is set
2009-08-14 16:21:03 +02:00
Harald Hoyer
860ace56f8 inst_simple(): add -p flag to cp 2009-08-13 14:22:54 +02:00
Harald Hoyer
ed6220fd25 plymouth: make the daemon attach to the session/terminal
https://bugzilla.redhat.com/show_bug.cgi?id=516104

it can be so simple :-)
2009-08-07 12:08:31 +02:00
Harald Hoyer
be9ca6c8a8 dracut.spec: require versioned util-linux-ng instead of switch_root 2009-08-07 12:08:04 +02:00
Warren Togami
148284ced6 Remove ugly hack 2009-08-06 11:07:43 -04:00
Harald Hoyer
1def132d53 version 0.8 2009-08-06 15:10:59 +02:00
Harald Hoyer
0de910602c add NEWS 2009-08-06 15:01:24 +02:00
Harald Hoyer
3714170f33 plymouth-populate-initrd: do not install label.so
https://bugzilla.redhat.com/show_bug.cgi?id=515589

It ends up installing the label.so control plugin which isn't supposed
to get installed into the initrd.  this makes cairo and libX11 and all sorts of
things move into the initrd that aren't supposed to.
2009-08-06 14:43:13 +02:00
Harald Hoyer
c6ca79eb4e dracut.spec: version for module-init-tools requirement
https://bugzilla.redhat.com/show_bug.cgi?id=515630

dracut-0.7-1 uses a modprobe option (-d) that exists only in
module-init-tools >= 3.7-9, but the 'Requires: module-init-tools'
of dracut is not version-specific.
2009-08-06 14:43:13 +02:00
Thilo Bangert
a15ad925e9 support for unusual terminfo location
the following patch makes the 95terminfo module work on gentoo.
2009-08-06 14:43:12 +02:00
Warren Togami
13d5225fc8 Temporary hack to provide ifcfg files to OS in a way that might work with existing initscripts.
I am not happy about this.  It shouldn't be the job of dracut to do this.  The initscripts should
deal with the plain /dev/.initramfs/ifcfg/ directory accordingly.  Doing this for now because
notting insists upon it.  We need to clean this up after we network option passing working.
2009-08-04 17:15:39 -04:00
Harald Hoyer
e3052553cf dracut.spec: fixed requirements for dracut-tools 2009-08-04 16:36:18 +02:00
Jeremy Katz
cc0e7a369b Parse options earlier for live root 2009-08-04 16:25:43 +02:00
Jeremy Katz
7f819d7041 Support resetting the live overlay
If you're using a persistent overlay, you might want to reset it
at boot time if it has become corrupted somehow.  Support using
reset_overlay as a command line optino to do so
2009-08-04 16:25:43 +02:00
Jeremy Katz
dfba82b3d3 And support passing in the persistent overlay
The persistent overlay can be specified with an overlay= argument
on the command line.  We'll probably try to move this into the
root= syntax soon, but this is the old way that works
2009-08-04 16:25:43 +02:00
Jeremy Katz
3ae2f09a04 Support passing live_ram
live_ram allows you to load the entirety of the live image into
RAM and run it from there rather than off of the block device
2009-08-04 16:25:43 +02:00
Jeremy Katz
a2a2a956dd Support passing the live_dir with live_dir=
The live image is assumed to be under LiveOS/ unless live_dir
is passed specifying otherwise
2009-08-04 16:25:43 +02:00
Jeremy Katz
fa9d7304bf Support old syntax
livecd-creator previously added 'liveimg' and used root=CDLABEL=;
it's easy enough to support that old syntax for now at least
and it will make it easier to get people testing
2009-08-04 16:25:43 +02:00
Jeremy Katz
c56b63d1bd Support checking the iso
Support checking the iso image with checkisomd5 if available
2009-08-04 16:25:43 +02:00
Jeremy Katz
2e44f115b9 Add basic support for dmsquashed live images
Fedora/Red Hat live images are implemented as an ext3fs inside of
a squashfs.  Writability is achieved with a device-mapper snapshot
on top of that.

This gives the basic support without a lot of things like persistent
overlays, iso md5sum checking, etc and also with a new basic syntax
that has to be specified as root=live:LABEL=...
2009-08-04 16:25:42 +02:00
Sergey Fionov
0c296f15b1 Fix full pathname condition in find_library
Hello,

Now a fact that the path is full is checked by
[[ -x $1 ]]

But if the working directory is /bin or a directory with a file named
"mount",
this condition will be met for "inst mount", and "mount" will not be copied
into initrd at all.
2009-08-04 16:21:58 +02:00
Harald Hoyer
345f573546 90mdraid/parse-md.sh: removed bashism 2009-08-04 11:36:06 +02:00
Warren Togami
69288348dd dracut requires bzip2 2009-08-03 14:26:26 -04:00
Harald Hoyer
9babe97e6f iscsiroot: check real root if it is block:... 2009-07-31 14:43:14 +02:00
Harald Hoyer
863fa9c295 dracut.8: fixed iscsi username/pw documentation 2009-07-31 13:22:58 +02:00
Hans de Goede
766968bb6f Implement extended iscsi: rfc4173 syntax which allows specifying credentials
As discussed before, it would be nice to be able to specify
the iscsi chap credentials inside the netroot=iscsi:.....
syntax, this patch implements this in a backwards compatible way, like
this:
iscsi:username:pass@127.0.0.1::3260::iqn.2009-01.com.example:testdisk
iscsi:username:pass:reverse:pass@127.0.0.1::3260::iqn.2009-01.com.example:test

The only downside is that the backwards compatibility is broken when there
is an @ in the iscsi target name (very unlikely), that can still be used,
but only like this:
iscsi:@192.168.1.100::3260::iqn.2009-01.com.example:testdi@sk
2009-07-31 12:44:18 +02:00
Harald Hoyer
123e04b23e 40network/installkernel: do not install isdn and uwb modules 2009-07-31 12:40:53 +02:00
Harald Hoyer
9d2eb35d7a 90kernel-modules/installkernel: do not install fs/ocfs2 filesystems 2009-07-31 12:40:53 +02:00
Harald Hoyer
67a38adacf nfs: only install libnss_*.so which are used by nsswitch.conf 2009-07-31 12:40:53 +02:00
Harald Hoyer
80aa303c29 dracut.spec: removed duplicate requirements 2009-07-31 12:40:53 +02:00
Harald Hoyer
5ea16f2790 kernel-modules: add modules for virtio devices 2009-07-31 12:40:53 +02:00
Harald Hoyer
2f24b79ddd iscsi: manually load the iscsi_ibft kernel module 2009-07-31 10:58:03 +02:00
Harald Hoyer
d9f8feb04a iscsi: install iscsi_ibft kernel module 2009-07-30 16:57:30 +02:00
Harald Hoyer
bb57587b42 iscsiroot: fixed udev rules for iscsi_firmware 2009-07-30 16:14:09 +02:00
Harald Hoyer
b61ca28260 dracut.spec: no more switch_root for >= F12 and Require "which" 2009-07-30 16:12:52 +02:00
Harald Hoyer
a3f4e7709b add udev rules for iscsi_firmware 2009-07-30 16:12:52 +02:00
Warren Togami
984a819b92 There is only one resolv.conf. 2009-07-30 09:27:09 -04:00
Warren Togami
edae4b5efb Mark the other ifcfg file when bridges are used. 2009-07-29 16:54:53 -04:00
Warren Togami
2098ebf712 Need some way of differentiating these interfaces as being netboot. 2009-07-29 14:07:08 -04:00
Harald Hoyer
f72c10f657 getarg()/getargs(): check existance of /etc/cmdline before reading it 2009-07-28 18:29:40 +02:00
Warren Togami
645bde35d3 Use standard ifcfg filenames, put them into an ifcfg directory. 2009-07-27 15:54:21 -04:00
Warren Togami
0c39f9f6f6 --strip requires file 2009-07-27 13:16:51 -04:00
286 changed files with 12082 additions and 1553 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"
}
}

6
.mailmap Normal file
View File

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

37
AUTHORS
View File

@@ -1,11 +1,32 @@
Andreas Thienemann <andreas@bawue.net>
Bill Nottingham <notting@redhat.com>
Dave Jones <davej@redhat.com>
David Dillow <dave@thedillows.org>
Harald Hoyer <harald@redhat.com>
Jeremy Katz <katzj@redhat.com>
Peter Jones <pjones@redhat.com>
Seewer Philippe <philippe.seewer@bfh.ch>
Victor Lowther <victor.lowther@gmail.com>
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>
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>
Lance Albertson <lance@osuosl.org>
Michael Ploujnikov <plouj@somanetworks.com>
Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Dan Horák <dan@danny.cz>
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>
Sergey Fionov <fionov@gmail.com>
Thilo Bangert <thilo.bangert@gmx.net>
Yanko Kaneti <yaneti@declera.com>

View File

@@ -1,35 +1,60 @@
VERSION=0.7
VERSION=004
GITVERSION=$(shell [ -d .git ] && git rev-list --abbrev-commit -n 1 HEAD |cut -b 1-8)
prefix = /usr
datadir = ${prefix}/share
pkglibdir = ${datadir}/dracut
sysconfdir = ${prefix}/etc
sbindir = ${prefix}/sbin
mandir = ${prefix}/share/man
prefix ?= /usr
datadir ?= ${prefix}/share
pkglibdir ?= ${datadir}/dracut
sysconfdir ?= ${prefix}/etc
sbindir ?= ${prefix}/sbin
mandir ?= ${prefix}/share/man
.PHONY: install clean archive rpm testimage test all check AUTHORS
ifeq (1,${WITH_SWITCH_ROOT})
targets = modules.d/99base/switch_root
else
targets =
endif
all: $(targets) 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
all: modules.d/99base/switch_root
.PHONY: install clean archive rpm testimage test all check
install:
mkdir -p $(DESTDIR)$(pkglibdir)
mkdir -p $(DESTDIR)$(sbindir)
mkdir -p $(DESTDIR)$(sysconfdir)
mkdir -p $(DESTDIR)$(pkglibdir)/modules.d
mkdir -p $(DESTDIR)$(mandir)/man8
mkdir -p $(DESTDIR)$(mandir)/man{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
install -m 0755 mkinitrd-dracut.sh $(DESTDIR)$(sbindir)/mkinitrd
install -m 0755 lsinitrd $(DESTDIR)$(sbindir)/lsinitrd
ifeq (1,${WITH_SWITCH_ROOT})
install -m 0755 modules.d/99base/switch_root $(DESTDIR)$(sbindir)/switch_root
endif
install -m 0644 dracut.conf $(DESTDIR)$(sysconfdir)/dracut.conf
mkdir -p $(DESTDIR)$(sysconfdir)/dracut.conf.d
install -m 0755 dracut-functions $(DESTDIR)$(pkglibdir)/dracut-functions
cp -arx modules.d $(DESTDIR)$(pkglibdir)
install -m 0644 dracut.8 $(DESTDIR)$(mandir)/man8
install -m 0644 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
ifeq (1,${WITH_SWITCH_ROOT})
rm $(DESTDIR)$(pkglibdir)/modules.d/99base/switch_root
endif
clean:
rm -f *~
@@ -45,23 +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
rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" --define "_specdir $$PWD" --define "_srcrpmdir $$PWD" --define "_rpmdir $$PWD" --define "gittag $(GITVERSION)" -ba 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)
@@ -72,6 +107,10 @@ testimages: all
@echo wrote test-$(shell uname -r).img
./dracut -l -a debug --no-kernel -f test-dracut.img $(shell uname -r)
@echo wrote test-dracut.img
hostimage: all
./dracut -H -l -a debug -f test-$(shell uname -r).img $(shell uname -r)
@echo wrote test-$(shell uname -r).img
AUTHORS:
git shortlog --numbered --summary -e |while read a rest; do echo $$rest;done > AUTHORS

286
NEWS Normal file
View File

@@ -0,0 +1,286 @@
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
- lsinitrd and mkinitrd
- dmsquash: add support for loopmounted *.iso files
- lvm: add rd_LVM_LV and "--poll n"
- user suspend support
- add additional drivers in host-only mode, too
- improved emergency shell
- support for compressed kernel modules
- support for loading Xen modules
- rdloaddriver kernel command line parameter
- man pages for dracut-catimages and dracut-gencmdline
- bugfixes
dracut-003
==========
- add debian package modules
- add dracut.conf manpage
- add module 90multipath
- add module 01fips
- crypt: ignore devices in /etc/crypttab (root is not in there)
unless rd_NO_CRYPTTAB is specified
- kernel-modules: add scsi_dh scsi_dh_rdac scsi_dh_emc
- add multinic support
- add s390 zfcp support
- add s390 dasd support
- add s390 network support
- fixed dracut-gencmdline for root=UUID or LABEL
- do not destroy assembled raid arrays if mdadm.conf present
- mount /dev/shm
- let udevd not resolve group and user names
- moved network from udev to initqueue
- improved debug output: specifying "rdinitdebug" now logs
to dmesg, console and /init.log
- strip kernel modules which have no x bit set
- redirect stdin, stdout, stderr all RW to /dev/console
so the user can use "less" to view /init.log and dmesg
- add new device mapper udev rules and dmeventd
- fixed dracut-gencmdline for root=UUID or LABEL
- do not destroy assembled raid arrays if mdadm.conf present
- mount /dev/shm
- let udevd not resolve group and user names
- preserve timestamps of tools on initramfs generation
- generate symlinks for binaries correctly
- moved network from udev to initqueue
- mount nfs3 with nfsvers=3 option and retry with nfsvers=2
- fixed nbd initqueue-finished
- improved debug output: specifying "rdinitdebug" now logs
to dmesg, console and /init.log
- strip kernel modules which have no x bit set
- redirect stdin, stdout, stderr all RW to /dev/console
so the user can use "less" to view /init.log and dmesg
- make install of new dm/lvm udev rules optionally
- add new device mapper udev rules and dmeventd
- Fix LiveCD boot regression
- bail out if selinux policy could not be loaded and
selinux=0 not specified on kernel command line
- do not cleanup dmraids
- copy over lvm.conf
dracut-002
==========
- add ifname= argument for persistent netdev names
- new /initqueue-finished to check if the main loop can be left
- copy mdadm.conf if --mdadmconf set or mdadmconf in dracut.conf
- plymouth: use plymouth-populate-initrd
- add add_drivers for dracut and dracut.conf
- add modprobe scsi_wait_scan to be sure everything was scanned
- fix for several problems with md raid containers
- fix for selinux policy loading
- fix for mdraid for IMSM
- fix for bug, which prevents installing 61-persistent-storage.rules (bug #520109)
- fix for missing grep for md
dracut-001
==========
- better --hostonly checks
- better lvm/mdraid/dmraid handling
- fcoe booting support
Supported cmdline formats:
fcoe=<networkdevice>:<dcb|nodcb>
fcoe=<macaddress>:<dcb|nodcb>
Note currently only nodcb is supported, the dcb option is reserved for
future use.
Note letters in the macaddress must be lowercase!
Examples:
fcoe=eth0:nodcb
fcoe=4A:3F:4C:04:F8:D7:nodcb
- Syslog support for dracut
This module provides syslog functionality in the initrd.
This is especially interesting when complex configuration being
used to provide access to the device the rootfs resides on.
dracut-0.9
==========
- let plymouth attach to the terminal (nice text output now)
- new kernel command line parameter "rdinfo" show dracut output, even when
"quiet" is specified
- rd_LUKS_UUID is now handled correctly
- dracut-gencmdline: rd_LUKS_UUID and rd_MD_UUID is now correctly generated
- now generates initrd-generic with around 15MB
- smaller bugfixes
dracut-0.8
==========
- iSCSI with username and password
- support for live images (dmsquashed live images)
- iscsi_firmware fixes
- smaller images
- bugfixes
dracut-0.7
==========
- dracut: strip binaries in initramfs
--strip
strip binaries in the initramfs (default)
--nostrip
do not strip binaries in the initramfs
- dracut-catimages
Usage: ./dracut-catimages [OPTION]... <initramfs> <base image>
[<image>...]
Creates initial ramdisk image by concatenating several images from the
command
line and /boot/dracut/
-f, --force Overwrite existing initramfs file.
-i, --imagedir Directory with additional images to add
(default: /boot/dracut/)
-o, --overlaydir Overlay directory, which contains files that
will be used to create an additional image
--nooverlay Do not use the overlay directory
--noimagedir Do not use the additional image directory
-h, --help This message
--debug Output debug information of the build process
-v, --verbose Verbose output during the build process
- s390 dasd support
dracut-0.6
==========
- dracut: add --kernel-only and --no-kernel arguments
--kernel-only
only install kernel drivers and firmware files
--no-kernel
do not install kernel drivers and firmware files
All kernel module related install commands moved from "install"
to "installkernel".
For "--kernel-only" all installkernel scripts of the specified
modules are used, regardless of any checks, so that all modules
which might be needed by any dracut generic image are in.
The basic idea is to create two images. One image with the kernel
modules and one without. So if the kernel changes, you only have
to replace one image.
Grub and the kernel can handle multiple images, so grub entry can
look like this:
title Fedora (2.6.29.5-191.fc11.i586)
root (hd0,0)
kernel /vmlinuz-2.6.29.5-191.fc11.i586 ro rhgb quiet
initrd /initrd-20090722.img /initrd-kernel-2.6.29.5-191.fc11.i586.img /initrd-config.img
initrd-20090722.img
the image provided by the initrd rpm
one old backup version is kept like with the kernel
initrd-kernel-2.6.29.5-191.fc11.i586.img
the image provided by the kernel rpm
initrd-config.img
optional image with local configuration files
- dracut: add --kmoddir directory, where to look for kernel modules
-k, --kmoddir [DIR]
specify the directory, where to look for kernel modules
dracut-0.5
==========
- more generic (all plymouth modules, all keyboards, all console fonts)
- more kernel command line parameters (see also man dracut(8))
- a helper tool, which generates the kernel command line (dracut-gencmdline)
- bridged network boot
- a lot of new command line parameter
dracut-0.4
==========
- bugfixes
- firmware loading support
- new internal queue (initqueue)
initqueue now loops until /dev/root exists or root is mounted
init now has the following points to inject scripts:
/cmdline/*.sh
scripts for command line parsing
/pre-udev/*.sh
scripts to run before udev is started
/pre-trigger/*.sh
scripts to run before the main udev trigger is pulled
/initqueue/*.sh
runs in parallel to the udev trigger
Udev events can add scripts here with /sbin/initqueue.
If /sbin/initqueue is called with the "--onetime" option, the script
will be removed after it was run.
If /initqueue/work is created and udev >= 143 then this loop can
process the jobs in parallel to the udevtrigger.
If the udev queue is empty and no root device is found or no root
filesystem was mounted, the user will be dropped to a shell after
a timeout.
Scripts can remove themselves from the initqueue by "rm $job".
/pre-mount/*.sh
scripts to run before the root filesystem is mounted
NFS is an exception, because it has no device node to be created
and mounts in the udev events
/mount/*.sh
scripts to mount the root filesystem
NFS is an exception, because it has no device node to be created
and mounts in the udev events
If the udev queue is empty and no root device is found or no root
filesystem was mounted, the user will be dropped to a shell after
a timeout.
/pre-pivot/*.sh
scripts to run before the real init is executed and the initramfs
disappears
All processes started before should be killed here.
The behaviour of the dmraid module demonstrates how to use the new
mechanism. If it detects a device which is part of a raidmember from a
udev rule, it installs a job to scan for dmraid devices, if the udev
queue is empty. After a scan, it removes itsself from the queue.
dracut-0.3
==========
- first public version

10
README
View File

@@ -21,8 +21,10 @@ as hooks are guaranteed to be the path to slow-down.
Most of the initrd generation functionality in dracut is provided by a bunch
of generator modules that are sourced by the main dracut script to install
specific functionality into the initrd. They live in the modules.d subdirectory,
and use functionality provided by dracut-functions to do their work.
specific functionality into the initrd. They live in the modules.d
subdirectory, and use functionality provided by dracut-functions to do their
work.
Some general rules for writing modules:
* Use one of the inst family of functions to actually install files
on to the initrd. They handle mangling the pathnames and (for binaries,
@@ -59,13 +61,13 @@ the documentation, git access, etc.
Git Repository:
http://dracut.git.sourceforge.net/
git://dracut.git.sourceforge.net/gitroot/dracut
git://dracut.git.sourceforge.net/gitroot/dracut/dracut
Trac Instance:
http://apps.sourceforge.net/trac/dracut/
The git tree can be found at
git://dracut.git.sourceforge.net/gitroot/dracut for now. See the TODO
git://dracut.git.sourceforge.net/gitroot/dracut/dracut for now. See the TODO
file for things which still need to be done and HACKING for some
instructions on how to get started. There is also a mailing list that
is being used for the discussion -- initramfs@vger.kernel.org. It is

View File

@@ -8,3 +8,6 @@ To build a generic initramfs, you have to install the following software package
* mdadm
* net-tools iproute
Generic initramfs'es are huge (usually over 10 megs in size uncompressed), but
should be able to automatically boot any bootable configuration with appropriate
boot flags (root device, network configuration information, etc.)

View File

@@ -35,7 +35,7 @@ check: Dracut calls this program to check and see if a module can be installed
are present. It should exit with a 0 if they are, and a 1 if they are
not.
When called with -H, it should perform the same check that it would
When called with -h, it should perform the same check that it would
without any options, and it should also check to see if the
functionality the module implements is being used on the host system.
For example, if this module handles installing support for LUKS
@@ -43,9 +43,12 @@ check: Dracut calls this program to check and see if a module can be installed
encrpted volumes are available and the host system has the root
partition on an encrypted volume, 1 otherwise.
When called with -d, it should output a list of dracut modules
that it relies upon. An example would be the nfs and iscsi modules,
which rely on the network module to detect and configure network
interfaces.
Check may take additional options in the future.
We will most likely grow a module dependency checking system in the
near future, and check will need to handle a -d option when we do.
Any other files in the module will not be touched by dracut directly.

53
debian/changelog vendored Normal file
View File

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

1
debian/compat vendored Normal file
View File

@@ -0,0 +1 @@
5

40
debian/control vendored Normal file
View File

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

39
debian/copyright vendored Normal file
View File

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

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

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

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

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

22
debian/dracut.dirs vendored Normal file
View File

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

4
debian/dracut.docs vendored Normal file
View File

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

25
debian/dracut.install vendored Normal file
View File

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

2
debian/dracut.manpages vendored Normal file
View File

@@ -0,0 +1,2 @@
dracut.8
dracut.conf.5

8
debian/dracut.postinst vendored Normal file
View File

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

1
debian/dracut.triggers vendored Normal file
View File

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

3
debian/rules vendored Executable file
View File

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

222
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 ^
@@ -34,7 +36,14 @@ Creates initial ramdisk images for preloading modules
-o, --omit [LIST] Omit a space-separated list of dracut modules.
-a, --add [LIST] Add a space-separated list of dracut modules.
-d, --drivers [LIST] Specify a space-separated list of kernel modules to
include in the initramfs.
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.
-k, --kmoddir [DIR] Specify the directory, where to look for kernel
modules
--fwdir [DIR] Specify additional directories, where to look for
@@ -43,6 +52,10 @@ Creates initial ramdisk images for preloading modules
--no-kernel Do not install kernel drivers and firmware files
--strip Strip binaries in the initramfs (default)
--nostrip Do not strip binaries in the initramfs
--mdadmconf Include local /etc/mdadm.conf
--nomdadmconf Do not include local /etc/mdadm.conf
--lvmconf Include local /etc/lvm/lvm.conf
--nolvmconf Do not include local /etc/lvm/lvm.conf
-h, --help This message
--debug Output debug information of the build process
-v, --verbose Verbose output during the build process
@@ -69,18 +82,26 @@ while (($# > 0)); do
-o|--omit) omit_dracutmodules_l="$2"; shift;;
-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;;
--kernel-only) kernel_only="yes"; nokernel="no";;
--kernel-only) kernel_only="yes"; no_kernel="no";;
--no-kernel) kernel_only="no"; no_kernel="yes";;
--strip) do_strip_l="yes";;
--nostrip) do_strip_l="no";;
--mdadmconf) mdadmconf_l="yes";;
--nomdadmconf) mdadmconf_l="no";;
--lvmconf) lvmconf_l="yes";;
--nolvmconf) lvmconf_l="no";;
-h|--help) usage; exit 1 ;;
--debug) debug="yes";;
-v|--verbose) beverbose="yes";;
-c|--conf) conffile="$2"; shift;;
--confdir) confdir="$2"; shift;;
-l|--local) allowlocal="yes" ;;
-H|--hostonly) hostonly="-h" ;;
-H|--hostonly) hostonly_l="yes" ;;
-i|--include) include_src="$2"; include_target="$3"; shift 2;;
-I|--install) install_items="$2"; shift;;
-*) printf "\nUnknown option: %s\n\n" "$1" >&2; usage; exit 1;;
@@ -89,117 +110,183 @@ while (($# > 0)); do
shift
done
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
PATH=/sbin:/bin:/usr/sbin:/usr/bin
export PATH
unset LD_LIBRARY_PATH
unset GREP_OPTIONS
[[ $debug ]] && {
export PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): ';
set -x
}
[[ $dracutbasedir ]] || dracutbasedir=/usr/share/dracut
[[ $allowlocal && -f "$(readlink -f $(dirname $0))/dracut-functions" ]] && dracutbasedir="$(dirname $0)"
# if we were not passed a config file, try the default one
[[ ! -f $conffile ]] && conffile="/etc/dracut.conf"
if [[ ! -f $conffile ]]; then
[[ $allowlocal ]] || conffile="/etc/dracut.conf"
[[ $allowlocal ]] && conffile="$dracutbasedir/dracut.conf"
fi
if [[ ! -d $confdir ]]; then
[[ $allowlocal ]] || confdir="/etc/dracut.conf.d"
[[ $allowlocal ]] && confdir="$dracutbasedir/dracut.conf.d"
fi
# source our config dir
if [ "$confdir" ] && [ -d "$confdir" ]; then
for f in "$confdir"/*.conf; do
[ -e "$f" ] && . "$f"
done
fi
# source our config file
[[ -f $conffile ]] && . "$conffile"
# 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
[[ $filesystems_l ]] && filesystems=$filesystems_l
[[ $drivers_dir_l ]] && drivers_dir=$drivers_dir_l
[[ $fw_dir_l ]] && fw_dir=$fw_dir_l
[[ $do_strip_l ]] && do_strip=$do_strip_l
[[ $hostonly_l ]] && hostonly=$hostonly_l
[[ $mdadmconf_l ]] && mdadmconf=$mdadmconf_l
[[ $lvmconf_l ]] && lvmconf=$lvmconf_l
[[ $dracutbasedir ]] || dracutbasedir=/usr/share/dracut
[[ $fw_dir ]] || fw_dir=/lib/firmware
[[ $do_strip ]] || do_strip=yes
# eliminate IFS hackery when messing with fw_dir
fw_dir=${fw_dir//:/ }
[[ $allowlocal && -f "$(dirname $0)/dracut-functions" ]] && dsrc="$(dirname $0)" || dsrc=$dracutbasedir
[[ $hostonly = yes ]] && hostonly="-h"
[[ $hostonly != "-h" ]] && unset hostonly
if [[ -f $dsrc/dracut-functions ]]; then
. $dsrc/dracut-functions
if [[ -f $dracutbasedir/dracut-functions ]]; then
. $dracutbasedir/dracut-functions
else
echo "Cannot find $dsrc/dracut-functions. Are you running from a git checkout?"
echo "Cannot find $dracutbasedir/dracut-functions. Are you running from a git checkout?"
echo "Try passing -l as an argument to $0"
exit 1
fi
dracutfunctions=$dsrc/dracut-functions
dracutfunctions=$dracutbasedir/dracut-functions
export dracutfunctions
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/initrd-$kernel.img"
[[ $1 ]] && outfile=$1 || outfile="/boot/initramfs-$kernel.img"
abs_outfile=$(readlink -f "$outfile") && outfile="$abs_outfile"
srcmods="/lib/modules/$kernel/"
[ -n "$drivers_dir" ] && srcmods="$drivers_dir"
[[ $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
hookdirs="cmdline pre-udev pre-trigger netroot pre-mount pre-pivot mount emergency"
outdir=$(dirname "$outfile")
if ! [[ -d "$outdir" ]]; then
derror "Can't write $outfile: Directory $outdir does not exist."
exit 1
fi
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)
trap 'rm -rf "$initdir"' 0 # clean up after ourselves no matter how we die.
trap 'ret=$?;rm -rf "$initdir";exit $ret;' EXIT # clean up after ourselves no matter how we die.
trap 'exit 1;' SIGINT # clean up after ourselves no matter how we die.
# Need to be able to have non-root users read stuff (rpcbind etc)
chmod 755 "$initdir"
export initdir hookdirs dsrc dracutmodules drivers \
fw_dir drivers_dir debug beverbose no_kernel kernel_only
export initdir hookdirs dracutbasedir dracutmodules drivers \
fw_dir drivers_dir debug beverbose no_kernel kernel_only \
add_drivers omit_drivers mdadmconf lvmconf filesystems
if [[ "$kernel_only" != "yes" ]]; then
if [[ $kernel_only != yes ]]; then
# Create some directory structure first
for d in bin sbin usr/bin usr/sbin usr/lib etc proc sys sysroot tmp dev/pts var/run; do
mkdir -p "$initdir/$d";
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
#source our modules.
for moddir in "$dsrc/modules.d"/[0-9][0-9]*; do
mod=${moddir##*/}; mod=${mod#[0-9][0-9]}
if strstr "$mods_to_load" " $mod "; then
if [[ "$kernel_only" = "yes" ]]; then
[[ -x "$moddir/installkernel" ]] && . "$moddir/installkernel"
modules_loaded=" "
# source our modules.
for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
_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"
if [[ "$no_kernel" != "yes" && -x "$moddir/installkernel" ]]; then
[[ -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
echo $mods_to_load
## final stuff that has to happen
# generate module dependencies for the initrd
if [ -d "$initdir/lib/modules/$kernel" ]; then
if [[ -d $initdir/lib/modules/$kernel ]]; then
if ! depmod -a -b "$initdir" $kernel; then
echo "\"depmod -a $kernel\" failed."
derror "\"depmod -a $kernel\" failed."
exit 1
fi
fi
# make sure that library links are correct and up to date
ldconfig -n -r "$initdir" /lib* /usr/lib*
if [[ $include_src && $include_target ]]; then
mkdir -p "$initdir$include_target"
cp -a -t "$initdir$include_target" "$include_src"/*
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
@@ -207,40 +294,53 @@ for item in $install_items; do
done
unset item
[[ "$beverbose" = "yes" ]] && (du -c "$initdir" | sort -n)
# 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
if [[ $do_strip = yes ]] ; then
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 \) -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" || :
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' \) ); 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 -H newc -o |gzip -9 > "$outfile"; )
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

@@ -70,7 +70,7 @@ done
outfile=$1; shift
if [ -z "$outfile" ]; then
if [[ -z $outfile ]]; then
derror "No output file specified."
usage
exit 1
@@ -78,45 +78,48 @@ fi
baseimage=$1; shift
if [ -z "$baseimage" ]; then
if [[ -z $baseimage ]]; then
derror "No base image specified."
usage
exit 1
fi
if [ -f $outfile -a -z "$force" ]; then
if [[ -f $outfile && ! $force ]]; then
derror "Will not override existing initramfs ($outfile) without --force"
exit 1
fi
if [ -z "$no_imagedir" -a ! -d "$imagedir" ]; then
if [[ ! $no_imagedir && ! -d $imagedir ]]; then
derror "Image directory $overlay is not a directory"
exit 1
fi
if [ -z "$no_overlay" -a ! -d "$overlay" ]; then
if [[ ! $no_overlay && ! -d $overlay ]]; then
derror "Overlay $overlay is not a directory"
exit 1
fi
if [ -z "$no_overlay" ]; then
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 [ -z "$no_imagedir" ]; then
images=$(for i in $imagedir/*.img;do [ -f $i ] || continue; echo $i; done)
if [[ ! $no_imagedir ]]; then
for i in "$imagedir/"*.img; do
[[ -f $i ]] && images+=("$i")
done
fi
images="$images $@"
images+=($@)
dinfo "Using base image $baseimage"
cat $baseimage > $outfile
cat "$baseimage" > "$outfile"
for i in $images; do
for i in "${images[@]}"; do
dinfo "Appending $i"
cat $i >> $outfile
cat "$i" >> "$outfile"
done
dinfo "Created $outfile"

52
dracut-catimages.8 Normal file
View File

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

View File

@@ -22,30 +22,228 @@ IF_RTLD=""
IF_dynamic=""
# Generic substring function. If $2 is in $1, return 0.
strstr() { [[ ! ${1#*$2*} = $1 ]]; }
strstr() { [[ $1 =~ $2 ]]; }
# Log initrd creation.
if ! [[ $dracutlogfile ]]; then
[[ $dsrc = /usr/share/dracut ]] && \
dracutlogfile=/var/log/dracut.log || \
dracutlogfile=/tmp/dracut.log
[[ -w "$dracutlogfile" ]] || dracutlogfile=/tmp/dracut.log
>"$dracutlogfile"
[[ $dracutbasedir = /usr/share/dracut ]] && \
dracutlogfile=/var/log/dracut.log || \
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() {
if [[ -x /lib/udev/vol_id ]]; then
eval $(/lib/udev/vol_id --export $1)
elif find_binary blkid >/dev/null; then
eval $(blkid -o udev $1)
else
return 1
fi
}
get_fs_type() (
get_fs_env $1 || return
echo $ID_FS_TYPE
)
get_fs_uuid() (
get_fs_env $1 || return
echo $ID_FS_UUID
)
# finds the major:minor of the block device backing the root filesystem.
find_block_device() {
local rootdev blkdev fs type opts misc
while read blkdev fs type opts misc; do
[[ $blkdev = rootfs ]] && continue # skip rootfs entry
[[ $fs = $1 ]] && { rootdev=$blkdev; break; } # we have a winner!
done < /proc/mounts
[[ -b $rootdev ]] || return 1 # oops, not a block device.
# get major/minor for the device
ls -nLl "$rootdev" | \
(read x x x x maj min x; maj=${maj//,/}; echo $maj:$min)
}
find_root_block_device() { find_block_device /; }
# Walk all the slave relationships for a given block device.
# Stop when our helper function returns success
# $1 = function to call on every found block device
# $2 = block device in major:minor format
check_block_and_slaves() {
local x
[[ -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
check_block_and_slaves $1 $(cat "$x") && return 0
done
return 1
}
get_numeric_dev() {
ls -lH "$1" | { read a b c d maj min rest; printf "%d:%d" ${maj%%,} $min;}
}
# ugly workaround for the lvm design
# There is no volume group device,
# so, there are no slave devices for volume groups.
# Logical volumes only have the slave devices they really live on,
# but you cannot create the logical volume without the volume group.
# And the volume group might be bigger than the devices the LV needs.
check_vol_slaves() {
for i in /dev/mapper/*; do
lv=$(get_numeric_dev $i)
if [[ $lv = $2 ]]; then
vg=$(lvm lvs --noheadings -o vg_name $i 2>/dev/null)
# strip space
vg=$(echo $vg)
if [[ $vg ]]; then
for pv in $(lvm vgs --noheadings -o pv_name "$vg" 2>/dev/null); \
do
check_block_and_slaves $1 $(get_numeric_dev $pv) \
&& return 0
done
fi
fi
done
return 1
}
# Install a directory, keeping symlinks as on the original system.
# 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() {
[[ -e ${initdir}/"$1" ]] && return 0 # already there
local _dir="$1" _part="${1%/*}" _file
while [[ "$_part" != "${_part%/*}" ]] && ! [[ -e "${initdir}/${_part}" ]]; do
_dir="$_part $_dir"
_part=${_part%/*}
done
# iterate over parent directories
for _file in $_dir; do
[[ -e "${initdir}/$_file" ]] && continue
if [[ -L $_file ]]; then
inst_symlink "$_file"
else
# create directory
mkdir -m 0755 -p "${initdir}/$_file" || return 1
[[ -e "$_file" ]] && chmod --reference="$_file" "${initdir}/$_file"
chmod u+w "${initdir}/$_file"
fi
done
}
# $1 = file to copy to ramdisk
@@ -53,27 +251,37 @@ derror() {
# 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="${initdir}${2:-$1}"
[[ -f $target ]] && return 0
mkdir -p "${target%/*}"
src=$1 target="${2:-$1}"
if ! [[ -d ${initdir}$target ]]; then
[[ -e ${initdir}$target ]] && return 0
inst_dir "${target%/*}"
fi
# install checksum files also
if [[ -e "${src%/*}/.${src##*/}.hmac" ]]; then
inst "${src%/*}/.${src##*/}.hmac" "${target%/*}/.${target##*/}.hmac"
fi
dinfo "Installing $src"
cp -fL "$src" "$target"
cp -pfL "$src" "${initdir}$target"
}
# Same as above, but specialzed to handle dynamic libraries.
# Same as above, but specialized to handle dynamic libraries.
# It handles making symlinks according to how the original library
# is referenced.
inst_library() {
local src=$1 dest=${2:-$1}
[[ -f $initdir$dest ]] && return 0
[[ -e $initdir$dest ]] && return 0
if [[ -L $src ]]; then
reallib="$(readlink -f "$src")"
# 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"
mkdir -p ${initdir}${dest%/*}
(cd "${initdir}${dest%/*}" && ln -s "$reallib" "$lib")
inst_dir "${dest%/*}"
ln_r "$reallib" "$dest"
else
inst_simple "$src" "$dest"
fi
@@ -83,7 +291,7 @@ inst_library() {
# search in the usual places to find the binary.
find_binary() {
local binpath="/bin /sbin /usr/bin /usr/sbin" p
[[ -x $1 ]] && { echo $1; return 0; }
[[ -z ${1##/*} && -x $1 ]] && { echo $1; return 0; }
for p in $binpath; do
[[ -x $p/$1 ]] && { echo "$p/$1"; return 0; }
done
@@ -96,10 +304,11 @@ inst_binary() {
local bin target
bin=$(find_binary "$1") || return 1
target=${2:-$bin}
inst_symlink $bin $target && return 0
local LDSO NAME IO FILE ADDR I1 n f TLIBDIR
[[ -f $initdir$target ]] && return 0
[[ -e $initdir$target ]] && return 0
# I love bash!
ldd $bin 2>/dev/null | while read line; do
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."
@@ -110,20 +319,20 @@ inst_binary() {
so_regex='([^ ]*/lib[^/]*/[^ ]*\.so[^ ]*)'
[[ $line =~ $so_regex ]] || continue
FILE=${BASH_REMATCH[1]}
[[ -f ${initdir}$FILE ]] && continue
[[ -e ${initdir}$FILE ]] && continue
# see if we are loading an optimized version of a shared lib.
lib_regex='^(/lib[^/]*).*'
if [[ $FILE =~ $lib_regex ]]; then
TLIBDIR=${BASH_REMATCH[1]}
BASE="${FILE##*/}"
BASE=${FILE##*/}
# prefer nosegneg libs, then unoptimized ones.
for f in "$TLIBDIR/i686/nosegneg" "$TLIBDIR"; do
[[ -f $f/$BASE ]] || continue
FILE="$f/$BASE"
[[ -e $f/$BASE ]] || continue
FILE=$f/$BASE
break
done
inst_library "$FILE" "$TLIBDIR/$BASE"
IF_dynamic="yes"
IF_dynamic=yes
continue
fi
inst_library "$FILE"
@@ -146,18 +355,28 @@ 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 rule in the usual places.
# find a udev rule in the usual places.
find_rule() {
[[ -f $1 ]] && { echo "$1"; return 0; }
for r in . /lib/udev/rules.d /etc/udev/rules.d $dsrc/rules.d; do
for r in . /lib/udev/rules.d /etc/udev/rules.d $dracutbasedir/rules.d; do
[[ -f $r/$1 ]] && { echo "$r/$1"; return 0; }
done
return 1
@@ -166,10 +385,11 @@ find_rule() {
# udev rules always get installed in the same place, so
# create a function to install them to make life simpler.
inst_rules() {
local target="/etc/udev/rules.d"
mkdir -p "$initdir/lib/udev/rules.d" "$initdir$target"
local target=/etc/udev/rules.d
inst_dir "/lib/udev/rules.d"
inst_dir "$target"
for rule in "$@"; do
rule=$(find_rule $rule) && \
rule=$(find_rule "$rule") && \
inst_simple "$rule" "$target/${rule##*/}"
done
}
@@ -177,10 +397,21 @@ inst_rules() {
# general purpose installation function
# Same args as above.
inst() {
if (($# != 1 && $# != 2 )); then
derror "inst only takes 1 or 2 arguments"
exit 1
fi
case $# in
1) ;;
2)
[[ -z $initdir ]] && [[ -d $2 ]] && export initdir=$2
[[ $initdir = $2 ]] && set $1
;;
3)
[[ -z $initdir ]] && export initdir=$2
set $1 $3
;;
*)
derror "inst only takes 1 or 2 or 3 arguments"
exit 1
;;
esac
for x in inst_symlink inst_script inst_binary inst_simple; do
$x "$@" && return 0
done
@@ -203,34 +434,29 @@ inst_hook() {
}
dracut_install() {
local optional=
if [[ $1 = '-o' ]]; then
local optional=yes
shift
fi
while (($# > 0)); do
# Might be nice to optionally install a binary
if [ "$1" == "-o" ]; then
optional="yes"
shift
continue
fi
if inst "$1" ; then
shift
continue
fi
if [ "$optional" == "yes" ]; then
dwarning "Skipping program $1 as it cannot be found and is flagged to be optional"
shift
continue
else
derror "Failed to install $1"; exit 1
fi
if ! inst "$1" ; then
if [[ $optional = yes ]]; then
dinfo "Skipping program $1 as it cannot be found and is flagged to be optional"
else
derror "Failed to install $1"
exit 1
fi
fi
shift
done
}
check_module_deps() {
local moddir dep ret
# if we are already set to be loaded, we do not have to be checked again.
strstr "$mods_to_load" " $1 "
strstr "$mods_to_load" " $1 " && return
# turn a module name into a directory, if we can.
moddir=$(echo ${dsrc}/modules.d/??${1})
moddir=$(echo ${dracutbasedir}/modules.d/??${1})
[[ -d $moddir && -x $moddir/install ]] || return 1
# if we do not have a check script, we are unconditionally included
if [[ -x $moddir/check ]]; then
@@ -249,22 +475,24 @@ check_module_deps() {
should_source_module() {
local dep
[[ -x $1/install ]] || return 1
if [[ "$kernel_only" = "yes" ]]; then
if [[ $kernel_only = yes ]]; then
[[ -x $1/installkernel ]] && return 0
return 1
fi
[[ -x $1/install ]] || [[ -x $1/installkernel ]] || return 1
[[ -x $1/check ]] || return 0
"$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() {
for moddir in "$dsrc/modules.d"/[0-9][0-9]*; do
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.
strstr "$mods_to_load" " $mod " && continue
@@ -278,18 +506,114 @@ 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 kernel modules, and handle installing all their dependencies as well.
# Install a single kernel module along with any firmware it may require.
# $1 = full path to kernel module to install
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 $?
for fw in $(modinfo -k $kernel -F firmware $1 2>/dev/null); do
found=''
for fwdir in $fw_dir; do
if [[ -d $fwdir && -f $fwdir/$fw ]]; then
inst_simple "$fwdir/$fw" "/lib/firmware/$fw"
found=yes
fi
done
if [[ $found != yes ]]; then
dinfo "Possible missing firmware \"${fw}\" for kernel module \"${mod}.ko\""
fi
done
return 0
}
# Do something with all the dependencies of a kernel module.
# Note that kernel modules depend on themselves using the technique we use
# $1 = function to call for each dependency we find
# It will be passed the full path to the found kernel module
# $2 = module to get dependencies for
# rest of args = arguments to modprobe
for_each_kmod_dep() {
local func=$1 kmod=$2 cmd modpapth options
shift 2
modprobe "$@" --ignore-install --show-depends $kmod 2>/dev/null | ( \
local found=0;
while read cmd modpath options; do
[[ $cmd = insmod ]] || continue
$func ${modpath} || exit $?
found=1
done; [[ $found -eq 0 ]] && exit 1; exit 0;)
return $?
}
# filter kernel modules to install certain modules that meet specific
# requirements.
# $1 = function to call with module name to filter.
# This function will be passed the full path to the module to test.
# The behaviour of this function can vary depending on whether $hostonly is set.
# If it is, we will only look at modules that are already in memory.
# If it is not, we will look at all kernel modules
# This function returns the full filenames of modules that match $1
filter_kernel_modules () (
if ! [[ $hostonly ]]; then
filtercmd='find "$srcmods/kernel/drivers" "$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
for modname in $(eval $filtercmd); do
case $modname in
*.ko)
"$1" "$modname" && echo "$modname"
;;
*.ko.gz)
gzip -dc "$modname" > $initdir/$$.ko
$1 $initdir/$$.ko && echo "$modname"
rm -f $initdir/$$.ko
;;
esac
done
)
# install kernel modules along with all their dependencies.
instmods() {
[[ "$no_kernel" = "yes" ]] && return
[[ $no_kernel = yes ]] && return
local mod mpargs modpath modname cmd
local ret=0
while (($# > 0)); do
mod=${1%.ko}
mod=${1%.ko*}
case $mod in
=*) # This introduces 2 incompatible meanings for =* arguments
# to instmods. We need to decide which one to keep.
if [ "$mod" = "=ata" -a -f $srcmods/modules.block ] ; then
if [[ $mod = =ata && -f $srcmods/modules.block ]] ; then
instmods $mpargs $(egrep 'ata|ahci' "${srcmods}/modules.block")
elif [ -f $srcmods/modules.${mod#=} ]; then
instmods $mpargs $(cat ${srcmods}/modules.${mod#=} )
@@ -297,49 +621,41 @@ instmods() {
instmods $mpargs $(find "$srcmods" -path "*/${mod#=}/*")
fi
;;
--*) mpargs+=" $mod";;
--*)
mod=${mod##*/}
mpargs+=" $mod";;
i2o_scsi)
# Must never run this diagnostic-only module
shift; continue;
;;
*) mod=${mod##*/}
# if we are already installed, skip this module and go on
*)
# 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 && {
[[ $hostonly ]] && ! grep -q "${mod//-/_}" /proc/modules && \
! echo $add_drivers | grep -qe "\<${mod}\>" && {
shift; continue;
}
modprobe $mpargs --ignore-install --set-version $kernel -d ${srcmods%%/lib/modules/*}/ \
--show-depends $mod 2>/dev/null | \
while read cmd modpath options; do
[[ $cmd = insmod ]] || continue
modname=${modpath##*/}
modname=${modname%.ko}
if [[ ${mod/-/_} != ${modname/-/_} ]]; then
dinfo "Installing dependencies for $mod ($modpath)"
instmods $mpargs $modname
fi
inst_simple "$modpath" "/lib/modules/$kernel/${modpath##*/lib/modules/$kernel/}"
for fw in $(modinfo -k $kernel -F firmware $modpath 2>/dev/null); do
unset found
IFS=:
for fwdir in $fw_dir; do
if [ -d "$fwdir" -a -f $fwdir/$fw ]; then
inst_simple "$fwdir/$fw" "/lib/firmware/$fw"
found=yes
fi
done
if [ "$found" != "yes" ]; then
dwarning "Possible missing firmware ${fw} for module ${mod}.ko"
fi
done
done
;;
# ok, load the module, all its dependencies, and any firmware
# 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

View File

@@ -19,24 +19,46 @@
#
#. /usr/libexec/initrd-functions
IF_verbose=""
function set_verbose() {
case $1 in
1|true|yes|on)
IF_verbose="-v"
;;
0|false|no|off)
IF_verbose=""
;;
esac
}
function is_verbose() {
[ -n "$IF_verbose" ] && return 0
return 1
}
function get_verbose() {
echo "$IF_verbose"
is_verbose
}
function get_numeric_dev() {
(
fmt="%d:%d"
if [ "$1" == "hex" ]; then
fmt="%x:%x"
fi
ls -lH "$2" | awk '{ sub(/,/, "", $5); printf("'"$fmt"'", $5, $6); }'
) 2>/dev/null
}
function error() {
local NONL=""
if [ "$1" == "-n" ]; then
NONL="-n"
shift
fi
echo $NONL "$@" >&2
echo "$@" >&2
}
function vecho() {
return
local NONL=""
if [ "$1" == "-n" ]; then
NONL="-n"
shift
fi
is_verbose && echo $NONL "$@"
is_verbose && echo "$@"
}
# module dep finding and installation functions
@@ -52,18 +74,11 @@ moduledep() {
[ -n "$deps" ] && vecho ": $deps" || vecho
}
if [ $UID != 0 ]; then
error "$0 must be run as root."
exit 1
fi
export MALLOC_PERTURB_=204
PATH=/sbin:/usr/sbin:/bin:/usr/bin:$PATH
export PATH
. /etc/rc.d/init.d/functions
# Set the umask. For iscsi, the initrd can contain plaintext
# password (chap secret), so only allow read by owner.
umask 077
@@ -137,13 +152,21 @@ qpopd() {
popd >/dev/null 2>&1
}
resolve_device_name() {
echo "$1"
# echo "resolve_device_name $1" 1>&2
}
freadlink() {
/usr/bin/readlink -f "$1"
readlink -f "$1"
}
resolve_device_name() {
if [ -z "${1##UUID=*}" ]; then
real=$(freadlink /dev/disk/by-uuid/${1##UUID=})
[ -b $real ] && { echo $real; return; }
fi
if [ -z "${1##LABEL=*}" ]; then
real=$(freadlink /dev/disk/by-label/${1##LABEL=})
[ -b $real ] && { echo $real; return; }
fi
echo "$1"
}
finddevnoinsys() {
@@ -189,7 +212,7 @@ findstoragedriverinsys () {
sysfs=$(freadlink ${sysfs%/*})
fi
if [[ ! "$sysfs" =~ '^/sys/.*block/.*$' ]]; then
if [[ ! "$sysfs" =~ ^/sys/.*block/.*$ ]]; then
#error "WARNING: $sysfs is a not a block sysfs path, skipping"
return
fi
@@ -200,12 +223,12 @@ findstoragedriverinsys () {
*) handleddevices="$handleddevices $sysfs" ;;
esac
if [[ "$sysfs" =~ '^/sys/.*block/md[0-9]+$' ]]; then
if [[ "$sysfs" =~ ^/sys/.*block/md[0-9]+$ ]]; then
local raid=${sysfs##*/}
vecho "Found MDRAID component $raid"
handleraid $raid
fi
if [[ "$sysfs" =~ '^/sys/.*block/dm-[0-9]+$' ]]; then
if [[ "$sysfs" =~ ^/sys/.*block/dm-[0-9]+$ ]]; then
vecho "Found DeviceMapper component ${sysfs##*/}"
handledm $(cat $sysfs/dev |cut -d : -f 1) $(cat $sysfs/dev |cut -d : -f 2)
fi
@@ -589,9 +612,7 @@ done
else
# check if it's root by label
rdev=$rootdev
if [[ "$rdev" =~ ^(UUID=|LABEL=) ]]; then
rdev=$(resolve_device_name "$rdev")
fi
rdev=$(resolve_device_name "$rdev")
rootopts=$(echo $rootopts | sed -e 's/^r[ow],//' -e 's/,_netdev//' -e 's/_netdev//' -e 's/,r[ow],$//' -e 's/,r[ow],/,/' -e 's/^r[ow]$/defaults/' -e 's/$/,ro/')
findstoragedriver "$rdev"
fi
@@ -600,9 +621,7 @@ done
[ -z "$thawdev" ] && thawdev=$(awk '/^[ \t]*[^#]/ { if ($3 == "swap") { print $1; exit }}' $fstab)
swsuspdev="$thawdev"
if [ -n "$swsuspdev" ]; then
if [[ "$swsuspdev" =~ ^(UUID=|LABEL=) ]]; then
swsuspdev=$(resolve_device_name "$swsuspdev")
fi
swsuspdev=$(resolve_device_name "$swsuspdev")
findstoragedriver "$swsuspdev"
fi
@@ -643,36 +662,41 @@ emitcrypto()
if [ -z "$luksuuid" ]; then
luksuuid="$2"
fi
luksuuid=${luksuuid##UUID=}
echo -n "rd_LUKS_UUID=$luksuuid "
}
for cryptdev in ${!cryptopart@} ; do
emitcrypto `eval echo '$'$cryptdev`
done
if [ -n "$raiddevices" ]; then
for dev in $raiddevices; do
echo -n "rd_MD_UUID=${dev} "
uid=$(udevadm info --query=env --name /dev/${dev}|grep MD_UUID)
uid=${uid##MD_UUID=}
[ -n "$uid" ] && echo -n "rd_MD_UUID=$uid "
done
else
echo -n "rd_NO_MD "
fi
for cryptdev in ${!cryptoraid@} ; do
emitcrypto `eval echo '$'$cryptdev`
done
if [ -z "$nolvm" -a -n "$vg_list" ]; then
for vg in $vg_list; do
echo -n "rd_LVM_VG=$vg "
done
else
echo -n "rd_NO_LVM "
fi
for cryptdev in ${!cryptolv@} ; do
emitcrypto `eval echo '$'$cryptdev`
done
cryptdevs="$(echo ${!cryptoraid@} ${!cryptopart@} ${!cryptolv@})"
if [ -z "$cryptdevs" ]; then
echo -n "rd_NO_LUKS "
else
for cryptdev in ${!cryptoraid@} ${!cryptopart@} ${!cryptolv@} ; do
emitcrypto `eval echo '$'$cryptdev`
done
fi
# output local keyboard/18n settings
. /etc/sysconfig/keyboard
. /etc/sysconfig/i18n
[ -e /etc/sysconfig/keyboard ] && . /etc/sysconfig/keyboard
[ -e /etc/sysconfig/i18n ] && . /etc/sysconfig/i18n
for i in KEYTABLE SYSFONT SYSFONTACM UNIMAP LANG; do
val=$(eval echo \$$i)
@@ -687,13 +711,5 @@ if [ -n "$rootdev" ]; then
echo -n "root=$rootdev "
fi
if [ -L /usr/share/plymouth/themes/default.plymouth ]; then
theme=$(basename \
$(dirname \
$(readlink -f \
/usr/share/plymouth/themes/default.plymouth)))
[ -n "$theme" ] && echo -n "rd_plytheme=$theme "
fi
echo
# vim:ts=8:sw=4:sts=4:et

20
dracut-gencmdline.8 Normal file
View File

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

1764
dracut-rhel6.xml Normal file

File diff suppressed because it is too large Load Diff

558
dracut-update-initramfs Executable file
View File

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

452
dracut.8
View File

@@ -1,16 +1,16 @@
.TH DRACUT 8 "June 2009" "Linux"
.SH NAME
switch_root \- switch to another filesystem as the root of the mount tree.
dracut \- create initial ramdisk images for preloading modules
.SH SYNOPSIS
\fBdracut\fR [\fIOPTION\fR]... \fI<image>\fR \fI<kernel-version>\fR
.SH DESCRIPTION
.B switch_root
\fBdracut\fR creates an initial image used by the kernel for
.B dracut
creates an initial image used by the kernel for
preloading the block device modules (such as IDE, SCSI or RAID)
which are needed to access the root filesystem.
.SH OPTIONS
.SS Options
.TP
.BR \-f ", " \-\-force
overwrite existing initramfs file.
@@ -28,7 +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 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.
.TP
.BR \-k ", " \-\-kmoddir " \fI{DIR}\fR
specify the directory, where to look for kernel modules
@@ -42,6 +62,12 @@ only install kernel drivers and firmware files
.BR \-\-no-kernel
do not install kernel drivers and firmware files
.TP
.BR \-\-mdadmconf
include local /etc/mdadm.conf
.TP
.BR \-\-nomdadmconf
do not include local /etc/mdadm.conf
.TP
.BR \-\-strip
strip binaries in the initramfs (default)
.TP
@@ -62,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
@@ -79,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
@@ -88,111 +119,257 @@ with the appropriate label, and mount that device as the root filesystem.
\fBroot=UUID=uuidnumber\fR will mount the partition with that UUID as the
root filesystem.
.SH Standard
.SS Standard
.TP
.B init=<path to real init>
.BR init= "<path to real init>"
.TP
.B root=<path to blockdevice>
specify e.g. \fI/dev/sda1\fR or
\fI/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1\fR
.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
.BR rootfstype= "<filesystem type>"
"auto" if not specified, e.g. rootfstype=ext3
.TP
.BR rootflags= "<mount options>"
specify additional mount options for the root filesystem. If not set, /etc/fstab
of the real root will be parsed for special mount options and mounted
accordingly.
.TP
\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
e.g. LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=de-latin1-nodeadkeys
.SS Misc
.TP
.B KEYBOARDTYPE=sun|pc
.BR hostname= "<hostname>"
set the initial hostname
.TP
.BR rdblacklist= "<drivername>"
do not load kernel module <drivername>
This parameter can be specified multiple times.
.TP
.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.
Default: rd_retry=40
.SS Debug
.TP
.B rdinfo
print informational output though "quiet" is set
.TP
.B rdshell
allow dropping to a shell, if root mounting fails
.TP
.B rdinitdebug
set -x for the dracut shell and logs to dmesg, console and /init.log
.TP
.B rdbreak
drop to a shell at the end
.TP
.ad l
.BR rdbreak= \%{cmdline\:|pre-udev\:|pre-trigger\:|initqueue\:|pre-mount\:|mount\:|pre-pivot}
.ad
drop to a shell on defined breakpoint
.TP
.B rdudevinfo
set udev to loglevel info
.TP
.B rdudevdebug
set udev to loglevel debug
.SS I18N
e.g.
LANG=en_US.UTF-8
SYSFONT=latarcyrheb-sun16
KEYTABLE=de-latin1-nodeadkeys
.TP
.BR KEYBOARDTYPE= sun|pc
will be written to /etc/sysconfig/keyboard in the initramfs
.TP
.B KEYTABLE=<keytable filename>
.BR KEYTABLE= "<keytable filename>"
will be written to /etc/sysconfig/keyboard in the initramfs
.TP
.B SYSFONT= Console font
.BR SYSFONT= "Console font"
will be written to /etc/sysconfig/i18n in the initramfs
.TP
.B SYSFONTACM= Unicode font map
.BR SYSFONTACM= "Unicode font map"
will be written to /etc/sysconfig/i18n in the initramfs
.TP
.B UNIMAP= Unicode font map
.BR UNIMAP= "Unicode font map"
will be written to /etc/sysconfig/i18n in the initramfs
.TP
.B LANG=<locale>
.BR LANG= <locale>
will be written to /etc/sysconfig/i18n in the initramfs
.SH Bootsplash - plymouth
.SS LVM
.TP
.B rd_plytheme=<theme name>
specify the plymouth bootsplash theme (fallback is text)
.SH LVM
.TP
.B rd_NO_LVM
.BR rd_NO_LVM
disable LVM detection
.TP
.B rd_LVM_VG=<volume group name>
.BR rd_LVM_VG= "<volume group name>"
only activate the volume groups with the given name
.SH crypto LUKS
rd_LVM_VG can be specified multiple times on the kernel command line.
.TP
.B rd_NO_LUKS
.BR rd_LVM_LV= "<logical volume name>"
only activate the 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
.B rd_LUKS_UUID=<luks uuid>
.BR rd_LUKS_UUID= "<luks uuid>"
only activate the LUKS partitions with the given UUID
.SH MD
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
.B rd_NO_MD
.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
.B rd_NO_MDIMSM
.BR rd_NO_MDIMSM
no MD RAID for imsm/isw raids, use dmraid instead
.TP
.B rd_MD_UUID=<md uuid>
only activate the raid sets with the given UUID
.SH DMRAID
.BR rd_NO_MDADMCONF
ignore mdadm.conf included in initramfs
.TP
.B rd_NO_DM
.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
.B rd_DM_UUID=<dmraid uuid>
only activate the raid sets with the given UUID
.BR rd_DM_UUID= "<dmraid uuid>"
only activate the raid sets with the given UUID.
This parameter can be specified multiple times.
.SH DASD
.SS MULTIPATH
.TP
.B dasd=....
same syntax as the kernel module parameter (s390 only)
.BR rd_NO_MULTIPATH
disable multipath in the initramfs
.SH DHCP
.SS FIPS
.TP
.B root=dhcp
get IP from dhcp server, root-path option from dhcp specifies root location
.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>
.SH NFS
If the root device is encrypted, the /boot partition must reside on a seperate partition and has to be specified.
.SS Network
.TP
.B root=[<server-ip>:]<root-dir>[:<nfs-options>]
.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.
NFS options can be appended with the prefix "." or ","
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
.B root=nfs:[<server-ip>:]<root-dir>[:<nfs-options>]
.BR root= "nfs:[<server-ip>:]<root-dir>[:<nfs-options>]"
.TP
.B root=nfs4:[<server-ip>:]<root-dir>[:<nfs-options>]
.BR root= "nfs4:[<server-ip>:]<root-dir>[:<nfs-options>]"
.TP
.B root=dhcp
.BR root= dhcp|dhcp6
root=dhcp alone directs initrd to look at the DHCP root-path where NFS
options can be specified.
root-path=<server-ip>:<root-dir>[,<nfs-options>]
root-path=nfs:<server-ip>:<root-dir>[,<nfs-options>]
root-path=nfs4:<server-ip>:<root-dir>[,<nfs-options>]
.TP
.B root=/dev/nfs nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>]
.BR root= /dev/nfs " nfsroot=" "[<server-ip>:]<root-dir>[,<nfs-options>]"
\fBDeprecated!\fR kernel Documentation/filesystems/nfsroot.txt defines
this method.
This is supported by dracut but not recommended.
.SH iSCSI
.TP
.B root=iscsi:[<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname>
.BR rd_NFS_DOMAIN= "<NFSv4 domain name>"
Set the NFSv4 domain name. Will overwrite the settings in /etc/idmap.conf.
.SS iSCSI
.TP
.ad l
.BR root= "\%iscsi:[username:password\:[:reverse:password]@]\:[<servername>]\::[<protocol>]\::[<port>]\:[:[<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
@@ -205,95 +382,130 @@ associated fields.
http://tools.ietf.org/html/rfc4173
.TP
.B root=iscsi:[<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname>
.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
.B root=??? netroot=iscsi:[<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname> ...
.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
.B not yet implemented
e.g.
root=UUID=12424547
netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0
netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target1
.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
.B root=??? iscsi_initiator= iscsi_target_name= iscsi_target_ip= iscsi_target_port= iscsi_target_group= iscsi_username= iscsi_password= iscsi_in_username= iscsi_in_password=
.ad l
.BR \%root= \%??? " \%iscsi_initiator=" \%<initiator> " \%iscsi_target_name=" "<target name>" " \%iscsi_target_ip=" "<target ip>" " \%iscsi_target_port=" "<target port>" " \%iscsi_target_group=" "<target group>" " \%iscsi_username=" "<username>" " \%iscsi_password=" <password> " \%iscsi_in_username=" "<in username>" " \%iscsi_in_password=" "<in password>"
.ad
manually specify all iscsistart parameter (see \fIiscsistart\ --help\fR)
.TP
.B root=??? iscsi_firmware
.BR root= ??? " netroot=iscsi iscsi_firmware"
will read the iscsi parameter from the BIOS firmware
.SH NBD
.TP
.B root=nbd:<server>:<port>[:<fstype>][:<mountopts>]
.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
.B root=dhcp
with dhcp root-path=nbd:<server>:<port>[:<fstype>][:<mountopts>]
root=dhcp alone directs initrd to look at the DHCP root-path where NBD options can be specified.
This syntax is only usable in cases where you are directly mounting the volume as the rootfs.
.BR root= dhcp
with dhcp root-path=nbd:<server>:<port>[:<fstype>][:<mountopts>]
root=dhcp alone directs initrd to look at the DHCP root-path where NBD
options can be specified.
This syntax is only usable in cases where you are directly mounting the volume
as the rootfs.
.SH Network
.TP bootdev=<interface>
.B specify the network interface to boot from
.TP
.B ip={dhcp|on|any}
get ip from dhcp server from all interfaces. If root=dhcp, loop sequentially through all interfaces (eth0, eth1, ...) and use the first with a valid DHCP root-path.
.TP
.B ip=<interface>:{dhcp|on|any}
get ip from dhcp server on a specific interface
.TP
.B ip=<client-IP-number>:[<server-id>]:<gateway-IP-number>:<netmask>:<client-hostname>:<interface>:{none|off}
explicit network configuration
.SH Misc
.SS DASD
.TP
.B rdblacklist=<drivername>
do not load kernel module <drivername>
.BR rd_DASD_MOD= ....
same syntax as the kernel module parameter (s390 only)
.SH Debug
.TP
.B rdshell
allow dropping to a shell, if root mounting fails
.TP
.B rdinitdebug
set -x for the dracut shell
.TP
.B rdbreak
drop to a shell at the end
.TP
.B rdbreak={pre-udev|pre-mount|mount|pre-pivot|commandline|initqueue}
drop to a shell on defined breakpoint
.TP
.B rdudevinfo
set udev to loglevel info
.TP
.B rdudevdebug
set udev to loglevel debug
.TP
.B rdnetdebug
debug network scripts in dracut. Output is written to /tmp/
.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.
.SH CONFIGURATION IN INITRAMFS
.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 /etc/dracut.conf
see \fBdracut.conf\fR(5)
.SS "Configuration in the Initramfs"
.TP
.B /conf/conf.d/
Any files found in /conf/conf.d/ will be sourced in the initramfs to
.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
Andreas Thienemann <andreas@bawue.net>
Bill Nottingham <notting@redhat.com>
Dave Jones <davej@redhat.com>
David Dillow <dave@thedillows.org>
Harald Hoyer <harald@redhat.com>
Jeremy Katz <katzj@redhat.com>
Peter Jones <pjones@redhat.com>
Seewer Philippe <philippe.seewer@bfh.ch>
Victor Lowther <victor.lowther@gmail.com>
Warren Togami <wtogami@redhat.com>
Jeremy Katz <katzj@redhat.com>
Philippe Seewer <philippe.seewer@bfh.ch>
David Dillow <dave@thedillows.org>
.fi
.SH AVAILABILITY
The dracut command is part of the dracut package and is available from
https://sourceforge.net/apps/trac/dracut/wiki
http://sourceforge.net/apps/trac/dracut/wiki
.SH SEE ALSO
.BR dracut.conf (5)

View File

@@ -1,10 +1,26 @@
# Sample dracut config file
# Specific list of dracut modules to use
#dracutmodules=""
#dracutmodules+=""
# Dracut modules to omit
#omit_dracutmodules=""
#omit_dracutmodules+=""
# Additional kernel modules to install
#drivers=""
# Dracut modules to add to the default
#add_dracutmodules+=""
# additional kernel modules to the default
#add_drivers+=""
# list of kernel filesystem modules to be included in the generic initramfs
#filesystems+=""
# build initrd only to boot current hardware
#hostonly="yes"
#
# install local /etc/mdadm.conf
mdadmconf="yes"
# install local /etc/lvm/lvm.conf
lvmconf="yes"

78
dracut.conf.5 Normal file
View File

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

@@ -1,140 +1,291 @@
%if 0%{?fedora} < 12
%define with_switch_root 1
%else
%define with_switch_root 1
%endif
# Variables must be defined
%define with_switch_root 1
%define with_nbd 1
%if %{defined gittag}
%define rdist 1.git%{gittag}%{?dist}
%define dashgittag -%{gittag}
%else
%define rdist %{?dist}
# switchroot provided by util-linux-ng in F-12+
%if 0%{?fedora} > 11 || 0%{?rhel} >= 6
%define with_switch_root 0
%endif
# nbd in Fedora only
%if 0%{?rhel} >= 6
%define with_nbd 0
%endif
Name: dracut
Version: 0.7
Release: 1%{?rdist}
Version: 004
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
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)
Requires: udev
Requires: util-linux-ng
Requires: module-init-tools
Requires: cpio
Requires: coreutils
Requires: findutils
Requires: binutils
Requires: grep
Requires: mktemp
Requires: mount
Requires: bash
Requires: /bin/sh
Requires: fileutils, grep, mount, gzip, tar, mktemp >= 1.5-5, findutils
Requires: lvm2 >= 2.02.33-9, dhclient
Requires: filesystem >= 2.1.0, cpio, device-mapper, initscripts >= 8.63-1
Requires: e2fsprogs >= 1.38-12, libselinux, libsepol, coreutils
Requires: mdadm, elfutils-libelf, plymouth >= 0.7.0
Requires: cryptsetup-luks
Requires: bridge-utils
%ifnarch s390 s390x
Requires: dmraid
Requires: kbd
%if 0%{?fedora} > 12 || 0%{?rhel} >= 6
# no "provides", because dracut does not offer
# all functionality of the obsoleted packages
Obsoletes: mkinitrd <= 6.0.93
Obsoletes: mkinitrd-devel <= 6.0.93
Obsoletes: nash <= 6.0.93
Obsoletes: libbdevid-python <= 6.0.93
%endif
Requires: bash
Requires: bzip2
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: /sbin/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: dhclient rpcbind nfs-utils
Requires: iscsi-initiator-utils
%if %{with_nbd}
Requires: nbd
%endif
Requires: net-tools iproute
Requires: bridge-utils
%description network
This package requires everything which is needed to build a generic
all purpose initramfs with network support with dracut.
%package fips
Summary: Dracut modules to build a dracut initramfs with an integrity check
Requires: %{name} = %{version}-%{release}
Requires: hmaccalc 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 >= 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}
Requires: rpcbind nfs-utils
Requires: iscsi-initiator-utils
Requires: nbd
Requires: net-tools iproute
Requires: plymouth-system-theme plymouth-theme-charge plymouth-theme-solar
Requires: %{name}-network = %{version}-%{release}
%description generic
This package requires everything which is needed to build a generic
all purpose initramfs with dracut.
%package kernel
Summary: Metapackage to build generic initramfs with dracut with only kernel modules
Requires: %{name} = %{version}-%{release}
Requires: ql2100-firmware
Requires: ql2200-firmware
Requires: ql23xx-firmware
Requires: ql2400-firmware
Requires: ql2500-firmware
%description kernel
This package requires everything which is needed to build a initramfs with all
kernel modules and firmware files needed by dracut modules.
%package tools
Summary: dracut tools to build the local initramfs
Summary: Dracut tools to build the local initramfs
Requires: %{name} = %{version}-%{release}
Requires: ql2100-firmware
Requires: ql2200-firmware
Requires: ql23xx-firmware
Requires: ql2400-firmware
Requires: ql2500-firmware
Requires: coreutils cryptsetup-luks device-mapper
Requires: diffutils dmraid findutils gawk grep lvm2
Requires: module-init-tools sed
Requires: cpio gzip
%description tools
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
make WITH_SWITCH_ROOT=0%{?with_switch_root}
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT sbindir=/sbin sysconfdir=/etc mandir=%{_mandir}
make install DESTDIR=$RPM_BUILD_ROOT sbindir=/sbin \
sysconfdir=/etc mandir=%{_mandir} WITH_SWITCH_ROOT=0%{?with_switch_root}
%if ! 0%{?with_switch_root}
rm -f $RPM_BUILD_ROOT/sbin/switch_root
%endif
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
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log
touch $RPM_BUILD_ROOT%{_localstatedir}/log/dracut.log
%if 0%{?fedora} <= 12 && 0%{?rhel} < 6
rm $RPM_BUILD_ROOT/sbin/mkinitrd
rm $RPM_BUILD_ROOT/sbin/lsinitrd
%endif
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
%doc README HACKING TODO COPYING AUTHORS NEWS dracut-rhel6.html
/sbin/dracut
%if 0%{?with_switch_root}
/sbin/switch_root
%endif
%if 0%{?fedora} > 12 || 0%{?rhel} >= 6
/sbin/mkinitrd
/sbin/lsinitrd
%endif
%dir %{_datadir}/dracut
%{_datadir}/dracut/dracut-functions
%{_datadir}/dracut/modules.d
%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
%{_datadir}/dracut/modules.d/10redhat-i18n
%{_datadir}/dracut/modules.d/10rpmversion
%{_datadir}/dracut/modules.d/50plymouth
%{_datadir}/dracut/modules.d/60xen
%{_datadir}/dracut/modules.d/90btrfs
%{_datadir}/dracut/modules.d/90crypt
%{_datadir}/dracut/modules.d/90dm
%{_datadir}/dracut/modules.d/90dmraid
%{_datadir}/dracut/modules.d/90dmsquash-live
%{_datadir}/dracut/modules.d/90kernel-modules
%{_datadir}/dracut/modules.d/90lvm
%{_datadir}/dracut/modules.d/90mdraid
%{_datadir}/dracut/modules.d/90multipath
%{_datadir}/dracut/modules.d/95debug
%{_datadir}/dracut/modules.d/95fstab-sys
%{_datadir}/dracut/modules.d/95resume
%{_datadir}/dracut/modules.d/95rootfs-block
%{_datadir}/dracut/modules.d/95dasd
%{_datadir}/dracut/modules.d/95dasd_mod
%{_datadir}/dracut/modules.d/95zfcp
%{_datadir}/dracut/modules.d/95znet
%{_datadir}/dracut/modules.d/95terminfo
%{_datadir}/dracut/modules.d/95udev-rules
%{_datadir}/dracut/modules.d/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
%defattr(-,root,root,0755)
%doc README HACKING TODO COPYING AUTHORS NEWS
%{_datadir}/dracut/modules.d/40network
%{_datadir}/dracut/modules.d/95fcoe
%{_datadir}/dracut/modules.d/95iscsi
%{_datadir}/dracut/modules.d/95nbd
%{_datadir}/dracut/modules.d/95nfs
%{_datadir}/dracut/modules.d/45ifcfg
%files fips
%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 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
%files generic
%defattr(-,root,root,0755)
%doc README.generic
%files kernel
%files tools
%defattr(-,root,root,0755)
%doc README.kernel
%files tools
%defattr(-,root,root,0755)
%doc COPYING
%doc COPYING NEWS
%{_mandir}/man8/dracut-gencmdline.8*
%{_mandir}/man8/dracut-catimages.8*
/sbin/dracut-gencmdline
/sbin/dracut-catimages
%dir /boot/dracut
@@ -142,27 +293,3 @@ rm -rf $RPM_BUILD_ROOT
%dir /var/lib/dracut/overlay
%changelog
* Fri Jul 24 2009 Harald Hoyer <harald@redhat.com> 0.7-1
- version 0.7
* Wed Jul 22 2009 Harald Hoyer <harald@redhat.com> 0.6-1
- version 0.6
* Fri Jul 17 2009 Harald Hoyer <harald@redhat.com> 0.5-1
- version 0.5
* Sat Jul 04 2009 Harald Hoyer <harald@redhat.com> 0.4-1
- version 0.4
* Thu Jul 02 2009 Harald Hoyer <harald@redhat.com> 0.3-1
- version 0.3
* 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;

141
lsinitrd Executable file
View File

@@ -0,0 +1,141 @@
#!/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/>.
#
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
}
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)

150
mkinitrd-dracut.sh Normal file
View File

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

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

@@ -0,0 +1,5 @@
#!/bin/bash
[[ $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

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

@@ -0,0 +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()
{
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
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
FIPSMODULES=$(cat /etc/fipsmodules)
info "Loading and integrity checking all crypto modules"
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 || return 1
rmmod tcrypt
info "All initrd crypto checks done"
> /tmp/fipsdone
umount /boot >/dev/null 2>&1
return 0
}

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

@@ -0,0 +1,35 @@
#!/bin/bash
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) 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
else
dracut_install \
/$libdir/libsoftokn3.so /$libdir/libsoftokn3.chk
fi
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

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

@@ -0,0 +1,18 @@
#!/bin/bash
_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 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

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

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

@@ -3,7 +3,6 @@ inst_key_val()
local value
value=$(getarg $1)
[ -n "$value" ] && printf '%s="%s"\n' $1 $value >> $2
initrdargs="$initrdargs $1"
}
mkdir -p /etc/sysconfig

3
modules.d/10rpmversion/check Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
[ -f /etc/redhat-release ]

13
modules.d/10rpmversion/install Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
if [ -e "$moddir/dracut-version" ]; then
dracut_rpm_version=$(cat "$moddir/dracut-version")
inst "$moddir/dracut-version" /$dracut_rpm_version
else
if rpm -qf $(which $0) &>/dev/null; then
dracut_rpm_version=$(rpm -qf --qf '%{name}-%{version}-%{release}\n' $(which $0) | { ver="";while read line;do ver=$line;done;echo $ver;} )
echo $dracut_rpm_version > $initdir/$dracut_rpm_version
fi
fi
inst_hook cmdline 01 "$moddir/version.sh"

View File

@@ -0,0 +1,6 @@
for i in dracut-*; do
if [ -f $i ]; then
vinfo < $i
fi
done
unset i

View File

@@ -1,19 +1,27 @@
#!/bin/sh
#!/bin/bash
if [[ $1 = -d ]]; then
[ -d /etc/sysconfig/network-scripts/ ] && echo ifcfg
exit 0
fi
. $dracutfunctions
for program in ip hostname; do
for program in ip arping; do
which $program >/dev/null 2>&1
if [ $? -ne 0 ]; then
dwarning "Could not find program \"$program\" required by network."
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

@@ -13,13 +13,24 @@ setup_interface() {
[ -f /tmp/net.$netif.override ] && . /tmp/net.$netif.override
if [ -n "$mtu" ] ; then
echo ip link set $netif down
echo ip link set $netif mtu $mtu
echo ip link set $netif up
fi > /tmp/net.$netif.up
# Taken from debian dhclient-script:
# The 576 MTU is only used for X.25 and dialup connections
# where the admin wants low latency. Such a low MTU can cause
# problems with UDP traffic, among other things. As such,
# disallow MTUs from 576 and below by default, so that broken
# MTUs are ignored, but higher stuff is allowed (1492, 1500, etc).
if [ -n "$mtu" ] && [ $mtu -gt 576 ] ; then
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
@@ -30,38 +41,39 @@ setup_interface() {
done
fi >> /tmp/net.$netif.resolv.conf
[ -n "$hostname" ] && echo hostname $hostname > /tmp/net.$netif.hostname
[ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
}
PATH=$PATH:/sbin:/usr/sbin
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
fi
setup_interface
set | while read line; do
[ "${line#new_}" = "$line" ] && continue
echo "$line"
done >/tmp/dhclient.$netif.dhcpopts
echo online > /sys/class/net/$netif/uevent
/sbin/initqueue --onetime --name netroot-$netif /sbin/netroot $netif
;;
*) ;;
*) echo "dhcp: $reason";;
esac
exit 0

View File

@@ -7,14 +7,17 @@
[ -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"
echo '[ -d $NEWROOT/proc -o -e /dev/root ]' > /initqueue-finished/dhcp.sh
fi

View File

@@ -0,0 +1,27 @@
#!/bin/sh
# if there are no ifname parameters, just use NAME=KERNEL
if ! getarg ifname= >/dev/null ; then
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 '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 '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,56 +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"
}
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 "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
namesrv=$(getargs nameserver)
if [ -n "$namesrv" ] ; then
for s in $namesrv; do
echo nameserver $s
done
fi >> /tmp/net.$netif.resolv.conf
echo online > /sys/class/net/$netif/uevent
/sbin/initqueue --onetime --name netroot-$netif /sbin/netroot $netif
}
# Handle static ip configuration
do_static() {
{
echo ip link set $netif up
echo ip addr flush dev $netif
echo ip addr add $ip/$mask dev $netif
} > /tmp/net.$netif.up
strstr $ip '*:*:*' && load_ipv6
{
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
[ -n "$gw" ] && echo ip route add default via $gw dev $netif > /tmp/net.$netif.gw
[ -n "$hostname" ] && echo hostname $hostname > /tmp/net.$netif.hostname
[ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
namesrv=$(getargs nameserver)
if [ -n "$namesrv" ] ; then
for s in $namesrv; do
echo nameserver $s
done
fi >> /tmp/net.$netif.resolv.conf
echo online > /sys/class/net/$netif/uevent
/sbin/initqueue --onetime --name netroot-$netif /sbin/netroot $netif
}
PATH=$PATH:/sbin:/usr/sbin
. /lib/dracut-lib.sh
if getarg rdnetdebug ; then
exec >/tmp/ifup.$1.$$.out
exec 2>>/tmp/ifup.$1.$$.out
set -x
fi
get_vid() {
case "$1" in
vlan*)
echo ${1#vlan}
;;
*.*)
echo ${1##*.}
;;
esac
}
# Huh? No $1?
[ -z "$1" ] && exit 1
@@ -60,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
@@ -83,38 +171,121 @@ 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
brctl setfd $bridgename 0
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,17 +1,36 @@
#!/bin/bash
dracut_install ip dhclient hostname brctl
# -*- 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"
# TODO ifcfg config style is redhat specific, this should probably
# go into its own module at one time
inst_hook pre-pivot 85 "$moddir/write-ifcfg.sh"
if ldd $(which sh) 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
mkdir -p "${initdir}/var/run"

View File

@@ -1,14 +1,23 @@
#!/bin/bash
# Include wired net drivers, excluding wireless
for modname in $(find "$srcmods/kernel/drivers" -name '*.ko'); do
if nm -uPA $modname | grep -q eth_type_trans; then
if echo "$modname" | grep -q wireless; then
continue
else
instmods $modname
fi
fi
done
net_module_test() {
local net_drivers='eth_type_trans|register_virtio_device'
local unwanted_drivers='/(wireless|isdn|uwb)/'
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,27 +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", KERNEL=="%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
# Udev event 'online' only gets fired from ifup/dhclient-script.
# No special rules required
printf 'ACTION=="online", SUBSYSTEM=="net", RUN+="/sbin/netroot $env{INTERFACE}"\n'
} > /etc/udev/rules.d/60-net.rules

View File

@@ -4,33 +4,17 @@ PATH=$PATH:/sbin:/usr/sbin
. /lib/dracut-lib.sh
if getarg rdnetdebug ; then
exec >/tmp/netroot.$1.$$.out
exec 2>>/tmp/netroot.$1.$$.out
set -x
fi
[ "$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
# Only try to configure from one network interface at a time
#
if [ -z "$NETROOT_LOCKED" ] ; then
NETROOT_LOCKED=true
export NETROOT_LOCKED
exec flock -xo /tmp/netroot.lock -c "$0 $*"
exit 1
fi
# There's no sense in doing something if no (net)root info is available
# or root is already there
[ -e /tmp/root.info ] || exit 1
. /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
@@ -42,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
@@ -71,6 +59,37 @@ else
rootok="1"
fi
# We're here, so we can assume that upping interfaces is now ok
[ -z "$IFACES" ] && IFACES="$netif"
[ -e /tmp/net.$netif.gw ] && . /tmp/net.$netif.gw
[ -e /tmp/net.$netif.hostname ] && . /tmp/net.$netif.hostname
[ -e /tmp/net.$netif.resolv.conf ] && cp -f /tmp/net.$netif.resolv.conf /etc/resolv.conf
# Load interface options
[ -e /tmp/net.$netif.override ] && . /tmp/net.$netif.override
[ -e /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts
# Handle STP Timeout: arping default router or if not available the
# root server. Note: This assumes that if no router is present the
# root server is on the same subnet.
#
# TODO There's some netroot variants that don't (yet) have their
# server-ip netroot
[ -n "$new_routers" ] && dest=${new_routers%%,*}
[ -n "$gw" ] && dest=$gw
if [ -z "$dest" ] ; then
dummy=${netroot#*:}
dummy=${dummy%%:*}
case "$dummy" in
[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*) dest=$dummy;;
esac
fi
[ -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'"
@@ -82,16 +101,6 @@ 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
[ -e /tmp/net.$netif.resolv.conf ] && cp -f /tmp/net.$netif.resolv.conf /etc/resolv.conf
# Source netroot hooks before we start the handler
source_all netroot
@@ -100,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

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

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

@@ -0,0 +1,37 @@
#!/bin/sh
#
# Format:
# ifname=<interface>:<mac>
#
#
# Examples:
# ifname=eth0:4a:3f:4c:04:f8:d7
#
# 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
parse_ifname_opts() {
local IFS=:
set $1
case $# in
7)
ifname_if=$1
# 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="
;;
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
done

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

View File

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

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

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

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

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

View File

@@ -0,0 +1,168 @@
#!/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
# Don't write anything if we don't know our bootdev
[ -f /tmp/net.ifaces ] || return 1
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
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
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" ] && [ -z "$bond" ] && [ -z "$vlan" ]; then
# standard interface
{
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"
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
# Pass network opts
mkdir /dev/.initramfs/
cp /tmp/net.* /dev/.initramfs/ >/dev/null 2>&1
mkdir -p /dev/.initramfs/state/etc/sysconfig/network-scripts/
cp /tmp/net.$netif.resolv.conf /dev/.initramfs/state/etc/ >/dev/null 2>&1
echo "files /etc/sysconfig/network-scripts" > /dev/.initramfs/rwtab
cp -a /tmp/ifcfg/* /dev/.initramfs/state/etc/sysconfig/network-scripts/ >/dev/null 2>&1

View File

@@ -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,41 +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
LUKS=$(getargs rd_LUKS_UUID=)
ask=1
if [ -n "$LUKS" ]; then
ask=0
for luks in $LUKS; do
if [ "${2##$luks}" != "$2" ]; then
ask=1
fi
done
fi
if [ $ask -gt 0 ]; then
# flock against other interactive activities
{ flock -s 9;
/bin/plymouth ask-for-password \
--prompt "$1 is password protected" \
--command="/sbin/cryptsetup luksOpen -T1 $1 $2"
} 9>/.console.lock
fi
# mark device as asked
>> /tmp/cryptroot-asked-$2
unset LUKS
unset ask
unset luks
exit 0

View File

@@ -1,7 +1,15 @@
#!/bin/bash
. "$moddir"/plymouth-populate-initrd
inst_hook cmdline 30 "$moddir/parse-plymouth.sh"
if grep -q nash /usr/libexec/plymouth/plymouth-populate-initrd \
|| ! grep -q PLYMOUTH_POPULATE_SOURCE_FUNCTIONS /usr/libexec/plymouth/plymouth-populate-initrd \
|| [ ! -x /usr/libexec/plymouth/plymouth-populate-initrd ]; then
. "$moddir"/plymouth-populate-initrd
else
PLYMOUTH_POPULATE_SOURCE_FUNCTIONS="$dracutfunctions" \
/usr/libexec/plymouth/plymouth-populate-initrd -t $initdir
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_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'); do
nm -uPA $modname | grep -q drm_crtc_init && instmods $modname
for modname in $(find "$srcmods/kernel/drivers/gpu/drm" -name '*.ko' 2>/dev/null); do
grep -q drm_crtc_init $modname && instmods $modname
done
hostonly='' instmods hyperv_fb

View File

@@ -1,19 +0,0 @@
initrdargs="$initrdargs rd_plytheme"
PLYMOUTH_THEMEDIR=/usr/share/plymouth/themes
PLYMOUTH_THEME=$(getarg rd_plytheme=)
if [ -n "$PLYMOUTH_THEME" ]; then
if [ -f "${PLYMOUTH_THEMEDIR}/${PLYMOUTH_THEME}/${PLYMOUTH_THEME}.plymouth" ]; then
info "Setting theme $PLYMOUTH_THEME"
(
cd $PLYMOUTH_THEMEDIR;
ln -fs "${PLYMOUTH_THEME}/${PLYMOUTH_THEME}.plymouth" default.plymouth 2>&1 | vinfo;
)
else
warn "Theme $PLYMOUTH_THEME not found!"
fi
fi
unset PLYMOUTH_THEME
unset PLYMOUTH_THEMEDIR

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,18 +30,19 @@ 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
for x in /usr/share/plymouth/themes/*/* ; do
for x in /usr/share/plymouth/themes/{text,details}/* ; do
[[ -f "$x" ]] || continue
THEME_DIR=$(dirname "$x")
mkdir -p "${initdir}/$THEME_DIR"
dracut_install "$x"
done
for x in ${LIBDIR}/plymouth/*.so ; do
for x in ${LIBDIR}/plymouth/{text,details}.so ; do
[[ -f "$x" ]] || continue
[[ "$x" != "${x%%/label.so}" ]] && continue
dracut_install "$x"
done
(

View File

@@ -1,18 +1,28 @@
#!/bin/sh
[ -c /dev/null ] || mknod /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
if ! getarg rd_NO_PLYMOUTH; then
[ -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 --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"
[ -x /bin/plymouthd ] && /bin/plymouthd
/bin/plymouth --show-splash 2>&1 | vinfo
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
/bin/plymouth --show-splash 2>&1 | vinfo
fi
# vim:ts=8:sw=4:sts=4:et

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

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

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

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

View File

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

View File

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

View File

@@ -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 --onetime /sbin/cryptroot-ask $env{DEVNAME} luks-$env{ID_FS_UUID}"
LABEL="luks_end"

View File

@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# if cryptsetup is not installed, then we cannot support encrypted devices.
which cryptsetup >/dev/null 2>&1 || exit 1
@@ -6,8 +6,21 @@ which cryptsetup >/dev/null 2>&1 || exit 1
# hostonly checking should only return true if root is on a LUKS device
# in some way, but I am too lazy to figure out how to do that.
# Instead, fail if we do not have a LUKS device in use somewhere.
if [ "$1" = "-h" ] ; then
blkid | grep -q crypt_LUKS || exit 1
fi
. $dracutfunctions
is_crypt() { [[ $(get_fs_type /dev/block/$1) = crypto_LUKS ]]; }
[[ $1 = '-h' ]] && {
rootdev=$(find_root_block_device)
if [[ $rootdev ]]; then
# root lives on a block device, so we can be more precise about
# hostonly checking
check_block_and_slaves is_crypt "$rootdev" || exit 1
else
# root is not on a block device, use the shotgun approach
blkid | grep -q crypto\?_LUKS || exit 1
fi
}
exit 0

View File

@@ -0,0 +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,28 +14,109 @@
# we already asked for this device
[ -f /tmp/cryptroot-asked-$2 ] && exit 0
. /lib/dracut-lib.sh
LUKS=$(getargs rd_LUKS_UUID=)
ask=1
# load dm_crypt if it is not already loaded
[ -d /sys/module/dm_crypt ] || modprobe dm_crypt
if [ -n "$LUKS" ]; then
ask=0
for luks in $LUKS; do
if [ "${2##$luks}" != "$2" ]; then
ask=1
fi
. /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")"
else
device="$1"
fi
# TODO: improve to support what cmdline does
if [ -f /etc/crypttab ] && ! getargs rd_NO_CRYPTTAB; then
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
done < /etc/crypttab
unset name dev rest
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
if [ $ask -gt 0 ]; then
# flock against other interactive activities
{ flock -s 9;
echo -n "$1 is password protected "
/sbin/cryptsetup luksOpen -T1 $1 $2
} 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
exit 0
udevsettle
exit 0

View File

@@ -1,5 +1,11 @@
#!/bin/bash
inst cryptsetup
inst_rules "$moddir/70-luks.rules"
inst cryptsetup
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

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