Compare commits

..

410 Commits

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
836 changed files with 13746 additions and 54457 deletions

View File

@@ -1,9 +0,0 @@
lineend=linux
style=linux
indent=spaces=8
convert-tabs
min-conditional-indent=0
max-instatement-indent=120
align-pointer=name
max-code-length=120

View File

@@ -1,25 +1,3 @@
; Directory Local Variables
; For more information see (info "(emacs) Directory Variables")
; Sets emacs variables based on mode.
; A list of (major-mode . ((var1 . value1) (var2 . value2)))
; Mode can be nil, which gives default values.
; Characters width is set to 109 for .c and XML but for everything else 79.
; If you update this file make sure to update .vimrc and .editorconfig too.
((c-mode . ((fill-column . 109)
(c-basic-offset . 8)
(eval . (c-set-offset 'substatement-open 0))
(eval . (c-set-offset 'statement-case-open 0))
(eval . (c-set-offset 'case-label 0))
(eval . (c-set-offset 'arglist-intro '++))
(eval . (c-set-offset 'arglist-close 0))
(eval . (c-set-offset 'arglist-cont-nonempty '(c-lineup-gcc-asm-reg c-lineup-arglist)))))
(nxml-mode . ((nxml-child-indent . 2)
(fill-column . 109)))
(meson-mode . ((meson-indent-basic . 8)))
(sh-mode . ((sh-basic-offset . 4)
(sh-indentation . 4)))
(awk-mode . ((c-basic-offset . 8)))
(nil . ((indent-tabs-mode . nil)
(tab-width . 4)
(fill-column . 79))) )
((nil . ((setq sh-basic-offset: 4)
(setq indent-tabs-mode nil)
)))

View File

@@ -1,39 +0,0 @@
# EditorConfig configuration for dracut
# http://EditorConfig.org
# If you update this file make sure to update .dir-locals.el and .vimrc too.
# Top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file, utf-8 charset
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
indent_style = space
indent_size = 4
switch_case_indent = true
function_next_line = false
binary_next_line = true
space_redirects = true
# Match config files, set indent to spaces with width of eight.
[*.{c,h}]
indent_style = space
indent_size = 8
# Match config files, set indent to spaces with width of four.
[*.sh]
indent_style = space
indent_size = 4
switch_case_indent = true
function_next_line = false
binary_next_line = true
space_redirects = true
# Match xml man pages, set indent to spaces with width of two.
[man/*.xml]
indent_style = space
indent_size = 2

9
.github/CODEOWNERS vendored
View File

@@ -1,9 +0,0 @@
# This is a comment.
# Each line is a file pattern followed by one or more owners.
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @global-owner1 and @global-owner2 will be requested for
# review when someone opens a pull request.
* @haraldh @danimo @johannbg

View File

@@ -1,26 +0,0 @@
---
name: "\U0001F41B Bug report"
about: A report of an error in a recent Dracut version
labels: 'bug'
---
**Describe the bug**
A clear and concise description of what the error is.
**Distribution used**
Which distribution was this behaviour seen in?
**Dracut version**
Which dracut version was this behaviour seen in?
**Init system**
Which init system is being used?
**To Reproduce**
Steps or code to reproduce the behavior.
**Expected behavior**
A clear and concise description of what you expected to happen.
**Additional context**
Add any other context you like about the problem here.

View File

@@ -1,8 +0,0 @@
---
name: "\U0001F4D6 Documentation"
about: Suggest an improvement for documentation in Dracut
labels: 'documents'
---
**Describe the documentation**
A clear and concise description of what should be better documented.

View File

@@ -1,8 +0,0 @@
---
name: "\U00002728 Feature Request"
about: A request for enhancement in Dracut
labels: 'enhancement'
---
**Describe the enhancement**
A clear and concise description of what the enhancement is that you would like to see.

View File

@@ -1,14 +0,0 @@
version: 2
# Maintain dependencies for GitHub Actions
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "tuesday"
commit-message:
prefix: "chore"
include: "scope"
ignore:
- dependency-name: "Manual test"

292
.github/labeler.yml vendored
View File

@@ -1,292 +0,0 @@
repository:
- ./*
github:
- .github/*
- .github/**/*
dracut-install:
- install/*
- install/**/*
example:
- examples/*
- examples/**/*
- examples/**/**/*
modules:
- modules.d/*
- modules.d/**/*
bash:
- modules.d/00bash/*
dash:
- modules.d/00dash/*
mksh:
- modules.d/00mksh/*
systemd:
- modules.d/00systemd/*
warpclock:
- modules.d/00warpclock/*
fips:
- modules.d/01fips/*
systemd-initrd:
- modules.d/01systemd-initrd/*
caps:
- modules.d/02caps/*
systemd-networkd:
- modules.d/02systemd-networkd/*
modsign:
- modules.d/03modsign/*
rescue:
- modules.d/03rescue/*
watchdog:
- modules.d/04watchdog/*
busybox:
- modules.d/05busybox/*
rngd:
- modules.d/06rngd/*
i18n:
- modules.d/10i18n/*
convertfs:
- modules.d/30convertfs/*
network-legacy:
- modules.d/35network-legacy/*
network-manager:
- modules.d/35network-manager/*
network:
- modules.d/40network/*
ifcfg:
- modules.d/45ifcfg/*
url-lib:
- modules.d/45url-lib/*
drm:
- modules.d/50drm/*
plymouth:
- modules.d/50plymouth/*
cms:
- modules.d/80cms/*
lvmmerge:
- modules.d/80lvmmerge/*
cio_ignore:
- modules.d/81cio_ignore/*
btrfs:
- modules.d/90btrfs/*
crypt:
- modules.d/90crypt/*
dm:
- modules.d/90dm/*
dmraid:
- modules.d/90dmraid/*
dmsquash-live:
- modules.d/90dmsquash-live/*
dmsquash-live-ntfs:
- modules.d/90dmsquash-live-ntfs/*
kernel-modules:
- modules.d/90kernel-modules/*
kernel-modules-extra:
- modules.d/90kernel-modules-extra/*
kernel-network-modules:
- modules.d/90kernel-network-modules/*
livenet:
- modules.d/90livenet/*
lvm:
- modules.d/90lvm/*
mdraid:
- modules.d/90mdraid/*
multipath:
- modules.d/90multipath/*
nvdimm:
- modules.d/90nvdimm/*
overlayfs:
- modules.d/90overlayfs/*
ppcmac:
- modules.d/90ppcmac/*
qemu:
- modules.d/90qemu/*
qemu-net:
- modules.d/90qemu-net/*
crypt-gpg:
- modules.d/91crypt-gpg/*
crypt-loop:
- modules.d/91crypt-loop/*
zipl:
- modules.d/91zipl/*
cifs:
- modules.d/95cifs/*
dasd:
- modules.d/95dasd/*
dasd_mod:
- modules.d/95dasd_mod/*
dasd_rules:
- modules.d/95dasd_rules/*
dcssblk:
- modules.d/95dcssblk/*
debug:
- modules.d/95debug/*
fcoe:
- modules.d/95fcoe/*
fcoe-uefi:
- modules.d/95fcoe-uefi/*
fstab-sys:
- modules.d/95fstab-sys/*
iscsi:
- modules.d/95iscsi/*
lunmask:
- modules.d/95lunmask/*
nbd:
- modules.d/95nbd/*
nfs:
- modules.d/95nfs/*
nvmf:
- modules.d/95nvmf/*
qeth_rules:
- modules.d/95qeth_rules/*
resume:
- modules.d/95resume/*
rootfs-block:
- modules.d/95rootfs-block/*
ssh-client:
- modules.d/95ssh-client/*
terminfo:
- modules.d/95terminfo/*
udev-rules:
- modules.d/95udev-rules/*
virtfs:
- modules.d/95virtfs/*
virtiofs:
- modules.d/95virtiofs/*
zfcp:
- modules.d/95zfcp/*
zfcp_rules:
- modules.d/95zfcp_rules/*
znet:
- modules.d/95znet/*
securityfs:
- modules.d/96securityfs/*
biosdevname:
- modules.d/97biosdevname/*
masterkey:
- modules.d/97masterkey/*
dracut-systemd:
- modules.d/98dracut-systemd/*
ecryptfs:
- modules.d/98ecryptfs/*
integrity:
- modules.d/98integrity/*
pollcdrom:
- modules.d/98pollcdrom/*
selinux:
- modules.d/98selinux/*
syslog:
- modules.d/98syslog/*
usrmount:
- modules.d/98usrmount/*
base:
- modules.d/99base/*
fs-lib:
- modules.d/99fs-lib/*
img-lib:
- modules.d/99img-lib/*
memstrack:
- modules.d/99memstrack/*
shutdown:
- modules.d/99shutdown/*
squash:
- modules.d/99squash/*
uefi-lib:
- modules.d/99uefi-lib/*
test:
- test/*
- test/**/*
- modules.d/80test*
- modules.d/80test*/*

View File

@@ -1,10 +0,0 @@
This pull request changes...
## Changes
## Checklist
- [ ] I have tested it locally
- [ ] I have reviewed and updated any documentation if relevant
- [ ] I am providing new code and test(s) for it
Fixes #

23
.github/stale.yml vendored
View File

@@ -1,23 +0,0 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 30
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Ignore if in a milestone
exemptMilestones: true
# Issues with these labels will never be considered stale
exemptLabels:
- documents
- enhancement
- regression
- wiki
- bug
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue is being marked as stale because it has not had any recent activity.
It will be closed if no further activity occurs.
If this is still an issue in the latest release of Dracut and you would like to keep it open please comment on this issue within the next 7 days.
Thank you for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false

View File

@@ -1,53 +0,0 @@
---
# vi: ts=2 sw=2 et:
# SPDX-License-Identifier: LGPL-2.1-or-later
#
name: "CodeQL"
on:
push:
branches:
- master
pull_request:
branches:
- master
permissions:
contents: read
jobs:
analyze:
name: Analyze
runs-on: ubuntu-22.04
concurrency:
group: ${{ github.workflow }}-${{ matrix.language }}-${{ github.ref }}
cancel-in-progress: true
permissions:
actions: read
security-events: write
strategy:
fail-fast: false
matrix:
language: ['cpp', 'python']
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: +security-extended,security-and-quality
- name: Install dependencies
run: |
sudo apt -y update
sudo apt -y install asciidoc gcc libkmod-dev libsystemd-dev pkg-config
- name: Autobuild
uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

View File

@@ -1,54 +0,0 @@
name: Container
on:
schedule:
- cron: '30 11 * * *' # every day at 4:40
push:
branches: [ master ]
paths:
- 'test/container/**'
- '.github/workflows/container.yml'
pull_request:
branches: [ master ]
paths:
- 'test/container/**'
- '.github/workflows/container.yml'
permissions:
packages: write
contents: read
jobs:
push_to_registry:
name: Build and push containers image to GitHub Packages
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.config.dockerfile }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
config:
- { dockerfile: 'Dockerfile-Fedora-latest', tag: 'fedora:latest' }
- { dockerfile: 'Dockerfile-OpenSuse-latest', tag: 'opensuse:latest' }
- { dockerfile: 'Dockerfile-Arch', tag: 'arch:latest' }
- { dockerfile: 'Dockerfile-Debian', tag: 'debian:latest' }
- { dockerfile: 'Dockerfile-Gentoo', tag: 'gentoo:latest' }
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up env
run: echo "repository_owner=${GITHUB_REPOSITORY_OWNER,,}" >>${GITHUB_ENV}
- name: Build and Push Container
uses: docker/build-push-action@v4
with:
file: test/container/${{ matrix.config.dockerfile }}
tags: ghcr.io/${{env.repository_owner}}/${{ matrix.config.tag }}
push: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}

View File

@@ -1,116 +0,0 @@
name: Integration Test
on:
pull_request:
branches: [ master ]
env:
DEBUGFAIL: "${{ secrets.ACTIONS_STEP_DEBUG && 'rd.debug' }}"
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 30
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.container }}-${{ matrix.test }}
cancel-in-progress: true
strategy:
matrix:
container: [
"arch:latest",
"debian:latest",
"fedora:latest",
"opensuse:latest",
]
test: [
"01",
"02",
"03",
"04",
"10",
"11",
"12",
"13",
"14",
"15",
"16",
"17",
"18",
"62",
"98",
]
fail-fast: false
container:
image: ghcr.io/dracutdevs/${{ matrix.container }}
options: "--privileged -v /dev:/dev"
steps:
- name: "Checkout Repository"
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: "${{ matrix.container }} TEST-${{ matrix.test }}"
run: ./tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }}
network:
runs-on: ubuntu-latest
timeout-minutes: 45
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.container }}-${{ matrix.test }}-${{ matrix.network }}
cancel-in-progress: true
strategy:
matrix:
container: [
"fedora:latest",
]
network: [
"network-manager",
"network-legacy",
#"systemd-networkd",
#"connman",
]
test: [
"20",
"30",
"35",
"40",
"60",
# "50", # times out
]
fail-fast: false
container:
image: ghcr.io/dracutdevs/${{ matrix.container }}
options: "--privileged -v /dev:/dev"
steps:
- name: "Checkout Repository"
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: "${{ matrix.container }} TEST-${{ matrix.test }}"
run: USE_NETWORK=${{ matrix.network }} ./tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }}
openrc-musl:
runs-on: ubuntu-latest
timeout-minutes: 45
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.container }}-${{ matrix.test }}
cancel-in-progress: true
strategy:
matrix:
container: [
"gentoo:latest",
]
test: [
"18",
]
fail-fast: false
container:
image: ghcr.io/dracutdevs/${{ matrix.container }}
options: "--privileged -v /dev:/dev"
steps:
- name: "Checkout Repository"
uses: actions/checkout@v1
with:
fetch-depth: 0
- name: "${{ matrix.container }} TEST-${{ matrix.test }}"
run: ./tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }}

View File

@@ -1,11 +0,0 @@
name: "Pull Request Labeler"
on: pull_request_target
jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@main
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"

View File

@@ -1,38 +0,0 @@
name: Lint
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
lint-c:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install tools
run: sudo apt-get install astyle
- name: indent
run: make indent-c
- name: check formatting
run: git diff --exit-code
lint-shell:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: shfmt
uses: luizm/action-sh-checker@v0.6.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SHFMT_OPTS: -s # arguments to shfmt.
with:
sh_checker_shellcheck_disable: false
sh_checker_comment: true

View File

@@ -1,37 +0,0 @@
name: Manual test
on:
workflow_dispatch:
inputs:
test:
description: "Array of tests to run, such as [11,12]"
default: "['04']"
required: true
container:
type: choice
description: 'distro'
default: 'fedora'
options:
- "fedora"
- "arch"
- "debian"
- "opensuse"
- "gentoo"
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 45
strategy:
matrix:
test: ${{ fromJSON(inputs.test) }}
container:
image: ghcr.io/dracutdevs/${{ inputs.container }}
options: "--privileged -v /dev:/dev"
steps:
- name: "Checkout Repository"
uses: actions/checkout@v1
with:
fetch-depth: 0
- name: "${{ inputs.container }} ${{ matrix.test }}"
run: ./tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }}

View File

@@ -1,19 +0,0 @@
name: Commisery
on:
pull_request:
types: [edited, opened, synchronize, reopened]
jobs:
commit-message:
name: Conventional Commit Message Checker (Commisery)
runs-on: ubuntu-latest
steps:
- name: Check-out the repo under $GITHUB_WORKSPACE
uses: actions/checkout@v3
- name: Run Commisery
uses: dracutdevs/commisery-action@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
pull_request: ${{ github.event.number }}

31
.gitignore vendored
View File

@@ -1,30 +1,3 @@
/Makefile.inc
/man/dracut.8
/man/dracut-catimages.8
/man/dracut.conf.5
/dracut.conf.d/*.conf
/man/dracut.cmdline.7
/dracut.html
/man/dracut.kernel.7
/man/dracut.bootup.7
/man/dracut.modules.7
/man/lsinitrd.1
/dracut.pc
/dracut-install
/modules.d/99base/switch_root
/test/*/test.log
/test/*/.testdir
test*.img
/.buildpath
/.project
/dracut-version.sh
/src/install/dracut-install
/*.rpm
/*.[0-9]
/modules.d/98dracut-systemd/*.service.8
/*.sign
*.o
/src/skipcpio/skipcpio
/src/util/util
/dracut-util
.idea/
modules.d/99base/switch_root
*~

View File

@@ -1,2 +1 @@
kate: space-indent on; tab-width 4; indent-width 4; replace-tabs on; eol unix;
kate-mimetype(text/x-c): tab-width 8; indent-width 8;

View File

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

View File

@@ -1,38 +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@profian.com> <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Harald Hoyer <harald@profian.com> <harald@eeepc.(none)>
Harald Hoyer <harald@profian.com> <harald@hoyer.xyz>
Harald Hoyer <harald@profian.com> <harald@redhat.com>
Mike Snitzer <snitzer@redhat.com> <msnitzer@redhat.com>
Amerigo Wang <amwang@redhat.com> <xiyou.wangcong@gmail.com>
Andrey Borzenkov <arvidjaar@gmail.com> <arvidjaar@mail.ru>
Dan Horák <dhorak@redhat.com> <dan@danny.cz>
John Reiser <jreiser@bitwagon.com> <jreiser@BitWagon.com>
Luca Berra <bluca@vodka.it> <bluca@comedia.it>
Dave Young <dyoung@redhat.com> <dyoung@redhat.com>
Dave Young <dyoung@redhat.com> <dave@redhat.com>
Frederick Grose <fgrose@sugarlabs.org> <fgrose@gmail.com>
Frederic Crozat <fcrozat@suse.com> <fcrozat@mandriva.com>
Shawn W Dunn <sfalken@opensuse.org> <sfalken@opensuse.org>
Kyle McMartin <kmcmarti@redhat.com> <kyle@redhat.com>
Angelo "pallotron" Failla <pallotron@fb.com> <pallotron@fb.com>
Yu Watanabe <watanabe.yu+github@gmail.com>
Martin Wilck <mwilck@suse.de> <mwilck@suse.com>
Thomas Renninger <trenn@suse.com> <trenn@suse.de>
Andrey Borzenkov <arvidjaar@gmail.com>
Cristian Rodríguez <crrodriguez@opensuse.org>
Daniel Drake <drake@endlessm.com> <dsd@laptop.org>
Fabian Vogt <fvogt@suse.com>
Hannes Reinecke <hare@suse.com> <hare@suse.de>
Julian Wolf <juwolf@suse.com> <juwolf@suse.de>
Lidong Zhong <lidong.zhong@suse.com> <lzhong@suse.com>
Nikoli <nikoli@gmx.us> <nikoli@lavabit.com>
Peter Robinson <pbrobinson@fedoraproject.org> <pbrobinson@gmail.com>
Xunlei Pang <xlpang@redhat.com> <xpang@redhat.com>
Daniel Molkentin <daniel.molkentin@suse.com> <dmolkentin@suse.com>
Thomas Blume <thomas.blume@suse.com> <Thomas.Blume@suse.com>
Brian C. Lane <bcl@redhat.com> <bcl@brianlane.com>
Tomasz Paweł Gajc <tpgxyz@gmail.com> <tpgxyz@gmail.com>
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)>

View File

@@ -1,34 +0,0 @@
# SC2039: In POSIX sh, 'local' is undefined.
# https://github.com/koalaman/shellcheck/wiki/SC2039
disable=SC2039
# SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
# https://github.com/koalaman/shellcheck/wiki/SC2166
disable=SC2166
# SC2154: Variable is referenced but not assigned
# https://github.com/koalaman/shellcheck/wiki/SC2154
disable=SC2154
# SC1091: Not following <file>
# https://github.com/koalaman/shellcheck/wiki/SC1091
disable=SC1091
# SC2174: When used with -p, -m only applies to the deepest directory.
# https://github.com/koalaman/shellcheck/wiki/SC2174
disable=SC2174
# SC3043: In POSIX sh, 'local' is undefined.
# https://github.com/koalaman/shellcheck/wiki/SC3043
# ... but dash supports it
disable=SC3043
# SC3013: In POSIX sh, -ef is undefined.
# https://github.com/koalaman/shellcheck/wiki/SC3013
# ... but dash supports it
disable=SC3013
# SC3045: In POSIX sh, read -p is undefined.
# https://github.com/koalaman/shellcheck/wiki/SC3045
# ... but dash supports it
disable=SC3045

15
.vimrc
View File

@@ -1,15 +0,0 @@
" Vim can use per directory configuration files like this.
" To enable that feature two lines are needed in your ~/.vimrc
" set exrc " enables per-directory .vimrc files
" set secure " disable unsafe commands in local .vimrc files
" Characters width is set to 109 for .c and XML but for everything else 79.
" If you update this file make sure to update .dir-locals.el & .editorconfig
set tabstop=4
set shiftwidth=4
set expandtab
set makeprg=GCC_COLORS=\ make
set tw=79
au BufRead,BufNewFile *.xml set tw=109 shiftwidth=2 smarttab
au FileType sh set tw=80 shiftwidth=4 smarttab
au FileType c set tw=109 shiftwidth=8 tabstop=8 smarttab expandtab

364
AUTHORS
View File

@@ -1,372 +1,32 @@
Harald Hoyer <harald@profian.com>
Harald Hoyer <harald@redhat.com>
Victor Lowther <victor.lowther@gmail.com>
Jóhann B. Guðmundsson <johannbg@gmail.com>
Laszlo Gombos <laszlo.gombos@gmail.com>
Amadeusz Żołnowski <aidecoe@aidecoe.name>
Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
Daniel Molkentin <daniel.molkentin@suse.com>
Hannes Reinecke <hare@suse.com>
Kairui Song <kasong@redhat.com>
Will Woods <wwoods@redhat.com>
Philippe Seewer <philippe.seewer@bfh.ch>
Warren Togami <wtogami@redhat.com>
Dave Young <dyoung@redhat.com>
Jeremy Katz <katzj@redhat.com>
Lukas Nykryn <lnykryn@redhat.com>
David Dillow <dave@thedillows.org>
Martin Wilck <mwilck@suse.de>
Lubomir Rintel <lkundrak@v3.sk>
Michal Soltys <soltys@ziu.info>
Colin Guthrie <colin@mageia.org>
Amerigo Wang <amwang@redhat.com>
Thomas Renninger <trenn@suse.com>
Alexander Tsoy <alexander@tsoy.me>
Frederick Grose <fgrose@sugarlabs.org>
WANG Chao <chaowang@redhat.com>
Beniamino Galvani <bgalvani@redhat.com>
Jonathan Lebon <jonathan@jlebon.com>
Yu Watanabe <watanabe.yu+github@gmail.com>
Andrey Borzenkov <arvidjaar@gmail.com>
David Tardon <dtardon@redhat.com>
Peter Robinson <pbrobinson@fedoraproject.org>
David Disseldorp <ddiss@suse.de>
Hans de Goede <hdegoede@redhat.com>
Frantisek Sumsal <frantisek@sumsal.cz>
Peter Jones <pjones@redhat.com>
Thomas Blume <thomas.blume@suse.com>
Andreas Thienemann <andreas@bawue.net>
Marcos Mello <marcosfrm@gmail.com>
Renaud Métrich <rmetrich@redhat.com>
наб <nabijaczleweli@nabijaczleweli.xyz>
Pavel Valena <pvalena@redhat.com>
Tomasz Paweł Gajc <tpgxyz@gmail.com>
Brian C. Lane <bcl@redhat.com>
Fabian Vogt <fvogt@suse.com>
Nicolas Chauvet <kwizart@gmail.com>
Zoltán Böszörményi <zboszor@pr.hu>
Colin Walters <walters@verbum.org>
John Reiser <jreiser@bitwagon.com>
Luca Berra <bluca@vodka.it>
Shreenidhi Shedi <sshedi@vmware.com>
Xunlei Pang <xlpang@redhat.com>
Daniel Drake <drake@endlessm.com>
David Teigland <teigland@redhat.com>
Dusty Mabe <dusty@dustymabe.com>
Kairui Song <kasong@tencent.com>
Angelo "pallotron" Failla <pallotron@fb.com>
Dan Horák <dhorak@redhat.com>
Ville Skyttä <ville.skytta@iki.fi>
Böszörményi Zoltán <zboszor@pr.hu>
Cristian Rodríguez <crrodriguez@opensuse.org>
Javier Martinez Canillas <javierm@redhat.com>
Mike Gilbert <floppym@gentoo.org>
Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
Ondrej Mosnacek <omosnace@redhat.com>
Baoquan He <bhe@redhat.com>
Brendan Germain <brendan.germain@nasdaqomx.com>
Jonas Witschel <diabonas@gmx.de>
Leho Kraav <leho@kraav.com>
Moritz Maxeiner <moritz@ucworks.org>
Nathan Rini <nate@ucar.edu>
Radek Vykydal <rvykydal@redhat.com>
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Đoàn Trần Công Danh <congdanhqx@gmail.com>
Fabian Deutsch <fabiand@fedoraproject.org>
Kamil Rytarowski <n54@gmx.com>
Lidong Zhong <lidong.zhong@suse.com>
Hans de Goede <hdegoede@redhat.com>
Peter Jones <pjones@redhat.com>
Luca Berra <bluca@comedia.it>
Marc Grimme <grimme@atix.de>
NeilBrown <neilb@suse.de>
Peter Rajnoha <prajnoha@redhat.com>
Tao Liu <ltao@redhat.com>
Thorsten Behrens <tbehrens@suse.com>
q66 <daniel@octaforge.org>
Adam Williamson <awilliam@redhat.com>
Chao Wang <chaowang@redhat.com>
Frederic Crozat <fcrozat@suse.com>
James Lee <jlee@thestaticvoid.com>
Jesse Keating <jkeating@redhat.com>
Masahiro Matsuya <mmatsuya@redhat.com>
Milan Broz <mbroz@redhat.com>
Mimi Zohar <zohar@linux.vnet.ibm.com>
Norbert Lange <norbert.lange@andritz.com>
Pingfan Liu <piliu@redhat.com>
Roberto Sassu <roberto.sassu@polito.it>
Stefan Reimer <it@startux.de>
Takashi Iwai <tiwai@suse.de>
Tony Asleson <tasleson@redhat.com>
Zoltán Böszörményi <zboszor@gmail.com>
Anton Blanchard <anton@samba.org>
Andrey Borzenkov <arvidjaar@mail.ru>
Bill Nottingham <notting@redhat.com>
Chapman Flack <g2@anastigmatix.net>
Chris Leech <cleech@redhat.com>
Daniel Drake <dsd@laptop.org>
David Cantrell <dcantrell@redhat.com>
Dennis Gilmore <dennis@ausil.us>
Doan Tran Cong Danh <congdanhqx@gmail.com>
Gaël PORTAY <gael.portay@collabora.com>
Jan Synacek <jsynacek@redhat.com>
Jiri Konecny <jkonecny@redhat.com>
Jon Ander Hernandez <jonan.h@gmail.com>
Juan RP <xtraeme@gmail.com>
Lance Albertson <lance@osuosl.org>
Marian Ganisin <mganisin@redhat.com>
Matt Coleman <matt@datto.com>
Matthias Gerstner <matthias.gerstner@suse.de>
Max Resch <resch.max@gmail.com>
Michael Ploujnikov <plouj@somanetworks.com>
Nicolas Porcel <nicolasporcel06@gmail.com>
Pratyush Anand <panand@redhat.com>
Silvio Fricke <silvio.fricke@gmail.com>
Stefan Berger <stefanb@linux.ibm.com>
Steven Brudenell <steven.brudenell@gmail.com>
Stig Telfer <stelfer@cray.com>
Thomas Backlund <tmb@mageia.org>
Topi Miettinen <toiwoton@gmail.com>
Vasiliy Tolstov <v.tolstov@selfip.ru>
Wim Muskee <wimmuskee@gmail.com>
Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Alan Pevec <apevec@redhat.com>
Alberto Planas <aplanas@suse.com>
Alex Harpin <development@landsofshadow.co.uk>
Alexander Wenzel <alexander.wenzel@qbeyond.de>
Alexey Shabalin <shaba@altlinux.org>
Andre Russ <andre.russ@sap.com>
Andreas Schwab <schwab@suse.de>
Ankit Kumar <ankit@linux.vnet.ibm.com>
Antony Messerli <amesserl@rackspace.com>
Chao Fan <cfan@redhat.com>
Coiby Xu <coxu@redhat.com>
Cornelius Hoffmann <coding@hoffmn.de>
Daniel Cordero <dracut@0xdc.io>
Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Daniel Schaal <farbing@web.de>
Denis Silakov <dsilakov@virtuozzo.com>
Dimitri John Ledkov <dimitri.j.ledkov@intel.com>
Erwan Velu <erwan.velu@enovance.com>
Evgeny Vereshchagin <evvers@ya.ru>
German Maglione <gmaglione@redhat.com>
Guido Trentalancia <guido@trentalancia.net>
Hari Bathini <hbathini@linux.ibm.com>
Hari Bathini <hbathini@linux.vnet.ibm.com>
Henrik Gombos <henrik99999@gmail.com>
Ian Dall <ian@beware.dropbear.id.au>
Imran Haider <imran1008@gmail.com>
James Buren <ryuo@frugalware.org>
Jan Macku <jamacku@redhat.com>
Dan Horák <dan@danny.cz>
Joey Boggs <jboggs@redhat.com>
José María Fernández <josemariafg@gmail.com>
Julian Wolf <juwolf@suse.com>
Koen Kooi <koen@dominion.thruhere.net>
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Kyle McMartin <kmcmarti@redhat.com>
Lee Duncan <lduncan@suse.com>
Luiz Angelo Daros de Luca <luizluca@gmail.com>
Lukas Wunner <lukas@wunner.de>
Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Marko Myllynen <myllynen@redhat.com>
Matthew Thode <mthode@mthode.org>
Michal Koutný <mkoutny@suse.com>
Mike Snitzer <snitzer@redhat.com>
Minfei Huang <mhuang@redhat.com>
Nikoli <nikoli@gmx.us>
Patrick Talbert <ptalbert@redhat.com>
Pedro Monreal <pmgdeb@gmail.com>
Petr Pavlu <petr.pavlu@suse.com>
Przemysław Rudy <prudy1@o2.pl>
Robert LeBlanc <robert@leblancnet.us>
Robert Scheck <robert@fedoraproject.org>
Stefan Berger <stefanb@us.ibm.com>
Thomas Lange <lange@informatik.uni-koeln.de>
Till Maas <opensource@till.name>
Vivek Goyal <vgoyal@redhat.com>
Vladislav Bogdanov <bubble@hoster-ok.com>
keentux <valentin.lefebvre@suse.com>
nkraetzschmar <nkraetzschmar@users.noreply.github.com>
Érico Rolim <erico.erc@gmail.com>
A. Wilcox <AWilcox@Wilcox-Tech.com>
Adam Alves <adamoa@gmail.com>
Adrien Thierry <athierry@redhat.com>
Alexander Kurtz <alexander@kurtz.be>
Alexander Miroshnichenko <alex@millerson.name>
Alexander Sosedkin <asosedkin@redhat.com>
Alexander Todorov <atodorov@redhat.com>
Alexey Kodanev <alexey.kodanev@oracle.com>
Andreas Stieger <astieger@suse.com>
Andrew J. Hesford <ajh@sideband.org>
Andrey Sokolov <keremet@altlinux.org>
Andy Lutomirski <luto@mit.edu>
Anjali Kulkarni <anjali.k.kulkarni@oracle.com>
Anssi Hannula <anssi@mageia.org>
Antz <antzz@protonmail.ch>
Arnaud Rebillout <arnaud.rebillout@collabora.com>
Artem Savkov <asavkov@redhat.com>
Attila Bruncsak <bruncsak@users.noreply.github.com>
B. Wilson <x@wilsonb.com>
Ben Howard <ben.howard@redhat.com>
Benjamin Gilbert <bgilbert@redhat.com>
Benjamin Marzinski <bmarzins@redhat.com>
Brandon Philips <brandon@ifup.co>
Brandon Sloane <btsloane@verizon.net>
Bruno E. O. Meneguele <bmeneg@redhat.com>
Bryn M. Reeves <bmr@redhat.com>
Canek Peláez Valdés <caneko@gmail.com>
Carlo Caione <carlo@endlessm.com>
Chad Dupuis <chad.dupuis@cavium.com>
Charles Rose <charles.rose@dell.com>
Christian Heinz <christian.ch.heinz@gmail.com>
Cole Robinson <crobinso@redhat.com>
Cong Wang <amwang@redhat.com>
Conrad Hoffmann <ch@bitfehler.net>
Daan De Meyer <daan.j.demeyer@gmail.com>
Dan Fuhry <dfuhry@datto.com>
Dave Jones <davej@redhat.com>
David Hildenbrand <david@redhat.com>
David Michael <david.michael@coreos.com>
Denis Volkov <denis@simpletexting.net>
Dennis Schridde <devurandom@gmx.net>
Derek Hageman <hageman@inthat.cloud>
Derek Higgins <derekh@redhat.com>
Dirk Müller <dirk@dmllr.de>
Donovan Tremura <neurognostic@protonmail.ch>
Duane Griffin <duaneg@dghda.com>
Elan Ruusamäe <glen@delfi.ee>
Enno Boland <g@s01.de>
Enzo Matsumiya <ematsumiya@suse.de>
Eugene S. Sobolev <sobolev@protei.ru>
Eugene Syromiatnikov <esyr@redhat.com>
Evgeni Golov <evgeni@golov.de>
Fabian Vogt <fvogt@suse.de>
Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
Florian Gamböck <mail@floga.de>
Frank Deng <frank.deng@oracle.com>
François Cami <fcami@fedoraproject.org>
Frederick Grose <4335897+FGrose@users.noreply.github.com>
Gerd von Egidy <gerd.von.egidy@intra2net.com>
Glen Gray <slaine@slaine.org>
Glenn Morris <rgm@stanford.edu>
GuoChuang <guo.chuang@zte.com.cn>
HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
Hendrik Brueckner <brueckner@linux.ibm.com>
Hermann Gausterer <git-dracut-2012@mrq1.org>
Hiroaki Mizuguchi <hiroaki-m@iij.ad.jp>
Hongxu Jia <hongxu.jia@windriver.com>
Hui Wang <john.wanghui@huawei.com>
Ignaz Forster <iforster@suse.com>
Jacob Wen <jian.w.wen@oracle.com>
James Laska <jlaska@redhat.com>
James Morris <morisja@gmail.com>
Jan Stodola <jstodola@redhat.com>
Jaroslav Jindrak <dzejrou@gmail.com>
Jason Dana <jasondana@quarksecurity.com>
Jens Heise <46450477+heisej@users.noreply.github.com>
Jeremy Linton <jlinton@redhat.com>
Jeremy Linton <lintonrjeremy@gmail.com>
Jiri Pirko <jiri@resnulli.us>
Joe Lawrence <Joe.Lawrence@stratus.com>
Johannes Thumshirn <jthumshirn@suse.com>
Jonas Jelten <jj@sft.lol>
Jonas Jonsson <jonas@websystem.se>
Jonas Witschel <diabonas@archlinux.org>
Kenneth D'souza <kennethdsouza94@gmail.com>
Kevin Yung <Kevin.Yung@myob.com>
Lars R. Damerow <lars@pixar.com>
Lars Wendler <polynomial-c@gentoo.org>
Laura Hild <lsh@jlab.org>
Lennart Poettering <lennart@poettering.net>
Lennert Buytenhek <buytenh@wantstofly.org>
Lev Veyde <lveyde@redhat.com>
Lianbo Jiang <lijiang@redhat.com>
LinkTed <link.ted@mailbox.org>
Luca BRUNO <luca.bruno@coreos.com>
Lucas C. Villa Real <lucasvr@gmail.com>
Major Hayden <major@mhtx.net>
Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Marian Csontos <mcsontos@redhat.com>
Mark Fasheh <mfasheh@suse.de>
Matt <smoothsailing72@hotmail.com>
Matt Smith <shadowfax@gmx.com>
Matthias Berndt <matthias_berndt@gmx.de>
Mei Liu <liumbj@linux.vnet.ibm.com>
Michael Chapman <mike@very.puzzling.org>
Michael McCracken <michael.mccracken@gmail.com>
Michal Hecko <mhecko@redhat.com>
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Luca Berra <bluca@vodka.it>
Michal Schmidt <mschmidt@redhat.com>
Michal Sekletar <msekleta@redhat.com>
Mike Gorse <mgorse@suse.com>
Moritz 'Morty' Strübe <morty@gmx.net>
Morten Linderud <morten@linderud.pw>
Mike Snitzer <msnitzer@redhat.com>
Mike Snitzer <snitzer@redhat.com>
Munehiro Matsuda <haro@kgt.co.jp>
Neal Gompa <neal@gompa.dev>
Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Olivier Blin <dev@blino.org>
Ondrej Dubaj <odubaj@redhat.com>
P J P <ppandit@redhat.com>
Paolo Bonzini <pbonzini@redhat.com>
Paul Robins <exp@users.noreply.github.com>
Pavel Zhukov <pzhukov@redhat.com>
Pawel Wieczorkiewicz <pwieczorkiewicz@suse.de>
Pekka Wallendahl <wyrmiyu@gmail.com>
Peter Georg <peter.georg@physik.uni-regensburg.de>
Peter Levine <plevine457@gmail.com>
Petr Tesarik <ptesarik@suse.com>
Petr Vorel <pvorel@suse.cz>
Prarit Bhargava <prarit@redhat.com>
Praveen_Paladugu@Dell.com <Praveen_Paladugu@Dell.com>
Pádraig Brady <P@draigBrady.com>
Peter Rajnoha <prajnoha@redhat.com>
Quentin Armitage <quentin@armitage.org.uk>
Robert Buchholz <rbu@goodpoint.de>
Ruben Kerkhof <ruben@rubenkerkhof.com>
Rumbaut Thomas <Thomas.Rumbaut@digipolis.gent>
Rusty Bird <rustybird@openmailbox.org>
Savyasachee Jha <genghizkhan91@hawkradius.com>
Scott Moser <smoser@brickies.net>
Sebastian Mitterle <smitterl@redhat.com>
Sergei Iudin <tsipa740@gmail.com>
Sergey Fionov <fionov@gmail.com>
Shawn W Dunn <sfalken@opensuse.org>
Srinivasa T N <seenutn@linux.vnet.ibm.com>
Stijn Hoop <stijn@sandcat.nl>
Sullivan (CTR), Austin <austin.sullivan.ctr@progeny.net>
Thierry Vignaud <thierry.vignaud@gmail.com>
Thilo Bangert <thilo.bangert@gmx.net>
Thomas Abraham <tabraham@suse.com>
Thomas Haller <thaller@redhat.com>
Tianhao Chai <cth451@gmail.com>
Tobias Geerinckx <tobias.geerinckx@gmail.com>
Tobias Klauser <tklauser@distanz.ch>
Tom Gundersen <teg@jklm.no>
Tomasz Torcz <tomek@pipebreaker.pl>
Tong Li <tonli@redhat.com>
Vadim Kuznetsov <vadimk@gentoo.org>
Vaughan Cao <vaughan.cao@oracle.com>
Vladius25 <vkorol2509@icloud.com>
Vratislav Podzimek <vpodzime@redhat.com>
Wenchao Hao <haowenchao@huawei.com>
Yang Liu <50459973+ly4096x@users.noreply.github.com>
Yanko Kaneti <yaneti@declera.com>
Zhiguo Deng <bjzgdeng@linux.vnet.ibm.com>
Ziyue Yang <ziyang@redhat.com>
foopub <45460217+foopub@users.noreply.github.com>
gaoyi <ymuemc@163.com>
gombi <gombi@>
honza801 <honza801@gmail.com>
jbash aka John Bashinski <jbash@velvet.com>
jloeser <jloeser@suse.de>
joamonwx <unknown>
johannes <johannes.brechtmann@gmail.com>
jonathan-teh <30538043+jonathan-teh@users.noreply.github.com>
joshuacov1 <joshuacov@gmail.com>
lapseofreason <lapseofreason0@gmail.com>
leo-lb <lle-bout@zaclys.net>
logan <logancaldwell23@gmail.com>
masem <matej.semian@gmail.com>
maximilian attems <max@stro.at>
mulhern <amulhern@redhat.com>
mwberry <mwberry@users.noreply.github.com>
nabijaczleweli <nabijaczleweli@gmail.com>
privb0x23 <privb0x23@users.noreply.github.com>
realtime-neil <neil@rtr.ai>
runsisi <runsisi@hust.edu.cn>
tupper <tupper.bob@gmail.com>
xtraeme <xtraeme@voidlinux.eu>
Дамјан Георгиевски <gdamjan@gmail.com>

View File

@@ -1,22 +0,0 @@
We welcome contributions from everyone. However, please follow the following guidelines when posting a GitHub Pull Request or filing a GitHub Issue on the dracut project:
By participating in this project, you agree to abide by the [code of conduct](docs/CODE_OF_CONDUCT.md).
# Filing Issues
We use GitHub Issues exclusively for tracking bugs and feature requests of dracut.
We only track bugs in the two most recently released versions of dracut in the GitHub Issue tracker.
If you are using an older version of dracut, please contact your distribution's bug tracker instead (see below). See GitHub Release Page for the list of most recent releases.
When filing an issue, specify the dracut version you are experiencing the issue with. Also, indicate which distribution you are using.
Please include an explanation how to reproduce the issue you are pointing out.
For more information on Coding Style and Commit messages see [Dracut Developer Guidelines](docs/HACKING.md).
# Older or downstream versions
For older or downstream versions that are still supported by your distribution please use respective downstream tracker:
[Debian](https://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=dracut)
[Fedora](https://bugzilla.redhat.com/buglist.cgi?quicksearch=dracut)
[Gentoo](https://bugs.gentoo.org/buglist.cgi?quicksearch=dracut)
[openSUSE](https://bugzilla.opensuse.org/buglist.cgi?quicksearch=dracut)

42
COPYING
View File

@@ -1,12 +1,12 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
@@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
@@ -55,8 +55,8 @@ patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
@@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
@@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
@@ -225,7 +225,7 @@ impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
@@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
@@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
@@ -291,7 +291,7 @@ convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
Copyright (C) 19yy <name of author>
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
@@ -303,16 +303,16 @@ the "copyright" line and a pointer to where the full notice is found.
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, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
@@ -335,5 +335,5 @@ necessary. Here is a sample; alter the names:
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

23
HACKING Normal file
View File

@@ -0,0 +1,23 @@
Right now, most of the testing is done using a qemu/kvm guest and
generating the initramfs on another box but the support is all present
to build for the "running" machine. For the former, you can boot the guest
using qemu's -kernel and -initrd options.
dracut exists and will build an image. It is command-line equivalent
to most mkinitrd implementations and should be pretty straight-forward
to use.
To use, just run dracut with an output file name and, optionally, a
kernel version (it defaults to using the current). The appropriate
modules will be copied over and things should be good to go. If you'd
like to customize the list of modules copied in, edit /etc/dracut.conf
and set
dracutmodules="foo bar baz"
Note that dracut calls functional components in modules.d "modules"
while kernel modules are called "drivers".
Requirements:
* udev
* nfs module: nfs daemon and rpc helper
* iscsi: iscsi

346
Makefile
View File

@@ -1,306 +1,116 @@
-include dracut-version.sh
DRACUT_MAIN_VERSION := $(shell env GIT_CEILING_DIRECTORIES=$(CURDIR)/.. git describe --abbrev=0 --tags --always 2>/dev/null || :)
ifeq ($(DRACUT_MAIN_VERSION),)
DRACUT_MAIN_VERSION = $(DRACUT_VERSION)
endif
DRACUT_FULL_VERSION := $(shell env GIT_CEILING_DIRECTORIES=$(CURDIR)/.. git describe --tags --always 2>/dev/null || :)
ifeq ($(DRACUT_FULL_VERSION),)
DRACUT_FULL_VERSION = $(DRACUT_VERSION)
endif
HAVE_SHELLCHECK ?= $(shell command -v shellcheck >/dev/null 2>&1 && echo yes)
HAVE_SHFMT ?= $(shell command -v shfmt >/dev/null 2>&1 && echo yes)
-include Makefile.inc
KVERSION ?= $(shell uname -r)
VERSION=004
GITVERSION=$(shell [ -d .git ] && git rev-list --abbrev-commit -n 1 HEAD |cut -b 1-8)
prefix ?= /usr
libdir ?= ${prefix}/lib
datadir ?= ${prefix}/share
pkglibdir ?= ${libdir}/dracut
pkglibdir ?= ${datadir}/dracut
sysconfdir ?= ${prefix}/etc
bindir ?= ${prefix}/bin
sbindir ?= ${prefix}/sbin
mandir ?= ${prefix}/share/man
CFLAGS ?= -O2 -g -Wall -std=gnu99 -D_FILE_OFFSET_BITS=64 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
bashcompletiondir ?= ${datadir}/bash-completion/completions
pkgconfigdatadir ?= $(datadir)/pkgconfig
man1pages = man/lsinitrd.1
man5pages = man/dracut.conf.5
.PHONY: install clean archive rpm testimage test all check AUTHORS
man7pages = man/dracut.cmdline.7 \
man/dracut.bootup.7 \
man/dracut.modules.7
man8pages = man/dracut.8 \
man/dracut-catimages.8 \
modules.d/98dracut-systemd/dracut-cmdline.service.8 \
modules.d/98dracut-systemd/dracut-initqueue.service.8 \
modules.d/98dracut-systemd/dracut-mount.service.8 \
modules.d/98dracut-systemd/dracut-shutdown.service.8 \
modules.d/98dracut-systemd/dracut-pre-mount.service.8 \
modules.d/98dracut-systemd/dracut-pre-pivot.service.8 \
modules.d/98dracut-systemd/dracut-pre-trigger.service.8 \
modules.d/98dracut-systemd/dracut-pre-udev.service.8
manpages = $(man1pages) $(man5pages) $(man7pages) $(man8pages)
.PHONY: install clean archive testimage test all check AUTHORS CONTRIBUTORS doc dracut-version.sh
all: dracut-version.sh dracut.pc dracut-install src/skipcpio/skipcpio dracut-util
%.o : %.c
$(CC) -c $(CFLAGS) $(CPPFLAGS) $(KMOD_CFLAGS) $< -o $@
DRACUT_INSTALL_OBJECTS = \
src/install/dracut-install.o \
src/install/hashmap.o\
src/install/log.o \
src/install/strv.o \
src/install/util.o
# deps generated with gcc -MM
src/install/dracut-install.o: src/install/dracut-install.c src/install/log.h src/install/macro.h \
src/install/hashmap.h src/install/util.h
src/install/hashmap.o: src/install/hashmap.c src/install/util.h src/install/macro.h src/install/log.h \
src/install/hashmap.h
src/install/log.o: src/install/log.c src/install/log.h src/install/macro.h src/install/util.h
src/install/util.o: src/install/util.c src/install/util.h src/install/macro.h src/install/log.h
src/install/strv.o: src/install/strv.c src/install/strv.h src/install/util.h src/install/macro.h src/install/log.h
src/install/dracut-install: $(DRACUT_INSTALL_OBJECTS)
$(CC) $(LDFLAGS) -o $@ $(DRACUT_INSTALL_OBJECTS) $(LDLIBS) $(FTS_LIBS) $(KMOD_LIBS)
logtee: src/logtee/logtee.c
$(CC) $(LDFLAGS) -o $@ $<
dracut-install: src/install/dracut-install
ln -fs $< $@
SKIPCPIO_OBJECTS = src/skipcpio/skipcpio.o
skipcpio/skipcpio.o: src/skipcpio/skipcpio.c
skipcpio/skipcpio: $(SKIPCPIO_OBJECTS)
UTIL_OBJECTS = src/util/util.o
util/util.o: src/util/util.c
util/util: $(UTIL_OBJECTS)
dracut-util: src/util/util
cp -a $< $@
.PHONY: indent-c
indent-c:
astyle -n --quiet --options=.astylerc $(wildcard *.[ch] */*.[ch] src/*/*.[ch])
.PHONY: indent
indent: indent-c
ifeq ($(HAVE_SHFMT),yes)
shfmt -w -s .
ifeq (1,${WITH_SWITCH_ROOT})
targets = modules.d/99base/switch_root
else
targets =
endif
src/dracut-cpio/target/release/dracut-cpio: src/dracut-cpio/src/main.rs
cargo --offline build --release --manifest-path src/dracut-cpio/Cargo.toml
all: $(targets) dracut-rhel6.html
dracut-cpio: src/dracut-cpio/target/release/dracut-cpio
ln -fs $< $@
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
ifeq ($(enable_dracut_cpio),yes)
all: dracut-cpio
endif
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
doc: $(manpages) dracut.html
ifneq ($(enable_documentation),no)
all: doc
endif
%: %.xml
@rm -f -- "$@"
xsltproc -o "$@" -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
%.xml: %.asc
@rm -f -- "$@"
asciidoc -a "version=$(DRACUT_FULL_VERSION)" -d manpage -b docbook -o "$@" $<
dracut.8: man/dracut.8.asc \
man/dracut.usage.asc
dracut.html: man/dracut.asc $(manpages) docs/dracut.css man/dracut.usage.asc
@rm -f -- dracut.xml
asciidoc -a "mainversion=$(DRACUT_MAIN_VERSION)" \
-a "version=$(DRACUT_FULL_VERSION)" \
-a numbered \
-d book -b docbook -o dracut.xml man/dracut.asc
@rm -f -- dracut.html
xsltproc -o dracut.html --xinclude -nonet \
--stringparam custom.css.source docs/dracut.css \
--stringparam generate.css.header 1 \
http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl dracut.xml
@rm -f -- dracut.xml
dracut.pc: Makefile.inc Makefile
@echo "Name: dracut" > dracut.pc
@echo "Description: dracut" >> dracut.pc
@echo "Version: $(DRACUT_FULL_VERSION)" >> dracut.pc
@echo "dracutdir=$(pkglibdir)" >> dracut.pc
@echo "dracutmodulesdir=$(pkglibdir)/modules.d" >> dracut.pc
@echo "dracutconfdir=$(pkglibdir)/dracut.conf.d" >> dracut.pc
install: all
install:
mkdir -p $(DESTDIR)$(pkglibdir)
mkdir -p $(DESTDIR)$(bindir)
mkdir -p $(DESTDIR)$(sbindir)
mkdir -p $(DESTDIR)$(sysconfdir)
mkdir -p $(DESTDIR)$(pkglibdir)/modules.d
mkdir -p $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5 $(DESTDIR)$(mandir)/man7 $(DESTDIR)$(mandir)/man8
install -m 0755 dracut.sh $(DESTDIR)$(bindir)/dracut
install -m 0755 dracut-catimages.sh $(DESTDIR)$(bindir)/dracut-catimages
install -m 0755 lsinitrd.sh $(DESTDIR)$(bindir)/lsinitrd
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
mkdir -p $(DESTDIR)$(pkglibdir)/dracut.conf.d
install -m 0755 dracut-init.sh $(DESTDIR)$(pkglibdir)/dracut-init.sh
install -m 0755 dracut-functions.sh $(DESTDIR)$(pkglibdir)/dracut-functions.sh
install -m 0755 dracut-version.sh $(DESTDIR)$(pkglibdir)/dracut-version.sh
ln -fs dracut-functions.sh $(DESTDIR)$(pkglibdir)/dracut-functions
install -m 0755 dracut-logger.sh $(DESTDIR)$(pkglibdir)/dracut-logger.sh
install -m 0755 dracut-initramfs-restore.sh $(DESTDIR)$(pkglibdir)/dracut-initramfs-restore
install -m 0755 dracut-functions $(DESTDIR)$(pkglibdir)/dracut-functions
cp -arx modules.d $(DESTDIR)$(pkglibdir)
ifneq ($(enable_documentation),no)
for i in $(man1pages); do install -m 0644 $$i $(DESTDIR)$(mandir)/man1/$${i##*/}; done
for i in $(man5pages); do install -m 0644 $$i $(DESTDIR)$(mandir)/man5/$${i##*/}; done
for i in $(man7pages); do install -m 0644 $$i $(DESTDIR)$(mandir)/man7/$${i##*/}; done
for i in $(man8pages); do install -m 0644 $$i $(DESTDIR)$(mandir)/man8/$${i##*/}; done
ln -fs dracut.cmdline.7 $(DESTDIR)$(mandir)/man7/dracut.kernel.7
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
if [ -n "$(systemdsystemunitdir)" ]; then \
mkdir -p $(DESTDIR)$(systemdsystemunitdir); \
ln -srf $(DESTDIR)$(pkglibdir)/modules.d/98dracut-systemd/dracut-shutdown-onfailure.service $(DESTDIR)$(systemdsystemunitdir)/dracut-shutdown-onfailure.service; \
ln -srf $(DESTDIR)$(pkglibdir)/modules.d/98dracut-systemd/dracut-shutdown.service $(DESTDIR)$(systemdsystemunitdir)/dracut-shutdown.service; \
mkdir -p $(DESTDIR)$(systemdsystemunitdir)/sysinit.target.wants; \
ln -s ../dracut-shutdown.service \
$(DESTDIR)$(systemdsystemunitdir)/sysinit.target.wants/dracut-shutdown.service; \
mkdir -p $(DESTDIR)$(systemdsystemunitdir)/initrd.target.wants; \
for i in \
dracut-cmdline.service \
dracut-initqueue.service \
dracut-mount.service \
dracut-pre-mount.service \
dracut-pre-pivot.service \
dracut-pre-trigger.service \
dracut-pre-udev.service \
; do \
ln -srf $(DESTDIR)$(pkglibdir)/modules.d/98dracut-systemd/$$i $(DESTDIR)$(systemdsystemunitdir); \
ln -s ../$$i \
$(DESTDIR)$(systemdsystemunitdir)/initrd.target.wants/$$i; \
done \
fi
if [ -f src/install/dracut-install ]; then \
install -m 0755 src/install/dracut-install $(DESTDIR)$(pkglibdir)/dracut-install; \
fi
if [ -f src/skipcpio/skipcpio ]; then \
install -m 0755 src/skipcpio/skipcpio $(DESTDIR)$(pkglibdir)/skipcpio; \
fi
if [ -f dracut-util ]; then \
install -m 0755 dracut-util $(DESTDIR)$(pkglibdir)/dracut-util; \
fi
ifeq ($(enable_dracut_cpio),yes)
install -m 0755 dracut-cpio $(DESTDIR)$(pkglibdir)/dracut-cpio
endif
mkdir -p $(DESTDIR)${prefix}/lib/kernel/install.d
install -m 0755 install.d/50-dracut.install $(DESTDIR)${prefix}/lib/kernel/install.d/50-dracut.install
install -m 0755 install.d/51-dracut-rescue.install $(DESTDIR)${prefix}/lib/kernel/install.d/51-dracut-rescue.install
mkdir -p $(DESTDIR)${bashcompletiondir}
install -m 0644 shell-completion/bash/dracut $(DESTDIR)${bashcompletiondir}/dracut
install -m 0644 shell-completion/bash/lsinitrd $(DESTDIR)${bashcompletiondir}/lsinitrd
mkdir -p $(DESTDIR)${pkgconfigdatadir}
install -m 0644 dracut.pc $(DESTDIR)${pkgconfigdatadir}/dracut.pc
dracut-version.sh:
@rm -f dracut-version.sh
@printf "#!/bin/sh\n# shellcheck disable=SC2034\nDRACUT_VERSION=%s\n" "$(DRACUT_FULL_VERSION)" > dracut-version.sh
clean:
$(RM) *~
$(RM) */*~
$(RM) */*/*~
$(RM) $(manpages:%=%.xml) dracut.xml
$(RM) test-*.img
$(RM) dracut-*.tar.bz2 dracut-*.tar.xz
$(RM) dracut-version.sh
$(RM) dracut-install src/install/dracut-install $(DRACUT_INSTALL_OBJECTS)
$(RM) skipcpio/skipcpio $(SKIPCPIO_OBJECTS)
$(RM) dracut-util util/util $(UTIL_OBJECTS)
$(RM) $(manpages) dracut.html
$(RM) dracut.pc
$(RM) dracut-cpio src/dracut-cpio/target/release/dracut-cpio*
$(MAKE) -C test clean
rm -f *~
rm -f modules.d/99base/switch_root
rm -f test-*.img
rm -f dracut-*.rpm dracut-*.tar.bz2
make -C test clean
dist: dracut-$(DRACUT_MAIN_VERSION).tar.xz
archive: dracut-$(VERSION)-$(GITVERSION).tar.bz2
dracut-$(DRACUT_MAIN_VERSION).tar.xz: doc syncheck
@echo "DRACUT_VERSION=$(DRACUT_MAIN_VERSION)" > dracut-version.sh
git archive --format=tar $(DRACUT_MAIN_VERSION) --prefix=dracut-$(DRACUT_MAIN_VERSION)/ > dracut-$(DRACUT_MAIN_VERSION).tar
mkdir -p dracut-$(DRACUT_MAIN_VERSION)
for i in $(manpages) dracut.html dracut-version.sh; do [ "$${i%/*}" != "$$i" ] && mkdir -p "dracut-$(DRACUT_MAIN_VERSION)/$${i%/*}"; cp "$$i" "dracut-$(DRACUT_MAIN_VERSION)/$$i"; done
tar --owner=root --group=root -rf dracut-$(DRACUT_MAIN_VERSION).tar $$(find dracut-$(DRACUT_MAIN_VERSION) -type f)
rm -fr -- dracut-$(DRACUT_MAIN_VERSION).tar.xz dracut-$(DRACUT_MAIN_VERSION)
xz -9 dracut-$(DRACUT_MAIN_VERSION).tar
rm -f -- dracut-$(DRACUT_MAIN_VERSION).tar
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: 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 )
syncheck:
@ret=0;for i in dracut-initramfs-restore.sh modules.d/*/*.sh; do \
[ "$${i##*/}" = "module-setup.sh" ] && continue; \
read line < "$$i"; [ "$${line#*bash*}" != "$$line" ] && continue; \
[ $$V ] && echo "posix syntax check: $$i"; bash --posix -n "$$i" ; ret=$$(($$ret+$$?)); \
[ $$V ] && echo "checking for [[: $$i"; if grep -Fq '[[ ' "$$i" ; then ret=$$(($$ret+1)); echo "$$i contains [["; fi; \
[ $$V ] && echo "checking for echo -n: $$i"; if grep -Fq 'echo -n ' "$$i" ; then ret=$$(($$ret+1)); echo "$$i contains echo -n"; fi \
@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
@ret=0;for i in *.sh modules.d/*/*.sh modules.d/*/module-setup.sh; do \
[ $$V ] && echo "bash syntax check: $$i"; bash -n "$$i" ; ret=$$(($$ret+$$?)); \
@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
ifeq ($(HAVE_SHELLCHECK),yes)
ifeq ($(HAVE_SHFMT),yes)
shellcheck $$(shfmt -f .)
else
find . -name '*.sh' -print0 | xargs -0 shellcheck
endif
endif
check: all syncheck
@[ "$$EUID" == "0" ] || { echo "'check' must be run as root! Please use 'sudo'."; exit 1; }
@$(MAKE) -C test check
$(MAKE) -C test check
testimage: all
./dracut.sh -N -l -a debug -f test-$(KVERSION).img $(KVERSION)
@echo wrote test-$(KVERSION).img
debugtestimage: all
./dracut.sh --debug -l -a debug -f test-$(KVERSION).img $(KVERSION)
@echo wrote test-$(KVERSION).img
./dracut -l -a debug -f test-$(shell uname -r).img $(shell uname -r)
@echo wrote test-$(shell uname -r).img
testimages: all
./dracut.sh -l -a debug --kernel-only -f test-kernel-$(KVERSION).img $(KVERSION)
@echo wrote test-$(KVERSION).img
./dracut.sh -l -a debug --no-kernel -f test-dracut.img $(KVERSION)
@echo wrote test-dracut.img
debughostimage: all
./dracut.sh --debug -H -l -f test-$(KVERSION).img $(KVERSION)
@echo wrote test-$(KVERSION).img
./dracut -l -a debug --kernel-only -f test-kernel-$(shell uname -r).img $(shell uname -r)
@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.sh -H -l -f test-$(KVERSION).img $(KVERSION)
@echo wrote test-$(KVERSION).img
efi: all
./dracut.sh --uefi -H -l -f linux-$(KVERSION).efi $(KVERSION)
@echo wrote linux-$(KVERSION).efi
./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 || [ -n "$$rest" ]; do echo $$rest;done > AUTHORS
CONTRIBUTORS:
@git shortlog $(DRACUT_MAIN_VERSION).. --numbered --summary -e |while read a rest || [ -n "$$rest" ]; do echo "- $$rest";done
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

2862
NEWS.md

File diff suppressed because it is too large Load Diff

78
README Normal file
View File

@@ -0,0 +1,78 @@
Dracut
------
Dracut is a new initramfs infrastructure.
Information about the initial goals and aims can be found at
https://fedoraproject.org/wiki/Initrdrewrite
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.
This helps to keep the time required in the initramfs as little as
possible so that things like a 5 second boot aren't made impossible as
a result of the very existence of an initramfs. It's likely that
we'll grow some hooks for running arbitrary commands in the flow of
the script, but it's worth trying to resist the urge as much as we can
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.
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,
scripts, and kernel modules) installing dependencies as appropriate so
you do not have to.
* Scripts that end up on the initrd should be POSIX compliant. dracut
will try to use /bin/dash as /bin/sh for the initrd if it is available,
so you should install it on your system -- dash aims for strict POSIX
compliance to the extent possible.
* Hooks MUST be POSIX compliant -- they are sourced by the init script,
and having a bashism break your user's ability to boot really sucks.
* Generator modules should have a two digit numeric prefix -- they run in
ascending sort order. Anything in the 90-99 range is stuff that dracut
relies on, so try not to break those hooks.
* Hooks must have a .sh extension.
* Generator modules are described in more detail in README.modules.
* We have some breakpoints for debugging your hooks. If you pass 'rdbreak'
as a kernel parameter, the initramfs will drop to a shell just before
switching to a new root. You can pass 'rdbreak=hookpoint', and the initramfs
will break just before hooks in that hookpoint run.
Also, there is an attempt to keep things as distribution-agnostic as
possible. Every distribution has their own tool here and it's not
something which is really interesting to have separate across them.
So contributions to help decrease the distro-dependencies are welcome.
Currently dracut lives on sourceforge.
Project Page:
https://sourceforge.net/projects/dracut/
Drop Harald Hoyer <harald@redhat.com> a mail, if you want to help with
the documentation, git access, etc.
Git Repository:
http://dracut.git.sourceforge.net/
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/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
a typical vger list, send mail to majordomo@vger.kernel.org with body
of 'subscribe initramfs email@host.com'
Licensed under the GPLv2

View File

@@ -1,7 +1,7 @@
To build a generic initramfs, you have to install the following software packages:
* device-mapper
* cryptsetup-luks
* rpcbind nfs-utils
* rpcbind nfs-utils
* lvm2
* iscsi-initiator-utils
* nbd

6
README.kernel Normal file
View File

@@ -0,0 +1,6 @@
dracut-kernel is used to pull in all firmware files to build an initrd with
only kernel modules and firmware files.
dracut --kernel-only only executes "installkernel" in the modules
subdirectories.

View File

@@ -1,50 +0,0 @@
dracut
====
dracut is an event driven initramfs infrastructure.
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](docs/CODE_OF_CONDUCT.md)
dracut (the tool) is used to create an initramfs image by copying tools
and files from an installed system and combining it with the
dracut framework, usually found in /usr/lib/dracut/modules.d.
Unlike other implementations, dracut hard-codes as little
as possible into the initramfs. 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.
This helps to keep the time required in the initramfs as little as
possible so that things like a 5 second boot aren't made impossible as
a result of the very existence of an initramfs.
Most of the initramfs 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 initramfs. They live in the modules.d
subdirectory, and use functionality provided by dracut-functions to do their
work.
Documentation:
- [Introduction](man/dracut.asc)
- [User Manual](man/dracut.usage.asc)
Currently dracut is developed on [github.com](https://github.com/dracutdevs/dracut).
The release tarballs are [here](https://github.com/dracutdevs/dracut/releases).
Gitter (chat):
- https://gitter.im/dracutdevs/Lobby
See [News](NEWS.md) for information about changes in the releases and
the [Wiki](https://github.com/dracutdevs/dracut/wiki) to share information.
See the github issue tracker for things which still need to be done and [Hacking](docs/HACKING.md)
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 a typical vger list, send mail to majordomo@vger.kernel.org with body
of 'subscribe initramfs email@host.com'
Licensed under the GPLv2

99
README.modules Normal file
View File

@@ -0,0 +1,99 @@
Most of the functionality that dracut implements are actually implemented
by dracut modules. Dracut modules live in modules.d, and have the following
structure:
dracut_install_dir/modules.d/
00modname/
install
check
<other files as needed by the hook>
00modname: The name of the module prefixed by a two-digit numeric sort code.
The numeric code must be present and in the range of 00 - 99.
Modules with lower numbers are installed first. This is important
because the dracut install functions (which install files onto
the initrd) refuse to overwrite already installed files. This makes
it easy for an earlier module to override the functionality of a
later module, so that you can have a distro or system specific
module override or modify the functionality of a generic module
without having to patch the more generic module.
install: dracut sources this script to install the functionality that a
module implements onto the initrd. For the most part, this amounts
to copying files from the host system onto the initrd in a controlled
manner. dracut supplies several install functions that are
specialized for different file types. Browse through dracut-functions
fore more details. dracut also provides a $moddir variable if you
need to install a file from the module directory, such as an initrd
hook, a udev rule, or a specialized executable.
check: Dracut calls this program to check and see if a module can be installed
on the initrd.
When called without options, check should check to make sure that
any files it needs to install into the initrd from the host system
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
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
encrypted volumes, it should return 0 if all the tools to handle
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.
Any other files in the module will not be touched by dracut directly.
You are encouraged to provide a README that describes what the module is for.
HOOKS
=====
init has the following hook 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
Network filesystems like NFS that do not use device files are an
exception. Root can be mounted already at this point.
/mount/*.sh
scripts to mount the root filesystem
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.

2
TODO Normal file
View File

@@ -0,0 +1,2 @@
See https://sourceforge.net/apps/trac/dracut/wiki/TODO

169
configure vendored
View File

@@ -1,169 +0,0 @@
#!/bin/bash
# We don't support srcdir != builddir
echo \#buildapi-variable-no-builddir > /dev/null
prefix=/usr
enable_documentation=yes
enable_dracut_cpio=no
CC="${CC:-cc}"
PKG_CONFIG="${PKG_CONFIG:-pkg-config}"
# Little helper function for reading args from the commandline.
# it automatically handles -a b and -a=b variants, and returns 1 if
# we need to shift $3.
read_arg() {
# $1 = arg name
# $2 = arg value
# $3 = arg parameter
local rematch='^[^=]*=(.*)$'
if [[ $2 =~ $rematch ]]; then
read -r "$1" <<< "${BASH_REMATCH[1]}"
else
read -r "$1" <<< "$3"
# There is no way to shift our callers args, so
# return 1 to indicate they should do it instead.
return 1
fi
return 0
}
while (($# > 0)); do
case "${1%%=*}" in
--prefix) read_arg prefix "$@" || shift ;;
--libdir) read_arg libdir "$@" || shift ;;
--datadir) read_arg datadir "$@" || shift ;;
--sysconfdir) read_arg sysconfdir "$@" || shift ;;
--sbindir) read_arg sbindir "$@" || shift ;;
--mandir) read_arg mandir "$@" || shift ;;
--disable-documentation) enable_documentation=no ;;
--program-prefix) read_arg programprefix "$@" || shift ;;
--exec-prefix) read_arg execprefix "$@" || shift ;;
--bindir) read_arg bindir "$@" || shift ;;
--includedir) read_arg includedir "$@" || shift ;;
--libexecdir) read_arg libexecdir "$@" || shift ;;
--localstatedir) read_arg localstatedir "$@" || shift ;;
--sharedstatedir) read_arg sharedstatedir "$@" || shift ;;
--infodir) read_arg infodir "$@" || shift ;;
--systemdsystemunitdir) read_arg systemdsystemunitdir "$@" || shift ;;
--bashcompletiondir) read_arg bashcompletiondir "$@" || shift ;;
--enable-dracut-cpio) enable_dracut_cpio=yes ;;
*) echo "Ignoring unknown option '$1'" ;;
esac
shift
done
if ! ${PKG_CONFIG} --exists --print-errors " libkmod >= 23 "; then
echo "dracut needs pkg-config and libkmod >= 23." >&2
exit 1
fi
cat << EOF > conftest.c
#include <fts.h>
int main() {
return 0;
}
EOF
# shellcheck disable=SC2086
${CC} $CFLAGS $LDFLAGS conftest.c > /dev/null 2>&1
ret=$?
rm -f conftest.c a.out
# musl doesn't have fts.h included
if test $ret -ne 0; then
echo "dracut needs fts development files." >&2
exit 1
fi
cat << EOF > conftest.c
#include <fts.h>
int main(void) {
fts_open(0, 0, 0);
return 0;
}
EOF
found=no
for lib in "-lc" "-lfts"; do
# shellcheck disable=SC2086
${CC} $CFLAGS $LDFLAGS conftest.c -Wl,$lib > /dev/null 2>&1
ret=$?
if test $ret -eq 0; then
FTS_LIBS="$lib"
found=yes
break
fi
done
rm -f conftest.c a.out
if test $found = no; then
echo "dracut couldn't find usable fts library" >&2
exit 1
fi
cat << EOF > conftest.c
#include <stdio.h>
#include <unistd.h>
#include <sys/syscall.h>
#ifndef SYS_gettid
#error "SYS_gettid unavailable on this system"
#endif
#define gettid() ((pid_t) syscall(SYS_gettid))
int main(void) {
return getpid() == gettid() ? 0 : -1;
}
EOF
# shellcheck disable=SC2086
${CC} $CFLAGS $LDFLAGS conftest.c > /dev/null 2>&1
ret=$?
rm -f conftest.c a.out
if test $ret -ne 0; then
echo "dracut needs SYS_gettid support." >&2
exit 1
fi
if test "$enable_dracut_cpio" = "yes"; then
cargo --version > /dev/null
ret=$?
if test $ret -ne 0; then
echo "dracut couldn't find cargo for dracut-cpio build"
exit 1
fi
fi
cat > Makefile.inc.$$ << EOF
prefix ?= ${prefix}
libdir ?= ${libdir:-${prefix}/lib}
datadir ?= ${datadir:-${prefix}/share}
sysconfdir ?= ${sysconfdir:-${prefix}/etc}
sbindir ?= ${sbindir:-${prefix}/sbin}
mandir ?= ${mandir:-${prefix}/share/man}
enable_documentation ?= ${enable_documentation:-yes}
enable_dracut_cpio ?= ${enable_dracut_cpio}
bindir ?= ${bindir:-${prefix}/bin}
KMOD_CFLAGS ?= $(${PKG_CONFIG} --cflags " libkmod >= 23 ")
KMOD_LIBS ?= $(${PKG_CONFIG} --libs " libkmod >= 23 ")
FTS_LIBS ?= ${FTS_LIBS}
EOF
{
[[ $programprefix ]] && echo "programprefix ?= ${programprefix}"
[[ $execprefix ]] && echo "execprefix ?= ${execprefix}"
[[ $includedir ]] && echo "includedir ?= ${includedir}"
[[ $libexecdir ]] && echo "libexecdir ?= ${libexecdir}"
[[ $localstatedir ]] && echo "localstatedir ?= ${localstatedir}"
[[ $sharedstatedir ]] && echo "sharedstatedir ?= ${sharedstatedir}"
[[ $infodir ]] && echo "infodir ?= ${infodir}"
[[ $systemdsystemunitdir ]] && echo "systemdsystemunitdir ?= ${systemdsystemunitdir}"
[[ $bashcompletiondir ]] && echo "bashcompletiondir ?= ${bashcompletiondir}"
} >> Makefile.inc.$$
mv Makefile.inc.$$ Makefile.inc

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

View File

@@ -1,213 +0,0 @@
# BASH Notes
## basename
Don't use `basename`, use:
```shell
file=${path##*/}
```
## dirname
Don't use `dirname`, use:
```shell
dir=${path%/*}
```
## shopt
If you set `shopt` in a function, reset to its default state with `trap`:
```shell
func() {
trap "$(shopt -p globstar)" RETURN
shopt -q -s globstar
}
```
## find, grep, print0, -0, -z
Don't use `find` in `for` loops, because filenames can contain spaces.
Try to use `globstar` and `nullglob` or null byte terminated strings.
Instead of:
```shell
func() {
for file in $(find /usr/lib* -type f -name 'lib*.a' -print0 ); do
echo $file
done
}
```
use:
```shell
func() {
trap "$(shopt -p nullglob globstar)" RETURN
shopt -q -s nullglob globstar
for file in /usr/lib*/**/lib*.a; do
[[ -f $file ]] || continue
echo "$file"
done
}
```
Or collect the filenames in an array, if you need them more than once:
```shell
func() {
trap "$(shopt -p globstar)" RETURN
shopt -q -s globstar
filenames=( /usr/lib*/**/lib*.a )
for file in "${filenames[@]}"; do
[[ -f $file ]] || continue
echo "$file"
done
}
```
Or, if you really want to use `find`, use `-print0` and an array:
```shell
func() {
mapfile -t -d '' filenames < <(find /usr/lib* -type f -name 'lib*.a' -print0)
for file in "${filenames[@]}"; do
echo "$file"
done
}
```
Note: `-d ''` is the same as `-d $'\0'` and sets the null byte as the delimiter.
or:
```shell
func() {
find /usr/lib* -type f -name 'lib*.a' -print0 | while read -r -d '' file; do
echo "$file"
done
}
```
or
```shell
func() {
while read -r -d '' file; do
echo "$file"
done < <(find /usr/lib* -type f -name 'lib*.a' -print0)
}
```
Use the tool options for null terminated strings, like `-print0`, `-0`, `-z`, etc.
## prefix or suffix array elements
Instead of:
```shell
func() {
other-cmd $(for k in "$@"; do echo "prefix-$k"; done)
}
```
do
```shell
func() {
other-cmd "${@/#/prefix-}"
}
```
or suffix:
```shell
func() {
other-cmd "${@/%/-suffix}"
}
```
## Join array elements with a separator char
Here we have an associate array `_drivers`, where we want to print the keys separated by ',':
```shell
if [[ ${!_drivers[*]} ]]; then
echo "rd.driver.pre=$(IFS=, ;echo "${!_drivers[*]}")" > "${initdir}"/etc/cmdline.d/00-watchdog.conf
fi
```
## Optional parameters to commands
If you want to call a command `cmd` with an option, if a variable is set, rather than doing:
```shell
func() {
local param="$1"
if [[ $param ]]; then
param="--this-special-option $param"
fi
cmd $param
}
```
do it like this:
```shell
func() {
local param="$1"
cmd ${param:+--this-special-option "$param"}
}
# cmd --this-special-option 'abc'
func 'abc'
# cmd
func ''
# cmd
func
```
If you want to specify the option even with an empty string do this:
```shell
func() {
local -a special_params
if [[ ${1+_} ]]; then
# only declare `param` if $1 is set (even as null string)
local param="$1"
fi
# check if `param` is set (even as null string)
if [[ ${param+_} ]]; then
special_params=( --this-special-option "${param}" )
fi
cmd ${param+"${special_params[@]}"}
}
# cmd --this-special-option 'abc'
func 'abc'
# cmd --this-special-option ''
func ''
# cmd
func
```
Or more simple, if you only have to set an option:
```shell
func() {
if [[ ${1+_} ]]; then
# only declare `param` if $1 is set (even as null string)
local param="$1"
fi
cmd ${param+--this-special-option}
}
# cmd --this-special-option
func 'abc'
# cmd --this-special-option
func ''
# cmd
func
```

View File

@@ -1,56 +0,0 @@
# Dracut Code of Conduct
This code of conduct outlines our expectations for participants within the Dracut community, as well as steps for reporting unacceptable behavior.
We are committed to providing a welcoming and inspiring community for all and expect our code of conduct to be honored.
Anyone who violates this code of conduct may be banned from the community.
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others private information, such as a physical or email address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project maintainer responsible for enforcement Harald Hoyer <harald@profian.com>.
All complaints will be reviewed and investigated promptly and fairly and will result in a response that is deemed necessary and appropriate to the circumstances.
Project maintainers are obligated to respect the privacy and security of the reporter of any incident.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq.
Translations are available at https://www.contributor-covenant.org/translations.

View File

@@ -1,279 +0,0 @@
# Dracut Developer Guidelines
Please make sure to follow our [Contribution Guidelines](../CONTRIBUTING.md).
## git
Currently dracut lives on github.com.
* https://github.com/dracutdevs/dracut.git
Pull requests should be filed preferably on github nowadays.
### Code Format
It is recommended, that you install a plugin for your editor, which reads in `.editorconfig`.
Additionally `emacs` and `vim` config files are provided for convenience.
To reformat C files use `astyle`:
```console
$ astyle --options=.astylerc <FILE>
```
For convenience there is also a Makefile `indent-c` target `make indent-c`.
To reformat shell files use `shfmt`:
```console
$ shfmt_version=3.2.4
$ wget "https://github.com/mvdan/sh/releases/download/v${shfmt_version}/shfmt_v${shfmt_version}_linux_amd64" -O shfmt
$ chmod u+x shfmt
$ ./shfmt -w -s .
```
or
```console
$ GO111MODULE=on go get mvdan.cc/sh/v3/cmd/shfmt
$ $GOPATH/bin/shfmt -w -s .
```
or if `shfmt` is already in your `PATH`, use `make indent`.
Some IDEs already have support for shfmt.
For convenience the `make indent` Makefile target also calls shfmt, if it is in `$PATH`.
### Commit Messages
Commit messages should answer these questions:
* What?: a short summary of what you changed in the subject line.
* Why?: what the intended outcome of the change is (arguably the most important piece of information that should go into a message).
* How?: if multiple approaches for achieving your goal were available, you also want to explain why you chose the used implementation strategy.
Note that you should not explain how your change achieves your goal in your commit message.
That should be obvious from the code itself.
If you cannot achieve that clarity with the used programming language, use comments within the code instead.
The commit message is primarily the place for documenting the why.
Commit message titles should follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).
Format is `<type>[optional scope]: <description>`, where `type` is one of:
* fix: A bug fix
* feat: A new feature
* perf: A code change that improves performance
* refactor: A code change that neither fixes a bug nor adds a feature
* style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
* test: Adding missing tests or correcting existing tests
* docs: Documentation only changes
* revert: Reverts a previous commit
* chore: Other changes that don't modify src or test files
* build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
* ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
`scope` should be the module name (without numbers) or:
* cli: for the dracut command line interface
* rt: for the dracut initramfs runtime logic
* functions: for general purpose dracut functions
Commit messages are checked with [Commisery](https://github.com/tomtom-international/commisery).
## Writing modules
Some general rules for writing modules:
* Use one of the inst family of functions to actually install files
on to the initramfs. They handle mangling the pathnames and (for binaries,
scripts, and kernel modules) installing dependencies as appropriate so
you do not have to.
* Scripts that end up on the initramfs should be POSIX compliant. dracut
will try to use /bin/dash as /bin/sh for the initramfs if it is available,
so you should install it on your system -- dash aims for strict POSIX
compliance to the extent possible.
* Hooks MUST be POSIX compliant -- they are sourced by the init script,
and having a bashism break your user's ability to boot really sucks.
* Generator modules should have a two digit numeric prefix -- they run in
ascending sort order. Anything in the 90-99 range is stuff that dracut
relies on, so try not to break those hooks.
* Hooks must have a .sh extension.
* Generator modules are described in more detail later on.
* We have some breakpoints for debugging your hooks. If you pass 'rdbreak'
as a kernel parameter, the initramfs will drop to a shell just before
switching to a new root. You can pass 'rdbreak=hookpoint', and the initramfs
will break just before hooks in that hookpoint run.
Also, there is an attempt to keep things as distribution-agnostic as
possible. Every distribution has their own tool here and it's not
something which is really interesting to have separate across them.
So contributions to help decrease the distro-dependencies are welcome.
Most of the functionality that dracut implements are actually implemented
by dracut modules. dracut modules live in modules.d, and have the following
structure:
```
dracut_install_dir/modules.d/
00modname/
module-setup.sh
check
<other files as needed by the hook>
```
`00modname`: The name of the module prefixed by a two-digit numeric sort code.
The numeric code must be present and in the range of 00 - 99.
Modules with lower numbers are installed first. This is important
because the dracut install functions (which install files onto
the initrd) refuse to overwrite already installed files. This makes
it easy for an earlier module to override the functionality of a
later module, so that you can have a distro or system specific
module override or modify the functionality of a generic module
without having to patch the more generic module.
`module-setup.sh`:
dracut sources this script to install the functionality that a
module implements onto the initrd. For the most part, this amounts
to copying files from the host system onto the initrd in a controlled
manner.
`install()`:
This function of module-setup.sh is called to install all
non-kernel files. dracut supplies several install functions that are
specialized for different file types. Browse through dracut-functions
for more details. dracut also provides a $moddir variable if you
need to install a file from the module directory, such as an initrd
hook, a udev rule, or a specialized executable.
`installkernel()`:
This function of module-setup.sh is called to install all
kernel related files.
`check()`:
dracut calls this function to check and see if a module can be installed
on the initrd.
When called without options, check should check to make sure that
any files it needs to install into the initrd from the host system
are present. It should exit with a 0 if they are, and a 1 if they are
not.
When called with $hostonly set, it should perform the same check
that it would without it set, 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
encrypted volumes, it should return 0 if all the tools to handle
encrpted volumes are available and the host system has the root
partition on an encrypted volume, 1 otherwise.
`depends()`:
This function 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.
Any other files in the module will not be touched by dracut directly.
You are encouraged to provide a README that describes what the module is for.
### Hooks
init has the following hook points to inject scripts:
`/lib/dracut/hooks/cmdline/*.sh`
scripts for command line parsing
`/lib/dracut/hooks/pre-udev/*.sh`
scripts to run before udev is started
`/lib/dracut/hooks/pre-trigger/*.sh`
scripts to run before the main udev trigger is pulled
`/lib/dracut/hooks/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 /lib/dracut/hooks/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".
`/lib/dracut/hooks/pre-mount/*.sh`
scripts to run before the root filesystem is mounted
Network filesystems like NFS that do not use device files are an
exception. Root can be mounted already at this point.
`/lib/dracut/hooks/mount/*.sh`
scripts to mount the root filesystem
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.
`/lib/dracut/hooks/pre-pivot/*.sh`
scripts to run before latter initramfs cleanups
`/lib/dracut/hooks/cleanup/*.sh`
scripts to run before the real init is executed and the initramfs
disappears
All processes started before should be killed here.
## Testsuite
### Rootless in a container with podman
```console
$ cd <DRACUT_SOURCE>
$ podman pull [CONTAINER]
$ podman run --rm -it \
--cap-add=SYS_PTRACE --user 0 \
-v /dev:/dev -v ./:/dracut:z \
[CONTAINER] \
bash -l
# cd /dracut
# ./configure
# make -j $(getconf _NPROCESSORS_ONLN)
# cd test
# make V=1 SKIP="16 60 61" clean check
```
with `[CONTAINER]` being one of the
[github `dracutdevs` containers](https://github.com/orgs/dracutdevs/packages),
e.g. `ghcr.io/dracutdevs/fedora:latest`.
### On bare metal
For the testsuite to pass, you will have to install at least the software packages
mentioned in the `test/container` Dockerfiles.
```
$ sudo make clean check
```
in verbose mode:
```
$ sudo make V=1 clean check
```
only specific test:
```
$ sudo make TESTS="01 20 40" clean check
```
only runs the 01, 20 and 40 tests.
debug a specific test case:
```
$ cd TEST-01-BASIC
$ sudo make clean setup run
```
... change some kernel parameters in `test.sh` ...
```
$ sudo make run
```
to run the test without doing the setup.

View File

@@ -1,48 +0,0 @@
Dracut supports running against a sysroot directory that is different
from the actual root (/) directory of the running system. It is most
useful for creating/bootstrapping a new system that may or may not be
using the same CPU architecture as the host system, i.e. building a
whole Linux system with a cross-compiler framework like Yocto.
The user-visible frontend change is the introduction of a new option
called "-r" or "--sysroot". It expects a directory that contains the
complete Linux system that has all the files (kernel drivers, firmware,
executables, libraries and others) necessary to construct the initramfs.
E.g: dracut --sysroot /path/to/sysroot initramfs.img kernelversion
To support this, a new global variable was introduced inside dracut.
This variable is called "dracutsysrootdir" and all the files installed
into the initramfs image is searched relative to the sysroot directory.
This variable can also be set externally to dracut without using option
-r/--sysroot.
There are other details that are necessary to tweak to be able to
run on cross-compiled (a.k.a. foreign) binaries.
dracut uses these crucial utilities during its operation:
ldd
===
It lists dynamic library dependencies for executables or libraries
ldconfig
========
It creates /etc/ld.so.cache, i.e. the cached information about libraries
known to the system.
These utilities the way they exist on the host system only work on
the host system.
To support cross-compiled binaries, a different ldd variant is needed that
works on those binaries. One such ldd script is found at
https://gist.github.com/jerome-pouiller/c403786c1394f53f44a3b61214489e6f
ldconfig in GLIBC as is does support a sysroot with its -r option.
Extra environment variables needed to run dracut on the sysroot are
documented in the dracut(8) man page.
For the Plymouth boot splash to be added to the initramfs image,
this gitlab PR is needed for Plymouth:
https://gitlab.freedesktop.org/plymouth/plymouth/merge_requests/72

View File

@@ -1,3 +0,0 @@
"dracut --kernel-only" is to build an initrd with only kernel modules and firmware files.
"dracut --kernel-only" only executes "installkernel" in the modules subdirectories.

View File

@@ -1,48 +0,0 @@
# Conducting A Successful Release
This documents contains the necessary steps to conduct a successful release.
1. Add all items to `NEWS.md`
Get a first template with [`clog`](https://github.com/clog-tool/clog-cli)
```console
$ clog -F -r https://github.com/dracutdevs/dracut
```
2. Update the contributors list in NEWS.md
Produce the list with:
```console
$ make CONTRIBUTORS
```
Append the list to the section in `NEWS.md`
3. Update AUTHORS
```console
$ make AUTHORS
```
4. Check in AUTHORS and NEWS.md
```console
$ git commit -m "docs: update NEWS.md and AUTHORS" NEWS.md AUTHORS
$ git push origin master
```
5. Tag the release, validate the tag and push
```console
$ git tag -s 060
$ git tag -v 060
$ git push --tags
```
Add the section from `NEWS.md` to the git tag message excluding the Rendered
view entry.
6. Create a new release on github (https://github.com/dracutdevs/dracut/releases/new)
- Add the section from `NEWS.md` to the release.
7. Open a new milestone, move all unfinished issue from the previous milestone to the new one and close the released milestone (https://github.com/dracutdevs/dracut/milestones)

View File

@@ -1,3 +0,0 @@
Security is very important to us. If you discover any issue regarding security, we'd appreciate a non-public disclosure of
the information, so please disclose the information responsibly by sending an email to Harald Hoyer <harald@profian.com> and not by creating a GitHub issue.
We will respond swiftly to fix verifiable security issues with the disclosure being coordinated with distributions and relevant security teams.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

346
dracut Executable file
View File

@@ -0,0 +1,346 @@
#!/bin/bash
#
# Generator script for a dracut initramfs
# Tries to retain some degree of compatibility with the command line
# of the various mkinitrd implementations out there
#
# Copyright 2005-2009 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/>.
#
# store for logging
dracut_args="$@"
usage() {
# 80x25 linebreak here ^
echo "Usage: $0 [OPTION]... <initramfs> <kernel-version>
Creates initial ramdisk images for preloading modules
-f, --force Overwrite existing initramfs file.
-m, --modules [LIST] Specify a space-separated list of dracut modules to
call when building the initramfs. Modules are located
in /usr/share/dracut/modules.d.
-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
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
firmwares, separated by :
--kernel-only Only install kernel drivers and firmware files
--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
-c, --conf [FILE] Specify configuration file to use.
Default: /etc/dracut.conf
-l, --local Local mode. Use modules from the current working
directory instead of the system-wide installed in
/usr/share/dracut/modules.d.
Useful when running dracut from a git checkout.
-H, --hostonly Host-Only mode: Install only what is needed for
booting the local host instead of a generic host.
-i, --include [SOURCE] [TARGET]
Include the files in the SOURCE directory into the
Target directory in the final initramfs.
-I, --install [LIST] Install the space separated list of files into the
initramfs.
"
}
while (($# > 0)); do
case $1 in
-f|--force) force=yes;;
-m|--modules) dracutmodules_l="$2"; shift;;
-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"; no_kernel="no";;
--no-kernel) kernel_only="no"; no_kernel="yes";;
--strip) do_strip_l="yes";;
--nostrip) do_strip_l="no";;
--mdadmconf) mdadmconf_l="yes";;
--nomdadmconf) mdadmconf_l="no";;
--lvmconf) lvmconf_l="yes";;
--nolvmconf) lvmconf_l="no";;
-h|--help) usage; exit 1 ;;
--debug) debug="yes";;
-v|--verbose) beverbose="yes";;
-c|--conf) conffile="$2"; shift;;
--confdir) confdir="$2"; shift;;
-l|--local) allowlocal="yes" ;;
-H|--hostonly) hostonly_l="yes" ;;
-i|--include) include_src="$2"; include_target="$3"; shift 2;;
-I|--install) install_items="$2"; shift;;
-*) printf "\nUnknown option: %s\n\n" "$1" >&2; usage; exit 1;;
*) break ;;
esac
shift
done
PATH=/sbin:/bin:/usr/sbin:/usr/bin
export PATH
unset LD_LIBRARY_PATH
unset GREP_OPTIONS
[[ $debug ]] && {
export PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): ';
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
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
[[ $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//:/ }
[[ $hostonly = yes ]] && hostonly="-h"
[[ $hostonly != "-h" ]] && unset hostonly
if [[ -f $dracutbasedir/dracut-functions ]]; then
. $dracutbasedir/dracut-functions
else
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=$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=$1 || outfile="/boot/initramfs-$kernel.img"
abs_outfile=$(readlink -f "$outfile") && outfile="$abs_outfile"
srcmods="/lib/modules/$kernel/"
[[ $drivers_dir ]] && srcmods="$drivers_dir"
export srcmods
if [[ -f $outfile && ! $force ]]; then
derror "Will not override existing initramfs ($outfile) without --force"
exit 1
fi
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 '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 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
# Create some directory structure first
for d in bin sbin usr/bin usr/sbin usr/lib etc proc sys sysroot tmp dev/pts var/log var/run $hookdirs; do
inst_dir "/$d"
done
fi
# check all our modules to see if they should be sourced.
# This builds a list of modules that we will install next.
check_modules
modules_loaded=" "
# source our modules.
for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
_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
[[ -x "$moddir/install" ]] && . "$moddir/install"
if [[ $no_kernel != yes && -x $moddir/installkernel ]]; then
. "$moddir/installkernel"
fi
fi
modules_loaded+="$_d_mod "
mods_to_load=${mods_to_load// $_d_mod /}
fi
done
unset moddir
## final stuff that has to happen
# generate module dependencies for the initrd
if [[ -d $initdir/lib/modules/$kernel ]]; then
if ! depmod -a -b "$initdir" $kernel; then
derror "\"depmod -a $kernel\" failed."
exit 1
fi
fi
if [[ $include_src && $include_target ]]; then
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
dracut_install "$item"
done
unset item
# make sure that library links are correct and up to date
cp -ar /etc/ld.so.conf* "$initdir"/etc
ldconfig -r "$initdir" || [[ $(id -u) != "0" ]] && dinfo "ldconfig might need uid=0 (root) for chroot()"
[[ $beverbose = yes ]] && (du -c "$initdir" | sort -n)
# strip binaries
if [[ $do_strip = yes ]] ; then
for p in strip grep find; do
if ! which $p >/dev/null 2>&1; then
dwarn "Could not find '$p'. Not stripping binaries in the initramfs."
do_strip=no
fi
done
fi
if [[ $do_strip = yes ]] ; then
for f in $(find "$initdir" -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 -or -path '*/lib/modules/*.ko' \) ); 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
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
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

@@ -1,5 +1,5 @@
#!/bin/bash --norc
#
# Copyright 2009 Red Hat, Inc. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
@@ -16,8 +16,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
dwarning() {
echo "Warning: $*" >&2
echo "Warning: $@" >&2
}
dinfo() {
@@ -25,18 +26,17 @@ dinfo() {
}
derror() {
echo "Error: $*" >&2
echo "Error: $@" >&2
}
usage() {
# 80x25 linebreak here ^
cat << EOF
Usage: $0 [OPTION]... <initramfs> <base image> [<image>...]
# 80x25 linebreak here ^
echo "Usage: $0 [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
-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
@@ -45,49 +45,30 @@ line and /boot/dracut/
-h, --help This message
--debug Output debug information of the build process
-v, --verbose Verbose output during the build process
EOF
"
}
imagedir=/boot/dracut/
overlay=/var/lib/dracut/overlay
while (($# > 0)); do
case $1 in
-f | --force) force=yes ;;
-i | --imagedir)
imagedir=$2
shift
;;
-o | --overlaydir)
overlay=$2
shift
;;
--nooverlay)
no_overlay=yes
shift
;;
--noimagedir)
no_imagedir=yes
shift
;;
-h | --help)
usage
exit 1
;;
--debug) export debug="yes" ;;
-v | --verbose) beverbose="yes" ;;
-*)
printf "\nUnknown option: %s\n\n" "$1" >&2
usage
exit 1
;;
*) break ;;
-f|--force) force=yes;;
-i|--imagedir) imagedir=$2;shift;;
-o|--overlaydir) overlay=$2;shift;;
--nooverlay) no_overlay=yes;shift;;
--noimagedir) no_imagedir=yes;shift;;
-h|--help) usage; exit 1 ;;
--debug) debug="yes";;
-v|--verbose) beverbose="yes";;
-*) printf "\nUnknown option: %s\n\n" "$1" >&2; usage; exit 1;;
*) break ;;
esac
shift
done
outfile=$1
shift
outfile=$1; shift
if [[ -z $outfile ]]; then
derror "No output file specified."
@@ -95,8 +76,7 @@ if [[ -z $outfile ]]; then
exit 1
fi
baseimage=$1
shift
baseimage=$1; shift
if [[ -z $baseimage ]]; then
derror "No base image specified."
@@ -122,27 +102,24 @@ fi
if [[ ! $no_overlay ]]; then
ofile="$imagedir/90-overlay.img"
dinfo "Creating image $ofile from directory $overlay"
type pigz &> /dev/null && gzip=pigz || gzip=gzip
(
cd "$overlay" || return 1
find . | cpio --quiet -H newc -o | $gzip -9 > "$ofile"
)
type pigz &>/dev/null && gzip=pigz || gzip=gzip
( cd "$overlay"; find . |cpio --quiet -H newc -o |$gzip -9 > "$ofile"; )
fi
if [[ ! $no_imagedir ]]; then
for i in "$imagedir/"*.img; do
[[ -f $i ]] && images+=("$i")
[[ -f $i ]] && images+=("$i")
done
fi
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)

661
dracut-functions Executable file
View File

@@ -0,0 +1,661 @@
#!/bin/bash
#
# functions used by dracut and other tools.
#
# Copyright 2005-2009 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/>.
#
IF_RTLD=""
IF_dynamic=""
# Generic substring function. If $2 is in $1, return 0.
strstr() { [[ $1 =~ $2 ]]; }
# Log initrd creation.
if ! [[ $dracutlogfile ]]; then
[[ $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 $(date) "Warn:" $@ >>"$dracutlogfile"
}
dinfo() {
[[ $beverbose ]] && echo "I: $@" >&2
[[ -w $dracutlogfile ]] && echo $(date) "Info:" $@ >>"$dracutlogfile"
}
derror() {
echo "E: $@" >&2
[[ -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
# $2 (optional) Name for the file on the ramdisk
# Location of the image dir is assumed to be $initdir
# We never overwrite the target if it exists.
inst_simple() {
local src target
[[ -f $1 ]] || return 1
src=$1 target="${2:-$1}"
if ! [[ -d ${initdir}$target ]]; then
[[ -e ${initdir}$target ]] && return 0
inst_dir "${target%/*}"
fi
# install checksum files also
if [[ -e "${src%/*}/.${src##*/}.hmac" ]]; then
inst "${src%/*}/.${src##*/}.hmac" "${target%/*}/.${target##*/}.hmac"
fi
dinfo "Installing $src"
cp -pfL "$src" "${initdir}$target"
}
# 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}
[[ -e $initdir$dest ]] && return 0
if [[ -L $src ]]; then
# install checksum files also
if [[ -e "${src%/*}/.${src##*/}.hmac" ]]; then
inst "${src%/*}/.${src##*/}.hmac" "${dest%/*}/.${dest##*/}.hmac"
fi
reallib=$(readlink -f "$src")
lib=${src##*/}
inst_simple "$reallib" "$reallib"
inst_dir "${dest%/*}"
ln_r "$reallib" "$dest"
else
inst_simple "$src" "$dest"
fi
}
# find a binary. If we were not passed the full path directly,
# search in the usual places to find the binary.
find_binary() {
local binpath="/bin /sbin /usr/bin /usr/sbin" p
[[ -z ${1##/*} && -x $1 ]] && { echo $1; return 0; }
for p in $binpath; do
[[ -x $p/$1 ]] && { echo "$p/$1"; return 0; }
done
return 1
}
# Same as above, but specialized to install binary executables.
# Install binary executable, and all shared library dependencies, if any.
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
[[ -e $initdir$target ]] && return 0
# I love bash!
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."
derror "Run \"ldd $bin\" to find out what it is."
derror "dracut cannot create an initrd."
exit 1
fi
so_regex='([^ ]*/lib[^/]*/[^ ]*\.so[^ ]*)'
[[ $line =~ $so_regex ]] || continue
FILE=${BASH_REMATCH[1]}
[[ -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##*/}
# prefer nosegneg libs, then unoptimized ones.
for f in "$TLIBDIR/i686/nosegneg" "$TLIBDIR"; do
[[ -e $f/$BASE ]] || continue
FILE=$f/$BASE
break
done
inst_library "$FILE" "$TLIBDIR/$BASE"
IF_dynamic=yes
continue
fi
inst_library "$FILE"
done
inst_simple "$bin" "$target"
}
# same as above, except for shell scripts.
# If your shell script does not start with shebang, it is not a shell script.
inst_script() {
[[ -f $1 ]] || return 1
local line
read -r -n 80 line <"$1"
# If debug is set, clean unprintable chars to prevent messing up the term
[[ $debug ]] && line=$(echo -n "$line" | tr -c -d '[:print:][:space:]')
shebang_regex='(#! *)(/[^ ]+).*'
[[ $line =~ $shebang_regex ]] || return 1
inst "${BASH_REMATCH[2]}" && inst_simple "$@"
}
# same as above, but specialized for symlinks
inst_symlink() {
local _src=$1 _target=${2:-$1} _realsrc
strstr "$1" "/" || return 1
[[ -L $1 ]] || return 1
[[ -L $initdir/$_target ]] && return 0
_realsrc=$(readlink -f "$_src")
[[ ${_realsrc#/} = ${_realsrc} ]] && _realsrc="${_src%/*}/${_realsrc}"
if ! [[ -e $initdir/$_realsrc ]]; then
if [[ -d $_realsrc ]]; then
inst_dir "$_realsrc"
else
inst "$_realsrc"
fi
fi
[[ ! -e $initdir/${_target%/*} ]] && inst_dir "${_target%/*}"
ln_r "${_realsrc}" "${_target}"
}
# find a udev rule in the usual places.
find_rule() {
[[ -f $1 ]] && { echo "$1"; return 0; }
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
}
# 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
inst_dir "/lib/udev/rules.d"
inst_dir "$target"
for rule in "$@"; do
rule=$(find_rule "$rule") && \
inst_simple "$rule" "$target/${rule##*/}"
done
}
# general purpose installation function
# Same args as above.
inst() {
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
return 1
}
# install function specialized for hooks
# $1 = type of hook, $2 = hook priority (lower runs first), $3 = hook
# All hooks should be POSIX/SuS compliant, they will be sourced by init.
inst_hook() {
if ! [[ -f $3 ]]; then
derror "Cannot install a hook ($3) that does not exist."
derror "Aborting initrd creation."
exit 1
elif ! strstr "$hookdirs" "$1"; then
derror "No such hook type $1. Aborting initrd creation."
exit 1
fi
inst_simple "$3" "/${1}/${2}${3##*/}"
}
dracut_install() {
if [[ $1 = '-o' ]]; then
local optional=yes
shift
fi
while (($# > 0)); do
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 " && return
# turn a module name into a directory, if we can.
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
"$moddir/check"
ret=$?
# a return value of 255 = load module only as a dependency.
((ret==0||ret==255)) || return 1
for dep in $("$moddir/check" -d); do
check_module_deps "$dep" && continue
dwarning "Dependency $mod failed."
return 1
done
fi
mods_to_load+=" $1 "
}
should_source_module() {
local dep
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 dracut module \"$mod\", dependencies failed."
return 1
done
}
check_modules() {
local modcheck;
local mod;
for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
local mod=${moddir##*/}; mod=${mod#[0-9][0-9]}
# If we are already scheduled to be loaded, no need to check again.
strstr "$mods_to_load" " $mod " && continue
# This should never happen, but...
[[ -d $moddir ]] || continue
[[ $dracutmodules != all ]] && ! strstr "$dracutmodules" "$mod" && \
continue
strstr "$omit_dracutmodules" "$mod" && continue
if ! strstr "$add_dracutmodules" "$mod"; then
should_source_module "$moddir" || continue
fi
mods_to_load+=" $mod "
done
modcheck=$add_dracutmodules
[[ $dracutmodules != all ]] && modcheck="$m $dracutmodules"
for mod in $modcheck; do
strstr "$mods_to_load" "$mod" && continue
strstr "$omit_dracutmodules" "$mod" && continue
dwarning "Dracut module \"$mod\" cannot be found."
done
}
# Install a single kernel module along with any firmware it may require.
# $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
local mod mpargs modpath modname cmd
local ret=0
while (($# > 0)); do
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 && -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#=} )
else
instmods $mpargs $(find "$srcmods" -path "*/${mod#=}/*")
fi
;;
--*)
mod=${mod##*/}
mpargs+=" $mod";;
i2o_scsi)
# Must never run this diagnostic-only module
shift; continue;
;;
*)
# 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 && \
! echo $add_drivers | grep -qe "\<${mod}\>" && {
shift; continue;
}
# 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

File diff suppressed because it is too large Load Diff

715
dracut-gencmdline Executable file
View File

@@ -0,0 +1,715 @@
#!/bin/bash --norc
#
# Copyright 2005-2009 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/>.
#
# code taken from mkinitrd
#
#. /usr/libexec/initrd-functions
IF_verbose=""
function set_verbose() {
case $1 in
1|true|yes|on)
IF_verbose="-v"
;;
0|false|no|off)
IF_verbose=""
;;
esac
}
function is_verbose() {
[ -n "$IF_verbose" ] && return 0
return 1
}
function get_verbose() {
echo "$IF_verbose"
is_verbose
}
function get_numeric_dev() {
(
fmt="%d:%d"
if [ "$1" == "hex" ]; then
fmt="%x:%x"
fi
ls -lH "$2" | awk '{ sub(/,/, "", $5); printf("'"$fmt"'", $5, $6); }'
) 2>/dev/null
}
function error() {
echo "$@" >&2
}
function vecho() {
is_verbose && echo "$@"
}
# module dep finding and installation functions
moduledep() {
MPARGS=""
if [ "$1" == "--ignore-install" ]; then
MPARGS="$MPARGS --ignore-install"
shift
fi
vecho -n "Looking for deps of module $1"
deps=""
deps=$(modprobe $MPARGS --set-version $kernel --show-depends $1 2>/dev/null| awk '/^insmod / { print gensub(".*/","","g",$2) }' | while read foo ; do [ "${foo%%.ko}" != "$1" ] && echo -n "${foo%%.ko} " ; done)
[ -n "$deps" ] && vecho ": $deps" || vecho
}
export MALLOC_PERTURB_=204
PATH=/sbin:/usr/sbin:/bin:/usr/bin:$PATH
export PATH
# Set the umask. For iscsi, the initrd can contain plaintext
# password (chap secret), so only allow read by owner.
umask 077
VERSION=6.0.87
PROBE="yes"
MODULES=""
GRAPHICSMODS=""
PREMODS=""
DMRAIDS=""
ncryptodevs=0
ncryptoparts=0
ncryptolvs=0
ncryptoraids=0
root=""
scsi_wait_scan="no"
NET_LIST=""
LD_SO_CONF=/etc/ld.so.conf
LD_SO_CONF_D=/etc/ld.so.conf.d/
[ -e /etc/sysconfig/mkinitrd ] && . /etc/sysconfig/mkinitrd
CONFMODS="$MODULES"
MODULES=""
ARCH=$(uname -m | sed -e 's/s390x/s390/')
compress=1
allowmissing=""
target=""
kernel=""
force=""
img_vers=""
builtins=""
modulefile=/etc/modules.conf
[ "$ARCH" != "s390" ] && withusb=1
rc=0
nolvm=""
nodmraid=""
IMAGESIZE=8000
PRESCSIMODS=""
fstab="/etc/fstab"
vg_list=""
net_list="$NET_LIST"
usage () {
if [ "$1" == "-n" ]; then
cmd=echo
else
cmd=error
fi
$cmd "usage: `basename $0` [--version] [--help] [-v] [-f]"
if [ "$1" == "-n" ]; then
exit 0
else
exit 1
fi
}
qpushd() {
pushd "$1" >/dev/null 2>&1
}
qpopd() {
popd >/dev/null 2>&1
}
freadlink() {
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() {
majmin="$1"
if [ -n "$majmin" ]; then
dev=$(for x in /sys/block/* ; do find $x/ -name dev ; done | while read device ; do \
echo "$majmin" | cmp -s $device && echo $device ; done)
if [ -n "$dev" ]; then
dev=${dev%%/dev}
dev=${dev%%/}
echo "$dev"
return 0
fi
fi
return 1
}
finddevicedriverinsys () {
if is_iscsi $PWD; then
handleiscsi "$PWD"
return
fi
while [ "$PWD" != "/sys/devices" ]; do
deps=
if [ -f modalias ]; then
MODALIAS=$(cat modalias)
if [ "${MODALIAS::7}" == "scsi:t-" ]; then
scsi_wait_scan=yes
fi
moduledep $MODALIAS
unset MODALIAS
fi
cd ..
done
}
findstoragedriverinsys () {
local sysfs=$(freadlink "$1")
# if its a partition look at the device holding the partition
if [ -f "$sysfs/start" ]; then
sysfs=$(freadlink ${sysfs%/*})
fi
if [[ ! "$sysfs" =~ ^/sys/.*block/.*$ ]]; then
#error "WARNING: $sysfs is a not a block sysfs path, skipping"
return
fi
case " $handleddevices " in
*" $sysfs "*)
return ;;
*) handleddevices="$handleddevices $sysfs" ;;
esac
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
vecho "Found DeviceMapper component ${sysfs##*/}"
handledm $(cat $sysfs/dev |cut -d : -f 1) $(cat $sysfs/dev |cut -d : -f 2)
fi
for slave in $(ls -d "$sysfs"/slaves/* 2>/dev/null) ; do
findstoragedriverinsys "$slave"
done
if [ -L "$sysfs/device" ]; then
qpushd $(freadlink "$sysfs/device")
finddevicedriverinsys
qpopd
fi
}
findstoragedriver () {
local device="$1"
if [ ! -b "$device" ]; then
#error "WARNING: $device is a not a block device, skipping"
return
fi
local majmin=$(get_numeric_dev dec "$device")
local sysfs=$(finddevnoinsys "$majmin")
if [ -z "$sysfs" ]; then
#error "WARNING: $device major:minor $majmin not found, skipping"
return
fi
vecho "Looking for driver for $device in $sysfs"
findstoragedriverinsys "$sysfs"
}
iscsi_get_rec_val() {
# The open-iscsi 742 release changed to using flat files in
# /var/lib/iscsi.
result=$(grep "^${2} = " "$1" | sed -e s'/.* = //')
}
iscsi_set_parameters() {
path=$1
vecho setting iscsi parameters
tmpfile=$(mktemp)
# Check once before getting explicit values, so we can output a decent
# error message.
/sbin/iscsiadm --show -m session -r $path > $tmpfile
if [ ! -s $tmpfile ]; then
echo Unable to find iscsi record for $path
exit 1
fi
nit_name=$(grep "^InitiatorName=" /etc/iscsi/initiatorname.iscsi | \
sed -e "s/^InitiatorName=//")
iscsi_get_rec_val $tmpfile "node.name"
tgt_name=${result}
iscsi_get_rec_val $tmpfile "node.tpgt"
tpgt=${result}
# iscsistart wants node.conn[0].address / port
iscsi_get_rec_val $tmpfile 'node.conn\[0\].address'
tgt_ipaddr=${result}
iscsi_get_rec_val $tmpfile 'node.conn\[0\].port'
tgt_port=${result}
# Note: we get chap secrets (passwords) in plaintext, and also store
# them in the initrd.
iscsi_get_rec_val $tmpfile "node.session.auth.username"
chap=${result}
if [ -n "${chap}" -a "${chap}" != "<empty>" ]; then
chap="-u ${chap}"
iscsi_get_rec_val $tmpfile "node.session.auth.password"
chap_pw="-w ${result}"
else
chap=""
fi
iscsi_get_rec_val $tmpfile "node.session.auth.username_in"
chap_in=${result}
if [ -n "${chap_in}" -a "${chap_in}" != "<empty>" ]; then
chap_in="-U ${chap_in}"
iscsi_get_rec_val $tmpfile "node.session.auth.password_in"
chap_in_pw="-W ${result}"
else
chap_in=""
fi
rm $tmpfile
}
emit_iscsi () {
if [ -n "${iscsi_devs}" ]; then
for dev in ${iscsi_devs}; do
iscsi_set_parameters $dev
# recid is not really used, just use 0 for it
echo "/bin/iscsistart -t ${tgt_name} -i ${nit_name} \
-g ${tpgt} -a ${tgt_ipaddr} ${chap} ${chap_pw} \
${chap_in} ${chap_in_pw}"
done
fi
}
is_iscsi() {
path=$1
if echo $path | grep -q "/platform/host[0-9]*/session[0-9]*/target[0-9]*:[0-9]*:[0-9]*/[0-9]*:[0-9]*:[0-9]*:[0-9]*"; then
return 0
else
return 1
fi
}
handledm() {
major=$1
minor=$2
while read dmstart dmend dmtype r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 ; do
case "$dmtype" in
crypt)
# this device is encrypted; find the slave device and see
# whether the encryption is LUKS; if not, bail.
slavedev=$(finddevnoinsys $r3)
# get the basename, then s,!,/, in case it's a cciss device
slavedev=$(echo ${slavedev##*/} | tr '!' '/')
cryptsetup isLuks "/dev/$slavedev" 2>/dev/null || continue
find_base_dm_mods
dmname=$(dmsetup info -j $major -m $minor -c --noheadings -o name)
# do the device resolution dance to get /dev/mapper/foo
# since 'lvm lvs' doesn't like dm-X device nodes
if [[ "$slavedev" =~ ^dm- ]]; then
majmin=$(get_numeric_dev dec "/dev/$slavedev")
for dmdev in /dev/mapper/* ; do
dmnum=$(get_numeric_dev dev $dmdev)
if [ $dmnum = $majmin ]; then
slavedev=${dmdev#/dev/}
break
fi
done
fi
# determine if $slavedev is an LV
# if so, add the device to latecryptodevs
# if not, add the device to cryptodevs
local vg=$(lvshow /dev/$slavedev)
if [ -n "$vg" ]; then
eval cryptolv${ncryptolvs}='"'/dev/$slavedev $dmname'"'
let ncryptolvs++
elif grep -q "^$slavedev :" /proc/mdstat ; then
eval cryptoraid${ncryptoraids}='"'/dev/$slavedev $dmname'"'
let ncryptoraids++
else
eval cryptoparts${ncryptoparts}='"'/dev/$slavedev $dmname'"'
let ncryptoparts++
fi
let ncryptodevs++
findstoragedriver "/dev/$slavedev"
;;
esac
done << EOF
$(dmsetup table -j $major -m $minor 2>/dev/null)
EOF
local name=$(dmsetup info --noheadings -c -j $major -m $minor -o name)
local vg=$(lvshow "/dev/mapper/$name")
local raids=$(/sbin/dmraid -s -craidname 2>/dev/null | grep -vi "no raid disks")
if [ -n "$vg" ]; then
vg=`echo $vg` # strip whitespace
case " $vg_list " in
*" $vg "*) ;;
*) vg_list="$vg_list $vg"
[ -z "$nolvm" ] && find_base_dm_mods
;;
esac
fi
for raid in $raids ; do
if [ "$raid" == "$name" ]; then
case " $DMRAIDS " in
*" $raid "*) ;;
*) DMRAIDS="$DMRAIDS $raid"
[ -z "$nodmraid" ] && find_base_dm_mods
;;
esac
break
fi
done
}
handleiscsi() {
vecho "Found iscsi component $1"
# We call iscsi_set_parameters once here to figure out what network to
# use (it sets tgt_ipaddr), and once again to emit iscsi values,
# not very efficient.
iscsi_set_parameters $1
iscsi_devs="$iscsi_devs $1"
netdev=$(/sbin/ip route get to $tgt_ipaddr | \
sed 's|.*dev \(.*\).*|\1|g' | awk '{ print $1; exit }')
addnetdev $netdev
}
handleraid() {
local start=0
if [ -n "$noraid" -o ! -f /proc/mdstat ]; then
return 0
fi
levels=$(awk "/^$1[ ]*:/ { print\$4 }" /proc/mdstat)
for level in $levels ; do
case $level in
linear)
start=1
;;
multipath)
start=1
;;
raid[01] | raid10)
start=1
;;
raid[456])
start=1
;;
*)
error "raid level $level (in /proc/mdstat) not recognized"
;;
esac
done
if [ "$start" = 1 ]; then
raiddevices="$raiddevices $1"
fi
return $start
}
lvshow() {
lvm lvs --ignorelockingfailure --noheadings -o vg_name \
$1 2>/dev/null | egrep -v '^ *(WARNING:|Volume Groups with)'
}
vgdisplay() {
lvm vgdisplay --ignorelockingfailure -v $1 2>/dev/null |
sed -n 's/PV Name//p'
}
dmmods_found="n"
find_base_dm_mods()
{
[ "$dmmods_found" == "n" ] || return
dmmods_found="y"
}
savedargs=$*
while [ $# -gt 0 ]; do
case $1 in
--fstab*)
if [ "$1" != "${1##--fstab=}" ]; then
fstab=${1##--fstab=}
else
fstab=$2
shift
fi
;;
-v|--verbose)
set_verbose true
;;
--net-dev*)
if [ "$1" != "${1##--net-dev=}" ]; then
net_list="$net_list ${1##--net-dev=}"
else
net_list="$net_list $2"
shift
fi
;;
--rootdev*)
if [ "$1" != "${1##--rootdev=}" ]; then
rootdev="${1##--rootdev=}"
else
rootdev="$2"
shift
fi
;;
--thawdev*)
if [ "$1" != "${1##--thawdev=}" ]; then
thawdev="${1##--thawdev=}"
else
thawdev="$2"
shift
fi
;;
--rootfs*)
if [ "$1" != "${1##--rootfs=}" ]; then
rootfs="${1##--rootfs=}"
else
rootfs="$2"
shift
fi
;;
--rootopts*)
if [ "$1" != "${1##--rootopts=}" ]; then
rootopts="${1##--rootopts=}"
else
rootopts="$2"
shift
fi
;;
--root*)
if [ "$1" != "${1##--root=}" ]; then
root="${1##--root=}"
else
root="$2"
shift
fi
;;
--loopdev*)
if [ "$1" != "${1##--loopdev=}" ]; then
loopdev="${1##--loopdev=}"
else
loopdev="$2"
shift
fi
;;
--loopfs*)
if [ "$1" != "${1##--loopfs=}" ]; then
loopfs="${1##--loopfs=}"
else
loopfs="$2"
shift
fi
;;
--loopopts*)
if [ "$1" != "${1##--loopopts=}" ]; then
loopopts="${1##--loopopts=}"
else
loopopts="$2"
shift
fi
;;
--looppath*)
if [ "$1" != "${1##--looppath=}" ]; then
looppath="${1##--looppath=}"
else
looppath="$2"
shift
fi
;;
--help)
usage -n
;;
*)
if [ -z "$target" ]; then
target=$1
elif [ -z "$kernel" ]; then
kernel=$1
else
usage
fi
;;
esac
shift
done
[ -z "$rootfs" ] && rootfs=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $3; }}' $fstab)
[ -z "$rootopts" ] && rootopts=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $4; }}' $fstab)
[ -z "$rootopts" ] && rootopts="defaults"
[ -z "$rootdev" ] && rootdev=$(awk '/^[ \t]*[^#]/ { if ($2 == "/") { print $1; }}' $fstab)
# check if it's nfsroot
physdev=""
if [ "$rootfs" == "nfs" ]; then
if [ "x$net_list" == "x" ]; then
handlenfs $rootdev
fi
else
# check if it's root by label
rdev=$rootdev
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
# find the first swap dev which would get used for swsusp
[ -z "$thawdev" ] && thawdev=$(awk '/^[ \t]*[^#]/ { if ($3 == "swap") { print $1; exit }}' $fstab)
swsuspdev="$thawdev"
if [ -n "$swsuspdev" ]; then
swsuspdev=$(resolve_device_name "$swsuspdev")
findstoragedriver "$swsuspdev"
fi
cemit()
{
cat
}
emit()
{
NONL=""
if [ "$1" == "-n" ]; then
NONL="-n"
shift
fi
echo $NONL "$@"
}
emitdmraids()
{
if [ -z "$nodmraid" -a -n "$DMRAIDS" ]; then
for raid in $DMRAIDS; do
echo -n "rd_DM_UUID=$raid "
done
fi
}
# HACK: module loading + device creation isn't necessarily synchronous...
# this will make sure that we have all of our devices before trying
# things like RAID or LVM
emitdmraids
emitcrypto()
{
local luksuuid=$(grep "^$2 " /etc/crypttab 2>/dev/null| awk '{ print $2 }')
if [ -z "$luksuuid" ]; then
luksuuid="$2"
fi
luksuuid=${luksuuid##UUID=}
echo -n "rd_LUKS_UUID=$luksuuid "
}
if [ -n "$raiddevices" ]; then
for dev in $raiddevices; do
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
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
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
[ -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)
[[ $val ]] && echo -n "$i=$val "
done
if [ -n "$KEYBOARDTYPE" -a "$KEYBOARDTYPE" != "pc" ]; then
echo -n "KEYBOARDTYPE=$KEYBOARDTYPE "
fi
if [ -n "$rootdev" ]; then
echo -n "root=$rootdev "
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)

File diff suppressed because it is too large Load Diff

View File

@@ -1,83 +0,0 @@
#!/bin/bash
set -e
# do some sanity checks first
[ -e /run/initramfs/bin/sh ] && exit 0
[ -e /run/initramfs/.need_shutdown ] || exit 0
# SIGTERM signal is received upon forced shutdown: ignore the signal
# We want to remain alive to be able to trap unpacking errors to avoid
# switching root to an incompletely unpacked initramfs
trap 'echo "Received SIGTERM signal, ignoring!" >&2' TERM
KERNEL_VERSION="$(uname -r)"
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
SKIP="$dracutbasedir/skipcpio"
[[ -x $SKIP ]] || SKIP="cat"
if [[ -d /efi/Default ]] || [[ -d /boot/Default ]] || [[ -d /boot/efi/Default ]]; then
MACHINE_ID="Default"
elif [[ -s /etc/machine-id ]]; then
read -r MACHINE_ID < /etc/machine-id
[[ $MACHINE_ID == "uninitialized" ]] && MACHINE_ID="Default"
else
MACHINE_ID="Default"
fi
mount -o ro /boot &> /dev/null || true
if [[ -d /efi/loader/entries || -L /efi/loader/entries ]] \
&& [[ -d /efi/$MACHINE_ID || -L /efi/$MACHINE_ID ]]; then
IMG="/efi/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
elif [[ -d /boot/loader/entries || -L /boot/loader/entries ]] \
&& [[ -d /boot/$MACHINE_ID || -L /boot/$MACHINE_ID ]]; then
IMG="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
elif [[ -d /boot/efi/loader/entries || -L /boot/efi/loader/entries ]] \
&& [[ -d /boot/efi/$MACHINE_ID || -L /boot/efi/$MACHINE_ID ]]; then
IMG="/boot/efi/$MACHINE_ID/$KERNEL_VERSION/initrd"
elif [[ -f /lib/modules/${KERNEL_VERSION}/initrd ]]; then
IMG="/lib/modules/${KERNEL_VERSION}/initrd"
elif [[ -f /boot/initramfs-${KERNEL_VERSION}.img ]]; then
IMG="/boot/initramfs-${KERNEL_VERSION}.img"
elif mountpoint -q /efi; then
IMG="/efi/$MACHINE_ID/$KERNEL_VERSION/initrd"
elif mountpoint -q /boot/efi; then
IMG="/boot/efi/$MACHINE_ID/$KERNEL_VERSION/initrd"
else
echo "No initramfs image found to restore!"
exit 1
fi
cd /run/initramfs
if (command -v zcat > /dev/null && $SKIP "$IMG" 2> /dev/null | zcat 2> /dev/null | cpio -id --no-absolute-filenames --quiet > /dev/null 2>&1) \
|| (command -v bzcat > /dev/null && $SKIP "$IMG" 2> /dev/null | bzcat 2> /dev/null | cpio -id --no-absolute-filenames --quiet > /dev/null 2>&1) \
|| (command -v xzcat > /dev/null && $SKIP "$IMG" 2> /dev/null | xzcat 2> /dev/null | cpio -id --no-absolute-filenames --quiet > /dev/null 2>&1) \
|| (command -v lz4 > /dev/null && $SKIP "$IMG" 2> /dev/null | lz4 -d -c 2> /dev/null | cpio -id --no-absolute-filenames --quiet > /dev/null 2>&1) \
|| (command -v lzop > /dev/null && $SKIP "$IMG" 2> /dev/null | lzop -d -c 2> /dev/null | cpio -id --no-absolute-filenames --quiet > /dev/null 2>&1) \
|| (command -v zstd > /dev/null && $SKIP "$IMG" 2> /dev/null | zstd -d -c 2> /dev/null | cpio -id --no-absolute-filenames --quiet > /dev/null 2>&1) \
|| ($SKIP "$IMG" 2> /dev/null | cpio -id --no-absolute-filenames --quiet > /dev/null 2>&1); then
rm -f -- .need_shutdown
else
# something failed, so we clean up
echo "Unpacking of $IMG to /run/initramfs failed" >&2
rm -f -- /run/initramfs/shutdown
exit 1
fi
if [[ -d squash ]]; then
if ! unsquashfs -no-xattrs -f -d . squash-root.img > /dev/null; then
echo "Squash module is enabled for this initramfs but failed to unpack squash-root.img" >&2
rm -f -- /run/initramfs/shutdown
exit 1
fi
fi
if [ -e /etc/selinux/config -a -x /usr/sbin/setfiles ]; then
. /etc/selinux/config
[ -n "${SELINUXTYPE}" ] && /usr/sbin/setfiles -v -r /run/initramfs /etc/selinux/"${SELINUXTYPE}"/contexts/files/file_contexts /run/initramfs > /dev/null
fi
exit 0

View File

@@ -1,455 +0,0 @@
#!/bin/bash
#
# logging faciality module for dracut both at build- and boot-time
#
# Copyright 2010 Amadeusz Żołnowski <aidecoe@aidecoe.name>
#
# 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/>.
export __DRACUT_LOGGER__=1
## @brief Logging facility module for dracut both at build- and boot-time.
#
# @section intro Introduction
#
# The logger takes a bit from Log4j philosophy. There are defined 6 logging
# levels:
# - TRACE (6)
# The TRACE Level designates finer-grained informational events than the
# DEBUG.
# - DEBUG (5)
# The DEBUG Level designates fine-grained informational events that are most
# useful to debug an application.
# - INFO (4)
# The INFO level designates informational messages that highlight the
# progress of the application at coarse-grained level.
# - WARN (3)
# The WARN level designates potentially harmful situations.
# - ERROR (2)
# The ERROR level designates error events that might still allow the
# application to continue running.
# - FATAL (1)
# The FATAL level designates very severe error events that will presumably
# lead the application to abort.
# Descriptions are borrowed from Log4j documentation:
# http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html
#
# @section usage Usage
#
# First of all you have to start with dlog_init() function which initializes
# required variables. Don't call any other logging function before that one!
# If you're ready with this, you can use following functions which corresponds
# clearly to levels listed in @ref intro Introduction. Here they are:
# - dtrace()
# - ddebug()
# - dinfo()
# - dwarn()
# - derror()
# - dfatal()
# They take all arguments given as a single message to be logged. See dlog()
# function for details how it works. Note that you shouldn't use dlog() by
# yourself. It's wrapped with above functions.
#
# @see dlog_init() dlog()
#
# @section conf Configuration
#
# Logging is controlled by following global variables:
# - @var stdloglvl - logging level to standard error (console output)
# - @var sysloglvl - logging level to syslog (by logger command)
# - @var fileloglvl - logging level to file
# - @var kmsgloglvl - logging level to /dev/kmsg (only for boot-time)
# - @var logfile - log file which is used when @var fileloglvl is higher
# than 0
# and two global variables: @var maxloglvl and @var syslogfacility which <b>must
# not</b> be overwritten. Both are set by dlog_init(). @var maxloglvl holds
# maximum logging level of those three and indicates that dlog_init() was run.
# @var syslogfacility is set either to 'user' (when building initramfs) or
# 'daemon' (when booting).
#
# Logging level set by the variable means that messages from this logging level
# and above (FATAL is the highest) will be shown. Logging levels may be set
# independently for each destination (stderr, syslog, file, kmsg).
#
# @see dlog_init()
## @brief Initializes dracut Logger.
#
# @retval 1 if something has gone wrong
# @retval 0 on success.
#
# @note This function need to be called before any other from this file.
#
# If any of the variables is not set, this function set it to default:
# - @var stdloglvl = 4 (info)
# - @var sysloglvl = 0 (no logging)
# - @var fileloglvl is set to 4 when @var logfile is set too, otherwise it's
# - @var kmsgloglvl = 0 (no logging)
# set to 0
#
# @warning Function sets global variables @var maxloglvl and @syslogfacility.
# See file doc comment for details.
dlog_init() {
local __oldumask
local ret=0
local errmsg
[ -z "$stdloglvl" ] && stdloglvl=4
[ -z "$sysloglvl" ] && sysloglvl=0
[ -z "$kmsgloglvl" ] && kmsgloglvl=0
# Skip initialization if it's already done.
[ -n "$maxloglvl" ] && return 0
if [ -z "$fileloglvl" ]; then
[ -w "$logfile" ] && fileloglvl=4 || fileloglvl=0
elif ((fileloglvl > 0)); then
if [[ $logfile ]]; then
__oldumask=$(umask)
umask 0377
! [ -e "$logfile" ] && : > "$logfile"
umask "$__oldumask"
if [[ -w $logfile ]] && [[ -f $logfile ]]; then
# Mark new run in the log file
echo >> "$logfile"
if command -v date > /dev/null; then
echo "=== $(date) ===" >> "$logfile"
else
echo "===============================================" >> "$logfile"
fi
echo >> "$logfile"
else
# We cannot log to file, so turn this facility off.
fileloglvl=0
ret=1
errmsg="'$logfile' is not a writable file"
fi
fi
fi
if ((UID != 0)); then
kmsgloglvl=0
sysloglvl=0
fi
if ((sysloglvl > 0)); then
if [[ -d /run/systemd/journal ]] \
&& type -P systemd-cat &> /dev/null \
&& systemctl --quiet is-active systemd-journald.socket &> /dev/null \
&& { echo "dracut-$DRACUT_VERSION" | systemd-cat -t 'dracut' &> /dev/null; }; then
readonly _systemdcatfile="$DRACUT_TMPDIR/systemd-cat"
mkfifo "$_systemdcatfile"
readonly _dlogfd=15
systemd-cat -t 'dracut' --level-prefix=true < "$_systemdcatfile" &
exec 15> "$_systemdcatfile"
elif ! ([[ -S /dev/log ]] && [[ -w /dev/log ]] && command -v logger > /dev/null); then
# We cannot log to syslog, so turn this facility off.
kmsgloglvl=$sysloglvl
sysloglvl=0
ret=1
errmsg="No '/dev/log' or 'logger' included for syslog logging"
fi
fi
if ((sysloglvl > 0)) || ((kmsgloglvl > 0)); then
if [ -n "$dracutbasedir" ]; then
readonly syslogfacility=user
else
readonly syslogfacility=daemon
fi
export syslogfacility
fi
local lvl
local maxloglvl_l=0
for lvl in $stdloglvl $sysloglvl $fileloglvl $kmsgloglvl; do
((lvl > maxloglvl_l)) && maxloglvl_l=$lvl
done
readonly maxloglvl=$maxloglvl_l
export maxloglvl
if ((stdloglvl < 6)) && ((kmsgloglvl < 6)) && ((fileloglvl < 6)) && ((sysloglvl < 6)); then
unset dtrace
dtrace() { :; }
fi
if ((stdloglvl < 5)) && ((kmsgloglvl < 5)) && ((fileloglvl < 5)) && ((sysloglvl < 5)); then
unset ddebug
ddebug() { :; }
fi
if ((stdloglvl < 4)) && ((kmsgloglvl < 4)) && ((fileloglvl < 4)) && ((sysloglvl < 4)); then
unset dinfo
dinfo() { :; }
fi
if ((stdloglvl < 3)) && ((kmsgloglvl < 3)) && ((fileloglvl < 3)) && ((sysloglvl < 3)); then
unset dwarn
dwarn() { :; }
unset dwarning
dwarning() { :; }
fi
if ((stdloglvl < 2)) && ((kmsgloglvl < 2)) && ((fileloglvl < 2)) && ((sysloglvl < 2)); then
unset derror
derror() { :; }
fi
if ((stdloglvl < 1)) && ((kmsgloglvl < 1)) && ((fileloglvl < 1)) && ((sysloglvl < 1)); then
unset dfatal
dfatal() { :; }
fi
[ -n "$errmsg" ] && derror "$errmsg"
return $ret
}
## @brief Converts numeric logging level to the first letter of level name.
#
# @param lvl Numeric logging level in range from 1 to 6.
# @retval 1 if @a lvl is out of range.
# @retval 0 if @a lvl is correct.
# @result Echoes first letter of level name.
_lvl2char() {
case "$1" in
1) echo F ;;
2) echo E ;;
3) echo W ;;
4) echo I ;;
5) echo D ;;
6) echo T ;;
*) return 1 ;;
esac
}
## @brief Converts numeric level to logger priority defined by POSIX.2.
#
# @param lvl Numeric logging level in range from 1 to 6.
# @retval 1 if @a lvl is out of range.
# @retval 0 if @a lvl is correct.
# @result Echoes logger priority.
_lvl2syspri() {
printf -- "%s" "$syslogfacility."
case "$1" in
1) echo crit ;;
2) echo error ;;
3) echo warning ;;
4) echo info ;;
5) echo debug ;;
6) echo debug ;;
*) return 1 ;;
esac
}
## @brief Converts dracut-logger numeric level to syslog log level
#
# @param lvl Numeric logging level in range from 1 to 6.
# @retval 1 if @a lvl is out of range.
# @retval 0 if @a lvl is correct.
# @result Echoes kernel console numeric log level
#
# Conversion is done as follows:
#
# <tt>
# none -> LOG_EMERG (0)
# none -> LOG_ALERT (1)
# FATAL(1) -> LOG_CRIT (2)
# ERROR(2) -> LOG_ERR (3)
# WARN(3) -> LOG_WARNING (4)
# none -> LOG_NOTICE (5)
# INFO(4) -> LOG_INFO (6)
# DEBUG(5) -> LOG_DEBUG (7)
# TRACE(6) /
# </tt>
#
# @see /usr/include/sys/syslog.h
_dlvl2syslvl() {
local lvl
case "$1" in
1) lvl=2 ;;
2) lvl=3 ;;
3) lvl=4 ;;
4) lvl=6 ;;
5) lvl=7 ;;
6) lvl=7 ;;
*) return 1 ;;
esac
[ "$syslogfacility" = user ] && echo $((8 + lvl)) || echo $((24 + lvl))
}
## @brief Prints to stderr and/or writes to file, to syslog and/or /dev/kmsg
# given message with given level (priority).
#
# @param lvl Numeric logging level.
# @param msg Message.
# @retval 0 It's always returned, even if logging failed.
#
# @note This function is not supposed to be called manually. Please use
# dtrace(), ddebug(), or others instead which wrap this one.
#
# This is core logging function which logs given message to standard error, file
# and/or syslog (with POSIX shell command <tt>logger</tt>) and/or to /dev/kmsg.
# The format is following:
#
# <tt>X: some message</tt>
#
# where @c X is the first letter of logging level. See module description for
# details on that.
#
# Message to syslog is sent with tag @c dracut. Priorities are mapped as
# following:
# - @c FATAL to @c crit
# - @c ERROR to @c error
# - @c WARN to @c warning
# - @c INFO to @c info
# - @c DEBUG and @c TRACE both to @c debug
_do_dlog() {
local lvlc
local lvl="$1"
shift
lvlc=$(_lvl2char "$lvl") || return 0
local msg="$*"
local lmsg="$lvlc: $*"
((lvl <= stdloglvl)) && printf -- 'dracut[%s]: %s\n' "$lvlc" "$msg" >&2
if ((lvl <= sysloglvl)); then
if [[ "$_dlogfd" ]]; then
printf -- "<%s>%s\n" "$(($(_dlvl2syslvl "$lvl") & 7))" "$msg" >&$_dlogfd
else
logger -t "dracut[$$]" -p "$(_lvl2syspri "$lvl")" -- "$msg"
fi
fi
if ((lvl <= fileloglvl)) && [[ -w $logfile ]] && [[ -f $logfile ]]; then
echo "$lmsg" >> "$logfile"
fi
((lvl <= kmsgloglvl)) \
&& echo "<$(_dlvl2syslvl "$lvl")>dracut[$$] $msg" > /dev/kmsg
}
## @brief Internal helper function for _do_dlog()
#
# @param lvl Numeric logging level.
# @param msg Message.
# @retval 0 It's always returned, even if logging failed.
#
# @note This function is not supposed to be called manually. Please use
# dtrace(), ddebug(), or others instead which wrap this one.
#
# This function calls _do_dlog() either with parameter msg, or if
# none is given, it will read standard input and will use every line as
# a message.
#
# This enables:
# dwarn "This is a warning"
# echo "This is a warning" | dwarn
dlog() {
[ -z "$maxloglvl" ] && return 0
(($1 <= maxloglvl)) || return 0
if (($# > 1)); then
_do_dlog "$@"
else
while read -r line || [ -n "$line" ]; do
_do_dlog "$1" "$line"
done
fi
}
## @brief Logs message at TRACE level (6)
#
# @param msg Message.
# @retval 0 It's always returned, even if logging failed.
dtrace() {
set +x
dlog 6 "$@"
if [ -n "$debug" ]; then
set -x
fi
}
## @brief Logs message at DEBUG level (5)
#
# @param msg Message.
# @retval 0 It's always returned, even if logging failed.
ddebug() {
set +x
dlog 5 "$@"
if [ -n "$debug" ]; then
set -x
fi
}
## @brief Logs message at INFO level (4)
#
# @param msg Message.
# @retval 0 It's always returned, even if logging failed.
dinfo() {
set +x
dlog 4 "$@"
if [ -n "$debug" ]; then
set -x
fi
}
## @brief Logs message at WARN level (3)
#
# @param msg Message.
# @retval 0 It's always returned, even if logging failed.
dwarn() {
set +x
dlog 3 "$@"
if [ -n "$debug" ]; then
set -x
fi
}
## @brief It's an alias to dwarn() function.
#
# @param msg Message.
# @retval 0 It's always returned, even if logging failed.
dwarning() {
set +x
dwarn "$@"
if [ -n "$debug" ]; then
set -x
fi
}
## @brief Logs message at ERROR level (2)
#
# @param msg Message.
# @retval 0 It's always returned, even if logging failed.
derror() {
set +x
dlog 2 "$@"
if [ -n "$debug" ]; then
set -x
fi
}
## @brief Logs message at FATAL level (1)
#
# @param msg Message.
# @retval 0 It's always returned, even if logging failed.
dfatal() {
set +x
dlog 1 "$@"
if [ -n "$debug" ]; then
set -x
fi
}

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

511
dracut.8 Normal file
View File

@@ -0,0 +1,511 @@
.TH DRACUT 8 "June 2009" "Linux"
.SH NAME
dracut \- create initial ramdisk images for preloading modules
.SH SYNOPSIS
\fBdracut\fR [\fIOPTION\fR]... \fI<image>\fR \fI<kernel-version>\fR
.SH DESCRIPTION
.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.
.SS Options
.TP
.BR \-f ", " \-\-force
overwrite existing initramfs file.
.TP
.BR \-m ", " \-\-modules " \fILIST\fR"
specify a space-separated list of dracut modules to call
when building the initramfs.
Modules are located in
.IR /usr/share/dracut/modules.d .
.TP
.BR \-o ", " \-\-omit " \fILIST\fR"
omit a space-separated list of dracut modules.
.TP
.BR \-a ", " \-\-add " \fILIST\fR"
add a space-separated list of dracut modules.
.TP
.BR \-d ", " \-\-drivers " \fILIST\fR"
specify a space-separated list of kernel modules to exclusively include
in the initramfs.
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
.TP
.BR " \-\-fwdir " \fI{DIR}\fR
specify additional directory, where to look for firmwares
.TP
.BR \-\-kernel-only
only install kernel drivers and firmware files
.TP
.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
.BR \-\-nostrip
do not strip binaries in the initramfs
.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
.TP
.BR \-c ", " \-\-conf " \fIFILE\fR"
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
.IR /usr/share/dracut/modules.d .
Useful when running dracut from a git checkout.
.TP
.BR \-H ", " \-\-hostonly
Host-Only mode: Install only what is needed for
booting the local host instead of a generic host.
.TP
.BR \-i ", " \-\-include " \fISOURCE\fR" "" " \fITARGET\fR"
include the files in the SOURCE directory into the
target directory in the final initramfs.
.TP
.BR \-I ", " \-\-install " \fILIST\fR"
install the space separated list of files into the initramfs.
.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
the initrd will search all available devices for an ext2 or ext3 filesystem
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.
.SS Standard
.TP
.BR init= "<path to real init>"
.TP
.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.
.SS Misc
.TP
.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
.BR KEYTABLE= "<keytable filename>"
will be written to /etc/sysconfig/keyboard in the initramfs
.TP
.BR SYSFONT= "Console font"
will be written to /etc/sysconfig/i18n in the initramfs
.TP
.BR SYSFONTACM= "Unicode font map"
will be written to /etc/sysconfig/i18n in the initramfs
.TP
.BR UNIMAP= "Unicode font map"
will be written to /etc/sysconfig/i18n in the initramfs
.TP
.BR LANG= <locale>
will be written to /etc/sysconfig/i18n in the initramfs
.SS LVM
.TP
.BR rd_NO_LVM
disable LVM detection
.TP
.BR rd_LVM_VG= "<volume group name>"
only activate the volume groups with the given name
rd_LVM_VG can be specified multiple times on the kernel command line.
.TP
.BR rd_LVM_LV= "<logical volume name>"
only activate the logical volumes with the given name
rd_LVM_LV can be specified multiple times on the kernel command line.
.TP
.BR rd_NO_LVMCONF
remove any /etc/lvm/lvm.conf, which may exist in the initramfs
.SS "crypto LUKS"
.TP
.BR rd_NO_LUKS
disable crypto LUKS detection
.TP
.BR rd_LUKS_UUID= "<luks uuid>"
only activate the LUKS partitions with the given UUID
Any "luks-" of the LUKS UUID is removed before comparing to <luks uuid>.
The comparisons also matches, if <luks uuid> is only the beginning of the
LUKS UUID, so you don't have to specify the full UUID.
This parameter can be specified multiple times.
.TP
.BR rd_NO_CRYPTTAB
do not check, if LUKS partition is in /etc/crypttab
.SS MD
.TP
.BR rd_NO_MD
disable MD RAID detection
.TP
.BR rd_NO_MDIMSM
no MD RAID for imsm/isw raids, use dmraid instead
.TP
.BR rd_NO_MDADMCONF
ignore mdadm.conf included in initramfs
.TP
.BR rd_MD_UUID= "<md uuid>"
only activate the raid sets with the given UUID.
This parameter can be specified multiple times.
.SS DMRAID
.TP
.BR rd_NO_DM
disable DM RAID detection
.TP
.BR rd_DM_UUID= "<dmraid uuid>"
only activate the raid sets with the given UUID.
This parameter can be specified multiple times.
.SS MULTIPATH
.TP
.BR rd_NO_MULTIPATH
disable multipath in the initramfs
.SS FIPS
.TP
.BR fips=1
enable FIPS
.TP
.BR boot=<boot device>
specify the device, where /boot is located
e.g.
boot=/dev/sda1
boot=/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1
boot=UUID=<uuid>
boot=LABEL=<label>
If the root device is encrypted, the /boot partition must reside on a seperate partition and has to be specified.
.SS Network
.TP
.BR ip= {dhcp|on|any|dhcp6|auto6|ibft}
dhcp|on|any: get ip from dhcp server from all interfaces. If root=dhcp,
loop sequentially through all interfaces (eth0, eth1, ...) and use the first
with a valid DHCP root-path.
.sp
\fBauto6\fR: IPv6 autoconfiguration
.sp
\fBdhcp6\fR: IPv6 DHCP
.sp
\fBibft\fR: iBFT autoconfiguration
.TP
.BR ip= <interface>:{dhcp|on|any|dhcp6|auto6}
dhcp|on|any|dhcp6: get ip from dhcp server on a specific interface
auto6: do IPv6 autoconfiguration
This parameter can be specified multiple times.
.TP
.ad l
.BR ip= "\%<client-IP>\::[<server-id>]\::<gateway-IP>\::<netmask>\::<client\%hostname>\::<interface>\::{none|off}"
.ad
explicit network configuration. If you want do define a IPv6 address, put it in brackets (e.g. [2001:DB8::1]).
This parameter can be specified multiple times.
.TP
.BR ifname= <interface>:<MAC>
Assign network device name <interface> (ie eth0) to the NIC with MAC <MAC>.
Note that if you use this option you \fBmust\fR specify an ifname= argument
for all interfaces used in ip= or fcoe= arguments
This parameter can be specified multiple times.
.TP
.BR bootdev= <interface>
specify network interface to use routing and netroot information from.
Required if multiple ip= lines are used.
.TP
.BR nameserver= "<IP> [nameserver=<IP> ...]"
specify nameserver(s) to use
.TP
.BR vlan= "<vlanname>:<phydevice>"
Setup vlan device named <vlanname> on <phydeivce>.
We support the four styles of vlan names: VLAN_PLUS_VID (vlan0005), VLAN_PLUS_VID_NO_PAD (vlan5),
DEV_PLUS_VID (eth0.0005), DEV_PLUS_VID_NO_PAD (eth0.5)
This parameter can be specified multiple times.
.TP
.BR bridge= "<bridgename>:<ethnames>"
Setup bridge <bridgename> with <ethnames>\&. <ethnames> is a comma\-separated list of physical (ethernet) interfaces\&. Bridge without parameters assumes bridge=br0:eth0
.TP
.BR bond= "<bondname>[:<bondslaves>:[:<options>]]"
Setup bonding device <bondname> on top of <bondslaves>\&. <bondslaves> is a comma\-separated list of physical (ethernet) interfaces\&. <options> is a comma\-separated list on bonding options (modinfo bonding for details) in format compatible with initscripts\&. If <options> includes multi\-valued arp_ip_target option, then its values should be separated by semicolon\&. Bond without parameters assumes bond=bond0:eth0,eth1:mode=balance\-rr
.TP
.BR biosdevname={0|1]}
turn off/on biosdevname network interface renaming
.SS NFS
.TP
.BR root= "[<server-ip>:]<root-dir>[:<nfs-options>]"
mount nfs share from <server-ip>:/<root-dir>, if no server-ip is given,
use dhcp next_server. if server-ip is an IPv6 address it has to be put in brackets, e.g. [2001:DB8::1].
NFS options can be appended with the prefix ":" or "," and are seperated by ",".
.TP
.BR root= "nfs:[<server-ip>:]<root-dir>[:<nfs-options>]"
.TP
.BR root= "nfs4:[<server-ip>:]<root-dir>[:<nfs-options>]"
.TP
.BR root= dhcp|dhcp6
root=dhcp alone directs initrd to look at the DHCP root-path where NFS
options can be specified.
root-path=<server-ip>:<root-dir>[,<nfs-options>]
root-path=nfs:<server-ip>:<root-dir>[,<nfs-options>]
root-path=nfs4:<server-ip>:<root-dir>[,<nfs-options>]
.TP
.BR root= /dev/nfs " nfsroot=" "[<server-ip>:]<root-dir>[,<nfs-options>]"
\fBDeprecated!\fR kernel Documentation/filesystems/nfsroot.txt defines
this method.
This is supported by dracut but not recommended.
.TP
.BR rd_NFS_DOMAIN= "<NFSv4 domain name>"
Set the NFSv4 domain name. Will overwrite the settings in /etc/idmap.conf.
.SS iSCSI
.TP
.ad l
.BR root= "\%iscsi:[username:password\:[:reverse:password]@]\:[<servername>]\::[<protocol>]\::[<port>]\:[:[<iscsi_iface_name>]:[<netdev_name>]]\::[<LUN>]\::<targetname>"
.ad
protocol defaults to "6", LUN defaults to "0".
If the "servername" field is provided by BOOTP or DHCP, then that
field is used in conjunction with other associated fields to contact
the boot server in the Boot stage (Section 7). However, if the
"servername" field is not provided, then the "targetname" field is
then used in the Discovery Service stage in conjunction with other
associated fields.
http://tools.ietf.org/html/rfc4173
.TP
.ad l
.BR root= "\%iscsi:[username:password\:[:reverse:password]@]\:[<servername>]\::[<protocol>]\::[<port>]\:[:[<iscsi_iface_name>]:[<netdev_name>]]\::[<LUN>]\::<targetname>"
.ad
e.g. root=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0
.ad l
If servername is an IPv6 address, it has to be put in brackets.
e.g.
root=iscsi:[2001:DB8::1]::::iqn.2009-06.dracut:target0
.TP
.ad l
.BR root= ??? " netroot=" "\%iscsi:[username:password[:reverse:password]@]\:[<servername>]\::[<protocol>]\::[<port>]\:[:[<iscsi_iface_name>]:[<netdev_name>]]\::[<LUN>]\::<targetname> ..."
.ad
multiple netroot options allow setting up multiple iscsi disks
e.g.
root=UUID=12424547
netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0
netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target1
.ad l
If servername is an IPv6 address, it has to be put in brackets.
e.g.
netroot=iscsi:[2001:DB8::1]::::iqn.2009-06.dracut:target0
.TP
.ad l
.BR \%root= \%??? " \%iscsi_initiator=" \%<initiator> " \%iscsi_target_name=" "<target name>" " \%iscsi_target_ip=" "<target ip>" " \%iscsi_target_port=" "<target port>" " \%iscsi_target_group=" "<target group>" " \%iscsi_username=" "<username>" " \%iscsi_password=" <password> " \%iscsi_in_username=" "<in username>" " \%iscsi_in_password=" "<in password>"
.ad
manually specify all iscsistart parameter (see \fIiscsistart\ --help\fR)
.TP
.BR root= ??? " netroot=iscsi iscsi_firmware"
will read the iscsi parameter from the BIOS firmware
.TP
.BR iscsi_param= <param>
<param> will be passed as "--param <param>" to iscsistart.
This parameter can be specified multiple times.
e.g.:
"netroot=iscsi iscsi_firmware iscsi_param=node.session.timeo.replacement_timeout=30"
will result in
iscsistart -b --param node.session.timeo.replacement_timeout=30
.SS FCoE
.TP
.BR fcoe=<edd|interface|MAC>:<dcb|nodcb>
Try to connect to a FCoE SAN through the NIC specified by <interface> or <MAC> or EDD settings.
This parameter can be specified multiple times.
.SS NBD
.TP
.BR root= nbd:<server>:<port>[:<fstype>][:<mountopts>]
mount nbd share from <server>
.TP
.BR root= dhcp
with dhcp root-path=nbd:<server>:<port>[:<fstype>][:<mountopts>]
root=dhcp alone directs initrd to look at the DHCP root-path where NBD
options can be specified.
This syntax is only usable in cases where you are directly mounting the volume
as the rootfs.
.SS DASD
.TP
.BR rd_DASD_MOD= ....
same syntax as the kernel module parameter (s390 only)
.TP
.ad l
.BR rd_DASD= "\%<dasd adaptor device bus ID>\:[,readonly=X]\:[,use_diag=X]\:[,erplog=X]\:[,failfast=X]"
.ad
activate DASD device with the given adaptor device bus ID and setting the sysfs attributes
to the specified values
This parameter can be specified multiple times.
.SS ZFCP
.TP
.BR rd_ZFCP= "<zfcp adaptor device bus ID>,\:<WWPN>,\:<FCPLUN>"
rd_ZFCP can be specified multiple times on the kernel command line.
example: rd_ZFCP=0.0.4000,0x5005076300C213e9,0x5022000000000000
.TP
.BR rd_NO_ZFCPCONF
ignore zfcp.conf included in the initramfs
.SS ZNET
.TP
.BR rd_ZNET= "<nettype>,<subchannels>,<options>"
rd_ZNET can be specified multiple times on the kernel command line. Examples:
rd_ZNET=qeth,0.0.0600,0.0.0601,0.0.0602,layer2=1,portname=foo
rd_ZNET=ctc,0.0.0600,0.0.0601,0.0.0602,protocol=bar
.SS "Plymouth Boot Splash"
.TP
.BR rd_NO_PLYMOUTH
do not start plymouth. This will not work with encrypted partitions.
.SH FILES
.TP
.B /var/log/dracut.log
.TP
.B /etc/dracut.conf
see \fBdracut.conf\fR(5)
.SS "Configuration in the Initramfs"
.TP
.B /etc/conf.d/
Any files found in /etc/conf.d/ will be sourced in the initramfs to
set initial values. Command line options will override these values
set in the configuration files.
.TP
.B /etc/cmdline
Can contain additional command line options.
.SH AUTHORS
.nf
Harald Hoyer <harald@redhat.com>
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
http://sourceforge.net/apps/trac/dracut/wiki
.SH SEE ALSO
.BR dracut.conf (5)

View File

@@ -1,3 +1,26 @@
# PUT YOUR CONFIG IN separate files
# in /etc/dracut.conf.d named "<name>.conf"
# SEE man dracut.conf(5) for options
# Sample dracut config file
# Specific list of dracut modules to use
#dracutmodules+=""
# Dracut modules to omit
#omit_dracutmodules+=""
# Dracut modules to add to the default
#add_dracutmodules+=""
# additional kernel modules to the default
#add_drivers+=""
# list of kernel filesystem modules to be included in the generic initramfs
#filesystems+=""
# build initrd only to boot current hardware
#hostonly="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)

View File

@@ -1,46 +0,0 @@
# dracut config file customized for RedHat/Fedora.
# i18n
i18n_vars="/etc/sysconfig/keyboard:KEYTABLE-KEYMAP /etc/sysconfig/i18n:SYSFONT-FONT,FONTACM-FONT_MAP,FONT_UNIMAP"
i18n_default_font="eurlatgr"
i18n_install_all="yes"
stdloglvl=3
sysloglvl=5
install_optional_items+=" vi /usr/libexec/vi /etc/virc ps grep cat rm "
prefix="/"
environment=/usr/lib/environment.d
environmentconfdir=/etc/environment.d
dbus=/usr/share/dbus-1
dbusinterfaces=/usr/share/dbus-1/interfaces
dbusservices=/usr/share/dbus-1/services
dbussession=/usr/share/dbus-1/session.d
dbussystem=/usr/share/dbus-1/system.d
dbussystemservices=/usr/share/dbus-1/system-services
dbusconfdir=/etc/dbus-1
dbusinterfacesconfdir=/etc/dbus-1/interfaces
dbusservicesconfdir=/etc/dbus-1/services
dbussessionconfdir=/etc/dbus-1/session.d
dbussystemconfdir=/etc/dbus-1/system.d
dbussystemservicesconfdir=/etc/dbus-1/system-services
sysctld=/usr/lib/sysctl.d
sysctlconfdir=/etc/sysctl.d
systemdutildir=/usr/lib/systemd
systemdutilconfdir=/etc/systemd
systemdcatalog=/usr/lib/systemd/catalog
systemdntpunits=/usr/lib/systemd/ntp-units.d
systemdntpunitsconfdir=/etc/systemd/ntp-units.d
systemdportable=/usr/lib/systemd/portable
systemdportableconfdir=/etc/systemd/portable
systemdsystemunitdir=/usr/lib/systemd/system
systemdsystemconfdir=/etc/systemd/system
systemduser=/usr/lib/systemd/user
systemduserconfdir=/etc/systemd/user
sysusers=/usr/lib/sysusers.d
sysusersconfdir=/etc/sysusers.d
udevdir=/usr/lib/udev
hostonly="yes"
hostonly_cmdline="no"
early_microcode="yes"
reproducible="yes"

View File

@@ -1,3 +0,0 @@
# turn on fips module
add_dracutmodules+=" fips "

View File

@@ -1,14 +0,0 @@
# SUSE specific dracut settings
#
# SUSE by default always builds as small as possible initrd for performance
# and resource reasons.
# If you like to build a generic initrd which works on other platforms than
# on the one dracut got called comment out below setting(s).
hostonly="yes"
hostonly_cmdline="yes"
compress="zstd -3 -T0 -q"
i18n_vars="/etc/sysconfig/language:RC_LANG-LANG,RC_LC_ALL-LC_ALL /etc/sysconfig/console:CONSOLE_UNICODEMAP-FONT_UNIMAP,CONSOLE_FONT-FONT,CONSOLE_SCREENMAP-FONT_MAP /etc/sysconfig/keyboard:KEYTABLE-KEYMAP"
omit_drivers+=" i2o_scsi "

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

2630
dracut.sh

File diff suppressed because it is too large Load Diff

295
dracut.spec Normal file
View File

@@ -0,0 +1,295 @@
# Variables must be defined
%define with_switch_root 1
%define with_nbd 1
# switchroot provided by util-linux-ng in F-12+
%if 0%{?fedora} > 11 || 0%{?rhel} >= 6
%define with_switch_root 0
%endif
# nbd in Fedora only
%if 0%{?rhel} >= 6
%define with_nbd 0
%endif
Name: dracut
Version: 004
Release: 1%{?dist}
Summary: Initramfs generator using udev
Group: System Environment/Base
License: GPLv2+
URL: http://apps.sourceforge.net/trac/dracut/wiki
Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%if 0%{?fedora} > 12 || 0%{?rhel} >= 6
# 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: 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: %{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}
%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
Requires: %{name} = %{version}-%{release}
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}
%if %{defined PATCH1}
git init
git config user.email "dracut-maint@redhat.com"
git config user.name "Fedora dracut team"
git add .
git commit -a -q -m "%{version} baseline."
# Apply all the patches.
git am -p1 %{patches}
%endif
chmod 0755 modules.d/*/check
# make rpmlint happy
chmod 0755 modules.d/*/install
chmod 0755 modules.d/*/installkernel
chmod 0755 modules.d/*/*.sh
%build
make WITH_SWITCH_ROOT=0%{?with_switch_root}
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT sbindir=/sbin \
sysconfdir=/etc mandir=%{_mandir} WITH_SWITCH_ROOT=0%{?with_switch_root}
echo %{name}-%{version}-%{release} > $RPM_BUILD_ROOT/%{_datadir}/dracut/modules.d/10rpmversion/dracut-version
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 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
%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 tools
%defattr(-,root,root,0755)
%doc COPYING NEWS
%{_mandir}/man8/dracut-gencmdline.8*
%{_mandir}/man8/dracut-catimages.8*
/sbin/dracut-gencmdline
/sbin/dracut-catimages
%dir /boot/dracut
%dir /var/lib/dracut
%dir /var/lib/dracut/overlay
%changelog

View File

Before

Width:  |  Height:  |  Size: 68 KiB

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 $_;
}
}

View File

@@ -1,99 +0,0 @@
#!/bin/bash
COMMAND="$1"
KERNEL_VERSION="$2"
BOOT_DIR_ABS="$3"
KERNEL_IMAGE="$4"
# If KERNEL_INSTALL_MACHINE_ID is defined but empty, BOOT_DIR_ABS is a fake directory.
# So, let's skip to create initrd.
if ! [[ ${KERNEL_INSTALL_MACHINE_ID-x} ]]; then
exit 0
fi
# Mismatching the install layout and the --uefi/--no-uefi opts just creates a mess.
if [[ $KERNEL_INSTALL_LAYOUT == "uki" && -n $KERNEL_INSTALL_STAGING_AREA ]]; then
BOOT_DIR_ABS="$KERNEL_INSTALL_STAGING_AREA"
IMAGE="uki.efi"
UEFI_OPTS="--uefi"
elif [[ $KERNEL_INSTALL_LAYOUT == "bls" && -n $KERNEL_INSTALL_STAGING_AREA ]]; then
BOOT_DIR_ABS="$KERNEL_INSTALL_STAGING_AREA"
IMAGE="initrd"
UEFI_OPTS="--no-uefi"
else
# No layout information, use users --uefi/--no-uefi preference
UEFI_OPTS=""
if [[ -d $BOOT_DIR_ABS ]]; then
IMAGE="initrd"
else
BOOT_DIR_ABS="/boot"
IMAGE="initramfs-${KERNEL_VERSION}.img"
fi
fi
ret=0
case "$COMMAND" in
add)
if [[ $IMAGE == "uki.efi" ]]; then
IMAGE_PREGENERATED=${KERNEL_IMAGE%/*}/uki.efi
else
IMAGE_PREGENERATED=${KERNEL_IMAGE%/*}/initrd
fi
if [[ -f ${IMAGE_PREGENERATED} ]]; then
# we found an initrd or uki.efi at the same place as the kernel
# use this and don't generate a new one
[[ $KERNEL_INSTALL_VERBOSE == 1 ]] && echo \
"There is an ${IMAGE} image at the same place as the kernel, skipping generating a new one"
cp --reflink=auto "$IMAGE_PREGENERATED" "$BOOT_DIR_ABS/$IMAGE" \
&& chown root:root "$BOOT_DIR_ABS/$IMAGE" \
&& chmod 0600 "$BOOT_DIR_ABS/$IMAGE" \
&& exit 0
fi
if [ -n "$KERNEL_INSTALL_CONF_ROOT" ]; then
if [ -f "$KERNEL_INSTALL_CONF_ROOT/cmdline" ]; then
read -r -d '' -a BOOT_OPTIONS < "$KERNEL_INSTALL_CONF_ROOT/cmdline"
fi
elif [[ -f /etc/kernel/cmdline ]]; then
read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
elif [[ -f /usr/lib/kernel/cmdline ]]; then
read -r -d '' -a BOOT_OPTIONS < /usr/lib/kernel/cmdline
else
declare -a BOOT_OPTIONS
read -r -d '' -a line < /proc/cmdline
for i in "${line[@]}"; do
[[ ${i#initrd=*} != "$i" ]] && continue
BOOT_OPTIONS+=("$i")
done
fi
unset noimageifnotneeded
for ((i = 0; i < "${#BOOT_OPTIONS[@]}"; i++)); do
# shellcheck disable=SC1001
if [[ ${BOOT_OPTIONS[$i]} == root\=PARTUUID\=* ]]; then
noimageifnotneeded="yes"
break
fi
done
# shellcheck disable=SC2046
dracut -f \
${noimageifnotneeded:+--noimageifnotneeded} \
$([[ $KERNEL_INSTALL_VERBOSE == 1 ]] && echo --verbose) \
$([[ -n $KERNEL_IMAGE ]] && echo --kernel-image "$KERNEL_IMAGE") \
"$UEFI_OPTS" \
--kver "$KERNEL_VERSION" \
"$BOOT_DIR_ABS/$IMAGE"
ret=$?
;;
remove)
rm -f -- "$BOOT_DIR_ABS/$IMAGE"
ret=$?
;;
esac
exit $ret

View File

@@ -1,153 +0,0 @@
#!/bin/bash
export LANG=C
COMMAND="$1"
KERNEL_VERSION="$2"
BOOT_DIR_ABS="${3%/*}/0-rescue"
KERNEL_IMAGE="$4"
dropindirs_sort() {
suffix=$1
shift
args=("$@")
files=$(
while (($# > 0)); do
for i in "${1}"/*"${suffix}"; do
[[ -f $i ]] && echo "${i##*/}"
done
shift
done | sort -Vu
)
for f in $files; do
for d in "${args[@]}"; do
if [[ -f "$d/$f" ]]; then
echo "$d/$f"
continue 2
fi
done
done
}
if [[ -f /etc/os-release ]]; then
. /etc/os-release
elif [[ -f /usr/lib/os-release ]]; then
. /usr/lib/os-release
fi
[[ -n $PRETTY_NAME ]] || PRETTY_NAME="Linux $KERNEL_VERSION"
if [[ ${KERNEL_INSTALL_MACHINE_ID+x} ]]; then
MACHINE_ID=$KERNEL_INSTALL_MACHINE_ID
elif [[ -f /etc/machine-id ]]; then
read -r MACHINE_ID < /etc/machine-id
fi
if ! [[ $MACHINE_ID ]]; then
exit 0
fi
if [ -n "$KERNEL_INSTALL_CONF_ROOT" ]; then
if [ -f "$KERNEL_INSTALL_CONF_ROOT/cmdline" ]; then
read -r -d '' -a BOOT_OPTIONS < "$KERNEL_INSTALL_CONF_ROOT/cmdline"
fi
elif [[ -f /etc/kernel/cmdline ]]; then
read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
elif [[ -f /usr/lib/kernel/cmdline ]]; then
read -r -d '' -a BOOT_OPTIONS < /usr/lib/kernel/cmdline
else
declare -a BOOT_OPTIONS
read -r -d '' -a line < /proc/cmdline
for i in "${line[@]}"; do
[[ ${i#initrd=*} != "$i" ]] && continue
BOOT_OPTIONS+=("$i")
done
fi
if [[ -d ${BOOT_DIR_ABS%/*} ]]; then
BOOT_DIR="/${MACHINE_ID}/0-rescue"
BOOT_ROOT=${BOOT_DIR_ABS%"$BOOT_DIR"}
LOADER_ENTRY="$BOOT_ROOT/loader/entries/${MACHINE_ID}-0-rescue.conf"
KERNEL="linux"
INITRD="initrd"
else
BLS_DIR="/boot/loader/entries"
BOOT_DIR_ABS="/boot"
LOADER_ENTRY="$BLS_DIR/${MACHINE_ID}-0-rescue.conf"
KERNEL="vmlinuz-0-rescue-${MACHINE_ID}"
INITRD="initramfs-0-rescue-${MACHINE_ID}.img"
fi
ret=0
case "$COMMAND" in
add)
if [[ -f $LOADER_ENTRY ]] && [[ -f "$BOOT_DIR_ABS/$KERNEL" ]] \
&& [[ -f "$BOOT_DIR_ABS/$INITRD" ]]; then
[[ $KERNEL_INSTALL_VERBOSE == 1 ]] \
&& echo "Skipping, there is already a rescue image generated with the same input parameters"
exit 0
fi
# source our config dir
for f in $(dropindirs_sort ".conf" "/etc/dracut.conf.d" "/usr/lib/dracut/dracut.conf.d"); do
if [[ -e $f ]]; then
# shellcheck disable=SC1090
. "$f"
fi
done
# shellcheck disable=SC2154
if [[ $dracut_rescue_image != "yes" ]]; then
[[ $KERNEL_INSTALL_VERBOSE == 1 ]] \
&& echo "Skipping, 'dracut_rescue_image' not set to 'yes' in any dracut configuration file"
exit 0
fi
[[ -d $BOOT_DIR_ABS ]] || mkdir -p "$BOOT_DIR_ABS"
if ! cp --reflink=auto "$KERNEL_IMAGE" "$BOOT_DIR_ABS/$KERNEL"; then
echo "Can't copy '$KERNEL_IMAGE to '$BOOT_DIR_ABS/$KERNEL'!" >&2
fi
if [[ ! -f "$BOOT_DIR_ABS/$INITRD" ]]; then
# shellcheck disable=SC2046
dracut -f --no-hostonly --no-uefi \
-a "rescue" \
$([[ $KERNEL_INSTALL_VERBOSE == 1 ]] && echo --verbose) \
--kver "$KERNEL_VERSION" \
"$BOOT_DIR_ABS/$INITRD"
((ret += $?))
fi
[[ $KERNEL_INSTALL_VERBOSE == 1 ]] && echo "Creating $LOADER_ENTRY"
if [[ ${BOOT_DIR_ABS} != "/boot" ]]; then
{
echo "title $PRETTY_NAME - Rescue Image"
echo "version $KERNEL_VERSION"
echo "machine-id $MACHINE_ID"
echo "options ${BOOT_OPTIONS[*]} rd.auto=1"
echo "linux $BOOT_DIR/linux"
echo "initrd $BOOT_DIR/initrd"
} > "$LOADER_ENTRY"
else
if [[ -e "${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf" ]]; then
cp -aT "${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf" "$LOADER_ENTRY"
else
cp -aT "${KERNEL_IMAGE%/*}/bls.conf" "$LOADER_ENTRY"
fi
sed -i "s/${KERNEL_VERSION}/0-rescue-${MACHINE_ID}/" "$LOADER_ENTRY"
fi
((ret += $?))
;;
remove)
exit 0
;;
esac
exit $ret

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)

View File

@@ -1,397 +0,0 @@
#!/bin/bash
#
# 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 "-m, --mod list modules."
echo "-f, --file <filename> print the contents of <filename>."
echo "--unpack unpack the initramfs, instead of displaying the contents."
echo " If optional filenames are given, will only unpack specified files,"
echo " else the whole image will be unpacked. Won't unpack anything from early cpio part."
echo "--unpackearly unpack the early microcode part of the initramfs."
echo " Same as --unpack, but only unpack files from early cpio part."
echo "-v, --verbose unpack verbosely."
echo "-k, --kver <kernel version> inspect the initramfs of <kernel version>."
echo
} >&2
}
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
sorted=0
modules=0
unset verbose
declare -A filenames
unset POSIXLY_CORRECT
TEMP=$(getopt \
-o "vshmf:k:" \
--long kver: \
--long file: \
--long mod \
--long help \
--long size \
--long unpack \
--long unpackearly \
--long verbose \
-- "$@")
# shellcheck disable=SC2181
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
;;
-m | --mod) modules=1 ;;
-v | --verbose) verbose="--verbose" ;;
--unpack) unpack=1 ;;
--unpackearly) unpackearly=1 ;;
--)
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
if [[ -d /efi/Default ]] || [[ -d /boot/Default ]] || [[ -d /boot/efi/Default ]]; then
MACHINE_ID="Default"
elif [[ -s /etc/machine-id ]]; then
read -r MACHINE_ID < /etc/machine-id
[[ $MACHINE_ID == "uninitialized" ]] && MACHINE_ID="Default"
else
MACHINE_ID="Default"
fi
if [[ -d /efi/loader/entries || -L /efi/loader/entries ]] \
&& [[ $MACHINE_ID ]] \
&& [[ -d /efi/${MACHINE_ID} || -L /efi/${MACHINE_ID} ]]; then
image="/efi/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
elif [[ -d /boot/loader/entries || -L /boot/loader/entries ]] \
&& [[ $MACHINE_ID ]] \
&& [[ -d /boot/${MACHINE_ID} || -L /boot/${MACHINE_ID} ]]; then
image="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
elif [[ -d /boot/efi/loader/entries || -L /boot/efi/loader/entries ]] \
&& [[ $MACHINE_ID ]] \
&& [[ -d /boot/efi/${MACHINE_ID} || -L /boot/efi/${MACHINE_ID} ]]; then
image="/boot/efi/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
elif [[ -f /lib/modules/${KERNEL_VERSION}/initrd ]]; then
image="/lib/modules/${KERNEL_VERSION}/initrd"
elif [[ -f /lib/modules/${KERNEL_VERSION}/initramfs.img ]]; then
image="/lib/modules/${KERNEL_VERSION}/initramfs.img"
elif [[ -f /boot/initramfs-${KERNEL_VERSION}.img ]]; then
image="/boot/initramfs-${KERNEL_VERSION}.img"
elif [[ $MACHINE_ID ]] \
&& mountpoint -q /efi; then
image="/efi/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
elif [[ $MACHINE_ID ]] \
&& mountpoint -q /boot/efi; then
image="/boot/efi/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
else
image=""
fi
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
TMPDIR="$(mktemp -d -t lsinitrd.XXXXXX)"
# shellcheck disable=SC2064
trap "rm -rf '$TMPDIR'" EXIT
dracutlibdirs() {
for d in lib64/dracut lib/dracut usr/lib64/dracut usr/lib/dracut; do
echo "$d/$1"
done
}
extract_files() {
((${#filenames[@]} == 1)) && nofileinfo=1
for f in "${!filenames[@]}"; do
[[ $nofileinfo ]] || echo "initramfs:/$f"
[[ $nofileinfo ]] || echo "========================================================================"
# shellcheck disable=SC2001
[[ $f == *"\\x"* ]] && f=$(echo "$f" | sed 's/\\x.\{2\}/????/g')
$CAT "$image" 2> /dev/null | cpio --extract --verbose --quiet --to-stdout "$f" 2> /dev/null
((ret += $?))
[[ $nofileinfo ]] || echo "========================================================================"
[[ $nofileinfo ]] || echo
done
}
list_modules() {
echo "dracut modules:"
# shellcheck disable=SC2046
$CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- \
$(dracutlibdirs modules.txt) 2> /dev/null
((ret += $?))
}
list_files() {
echo "========================================================================"
if [ "$sorted" -eq 1 ]; then
$CAT "$image" 2> /dev/null | cpio --extract --verbose --quiet --list | sort -n -k5
else
$CAT "$image" 2> /dev/null | cpio --extract --verbose --quiet --list | sort -k9
fi
((ret += $?))
echo "========================================================================"
}
list_squash_content() {
SQUASH_IMG="squash-root.img"
SQUASH_TMPFILE="$TMPDIR/initrd.root.sqsh"
$CAT "$image" 2> /dev/null | cpio --extract --verbose --quiet --to-stdout -- \
$SQUASH_IMG > "$SQUASH_TMPFILE" 2> /dev/null
if [[ -s $SQUASH_TMPFILE ]]; then
echo "Squashed content ($SQUASH_IMG):"
echo "========================================================================"
unsquashfs -ll "$SQUASH_TMPFILE" | tail -n +4
echo "========================================================================"
fi
}
unpack_files() {
if ((${#filenames[@]} > 0)); then
for f in "${!filenames[@]}"; do
# shellcheck disable=SC2001
[[ $f == *"\\x"* ]] && f=$(echo "$f" | sed 's/\\x.\{2\}/????/g')
$CAT "$image" 2> /dev/null | cpio -id --quiet $verbose "$f"
((ret += $?))
done
else
$CAT "$image" 2> /dev/null | cpio -id --quiet $verbose
((ret += $?))
fi
}
read -r -N 2 bin < "$image"
if [ "$bin" = "MZ" ]; then
command -v objcopy > /dev/null || {
echo "Need 'objcopy' to unpack an UEFI executable."
exit 1
}
objcopy \
--dump-section .linux="$TMPDIR/vmlinuz" \
--dump-section .initrd="$TMPDIR/initrd.img" \
--dump-section .cmdline="$TMPDIR/cmdline.txt" \
--dump-section .osrel="$TMPDIR/osrel.txt" \
"$image" /dev/null
uefi="$image"
image="$TMPDIR/initrd.img"
[ -f "$image" ] || exit 1
fi
if ((${#filenames[@]} <= 0)) && [[ -z $unpack ]] && [[ -z $unpackearly ]]; then
if [ -n "$uefi" ]; then
echo -n "initrd in UEFI: $uefi: "
du -h "$image" | while read -r a _ || [ -n "$a" ]; do echo "$a"; done
if [ -f "$TMPDIR/osrel.txt" ]; then
name=$(sed -En '/^PRETTY_NAME/ s/^\w+=["'"'"']?([^"'"'"'$]*)["'"'"']?/\1/p' "$TMPDIR/osrel.txt")
id=$(sed -En '/^ID/ s/^\w+=["'"'"']?([^"'"'"'$]*)["'"'"']?/\1/p' "$TMPDIR/osrel.txt")
build=$(sed -En '/^BUILD_ID/ s/^\w+=["'"'"']?([^"'"'"'$]*)["'"'"']?/\1/p' "$TMPDIR/osrel.txt")
echo "OS Release: $name (${id}-${build})"
fi
if [ -f "$TMPDIR/vmlinuz" ]; then
version=$(strings -n 20 "$TMPDIR/vmlinuz" | sed -En '/[0-9]+\.[0-9]+\.[0-9]+/ { p; q 0 }')
echo "Kernel Version: $version"
fi
if [ -f "$TMPDIR/cmdline.txt" ]; then
echo "Command line:"
sed -En 's/\s+/\n/g; s/\x00/\n/; p' "$TMPDIR/cmdline.txt"
fi
else
echo -n "Image: $image: "
du -h "$image" | while read -r a _ || [ -n "$a" ]; do echo "$a"; done
fi
echo "========================================================================"
fi
read -r -N 6 bin < "$image"
case $bin in
$'\x71\xc7'* | 070701)
CAT="cat --"
is_early=$(cpio --extract --verbose --quiet --to-stdout -- 'early_cpio' < "$image" 2> /dev/null)
# Debian mkinitramfs does not create the file 'early_cpio', so let's check if firmware files exist
[[ "$is_early" ]] || is_early=$(cpio --list --verbose --quiet --to-stdout -- 'kernel/*/microcode/*.bin' < "$image" 2> /dev/null)
if [[ "$is_early" ]]; then
if [[ -n $unpack ]]; then
# should use --unpackearly for early CPIO
:
elif [[ -n $unpackearly ]]; then
unpack_files
elif ((${#filenames[@]} > 0)); then
extract_files
else
echo "Early CPIO image"
list_files
fi
if [[ -d "$dracutbasedir/src/skipcpio" ]]; then
SKIP="$dracutbasedir/src/skipcpio/skipcpio"
else
SKIP="$dracutbasedir/skipcpio"
fi
if ! [[ -x $SKIP ]]; then
echo
echo "'$SKIP' not found, cannot display remaining contents!" >&2
echo
exit 0
fi
fi
;;
esac
if [[ $SKIP ]]; then
bin="$($SKIP "$image" | { read -r -N 6 bin && echo "$bin"; })"
else
read -r -N 6 bin < "$image"
fi
case $bin in
$'\x1f\x8b'*)
CAT="zcat --"
;;
BZh*)
CAT="bzcat --"
;;
$'\x71\xc7'* | 070701)
CAT="cat --"
;;
$'\x02\x21'*)
CAT="lz4 -d -c"
;;
$'\x89'LZO$'\0'*)
CAT="lzop -d -c"
;;
$'\x28\xB5\x2F\xFD'*)
CAT="zstd -d -c"
;;
*)
if echo "test" | xz | xzcat --single-stream > /dev/null 2>&1; then
CAT="xzcat --single-stream --"
else
CAT="xzcat --"
fi
;;
esac
type "${CAT%% *}" > /dev/null 2>&1 || {
echo "Need '${CAT%% *}' to unpack the initramfs."
exit 1
}
skipcpio() {
$SKIP "$@" | $ORIG_CAT
}
if [[ $SKIP ]]; then
ORIG_CAT="$CAT"
CAT=skipcpio
fi
if ((${#filenames[@]} > 1)); then
TMPFILE="$TMPDIR/initrd.cpio"
$CAT "$image" 2> /dev/null > "$TMPFILE"
pre_decompress() {
cat "$TMPFILE"
}
CAT=pre_decompress
fi
ret=0
if [[ -n $unpack ]]; then
unpack_files
elif ((${#filenames[@]} > 0)); then
extract_files
else
# shellcheck disable=SC2046
version=$($CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- \
$(dracutlibdirs 'dracut-*') 2> /dev/null)
((ret += $?))
echo "Version: $version"
echo
if [ "$modules" -eq 1 ]; then
list_modules
echo "========================================================================"
else
echo -n "Arguments: "
# shellcheck disable=SC2046
$CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- \
$(dracutlibdirs build-parameter.txt) 2> /dev/null
echo
list_modules
list_files
list_squash_content
fi
fi
exit "$ret"

View File

@@ -1,59 +0,0 @@
DRACUT-CATIMAGES(8)
===================
:doctype: manpage
:man source: dracut
:man manual: dracut
NAME
----
dracut-catimages - creates initial ramdisk image by concatenating images
SYNOPSIS
--------
**dracut-catimages** [_OPTION_...] _<initramfs base image>_ [_<image>_...]
DESCRIPTION
-----------
dracut-catimages creates an initial ramdisk image by concatenating several
images from the command line and /boot/dracut/*.img
OPTIONS
-------
**-f, --force**::
overwrite existing initramfs file.
**-i, --imagedir**::
Directory with additional images to add (default: /boot/dracut/)
**-o, --overlaydir**::
Overlay directory, which contains additional 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**:: display help text and exit.
**--debug**:: output debug information of the build process
**-v, --verbose**:: verbose output during the build process
FILES
-----
_/boot/dracut/*.img_::
images to work with
AUTHORS
-------
Harald Hoyer
AVAILABILITY
------------
The dracut-catimages command is part of the dracut package and is available from
link:$$https://github.com/dracutdevs/dracut$$[https://github.com/dracutdevs/dracut]
SEE ALSO
--------
*dracut*(8)

View File

@@ -1,767 +0,0 @@
DRACUT(8)
=========
:doctype: manpage
:man source: dracut
:man manual: dracut
:man version: {version}
NAME
----
dracut - low-level tool for generating an initramfs/initrd image
SYNOPSIS
--------
*dracut* [__OPTION...__] [__<image>__ [__<kernel version>__]]
DESCRIPTION
-----------
Create an initramfs <image> for the kernel with the version <kernel version>.
If <kernel version> is omitted, then the version of the actual running
kernel is used. If <image> is omitted or empty, depending on bootloader
specification, the default location can be
_/efi/<machine-id>/<kernel-version>/initrd_,
_/boot/<machine-id>/<kernel-version>/initrd_,
_/boot/efi/<machine-id>/<kernel-version>/initrd_,
_/lib/modules/<kernel-version>/initrd_ or
_/boot/initramfs-<kernel-version>.img_.
dracut creates an initial image used by the kernel for preloading the block
device modules (such as IDE, SCSI or RAID) which are needed to access the root
filesystem, mounting the root filesystem and booting into the real system.
At boot time, the kernel unpacks that archive into RAM disk, mounts and uses it
as initial root file system. All finding of the root device happens in this
early userspace.
Initramfs images are also called "initrd".
For a complete list of kernel command line options see *dracut.cmdline*(7).
If you are dropped to an emergency shell, while booting your initramfs,
the file _/run/initramfs/rdsosreport.txt_ is created, which can be saved to a
(to be mounted by hand) partition (usually /boot) or a USB stick.
Additional debugging info can be produced by adding **rd.debug** to the kernel
command line. _/run/initramfs/rdsosreport.txt_ contains all logs and the output
of some tools. It should be attached to any report about dracut problems.
USAGE
-----
include::dracut.usage.asc[]
OPTIONS
-------
**--kver** _<kernel version>_::
Set the kernel version. This enables to specify the kernel version, without
specifying the location of the initramfs image. For example:
----
# dracut --kver 3.5.0-0.rc7.git1.2.fc18.x86_64
----
**-f, --force**::
Overwrite existing initramfs file.
_<output file>_ **--rebuild**::
Append the current arguments to those with which the input initramfs image
was built. This option helps in incrementally building the initramfs for
testing. If optional _<output file>_ is not provided, the input initramfs
provided to rebuild will be used as output file.
**-a, --add** _<list of dracut modules>_::
Add a space-separated list of dracut modules to the default set of modules.
This parameter can be specified multiple times.
+
[NOTE]
===============================
If the list has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --add "module1 module2" ...
----
===============================
**--force-add** _<list of dracut modules>_::
Force to add a space-separated list of dracut modules to the default set of
modules, when -H is specified. This parameter can be specified multiple
times.
+
[NOTE]
===============================
If the list has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --force-add "module1 module2" ...
----
===============================
**-o, --omit** _<list of dracut modules>_::
Omit a space-separated list of dracut modules. This parameter can be
specified multiple times.
+
[NOTE]
===============================
If the list has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --omit "module1 module2" ...
----
===============================
**-m, --modules** _<list of dracut modules>_::
Specify a space-separated list of dracut modules to call when building the
initramfs. Modules are located in _/usr/lib/dracut/modules.d_. This
parameter can be specified multiple times.
This option forces dracut to only include the specified dracut modules.
In most cases the "--add" option is what you want to use.
+
[NOTE]
===============================
If the list has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --modules "module1 module2" ...
----
===============================
**-d, --drivers** _<list of kernel modules>_::
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. This parameter can be specified multiple times.
+
[NOTE]
===============================
If the list has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --drivers "kmodule1 kmodule2" ...
----
===============================
**--add-drivers** _<list of kernel modules>_::
Specify a space-separated list of kernel modules to add to the initramfs.
The kernel modules have to be specified without the ".ko" suffix. This
parameter can be specified multiple times.
+
[NOTE]
===============================
If the list has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --add-drivers "kmodule1 kmodule2" ...
----
===============================
**--force-drivers** _<list of kernel modules>_::
See add-drivers above. But in this case it is ensured that the drivers
are tried to be loaded early via modprobe.
+
[NOTE]
===============================
If the list has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --force-drivers "kmodule1 kmodule2" ...
----
===============================
**--omit-drivers** _<list of kernel modules>_::
Specify a space-separated list of kernel modules not to add to the
initramfs.
The kernel modules have to be specified without the ".ko" suffix. This
parameter can be specified multiple times.
+
[NOTE]
===============================
If the list has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --omit-drivers "kmodule1 kmodule2" ...
----
===============================
**--filesystems** _<list of filesystems>_::
Specify a space-separated list of kernel filesystem modules to exclusively
include in the generic initramfs. This parameter can be specified multiple
times.
+
[NOTE]
===============================
If the list has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --filesystems "filesystem1 filesystem2" ...
----
===============================
**-k, --kmoddir** _<kernel directory>_::
Specify the directory, where to look for kernel modules.
**--fwdir** _<dir>[:<dir>...]++_::
Specify additional directories, where to look for firmwares. This parameter
can be specified multiple times.
**--libdirs** _<list of directories>_::
Specify a space-separated list of directories to look for libraries to
include in the generic initramfs. This parameter can be specified multiple
times.
+
[NOTE]
===============================
If the list has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --libdirs "dir1 dir2" ...
----
===============================
**--kernel-cmdline <parameters>**::
Specify default kernel command line parameters.
**--kernel-only**::
Only install kernel drivers and firmware files.
**--no-kernel**::
Do not install kernel drivers and firmware files.
**--early-microcode**::
Combine early microcode with ramdisk.
**--no-early-microcode**::
Do not combine early microcode with ramdisk.
**--print-cmdline**::
Print the kernel command line for the current disk layout.
**--mdadmconf**::
Include local _/etc/mdadm.conf_ file.
**--nomdadmconf**::
Do not include local _/etc/mdadm.conf_ file.
**--lvmconf**::
Include local _/etc/lvm/lvm.conf_ file.
**--nolvmconf**::
Do not include local _/etc/lvm/lvm.conf_ file.
**--fscks** _<list of fsck tools>_::
Add a space-separated list of fsck tools, in addition to _dracut.conf_'s
specification; the installation is opportunistic (non-existing tools are
ignored).
+
[NOTE]
===============================
If the list has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --fscks "fsck.foo barfsck" ...
----
===============================
**--nofscks**::
Inhibit installation of any fsck tools.
**--strip**::
Strip binaries in the initramfs (default).
**--aggressive-strip**::
Strip more than just debug symbol and sections, for a smaller initramfs
build. The --strip option must also be specified.
**--nostrip**::
Do not strip binaries in the initramfs.
**--hardlink**::
Hardlink files in the initramfs (default).
**--nohardlink**::
Do not hardlink files in the initramfs.
**--prefix** _<dir>_::
Prefix initramfs files with the specified directory.
**--noprefix**::
Do not prefix initramfs files (default).
**-h, --help**::
Display help text and exit.
**--debug**::
Output debug information of the build process.
**-v, --verbose**::
Increase verbosity level (default is info(4)).
**--version**::
Display version and exit.
**-q, --quiet**::
Decrease verbosity level (default is info(4)).
**-c, --conf** _<dracut configuration file>_::
Specify configuration file to use.
+
Default:
_/etc/dracut.conf_
**--confdir** _<configuration directory>_::
Specify configuration directory to use.
+
Default:
_/etc/dracut.conf.d_
**--tmpdir** _<temporary directory>_::
Specify temporary directory to use.
+
Default:
_/var/tmp_
**-r, --sysroot** _<sysroot directory>_::
Specify the sysroot directory to collect files from.
This is useful to create the initramfs image from
a cross-compiled sysroot directory. For the extra helper
variables, see *ENVIRONMENT* below.
+
Default:
_empty_
**--sshkey** _<sshkey file>_::
SSH key file used with ssh-client module.
**--logfile** _<logfile>_::
Logfile to use; overrides any setting from the configuration files.
+
Default:
_/var/log/dracut.log_
**-l, --local**::
Activates the local mode. dracut will use modules from the current working
directory instead of the system-wide installed modules in
_/usr/lib/dracut/modules.d_.
This is useful when running dracut from a git checkout.
**-H, --hostonly**::
Host-only mode: Install only what is needed for booting the local host
instead of a generic host and generate host-specific configuration.
+
[WARNING]
====
If chrooted to another root other than the real root device, use "--fstab" and
provide a valid _/etc/fstab_.
====
**-N, --no-hostonly**::
Disable host-only mode.
**--hostonly-mode _<mode>_**::
Specify the host-only mode to use. _<mode>_ could be one of "sloppy" or
"strict".
In "sloppy" host-only mode, extra drivers and modules will be installed, so
minor hardware change won't make the image unbootable (e.g. changed
keyboard), and the image is still portable among similar hosts.
With "strict" mode enabled, anything not necessary for booting the local
host in its current state will not be included, and modules may do some
extra job to save more space. Minor change of hardware or environment could
make the image unbootable.
+
Default:
_sloppy_
**--hostonly-cmdline**::
Store kernel command line arguments needed in the initramfs.
**--no-hostonly-cmdline**::
Do not store kernel command line arguments needed in the initramfs.
**--no-hostonly-default-device**::
Do not generate implicit host devices like root, swap, fstab, etc.
Use "--mount" or "--add-device" to explicitly add devices as needed.
**--hostonly-i18n**::
Install only needed keyboard and font files according to the host
configuration (default).
**--no-hostonly-i18n**::
Install all keyboard and font files available.
**--hostonly-nics** _<list of nics>_::
Only enable listed NICs in the initramfs. The list can be empty, so other
modules can install only the necessary network drivers.
**--persistent-policy** _<policy>_::
Use _<policy>_ to address disks and partitions.
_<policy>_ can be any directory name found in /dev/disk (e.g. "by-uuid",
"by-label"), or "mapper" to use /dev/mapper device names (default).
**--fstab**::
Use _/etc/fstab_ instead of _/proc/self/mountinfo_.
**--add-fstab** _<filename>_::
Add entries of _<filename>_ to the initramfs /etc/fstab.
**--mount** "_<device>_ _<mountpoint>_ _<filesystem type>_ [_<filesystem options>_ [_<dump frequency>_ [_<fsck order>_]]]"::
Mount _<device>_ on _<mountpoint>_ with _<filesystem type>_ in the
initramfs. _<filesystem options>_, _<dump options>_ and _<fsck order>_ can
be specified, see fstab manpage for the details.
The default _<filesystem options>_ is "defaults".
The default _<dump frequency>_ is "0".
The default _<fsck order>_ is "2".
**--mount** "_<mountpoint>_"::
Like above, but _<device>_, _<filesystem type>_ and _<filesystem options>_
are determined by looking at the current mounts.
**--add-device** _<device>_ ::
Bring up _<device>_ in initramfs, _<device>_ should be the device name.
This can be useful in host-only mode for resume support when your swap is on
LVM or an encrypted partition.
[NB --device can be used for compatibility with earlier releases]
**-i, --include** _<SOURCE>_ _<TARGET>_::
Include the files in the SOURCE directory into the
TARGET directory in the final initramfs. If SOURCE is a file, it will be
installed to TARGET in the final initramfs. This parameter can be specified
multiple times.
**-I, --install** _<file list>_::
Install the space separated list of files into the initramfs.
+
[NOTE]
===============================
If the list has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --install "/bin/foo /sbin/bar" ...
----
===============================
**--install-optional** _<file list>_::
Install the space separated list of files into the initramfs, if they exist.
**--gzip**::
Compress the generated initramfs using gzip. This will be done by default,
unless another compression option or --no-compress is passed. Equivalent to
"--compress=gzip -9".
**--bzip2**::
Compress the generated initramfs using bzip2.
+
[WARNING]
====
Make sure your kernel has bzip2 decompression support compiled in, otherwise you
will not be able to boot. Equivalent to "--compress=bzip2 -9".
====
**--lzma**::
Compress the generated initramfs using lzma.
+
[WARNING]
====
Make sure your kernel has lzma decompression support compiled in, otherwise you
will not be able to boot. Equivalent to "--compress=lzma -9 -T0".
====
**--xz**::
Compress the generated initramfs using xz.
+
[WARNING]
====
Make sure your kernel has xz decompression support compiled in, otherwise you
will not be able to boot. Equivalent to
"--compress=xz --check=crc32 --lzma2=dict=1MiB -T0".
====
**--lzo**::
Compress the generated initramfs using lzop.
+
[WARNING]
====
Make sure your kernel has lzo decompression support compiled in, otherwise you
will not be able to boot. Equivalent to "--compress=lzop -9".
====
**--lz4**::
Compress the generated initramfs using lz4.
+
[WARNING]
====
Make sure your kernel has lz4 decompression support compiled in, otherwise you
will not be able to boot. Equivalent to "--compress=lz4 -l -9".
====
**--zstd**::
Compress the generated initramfs using Zstandard.
+
[WARNING]
====
Make sure your kernel has zstd decompression support compiled in, otherwise you
will not be able to boot. Equivalent to "--compress=zstd -15 -q -T0".
====
**--compress** _<compressor>_::
Compress the generated initramfs using the passed compression program. If
you pass it just the name of a compression program, it will call that
program with known-working arguments. If you pass a quoted string with
arguments, it will be called with exactly those arguments. Depending on what
you pass, this may result in an initramfs that the kernel cannot decompress.
The default value can also be set via the _INITRD_COMPRESS_ environment
variable.
**--squash-compressor** _<compressor>_::
Compress the squashfs image using the passed compressor and compressor
specific options for mksquashfs. You can refer to mksquashfs manual for
supported compressors and compressor specific options. If squash module is
not called when building the initramfs, this option will not take effect.
**--no-compress**::
Do not compress the generated initramfs. This will override any other
compression options.
**--reproducible**::
Create reproducible images.
**--no-reproducible**::
Do not create reproducible images.
**--list-modules**::
List all available dracut modules.
**-M, --show-modules**::
Print included module's name to standard output during build.
**--keep**::
Keep the initramfs temporary directory for debugging purposes.
**--printsize**::
Print out the module install size.
**--profile**::
Output profile information of the build process.
**--ro-mnt**::
Mount / and /usr read-only by default.
**-L, --stdlog** _<level>_::
[0-6] Specify logging level (to standard error).
----
0 - suppress any messages
1 - only fatal errors
2 - all errors
3 - warnings
4 - info
5 - debug info (here starts lots of output)
6 - trace info (and even more)
----
**--regenerate-all**::
Regenerate all initramfs images at the default location with the kernel
versions found on the system. Additional parameters are passed through.
**-p, --parallel**::
Try to execute tasks in parallel. Currently only supported with
**--regenerate-all** (build initramfs images for all kernel
versions simultaneously).
**--noimageifnotneeded**::
Do not create an image in host-only mode, if no kernel driver is needed
and no /etc/cmdline/*.conf will be generated into the initramfs.
**--loginstall _<directory>_**::
Log all files installed from the host to _<directory>_.
**--uefi**::
Instead of creating an initramfs image, dracut will create an UEFI
executable, which can be executed by an UEFI BIOS. The default output
filename is _<EFI>/EFI/Linux/linux-$kernel$-<MACHINE_ID>-<BUILD_ID>.efi_.
<EFI> might be _/efi_, _/boot_ or _/boot/efi_ depending on where the ESP
partition is mounted. The <BUILD_ID> is taken from BUILD_ID in
_/usr/lib/os-release_ or if it exists _/etc/os-release_ and is left out,
if BUILD_ID is non-existant or empty.
**--no-uefi**::
Disables UEFI mode.
**--no-machineid**::
Affects the default output filename of **--uefi** and will discard the
<MACHINE_ID> part.
**--uefi-stub _<file>_**::
Specifies the UEFI stub loader, which will load the attached kernel,
initramfs and kernel command line and boots the kernel. The default is
_$prefix/lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_.
**--uefi-splash-image _<file>_**::
Specifies the UEFI stub loader's splash image. Requires bitmap (**.bmp**)
image format.
**--kernel-image _<file>_**::
Specifies the kernel image, which to include in the UEFI executable. The
default is _/lib/modules/<KERNEL-VERSION>/vmlinuz_ or
_/boot/vmlinuz-<KERNEL-VERSION>_.
**--enhanced-cpio**::
Attempt to use the dracut-cpio binary, which optimizes archive creation for
copy-on-write filesystems by using the copy_file_range(2) syscall via Rust's
io::copy(). When specified, initramfs archives are also padded to ensure
optimal data alignment for extent sharing. To retain reflink data
deduplication benefits, this should be used alongside the **--no-compress**
and **--nostrip** parameters, with initramfs source files, **--tmpdir**
staging area and destination all on the same copy-on-write capable
filesystem.
ENVIRONMENT
-----------
_INITRD_COMPRESS_::
sets the default compression program. See **--compress**.
_DRACUT_LDCONFIG_::
sets the _ldconfig_ program path and options. Optional.
Used for **--sysroot**.
+
Default:
_ldconfig_
_DRACUT_LDD_::
sets the _ldd_ program path and options. Optional.
Used for **--sysroot**.
+
Default:
_ldd_
_DRACUT_TESTBIN_::
sets the initially tested binary for detecting library paths.
Optional. Used for **--sysroot**. In the cross-compiled sysroot,
the default value (_/bin/sh_) is unusable, as it is an absolute
symlink and points outside the sysroot directory.
+
Default:
_/bin/sh_
_DRACUT_INSTALL_::
overrides path and options for executing _dracut-install_ internally.
Optional. Can be used to debug _dracut-install_ while running the
main dracut script.
+
Default:
_dracut-install_
+
Example:
DRACUT_INSTALL="valgrind dracut-install"
_DRACUT_COMPRESS_BZIP2_::
_DRACUT_COMPRESS_BZIP2_::
_DRACUT_COMPRESS_LBZIP2_::
_DRACUT_COMPRESS_LZMA_::
_DRACUT_COMPRESS_XZ_::
_DRACUT_COMPRESS_GZIP_::
_DRACUT_COMPRESS_PIGZ_::
_DRACUT_COMPRESS_LZOP_::
_DRACUT_COMPRESS_ZSTD_::
_DRACUT_COMPRESS_LZ4_::
_DRACUT_COMPRESS_CAT_::
overrides for compression utilities to support using them from
non-standard paths.
+
Default values are the default compression utility names to be found in **PATH**.
_DRACUT_ARCH_::
overrides the value of **uname -m**. Used for **--sysroot**.
+
Default:
_empty_ (the value of **uname -m** on the host system)
_SYSTEMD_VERSION_::
overrides systemd version. Used for **--sysroot**.
_SYSTEMCTL_::
overrides the systemctl binary. Used for **--sysroot**.
_NM_VERSION_::
overrides the NetworkManager version. Used for **--sysroot**.
_DRACUT_INSTALL_PATH_::
overrides **PATH** environment for **dracut-install** to look for
binaries relative to **--sysroot**. In a cross-compiled environment
(e.g. Yocto), PATH points to natively built binaries that are not
in the host's /bin, /usr/bin, etc. **dracut-install** still needs plain
/bin and /usr/bin that are relative to the cross-compiled sysroot.
+
Default:
_PATH_
_DRACUT_INSTALL_LOG_TARGET_::
overrides **DRACUT_LOG_TARGET** for **dracut-install**. It allows
running **dracut-install* to run with different log target that
**dracut** runs with.
+
Default:
_DRACUT_LOG_TARGET_
_DRACUT_INSTALL_LOG_LEVEL_::
overrides **DRACUT_LOG_LEVEL** for **dracut-install**. It allows
running **dracut-install* to run with different log level that
**dracut** runs with.
+
Default:
_DRACUT_LOG_LEVEL_
FILES
-----
_/var/log/dracut.log_::
logfile of initramfs image creation
_/tmp/dracut.log_::
logfile of initramfs image creation, if _/var/log/dracut.log_ is not
writable
_/etc/dracut.conf_::
see dracut.conf5
_/etc/dracut.conf.d/*.conf_::
see dracut.conf5
_/usr/lib/dracut/dracut.conf.d/*.conf_::
see dracut.conf5
Configuration in the initramfs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_/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.
_/etc/cmdline_::
Can contain additional command line options. Deprecated, better use
/etc/cmdline.d/*.conf.
_/etc/cmdline.d/*.conf_::
Can contain additional command line options.
AVAILABILITY
------------
The dracut command is part of the dracut package and is available from
link:$$https://github.com/dracutdevs/dracut$$[https://github.com/dracutdevs/dracut]
AUTHORS
-------
Harald Hoyer
Victor Lowther
Amadeusz Żołnowski
Hannes Reinecke
Daniel Molkentin
Will Woods
Philippe Seewer
Warren Togami
SEE ALSO
--------
*dracut.cmdline*(7) *dracut.conf*(5) *lsinitrd*(1)

View File

@@ -1,182 +0,0 @@
dracut {mainversion}
====================
:author: Harald Hoyer
:email: harald@profian.com
:revnumber: {version}
:language: bash
= Introduction
This section is a modified version of
http://en.wikipedia.org/wiki/Initrd which is licensed under the
Creative Commons Attribution/Share-Alike License.
== Definition
An _initial ramdisk_ is a temporary file system used in the boot process of the
Linux kernel. _initrd_ and _initramfs_ refer to slightly different schemes for
loading this file system into memory. Both are commonly used to make
preparations before the real root file system can be mounted.
== Rationale
Many Linux distributions ship a single, generic kernel image that is intended to
boot as wide a variety of hardware as possible. The device drivers for this
generic kernel image are included as loadable modules, as it is not possible to
statically compile them all into the one kernel without making it too large to
boot from computers with limited memory or from lower-capacity media like floppy
disks.
This then raises the problem of detecting and loading the modules necessary to
mount the root file system at boot time (or, for that matter, deducing where or
what the root file system is).
To further complicate matters, the root file system may be on a software RAID
volume, LVM, NFS (on diskless workstations), or on an encrypted partition. All
of these require special preparations to mount.
Another complication is kernel support for hibernation, which suspends the
computer to disk by dumping an image of the entire system to a swap partition or
a regular file, then powering off. On next boot, this image has to be made
accessible before it can be loaded back into memory.
To avoid having to hardcode handling for so many special cases into the kernel,
an initial boot stage with a temporary root file system
—now dubbed early user space— is used. This root file system would contain
user-space helpers that would do the hardware detection, module loading and
device discovery necessary to get the real root file system mounted.
== Implementation
An image of this initial root file system (along with the kernel image) must be
stored somewhere accessible by the Linux bootloader or the boot firmware of the
computer. This can be:
* The root file system itself
* A boot image on an optical disc
* A small ext2/ext3/ext4 or FAT-formatted partition on a local disk
(a _boot partition_)
* A TFTP server (on systems that can boot from Ethernet)
The bootloader will load the kernel and initial root file system image into
memory and then start the kernel, passing in the memory address of the image.
Depending on which algorithms were compiled statically into it, the kernel can
currently unpack initrd/initramfs images compressed with gzip, bzip2 and LZMA.
== Mount preparations
dracut can generate a customized initramfs image which contains only whatever is
necessary to boot some particular computer, such as ATA, SCSI and filesystem
kernel modules (host-only mode).
dracut can also generate a more generic initramfs image (default mode).
dracut's initramfs starts only with the device name of the root file system (or
its UUID) and must discover everything else at boot time. A complex cascade of
tasks must be performed to get the root file system mounted:
* Any hardware drivers that the boot process depends on must be loaded. All
kernel modules for common storage devices are packed onto the initramfs and then
udev pulls in modules matching the computer's detected hardware.
* On systems which display a boot rd.splash screen, the video hardware must be
initialized and a user-space helper started to paint animations onto the display
in lockstep with the boot process.
* If the root file system is on NFS, dracut does then:
** Bring up the primary network interface.
** Invoke a DHCP client, with which it can obtain a DHCP lease.
** Extract the name of the NFS share and the address of the NFS server from the
lease.
** Mount the NFS share.
* If the root file system appears to be on a software RAID device, there is no
way of knowing which devices the RAID volume spans; the standard MD utilities
must be invoked to scan all available block devices with a raid signature and
bring the required ones online.
* If the root file system appears to be on a logical volume, the LVM utilities
must be invoked to scan for and activate the volume group containing it.
* If the root file system is on an encrypted block device:
** Invoke a helper script to prompt the user to type in a passphrase and/or
insert a hardware token (such as a smart card or a USB security dongle).
* Create a decryption target with the device mapper.
dracut uses udev, an event-driven hotplug agent, which invokes helper programs
as hardware devices, disk partitions and storage volumes matching certain rules
come online. This allows discovery to run in parallel, and to progressively
cascade into arbitrary nestings of LVM, RAID or encryption to get at the root
file system.
When the root file system finally becomes visible:
* Any maintenance tasks which cannot run on a mounted root file system
are done.
* The root file system is mounted read-only.
* Any processes which must continue running (such as the rd.splash screen helper
and its command FIFO) are hoisted into the newly-mounted root file system.
The final root file system cannot simply be mounted over /, since that would
make the scripts and tools on the initial root file system inaccessible for any
final cleanup tasks. On an initramfs, the initial root file system cannot be
rotated away. Instead, it is simply emptied and the final root file system
mounted over the top.
If the systemd module is used in the initramfs, the ordering of the services
started looks like <<dracutbootup7>>.
== Dracut on shutdown
On a systemd driven system, the dracut initramfs is also used for the shutdown
procedure.
The following steps are executed during a shutdown:
* systemd switches to the shutdown.target
* systemd starts
$prefix/lib/systemd/system/shutdown.target.wants/dracut-shutdown.service
* dracut-shutdown.service executes /usr/lib/dracut/dracut-initramfs-restore
which unpacks the initramfs to /run/initramfs
* systemd finishes shutdown.target
* systemd kills all processes
* systemd tries to unmount everything and mounts the remaining read-only
* systemd checks, if there is a /run/initramfs/shutdown executable
* if yes, it does a pivot_root to /run/initramfs and executes ./shutdown.
The old root is then mounted on /oldroot.
/usr/lib/dracut/modules.d/99shutdown/shutdown.sh is the shutdown executable.
* shutdown will try to unmount every /oldroot mount and calls the various
shutdown hooks from the dracut modules
This ensures, that all devices are disassembled and unmounted cleanly.
= User Manual
:leveloffset: 1
include::dracut.8.asc[]
:leveloffset: 1
[[dracutconf5]]
include::dracut.conf.5.asc[]
[[dracutcmdline7]]
include::dracut.cmdline.7.asc[]
[[lsinitrd1]]
include::lsinitrd.1.asc[]
= Developer Manual
:leveloffset: 1
[[dracutmodules7]]
include::dracut.modules.7.asc[]
[[dracutbootup7]]
include::dracut.bootup.7.asc[]
:leveloffset: 0
[appendix]
License
-------
This work is licensed under the Creative Commons Attribution/Share-Alike
License. To view a copy of this license, visit
http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative
Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

View File

@@ -1,124 +0,0 @@
DRACUT.BOOTUP(7)
================
:doctype: manpage
:man source: dracut
:man manual: dracut
:man version: {version}
NAME
----
dracut.bootup - boot ordering in the initramfs
DESCRIPTION
-----------
This flow chart illustrates the ordering of the services, if systemd is used in
the dracut initramfs.
----
systemd-journal.socket
|
v
dracut-cmdline.service
|
v
dracut-pre-udev.service
|
v
systemd-udevd.service
|
v
local-fs-pre.target dracut-pre-trigger.service
| |
v v
(various mounts) (various swap systemd-udev-trigger.service
| devices...) | (various low-level (various low-level
| | | services: seed, API VFS mounts:
v v v tmpfiles, random mqueue, configfs,
local-fs.target swap.target dracut-initqueue.service sysctl, ...) debugfs, ...)
| | | | |
\_______________|____________________ | ___________________|____________________/
\|/
v
sysinit.target
|
_________________/|\___________________
/ | \
| | |
v | v
(various | rescue.service
sockets...) | |
| | v
v | rescue.target
sockets.target |
| |
\_________________ | emergency.service
\| |
v v
basic.target emergency.target
|
______________________/|
/ |
| v
| dracut-pre-mount.service
| |
| v
| sysroot.mount
| |
| v
| initrd-root-fs.target
(custom initrd services) |
| v
| dracut-mount.service
| |
| v
| initrd-parse-etc.service
| |
| v
| (sysroot-usr.mount and
| various mounts marked
| with fstab option
| x-initrd.mount)
| |
| v
| initrd-fs.target
\______________________ |
\|
v
initrd.target
|
v
dracut-pre-pivot.service
|
v
initrd-cleanup.service
isolates to
initrd-switch-root.target
|
v
______________________/|
/ |
| initrd-udevadm-cleanup-db.service
| |
(custom initrd services) |
| |
\______________________ |
\|
v
initrd-switch-root.target
|
v
initrd-switch-root.service
|
v
switch-root
----
AUTHOR
------
Harald Hoyer
SEE ALSO
--------
*dracut*(8) *bootup*(7)

File diff suppressed because it is too large Load Diff

View File

@@ -1,336 +0,0 @@
DRACUT.CONF(5)
==============
:doctype: manpage
:man source: dracut
:man manual: dracut
:man version: {version}
NAME
----
dracut.conf - configuration file(s) for dracut
SYNOPSIS
--------
_/etc/dracut.conf_
_/etc/dracut.conf.d/\*.conf_
_/usr/lib/dracut/dracut.conf.d/*.conf_
Description
-----------
_dracut.conf_ is loaded during the initialisation phase of dracut. Command line
parameter will override any values set here.
_*.conf_ files are read from /usr/lib/dracut/dracut.conf.d and
/etc/dracut.conf.d. Files with the same name in /etc/dracut.conf.d will replace
files in /usr/lib/dracut/dracut.conf.d.
The files are then read in alphanumerical order and will override parameters
set in _/etc/dracut.conf_. Each line specifies an attribute and a value. A '#'
indicates the beginning of a comment; following characters, up to the end of the
line are not interpreted.
dracut command line options will override any values set here.
Configuration files must have the extension .conf; other extensions are ignored.
*add_dracutmodules+=*" __<dracut modules>__ "::
Add a space-separated list of dracut modules to call when building the
initramfs. Modules are located in _/usr/lib/dracut/modules.d_.
*force_add_dracutmodules+=*" __<dracut modules>__ "::
Force to add a space-separated list of dracut modules to the default set of
modules, when host-only mode is specified. This parameter can be specified
multiple times.
*omit_dracutmodules+=*" __<dracut modules>__ "::
Omit a space-separated list of dracut modules to call when building the
initramfs. Modules are located in _/usr/lib/dracut/modules.d_.
*dracutmodules+=*" __<dracut modules>__ "::
Specify a space-separated list of dracut modules to call when building the
initramfs. Modules are located in _/usr/lib/dracut/modules.d_.
This option forces dracut to only include the specified dracut modules.
In most cases the "add_dracutmodules" option is what you want to use.
*add_drivers+=*" __<kernel modules>__ "::
Specify a space-separated list of kernel modules to add to the initramfs.
The kernel modules have to be specified without the ".ko" suffix.
*force_drivers+=*" __<list of kernel modules>__ "::
See add_drivers above. But in this case it is ensured that the drivers
are tried to be loaded early via modprobe.
*omit_drivers+=*" __<kernel modules>__ "::
Specify a space-separated list of kernel modules not to add to the
initramfs. The kernel modules have to be specified without the ".ko" suffix.
*drivers+=*" __<kernel modules>__ "::
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.
*filesystems+=*" __<filesystem names>__ "::
Specify a space-separated list of kernel filesystem modules to exclusively
include in the generic initramfs.
*drivers_dir=*"__<kernel modules directory>__"::
Specify the directory where to look for kernel modules.
*fw_dir+=*" :__<dir>__[:__<dir>__ ...] "::
Specify additional colon-separated list of directories where to look for
firmware files.
*libdirs+=*" __<dir>__[ __<dir>__ ...] "::
Specify a space-separated list of directories where to look for libraries.
*install_items+=*" __<file>__[ __<file>__ ...] "::
Specify additional files to include in the initramfs, separated by spaces.
*install_optional_items+=*" __<file>__[ __<file>__ ...] "::
Specify additional files to include in the initramfs, separated by spaces,
if they exist.
*compress=*"__{cat|bzip2|lzma|xz|gzip|lzop|lz4|zstd|<compressor [args ...]>}__"::
Compress the generated initramfs using the passed compression program. If
you pass it just the name of a compression program, it will call that
program with known-working arguments. If you pass arguments, it will be
called with exactly those arguments. Depending on what you pass, this may
result in an initramfs that the kernel cannot decompress.
To disable compression, use "cat".
*squash_compress=*"__{<compressor [args ...]>}__"::
Compress the squashfs image using the passed compressor and compressor
specific options for mksquashfs. You can refer to mksquashfs manual for
supported compressors and compressor specific options. If squash module is
not called when building the initramfs, this option will not take effect.
*do_strip=*"__{yes|no}__"::
Strip binaries in the initramfs (default=yes).
*aggressive_strip=*"__{yes|no}__"::
Strip more than just debug symbol and sections, for a smaller initramfs
build. The "do_strip=yes" option must also be specified (default=no).
*do_hardlink=*"__{yes|no}__"::
Hardlink files in the initramfs (default=yes).
*prefix=*" __<directory>__ "::
Prefix initramfs files with __<directory>__.
*hostonly=*"__{yes|no}__"::
Host-only mode: Install only what is needed for booting the local host
instead of a generic host and generate host-specific configuration
(default=no).
*hostonly_mode=*"__{sloppy|strict}__"::
Specify the host-only mode to use (default=sloppy).
In "sloppy" host-only mode, extra drivers and modules will be installed, so
minor hardware change won't make the image unbootable (e.g. changed
keyboard), and the image is still portable among similar hosts.
With "strict" mode enabled, anything not necessary for booting the local
host in its current state will not be included, and modules may do some
extra job to save more space. Minor change of hardware or environment could
make the image unbootable.
*hostonly_cmdline=*"__{yes|no}__"::
If set to "yes", store the kernel command line arguments needed in the
initramfs. If **hostonly="yes"** and this option is not configured, it's
automatically set to "yes".
*hostonly_nics+=*" [__<nic>__[ __<nic>__ ...]] "::
Only enable listed NICs in the initramfs. The list can be empty, so other
modules can install only the necessary network drivers.
*persistent_policy=*"__<policy>__"::
Use _<policy>_ to address disks and partitions.
_<policy>_ can be any directory name found in /dev/disk (e.g. "by-uuid",
"by-label"), or "mapper" to use /dev/mapper device names (default=mapper).
*tmpdir=*"__<temporary directory>__"::
Specify temporary directory to use.
[WARNING]
====
If chrooted to another root other than the real root device, use --fstab and
provide a valid _/etc/fstab_.
====
*use_fstab=*"__{yes|no}__"::
Use _/etc/fstab_ instead of _/proc/self/mountinfo_ (default=no).
*add_fstab+=*" __<filename>__ "::
Add entries of __<filename>__ to the initramfs /etc/fstab.
*add_device+=*" __<device>__ "::
Bring up _<device>_ in initramfs, _<device>_ should be the device name.
This can be useful in host-only mode for resume support when your swap is on
LVM an encrypted partition.
*mdadmconf=*"__{yes|no}__"::
Include local _/etc/mdadm.conf_ (default=no).
*lvmconf=*"__{yes|no}__"::
Include local _/etc/lvm/lvm.conf_ (default=no).
*fscks=*" __<fsck tools>__ "::
Add a space-separated list of fsck tools. If nothing is specified, the
default is: "umount mount /sbin/fsck* xfs_db xfs_check xfs_repair e2fsck
jfs_fsck reiserfsck btrfsck". The installation is opportunistic
(non-existing tools are ignored).
*nofscks=*"__{yes|no}__"::
If specified, inhibit installation of any fsck tools (default=no).
*ro_mnt=*"__{yes|no}__"::
Mount _/_ and _/usr_ read-only by default (default=no).
*kernel_cmdline=*"__parameters__"::
Specify default kernel command line parameters.
*kernel_only=*"__{yes|no}__"::
Only install kernel drivers and firmware files (default=no).
*no_kernel=*"__{yes|no}__"::
Do not install kernel drivers and firmware files (default=no).
*acpi_override=*"__{yes|no}__"::
[WARNING] ONLY USE THIS IF YOU KNOW WHAT YOU ARE DOING! +
Override BIOS provided ACPI tables. For further documentation read
Documentation/acpi/initrd_table_override.txt in the kernel sources.
Search for ACPI table files (must have .aml suffix) in acpi_table_dir=
directory (see below) and add them to a separate uncompressed cpio
archive. This cpio archive gets glued (concatenated, uncompressed one
must be the first one) to the compressed cpio archive. The first,
uncompressed cpio archive is for data which the kernel must be able
to access very early (and cannot make use of uncompress algorithms yet)
like microcode or ACPI tables (default=no).
*acpi_table_dir=*"__<dir>__"::
Directory to search for ACPI tables if acpi_override= is set to yes.
*early_microcode=*"{yes|no}"::
Combine early microcode with ramdisk (default=yes).
*stdloglvl*="__\{0-6\}__"::
Specify logging level for standard error (default=4).
[NOTE]
===============================
Logging levels:
----
0 - suppress any messages
1 - only fatal errors
2 - all errors
3 - warnings
4 - info
5 - debug info (here starts lots of output)
6 - trace info (and even more)
----
===============================
*sysloglvl*="__\{0-6\}__"::
Specify logging level for syslog (default=0).
*fileloglvl=*"__\{0-6\}__"::
Specify logging level for logfile (default=4).
*logfile=*"__<file>__"::
Path to logfile.
*sshkey=*"__<file>__"::
SSH key file used with ssh-client module.
*show_modules=*"__{yes|no}__"::
Print the name of the included modules to standard output during build
(default=no).
*i18n_vars=*"__<variable mapping>__"::
Distribution specific variable mapping.
See dracut/modules.d/10i18n/README for a detailed description.
*i18n_default_font=*"__<fontname>__"::
The font <fontname> to install, if not specified otherwise.
Default is "eurlatgr".
*i18n_install_all=*"__{yes|no}__"::
Install everything regardless of generic or host-only mode (default=no).
*reproducible=*"__{yes|no}__"::
Create reproducible images (default=no).
*noimageifnotneeded=*"__{yes|no}__"::
Do not create an image in host-only mode, if no kernel driver is needed
and no /etc/cmdline/*.conf will be generated into the initramfs
(default=no).
*loginstall=*"__<directory>__"::
Log all files installed from the host to _<directory>_.
*uefi=*"__{yes|no}__"::
Instead of creating an initramfs image, dracut will create an UEFI
executable, which can be executed by an UEFI BIOS (default=no).
The default output filename is
_<EFI>/EFI/Linux/linux-$kernel$-<MACHINE_ID>-<BUILD_ID>.efi_.
<EFI> might be _/efi_, _/boot_ or _/boot/efi_ depending on where the ESP
partition is mounted. The <BUILD_ID> is taken from BUILD_ID in
_/usr/lib/os-release_ or if it exists _/etc/os-release_ and is left out,
if BUILD_ID is non-existant or empty.
*machine_id=*"__{yes|no}__"::
Affects the default output filename of the UEFI executable, including the
<MACHINE_ID> part (default=yes).
*uefi_stub=*"_<file>_"::
Specifies the UEFI stub loader, which will load the attached kernel,
initramfs and kernel command line and boots the kernel. The default is
_/lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_.
*uefi_splash_image=*"_<file>_"::
Specifies the UEFI stub loader's splash image. Requires bitmap (**.bmp**)
image format.
*uefi_secureboot_cert=*"_<file>_", *uefi_secureboot_key=*"_<file>_"::
Specifies a certificate and corresponding key, which are used to sign the
created UEFI executable.
Requires both certificate and key need to be specified and _sbsign_ to be
installed.
*uefi_secureboot_engine=*"_parameter_"::
Specifies an engine to use when signing the created UEFI executable. E.g. "pkcs11"
*kernel_image=*"_<file>_"::
Specifies the kernel image, which to include in the UEFI executable. The
default is _/lib/modules/<KERNEL-VERSION>/vmlinuz_ or
_/boot/vmlinuz-<KERNEL-VERSION>_.
*enhanced_cpio=*"__{yes|no}__"::
Attempt to use the dracut-cpio binary, which optimizes archive creation for
copy-on-write filesystems (default=no).
When specified, initramfs archives are also padded to ensure optimal data
alignment for extent sharing. To retain reflink data deduplication benefits,
this should be used alongside the **compress="cat"** and **do_strip="no"**
parameters, with initramfs source files, **tmpdir** staging area and
destination all on the same copy-on-write capable filesystem.
*parallel=*"__{yes|no}__"::
If set to _yes_, try to execute tasks in parallel (currently only supported
for _--regenerate-all_).
Files
-----
_/etc/dracut.conf_::
Old configuration file. You better use your own file in
_/etc/dracut.conf.d/_.
_/etc/dracut.conf.d/_::
Any _/etc/dracut.conf.d/*.conf_ file can override the values in
_/etc/dracut.conf_. The configuration files are read in alphanumerical
order.
AUTHOR
------
Harald Hoyer
See Also
--------
*dracut*(8) *dracut.cmdline*(7)

View File

@@ -1,307 +0,0 @@
DRACUT.MODULES(7)
=================
:doctype: manpage
:man source: dracut
:man manual: dracut
:man version: {version}
NAME
----
dracut.modules - dracut modules
DESCRIPTION
-----------
dracut uses a modular system to build and extend the initramfs image. All
modules are located in _/usr/lib/dracut/modules.d_ or in _<git-src>/modules.d_.
The most basic dracut module is _99base_. In _99base_ the initial shell script
init is defined, which gets run by the kernel after initramfs loading. Although
you can replace init with your own version of _99base_, this is not encouraged.
Instead you should use, if possible, the hooks of dracut. All hooks, and the
point of time in which they are executed, are described in <<stages>>.
The main script, which creates the initramfs is dracut itself. It parses all
arguments and sets up the directory, in which everything is installed. It then
executes all check, install, installkernel scripts found in the modules, which
are to be processed. After everything is installed, the install directory is
archived and compressed to the final initramfs image. All helper functions used
by check, install and installkernel are found in in the file _dracut-functions_.
These shell functions are available to all module installer (install,
installkernel) scripts, without the need to source _dracut-functions_.
A module can check the preconditions for install and installkernel with the
check script. Also dependencies can be expressed with check. If a module passed
check, install and installkernel will be called to install all of the necessary
files for the module. To split between kernel and non-kernel parts of the
installation, all kernel module related parts have to be in installkernel. All
other files found in a module directory are module specific and mostly are hook
scripts and udev rules.
[[stages]]
== Boot Process Stages
dracut modules can insert custom script at various points, to control the boot
process.
These hooks are plain directories containing shell scripts ending with ".sh",
which are sourced by init.
Common used functions are in _dracut-lib.sh_, which can be sourced by any script.
=== Hook: cmdline
The _cmdline_ hook is a place to insert scripts to parse the kernel command line
and prepare the later actions, like setting up udev rules and configuration
files.
In this hook the most important environment variable is defined: root. The
second one is rootok, which indicates, that a module claimed to be able to parse
the root defined. So for example, **root=**__iscsi:....__ will be claimed by the
iscsi dracut module, which then sets rootok.
=== Hook: pre-udev
This hook is executed right after the cmdline hook and a check if root and
rootok were set. Here modules can take action with the final root, and before
udev has been run.
=== Start Udev
Now udev is started and the logging for udev is setup.
=== Hook: pre-trigger
In this hook, you can set udev environment variables with **udevadm control
--property=KEY=_value_** or control the further execution of udev with
udevadm.
=== Trigger Udev
udev is triggered by calling udevadm trigger, which sends add events for all
devices and subsystems.
=== Main Loop
In the main loop of dracut loops until udev has settled and
all scripts in _initqueue/finished_ returned true.
In this loop there are three hooks, where scripts can be inserted
by calling /sbin/initqueue.
==== Initqueue
This hook gets executed every time a script is inserted here, regardless of the
udev state.
==== Initqueue settled
This hook (initqueue/settled) gets executed every time udev has settled.
==== Initqueue timeout
This hook (initqueue/timeout) gets executed, when the main loop counter becomes
half of the rd.retry counter.
==== Initqueue online
This hook (initqueue/online) gets executed whenever a network interface comes online
(that is, once it is up and configured by the configured network module).
==== Initqueue finished
This hook (initqueue/finished) is called after udev has settled and
if all scripts herein return 0 the main loop will be ended.
Arbitrary scripts can be added here, to loop in the
initqueue until something happens, which a dracut module wants to wait for.
=== Hook: pre-mount
Before the root device is mounted all scripts in the hook pre-mount are
executed. In some cases (e.g. NFS) the real root device is already mounted,
though.
=== Hook: mount
This hook is mainly to mount the real root device.
=== Hook: pre-pivot
This hook is called before cleanup hook, This is a good place for
actions other than cleanups which need to be called before pivot.
=== Hook: cleanup
This hook is the last hook and is called before init finally switches root to
the real root device. This is a good place to clean up and kill processes not
needed anymore.
=== Cleanup and switch_root
Init (or systemd) kills all udev processes, cleans up the environment,
sets up the arguments for the real init process and finally calls switch_root.
switch_root removes the whole filesystem hierarchy of the initramfs,
chroot()s to the real root device and calls /sbin/init with the specified
arguments.
To ensure all files in the initramfs hierarchy can be removed, all processes
still running from the initramfs should not have any open file descriptors left.
== Network Infrastructure
FIXME
== Writing a Module
A simple example module is _90kernel-modules_, which modprobes a kernel module
after udev has settled and the basic device drivers have been loaded.
All module installation information is in the file module-setup.sh.
First we create a check() function, which just exits with 0 indicating that this
module should be included by default.
check():
----
return 0
----
Then we create the install() function, which installs a cmdline hook with
priority number 20 called _parse-insmodpost.sh_. It also installs the
_insmodpost.sh_ script in _/sbin_.
install():
----
inst_hook cmdline 20 "$moddir/parse-insmodpost.sh"
inst_simple "$moddir/insmodpost.sh" /sbin/insmodpost.sh
----
The _parse-instmodpost.sh_ parses the kernel command line for a argument
rd.driver.post, blacklists the module from being autoloaded and installs the
hook _insmodpost.sh_ in the _initqueue/settled_.
_parse-insmodpost.sh_:
----
for p in $(getargs rd.driver.post=); do
echo "blacklist $p" >> /etc/modprobe.d/initramfsblacklist.conf
_do_insmodpost=1
done
[ -n "$_do_insmodpost" ] && /sbin/initqueue --settled --unique --onetime /sbin/insmodpost.sh
unset _do_insmodpost
----
_insmodpost.sh_, which is called in the _initqueue/settled_ hook will just
modprobe the kernel modules specified in all rd.driver.post kernel command line
parameters. It runs after udev has settled and is only called once (--onetime).
_insmodpost.sh_:
----
. /lib/dracut-lib.sh
for p in $(getargs rd.driver.post=); do
modprobe $p
done
----
=== module-setup.sh: check()
_check()_ is called by dracut to evaluate the inclusion of a dracut module in
the initramfs.
$hostonly:: If the $hostonly variable is set, then the module check() function
should be in "hostonly" mode, which means, that the check() should only return
0, if the module is really needed to boot this specific host.
check() should return with:
0:: Include the dracut module in the initramfs.
1:: Do not include the dracut module. The requirements are not fulfilled
(missing tools, etc.)
255:: Only include the dracut module, if another module requires it or if
explicitly specified in the config file or on the argument list.
=== module-setup.sh: depends()
The function depends() should echo all other dracut module names the module
depends on.
=== module-setup.sh: cmdline()
This function should print the kernel command line options needed to boot the
current machine setup. It should start with a space and should not print a
newline.
=== module-setup.sh: install()
The install() function is called to install everything non-kernel related.
To install binaries, scripts, and other files, you can use the functions
mentioned in <<creation>>.
To address a file in the current module directory, use the variable "$moddir".
=== module-setup.sh: installkernel()
In installkernel() all kernel related files should be installed. You can use all
of the functions mentioned in <<creation>> to install files.
=== [[creation]]Creation Functions
==== inst_multiple [-o] <file> [ <file> ...]
installs multiple binaries and files. If executables are specified without a
path, dracut will search the path PATH=/usr/sbin:/sbin:/usr/bin:/bin for the
binary. If the option "-o" is given as the first parameter, a missing file does
not lead to an error.
==== inst <src> [<dst>]
installs _one_ file <src> either to the same place in the initramfs or to an
optional <dst>. inst with more than two arguments is treated the same as
inst_multiple, all arguments are treated as files to install and none as
install destinations.
==== inst_hook <hookdir> <prio> <src>
installs an executable/script <src> in the dracut hook <hookdir> with priority
<prio>.
==== inst_rules <udevrule> [ <udevrule> ...]
installs one or more udev rules. Non-existant udev rules are reported, but do
not let dracut fail.
==== instmods <kernelmodule> [ <kernelmodule> ... ]
instmods should be used only in the installkernel() function.
instmods installs one or more kernel modules in the initramfs. <kernelmodule>
can also be a whole subsystem, if prefixed with a "=", like "=drivers/net/team".
instmods will not install the kernel module, if $hostonly is set and the kernel
module is not currently needed by any /sys/*...*/uevent MODALIAS.
To install a kernel module regardless of the hostonly mode use the form:
----
hostonly='' instmods <kernelmodule>
----
=== Initramfs Functions
FIXME
=== Network Modules
FIXME
AUTHOR
------
Harald Hoyer
SEE ALSO
--------
*dracut*(8)

View File

@@ -1,519 +0,0 @@
To create a initramfs image, the most simple command is:
----
# dracut
----
This will generate a general purpose initramfs image, with all possible
functionality resulting of the combination of the installed dracut modules and
system tools. The image, depending on bootloader specification, can be
_/efi/_++<machine-id>++_/_++<kernel-version>++_/initrd_,
_/boot/_++<machine-id>++_/_++<kernel-version>++_/initrd_,
_/boot/efi/_++<machine-id>++_/_++<kernel-version>++_/initrd_,
_/lib/modules/_++<kernel-version>++_/initrd_ or
_/boot/initramfs-_++<kernel-version>++_.img_ and contains the kernel modules of
the currently active kernel with version _++<kernel-version>++_.
If the initramfs image already exists, dracut will display an error message, and
to overwrite the existing image, you have to use the --force option.
----
# dracut --force
----
If you want to specify another filename for the resulting image you would issue
a command like:
----
# dracut foobar.img
----
To generate an image for a specific kernel version, the command would be:
----
# dracut foobar.img 2.6.40-1.rc5.f20
----
A shortcut to generate the image at the default location for a specific kernel
version is:
----
# dracut --kver 2.6.40-1.rc5.f20
----
If you want to create lighter, smaller initramfs images, you may want to specify
the --hostonly or -H option. Using this option, the resulting image will
contain only those dracut modules, kernel modules and filesystems, which are
needed to boot this specific machine. This has the drawback, that you can't put
the disk on another controller or machine, and that you can't switch to another
root filesystem, without recreating the initramfs image. The usage of the
--hostonly option is only for experts and you will have to keep the broken
pieces. At least keep a copy of a general purpose image (and corresponding
kernel) as a fallback to rescue your system.
=== Inspecting the Contents
To see the contents of the image created by dracut, you can use the lsinitrd
tool.
----
# lsinitrd | less
----
To display the contents of a file in the initramfs also use the lsinitrd tool:
----
# lsinitrd -f /etc/ld.so.conf
include ld.so.conf.d/*.conf
----
=== Adding dracut Modules
Some dracut modules are turned off by default and have to be activated manually.
You can do this by adding the dracut modules to the configuration file
_/etc/dracut.conf_ or _/etc/dracut.conf.d/myconf.conf_. See *dracut.conf*(5).
You can also add dracut modules on the command line
by using the -a or --add option:
----
# dracut --add module initramfs-module.img
----
To see a list of available dracut modules, use the --list-modules option:
----
# dracut --list-modules
----
=== Omitting dracut Modules
Sometimes you don't want a dracut module to be included for reasons of speed,
size or functionality. To do this, either specify the omit_dracutmodules
variable in the _dracut.conf_ or _/etc/dracut.conf.d/myconf.conf_ configuration
file (see *dracut.conf*(5)), or use the -o or --omit option
on the command line:
----
# dracut -o "multipath lvm" no-multipath-lvm.img
----
=== Adding Kernel Modules
If you need a special kernel module in the initramfs, which is not
automatically picked up by dracut, you have the use the --add-drivers option
on the command line or the drivers variable in the _/etc/dracut.conf_
or _/etc/dracut.conf.d/myconf.conf_ configuration file (see *dracut.conf*(5)):
----
# dracut --add-drivers mymod initramfs-with-mymod.img
----
=== Boot parameters
An initramfs generated without the "hostonly" mode, does not contain any system
configuration files (except for some special exceptions), so the configuration
has to be done on the kernel command line. With this flexibility, you can easily
boot from a changed root partition, without the need to recompile the initramfs
image. So, you could completely change your root partition (move it inside a md
raid with encryption and LVM on top), as long as you specify the correct
filesystem LABEL or UUID on the kernel command line for your root device, dracut
will find it and boot from it.
The kernel command line can also be provided by the dhcp server with the
root-path option. See <<NetworkBoot>>.
For a full reference of all kernel command line parameters,
see *dracut.cmdline*(7).
To get a quick start for the suitable kernel command line on your system,
use the __--print-cmdline__ option:
----
# dracut --print-cmdline
root=UUID=8b8b6f91-95c7-4da2-831b-171e12179081 rootflags=rw,relatime,discard,data=ordered rootfstype=ext4
----
==== Specifying the root Device
This is the only option dracut really needs to boot from your root partition.
Because your root partition can live in various environments, there are a lot of
formats for the root= option. The most basic one is root=_++<path to device
node>++_:
----
root=/dev/sda2
----
Because device node names can change, dependent on the drive ordering, you are
encouraged to use the filesystem identifier (UUID) or filesystem label (LABEL)
to specify your root partition:
----
root=UUID=19e9dda3-5a38-484d-a9b0-fa6b067d0331
----
or
----
root=LABEL=myrootpartitionlabel
----
To see all UUIDs or LABELs on your system, do:
----
# ls -l /dev/disk/by-uuid
----
or
----
# ls -l /dev/disk/by-label
----
If your root partition is on the network see <<NetworkBoot>>.
==== Keyboard Settings
If you have to input passwords for encrypted disk volumes, you might want to set
the keyboard layout and specify a display font.
A typical german kernel command line would contain:
----
rd.vconsole.font=eurlatgr rd.vconsole.keymap=de-latin1-nodeadkeys rd.locale.LANG=de_DE.UTF-8
----
Setting these options can override the setting stored on your system, if you use
a modern init system, like systemd.
==== Blacklisting Kernel Modules
Sometimes it is required to prevent the automatic kernel module loading of a
specific kernel module. To do this, just add rd.driver.blacklist=_++<kernel
module name>++_, with _++<kernel module name>++_ not containing the _.ko_
suffix, to the kernel command line. For example:
----
rd.driver.blacklist=mptsas rd.driver.blacklist=nouveau
----
The option can be specified multiple times on the kernel command line.
==== Speeding up the Boot Process
If you want to speed up the boot process, you can specify as much information
for dracut on the kernel command as possible. For example, you can tell dracut,
that you root partition is not on a LVM volume or not on a raid partition, or
that it lives inside a specific crypto LUKS encrypted volume. By default, dracut
searches everywhere. A typical dracut kernel command line for a plain primary or
logical partition would contain:
----
rd.luks=0 rd.lvm=0 rd.md=0 rd.dm=0
----
This turns off every automatic assembly of LVM, MD raids, DM raids and
crypto LUKS.
Of course, you could also omit the dracut modules in the initramfs creation
process, but then you would lose the possibility to turn it on on demand.
[[Injecting]]
=== Injecting custom Files
To add your own files to the initramfs image, you have several possibilities.
The --include option let you specify a source path and a target path.
For example
----
# dracut --include cmdline-preset /etc/cmdline.d/mycmdline.conf initramfs-cmdline-pre.img
----
will create an initramfs image, where the file cmdline-preset will be copied
inside the initramfs to _/etc/cmdline.d/mycmdline.conf_. --include can only
be specified once.
----
# mkdir -p rd.live.overlay/etc/cmdline.d
# mkdir -p rd.live.overlay/etc/conf.d
# echo "ip=dhcp" >> rd.live.overlay/etc/cmdline.d/mycmdline.conf
# echo export FOO=testtest >> rd.live.overlay/etc/conf.d/testvar.conf
# echo export BAR=testtest >> rd.live.overlay/etc/conf.d/testvar.conf
# tree rd.live.overlay/
rd.live.overlay/
`-- etc
|-- cmdline.d
| `-- mycmdline.conf
`-- conf.d
`-- testvar.conf
# dracut --include rd.live.overlay / initramfs-rd.live.overlay.img
----
This will put the contents of the rd.live.overlay directory into the root of the
initramfs image.
The --install option let you specify several files, which will get installed in
the initramfs image at the same location, as they are present on initramfs
creation time.
----
# dracut --install 'strace fsck.ext4 ssh' initramfs-dbg.img
----
This will create an initramfs with the strace, fsck.ext4 and ssh executables,
together with the libraries needed to start those. The --install option can be
specified multiple times.
[[NetworkBoot]]
=== Network Boot
If your root partition is on a network drive, you have to have the network
dracut modules installed to create a network aware initramfs image.
If you specify ip=dhcp on the kernel command line, then dracut asks a dhcp
server about the ip address for the machine. The dhcp server can also serve an
additional root-path, which will set the root device for dracut. With this
mechanism, you have static configuration on your client machine and a
centralized boot configuration on your TFTP/DHCP server. If you can't pass a
kernel command line, then you can inject _/etc/cmdline.d/mycmdline.conf_, with a
method described in <<Injecting>>.
==== Reducing the Image Size
To reduce the size of the initramfs, you should create it with by omitting all
dracut modules, which you know, you don't need to boot the machine.
You can also specify the exact dracut and kernel modules to produce a very tiny
initramfs image.
For example for a NFS image, you would do:
----
# dracut -m "nfs network base" initramfs-nfs-only.img
----
Then you would boot from this image with your target machine and reduce the size
once more by creating it on the target machine with the --host-only option:
----
# dracut -m "nfs network base" --host-only initramfs-nfs-host-only.img
----
This will reduce the size of the initramfs image significantly.
== Troubleshooting
If the boot process does not succeed, you have several options to debug the
situation.
[[identifying-your-problem-area]]
=== Identifying your problem area
. Remove ''rhgb'' and ''quiet'' from the kernel command line
. Add ''rd.shell'' to the kernel command line. This will present a shell should
dracut be unable to locate your root device
. Add ''rd.shell rd.debug log_buf_len=1M'' to the kernel command line so that
dracut shell commands are printed as they are executed
. The file /run/initramfs/rdsosreport.txt is generated,
which contains all the logs and the output of all significant tools, which are
mentioned later.
If you want to save that output, simply mount /boot by hand or insert an USB
stick and mount that. Then you can store the output for later inspection.
[[information-to-include-in-your-report]]
=== Information to include in your report
[[all-bug-reports]]
==== All bug reports
In all cases, the following should be mentioned and attached to your bug report:
* The exact kernel command-line used. Typically from the bootloader
configuration file (e.g. _/boot/grub2/grub.cfg_) or from _/proc/cmdline_.
* A copy of your disk partition information from _/etc/fstab_, which might be
obtained booting an old working initramfs or a rescue medium.
* Turn on dracut debugging (see _the 'debugging dracut' section_), and attach
the file /run/initramfs/rdsosreport.txt.
* If you use a dracut configuration file, please include _/etc/dracut.conf_ and
all files in _/etc/dracut.conf.d/*.conf_
[[network-root-device-related-problems]]
==== Network root device related problems
This section details information to include when experiencing problems on a
system whose root device is located on a network attached volume (e.g. iSCSI,
NFS or NBD). As well as the information from <<all-bug-reports>>, include the
following information:
* Please include the output of
+
----
# /sbin/ifup <interfacename>
# ip addr show
----
[[debugging-dracut]]
=== Debugging dracut
[[configure-a-serial-console]]
==== Configure a serial console
Successfully debugging dracut will require some form of console
logging during the system boot. This section documents configuring a
serial console connection to record boot messages.
. First, enable serial console output for both the kernel and the bootloader.
. Open the file _/boot/grub2/grub.cfg_ for editing. Below the line ''timeout=5'', add
the following:
+
----
serial --unit=0 --speed=9600
terminal --timeout=5 serial console
----
+
. Also in _/boot/grub2/grub.cfg_, add the following boot arguments to the ''kernel''
line:
+
----
console=tty0 console=ttyS0,9600
----
+
. When finished, the _/boot/grub2/grub.cfg_ file should look similar to the example
below.
+
----
default=0
timeout=5
serial --unit=0 --speed=9600
terminal --timeout=5 serial console
title Fedora (2.6.29.5-191.fc11.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.29.5-191.fc11.x86_64 ro root=/dev/mapper/vg_uc1-lv_root console=tty0 console=ttyS0,9600
initrd /dracut-2.6.29.5-191.fc11.x86_64.img
----
+
. More detailed information on how to configure the kernel for console output
can be found at
http://www.faqs.org/docs/Linux-HOWTO/Remote-Serial-Console-HOWTO.html#CONFIGURE-KERNEL.
. Redirecting non-interactive output
+
--
NOTE: You can redirect all non-interactive output to _/dev/kmsg_ and the kernel
will put it out on the console when it reaches the kernel buffer by doing
----
# exec >/dev/kmsg 2>&1 </dev/console
----
--
[[using-the-dracut-shell]]
==== Using the dracut shell
dracut offers a shell for interactive debugging in the event dracut fails to
locate your root filesystem. To enable the shell:
. Add the boot parameter ''rd.shell'' to your bootloader configuration file
(e.g. _/boot/grub2/grub.cfg_)
. Remove the boot arguments ''rhgb'' and ''quiet''
+
A sample _/boot/grub2/grub.cfg_ bootloader configuration file is listed below.
+
----
default=0
timeout=5
serial --unit=0 --speed=9600
terminal --timeout=5 serial console
title Fedora (2.6.29.5-191.fc11.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.29.5-191.fc11.x86_64 ro root=/dev/mapper/vg_uc1-lv_root console=tty0 rd.shell
initrd /dracut-2.6.29.5-191.fc11.x86_64.img
----
+
. If system boot fails, you will be dropped into a shell as seen in the example
below.
+
----
No root device found
Dropping to debug shell.
#
----
+
. Use this shell prompt to gather the information requested above
(see <<all-bug-reports>>).
[[accessing-the-root-volume-from-the-dracut-shell]]
==== Accessing the root volume from the dracut shell
From the dracut debug shell, you can manually perform the task of locating and
preparing your root volume for boot. The required steps will depend on how your
root volume is configured. Common scenarios include:
* A block device (e.g. _/dev/sda7_)
* A LVM logical volume (e.g. _/dev/VolGroup00/LogVol00_)
* An encrypted device
(e.g. _/dev/mapper/luks-4d5972ea-901c-4584-bd75-1da802417d83_)
* A network attached device
(e.g. _netroot=iscsi:@192.168.0.4::3260::iqn.2009-02.org.example:for.all_)
The exact method for locating and preparing will vary. However, to continue with
a successful boot, the objective is to locate your root volume and create a
symlink _/dev/root_ which points to the file system. For example, the following
example demonstrates accessing and booting a root volume that is an encrypted
LVM Logical volume.
. Inspect your partitions using parted
+
----
# parted /dev/sda -s p
Model: ATA HTS541060G9AT00 (scsi)
Disk /dev/sda: 60.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 32.3kB 10.8GB 107MB primary ext4 boot
2 10.8GB 55.6GB 44.7GB logical lvm
----
+
. You recall that your root volume was a LVM logical volume. Scan and activate
any logical volumes.
+
----
# lvm vgscan
# lvm vgchange -ay
----
+
. You should see any logical volumes now using the command blkid:
+
----
# blkid
/dev/sda1: UUID="3de247f3-5de4-4a44-afc5-1fe179750cf7" TYPE="ext4"
/dev/sda2: UUID="Ek4dQw-cOtq-5MJu-OGRF-xz5k-O2l8-wdDj0I" TYPE="LVM2_member"
/dev/mapper/linux-root: UUID="def0269e-424b-4752-acf3-1077bf96ad2c" TYPE="crypto_LUKS"
/dev/mapper/linux-home: UUID="c69127c1-f153-4ea2-b58e-4cbfa9257c5e" TYPE="ext4"
/dev/mapper/linux-swap: UUID="47b4d329-975c-4c08-b218-f9c9bf3635f1" TYPE="swap"
----
+
. From the output above, you recall that your root volume exists on an encrypted
block device. Following the guidance disk encryption guidance from the
Installation Guide, you unlock your encrypted root volume.
+
----
# UUID=$(cryptsetup luksUUID /dev/mapper/linux-root)
# cryptsetup luksOpen /dev/mapper/linux-root luks-$UUID
Enter passphrase for /dev/mapper/linux-root:
Key slot 0 unlocked.
----
+
. Next, make a symbolic link to the unlocked root volume
+
----
# ln -s /dev/mapper/luks-$UUID /dev/root
----
+
. With the root volume available, you may continue booting the system by exiting
the dracut shell
+
----
# exit
----
[[additional-dracut-boot-parameters]]
==== Additional dracut boot parameters
For more debugging options, see *dracut.cmdline*(7).
[[debugging-dracut-on-shutdown]]
==== Debugging dracut on shutdown
To debug the shutdown sequence on systemd systems, you can _rd.break_
on _pre-shutdown_ or _shutdown_.
To do this from an already booted system:
----
# mkdir -p /run/initramfs/etc/cmdline.d
# echo "rd.debug rd.break=pre-shutdown rd.break=shutdown" > /run/initramfs/etc/cmdline.d/debug.conf
# touch /run/initramfs/.need_shutdown
----
This will give you a dracut shell after the system pivot'ed back in the
initramfs.

View File

@@ -1,71 +0,0 @@
LSINITRD(1)
=========
:doctype: manpage
:man source: dracut
:man manual: dracut
:man version: {version}
NAME
----
lsinitrd - tool to show the contents of an initramfs image
SYNOPSIS
--------
*lsinitrd* ['OPTION...'] [<image> [<filename> [<filename> [...] ]]]
*lsinitrd* ['OPTION...'] -k <kernel version>
DESCRIPTION
-----------
lsinitrd shows the contents of an initramfs image. if <image> is omitted, then
lsinitrd uses the default image _/efi/<machine-id>/<kernel-version>/initrd_,
_/boot/<machine-id>/<kernel-version>/initrd_,
_/boot/efi/<machine-id>/<kernel-version>/initrd_,
_/lib/modules/<kernel-version>/initrd_ or
_/boot/initramfs-<kernel-version>.img_.
OPTIONS
-------
**-h, --help**::
print a help message and exit.
**-s, --size**::
sort the contents of the initramfs by size.
**-f, --file** _<filename>_::
print the contents of <filename>.
**-k, --kver** _<kernel version>_::
inspect the initramfs of <kernel version>.
**-m, --mod**::
list dracut modules included of the initramfs image.
**--unpack**::
unpack the initramfs to the current directory, instead of displaying the contents.
If optional filenames are given, will only unpack specified files, else the whole image will be unpacked.
Won't unpack anything from early cpio part.
**--unpackearly**::
unpack the early microcode initramfs to the current directory, instead of displaying the contents.
Same as --unpack, but only unpack files from early cpio part.
**-v, --verbose**::
unpack verbosely
AVAILABILITY
------------
The lsinitrd command is part of the dracut package and is available from
link:$$https://github.com/dracutdevs/dracut$$[https://github.com/dracutdevs/dracut]
AUTHORS
-------
Harald Hoyer
Amerigo Wang
Nikoli
SEE ALSO
--------
*dracut*(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

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