Compare commits
195 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
59a232ddcd | ||
![]() |
01816f2bb1 | ||
![]() |
0d86614794 | ||
![]() |
8821f4109e | ||
![]() |
783721b34b | ||
![]() |
f6c76abe8e | ||
![]() |
41bad60c82 | ||
![]() |
9c7f67a94d | ||
![]() |
26df1299cb | ||
![]() |
1f03abefad | ||
![]() |
f2db681002 | ||
![]() |
5bb59e428f | ||
![]() |
a1ef436531 | ||
![]() |
c865ecbf32 | ||
![]() |
2576bec68f | ||
![]() |
7c1796860f | ||
![]() |
d350ae6966 | ||
![]() |
9b3d462b68 | ||
![]() |
5150d44a7e | ||
![]() |
30cd3616e9 | ||
![]() |
609d00c467 | ||
![]() |
27e15000d0 | ||
![]() |
029f2691f8 | ||
![]() |
0493f9c849 | ||
![]() |
3eccdb5289 | ||
![]() |
17cb0e3fe8 | ||
![]() |
cdc8d9c403 | ||
![]() |
719cc30626 | ||
![]() |
0ca3a5ee84 | ||
![]() |
62f8a2b63c | ||
![]() |
a0342347e9 | ||
![]() |
076bab08c1 | ||
![]() |
578c24a473 | ||
![]() |
c492fe12c0 | ||
![]() |
e0c1d4e79f | ||
![]() |
0b2ddf8f69 | ||
![]() |
80a18b8bef | ||
![]() |
3a4d0c9c14 | ||
![]() |
3122e93350 | ||
![]() |
21a7b84486 | ||
![]() |
4b0a61c586 | ||
![]() |
cc97412c32 | ||
![]() |
aceaf13b44 | ||
![]() |
d7cc3f2ef5 | ||
![]() |
db3641a2ea | ||
![]() |
8e102a2487 | ||
![]() |
4c2d8f5816 | ||
![]() |
d6351b36b8 | ||
![]() |
d752c51b90 | ||
![]() |
f007e84e8e | ||
![]() |
9c111e59c9 | ||
![]() |
4754226a1a | ||
![]() |
606852a4a6 | ||
![]() |
8220945b2c | ||
![]() |
6292ee9d18 | ||
![]() |
dd2c34a82b | ||
![]() |
1246703bb4 | ||
![]() |
d2a535855b | ||
![]() |
ddd109bdf9 | ||
![]() |
3f62b2637c | ||
![]() |
08852c50b9 | ||
![]() |
bb7645459e | ||
![]() |
e5c6cb2a8c | ||
![]() |
3272ed884f | ||
![]() |
3ad4f77cef | ||
![]() |
e001359311 | ||
![]() |
dcdca91d91 | ||
![]() |
6baa63110e | ||
![]() |
93ad8c19bb | ||
![]() |
2926b5b35d | ||
![]() |
76514565c0 | ||
![]() |
bd324b9d94 | ||
![]() |
a10a1416c1 | ||
![]() |
e13918d24a | ||
![]() |
466f36159d | ||
![]() |
2245f3723b | ||
![]() |
dde97b301f | ||
![]() |
6f9d69c95a | ||
![]() |
adde3a7a27 | ||
![]() |
ed61aae141 | ||
![]() |
26257a5cf4 | ||
![]() |
0e1d2c3efa | ||
![]() |
b8a2f174d7 | ||
![]() |
e9ef52b460 | ||
![]() |
3a4989cae2 | ||
![]() |
ecee64bffa | ||
![]() |
540eb97162 | ||
![]() |
013986a8ad | ||
![]() |
a0af4fa5ea | ||
![]() |
5cae1fe179 | ||
![]() |
91bb250aed | ||
![]() |
40d69001ac | ||
![]() |
06f91665df | ||
![]() |
8442b51e20 | ||
![]() |
e9a9c8bb7e | ||
![]() |
847b618b4c | ||
![]() |
fd2312e03d | ||
![]() |
5f70a1bd06 | ||
![]() |
876bd1a2be | ||
![]() |
87122afcda | ||
![]() |
78cd3b9824 | ||
![]() |
185468f57d | ||
![]() |
45b5a4e142 | ||
![]() |
e4ebd474ec | ||
![]() |
ae5ec68355 | ||
![]() |
95c1941ce5 | ||
![]() |
59a083d8d1 | ||
![]() |
be217dc4d4 | ||
![]() |
e8e4b28dfa | ||
![]() |
1c894acb42 | ||
![]() |
7d86d90d11 | ||
![]() |
532b8c7a43 | ||
![]() |
22ecea456b | ||
![]() |
5f927f201d | ||
![]() |
b48d98dda3 | ||
![]() |
4eab305062 | ||
![]() |
edcd2c5eb7 | ||
![]() |
2c24ee9a72 | ||
![]() |
169f167151 | ||
![]() |
08e10f05f6 | ||
![]() |
bd987e3036 | ||
![]() |
be0921a413 | ||
![]() |
f01d965f0e | ||
![]() |
ecf42850c3 | ||
![]() |
2974f382f8 | ||
![]() |
6a4f980921 | ||
![]() |
5a4bbf1bda | ||
![]() |
123e24a3b5 | ||
![]() |
dcdf5c8801 | ||
![]() |
ed8c7bf5c2 | ||
![]() |
70503db416 | ||
![]() |
a2929f90ff | ||
![]() |
9cdde06d50 | ||
![]() |
b6a7c09070 | ||
![]() |
680ac04370 | ||
![]() |
e54a84113e | ||
![]() |
91d8394093 | ||
![]() |
e02c2d5c43 | ||
![]() |
7c0aa2a2ea | ||
![]() |
9ab1426534 | ||
![]() |
647035f9aa | ||
![]() |
a3afcf2a5a | ||
![]() |
7e33fa5b52 | ||
![]() |
d0ced35fc6 | ||
![]() |
a8ca68a91e | ||
![]() |
5be225d299 | ||
![]() |
a8a103e093 | ||
![]() |
d7a272a95e | ||
![]() |
c198a4bc8c | ||
![]() |
13289be133 | ||
![]() |
3df3a99759 | ||
![]() |
270ba358fa | ||
![]() |
d87c2708ec | ||
![]() |
d8b9844c61 | ||
![]() |
1d323cd938 | ||
![]() |
8f74a60ced | ||
![]() |
127fb81754 | ||
![]() |
ebcfda6c61 | ||
![]() |
bdcb63b0e6 | ||
![]() |
8f4c066020 | ||
![]() |
1fca65c576 | ||
![]() |
da4e644327 | ||
![]() |
c5ef4b63a3 | ||
![]() |
6c980807d0 | ||
![]() |
97add1b383 | ||
![]() |
3de984ba7f | ||
![]() |
85fd75f91f | ||
![]() |
0c88742669 | ||
![]() |
709302e3cc | ||
![]() |
3e96d7aa33 | ||
![]() |
3409c2377f | ||
![]() |
4058d85cb6 | ||
![]() |
2937028c54 | ||
![]() |
56f184310a | ||
![]() |
1d149cd039 | ||
![]() |
dafa4f621f | ||
![]() |
0679a6d24e | ||
![]() |
8ded2a65c0 | ||
![]() |
400723054c | ||
![]() |
7f00669875 | ||
![]() |
c91570782c | ||
![]() |
fede5bbcda | ||
![]() |
e9e93e2ec6 | ||
![]() |
d4abad2288 | ||
![]() |
ddbdebb9c8 | ||
![]() |
4828beb949 | ||
![]() |
9b17b085f3 | ||
![]() |
d293133982 | ||
![]() |
cd83e4c54d | ||
![]() |
fbf1b5b138 | ||
![]() |
58ffd15bff | ||
![]() |
0e0bf83057 | ||
![]() |
d693f34afb | ||
![]() |
d1bae3cd17 | ||
![]() |
7ea25f3a34 |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,3 +1,8 @@
|
||||
test*.img
|
||||
modules.d/99base/switch_root
|
||||
*~
|
||||
dracut.kernel.7
|
||||
dracut.conf.5
|
||||
dracut.8
|
||||
dracut-catimages.8
|
||||
dracut-gencmdline.8
|
||||
|
13
AUTHORS
13
AUTHORS
@@ -1,13 +1,15 @@
|
||||
Harald Hoyer <harald@redhat.com>
|
||||
Victor Lowther <victor.lowther@gmail.com>
|
||||
Warren Togami <wtogami@redhat.com>
|
||||
Philippe Seewer <philippe.seewer@bfh.ch>
|
||||
Warren Togami <wtogami@redhat.com>
|
||||
Jeremy Katz <katzj@redhat.com>
|
||||
David Dillow <dave@thedillows.org>
|
||||
Amadeusz Żołnowski <aidecoe@aidecoe.name>
|
||||
Andreas Thienemann <andreas@bawue.net>
|
||||
Hans de Goede <hdegoede@redhat.com>
|
||||
Peter Jones <pjones@redhat.com>
|
||||
Luca Berra <bluca@comedia.it>
|
||||
Andrey Borzenkov <arvidjaar@mail.ru>
|
||||
Marc Grimme <grimme@atix.de>
|
||||
Bill Nottingham <notting@redhat.com>
|
||||
Daniel Drake <dsd@laptop.org>
|
||||
@@ -16,15 +18,22 @@ Lance Albertson <lance@osuosl.org>
|
||||
Michael Ploujnikov <plouj@somanetworks.com>
|
||||
Alan Jenkins <alan-jenkins@tuffmail.co.uk>
|
||||
Dan Horák <dan@danny.cz>
|
||||
Andrey Borzenkov <arvidjaar@mail.ru>
|
||||
Joey Boggs <jboggs@redhat.com>
|
||||
Alexander Todorov <atodorov@redhat.com>
|
||||
Andy Lutomirski <luto@mit.edu>
|
||||
Dan Horák <dhorak@redhat.com>
|
||||
Dave Jones <davej@redhat.com>
|
||||
Frederic Crozat <fcrozat@mandriva.com>
|
||||
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
|
||||
Luca Berra <bluca@vodka.it>
|
||||
Matt <smoothsailing72@hotmail.com>
|
||||
Michal Schmidt <mschmidt@redhat.com>
|
||||
Mike Snitzer <msnitzer@redhat.com>
|
||||
Mike Snitzer <snitzer@redhat.com>
|
||||
Munehiro Matsuda <haro@kgt.co.jp>
|
||||
Peter Rajnoha <prajnoha@redhat.com>
|
||||
Quentin Armitage <quentin@armitage.org.uk>
|
||||
Sergey Fionov <fionov@gmail.com>
|
||||
Thilo Bangert <thilo.bangert@gmx.net>
|
||||
Ville Skyttä <ville.skytta@iki.fi>
|
||||
Yanko Kaneti <yaneti@declera.com>
|
||||
|
26
Makefile
26
Makefile
@@ -1,4 +1,4 @@
|
||||
VERSION=005
|
||||
VERSION=007
|
||||
GITVERSION=$(shell [ -d .git ] && git rev-list --abbrev-commit -n 1 HEAD |cut -b 1-8)
|
||||
|
||||
prefix ?= /usr
|
||||
@@ -8,6 +8,7 @@ sysconfdir ?= ${prefix}/etc
|
||||
sbindir ?= ${prefix}/sbin
|
||||
mandir ?= ${prefix}/share/man
|
||||
|
||||
manpages = dracut.8 dracut.kernel.7 dracut.conf.5 dracut-catimages.8 dracut-gencmdline.8
|
||||
|
||||
.PHONY: install clean archive rpm testimage test all check AUTHORS
|
||||
|
||||
@@ -17,7 +18,10 @@ else
|
||||
targets =
|
||||
endif
|
||||
|
||||
all: $(targets)
|
||||
all: $(targets) $(manpages)
|
||||
|
||||
%: %.xml
|
||||
xsltproc -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
|
||||
|
||||
modules.d/99base/switch_root: switch_root.c
|
||||
gcc -D _GNU_SOURCE -D 'PACKAGE_STRING="dracut"' -std=gnu99 -fsigned-char -g -O2 -o modules.d/99base/switch_root switch_root.c
|
||||
@@ -27,7 +31,7 @@ install:
|
||||
mkdir -p $(DESTDIR)$(sbindir)
|
||||
mkdir -p $(DESTDIR)$(sysconfdir)
|
||||
mkdir -p $(DESTDIR)$(pkglibdir)/modules.d
|
||||
mkdir -p $(DESTDIR)$(mandir)/man{5,8}
|
||||
mkdir -p $(DESTDIR)$(mandir)/man{5,7,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
|
||||
@@ -44,16 +48,20 @@ endif
|
||||
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
|
||||
install -m 0644 dracut.kernel.7 $(DESTDIR)$(mandir)/man7
|
||||
ifeq (1,${WITH_SWITCH_ROOT})
|
||||
rm $(DESTDIR)$(pkglibdir)/modules.d/99base/switch_root
|
||||
endif
|
||||
|
||||
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
|
||||
$(RM) *~
|
||||
$(RM) */*~
|
||||
$(RM) */*/*~
|
||||
$(RM) modules.d/99base/switch_root
|
||||
$(RM) test-*.img
|
||||
$(RM) dracut-*.rpm dracut-*.tar.bz2
|
||||
$(RM) $(manpages)
|
||||
$(MAKE) -C test clean
|
||||
|
||||
archive: dracut-$(VERSION)-$(GITVERSION).tar.bz2
|
||||
|
||||
@@ -83,7 +91,7 @@ check: all
|
||||
@ret=0;for i in modules.d/99base/init modules.d/*/*.sh; do \
|
||||
dash -n "$$i" ; ret=$$(($$ret+$$?)); \
|
||||
done;exit $$ret
|
||||
make -C test check
|
||||
$(MAKE) -C test check
|
||||
|
||||
testimage: all
|
||||
./dracut -l -a debug -f test-$(shell uname -r).img $(shell uname -r)
|
||||
|
35
NEWS
35
NEWS
@@ -1,3 +1,37 @@
|
||||
dracut-007
|
||||
==========
|
||||
- module i18n is no longer fedora/red hat specific (Amadeusz Żołnowski)
|
||||
- distribution specific conf file
|
||||
- bootchartd support
|
||||
- debug module now has fsck
|
||||
- use "hardlink", if available, to safe some space
|
||||
- /etc/dracut.conf can be overwritten by settings in /etc/dracut.conf.d/*.conf
|
||||
- gentoo splash module
|
||||
- --ignore-kernel-modules option
|
||||
- crypto keys on external devices support
|
||||
- bugfixes
|
||||
|
||||
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
|
||||
- boot from LVM mirrors and snapshots
|
||||
- iscsi: add support for multiple netroot=iscsi:
|
||||
- Support old version of module-init-tools
|
||||
- got rid of rdnetdebug
|
||||
- fixed "ip=auto6"
|
||||
- dracut.conf: use "+=" as default for config variables
|
||||
- bugfixes
|
||||
|
||||
dracut-005
|
||||
==========
|
||||
- dcb support to dracut's FCoE support
|
||||
@@ -8,7 +42,6 @@ dracut-005
|
||||
- add preliminary IPv6 support
|
||||
- bugfixes
|
||||
|
||||
|
||||
dracut-004
|
||||
==========
|
||||
- dracut-lib: read multiple lines from $init/etc/cmdline
|
||||
|
@@ -1,6 +1,3 @@
|
||||
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.
|
||||
"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.
|
||||
|
||||
|
72
dracut
72
dracut
@@ -46,8 +46,12 @@ Creates initial ramdisk images for preloading modules
|
||||
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
|
||||
--ignore-kernel-modules
|
||||
Don't try to load modules. It automatically implies
|
||||
'--no-kernel'. It's assumed that everything needed
|
||||
is built into kernel.
|
||||
--strip Strip binaries in the initramfs
|
||||
--nostrip Do not strip binaries in the initramfs (default)
|
||||
--mdadmconf Include local /etc/mdadm.conf
|
||||
--nomdadmconf Do not include local /etc/mdadm.conf
|
||||
--lvmconf Include local /etc/lvm/lvm.conf
|
||||
@@ -57,12 +61,15 @@ Creates initial ramdisk images for preloading modules
|
||||
-v, --verbose Verbose output during the build process
|
||||
-c, --conf [FILE] Specify configuration file to use.
|
||||
Default: /etc/dracut.conf
|
||||
--confdir [DIR] Specify configuration directory to use *.conf files from.
|
||||
Default: /etc/dracut.conf.d
|
||||
-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
|
||||
-H, --hostonly Host-Only mode: Install only what is needed for
|
||||
booting the local host instead of a generic host.
|
||||
--fstab Use /etc/fstab to determine the root device.
|
||||
-i, --include [SOURCE] [TARGET]
|
||||
Include the files in the SOURCE directory into the
|
||||
Target directory in the final initramfs.
|
||||
@@ -74,16 +81,20 @@ Creates initial ramdisk images for preloading modules
|
||||
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;;
|
||||
--filesystems) filesystems_l="$2"; shift;;
|
||||
-m|--modules) dracutmodules_l="$dracutmodules_l $2"; shift;;
|
||||
-o|--omit) omit_dracutmodules_l="$omit_dracutmodules_l $2"; shift;;
|
||||
-a|--add) add_dracutmodules_l="$add_dracutmodules_l $2"; shift;;
|
||||
-d|--drivers) drivers_l="$drivers_l $2"; shift;;
|
||||
--add-drivers) add_drivers_l="$add_drivers_l $2"; shift;;
|
||||
--filesystems) filesystems_l="$filesystems_l $2"; shift;;
|
||||
-k|--kmoddir) drivers_dir_l="$2"; shift;;
|
||||
--fwdir) fw_dir_l="$2"; shift;;
|
||||
--fwdir) fw_dir_l="$fw_dir_l:$2"; shift;;
|
||||
--kernel-only) kernel_only="yes"; no_kernel="no";;
|
||||
--no-kernel) kernel_only="no"; no_kernel="yes";;
|
||||
--ignore-kernel-modules) kernel_only="no"; no_kernel="yes"
|
||||
ignore_kmodules="yes"
|
||||
omit_dracutmodules_l+=\ kernel-modules
|
||||
;;
|
||||
--strip) do_strip_l="yes";;
|
||||
--nostrip) do_strip_l="no";;
|
||||
--mdadmconf) mdadmconf_l="yes";;
|
||||
@@ -97,6 +108,7 @@ while (($# > 0)); do
|
||||
--confdir) confdir="$2"; shift;;
|
||||
-l|--local) allowlocal="yes" ;;
|
||||
-H|--hostonly) hostonly_l="yes" ;;
|
||||
--fstab) use_fstab_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;;
|
||||
@@ -128,6 +140,9 @@ if [[ ! -d $confdir ]]; then
|
||||
[[ $allowlocal ]] && confdir="$dracutbasedir/dracut.conf.d"
|
||||
fi
|
||||
|
||||
# source our config file
|
||||
[[ -f $conffile ]] && . "$conffile"
|
||||
|
||||
# source our config dir
|
||||
if [ "$confdir" ] && [ -d "$confdir" ]; then
|
||||
for f in "$confdir"/*.conf; do
|
||||
@@ -135,25 +150,25 @@ if [ "$confdir" ] && [ -d "$confdir" ]; then
|
||||
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"
|
||||
|
||||
# these options override the stuff in the config file
|
||||
[[ $dracutmodules_l ]] && dracutmodules=$dracutmodules_l
|
||||
[[ $omit_dracutmodules_l ]] && omit_dracutmodules=$omit_dracutmodules_l
|
||||
[[ $add_dracutmodules_l ]] && add_dracutmodules="$add_dracutmodules $add_dracutmodules_l"
|
||||
[[ $drivers_l ]] && drivers=$drivers_l
|
||||
[[ $add_drivers_l ]] && add_drivers=$add_drivers_l
|
||||
[[ $filesystems_l ]] && filesystems=$filesystems_l
|
||||
[[ $drivers_dir_l ]] && drivers_dir=$drivers_dir_l
|
||||
[[ $fw_dir_l ]] && fw_dir=$fw_dir_l
|
||||
[[ $do_strip_l ]] && do_strip=$do_strip_l
|
||||
[[ $hostonly_l ]] && hostonly=$hostonly_l
|
||||
[[ $use_fstab_l ]] && use_fstab=$use_fstab_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
|
||||
[[ $do_strip ]] || do_strip=no
|
||||
# eliminate IFS hackery when messing with fw_dir
|
||||
fw_dir=${fw_dir//:/ }
|
||||
|
||||
@@ -181,7 +196,13 @@ esac
|
||||
abs_outfile=$(readlink -f "$outfile") && outfile="$abs_outfile"
|
||||
|
||||
srcmods="/lib/modules/$kernel/"
|
||||
[[ $drivers_dir ]] && srcmods="$drivers_dir"
|
||||
[[ $drivers_dir ]] && {
|
||||
if vercmp $(modprobe --version | cut -d' ' -f3) lt 3.7; then
|
||||
derror 'To use --kmoddir option module-init-tools >= 3.7 is required.'
|
||||
exit 1
|
||||
fi
|
||||
srcmods="$drivers_dir"
|
||||
}
|
||||
export srcmods
|
||||
|
||||
if [[ -f $outfile && ! $force ]]; then
|
||||
@@ -218,7 +239,8 @@ chmod 755 "$initdir"
|
||||
|
||||
export initdir hookdirs dracutbasedir dracutmodules drivers \
|
||||
fw_dir drivers_dir debug beverbose no_kernel kernel_only \
|
||||
add_drivers mdadmconf lvmconf filesystems
|
||||
add_drivers mdadmconf lvmconf filesystems ignore_kmodules \
|
||||
use_fstab
|
||||
|
||||
if [[ $kernel_only != yes ]]; then
|
||||
# Create some directory structure first
|
||||
@@ -235,6 +257,7 @@ check_modules
|
||||
for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
|
||||
mod=${moddir##*/}; mod=${mod#[0-9][0-9]}
|
||||
if strstr "$mods_to_load" " $mod "; then
|
||||
dinfo "*** Sourcing module $mod"
|
||||
if [[ $kernel_only = yes ]]; then
|
||||
[[ -x $moddir/installkernel ]] && . "$moddir/installkernel"
|
||||
else
|
||||
@@ -276,7 +299,7 @@ ldconfig -r "$initdir" || [[ $(id -u) != "0" ]] && dinfo "ldconfig might need ui
|
||||
|
||||
# strip binaries
|
||||
if [[ $do_strip = yes ]] ; then
|
||||
for p in strip objdump sed grep find; do
|
||||
for p in strip grep find; do
|
||||
if ! which $p >/dev/null 2>&1; then
|
||||
derror "Could not find '$p'. You should run $0 with '--nostrip'."
|
||||
do_strip=no
|
||||
@@ -285,11 +308,9 @@ if [[ $do_strip = yes ]] ; then
|
||||
fi
|
||||
|
||||
if [[ $do_strip = yes ]] ; then
|
||||
for f in $(find "$initdir" -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 -or -path '/lib/modules/*.ko' \) -exec file {} \; |
|
||||
grep -v ' shared object,' |
|
||||
sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'); do
|
||||
for f in $(find "$initdir" -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 -or -path '*/lib/modules/*.ko' \) ); do
|
||||
dinfo "Stripping $f"
|
||||
strip -g "$f" || :
|
||||
strip -g "$f" 2>/dev/null|| :
|
||||
#
|
||||
# FIXME: only strip -g for now
|
||||
#
|
||||
@@ -303,7 +324,12 @@ if [[ $do_strip = yes ]] ; then
|
||||
done
|
||||
fi
|
||||
|
||||
( cd "$initdir"; find . |cpio -R 0:0 -H newc -o --quiet |gzip -9 > "$outfile"; )
|
||||
type hardlink &>/dev/null && {
|
||||
hardlink "$initdir" 2>&1
|
||||
}
|
||||
|
||||
type pigz &>/dev/null && gzip=pigz || gzip=gzip
|
||||
( cd "$initdir"; find . |cpio -R 0:0 -H newc -o --quiet |$gzip -9 > "$outfile"; )
|
||||
if [ $? -ne 0 ]; then
|
||||
derror "dracut: creation of $outfile failed"
|
||||
exit 1
|
||||
|
@@ -102,7 +102,8 @@ fi
|
||||
if [[ ! $no_overlay ]]; then
|
||||
ofile="$imagedir/90-overlay.img"
|
||||
dinfo "Creating image $ofile from directory $overlay"
|
||||
( cd "$overlay"; find . |cpio --quiet -H newc -o |gzip -9 > "$ofile"; )
|
||||
type pigz &>/dev/null && gzip=pigz || gzip=gzip
|
||||
( cd "$overlay"; find . |cpio --quiet -H newc -o |$gzip -9 > "$ofile"; )
|
||||
fi
|
||||
|
||||
if [[ ! $no_imagedir ]]; then
|
||||
|
@@ -1,52 +0,0 @@
|
||||
.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)
|
116
dracut-catimages.8.xml
Normal file
116
dracut-catimages.8.xml
Normal file
@@ -0,0 +1,116 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" []>
|
||||
<!-- lifted from troff+man by doclifter -->
|
||||
<refentry id='dracutcatimages8'>
|
||||
<refmeta>
|
||||
<refentrytitle>DRACUT-CATIMAGES</refentrytitle>
|
||||
<manvolnum>8</manvolnum>
|
||||
<refmiscinfo class='source'>June 2009</refmiscinfo>
|
||||
<refmiscinfo class='manual'>Linux</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv id='name'>
|
||||
<refname>dracut-catimages</refname>
|
||||
<refpurpose>creates initial ramdisk image by concatenating images</refpurpose>
|
||||
</refnamediv>
|
||||
<!-- body begins here -->
|
||||
<refsynopsisdiv id='synopsis'>
|
||||
<cmdsynopsis>
|
||||
<command>dracut-catimages</command> <arg choice='opt' rep='repeat'><replaceable>OPTION</replaceable></arg>
|
||||
<arg choice='plain'><replaceable><initramfs</replaceable></arg>
|
||||
<arg choice='plain'><replaceable>base</replaceable></arg>
|
||||
<arg choice='plain'><replaceable>image></replaceable></arg>
|
||||
<arg choice='opt' rep='repeat'><replaceable><image></replaceable></arg>
|
||||
<sbr/>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
|
||||
<refsect1 id='description'><title>DESCRIPTION</title>
|
||||
<para><command>dracut-catimages</command>
|
||||
creates an initial ramdisk image by concatenating several images from the command
|
||||
line and /boot/dracut/*.img</para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id='options'><title>OPTIONS</title>
|
||||
<variablelist remap='TP'>
|
||||
<varlistentry>
|
||||
<term><option>-f</option>, <option>--force</option></term>
|
||||
<listitem>
|
||||
<para>overwrite existing initramfs file.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>-i</option>, <option>--imagedir</option></term>
|
||||
<listitem>
|
||||
<para>Directory with additional images to add (default: /boot/dracut/)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>-o</option>, <option>--overlaydir</option></term>
|
||||
<listitem>
|
||||
<para>Overlay directory, which contains additional files that will be used to create an additional image</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>--nooverlay</option></term>
|
||||
<listitem>
|
||||
<para>Do not use the overlay directory</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>--noimagedir</option></term>
|
||||
<listitem>
|
||||
<para>Do not use the additional image directory</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>-h</option>, <option>--help</option></term>
|
||||
<listitem>
|
||||
<para>display help text and exit.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>--debug</option></term>
|
||||
<listitem>
|
||||
<para>output debug information of the build process</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>-v</option>, <option>--verbose</option></term>
|
||||
<listitem>
|
||||
<para>verbose output during the build process</para>
|
||||
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id='files'><title>FILES</title>
|
||||
<variablelist remap='TP'>
|
||||
<varlistentry>
|
||||
<term><filename>/boot/dracut/*.img</filename></term>
|
||||
<listitem>
|
||||
<para></para> <!-- FIXME: blank list item -->
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id='authors'><title>AUTHORS</title>
|
||||
<literallayout remap='.nf'>
|
||||
Harald Hoyer <harald@redhat.com>
|
||||
</literallayout> <!-- .fi -->
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id='availability'><title>AVAILABILITY</title>
|
||||
<para>The dracut-catimages command is part of the dracut package and is available from
|
||||
<ulink url='http://sourceforge.net/apps/trac/dracut/wiki'>http://sourceforge.net/apps/trac/dracut/wiki</ulink></para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id='see_also'><title>SEE ALSO</title>
|
||||
<para><citerefentry><refentrytitle>dracut</refentrytitle><manvolnum>8</manvolnum></citerefentry></para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
247
dracut-functions
247
dracut-functions
@@ -24,6 +24,37 @@ IF_dynamic=""
|
||||
# Generic substring function. If $2 is in $1, return 0.
|
||||
strstr() { [[ $1 =~ $2 ]]; }
|
||||
|
||||
# Create all subdirectories for given path without creating the last element.
|
||||
# $1 = path
|
||||
mksubdirs() { mkdir -p ${1%/*}; }
|
||||
|
||||
# Version comparision function. Assumes Linux style version scheme.
|
||||
# $1 = version a
|
||||
# $2 = comparision op (gt, ge, eq, le, lt, ne)
|
||||
# $3 = version b
|
||||
vercmp() {
|
||||
local n1=(${1//./ }) op=$2 n2=(${3//./ }) i res
|
||||
|
||||
for ((i=0; ; i++))
|
||||
do
|
||||
if [[ ! ${n1[i]}${n2[i]} ]]; then res=0
|
||||
elif ((${n1[i]:-0} > ${n2[i]:-0})); then res=1
|
||||
elif ((${n1[i]:-0} < ${n2[i]:-0})); then res=2
|
||||
else continue
|
||||
fi
|
||||
break
|
||||
done
|
||||
|
||||
case $op in
|
||||
gt) ((res == 1));;
|
||||
ge) ((res != 2));;
|
||||
eq) ((res == 0));;
|
||||
le) ((res != 1));;
|
||||
lt) ((res == 2));;
|
||||
ne) ((res != 0));;
|
||||
esac
|
||||
}
|
||||
|
||||
# Log initrd creation.
|
||||
if ! [[ $dracutlogfile ]]; then
|
||||
[[ $dracutbasedir = /usr/share/dracut ]] && \
|
||||
@@ -50,7 +81,23 @@ derror() {
|
||||
[[ -w $dracutlogfile ]] && echo "E: $@" >>"$dracutlogfile"
|
||||
}
|
||||
|
||||
# Function prints global variables in format name=value line by line.
|
||||
# $@ = list of global variables' name
|
||||
print_vars() {
|
||||
local var value
|
||||
|
||||
for var in $@
|
||||
do
|
||||
value=$(eval echo \$$var)
|
||||
[[ ${value} ]] && echo "${var}=\"${value}\""
|
||||
done
|
||||
}
|
||||
|
||||
get_fs_env() {
|
||||
[[ $1 ]] || return
|
||||
eval $(udevadm info --query=env --name=$1|egrep 'ID_FS_(TYPE|UUID)=')
|
||||
[[ $ID_FS_TYPE ]] && return
|
||||
|
||||
if [[ -x /lib/udev/vol_id ]]; then
|
||||
eval $(/lib/udev/vol_id --export $1)
|
||||
elif find_binary blkid >/dev/null; then
|
||||
@@ -61,6 +108,13 @@ get_fs_env() {
|
||||
}
|
||||
|
||||
get_fs_type() (
|
||||
[[ $1 ]] || return
|
||||
if [[ $1 != ${1#/dev/block/nfs:} ]] \
|
||||
|| [[ $1 != ${1#/dev/block/nfs3:} ]] \
|
||||
|| [[ $1 != ${1#/dev/block/nfs4:} ]]; then
|
||||
echo "nfs"
|
||||
return
|
||||
fi
|
||||
get_fs_env $1 || return
|
||||
echo $ID_FS_TYPE
|
||||
)
|
||||
@@ -72,15 +126,35 @@ get_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)
|
||||
local x mpt majmin dev fs misc maj min
|
||||
if [[ $use_fstab != yes ]]; then
|
||||
while read x x majmin x mpt x x fs misc; do
|
||||
[[ $fs = nfs ]] && { echo $dev; return 0;}
|
||||
[[ $fs = nfs3 ]] && { echo $dev; return 0;}
|
||||
[[ $fs = nfs4 ]] && { echo $dev; return 0;}
|
||||
if [[ $mpt = $1 ]] && [[ ${majmin#0:} = $majmin ]]; then
|
||||
echo $majmin;
|
||||
return 0 # we have a winner!
|
||||
fi
|
||||
done < /proc/self/mountinfo
|
||||
fi
|
||||
# fall back to /etc/fstab
|
||||
while read dev mpt fs misc; do
|
||||
if [[ $mpt = $1 ]]; then
|
||||
[[ $fs = nfs ]] && { echo $dev; return 0;}
|
||||
[[ $fs = nfs3 ]] && { echo $dev; return 0;}
|
||||
[[ $fs = nfs4 ]] && { echo $dev; return 0;}
|
||||
[[ $dev != ${dev#UUID=} ]] && dev=/dev/disk/by-uuid/${dev#UUID=}
|
||||
[[ $dev != ${dev#LABEL=} ]] && dev=/dev/disk/by-label/${dev#LABEL=}
|
||||
[[ -b $dev ]] || return 1 # oops, not a block device.
|
||||
ls -nLl "$dev" | {
|
||||
read x x x x maj min x;
|
||||
maj=${maj//,/};
|
||||
echo $maj:$min;
|
||||
} && return 0
|
||||
fi
|
||||
done < /etc/fstab
|
||||
return 1;
|
||||
}
|
||||
|
||||
find_root_block_device() { find_block_device /; }
|
||||
@@ -94,6 +168,9 @@ check_block_and_slaves() {
|
||||
[[ -b /dev/block/$2 ]] || return 1 # Not a block device? So sorry.
|
||||
"$1" $2 && return
|
||||
check_vol_slaves "$@" && return 0
|
||||
if [[ -f "/sys/dev/block/$2/../dev" ]]; then
|
||||
check_block_and_slaves $1 $(cat "/sys/dev/block/$2/../dev") && return 0
|
||||
fi
|
||||
[[ -d /sys/dev/block/$2/slaves ]] || return 1
|
||||
for x in /sys/dev/block/$2/slaves/*/dev; do
|
||||
[[ -f $x ]] || continue
|
||||
@@ -177,11 +254,36 @@ inst_simple() {
|
||||
cp -pfL "$src" "${initdir}$target"
|
||||
}
|
||||
|
||||
# find symlinks linked to given library file
|
||||
# $1 = library file
|
||||
# Function searches for symlinks by stripping version numbers appended to
|
||||
# library filename, checks if it points to the same target and finally
|
||||
# prints the list of symlinks to stdout.
|
||||
#
|
||||
# Example:
|
||||
# rev_lib_symlinks libfoo.so.8.1
|
||||
# output: libfoo.so.8 libfoo.so
|
||||
# (Only if libfoo.so.8 and libfoo.so exists on host system.)
|
||||
rev_lib_symlinks() {
|
||||
[[ ! $1 ]] && return 0
|
||||
|
||||
local fn="$1" orig="$(readlink -f "$1")" links=''
|
||||
|
||||
[[ ${fn} =~ .*\.so\..* ]] || return 1
|
||||
|
||||
until [[ ${fn##*.} == so ]]; do
|
||||
fn="${fn%.*}"
|
||||
[[ -L ${fn} && $(readlink -f "${fn}") == ${orig} ]] && links+=" ${fn}"
|
||||
done
|
||||
|
||||
echo ${links}
|
||||
}
|
||||
|
||||
# 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}
|
||||
local src=$1 dest=${2:-$1} lib reallib symlink
|
||||
[[ -e $initdir$dest ]] && return 0
|
||||
if [[ -L $src ]]; then
|
||||
reallib=$(readlink -f "$src")
|
||||
@@ -192,6 +294,14 @@ inst_library() {
|
||||
else
|
||||
inst_simple "$src" "$dest"
|
||||
fi
|
||||
|
||||
# Create additional symlinks. See rev_symlinks description.
|
||||
for symlink in $(rev_lib_symlinks $src) $(rev_lib_symlinks $reallib); do
|
||||
[[ ! -e $initdir$symlink ]] && {
|
||||
dinfo "Creating extra symlink: $symlink"
|
||||
inst_symlink $symlink
|
||||
}
|
||||
done
|
||||
}
|
||||
|
||||
# find a binary. If we were not passed the full path directly,
|
||||
@@ -215,7 +325,7 @@ inst_binary() {
|
||||
local LDSO NAME IO FILE ADDR I1 n f TLIBDIR
|
||||
[[ -e $initdir$target ]] && return 0
|
||||
# I love bash!
|
||||
ldd $bin 2>/dev/null | while read line; do
|
||||
LC_ALL=C ldd $bin 2>/dev/null | while read line; do
|
||||
[[ $line = 'not a dynamic executable' ]] && return 1
|
||||
if [[ $line =~ not\ found ]]; then
|
||||
derror "Missing a shared library required by $bin."
|
||||
@@ -282,12 +392,14 @@ find_rule() {
|
||||
# udev rules always get installed in the same place, so
|
||||
# create a function to install them to make life simpler.
|
||||
inst_rules() {
|
||||
local target=/etc/udev/rules.d
|
||||
local target=/etc/udev/rules.d rule found
|
||||
|
||||
inst_dir "/lib/udev/rules.d"
|
||||
inst_dir "$target"
|
||||
for rule in "$@"; do
|
||||
rule=$(find_rule "$rule") && \
|
||||
inst_simple "$rule" "$target/${rule##*/}"
|
||||
found=$(find_rule "$rule") && \
|
||||
inst_simple "$found" "$target/${found##*/}" \
|
||||
|| dinfo "Skipping udev rule: $rule"
|
||||
done
|
||||
}
|
||||
|
||||
@@ -348,10 +460,58 @@ dracut_install() {
|
||||
done
|
||||
}
|
||||
|
||||
# install function decompressing the target and handling symlinks
|
||||
# $@ = list of compressed (gz or bz2) files or symlinks pointing to such files
|
||||
#
|
||||
# Function install targets in the same paths inside overlay but decompressed
|
||||
# and without extensions (.gz, .bz2).
|
||||
inst_decompress() {
|
||||
local src dst realsrc realdst cmd
|
||||
|
||||
for src in $@
|
||||
do
|
||||
case ${src} in
|
||||
*.gz) cmd='gzip -d' ;;
|
||||
*.bz2) cmd='bzip2 -d' ;;
|
||||
*) return 1 ;;
|
||||
esac
|
||||
|
||||
if [[ -L ${src} ]]
|
||||
then
|
||||
realsrc="$(readlink -f ${src})" # symlink target with extension
|
||||
dst="${src%.*}" # symlink without extension
|
||||
realdst="${realsrc%.*}" # symlink target without extension
|
||||
mksubdirs "${initdir}/${src}"
|
||||
# Create symlink without extension to target without extension.
|
||||
ln -s "${realdst}" "${initdir}/${dst}"
|
||||
fi
|
||||
|
||||
# If the source is symlink we operate on its target.
|
||||
[[ ${realsrc} ]] && src=${realsrc}
|
||||
inst ${src}
|
||||
# Decompress with chosen tool. We assume that tool changes name e.g.
|
||||
# from 'name.gz' to 'name'.
|
||||
${cmd} "${initdir}${src}"
|
||||
done
|
||||
}
|
||||
|
||||
# It's similar to above, but if file is not compressed, performs standard
|
||||
# install.
|
||||
# $@ = list of files
|
||||
inst_opt_decompress() {
|
||||
local src
|
||||
|
||||
for src in $@
|
||||
do
|
||||
inst_decompress "${src}" || inst "${src}"
|
||||
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
|
||||
strstr " $mods_to_load " " $1 " && return
|
||||
strstr " $omit_dracutmodules " " $1 " && return 1
|
||||
# turn a module name into a directory, if we can.
|
||||
moddir=$(echo ${dracutbasedir}/modules.d/??${1})
|
||||
[[ -d $moddir && -x $moddir/install ]] || return 1
|
||||
@@ -372,35 +532,61 @@ check_module_deps() {
|
||||
|
||||
should_source_module() {
|
||||
local dep
|
||||
local ret
|
||||
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
|
||||
"$1/check" $hostonly || continue
|
||||
for dep in $("$1/check" -d); do
|
||||
check_module_deps "$dep" && continue
|
||||
dwarning "Cannot load $mod, dependencies failed."
|
||||
dwarning "Cannot load dracut module \"$mod\", dependencies failed."
|
||||
return 1
|
||||
done
|
||||
}
|
||||
|
||||
check_modules() {
|
||||
local modcheck;
|
||||
local mod;
|
||||
for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
|
||||
local mod=${moddir##*/}; mod=${mod#[0-9][0-9]}
|
||||
# If we are already scheduled to be loaded, no need to check again.
|
||||
strstr "$mods_to_load" " $mod " && continue
|
||||
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
|
||||
strstr " $omit_dracutmodules " " $mod " && continue
|
||||
|
||||
if ! strstr " $dracutmodules $add_dracutmodules " " $mod "; then
|
||||
# module not in our list
|
||||
if [[ $dracutmodules = all ]]; then
|
||||
# check, if we can install this module
|
||||
should_source_module "$moddir" || continue
|
||||
else
|
||||
# skip this module
|
||||
continue
|
||||
fi
|
||||
else
|
||||
if [ -x "$moddir/check" ] \
|
||||
&& "$moddir/check" -d > /dev/null 2>&1; then
|
||||
check_module_deps "$mod" || {
|
||||
dwarning "Cannot load dracut module \"$mod\", dependencies failed."
|
||||
continue
|
||||
}
|
||||
fi
|
||||
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.
|
||||
@@ -419,7 +605,7 @@ install_kmod_with_fw() {
|
||||
fi
|
||||
done
|
||||
if [[ $found != yes ]]; then
|
||||
dinfo "Possible missing firmware ${fw} for module ${mod}.ko"
|
||||
dinfo "Possible missing firmware \"${fw}\" for kernel module \"${mod}.ko\""
|
||||
fi
|
||||
done
|
||||
}
|
||||
@@ -471,7 +657,7 @@ filter_kernel_modules () (
|
||||
# install kernel modules along with all their dependencies.
|
||||
instmods() {
|
||||
[[ $no_kernel = yes ]] && return
|
||||
local mod mpargs modpath modname cmd
|
||||
local mod mpargs modpath modname cmd moddirname
|
||||
while (($# > 0)); do
|
||||
mod=${1%.ko*}
|
||||
case $mod in
|
||||
@@ -499,14 +685,21 @@ instmods() {
|
||||
[[ -f $initdir/$1 ]] && { shift; continue; }
|
||||
# If we are building a host-specific initramfs and this
|
||||
# module is not already loaded, move on to the next one.
|
||||
[[ $hostonly ]] && ! grep -q "${mod//-/_}" /proc/modules && \
|
||||
[[ $hostonly ]] && ! grep -qe "\<${mod//-/_}\>" /proc/modules && \
|
||||
! echo $add_drivers | grep -qe "\<${mod}\>" && {
|
||||
shift; continue;
|
||||
}
|
||||
|
||||
# We use '-d' option in modprobe only if modules prefix path
|
||||
# differs from default '/'. This allows us to use Dracut with
|
||||
# old version of modprobe which doesn't have '-d' option.
|
||||
moddirname=${srcmods%%/lib/modules/*}
|
||||
[[ -n ${moddirname} ]] && moddirname="-d ${moddirname}/"
|
||||
|
||||
# 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/*}/
|
||||
--set-version $kernel ${moddirname}
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
|
@@ -1,20 +0,0 @@
|
||||
.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)
|
46
dracut-gencmdline.8.xml
Normal file
46
dracut-gencmdline.8.xml
Normal file
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" []>
|
||||
<!-- lifted from troff+man by doclifter -->
|
||||
<refentry id='dracutgencmdline8'>
|
||||
<refmeta>
|
||||
<refentrytitle>DRACUT-GENCMDLINE</refentrytitle>
|
||||
<manvolnum>8</manvolnum>
|
||||
<refmiscinfo class='source'>June 2009</refmiscinfo>
|
||||
<refmiscinfo class='manual'>Linux</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv id='name'>
|
||||
<refname>dracut-gencmdline</refname>
|
||||
<refpurpose>generates kernel command line parameters for the dracut generated initramfs</refpurpose>
|
||||
</refnamediv>
|
||||
<!-- body begins here -->
|
||||
<refsynopsisdiv id='synopsis'>
|
||||
<cmdsynopsis>
|
||||
<command>dracut-gencmdline</command>
|
||||
<sbr/>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
|
||||
<refsect1 id='description'><title>DESCRIPTION</title>
|
||||
<para><command>dracut-gencmdline</command>
|
||||
generates kernel command line parameters for the dracut generated initramfs, which are very specific to the host system.</para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id='authors'><title>AUTHORS</title>
|
||||
<literallayout remap='.nf'>
|
||||
Harald Hoyer <harald@redhat.com>
|
||||
</literallayout> <!-- .fi -->
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id='availability'><title>AVAILABILITY</title>
|
||||
<para>The dracut-gencmdline command is part of the dracut package and is available from
|
||||
<ulink url='http://sourceforge.net/apps/trac/dracut/wiki'>http://sourceforge.net/apps/trac/dracut/wiki</ulink></para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id='see_also'><title>SEE ALSO</title>
|
||||
<para><citerefentry><refentrytitle>dracut</refentrytitle><manvolnum>8</manvolnum></citerefentry></para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
428
dracut.8
428
dracut.8
@@ -1,428 +0,0 @@
|
||||
.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.
|
||||
.BR \-\-add-drivers " \fILIST\fR"
|
||||
specify a space-separated list of kernel modules to add to the initramfs.
|
||||
.TP
|
||||
.BR \-\-filesystems " \fILIST\fR"
|
||||
specify a space-separated list of kernel filesystem modules to exclusively
|
||||
include in the generic initramfs.
|
||||
.TP
|
||||
.BR \-k ", " \-\-kmoddir " \fI{DIR}\fR
|
||||
specify the directory, where to look for kernel modules
|
||||
.TP
|
||||
.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
|
||||
.B rd_NO_FSTAB
|
||||
do not honor special mount options for the root filesystem found in
|
||||
/etc/fstab of the real root.
|
||||
|
||||
.SS Misc
|
||||
.TP
|
||||
.BR rdblacklist= <drivername>
|
||||
do not load kernel module <drivername>
|
||||
.TP
|
||||
.BR rdloaddriver= <drivername>
|
||||
force loading kernel module <drivername>
|
||||
|
||||
.SS Debug
|
||||
.TP
|
||||
.B rdinfo
|
||||
print informational output though "quiet" is set
|
||||
.TP
|
||||
.B rdshell
|
||||
allow dropping to a shell, if root mounting fails
|
||||
.TP
|
||||
.B rdinitdebug
|
||||
set -x for the dracut shell and logs to dmesg, console and /init.log
|
||||
.TP
|
||||
.B rdbreak
|
||||
drop to a shell at the end
|
||||
.TP
|
||||
.ad l
|
||||
.BR rdbreak= \%{cmdline\:|pre-udev\:|pre-trigger\:|initqueue\:|pre-mount\:|mount\:|pre-pivot}
|
||||
.ad
|
||||
drop to a shell on defined breakpoint
|
||||
.TP
|
||||
.B rdudevinfo
|
||||
set udev to loglevel info
|
||||
.TP
|
||||
.B rdudevdebug
|
||||
set udev to loglevel debug
|
||||
.TP
|
||||
.B rdnetdebug
|
||||
debug network scripts in dracut. Output is written to /tmp/
|
||||
|
||||
.SS I18N
|
||||
e.g.
|
||||
LANG=en_US.UTF-8
|
||||
SYSFONT=latarcyrheb-sun16
|
||||
KEYTABLE=de-latin1-nodeadkeys
|
||||
.TP
|
||||
.BR KEYBOARDTYPE= sun|pc
|
||||
will be written to /etc/sysconfig/keyboard in the initramfs
|
||||
.TP
|
||||
.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 volume groups with the given name
|
||||
rd_LVM_LV can be specified multiple times on the kernel command line.
|
||||
.TP
|
||||
.BR rd_NO_LVMCONF
|
||||
remove any /etc/lvm/lvm.conf, which may exist in the initramfs
|
||||
|
||||
.SS "crypto LUKS"
|
||||
.TP
|
||||
.BR rd_NO_LUKS
|
||||
disable crypto LUKS detection
|
||||
.TP
|
||||
.BR rd_LUKS_UUID= "<luks uuid>"
|
||||
only activate the LUKS partitions with the given UUID
|
||||
Any "luks-" of the LUKS UUID is removed before comparing to <luks uuid>.
|
||||
The comparisons also matches, if <luks uuid> is only the beginning of the
|
||||
LUKS UUID, so you don't have to specify the full UUID.
|
||||
.BR rd_NO_CRYPTTAB
|
||||
do not check if LUKS partition is in /etc/crypttab
|
||||
|
||||
.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
|
||||
|
||||
.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
|
||||
|
||||
.SS Network
|
||||
.TP
|
||||
.BR ip= {dhcp|on|any|dhcp6|auto6}
|
||||
dhcp|on|any: get ip from dhcp server from all interfaces. If root=dhcp,
|
||||
loop sequentially through all interfaces (eth0, eth1, ...) and use the first
|
||||
with a valid DHCP root-path.
|
||||
|
||||
auto6: do IPv6 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
|
||||
.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]).
|
||||
.TP
|
||||
.BR ifname= <interface>:<MAC>
|
||||
Assign network device name <interface> (ie eth0) to the NIC with MAC <MAC>.
|
||||
Note letters in the MAC-address must be lowercase!
|
||||
Note that if you use this option you \fBmust\fR specify an ifname= argument
|
||||
for all interfaces used in ip= or fcoe= arguments
|
||||
.TP
|
||||
.BR bootdev= <interface>
|
||||
specify network interface to use routing and netroot information from.
|
||||
Required if multiple ip= lines are used.
|
||||
.TP
|
||||
.BR nameserver= "<IP> [nameserver=<IP> ...]"
|
||||
specify nameserver(s) to use
|
||||
|
||||
.SS NFS
|
||||
.TP
|
||||
.BR root= "[<server-ip>:]<root-dir>[:<nfs-options>]"
|
||||
mount nfs share from <server-ip>:/<root-dir>, if no server-ip is given,
|
||||
use dhcp next_server.
|
||||
NFS options can be appended with the prefix ":" or "," 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>]\::[<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>]\::[<LUN>]\::<targetname>"
|
||||
.ad
|
||||
e.g. root=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0
|
||||
.TP
|
||||
.ad l
|
||||
.BR root= ??? " netroot=" "\%iscsi:[username:password[:reverse:password]@]\:[<servername>]\::[<protocol>]\::[<port>]\::[<LUN>]\::<targetname> ..."
|
||||
.ad
|
||||
multiple netroot options allow setting up multiple iscsi disks
|
||||
.B Not yet implemented!
|
||||
e.g.
|
||||
root=UUID=12424547
|
||||
netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0
|
||||
netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target1
|
||||
|
||||
.TP
|
||||
.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= ??? " iscsi_firmware"
|
||||
will read the iscsi parameter from the BIOS firmware
|
||||
|
||||
.SS FCoE
|
||||
.TP
|
||||
.BR netroot= fcoe:<interface|MAC>:<dcb|nodcb>
|
||||
Try to connect to a FCoE SAN through the NIC specified by <interface> or <MAC>,
|
||||
for the second argument, currently only nodcb is supported. Note letters in
|
||||
the MAC-address must be lowercase!
|
||||
|
||||
.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
|
||||
|
||||
.SS ZFCP
|
||||
.TP
|
||||
.BR rd_ZFCP= "<zfcp adaptor device bus ID>,\:<WWPN>,\:<FCPLUN>"
|
||||
rd_ZFCP can be specified multiple times on the kernel command line.
|
||||
|
||||
example: rd_ZFCP=0.0.4000,0x5005076300C213e9,0x5022000000000000
|
||||
.TP
|
||||
.BR rd_NO_ZFCPCONF
|
||||
ignore zfcp.conf included in the initramfs
|
||||
|
||||
.SS CCW
|
||||
.TP
|
||||
.BR rd_CCW= "<nettype>,<subchannels>,<options>"
|
||||
rd_CCW can be specified multiple times on the kernel command line. Examples:
|
||||
rd_CCW=qeth,0.0.0600,0.0.0601,0.0.0602,layer2=1,portname=foo
|
||||
rd_CCW=ctc,0.0.0600,0.0.0601,0.0.0602,protocol=bar
|
||||
|
||||
.SS "Plymouth Boot Splash"
|
||||
.TP
|
||||
.BR rd_NO_PLYMOUTH
|
||||
do not start plymouth. This will not work with encrypted partitions.
|
||||
|
||||
.SH FILES
|
||||
.TP
|
||||
.B /var/log/dracut.log
|
||||
.TP
|
||||
.B /tmp/dracut.log
|
||||
see \fBdracut.conf\fR(5)
|
||||
.TP
|
||||
.B /etc/dracut.conf
|
||||
.SS "Configuration in the Initramfs"
|
||||
.TP
|
||||
.B /conf/conf.d/
|
||||
Any files found in /conf/conf.d/ will be sourced in the initramfs to
|
||||
set initial values. Command line options will override these values
|
||||
set in the configuration files.
|
||||
.TP
|
||||
.B /etc/cmdline
|
||||
Can contain additional command line options.
|
||||
|
||||
.SH AUTHORS
|
||||
.nf
|
||||
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)
|
447
dracut.8.xml
Normal file
447
dracut.8.xml
Normal file
@@ -0,0 +1,447 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!-- This document was created with Syntext Serna Free. --><!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" []>
|
||||
<refentry>
|
||||
<refentryinfo>
|
||||
<title>dracut</title>
|
||||
<productname>dracut</productname>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<contrib>Project Leader, Developer</contrib>
|
||||
<firstname>Harald</firstname>
|
||||
<surname>Hoyer</surname>
|
||||
<email>harald@redhat.com</email>
|
||||
</author>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
<firstname>Victor</firstname>
|
||||
<surname>Lowther</surname>
|
||||
<email>victor.lowther@gmail.com</email>
|
||||
</author>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
<firstname>Warren</firstname>
|
||||
<surname>Togami</surname>
|
||||
<email>wtogami@redhat.com</email>
|
||||
</author>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
<firstname>Jeremy</firstname>
|
||||
<surname>Katz</surname>
|
||||
<email>katzj@redhat.com</email>
|
||||
</author>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
<firstname>Philippe</firstname>
|
||||
<surname>Seewer</surname>
|
||||
<email>philippe.seewer@bfh.ch</email>
|
||||
</author>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
<firstname>David</firstname>
|
||||
<surname>Dillow</surname>
|
||||
<email>dave@thedillows.org</email>
|
||||
</author>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
<firstname>Amadeusz</firstname>
|
||||
<surname>Żołnowski</surname>
|
||||
<email>aidecoe@aidecoe.name</email>
|
||||
</author>
|
||||
</authorgroup>
|
||||
</refentryinfo>
|
||||
<refmeta>
|
||||
<refentrytitle>dracut</refentrytitle>
|
||||
<manvolnum>8</manvolnum>
|
||||
<refmiscinfo class="version"/>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>dracut</refname>
|
||||
<refpurpose>create initial ramdisk images for preloading modules</refpurpose>
|
||||
</refnamediv>
|
||||
<refsynopsisdiv>
|
||||
<cmdsynopsis>
|
||||
<command>dracut</command>
|
||||
<arg choice="opt" rep="repeat">
|
||||
<replaceable>OPTION</replaceable>
|
||||
</arg>
|
||||
<arg choice="opt">
|
||||
<replaceable><image></replaceable>
|
||||
<arg choice="opt">
|
||||
<replaceable><kernel-version></replaceable>
|
||||
</arg>
|
||||
</arg>
|
||||
<sbr/>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<para><command>dracut</command>
|
||||
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.</para>
|
||||
<para>
|
||||
For a complete list of kernel command line options see
|
||||
<citerefentry>
|
||||
<refentrytitle>dracut.kernel</refentrytitle>
|
||||
<manvolnum>7</manvolnum>
|
||||
</citerefentry>
|
||||
</para>
|
||||
<refsect2>
|
||||
<title>Options</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-f</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--force</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>overwrite existing initramfs file.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-m</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--modules <replaceable><list of dracut modules></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>specify a space-separated list of dracut modules to call
|
||||
when building the initramfs.
|
||||
Modules are located in
|
||||
<filename>/usr/share/dracut/modules.d</filename>. This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-o</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--omit <replaceable><list of dracut modules></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>omit a space-separated list of dracut modules. This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-a</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--add <replaceable><list of dracut modules></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>add a space-separated list of dracut modules to the default set of modules. This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-d</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--drivers <replaceable><list of kernel modules></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>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.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--add-drivers <replaceable><list of kernel modules></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>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.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--filesystems <replaceable><list of filesystems></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>specify a space-separated list of kernel filesystem modules to exclusively
|
||||
include in the generic initramfs. This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-k</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--kmoddir <replaceable><kernel directory></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>specify the directory, where to look for kernel modules</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option> --fwdir <replaceable><dir>[:<dir>...]</replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>specify additional directories, where to look for firmwares. This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--kernel-only</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>only install kernel drivers and firmware files</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--no-kernel</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>do not install kernel drivers and firmware files</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--ignore-kernel-modules</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>don't try to load modules; it automatically implies <option>--no-kernel</option>; it's
|
||||
assumed that everything needed is built into kernel</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--mdadmconf</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>include local /etc/mdadm.conf</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--nomdadmconf</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>do not include local /etc/mdadm.conf</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--strip</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>strip binaries in the initramfs (default)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--nostrip</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>do not strip binaries in the initramfs</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-h</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--help</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>display help text and exit.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--debug</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>output debug information of the build process</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-v</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--verbose</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>verbose output during the build process</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-c</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--conf <replaceable><dracut configuration file></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>specify configuration file to use.
|
||||
Default:
|
||||
<filename>/etc/dracut.conf</filename></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--confdir <replaceable><configuration directory></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>specify configuration directory to use.
|
||||
Default:
|
||||
<filename>/etc/dracut.conf.d</filename></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-l</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--local</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>activates the local mode. Dracut will use modules from the current working
|
||||
directory instead of the system-wide installed modules in
|
||||
<filename>/usr/share/dracut/modules.d</filename>.
|
||||
Thsi is useful when running dracut from a git checkout.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-H</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--hostonly</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Host-Only mode: Install only what is needed for booting
|
||||
the local host instead of a generic host.
|
||||
<warning>
|
||||
<para>If chrooted to another root other than the real root device, use "--fstab" and provide a valid /etc/fstab.</para>
|
||||
</warning>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--fstab</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Use <filename>/etc/fstab</filename> instead of <filename>/proc/self/mountinfo</filename>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-i</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--include <replaceable><source directory></replaceable> <replaceable><target directory></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>include the files in the source directory into the
|
||||
target directory in the final initramfs.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-I</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--install <replaceable><file list></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>install the space separated list of files into the initramfs.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Files</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/var/log/dracut.log</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>logfile of initramfs image creation</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/tmp/dracut.log</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>logfile of initramfs image creation, if <filename>/var/log/dracut.log</filename> is not writable</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/etc/dracut.conf</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>see <citerefentry>
|
||||
<refentrytitle>dracut.conf</refentrytitle>
|
||||
<manvolnum>5</manvolnum>
|
||||
</citerefentry></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/etc/dracut.conf.d/*.conf</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>see <citerefentry>
|
||||
<refentrytitle>dracut.conf</refentrytitle>
|
||||
<manvolnum>5</manvolnum>
|
||||
</citerefentry></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
<refsect2>
|
||||
<title>Configuration in the Initramfs</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/conf/conf.d/</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Any files found in /conf/conf.d/ will be sourced in the initramfs to
|
||||
set initial values. Command line options will override these values
|
||||
set in the configuration files.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/etc/cmdline</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Can contain additional command line options.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Availability</title>
|
||||
<para>The dracut command is part of the dracut package and is available from
|
||||
<ulink url="http://sourceforge.net/apps/trac/dracut/wiki">http://sourceforge.net/apps/trac/dracut/wiki</ulink></para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>See Also</title>
|
||||
<para>
|
||||
<citerefentry>
|
||||
<refentrytitle>dracut.kernel</refentrytitle>
|
||||
<manvolnum>7</manvolnum>
|
||||
</citerefentry>
|
||||
<citerefentry>
|
||||
<refentrytitle>dracut.conf</refentrytitle>
|
||||
<manvolnum>5</manvolnum>
|
||||
</citerefentry>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
10
dracut.conf
10
dracut.conf
@@ -1,19 +1,19 @@
|
||||
# Sample dracut config file
|
||||
|
||||
# Specific list of dracut modules to use
|
||||
#dracutmodules=""
|
||||
#dracutmodules+=""
|
||||
|
||||
# Dracut modules to omit
|
||||
#omit_dracutmodules=""
|
||||
#omit_dracutmodules+=""
|
||||
|
||||
# Dracut modules to add to the default
|
||||
#add_dracutmodules=""
|
||||
#add_dracutmodules+=""
|
||||
|
||||
# additional kernel modules to the default
|
||||
#add_drivers=""
|
||||
#add_drivers+=""
|
||||
|
||||
# list of kernel filesystem modules to be included in the generic initramfs
|
||||
#filesystems=""
|
||||
#filesystems+=""
|
||||
|
||||
# build initrd only to boot current hardware
|
||||
#hostonly="yes"
|
||||
|
@@ -1,66 +0,0 @@
|
||||
.TH DRACUT.CONF 5 "NOV 2009" "Linux"
|
||||
.SH NAME
|
||||
dracut.conf \- configuration file for dracut
|
||||
|
||||
.SH SYNOPSIS
|
||||
\fB/etc/dracut.conf\fR
|
||||
|
||||
.SH DESCRIPTION
|
||||
.B dracut.conf
|
||||
is loaded during the initialisation phase of dracut.
|
||||
Command line parameter will overwrite any values set here.
|
||||
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.BR dracutmodules= \%"[LIST]"
|
||||
Specify a space-separated list of dracut modules to
|
||||
call when building the initramfs. Modules are located
|
||||
in /usr/share/dracut/modules.d.
|
||||
.TP
|
||||
.BR omit_dracutmodules= \%"[LIST]"
|
||||
Omit a space-separated list of dracut modules.
|
||||
.TP
|
||||
.BR add_dracutmodules= \%"[LIST]"
|
||||
Add a space-separated list of dracut modules.
|
||||
.TP
|
||||
.BR drivers= \%"[LIST]"
|
||||
Specify a space-separated list of kernel modules to
|
||||
exclusively include in the initramfs.
|
||||
.TP
|
||||
.BR add_drivers= \%"[LIST]"
|
||||
Specify a space-separated list of kernel
|
||||
modules to add to the initramfs.
|
||||
.TP
|
||||
.BR filesystems= \%"[LIST]"
|
||||
Specify a space-separated list of kernel filesystem
|
||||
modules to exclusively include in the generic
|
||||
initramfs.
|
||||
.TP
|
||||
.BR drivers_dir= \%"<dir>"
|
||||
Specify the directory, where to look for kernel modules
|
||||
.TP
|
||||
.BR fw_dir= \%"<dir>[:<dir>\ ...]"
|
||||
Specify additional directories, where to look for firmwares, separated by :
|
||||
.TP
|
||||
.BR do_strip= \%"yes|no"
|
||||
Strip binaries in the initramfs (default=yes)
|
||||
.TP
|
||||
.BR hostonly= \%"yes|no"
|
||||
Host-Only mode: Install only what is needed for booting
|
||||
the local host instead of a generic host.
|
||||
.TP
|
||||
.BR mdadmconf= \%"yes|no"
|
||||
Include local /etc/mdadm.conf (default=yes)
|
||||
.TP
|
||||
.BR lvmconf= \%"yes|no"
|
||||
Include local /etc/lvm/lvm.conf (default=yes)
|
||||
.TP
|
||||
.BR kernel_only= "yes|no"
|
||||
Only install kernel drivers and firmware files. (default=no)
|
||||
.TP
|
||||
.BR no_kernel= \%"yes|no"
|
||||
Do not install kernel drivers and firmware files (default=no)
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR dracut (8)
|
||||
|
200
dracut.conf.5.xml
Normal file
200
dracut.conf.5.xml
Normal file
@@ -0,0 +1,200 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!-- This document was created with Syntext Serna Free. --><!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" []>
|
||||
<refentry id="dracutconf5">
|
||||
<refentryinfo>
|
||||
<title>dracut.conf</title>
|
||||
<productname>dracut</productname>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
<firstname>Harald</firstname>
|
||||
<surname>Hoyer</surname>
|
||||
<email>harald@redhat.com</email>
|
||||
</author>
|
||||
</authorgroup>
|
||||
</refentryinfo>
|
||||
<refmeta>
|
||||
<refentrytitle>dracut.conf</refentrytitle>
|
||||
<manvolnum>5</manvolnum>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>dracut.conf</refname>
|
||||
<refpurpose>configuration file(s) for dracut</refpurpose>
|
||||
</refnamediv>
|
||||
<refsynopsisdiv>
|
||||
<cmdsynopsis>
|
||||
<command>/etc/dracut.conf</command>
|
||||
<arg choice="plain">
|
||||
<replaceable>/etc/dracut.conf.d/*.conf</replaceable>
|
||||
</arg>
|
||||
<sbr/>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<para><emphasis>dracut.conf</emphasis>
|
||||
is loaded during the initialisation phase of dracut.
|
||||
Command line parameter will overwrite any values set here.
|
||||
<emphasis>dracut.conf.d/*.conf files are read in alphanumerical order and will</emphasis>
|
||||
overwrite 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.</para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>dracutmodules+=" <replaceable><dracut modules></replaceable> "</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Specify a space-separated list of dracut modules to
|
||||
call when building the initramfs. Modules are located
|
||||
in /usr/share/dracut/modules.d.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>omit_dracutmodules+=" <replaceable><dracut modules></replaceable> "</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Omit a space-separated list of dracut modules.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>add_dracutmodules+=" <replaceable><dracut modules></replaceable> "</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Add a space-separated list of dracut modules.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>drivers+=" <replaceable><kernel modules></replaceable> "</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>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.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>add_drivers+=" <replaceable><kernel modules></replaceable> "</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Specify a space-separated list of kernel
|
||||
modules to add to the initramfs.
|
||||
The kernel modules have to be specified without the ".ko" suffix.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>filesystems+=" <replaceable><filesystem names></replaceable> "</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Specify a space-separated list of kernel filesystem
|
||||
modules to exclusively include in the generic
|
||||
initramfs.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>drivers_dir="<replaceable><kernel modules directory></replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Specify the directory, where to look for kernel modules</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>fw_dir+=" :<replaceable><dir></replaceable>[:<replaceable><dir></replaceable> ...] "</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Specify additional directories, where to look for firmwares, separated by :</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>do_strip="<replaceable>{yes|no}</replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Strip binaries in the initramfs (default=yes)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>hostonly="<replaceable>{yes|no}</replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Host-Only mode: Install only what is needed for booting
|
||||
the local host instead of a generic host.
|
||||
<warning><para>If chrooted to another root other than the real root device, use "--fstab" and provide a valid /etc/fstab.</para></warning>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>use_fstab="<replaceable>{yes|no}</replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Use /etc/fstab instead of /proc/self/mountinfo.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>mdadmconf="<replaceable>{yes|no}</replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Include local /etc/mdadm.conf (default=yes)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>lvmconf="<replaceable>{yes|no}</replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Include local /etc/lvm/lvm.conf (default=yes)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>kernel_only="<replaceable>{yes|no}</replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Only install kernel drivers and firmware files. (default=no)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>no_kernel="<replaceable>{yes|no}</replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Do not install kernel drivers and firmware files (default=no)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Files</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/etc/dracut/conf.d/</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Any /etc/dracut/conf.d/*.conf file can overwrite the values in /etc/dracut.conf.
|
||||
The configuration files are read in alphanumerical order.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>See Also</title>
|
||||
<para><citerefentry>
|
||||
<refentrytitle>dracut</refentrytitle>
|
||||
<manvolnum>8</manvolnum>
|
||||
</citerefentry>
|
||||
<citerefentry>
|
||||
<refentrytitle>dracut.kernel</refentrytitle>
|
||||
<manvolnum>7</manvolnum>
|
||||
</citerefentry>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
6
dracut.conf.d/fedora.conf.example
Normal file
6
dracut.conf.d/fedora.conf.example
Normal file
@@ -0,0 +1,6 @@
|
||||
# /etc/dracut.conf.d/redhat.conf
|
||||
# Dracut config file customized for RedHat/Fedora.
|
||||
|
||||
# i18n
|
||||
keyboard_vars="/etc/sysconfig/keyboard:KEYTABLE-KEYMAP"
|
||||
i18n_vars="/etc/sysconfig/i18n:SYSFONT,SYSFONTACM-CONTRANS,UNIMAP"
|
10
dracut.conf.d/gentoo-openrc.conf.example
Normal file
10
dracut.conf.d/gentoo-openrc.conf.example
Normal file
@@ -0,0 +1,10 @@
|
||||
# /etc/dracut.conf.d/gentoo-openrc.conf
|
||||
# Dracut config file customized for Gentoo Base System release 2
|
||||
|
||||
#
|
||||
# Modules
|
||||
#
|
||||
|
||||
# i18n
|
||||
keyboard_vars="/etc/conf.d/keymaps:keymap-KEYMAP,extended_keymaps-EXT_KEYMAPS"
|
||||
i18n_vars="/etc/conf.d/consolefont:consolefont-SYSFONT,consoletranslation-CONTRANS /etc/rc.conf:unicode-UNICODE"
|
10
dracut.conf.d/gentoo.conf.example
Normal file
10
dracut.conf.d/gentoo.conf.example
Normal file
@@ -0,0 +1,10 @@
|
||||
# /etc/dracut.conf.d/gentoo.conf
|
||||
# Dracut config file customized for Gentoo Base System release 1
|
||||
|
||||
#
|
||||
# Modules
|
||||
#
|
||||
|
||||
# i18n
|
||||
keyboard_vars="/etc/conf.d/keymaps:KEYMAP,EXTENDED_KEYMAPS-EXT_KEYMAPS"
|
||||
i18n_vars="/etc/conf.d/consolefont:CONSOLEFONT-SYSFONT,CONSOLETRANSLATION-CONTRANS /etc/rc.conf:UNICODE"
|
790
dracut.kernel.7.xml
Normal file
790
dracut.kernel.7.xml
Normal file
@@ -0,0 +1,790 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!-- This document was created with Syntext Serna Free. --><!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" []>
|
||||
<refentry>
|
||||
<refentryinfo>
|
||||
<title>dracut.kernel</title>
|
||||
<productname>dracut</productname>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
<firstname>Harald</firstname>
|
||||
<surname>Hoyer</surname>
|
||||
<email>harald@redhat.com</email>
|
||||
</author>
|
||||
</authorgroup>
|
||||
</refentryinfo>
|
||||
<refmeta>
|
||||
<refentrytitle>dracut.kernel</refentrytitle>
|
||||
<manvolnum>7</manvolnum>
|
||||
<refmiscinfo class="version"/>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>dracut.kernel</refname>
|
||||
<refpurpose>dracut kernel command line options</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<para>The root filesystem used by the kernel is specified in the boot configuration
|
||||
file, as always. The traditional <emphasis remap="B">root=/dev/hda1</emphasis> style device
|
||||
specification is allowed. If a label is used, as in <emphasis remap="B">root=LABEL=rootPart</emphasis>
|
||||
the initramfs will search all available devices for an ext2 or ext3 filesystem
|
||||
with the appropriate label, and mount that device as the root filesystem.
|
||||
<emphasis remap="B">root=UUID=uuidnumber</emphasis> will mount the partition with that UUID as the
|
||||
root filesystem.</para>
|
||||
<refsect2>
|
||||
<title>Standard</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>init=<replaceable><path to real init></replaceable></envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para> </para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>root=<replaceable><path to blockdevice></replaceable></envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>specify blockdevice to use as root filesystem.
|
||||
e.g.
|
||||
<programlisting>
|
||||
root=/dev/sda1
|
||||
root=/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1
|
||||
</programlisting></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rootfstype=<replaceable><filesystem type></replaceable></envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>"auto" if not specified, e.g. rootfstype=ext3</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rootflags=<replaceable><mount options></replaceable></envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>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.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_NO_FSTAB</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>do not honor special mount options for the root filesystem found in
|
||||
/etc/fstab of the real root.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
<refsect2>
|
||||
<title>Misc</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rdblacklist=<replaceable><drivername></replaceable></envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>do not load kernel module <drivername>
|
||||
This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rdloaddriver=<replaceable><drivername></replaceable></envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>force loading kernel module <drivername>
|
||||
This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
<refsect2>
|
||||
<title>Debug</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rdinfo</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>print informational output though "quiet" is set</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rdshell</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>allow dropping to a shell, if root mounting fails</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rdinitdebug</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>set -x for the dracut shell and logs to dmesg, console and /init.log</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rdbreak</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>drop to a shell at the end</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><envar>rdbreak=</envar>{cmdline|pre-udev|pre-trigger|initqueue|pre-mount|mount|pre-pivot} </term>
|
||||
<listitem>
|
||||
<para>drop to a shell on defined breakpoint</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rdudevinfo</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>set udev to loglevel info</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rdudevdebug</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>set udev to loglevel debug</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
<refsect2>
|
||||
<title>I18N</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>KEYMAP=</envar>
|
||||
<replaceable><keymap base file name></replaceable>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>keyboard translation table loaded by loadkeys; taken from keymaps directory; will be written to /etc/sysconfig/keyboard in the initramfs, e.g.: <programlisting>KEYMAP=de-latin1-nodeadkeys</programlisting></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>EXT_KEYMAPS=</envar>
|
||||
<replaceable><list of keymap base file names></replaceable>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>list of extra keymaps to bo loaded (sep. by space); will be written to /etc/sysconfig/keyboard in the initramfs</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>UNICODE=</envar>
|
||||
<replaceable><1|0></replaceable>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>boolean, indicating UTF-8 mode; will be written to /etc/sysconfig/i18n in the initramfs</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>SYSFONT=</envar>
|
||||
<replaceable><font base file name></replaceable>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>console font; taken from consolefonts directory; will be written to /etc/sysconfig/i18n in the initramfs; e.g.: <programlisting>SYSFONT=LatArCyrHeb-16</programlisting></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>CONTRANS=</envar>
|
||||
<replaceable><console map base file name></replaceable>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>see description of '-m' parameter in setfont manual; taken from consoletrans directory; will be written to /etc/sysconfig/i18n in the initramfs</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>UNIMAP=</envar>
|
||||
<replaceable><unicode table base file name></replaceable>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>see description of '-u' parameter in setfont manual; taken from unimaps directory; will be written to /etc/sysconfig/i18n in the initramfs</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>LANG=</envar>
|
||||
<replaceable><locale></replaceable>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>taken from the environment; if no UNICODE is defined we set its value in basis of LANG value (whether it ends with ".utf8" (or similar) or not); will be written to /etc/sysconfig/i18n in the initramfs; e.g.: <programlisting>LANG=pl_PL.utf8</programlisting></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>LC_ALL=</envar>
|
||||
<replaceable><locale></replaceable>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>taken from the environment; will be written to /etc/sysconfig/i18n in the initramfs</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
<refsect2>
|
||||
<title>LVM</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_NO_LVM</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>disable LVM detection</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_LVM_VG=<replaceable><volume group name></replaceable></envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>only activate the volume groups with the given name
|
||||
rd_LVM_VG can be specified multiple times on the kernel command line.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_LVM_LV=<replaceable><logical volume name></replaceable></envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>only activate the logical volumes with the given name
|
||||
rd_LVM_LV can be specified multiple times on the kernel command line.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_NO_LVMCONF</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>remove any /etc/lvm/lvm.conf, which may exist in the initramfs</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
<refsect2>
|
||||
<title>crypto LUKS</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_NO_LUKS</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>disable crypto LUKS detection</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_LUKS_UUID=<replaceable><luks uuid></replaceable></envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>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.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_NO_CRYPTTAB</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>do not check, if LUKS partition is in /etc/crypttab</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
<refsect2>
|
||||
<title>crypt LUKS - experimental removable keys support</title>
|
||||
<para>works only when plymouth module is not included</para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_LUKS_KEYPATH=</envar>
|
||||
<replaceable><path to keyfile></replaceable>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>path to keyfile inside remove device filesystem</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_LUKS_KEYDEV_UUID=</envar>
|
||||
<replaceable><rem. device uuid></replaceable>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>UUID of removalbe device storing keyfile; UUID doesn't have to be exact just like for rd_LUKS_UUID</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
<refsect2>
|
||||
<title>MD</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_NO_MD</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>disable MD RAID detection</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_NO_MDIMSM</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>no MD RAID for imsm/isw raids, use dmraid instead</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_NO_MDADMCONF</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>ignore mdadm.conf included in initramfs</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_MD_UUID=<replaceable><md uuid></replaceable></envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>only activate the raid sets with the given UUID.
|
||||
This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
<refsect2>
|
||||
<title>DMRAID</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_NO_DM</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>disable DM RAID detection</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_DM_UUID=<replaceable><dmraid uuid></replaceable></envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>only activate the raid sets with the given UUID.
|
||||
This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
<refsect2>
|
||||
<title>Network</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>ip=</envar>
|
||||
<replaceable>{dhcp|on|any|dhcp6|auto6}</replaceable>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>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.</para>
|
||||
<para>auto6: do IPv6 autoconfiguration</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><envar>ip=</envar><replaceable><interface></replaceable>:<replaceable>{dhcp|on|any|dhcp6|auto6}</replaceable></term>
|
||||
<listitem>
|
||||
<para>dhcp|on|any|dhcp6: get ip from dhcp server on a specific interface
|
||||
auto6: do IPv6 autoconfiguration
|
||||
This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><envar>ip=</envar><replaceable><client-IP></replaceable>:<optional>
|
||||
<replaceable><server-id></replaceable>
|
||||
</optional>:<replaceable><gateway-IP></replaceable>:<replaceable><netmask></replaceable>:<replaceable><client_hostname></replaceable>:<replaceable><interface></replaceable>:<replaceable>{none|off}</replaceable></term>
|
||||
<listitem>
|
||||
<para>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.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><envar>ifname=</envar><replaceable><interface></replaceable>:<replaceable><MAC></replaceable></term>
|
||||
<listitem>
|
||||
<para>Assign network device name <interface> (ie eth0) to the NIC with MAC <MAC>.
|
||||
Note letters in the MAC-address must be lowercase!
|
||||
Note that if you use this option you <emphasis remap="B">must</emphasis> specify an ifname= argument
|
||||
for all interfaces used in ip= or fcoe= arguments
|
||||
This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>bootdev=</envar>
|
||||
<replaceable><interface></replaceable>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>specify network interface to use routing and netroot information from.
|
||||
Required if multiple ip= lines are used.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>nameserver=</envar>
|
||||
<replaceable><IP></replaceable>
|
||||
<optional><envar>nameserver</envar>=<replaceable><IP></replaceable> ...</optional>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>specify nameserver(s) to use</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
<refsect2>
|
||||
<title>NFS</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>root=</envar>
|
||||
<optional><replaceable><server-ip></replaceable>:</optional>
|
||||
<replaceable><root-dir></replaceable>
|
||||
<optional>:<replaceable><nfs-options></replaceable></optional>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>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 ",".</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><envar>root=</envar>nfs:<optional><replaceable><server-ip></replaceable>:</optional><replaceable><root-dir></replaceable><optional>:<replaceable><nfs-options></replaceable></optional></term>
|
||||
<term><envar>root=</envar>nfs4:<optional><replaceable><server-ip></replaceable>:</optional><replaceable><root-dir></replaceable><optional>:<replaceable><nfs-options></replaceable></optional></term>
|
||||
<term>
|
||||
<envar>root=</envar>
|
||||
<replaceable>{dhcp|dhcp6}</replaceable>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>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>]</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>root=</envar>
|
||||
<filename>/dev/nfs</filename>
|
||||
<envar> nfsroot=</envar>
|
||||
<optional><replaceable><server-ip></replaceable>:</optional>
|
||||
<replaceable><root-dir></replaceable>
|
||||
<optional>:<replaceable><nfs-options></replaceable></optional>
|
||||
</term>
|
||||
<listitem>
|
||||
<para><emphasis remap="B">Deprecated!</emphasis> kernel Documentation/filesystems/nfsroot.txt defines
|
||||
this method.
|
||||
This is supported by dracut but not recommended.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar remap="B">rd_NFS_DOMAIN=</envar>
|
||||
<replaceable><NFSv4 domain name></replaceable>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Set the NFSv4 domain name. Will overwrite the settings in /etc/idmap.conf.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
<refsect2>
|
||||
<title>iSCSI</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><envar>root=</envar>iscsi:<optional><replaceable><username></replaceable>:<replaceable><password></replaceable><optional>:<replaceable><reverse></replaceable>:<replaceable><password></replaceable></optional>@</optional><optional>
|
||||
<replaceable><servername></replaceable>
|
||||
</optional>:<optional>
|
||||
<replaceable><protocol></replaceable>
|
||||
</optional>:<optional>
|
||||
<replaceable><port></replaceable>
|
||||
</optional>:<optional>
|
||||
<replaceable><LUN></replaceable>
|
||||
</optional>:<replaceable><targetname></replaceable></term>
|
||||
<listitem>
|
||||
<para>protocol defaults to "6", LUN defaults to "0".</para>
|
||||
<para>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.</para>
|
||||
<para><ulink url="http://tools.ietf.org/html/rfc4173">http://tools.ietf.org/html/rfc4173</ulink></para>
|
||||
<para>e.g.
|
||||
<programlisting>
|
||||
root=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0
|
||||
</programlisting>
|
||||
</para>
|
||||
<para>If servername is an IPv6 address, it has to be put in brackets. e.g.
|
||||
<programlisting>
|
||||
root=iscsi:[2001:DB8::1]::::iqn.2009-06.dracut:target0
|
||||
</programlisting></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><envar>root=</envar><replaceable>???</replaceable><envar> netroot=</envar>iscsi:<optional><replaceable><username></replaceable>:<replaceable><password></replaceable><optional>:<replaceable><reverse></replaceable>:<replaceable><password></replaceable></optional>@</optional><optional>
|
||||
<replaceable><servername></replaceable>
|
||||
</optional>:<optional>
|
||||
<replaceable><protocol></replaceable>
|
||||
</optional>:<optional>
|
||||
<replaceable><port></replaceable>
|
||||
</optional>:<optional>
|
||||
<replaceable><LUN></replaceable>
|
||||
</optional>:<replaceable><targetname></replaceable> ...</term>
|
||||
<listitem>
|
||||
<para>multiple netroot options allow setting up multiple iscsi disks. e.g.
|
||||
<programlisting>
|
||||
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
|
||||
</programlisting></para>
|
||||
<para>If servername is an IPv6 address, it has to be put in brackets.
|
||||
e.g.
|
||||
<programlisting>netroot=iscsi:[2001:DB8::1]::::iqn.2009-06.dracut:target0</programlisting></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>root=<replaceable>???</replaceable></envar>
|
||||
<envar> iscsi_initiator=<replaceable><initiator> </replaceable></envar>
|
||||
<envar>iscsi_target_name=<replaceable><target_name> </replaceable></envar>
|
||||
<envar>iscsi_target_ip=<replaceable><target ip> </replaceable></envar>
|
||||
<envar>iscsi_target_port=<replaceable><target port> </replaceable></envar>
|
||||
<envar>iscsi_target_group=<replaceable><target group> </replaceable></envar>
|
||||
<envar>iscsi_username=<replaceable><username> </replaceable></envar>
|
||||
<envar>iscsi_password=<replaceable><password> </replaceable></envar>
|
||||
<envar>iscsi_in_username=<replaceable><in username> </replaceable></envar>
|
||||
<envar>iscsi_in_password=<replaceable><in password> </replaceable></envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>manually specify all iscsistart parameter (see <userinput>iscsistart --help</userinput>)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><envar>root=</envar>???<envar> iscsi_firmware</envar></term>
|
||||
<listitem>
|
||||
<para>will read the iscsi parameter from the BIOS firmware</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
<refsect2>
|
||||
<title>FCoE</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><envar>netroot=</envar>fcoe:<replaceable><interface|MAC></replaceable>:<replaceable>{dcb|nodcb}</replaceable></term>
|
||||
<listitem>
|
||||
<para>Try to connect to a FCoE SAN through the NIC specified by <interface> or <MAC>,
|
||||
for the second argument, currently only nodcb is supported. Note letters in
|
||||
the MAC-address must be lowercase!</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
<refsect2>
|
||||
<title>NBD</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><envar>root=</envar><constant>nbd</constant>:<replaceable><server></replaceable>:<replaceable><port></replaceable><optional>:<replaceable><fstype></replaceable></optional><optional>:<replaceable><mountopts></replaceable></optional></term>
|
||||
<listitem>
|
||||
<para>mount nbd share from <server></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>root=dhcp</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>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.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
<refsect2>
|
||||
<title>DASD</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><envar>rd_DASD_MOD=</envar>....</term>
|
||||
<listitem>
|
||||
<para>same syntax as the kernel module parameter (s390 only)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_DASD=</envar>
|
||||
<replaceable><dasd_adaptor device bus ID></replaceable>
|
||||
<optional>,readonly=<replaceable>X</replaceable></optional>
|
||||
<optional>,use_diag=<replaceable>X</replaceable></optional>
|
||||
<optional>,erplog=<replaceable>X</replaceable></optional>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>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.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
<refsect2>
|
||||
<title>ZFCP</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><envar>rd_ZFCP=</envar><replaceable><zfcp adaptor device bus ID></replaceable>,<replaceable><WWPN></replaceable>,<replaceable><FCPLUN></replaceable></term>
|
||||
<listitem>
|
||||
<para>rd_ZFCP can be specified multiple times on the kernel command line.</para>
|
||||
<para>example: rd_ZFCP=0.0.4000,0x5005076300C213e9,0x5022000000000000</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_NO_ZFCPCONF</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>ignore zfcp.conf included in the initramfs</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
<refsect2>
|
||||
<title>ZNET</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><envar>rd_ZNET=</envar><replaceable><nettype></replaceable>,<replaceable><subchannels></replaceable>,<replaceable><options></replaceable></term>
|
||||
<listitem>
|
||||
<para>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</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
<refsect2>
|
||||
<title>Plymouth Boot Splash</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_NO_PLYMOUTH</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>do not start plymouth. This will not work with encrypted partitions.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Files</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/var/log/dracut.log</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>logfile of initramfs image creation</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/tmp/dracut.log</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>logfile of initramfs image creation, if /var/log/dracut.log is not writable</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/etc/dracut.conf</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>see <citerefentry>
|
||||
<refentrytitle>dracut.conf</refentrytitle>
|
||||
<manvolnum>5</manvolnum>
|
||||
</citerefentry></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/etc/dracut.conf.d/*.conf</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>see <citerefentry>
|
||||
<refentrytitle>dracut.conf</refentrytitle>
|
||||
<manvolnum>5</manvolnum>
|
||||
</citerefentry></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
<refsect2>
|
||||
<title>Configuration in the Initramfs</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/conf/conf.d/</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Any files found in /conf/conf.d/ will be sourced in the initramfs to
|
||||
set initial values. Command line options will override these values
|
||||
set in the configuration files.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/etc/cmdline</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Can contain additional command line options.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>See Also</title>
|
||||
<para>
|
||||
<citerefentry>
|
||||
<refentrytitle>dracut</refentrytitle>
|
||||
<manvolnum>8</manvolnum>
|
||||
</citerefentry>
|
||||
<citerefentry>
|
||||
<refentrytitle>dracut.conf</refentrytitle>
|
||||
<manvolnum>5</manvolnum>
|
||||
</citerefentry>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
159
dracut.spec
159
dracut.spec
@@ -19,7 +19,7 @@
|
||||
%endif
|
||||
|
||||
Name: dracut
|
||||
Version: 005
|
||||
Version: 007
|
||||
Release: 1%{?rdist}
|
||||
Summary: Initramfs generator using udev
|
||||
Group: System Environment/Base
|
||||
@@ -29,6 +29,7 @@ URL: http://apps.sourceforge.net/trac/dracut/wiki
|
||||
# http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=snapshot;h=%{?dashgittag};sf=tgz
|
||||
Source0: dracut-%{version}%{?dashgittag}.tar.bz2
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
BuildRequires: docbook-style-xsl docbook-dtds docbook-style-xsl libxslt
|
||||
|
||||
%if 0%{?fedora} > 12 || 0%{?rhel} >= 6
|
||||
# no "provides", because dracut does not offer
|
||||
@@ -41,36 +42,28 @@ Obsoletes: libbdevid-python <= 6.0.93
|
||||
Obsoletes: dracut-kernel < 005
|
||||
Provides: dracut-kernel = %{version}-%{release}
|
||||
|
||||
Requires: udev
|
||||
Requires: util-linux-ng
|
||||
Requires: module-init-tools >= 3.7-9
|
||||
Requires: cpio
|
||||
Requires: coreutils
|
||||
Requires: findutils
|
||||
Requires: binutils
|
||||
Requires: grep
|
||||
Requires: which
|
||||
Requires: mktemp >= 1.5-5
|
||||
Requires: mount
|
||||
Requires: bash
|
||||
Requires: dash
|
||||
Requires: /bin/sh
|
||||
Requires: fileutils, gzip, tar
|
||||
Requires: lvm2 >= 2.02.33-9, dhclient
|
||||
Requires: filesystem >= 2.1.0, cpio, device-mapper, initscripts >= 8.63-1
|
||||
Requires: e2fsprogs >= 1.38-12, coreutils
|
||||
Requires: mdadm, elfutils-libelf
|
||||
Requires(pre): plymouth >= 0.8.0-0.2009.29.09.19.1
|
||||
Requires: plymouth >= 0.8.0-0.2009.29.09.19.1
|
||||
Requires: cryptsetup-luks
|
||||
Requires: file
|
||||
Requires: bzip2
|
||||
Requires: dmraid
|
||||
Requires: coreutils
|
||||
Requires: cpio
|
||||
Requires: dash
|
||||
Requires: filesystem >= 2.1.0
|
||||
Requires: findutils
|
||||
Requires: grep
|
||||
Requires: gzip
|
||||
Requires: initscripts >= 8.63-1
|
||||
Requires: kbd
|
||||
Requires: plymouth-scripts
|
||||
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: sed
|
||||
Requires: tar
|
||||
Requires: udev
|
||||
Requires: util-linux-ng >= 2.16
|
||||
Requires: which
|
||||
|
||||
%if ! 0%{?with_switch_root}
|
||||
Requires: util-linux-ng >= 2.16
|
||||
BuildArch: noarch
|
||||
%endif
|
||||
|
||||
@@ -86,11 +79,13 @@ Summary: Dracut modules to build a dracut initramfs with network support
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: rpcbind nfs-utils
|
||||
Requires: iscsi-initiator-utils
|
||||
Requires: dhclient
|
||||
%if %{with_nbd}
|
||||
Requires: nbd
|
||||
%endif
|
||||
Requires: net-tools iproute
|
||||
Requires: bridge-utils
|
||||
Requires: vconfig
|
||||
|
||||
%description network
|
||||
This package requires everything which is needed to build a generic
|
||||
@@ -124,9 +119,10 @@ all purpose initramfs with dracut.
|
||||
%package tools
|
||||
Summary: Dracut tools to build the local initramfs
|
||||
Requires: coreutils cryptsetup-luks device-mapper
|
||||
Requires: diffutils dmraid findutils gawk grep lvm2
|
||||
Requires: diffutils dmraid findutils grep lvm2 gawk
|
||||
Requires: module-init-tools sed
|
||||
Requires: cpio gzip
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
|
||||
%description tools
|
||||
This package contains tools to assemble the local initrd and host configuration.
|
||||
@@ -144,11 +140,14 @@ make install DESTDIR=$RPM_BUILD_ROOT sbindir=/sbin \
|
||||
|
||||
echo %{name}-%{version}-%{release} > $RPM_BUILD_ROOT/%{_datadir}/dracut/modules.d/10rpmversion/dracut-version
|
||||
rm $RPM_BUILD_ROOT/%{_datadir}/dracut/modules.d/01fips/check
|
||||
# remove gentoo specific modules
|
||||
rm -fr $RPM_BUILD_ROOT/%{_datadir}/dracut/modules.d/50gensplash
|
||||
|
||||
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
|
||||
install -m 0644 dracut.conf.d/fedora.conf.example $RPM_BUILD_ROOT/etc/dracut.conf.d/fedora.conf
|
||||
|
||||
%if 0%{?fedora} <= 12 && 0%{?rhel} < 6
|
||||
rm $RPM_BUILD_ROOT/sbin/mkinitrd
|
||||
@@ -172,14 +171,18 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%dir %{_datadir}/dracut
|
||||
%{_datadir}/dracut/dracut-functions
|
||||
%config(noreplace) /etc/dracut.conf
|
||||
%config(noreplace) /etc/dracut.conf.d/fedora.conf
|
||||
%dir /etc/dracut.conf.d
|
||||
%{_mandir}/man8/dracut.8*
|
||||
%{_mandir}/man7/dracut.kernel.7*
|
||||
%{_mandir}/man5/dracut.conf.5*
|
||||
%{_datadir}/dracut/modules.d/00bootchart
|
||||
%{_datadir}/dracut/modules.d/00dash
|
||||
%{_datadir}/dracut/modules.d/10redhat-i18n
|
||||
%{_datadir}/dracut/modules.d/10i18n
|
||||
%{_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
|
||||
@@ -194,10 +197,10 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{_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/98selinux
|
||||
%{_datadir}/dracut/modules.d/98syslog
|
||||
%{_datadir}/dracut/modules.d/99base
|
||||
# logfile needs no logrotate, because it gets overwritten
|
||||
@@ -206,17 +209,16 @@ rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%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
|
||||
%{_datadir}/dracut/modules.d/95znet
|
||||
|
||||
%files fips
|
||||
%defattr(-,root,root,0755)
|
||||
%doc COPYING
|
||||
%{_datadir}/dracut/modules.d/01fips
|
||||
|
||||
%files generic
|
||||
@@ -225,7 +227,6 @@ rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files tools
|
||||
%defattr(-,root,root,0755)
|
||||
%doc COPYING NEWS
|
||||
%{_mandir}/man8/dracut-gencmdline.8*
|
||||
%{_mandir}/man8/dracut-catimages.8*
|
||||
/sbin/dracut-gencmdline
|
||||
@@ -235,6 +236,100 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%dir /var/lib/dracut/overlay
|
||||
|
||||
%changelog
|
||||
* Thu Jun 17 2010 Harald Hoyer <harald@redhat.com> 006-1
|
||||
- version 006
|
||||
|
||||
* Fri Jun 11 2010 Harald Hoyer <harald@redhat.com>
|
||||
- Remove requirements, which are not really needed
|
||||
Resolves: rhbz#598509
|
||||
- fixed copy of network config to /dev/.initramfs/ (patch 146)
|
||||
Resolves: rhbz#594649
|
||||
- more password beauty (patch 142)
|
||||
Resolves: rhbz#561092
|
||||
- support multiple iSCSI disks (patch 143)
|
||||
Resolves: rbhz#580190
|
||||
- fixed selinux=0 (patch 130)
|
||||
Resolves: rhbz#593080
|
||||
- add support for booting LVM snapshot root volume (patch 145)
|
||||
Resolves: rbhz#602723
|
||||
- remove hardware field from BOOTIF= (patch 148)
|
||||
Resolves: rhbz#599593
|
||||
- add aes kernel modules and fix crypt handling (patch 137, patch 140 and patch 147)
|
||||
Resolves: rhbz#600170
|
||||
|
||||
* Thu May 27 2010 Harald Hoyer <harald@redhat.com>
|
||||
- fixed Requirements
|
||||
- fixed autoip6
|
||||
Resolves: rhbz#538388
|
||||
- fixed multipath
|
||||
Resolves: rhbz#595719
|
||||
|
||||
* Thu May 06 2010 Harald Hoyer <harald@redhat.com>
|
||||
- only display short password messages
|
||||
Resolves: rhbz#561092
|
||||
|
||||
* Thu May 06 2010 Harald Hoyer <harald@redhat.com>
|
||||
- fixed dracut manpages
|
||||
Resolves: rhbz#589109
|
||||
- use ccw-init and ccw rules from s390utils
|
||||
Resolves: rhbz#533494
|
||||
- fixed fcoe
|
||||
Resolves: rhbz#486244
|
||||
- various other bugfixes seen in Fedora
|
||||
|
||||
* Tue Apr 20 2010 Harald Hoyer <harald@redhat.com>
|
||||
- fixed network with multiple nics
|
||||
- fixed nfsidmap paths
|
||||
- do not run blkid on non active container raids
|
||||
- fixed cdrom polling mechanism
|
||||
- update to latest git
|
||||
|
||||
* Thu Apr 15 2010 Harald Hoyer <harald@redhat.com>
|
||||
- fixed dracut manpages
|
||||
- dmraid parse different error messages
|
||||
- add cdrom polling mechanism for slow cdroms
|
||||
- add module btrfs
|
||||
- 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
|
||||
|
||||
* Thu Mar 25 2010 Harald Hoyer <harald@redhat.com>
|
||||
- removed firmware requirements (rhbz#572634)
|
||||
- add /etc/dracut.conf.d
|
||||
- Resolves: rhbz#572634
|
||||
|
||||
* Fri Mar 19 2010 Harald Hoyer <harald@redhat.com>
|
||||
- version 005
|
||||
|
||||
* Fri Mar 19 2010 Harald Hoyer <harald@redhat.com>
|
||||
- fixed rpmlint errors (rhbz#570547)
|
||||
- removed firmware package from dracut-kernel (rhbz#572634)
|
||||
- add dcb support to dracut's FCoE support (rhbz#563794)
|
||||
- force install some modules in hostonly mode (rhbz#573094)
|
||||
- various other bugfixes
|
||||
- Resolves: rhbz#570547, rhbz#572634, rhbz#563794, rhbz#573094
|
||||
|
||||
* Thu Feb 18 2010 Harald Hoyer <harald@redhat.com> 004-15
|
||||
- fixed "selinux=0" booting (rhbz#566376)
|
||||
- fixed internal IFS handling
|
||||
- Resolves: rhbz#566376
|
||||
|
||||
* Fri Jan 29 2010 Harald Hoyer <harald@redhat.com> 004-5
|
||||
- fixed firmware.sh bug (#559975 #559597)
|
||||
|
||||
* Tue Jan 26 2010 Harald Hoyer <harald@redhat.com> 004-4
|
||||
- add multipath check
|
||||
|
||||
* Tue Jan 26 2010 Harald Hoyer <harald@redhat.com> 004-3
|
||||
- fix selinux handling if .autorelabel is present
|
||||
- Resolves: rhbz#557744
|
||||
|
||||
* Wed Jan 20 2010 Harald Hoyer <harald@redhat.com> 004-2
|
||||
- fix emergency_shell argument parsing
|
||||
- Related: rhbz#543948
|
||||
|
||||
* Fri Jan 15 2010 Harald Hoyer <harald@redhat.com> 004-1
|
||||
- version 004
|
||||
- Resolves: rhbz#529339 rhbz#533494 rhbz#548550
|
||||
|
5
modules.d/00bootchart/check
Normal file
5
modules.d/00bootchart/check
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
[ -x /sbin/bootchartd ] || exit 1
|
||||
|
||||
# do not enable bootchartd by default
|
||||
exit 255
|
15
modules.d/00bootchart/install
Normal file
15
modules.d/00bootchart/install
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
inst /sbin/bootchartd
|
||||
inst /bin/bash
|
||||
ln -s /init "${initdir}/sbin/init"
|
||||
mkdir -p /lib/bootchart/
|
||||
inst /lib/bootchart/bootchart-collector
|
||||
inst /etc/bootchartd.conf
|
||||
inst /sbin/accton
|
||||
inst /usr/bin/pkill /bin/pkill
|
||||
inst /bin/echo
|
||||
inst /bin/grep
|
||||
inst /bin/usleep
|
||||
inst /usr/bin/[ /bin/[
|
||||
mknod -m 0666 "${initdir}/dev/null" c 1 3
|
@@ -1,19 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
. $dracutfunctions
|
||||
|
||||
for program in ip arping; do
|
||||
which $program >/dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
dwarning "Could not find program \"$program\" required by network."
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
for program in dhclient brctl; do
|
||||
which $program >/dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
dwarning "Could not find program \"$program\" it might be required by network."
|
||||
fi
|
||||
done
|
||||
[[ $1 = -d ]] && exit 0
|
||||
exit 255
|
||||
|
||||
|
@@ -4,7 +4,7 @@ do_fips()
|
||||
FIPSMODULES=$(cat /etc/fipsmodules)
|
||||
BOOT=$(getarg boot=)
|
||||
KERNEL=$(uname -r)
|
||||
udevadm trigger >/dev/null 2>&1
|
||||
udevadm trigger --action=add >/dev/null 2>&1
|
||||
case "$boot" in
|
||||
block:LABEL=*|LABEL=*)
|
||||
boot="${boot#block:}"
|
||||
|
2
modules.d/10i18n/10-console.rules
Normal file
2
modules.d/10i18n/10-console.rules
Normal file
@@ -0,0 +1,2 @@
|
||||
# Console initialization - keyboard, font, etc.
|
||||
KERNEL=="tty0", RUN+="/lib/udev/console_init %k"
|
124
modules.d/10i18n/README
Normal file
124
modules.d/10i18n/README
Normal file
@@ -0,0 +1,124 @@
|
||||
Dracut i18n module
|
||||
------------------
|
||||
|
||||
INDEX
|
||||
|
||||
0. Introduction
|
||||
1. Hostonly vs Generic
|
||||
2. Configuration
|
||||
2.1. Variables
|
||||
2.2. Setting up mappings
|
||||
2.3. Additional settings
|
||||
3. Kernel parameters
|
||||
|
||||
~
|
||||
|
||||
0. Introduction
|
||||
|
||||
i18n module provides internationalization for initramfs at runtime. It
|
||||
is intended to be generic across different GNU/Linux distributions.
|
||||
|
||||
i18n and keyboard settings are stored in different files among
|
||||
distributions. To deal with it avoiding hardcoding those differences in
|
||||
the installation script we handle it by mappings between variables used
|
||||
by Dracut and the ones in the system. Package maintainer is expected to
|
||||
create those for his/her distribution and it's appreciated to share it
|
||||
with us, so we can include it in source package.
|
||||
|
||||
|
||||
1. Hostonly vs Generic
|
||||
|
||||
If you invoke dracut with '-H' option, i18n module install script will
|
||||
gather variables values from your configuration files using mappings
|
||||
provided in "/etc/dracut.conf.d/<foo>.conf". Those variables will be
|
||||
put in "etc/sysconfig/{i18n,keyboard}" files inside initramfs image.
|
||||
Next it will install only declared font, keymaps and so.
|
||||
|
||||
When building generic image (dracut without '-H' option), install script
|
||||
copies all content of directories: consolefonts, consoletrans, unimaps
|
||||
and keymaps to image. Take into account that's about 4 MiB.
|
||||
|
||||
|
||||
2. Configuration
|
||||
|
||||
2.1. Variables
|
||||
|
||||
The following variables are used by i18n install script and at initramfs
|
||||
runtime:
|
||||
|
||||
KEYMAP - keyboard translation table loaded by loadkeys
|
||||
EXT_KEYMAPS - list of extra keymaps to bo loaded (sep. by space)
|
||||
UNICODE - boolean, indicating UTF-8 mode
|
||||
SYSFONT - console font
|
||||
CONTRANS - see description of '-m' parameter in setfont manual
|
||||
UNIMAP - see description of '-u' parameter in setfont manual
|
||||
|
||||
The following are appended to EXT_KEYMAPS only during build time:
|
||||
|
||||
UNIKEYMAP
|
||||
GRP_TOGGLE
|
||||
|
||||
They were used in 10redhat-i18n module, but not sure of its purpose.
|
||||
I'm leaving it in case... The following are taken from the environment:
|
||||
|
||||
LANG
|
||||
LC_ALL
|
||||
|
||||
If UNICODE variable is not provided, script indicates if UTF-8 should be
|
||||
used on the basis of LANG value (if it ends with ".utf8" or similar).
|
||||
|
||||
|
||||
2.2. Setting up mappings
|
||||
|
||||
Mappings between variables listed in 2.1. and the ones spread around
|
||||
your system are set up in /etc/dracut.conf.d/<foo>.conf. You need to
|
||||
assign mappings to fields keyboard_vars and i18n_vars. Here's an
|
||||
example:
|
||||
|
||||
keyboard_vars="/etc/conf.d/keymaps:KEYMAP,EXTENDED_KEYMAPS-EXT_KEYMAPS"
|
||||
i18n_vars="/etc/conf.d/consolefont:CONSOLEFONT-SYSFONT,CONSOLETRANSLATION-CONTRANS /etc/rc.conf:UNICODE"
|
||||
|
||||
First we've got name of file in host file system tree. After colon
|
||||
there's mapping: <from>-<to>. If both variables have the same name you
|
||||
can enter just a single, but it's important to specify it! The module
|
||||
will source only variables you've listed.
|
||||
|
||||
Below there's detailed description in BNF:
|
||||
|
||||
<list> ::= <element> | <element> " " <list>
|
||||
<element> ::= <conf-file-name> ":" <map-list>
|
||||
<map-list> ::= <mapping> | <mapping> "," <map-list>
|
||||
<mapping> ::= <src-var> "-" <dst-var> | <src-var>
|
||||
|
||||
We assume no whitespace are allowed between symbols.
|
||||
<conf-file-name> is a file holding <src-var> in your system.
|
||||
<src-var> is a variable holding value of meaning the same as <dst-var>.
|
||||
<dst-var> is a variable which will be set up inside initramfs.
|
||||
If <dst-var> has the same name as <src-var> we can omit <dst-var>.
|
||||
|
||||
Example:
|
||||
/etc/conf.d/keymaps:KEYMAP,extended_keymaps-EXT_KEYMAPS
|
||||
<list> = /etc/conf.d/keymaps:KEYMAP,extended_keymaps-EXT_KEYMAPS
|
||||
<element> = /etc/conf.d/keymaps:KEYMAP,extended_keymaps-EXT_KEYMAPS
|
||||
<conf-file-name> = /etc/conf.d/keymaps
|
||||
<map-list> = KEYMAP,extended_keymaps-EXT_KEYMAPS
|
||||
<mapping> = KEYMAP
|
||||
<src-var> = KEYMAP
|
||||
<mapping> = extended_keymaps-EXT_KEYMAPS
|
||||
<src-var> = extended_keymaps
|
||||
<dst-var> = EXT_KEYMAPS
|
||||
|
||||
|
||||
2.3. Additional settings
|
||||
|
||||
If you encounter following error message: "Directories consolefonts,
|
||||
consoletrans, keymaps, unimaps not found.", you can provide path where
|
||||
those directories lie in your system by setting kbddir in configuration
|
||||
file (the same where you put mappings).
|
||||
|
||||
|
||||
3. Kernel parameters
|
||||
|
||||
If you create generic initramfs you can set up i18n by kernel
|
||||
parameters using variables listed in 2.1. (except of UNIKEYMAP
|
||||
and GRP_TOGGLE) The recommended minimum is: SYSFONT, KEYMAP and UNICODE.
|
3
modules.d/10i18n/check
Executable file
3
modules.d/10i18n/check
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
exit 0
|
91
modules.d/10i18n/console_init
Executable file
91
modules.d/10i18n/console_init
Executable file
@@ -0,0 +1,91 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ -e /etc/sysconfig/i18n ] && . /etc/sysconfig/i18n
|
||||
[ -e /etc/sysconfig/keyboard ] && . /etc/sysconfig/keyboard
|
||||
|
||||
DEFAULT_SYSFONT=LatArCyrHeb-16
|
||||
DEFAULT_KEYMAP=/etc/sysconfig/console/default.kmap
|
||||
|
||||
|
||||
set_keyboard() {
|
||||
local param
|
||||
|
||||
[ "${UNICODE}" = 1 ] && param=-u || param=-a
|
||||
kbd_mode ${param}
|
||||
}
|
||||
|
||||
set_terminal() {
|
||||
local dev=$1
|
||||
|
||||
if [ "${UNICODE}" = 1 ]; then
|
||||
printf '\033%%G' >&7
|
||||
stty -F ${dev} iutf8
|
||||
else
|
||||
printf '\033%%@' >&7
|
||||
fi
|
||||
}
|
||||
|
||||
set_keymap() {
|
||||
local utf_switch
|
||||
|
||||
if [ -z "${KEYMAP}" ]; then
|
||||
[ -f "${DEFAULT_KEYMAP}" ] && KEYMAP=${DEFAULT_KEYMAP}
|
||||
fi
|
||||
|
||||
[ -n "${KEYMAP}" ] || return 1
|
||||
|
||||
[ "${UNICODE}" = 1 ] && utf_switch=-u
|
||||
|
||||
loadkeys -q ${utf_switch} ${KEYMAP} ${EXT_KEYMAPS}
|
||||
}
|
||||
|
||||
set_font() {
|
||||
local dev=$1; local trans=''; local uni=''
|
||||
|
||||
[ -z "${SYSFONT}" ] && SYSFONT=${DEFAULT_SYSFONT}
|
||||
[ -n "${CONTRANS}" ] && trans="-m ${CONTRANS}"
|
||||
[ -n "${UNIMAP}" ] && uni="-u ${UNIMAP}"
|
||||
|
||||
setfont ${SYSFONT} -C ${dev} ${trans} ${uni}
|
||||
}
|
||||
|
||||
dev_close() {
|
||||
exec 6>&-
|
||||
exec 7>&-
|
||||
}
|
||||
|
||||
dev_open() {
|
||||
local dev=$1
|
||||
|
||||
exec 6<${dev} && \
|
||||
exec 7>>${dev}
|
||||
}
|
||||
|
||||
|
||||
dev=/dev/${1#/dev/}
|
||||
devname=${dev#/dev/}
|
||||
|
||||
[ -c "${dev}" ] || {
|
||||
echo "Usage: $0 device" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
[ -e /tmp/console_init.${devname} ] && exit 0
|
||||
|
||||
dev_open ${dev}
|
||||
|
||||
for fd in 6 7; do
|
||||
if ! [ -t ${fd} ]; then
|
||||
echo "ERROR: File descriptor not opened: ${fd}" >&2
|
||||
dev_close
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
set_keyboard
|
||||
set_terminal ${dev}
|
||||
set_font ${dev}
|
||||
set_keymap
|
||||
|
||||
dev_close
|
||||
>/tmp/console_init.${devname}
|
195
modules.d/10i18n/install
Executable file
195
modules.d/10i18n/install
Executable file
@@ -0,0 +1,195 @@
|
||||
#!/bin/bash
|
||||
|
||||
KBDSUBDIRS=consolefonts,consoletrans,keymaps,unimaps
|
||||
DEFAULT_SYSFONT=LatArCyrHeb-16
|
||||
I18N_CONF="${initdir}/etc/sysconfig/i18n"
|
||||
KEYBOARD_CONF="${initdir}/etc/sysconfig/keyboard"
|
||||
|
||||
|
||||
# This is from 10redhat-i18n.
|
||||
findkeymap () {
|
||||
local MAP=$1
|
||||
[[ ! -f $MAP ]] && \
|
||||
MAP=$(find ${kbddir}/keymaps -type f -name $MAP -o -name $MAP.\* | head -n1)
|
||||
[[ " $KEYMAPS " = *" $MAP "* ]] && return
|
||||
KEYMAPS="$KEYMAPS $MAP"
|
||||
case $MAP in
|
||||
*.gz) cmd=zgrep;;
|
||||
*.bz2) cmd=bzgrep;;
|
||||
*) cmd=grep ;;
|
||||
esac
|
||||
|
||||
for INCL in $($cmd "^include " $MAP | cut -d' ' -f2 | tr -d '"'); do
|
||||
for FN in $(find ${kbddir}/keymaps -type f -name $INCL\*); do
|
||||
findkeymap $FN
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
# Function gathers variables from distributed files among the tree, maps to
|
||||
# specified names and prints the result in format "new-name=value".
|
||||
#
|
||||
# $@ = list in format specified below (BNF notation)
|
||||
#
|
||||
# <list> ::= <element> | <element> " " <list>
|
||||
# <element> ::= <conf-file-name> ":" <map-list>
|
||||
# <map-list> ::= <mapping> | <mapping> "," <map-list>
|
||||
# <mapping> ::= <src-var> "-" <dst-var> | <src-var>
|
||||
#
|
||||
# We assume no whitespace are allowed between symbols.
|
||||
# <conf-file-name> is a file holding <src-var> in your system.
|
||||
# <src-var> is a variable holding value of meaning the same as <dst-var>.
|
||||
# <dst-var> is a variable which will be set up inside initramfs.
|
||||
# If <dst-var> has the same name as <src-var> we can omit <dst-var>.
|
||||
#
|
||||
# Example:
|
||||
# /etc/conf.d/keymaps:KEYMAP,extended_keymaps-EXT_KEYMAPS
|
||||
# <list> = /etc/conf.d/keymaps:KEYMAP,extended_keymaps-EXT_KEYMAPS
|
||||
# <element> = /etc/conf.d/keymaps:KEYMAP,extended_keymaps-EXT_KEYMAPS
|
||||
# <conf-file-name> = /etc/conf.d/keymaps
|
||||
# <map-list> = KEYMAP,extended_keymaps-EXT_KEYMAPS
|
||||
# <mapping> = KEYMAP
|
||||
# <src-var> = KEYMAP
|
||||
# <mapping> = extended_keymaps-EXT_KEYMAPS
|
||||
# <src-var> = extended_keymaps
|
||||
# <dst-var> = EXT_KEYMAPS
|
||||
gather_vars() {
|
||||
local item map value
|
||||
|
||||
for item in $@
|
||||
do
|
||||
item=(${item/:/ })
|
||||
for map in ${item[1]//,/ }
|
||||
do
|
||||
map=(${map//-/ })
|
||||
value=$(grep "^${map[0]}=" "${item[0]}")
|
||||
value=${value#*=}
|
||||
echo "${map[1]:-${map[0]}}=${value}"
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
install_base() {
|
||||
dracut_install setfont loadkeys kbd_mode stty
|
||||
inst ${moddir}/console_init /lib/udev/console_init
|
||||
inst_rules ${moddir}/10-console.rules
|
||||
inst_hook cmdline 20 "${moddir}/parse-i18n.sh"
|
||||
}
|
||||
|
||||
install_all_kbd() {
|
||||
local rel f
|
||||
|
||||
for f in $(eval find ${kbddir}/{${KBDSUBDIRS}} -type f -print)
|
||||
do
|
||||
inst $f
|
||||
done
|
||||
|
||||
# remove unnecessary files
|
||||
rm -f "${initdir}${kbddir}/consoletrans/utflist"
|
||||
find "${initdir}${kbddir}/" -name README\* -delete
|
||||
|
||||
dracut_install gzip bzip2
|
||||
}
|
||||
|
||||
install_local_keyboard() {
|
||||
local map
|
||||
|
||||
eval $(gather_vars ${keyboard_vars})
|
||||
|
||||
# Gentoo user may have KEYMAP set to something like "-u pl2",
|
||||
KEYMAP=${KEYMAP#-* }
|
||||
# I'm not sure of the purpose of UNIKEYMAP and GRP_TOGGLE. They were in
|
||||
# original redhat-i18n module. Anyway it won't hurt.
|
||||
EXT_KEYMAPS+=\ ${UNIKEYMAP}\ ${GRP_TOGGLE}
|
||||
|
||||
[[ ${KEYMAP} ]] || derror 'No KEYMAP.' || return 1
|
||||
findkeymap ${KEYMAP}
|
||||
|
||||
for map in ${EXT_KEYMAPS}
|
||||
do
|
||||
dinfo "Adding extra map: ${map}"
|
||||
findkeymap ${map}
|
||||
done
|
||||
|
||||
inst_opt_decompress ${KEYMAPS}
|
||||
|
||||
mksubdirs ${KEYBOARD_CONF}
|
||||
print_vars KEYMAP EXT_KEYMAPS >> ${KEYBOARD_CONF}
|
||||
}
|
||||
|
||||
install_local_i18n() {
|
||||
eval $(gather_vars ${i18n_vars})
|
||||
|
||||
[[ ${SYSFONT} ]] || SYSFONT=${DEFAULT_SYSFONT}
|
||||
SYSFONT=${SYSFONT%.psf*}
|
||||
inst_opt_decompress ${kbddir}/consolefonts/${SYSFONT}.*
|
||||
|
||||
if [[ ${CONTRANS} ]]
|
||||
then
|
||||
CONTRANS=${CONTRANS%.trans}
|
||||
inst ${kbddir}/consoletrans/${CONTRANS}.trans
|
||||
fi
|
||||
|
||||
if [[ ${UNIMAP} ]]
|
||||
then
|
||||
UNIMAP=${UNIMAP%.uni}
|
||||
inst ${kbddir}/unimaps/${UNIMAP}.uni
|
||||
fi
|
||||
|
||||
if [[ ${UNICODE} ]]
|
||||
then
|
||||
if [[ ${UNICODE^^} = YES || ${UNICODE} = 1 ]]
|
||||
then
|
||||
UNICODE=1
|
||||
elif [[ ${UNICODE^^} = NO || ${UNICODE} = 0 ]]
|
||||
then
|
||||
UNICODE=0
|
||||
else
|
||||
UNICODE=''
|
||||
fi
|
||||
fi
|
||||
if [[ ! ${UNICODE} && ${LANG^^} =~ .*\.UTF-?8 ]]
|
||||
then
|
||||
UNICODE=1
|
||||
fi
|
||||
|
||||
mksubdirs ${I18N_CONF}
|
||||
print_vars LC_ALL LANG UNICODE SYSFONT CONTRANS UNIMAP >> ${I18N_CONF}
|
||||
}
|
||||
|
||||
checks() {
|
||||
for kbddir in ${kbddir} /usr/lib/kbd /lib/kbd /usr/share
|
||||
do
|
||||
[[ -d "${kbddir}" ]] && \
|
||||
for dir in ${KBDSUBDIRS//,/ }
|
||||
do
|
||||
[[ -d "${kbddir}/${dir}" ]] && continue
|
||||
false
|
||||
done && break
|
||||
kbddir=''
|
||||
done
|
||||
|
||||
[[ ${kbddir} ]] || {
|
||||
derror "Directories ${KBDSUBDIRS//,/, } not found. Please inform us about the issue including your OS name and version."
|
||||
return 1
|
||||
}
|
||||
|
||||
[[ ! ${hostonly} || ${keyboard_vars} && ${i18n_vars} ]] || {
|
||||
derror 'Please set up keyboard_vars and i18n_vars in configuration file.'
|
||||
return 1
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if checks
|
||||
then
|
||||
install_base
|
||||
|
||||
if [[ ${hostonly} ]]
|
||||
then
|
||||
install_local_keyboard
|
||||
install_local_i18n
|
||||
else
|
||||
install_all_kbd
|
||||
fi
|
||||
fi
|
24
modules.d/10i18n/parse-i18n.sh
Executable file
24
modules.d/10i18n/parse-i18n.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
|
||||
inst_key_val() {
|
||||
local value
|
||||
value=$(getarg $1)
|
||||
[ -n "${value}" ] && printf '%s="%s"\n' $1 ${value} >> $2
|
||||
}
|
||||
|
||||
|
||||
mkdir -p /etc/sysconfig
|
||||
inst_key_val KEYMAP /etc/sysconfig/keyboard
|
||||
inst_key_val EXT_KEYMAPS /etc/sysconfig/keyboard
|
||||
inst_key_val UNICODE /etc/sysconfig/i18n
|
||||
inst_key_val SYSFONT /etc/sysconfig/i18n
|
||||
inst_key_val CONTRANS /etc/sysconfig/i18n
|
||||
inst_key_val UNIMAP /etc/sysconfig/i18n
|
||||
inst_key_val LANG /etc/sysconfig/i18n
|
||||
inst_key_val LC_ALL /etc/sysconfig/i18n
|
||||
|
||||
if [ -f /etc/sysconfig/i18n ]; then
|
||||
. /etc/sysconfig/i18n
|
||||
export LANG
|
||||
export LC_ALL
|
||||
fi
|
@@ -1,2 +0,0 @@
|
||||
#!/bin/sh
|
||||
[ -f /etc/redhat-release ]
|
@@ -1,100 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
findkeymap () {
|
||||
local MAP=$1
|
||||
[[ ! -f $MAP ]] && \
|
||||
MAP=$(find ${kbddir}/keymaps -type f -name $MAP -o -name $MAP.\* | head -n1)
|
||||
[[ " $KEYMAPS " = *" $MAP "* ]] && return
|
||||
KEYMAPS="$KEYMAPS $MAP"
|
||||
case $MAP in
|
||||
*.gz) cmd=zgrep;;
|
||||
*.bz2) cmd=bzgrep;;
|
||||
*) cmd=grep ;;
|
||||
esac
|
||||
|
||||
for INCL in $($cmd "^include " $MAP | cut -d' ' -f2 | tr -d '"'); do
|
||||
for FN in $(find ${kbddir}/keymaps -type f -name $INCL\*); do
|
||||
findkeymap $FN
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
install_local()
|
||||
{
|
||||
# FIXME: i18n stuff isn't really distro-independent :/
|
||||
if [[ -f /etc/sysconfig/keyboard || -f /etc/sysconfig/console/default.kmap ]]; then
|
||||
if [ -f /etc/sysconfig/console/default.kmap ]; then
|
||||
KEYMAP=/etc/sysconfig/console/default.kmap
|
||||
else
|
||||
. /etc/sysconfig/keyboard
|
||||
if [[ $KEYTABLE && -d ${kbddir}/keymaps ]]; then
|
||||
[[ $KEYTABLE =~ *.uni ]] && UNIKEYMAP="$KEYTABLE.map" \
|
||||
|| UNIKEYMAP="$KEYTABLE.uni.map"
|
||||
KEYMAP="$KEYTABLE.map"
|
||||
fi
|
||||
fi
|
||||
if [[ $KEYMAP ]]; then
|
||||
[ -f /etc/sysconfig/keyboard ] && inst /etc/sysconfig/keyboard
|
||||
inst loadkeys
|
||||
findkeymap $KEYMAP
|
||||
[[ $UNIKEYMAP ]] && findkeymap $UNIKEYMAP
|
||||
[[ $GRP_TOGGLE ]] && findkeymap $GRP_TOGGLE.map
|
||||
findkeymap delete.map
|
||||
findkeymap backspace.map
|
||||
|
||||
for FN in $KEYMAPS; do
|
||||
if [ -L $FN ]; then
|
||||
TARGET=$(readlink -f $FN)
|
||||
TG=$(echo $TARGET | sed -e 's/\.gz$//' -e 's/\.bz2$//')
|
||||
LN=$(echo $FN | sed -e 's/\.gz$//' -e 's/\.bz2$//')
|
||||
mkdir -p "$initdir/$(dirname $LN)"
|
||||
ln -s "$TG" "$initdir/$LN"
|
||||
FN=$TARGET
|
||||
fi
|
||||
inst $FN
|
||||
case $FN in
|
||||
*.gz) gzip -d "$initdir$FN" ;;
|
||||
*.bz2) bzip2 -d "$initdir$FN" ;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -f /etc/sysconfig/i18n ]; then
|
||||
. /etc/sysconfig/i18n
|
||||
inst /etc/sysconfig/i18n
|
||||
[[ $SYSFONT ]] || SYSFONT=latarcyrheb-sun16
|
||||
inst setfont
|
||||
|
||||
for FN in ${kbddir}/consolefonts/$SYSFONT.* ; do
|
||||
inst "$FN"
|
||||
case $FN in
|
||||
*.gz) gzip -d "$initdir$FN" ;;
|
||||
*.bz2) bzip2 -d "$initdir$FN" ;;
|
||||
esac
|
||||
done
|
||||
[[ $SYSFONTACM ]] && inst ${kbddir}/consoletrans/$SYSFONTACM
|
||||
[[ $UNIMAP ]] && inst ${kbddir}/unimaps/$UNIMAP
|
||||
fi
|
||||
}
|
||||
|
||||
for kbddir in /usr/lib/kbd /lib/kbd; do
|
||||
[[ -d ${kbddir} ]] && break
|
||||
done
|
||||
|
||||
if [[ $hostonly ]]; then
|
||||
install_local
|
||||
else
|
||||
for i in $(find ${kbddir} -type f -print); do
|
||||
dracut_install $i
|
||||
done
|
||||
# remove unnecessary files
|
||||
rm -f "$initdir${kbddir}/consoletrans/utflist" 2>/dev/null
|
||||
find "$initdir${kbddir}/" -name README\* -exec rm -f '{}' \;
|
||||
dracut_install gzip bzip2
|
||||
fi
|
||||
|
||||
dracut_install /lib/udev/console_init
|
||||
dracut_install setfont loadkeys
|
||||
inst_rules 10-console.rules
|
||||
inst_hook cmdline 20 "$moddir/parse-i18n.sh"
|
@@ -1,20 +0,0 @@
|
||||
inst_key_val()
|
||||
{
|
||||
local value
|
||||
value=$(getarg $1)
|
||||
[ -n "$value" ] && printf '%s="%s"\n' $1 $value >> $2
|
||||
}
|
||||
|
||||
mkdir -p /etc/sysconfig
|
||||
inst_key_val KEYBOARDTYPE /etc/sysconfig/keyboard
|
||||
inst_key_val KEYTABLE /etc/sysconfig/keyboard
|
||||
inst_key_val SYSFONT /etc/sysconfig/i18n
|
||||
inst_key_val SYSFONTACM /etc/sysconfig/i18n
|
||||
inst_key_val UNIMAP /etc/sysconfig/i18n
|
||||
inst_key_val LANG /etc/sysconfig/i18n
|
||||
|
||||
if [ -f /etc/sysconfig/i18n ]; then
|
||||
. /etc/sysconfig/i18n
|
||||
export LANG
|
||||
fi
|
||||
|
0
modules.d/10rpmversion/version.sh
Normal file → Executable file
0
modules.d/10rpmversion/version.sh
Normal file → Executable file
@@ -1,5 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ $1 = -d ]]; then
|
||||
[ -d /etc/sysconfig/network-scripts/ ] && echo ifcfg
|
||||
exit 0
|
||||
fi
|
||||
|
||||
. $dracutfunctions
|
||||
|
||||
for program in ip arping; do
|
||||
@@ -15,5 +20,8 @@ for program in dhclient brctl; do
|
||||
dwarning "Could not find program \"$program\" it might be required by network."
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
|
||||
exit 255
|
||||
|
||||
|
@@ -44,14 +44,10 @@ setup_interface() {
|
||||
|
||||
PATH=$PATH:/sbin:/usr/sbin
|
||||
|
||||
export PS4="dhclient.$interface.$$ + "
|
||||
exec >>/dev/initlog.pipe 2>>/dev/initlog.pipe
|
||||
. /lib/dracut-lib.sh
|
||||
|
||||
if getarg rdnetdebug ; then
|
||||
exec >/tmp/dhclient.$interface.$$.out
|
||||
exec 2>>/tmp/dhclient.$interface.$$.out
|
||||
set -x
|
||||
fi
|
||||
|
||||
# We already need a set netif here
|
||||
netif=$interface
|
||||
|
||||
@@ -60,10 +56,12 @@ netif=$interface
|
||||
|
||||
case $reason in
|
||||
PREINIT)
|
||||
echo "dhcp: PREINIT $netif up"
|
||||
ip link set $netif up
|
||||
wait_for_if_up $netif
|
||||
;;
|
||||
BOUND)
|
||||
echo "dhcp: BOND setting $netif"
|
||||
if ! arping -q -D -c 2 -I $netif $new_ip_address ; then
|
||||
warn "Duplicate address detected for $new_ip_address while doing dhcp. retrying"
|
||||
exit 1
|
||||
@@ -76,7 +74,7 @@ case $reason in
|
||||
echo online > /sys/class/net/$netif/uevent
|
||||
/sbin/initqueue --onetime --name netroot-$netif /sbin/netroot $netif
|
||||
;;
|
||||
*) ;;
|
||||
*) echo "dhcp: $reason";;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
@@ -2,8 +2,6 @@
|
||||
|
||||
# if there are no ifname parameters, just use NAME=KERNEL
|
||||
if ! getarg ifname= >/dev/null ; then
|
||||
echo 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="?*", ATTR{type}=="1", NAME="%k"' \
|
||||
> /etc/udev/rules.d/50-ifname.rules
|
||||
return
|
||||
fi
|
||||
|
||||
|
@@ -12,7 +12,9 @@ do_dhcp() {
|
||||
# /sbin/dhclient-script will mark the netif up and generate the online
|
||||
# event for nfsroot
|
||||
# XXX add -V vendor class and option parsing per kernel
|
||||
dhclient "$@" -1 -q -cf /etc/dhclient.conf -pf /tmp/dhclient.$netif.pid -lf /tmp/dhclient.$netif.lease $netif
|
||||
echo "Starting dhcp for interface $netif"
|
||||
dhclient "$@" -1 -q -cf /etc/dhclient.conf -pf /tmp/dhclient.$netif.pid -lf /tmp/dhclient.$netif.lease $netif \
|
||||
|| echo "dhcp failed"
|
||||
}
|
||||
|
||||
load_ipv6() {
|
||||
@@ -78,14 +80,10 @@ do_static() {
|
||||
|
||||
PATH=$PATH:/sbin:/usr/sbin
|
||||
|
||||
export PS4="ifup.$1.$$ + "
|
||||
exec >>/dev/initlog.pipe 2>>/dev/initlog.pipe
|
||||
. /lib/dracut-lib.sh
|
||||
|
||||
if getarg rdnetdebug ; then
|
||||
exec >/tmp/ifup.$1.$$.out
|
||||
exec 2>>/tmp/ifup.$1.$$.out
|
||||
set -x
|
||||
fi
|
||||
|
||||
# Huh? No $1?
|
||||
[ -z "$1" ] && exit 1
|
||||
|
||||
|
@@ -4,8 +4,8 @@
|
||||
net_module_test() {
|
||||
local net_drivers='eth_type_trans|register_virtio_device'
|
||||
local unwanted_drivers='/(wireless|isdn|uwb)/'
|
||||
nm -uPA "$1" | egrep -q $net_drivers && \
|
||||
nm -uPA "$1" | egrep -qv 'iw_handler_get_spy' && \
|
||||
egrep -q $net_drivers "$1" && \
|
||||
egrep -qv 'iw_handler_get_spy' "$1" && \
|
||||
[[ ! $1 =~ $unwanted_drivers ]]
|
||||
}
|
||||
|
||||
|
@@ -6,6 +6,8 @@ fix_bootif() {
|
||||
local IFS='-'
|
||||
macaddr=$(for i in ${macaddr} ; do echo -n $i:; done)
|
||||
macaddr=${macaddr%:}
|
||||
# strip hardware type field from pxelinux
|
||||
[ -n "${macaddr%??:??:??:??:??:??}" ] && macaddr=${macaddr#??:}
|
||||
echo $macaddr
|
||||
}
|
||||
|
||||
@@ -29,7 +31,7 @@ fix_bootif() {
|
||||
# If we have to handle multiple interfaces, handle only them.
|
||||
elif [ -n "$IFACES" ] ; then
|
||||
for iface in $IFACES ; do
|
||||
printf 'ACTION=="add", SUBSYSTEM=="net", NAME=="%s", RUN+="/sbin/ifup $env{INTERFACE}"\n' "$iface"
|
||||
printf 'ACTION=="add", SUBSYSTEM=="net", ENV{INTERFACE}=="%s", RUN+="/sbin/ifup $env{INTERFACE}"\n' "$iface"
|
||||
done
|
||||
|
||||
# Default: We don't know the interface to use, handle all
|
||||
|
@@ -73,7 +73,8 @@ for p in $(getargs ip=); do
|
||||
[ -z "$mask" ] && \
|
||||
die "Sorry, automatic calculation of netmask is not yet supported"
|
||||
;;
|
||||
dhcp|on|any) \
|
||||
auto6);;
|
||||
dhcp|dhcp6|on|any) \
|
||||
[ -n "$NEEDBOOTDEV" ] && [ -z "$dev" ] && \
|
||||
die "Sorry, 'ip=$p' does not make sense for multiple interface configurations"
|
||||
[ -n "$ip" ] && \
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
[ -d /etc/sysconfig/network-scripts/ ] || exit 1
|
||||
|
||||
[[ $1 = -d ]] && echo network
|
||||
# ifcfg is required by network
|
||||
#[[ $1 = -d ]] && echo network
|
||||
|
||||
exit 255
|
||||
|
42
modules.d/50gensplash/README
Normal file
42
modules.d/50gensplash/README
Normal file
@@ -0,0 +1,42 @@
|
||||
Dracut gensplash module
|
||||
-----------------------
|
||||
|
||||
INDEX
|
||||
|
||||
0. Introduction
|
||||
1. Hostonly vs Generic
|
||||
2. Configuration and kernel parameters
|
||||
|
||||
~
|
||||
|
||||
0. Introduction
|
||||
|
||||
gensplash is based on Genkernel code and that's why it's Gentoo-specific. It
|
||||
requires splashutils to work. To set up theme you may edit /etc/conf.d/splash
|
||||
or set DRACUT_GENSPLASH_THEME and DRACUT_GENSPLASH_RES variables. Your theme
|
||||
has to exist in /etc/splash and for every given resolution has to exist config
|
||||
in theme's directory, e.g. there's 1024x768.cfg in /etc/splash/natural_gentoo.
|
||||
List of resolutions is comma-separated.
|
||||
|
||||
NOTE: The module will be rewritten to be distro-neutral. Its name will change
|
||||
to fbsplash.
|
||||
|
||||
|
||||
1. Hostonly vs Generic
|
||||
|
||||
All available themes are installed only if no --hostonly is specified and no
|
||||
DRACUT_GENSPLASH_THEME and DRACUT_GENSPLASH_RES are set. Otherwise those vars
|
||||
are checked and if not set then config /etc/conf.d/splash is read.
|
||||
|
||||
|
||||
2. Configuration and kernel parameters
|
||||
|
||||
Example set up by environment variables:
|
||||
DRACUT_GENSPLASH_THEME=natural_gentoo
|
||||
DRACUT_GENSPLASH_RES=1024x768,1024x600
|
||||
|
||||
Example kernel arguments:
|
||||
splash=silent,theme:natural_gentoo console=tty1 quiet
|
||||
|
||||
You may easily set up the module using Genkernel with arguments:
|
||||
--gensplash=<theme>:<res1>,<res2>,...
|
5
modules.d/50gensplash/check
Executable file
5
modules.d/50gensplash/check
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# TODO: splash_geninitramfs
|
||||
# TODO: /usr/share/splashutils/initrd.splash
|
||||
exit 255
|
5
modules.d/50gensplash/gensplash-emergency.sh
Executable file
5
modules.d/50gensplash/gensplash-emergency.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
CDROOT=0
|
||||
. /lib/gensplash-lib.sh
|
||||
splash verbose
|
5
modules.d/50gensplash/gensplash-newroot.sh
Executable file
5
modules.d/50gensplash/gensplash-newroot.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
CDROOT=0
|
||||
. /lib/gensplash-lib.sh
|
||||
splash set_msg 'Switching to new root'
|
14
modules.d/50gensplash/gensplash-pretrigger.sh
Executable file
14
modules.d/50gensplash/gensplash-pretrigger.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
if ! getarg rd_NO_SPLASH; then
|
||||
[ -c /dev/null ] || mknod /dev/null c 1 3
|
||||
[ -c /dev/console ] || mknod /dev/console c 5 1
|
||||
[ -c /dev/tty0 ] || mknod /dev/tty0 c 4 0
|
||||
|
||||
info "Starting Gentoo Splash"
|
||||
|
||||
/lib/udev/console_init tty0
|
||||
CDROOT=0
|
||||
. /lib/gensplash-lib.sh
|
||||
splash init
|
||||
fi
|
63
modules.d/50gensplash/install
Executable file
63
modules.d/50gensplash/install
Executable file
@@ -0,0 +1,63 @@
|
||||
#!/bin/bash
|
||||
|
||||
call_splash_geninitramfs() {
|
||||
local out ret
|
||||
|
||||
out=$(splash_geninitramfs -c "$1" ${@:2} 2>&1)
|
||||
ret=$?
|
||||
|
||||
if [[ ${out} ]]; then
|
||||
local IFS='
|
||||
'
|
||||
for line in ${out}; do
|
||||
if [[ ${line} =~ ^Warning ]]; then
|
||||
dwarning "${line}"
|
||||
else
|
||||
derror "${line}"
|
||||
(( ret == 0 )) && ret=1
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
return ${ret}
|
||||
}
|
||||
|
||||
|
||||
type -P splash_geninitramfs >/dev/null || exit 1
|
||||
|
||||
opts=''
|
||||
|
||||
if [[ ${DRACUT_GENSPLASH_THEME} ]]; then
|
||||
# Variables from the environment
|
||||
# They're supposed to be set up by e.g. Genkernel in basis of cmdline args.
|
||||
# If user set them he/she would expect to be included only given theme
|
||||
# rather then all even if we're building generic initramfs.
|
||||
SPLASH_THEME=${DRACUT_GENSPLASH_THEME}
|
||||
SPLASH_RES=${DRACUT_GENSPLASH_RES}
|
||||
elif [[ ${hostonly} ]]; then
|
||||
# Settings from config only in hostonly
|
||||
[[ -e /etc/conf.d/splash ]] && source /etc/conf.d/splash
|
||||
[[ ! ${SPLASH_THEME} ]] && SPLASH_THEME=default
|
||||
[[ ${SPLASH_RES} ]] && opts+=" -r ${SPLASH_RES}"
|
||||
else
|
||||
# generic
|
||||
SPLASH_THEME=--all
|
||||
fi
|
||||
|
||||
dinfo "Installing Gentoo Splash (using the ${SPLASH_THEME} theme)"
|
||||
|
||||
pushd "${initdir}" >/dev/null
|
||||
mv dev dev.old
|
||||
call_splash_geninitramfs "${initdir}" ${opts} ${SPLASH_THEME} || {
|
||||
derror "Could not build splash"
|
||||
exit 1
|
||||
}
|
||||
rm -rf dev
|
||||
mv dev.old dev
|
||||
popd >/dev/null
|
||||
|
||||
dracut_install chvt
|
||||
inst /usr/share/splashutils/initrd.splash /lib/gensplash-lib.sh
|
||||
inst_hook pre-pivot 90 "${moddir}"/gensplash-newroot.sh
|
||||
inst_hook pre-trigger 10 "${moddir}"/gensplash-pretrigger.sh
|
||||
inst_hook emergency 50 "${moddir}"/gensplash-emergency.sh
|
@@ -1,3 +1,3 @@
|
||||
#!/bin/bash
|
||||
[[ $1 = -d ]] && echo crypt
|
||||
[[ $1 = -d ]] && which cryptsetup &>/dev/null && echo crypt
|
||||
[[ -x /sbin/plymouthd && -x /bin/plymouth && -x /usr/sbin/plymouth-set-default-theme ]]
|
||||
|
@@ -9,6 +9,9 @@
|
||||
# we already asked for this device
|
||||
[ -f /tmp/cryptroot-asked-$2 ] && exit 0
|
||||
|
||||
# load dm_crypt if it is not already loaded
|
||||
[ -d /sys/module/dm_crypt ] || modprobe dm_crypt
|
||||
|
||||
. /lib/dracut-lib.sh
|
||||
|
||||
# default luksname - luks-UUID
|
||||
@@ -21,7 +24,7 @@ else
|
||||
device="$1"
|
||||
fi
|
||||
|
||||
if [ -f /etc/crypttab ] && ! getargs rd_NO_CRYPTTAB; then
|
||||
if [ -f /etc/crypttab ] && ! getarg rd_NO_CRYPTTAB; then
|
||||
while read name dev rest; do
|
||||
# ignore blank lines and comments
|
||||
if [ -z "$name" -o "${name#\#}" != "$name" ]; then
|
||||
@@ -48,30 +51,20 @@ if [ -f /etc/crypttab ] && ! getargs rd_NO_CRYPTTAB; then
|
||||
unset name dev rest
|
||||
fi
|
||||
|
||||
LUKS=$(getargs rd_LUKS_UUID=)
|
||||
ask=1
|
||||
if [ -n "$LUKS" ]; then
|
||||
ask=0
|
||||
luuid=${2##luks-}
|
||||
for luks in $LUKS; do
|
||||
luks=${luks##luks-}
|
||||
if [ "${luuid##$luks}" != "$luuid" ] || [ "$luksname" = "$luks" ]; then
|
||||
ask=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
prompt="Password [$device ($luksname)]:"
|
||||
if [ ${#luksname} -gt 8 ]; then
|
||||
sluksname=${sluksname##luks-}
|
||||
sluksname=${luksname%%${luksname##????????}}
|
||||
prompt="Password for $device ($sluksname...)"
|
||||
fi
|
||||
unset LUKS luks luuid
|
||||
|
||||
if [ $ask -gt 0 ]; then
|
||||
info "luksOpen $device $luksname"
|
||||
# flock against other interactive activities
|
||||
{ flock -s 9;
|
||||
/bin/plymouth ask-for-password \
|
||||
--prompt "$device ($luksname) is password protected" \
|
||||
--command="/sbin/cryptsetup luksOpen -T1 $device $luksname"
|
||||
} 9>/.console.lock
|
||||
fi
|
||||
# flock against other interactive activities
|
||||
{ flock -s 9;
|
||||
/bin/plymouth ask-for-password \
|
||||
--prompt "$prompt" \
|
||||
--command="/sbin/cryptsetup luksOpen -T1 $device $luksname"
|
||||
} 9>/.console.lock
|
||||
|
||||
unset ask device luksname
|
||||
|
||||
# mark device as asked
|
||||
@@ -80,4 +73,4 @@ unset ask device luksname
|
||||
udevsettle
|
||||
|
||||
exit 0
|
||||
# vim:ts=8:sw=4:sts=4:et
|
||||
# vim:ts=8:sw=4:sts=4:et
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
# Include KMS capable drm drivers
|
||||
for modname in $(find "$srcmods/kernel/drivers/gpu/drm" -name '*.ko' 2>/dev/null); do
|
||||
nm -uPA $modname | grep -q drm_crtc_init && instmods $modname
|
||||
grep -q drm_crtc_init $modname && instmods $modname
|
||||
done
|
||||
|
0
modules.d/50plymouth/plymouth-emergency.sh
Normal file → Executable file
0
modules.d/50plymouth/plymouth-emergency.sh
Normal file → Executable file
@@ -30,7 +30,7 @@ if [[ $hostonly ]]; then
|
||||
if [ -L /usr/share/plymouth/themes/default.plymouth ]; then
|
||||
inst /usr/share/plymouth/themes/default.plymouth
|
||||
# Install plugin for this theme
|
||||
PLYMOUTH_PLUGIN=$(grep "^ModuleName=" /usr/share/plymouth/themes/default.plymouth |awk -F= {'print $2'})
|
||||
PLYMOUTH_PLUGIN=$(grep "^ModuleName=" /usr/share/plymouth/themes/default.plymouth | while read a b c; do echo $b; done;)
|
||||
inst ${LIBDIR}/plymouth/${PLYMOUTH_PLUGIN}.so
|
||||
fi
|
||||
else
|
||||
|
@@ -1,17 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
if ! getarg rd_NO_PLYMOUTH; then
|
||||
[ -c /dev/null ] || mknod /dev/null c 1 3
|
||||
[ -c /dev/null ] || mknod -m 0666 /dev/null c 1 3
|
||||
# first trigger graphics subsystem
|
||||
udevadm trigger --attr-match=class=0x030000 >/dev/null 2>&1
|
||||
# first trigger graphics and tty subsystem
|
||||
udevadm trigger --subsystem-match=graphics --subsystem-match=drm --subsystem-match=tty >/dev/null 2>&1
|
||||
|
||||
udevadm settle --timeout=30 2>&1 | vinfo
|
||||
[ -c /dev/zero ] || mknod /dev/zero c 1 5
|
||||
[ -c /dev/systty ] || mknod /dev/systty c 4 0
|
||||
[ -c /dev/fb ] || mknod /dev/fb c 29 0
|
||||
[ -c /dev/hvc0 ] || mknod /dev/hvc0 c 229 0
|
||||
[ -c /dev/zero ] || mknod -m 0666 /dev/zero c 1 5
|
||||
[ -c /dev/tty0 ] || mknod -m 0620 /dev/tty0 c 4 0
|
||||
[ -e /dev/systty ] || ln -s tty0 /dev/systty
|
||||
[ -c /dev/fb0 ] || mknod -m 0660 /dev/fb0 c 29 0
|
||||
[ -e /dev/fb ] || ln -s fb0 /dev/fb
|
||||
[ -c /dev/hvc0 ] || mknod -m 0600 /dev/hvc0 c 229 0
|
||||
|
||||
info "Starting plymouth daemon"
|
||||
[ -x /bin/plymouthd ] && /bin/plymouthd --attach-to-session
|
||||
|
0
modules.d/60xen/xen-pre-udev.sh
Normal file → Executable file
0
modules.d/60xen/xen-pre-udev.sh
Normal file → Executable file
8
modules.d/90btrfs/40-btrfs.rules
Normal file
8
modules.d/90btrfs/40-btrfs.rules
Normal file
@@ -0,0 +1,8 @@
|
||||
SUBSYSTEM!="block", GOTO="btrfs_end"
|
||||
ACTION!="add|change", GOTO="btrfs_end"
|
||||
|
||||
ENV{ID_FS_TYPE}=="btrfs", RUN+="/sbin/modprobe btrfs"
|
||||
ENV{ID_FS_TYPE}=="btrfs", RUN+="/sbin/btrfsctl -A $env{DEVNAME}"
|
||||
|
||||
LABEL="btrfs_end"
|
||||
|
22
modules.d/90btrfs/check
Executable file
22
modules.d/90btrfs/check
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
# We depend on udev-rules being loaded
|
||||
[[ "$1" = "-d" ]] && exit 0
|
||||
|
||||
# if we don't have btrfs (btrfsctl) installed on the host system,
|
||||
# no point in trying to support it in the initramfs.
|
||||
which btrfsctl >/dev/null 2>&1 || exit 1
|
||||
|
||||
. $dracutfunctions
|
||||
[[ $debug ]] && set -x
|
||||
|
||||
is_btrfs() { get_fs_type /dev/block/$1 |grep -q btrfs; }
|
||||
|
||||
if [[ "$1" = "-h" ]]; then
|
||||
rootdev=$(find_root_block_device)
|
||||
if [[ $rootdev ]]; then
|
||||
is_btrfs "$rootdev" || exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
4
modules.d/90btrfs/install
Executable file
4
modules.d/90btrfs/install
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
inst_rules "$moddir/40-btrfs.rules"
|
||||
dracut_install btrfsctl
|
@@ -1,12 +0,0 @@
|
||||
# hacky rules to try to try unlocking dm-crypt devs
|
||||
#
|
||||
# Copyright 2008, Red Hat, Inc.
|
||||
# Jeremy Katz <katzj@redhat.com>
|
||||
|
||||
|
||||
SUBSYSTEM!="block", GOTO="luks_end"
|
||||
ACTION!="add|change", GOTO="luks_end"
|
||||
|
||||
ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="/sbin/initqueue --unique --onetime --name cryptroot-ask-%k /sbin/cryptroot-ask $env{DEVNAME} luks-$env{ID_FS_UUID}"
|
||||
|
||||
LABEL="luks_end"
|
@@ -3,6 +3,8 @@
|
||||
# if cryptsetup is not installed, then we cannot support encrypted devices.
|
||||
which cryptsetup >/dev/null 2>&1 || exit 1
|
||||
|
||||
[ "$1" = "-d" ] && echo dm
|
||||
|
||||
# hostonly checking should only return true if root is on a LUKS device
|
||||
# in some way, but I am too lazy to figure out how to do that.
|
||||
# Instead, fail if we do not have a LUKS device in use somewhere.
|
||||
@@ -19,7 +21,7 @@ is_crypt() { [[ $(get_fs_type /dev/block/$1) = crypto_LUKS ]]; }
|
||||
check_block_and_slaves is_crypt "$rootdev" || exit 1
|
||||
else
|
||||
# root is not on a block device, use the shotgun approach
|
||||
blkid | grep -q crypt_LUKS || exit 1
|
||||
blkid | grep -q crypto\?_LUKS || exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@@ -1,5 +1,11 @@
|
||||
#!/bin/sh
|
||||
# close everything which is not busy
|
||||
for i in /dev/mapper/luks-*; do
|
||||
cryptsetup luksClose $i >/dev/null 2>&1
|
||||
rm -f /etc/udev/rules.d/70-luks.rules >/dev/null 2>&1
|
||||
|
||||
while true; do
|
||||
local do_break="y"
|
||||
for i in /dev/mapper/luks-*; do
|
||||
cryptsetup luksClose $i >/dev/null 2>&1 && do_break=n
|
||||
done
|
||||
[ "$do_break" = "y" ] && break
|
||||
done
|
||||
|
@@ -9,6 +9,9 @@
|
||||
# we already asked for this device
|
||||
[ -f /tmp/cryptroot-asked-$2 ] && exit 0
|
||||
|
||||
# load dm_crypt if it is not already loaded
|
||||
[ -d /sys/module/dm_crypt ] || modprobe dm_crypt
|
||||
|
||||
. /lib/dracut-lib.sh
|
||||
|
||||
# default luksname - luks-UUID
|
||||
@@ -21,54 +24,104 @@ else
|
||||
device="$1"
|
||||
fi
|
||||
|
||||
if [ -f /etc/crypttab ] && ! getargs rd_NO_CRYPTTAB; then
|
||||
if [ -f /etc/crypttab ] && ! getarg rd_NO_CRYPTTAB; then
|
||||
while read name dev rest; do
|
||||
# ignore blank lines and comments
|
||||
if [ -z "$name" -o "${name#\#}" != "$name" ]; then
|
||||
continue
|
||||
fi
|
||||
# ignore blank lines and comments
|
||||
if [ -z "$name" -o "${name#\#}" != "$name" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
# UUID used in crypttab
|
||||
if [ "${dev%%=*}" = "UUID" ]; then
|
||||
if [ "luks-${dev##UUID=}" = "$2" ]; then
|
||||
luksname="$name"
|
||||
break
|
||||
fi
|
||||
|
||||
# path used in crypttab
|
||||
else
|
||||
cdev=$(readlink -f $dev)
|
||||
mdev=$(readlink -f $device)
|
||||
if [ "$cdev" = "$mdev" ]; then
|
||||
luksname="$name"
|
||||
break
|
||||
fi
|
||||
fi
|
||||
# UUID used in crypttab
|
||||
if [ "${dev%%=*}" = "UUID" ]; then
|
||||
if [ "luks-${dev##UUID=}" = "$2" ]; then
|
||||
luksname="$name"
|
||||
break
|
||||
fi
|
||||
|
||||
# path used in crypttab
|
||||
else
|
||||
cdev=$(readlink -f $dev)
|
||||
mdev=$(readlink -f $device)
|
||||
if [ "$cdev" = "$mdev" ]; then
|
||||
luksname="$name"
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done < /etc/crypttab
|
||||
unset name dev rest
|
||||
fi
|
||||
|
||||
LUKS=$(getargs rd_LUKS_UUID=)
|
||||
ask=1
|
||||
if [ -n "$LUKS" ]; then
|
||||
ask=0
|
||||
luuid=${2##luks-}
|
||||
for luks in $LUKS; do
|
||||
luks=${luks##luks-}
|
||||
if [ "${luuid##$luks}" != "$luuid" ] || [ "$luksname" = "$luks" ]; then
|
||||
ask=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
unset LUKS luks luuid
|
||||
#
|
||||
# Search key on external devices
|
||||
#
|
||||
|
||||
if [ $ask -gt 0 ]; then
|
||||
info "luksOpen $device $luksname"
|
||||
# Try to mount device specified by UUID and probe for existence of any of
|
||||
# the paths. On success return 0 and print "<uuid> <first-existing-path>",
|
||||
# otherwise return 1.
|
||||
# Function leaves mount point created.
|
||||
probe_keydev() {
|
||||
local uuid="$1"; shift; local keypaths="$*"
|
||||
local ret=1; local mount_point=/mnt/keydev
|
||||
local path
|
||||
|
||||
[ -n "${uuid}" -a -n "${keypaths}" ] || return 1
|
||||
[ -d ${mount_point} ] || mkdir -p "${mount_point}" || return 1
|
||||
|
||||
if mount -r -U "${uuid}" "${mount_point}" 2>/dev/null >/dev/null; then
|
||||
for path in ${keypaths}; do
|
||||
if [ -f "${mount_point}/${path}" ]; then
|
||||
echo "${uuid} ${path}"
|
||||
ret=0
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
umount "${mount_point}" 2>/dev/null >/dev/null
|
||||
|
||||
return ${ret}
|
||||
}
|
||||
|
||||
keypaths="$(getargs rd_LUKS_KEYPATH)"
|
||||
unset keydev_uuid keypath
|
||||
|
||||
if [ -n "$keypaths" ]; then
|
||||
keydev_uuids="$(getargs rd_LUKS_KEYDEV_UUID)"
|
||||
[ -n "$keydev_uuids" ] || {
|
||||
warn 'No UUID of device storing LUKS key specified.'
|
||||
warn 'It is recommended to set rd_LUKS_KEYDEV_UUID.'
|
||||
warn 'Performing scan of *all* devices accessible by UUID...'
|
||||
}
|
||||
tmp=$(foreach_uuid_until "probe_keydev \$full_uuid $keypaths" \
|
||||
$keydev_uuids) && {
|
||||
keydev_uuid="${tmp%% *}"
|
||||
keypath="${tmp#* }"
|
||||
} || {
|
||||
warn "Key for $device not found."
|
||||
}
|
||||
unset tmp keydev_uuids
|
||||
fi
|
||||
|
||||
unset keypaths
|
||||
|
||||
#
|
||||
# Open LUKS device
|
||||
#
|
||||
|
||||
info "luksOpen $device $luksname"
|
||||
|
||||
if [ -n "$keydev_uuid" ]; then
|
||||
mntp=/mnt/keydev
|
||||
mkdir -p "$mntp"
|
||||
mount -r -U "$keydev_uuid" "$mntp"
|
||||
cryptsetup -d "$mntp/$keypath" luksOpen "$device" "$luksname"
|
||||
umount "$mntp"
|
||||
rmdir -p "$mntp" 2>/dev/null
|
||||
else
|
||||
# flock against other interactive activities
|
||||
{ flock -s 9;
|
||||
echo -n "$device ($luksname) is password protected"
|
||||
/sbin/cryptsetup luksOpen -T1 $1 $luksname
|
||||
{ flock -s 9;
|
||||
echo -n "$device ($luksname) is password protected"
|
||||
cryptsetup luksOpen -T1 $1 $luksname
|
||||
} 9>/.console.lock
|
||||
fi
|
||||
|
||||
@@ -76,4 +129,4 @@ fi
|
||||
>> /tmp/cryptroot-asked-$2
|
||||
|
||||
exit 0
|
||||
# vim:ts=8:sw=4:sts=4:et
|
||||
# vim:ts=8:sw=4:sts=4:et
|
||||
|
@@ -1,8 +1,6 @@
|
||||
#!/bin/bash
|
||||
inst cryptsetup
|
||||
inst_rules "$moddir/70-luks.rules"
|
||||
inst "$moddir"/cryptroot-ask.sh /sbin/cryptroot-ask
|
||||
inst_hook cmdline 30 "$moddir/parse-crypt.sh"
|
||||
inst_hook pre-pivot 30 "$moddir/crypt-cleanup.sh"
|
||||
inst_hook pre-pivot 31 "$moddir/crypt-cleanup.sh"
|
||||
inst /etc/crypttab
|
||||
|
@@ -1,2 +1,3 @@
|
||||
#!/bin/bash
|
||||
instmods dm_crypt cbc aes sha256 xts
|
||||
instmods dm_crypt cbc sha256 xts aes aes_generic aesni-intel aes-x86_64 fpu
|
||||
|
||||
|
@@ -2,5 +2,42 @@
|
||||
if getarg rd_NO_LUKS; then
|
||||
info "rd_NO_LUKS: removing cryptoluks activation"
|
||||
rm -f /etc/udev/rules.d/70-luks.rules
|
||||
fi
|
||||
else
|
||||
{
|
||||
echo 'SUBSYSTEM!="block", GOTO="luks_end"'
|
||||
echo 'ACTION!="add|change", GOTO="luks_end"'
|
||||
} > /etc/udev/rules.d/70-luks.rules
|
||||
|
||||
LUKS=$(getargs rd_LUKS_UUID)
|
||||
unset settled
|
||||
[ -n "$(getargs rd_LUKS_KEYPATH)" ] && \
|
||||
[ -z "$(getargs rd_LUKS_KEYDEV_UUID)" ] && \
|
||||
settled='--settled'
|
||||
|
||||
if [ -n "$LUKS" ]; then
|
||||
for luksid in $LUKS; do
|
||||
luksid=${luksid##luks-}
|
||||
{
|
||||
printf 'ENV{ID_FS_TYPE}=="crypto_LUKS", '
|
||||
printf 'ENV{ID_FS_UUID}=="*%s*", ' $luksid
|
||||
printf 'RUN+="/sbin/initqueue --unique --onetime %s ' "$settled"
|
||||
printf -- '--name cryptroot-ask-%%k /sbin/cryptroot-ask '
|
||||
printf '$env{DEVNAME} luks-$env{ID_FS_UUID}"\n'
|
||||
} >> /etc/udev/rules.d/70-luks.rules
|
||||
|
||||
printf '[ -e /dev/disk/by-uuid/*%s* ] || exit 1\n' $luksid \
|
||||
>> /initqueue-finished/crypt.sh
|
||||
{
|
||||
printf '[ -e /dev/disk/by-uuid/*%s* ] || ' $luksid
|
||||
printf 'warn "crypto LUKS UUID "%s" not found"\n' $luksid
|
||||
} >> /emergency/00-crypt.sh
|
||||
done
|
||||
else
|
||||
echo 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="/sbin/initqueue' $settled \
|
||||
'--unique --onetime --name cryptroot-ask-%k' \
|
||||
'/sbin/cryptroot-ask $env{DEVNAME} luks-$env{ID_FS_UUID}"' \
|
||||
>> /etc/udev/rules.d/70-luks.rules
|
||||
fi
|
||||
|
||||
echo 'LABEL="luks_end"' >> /etc/udev/rules.d/70-luks.rules
|
||||
fi
|
||||
|
2
modules.d/90dm/dm-pre-udev.sh
Normal file → Executable file
2
modules.d/90dm/dm-pre-udev.sh
Normal file → Executable file
@@ -1 +1 @@
|
||||
modprobe dm_mod
|
||||
strstr "$(cat /proc/misc)" device-mapper || modprobe dm_mod
|
||||
|
@@ -10,7 +10,7 @@ DM_CLEANUP="no"
|
||||
info "Scanning for dmraid devices $DM_RAIDS"
|
||||
SETS=$(dmraid -c -s)
|
||||
|
||||
if [ "$SETS" = "no raid disks" ]; then
|
||||
if [ "$SETS" = "no raid disks" -o "$SETS" = "no raid sets" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
|
0
modules.d/90dmraid/parse-dm.sh
Normal file → Executable file
0
modules.d/90dmraid/parse-dm.sh
Normal file → Executable file
@@ -2,7 +2,10 @@
|
||||
|
||||
# if dmsetup is not installed, then we cannot support fedora/red hat
|
||||
# style live images
|
||||
which dmsetup >/dev/null 2>&1 || exit 1
|
||||
if [ "$1" = "-d" ]; then
|
||||
echo dm
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# a live host-only image doesn't really make a lot of sense
|
||||
if [ "$1" = "-h" ] ; then
|
||||
|
7
modules.d/90dmsquash-live/dmsquash-live-genrules.sh
Normal file → Executable file
7
modules.d/90dmsquash-live/dmsquash-live-genrules.sh
Normal file → Executable file
@@ -1,14 +1,15 @@
|
||||
if [ "${root%%:*}" = "live" ]; then
|
||||
(
|
||||
{
|
||||
printf 'KERNEL=="%s", SYMLINK+="live"\n' \
|
||||
${root#live:/dev/}
|
||||
printf 'SYMLINK=="%s", SYMLINK+="live"\n' \
|
||||
${root#live:/dev/}
|
||||
} >> /dev/.udev/rules.d/99-live-mount.rules
|
||||
{
|
||||
printf 'KERNEL=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root $env{DEVNAME}"\n' \
|
||||
${root#live:/dev/}
|
||||
printf 'SYMLINK=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root $env{DEVNAME}"\n' \
|
||||
${root#live:/dev/}
|
||||
|
||||
) >> /etc/udev/rules.d/99-live-mount.rules
|
||||
} >> /etc/udev/rules.d/99-live-squash.rules
|
||||
echo '[ -e /dev/root ]' > /initqueue-finished/dmsquash.sh
|
||||
fi
|
||||
|
@@ -41,7 +41,8 @@ getarg ro && liverw=ro
|
||||
getarg rw && liverw=rw
|
||||
[ -z "$liverw" ] && liverw=ro
|
||||
# mount the backing of the live image first
|
||||
mount -n -t $fstype -o $liverw $livedev $NEWROOT
|
||||
mkdir -p /dev/.initramfs/live
|
||||
mount -n -t $fstype -o $liverw $livedev /dev/.initramfs/live
|
||||
RES=$?
|
||||
if [ "$RES" != "0" ]; then
|
||||
die "Failed to mount block device of live image"
|
||||
@@ -105,8 +106,8 @@ do_live_from_base_loop() {
|
||||
}
|
||||
|
||||
# we might have a genMinInstDelta delta file for anaconda to take advantage of
|
||||
if [ -e $NEWROOT/${live_dir}/osmin.img ]; then
|
||||
OSMINSQFS=$NEWROOT/${live_dir}/osmin.img
|
||||
if [ -e /dev/.initramfs/live/${live_dir}/osmin.img ]; then
|
||||
OSMINSQFS=/dev/.initramfs/live/${live_dir}/osmin.img
|
||||
fi
|
||||
|
||||
if [ -n "$OSMINSQFS" ]; then
|
||||
@@ -122,21 +123,20 @@ if [ -n "$OSMINSQFS" ]; then
|
||||
fi
|
||||
|
||||
# we might have just an embedded ext3 to use as rootfs (uncompressed live)
|
||||
if [ -e $NEWROOT/${live_dir}/ext3fs.img ]; then
|
||||
EXT3FS="$NEWROOT/${live_dir}/ext3fs.img"
|
||||
if [ -e /dev/.initramfs/live/${live_dir}/ext3fs.img ]; then
|
||||
EXT3FS="/dev/.initramfs/live/${live_dir}/ext3fs.img"
|
||||
fi
|
||||
|
||||
if [ -n "$EXT3FS" ] ; then
|
||||
BASE_LOOPDEV=$( losetup -f )
|
||||
losetup -r $BASE_LOOPDEV $EXT3FS
|
||||
umount -l $NEWROOT
|
||||
|
||||
do_live_from_base_loop
|
||||
fi
|
||||
|
||||
# we might have an embedded ext3 on squashfs to use as rootfs (compressed live)
|
||||
if [ -e $NEWROOT/${live_dir}/squashfs.img ]; then
|
||||
SQUASHED="$NEWROOT/${live_dir}/squashfs.img"
|
||||
if [ -e /dev/.initramfs/live/${live_dir}/squashfs.img ]; then
|
||||
SQUASHED="/dev/.initramfs/live/${live_dir}/squashfs.img"
|
||||
fi
|
||||
|
||||
if [ -e "$SQUASHED" ] ; then
|
||||
@@ -144,7 +144,7 @@ if [ -e "$SQUASHED" ] ; then
|
||||
echo "Copying live image to RAM..."
|
||||
echo "(this may take a few minutes)"
|
||||
dd if=$SQUASHED of=/squashed.img bs=512 2> /dev/null
|
||||
umount -n $NEWROOT
|
||||
umount -n /dev/.initramfs/live
|
||||
echo "Done copying live image to RAM."
|
||||
eject -p $livedev || :
|
||||
SQUASHED="/squashed.img"
|
||||
@@ -159,9 +159,6 @@ if [ -e "$SQUASHED" ] ; then
|
||||
losetup -r $BASE_LOOPDEV /squashfs/LiveOS/ext3fs.img
|
||||
|
||||
umount -l /squashfs
|
||||
if [ -z "$live_ram" ] ; then
|
||||
umount -l $NEWROOT
|
||||
fi
|
||||
|
||||
do_live_from_base_loop
|
||||
fi
|
||||
@@ -172,7 +169,12 @@ if [ -b "$OSMIN_LOOPDEV" ]; then
|
||||
echo "0 $( blockdev --getsz $BASE_LOOPDEV ) snapshot $BASE_LOOPDEV $OSMIN_LOOPDEV p 8" | dmsetup create --readonly live-osimg-min
|
||||
fi
|
||||
|
||||
ROOTFLAGS="$(getarg rootflags)"
|
||||
if [ -n "$ROOTFLAGS" ]; then
|
||||
ROOTFLAGS="-o $ROOTFLAGS"
|
||||
fi
|
||||
|
||||
ln -s /dev/mapper/live-rw /dev/root
|
||||
printf '/bin/mount /dev/mapper/live-rw %s\n' "$NEWROOT" > /mount/01-$$-live.sh
|
||||
printf '/bin/mount %s /dev/mapper/live-rw %s\n' "$ROOTFLAGS" "$NEWROOT" > /mount/01-$$-live.sh
|
||||
|
||||
exit 0
|
||||
|
4
modules.d/90dmsquash-live/dmsquash-liveiso-genrules.sh
Normal file → Executable file
4
modules.d/90dmsquash-live/dmsquash-liveiso-genrules.sh
Normal file → Executable file
@@ -1,7 +1,7 @@
|
||||
if [ "${root%%:*}" = "liveiso" ]; then
|
||||
(
|
||||
{
|
||||
printf 'KERNEL=="loop0", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root `/sbin/losetup -f --show %s`"\n' \
|
||||
${root#liveiso:}
|
||||
) >> /etc/udev/rules.d/99-liveiso-mount.rules
|
||||
} >> /etc/udev/rules.d/99-liveiso-mount.rules
|
||||
echo '[ -e /dev/root ]' > /initqueue-finished/dmsquash.sh
|
||||
fi
|
||||
|
@@ -1,12 +1,13 @@
|
||||
#!/bin/bash
|
||||
if [[ -z $drivers ]]; then
|
||||
block_module_test() {
|
||||
local blockfuncs='ata_scsi_ioctl|scsi_add_host|blk_init_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device'
|
||||
local blockfuncs='ahci_init_controller|ata_scsi_ioctl|scsi_add_host|blk_init_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device'
|
||||
|
||||
nm -uPA "$1" | egrep -q "$blockfuncs"
|
||||
egrep -q "$blockfuncs" "$1"
|
||||
}
|
||||
hostonly='' instmods pcmcia sd_mod scsi_dh scsi_dh_rdac scsi_dh_emc
|
||||
hostonly='' instmods firewire-ohci
|
||||
hostonly='' instmods sr_mod sd_mod scsi_dh scsi_dh_rdac scsi_dh_emc
|
||||
hostonly='' instmods pcmcia firewire-ohci
|
||||
hostonly='' instmods usb_storage sdhci sdhci-pci
|
||||
|
||||
# install keyboard support
|
||||
hostonly='' instmods atkbd i8042 usbhid hid-apple ehci-hcd ohci-hcd uhci-hcd
|
||||
@@ -17,14 +18,15 @@ if [[ -z $drivers ]]; then
|
||||
if ! [[ $hostonly ]]; then
|
||||
if [[ -z $filesystems ]]; then
|
||||
instmods '=fs'
|
||||
# hardcoded list of exceptions
|
||||
# to save a lot of space
|
||||
rm -fr ${initdir}/lib/modules/*/kernel/fs/ocfs2
|
||||
else
|
||||
instmods $filesystems
|
||||
fi
|
||||
else
|
||||
hostonly='' instmods $(get_fs_type "/dev/block/$(find_root_block_device)")
|
||||
fi
|
||||
# hardcoded list of exceptions
|
||||
rm -fr ${initdir}/lib/modules/*/kernel/fs/ocfs2
|
||||
else
|
||||
hostonly='' instmods $drivers $filesystems
|
||||
fi
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
inst lvm
|
||||
|
||||
inst_rules "$moddir/64-lvm.rules" 64-lvm.rules
|
||||
inst_rules "$moddir/64-lvm.rules"
|
||||
|
||||
if [[ $hostonly ]] || [[ $lvmconf = "yes" ]]; then
|
||||
if [ -f /etc/lvm/lvm.conf ]; then
|
||||
@@ -16,3 +16,14 @@ inst_rules 10-dm.rules 13-dm-disk.rules 95-dm-notify.rules 11-dm-lvm.rules
|
||||
|
||||
inst "$moddir/lvm_scan.sh" /sbin/lvm_scan
|
||||
inst_hook cmdline 30 "$moddir/parse-lvm.sh"
|
||||
|
||||
|
||||
if ldd $(which lvm) | grep -q lib64; then
|
||||
LIBDIR="/lib64"
|
||||
else
|
||||
LIBDIR="/lib"
|
||||
fi
|
||||
|
||||
for i in $(ls /{usr,}/$LIBDIR/libdevmapper-event-lvm*.so 2>/dev/null); do
|
||||
dracut_install $i
|
||||
done
|
||||
|
18
modules.d/90lvm/parse-lvm.sh
Normal file → Executable file
18
modules.d/90lvm/parse-lvm.sh
Normal file → Executable file
@@ -1,10 +1,18 @@
|
||||
if getarg rd_NO_LVM; then
|
||||
info "rd_NO_LVM: removing LVM activation"
|
||||
rm -f /etc/udev/rules.d/64-lvm*.rules
|
||||
fi
|
||||
|
||||
if [ -e /etc/lvm/lvm.conf ] && getarg rd_NO_LVMCONF; then
|
||||
rm -f /etc/lvm/lvm.conf
|
||||
fi
|
||||
|
||||
if getarg rd_NO_LVM; then
|
||||
info "rd_NO_LVM: removing LVM activation"
|
||||
rm -f /etc/udev/rules.d/64-lvm*.rules
|
||||
else
|
||||
for dev in $(getargs rd_LVM_VG=) $(getargs rd_LVM_LV=); do
|
||||
printf '[ -e "/dev/%s" ] || exit 1\n' $dev \
|
||||
>> /initqueue-finished/lvm.sh
|
||||
{
|
||||
printf '[ -e "/dev/%s" ] || ' $dev
|
||||
printf 'warn "LVM "%s" not found"\n' $dev
|
||||
} >> /emergency/00-lvm.sh
|
||||
done
|
||||
fi
|
||||
|
||||
|
@@ -37,7 +37,7 @@ LABEL="md_auto_end"
|
||||
#
|
||||
# Incrementally build the md array
|
||||
#
|
||||
RUN+="/sbin/mdadm -I --no-degraded $env{DEVNAME}"
|
||||
RUN+="/sbin/mdadm -I $env{DEVNAME}"
|
||||
|
||||
RUN+="/bin/ln -s /sbin/md_finished.sh /initqueue-finished/md_finished.sh"
|
||||
|
||||
|
@@ -6,7 +6,7 @@ which mdadm >/dev/null 2>&1 || exit 1
|
||||
. $dracutfunctions
|
||||
[[ $debug ]] && set -x
|
||||
|
||||
is_mdraid() { get_fs_type /dev/block/$1 |egrep -q '(linux|isw)_raid'; }
|
||||
is_mdraid() { [[ -d "/sys/dev/block/$1/md" ]]; }
|
||||
|
||||
[[ $1 = '-h' ]] && {
|
||||
rootdev=$(find_root_block_device)
|
||||
@@ -16,7 +16,7 @@ is_mdraid() { get_fs_type /dev/block/$1 |egrep -q '(linux|isw)_raid'; }
|
||||
check_block_and_slaves is_mdraid "$rootdev" || exit 1
|
||||
else
|
||||
# root is not on a block device, use the shotgun approach
|
||||
blkid | grep -q linux_raid || exit 1
|
||||
blkid | egrep -q '(linux|isw)_raid' || exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
0
modules.d/90mdraid/md-noimsm.sh
Normal file → Executable file
0
modules.d/90mdraid/md-noimsm.sh
Normal file → Executable file
0
modules.d/90mdraid/md_finished.sh
Normal file → Executable file
0
modules.d/90mdraid/md_finished.sh
Normal file → Executable file
0
modules.d/90mdraid/mdmon-pre-udev.sh
Normal file → Executable file
0
modules.d/90mdraid/mdmon-pre-udev.sh
Normal file → Executable file
@@ -4,7 +4,21 @@
|
||||
# run mdadm if udev has settled
|
||||
info "Assembling MD RAID arrays"
|
||||
udevadm control --stop-exec-queue
|
||||
mdadm -IRs 2>&1 | vinfo
|
||||
mdadm -As --auto=yes --run 2>&1 | vinfo
|
||||
mdadm -Is --run 2>&1 | vinfo
|
||||
|
||||
# there could still be some leftover devices
|
||||
# which have had a container added
|
||||
for md in /dev/md[0-9]* /dev/md/*; do
|
||||
[ -b "$md" ] || continue
|
||||
udevinfo="$(udevadm info --query=env --name=$md)"
|
||||
strstr "$udevinfo" "MD_UUID=" && continue
|
||||
strstr "$udevinfo" "MD_LEVEL=container" && continue
|
||||
strstr "$udevinfo" "DEVTYPE=partition" && continue
|
||||
mdadm --run "$md" 2>&1 | vinfo
|
||||
done
|
||||
unset udevinfo
|
||||
|
||||
ln -s /sbin/mdraid-cleanup /pre-pivot/30-mdraid-cleanup.sh 2>/dev/null
|
||||
ln -s /sbin/mdraid-cleanup /pre-pivot/31-mdraid-cleanup.sh 2>/dev/null
|
||||
udevadm control --start-exec-queue
|
||||
|
4
modules.d/90mdraid/parse-md.sh
Normal file → Executable file
4
modules.d/90mdraid/parse-md.sh
Normal file → Executable file
@@ -30,6 +30,10 @@ if [ -e /etc/mdadm.conf ] && ! getarg rd_NO_MDADMCONF; then
|
||||
rm -f /pre-pivot/*mdraid-cleanup.sh
|
||||
fi
|
||||
|
||||
if getarg rd_NO_MDADMCONF; then
|
||||
rm -f /etc/mdadm/mdadm.conf /etc/mdadm.conf
|
||||
fi
|
||||
|
||||
# noiswmd nodmraid for anaconda / rc.sysinit compatibility
|
||||
# note nodmraid really means nobiosraid, so we don't want MDIMSM then either
|
||||
if getarg rd_NO_MDIMSM || getarg noiswmd || getarg nodmraid; then
|
||||
|
@@ -1,9 +0,0 @@
|
||||
# scan for multipath devices
|
||||
SUBSYSTEM!="block", GOTO="end_mpath_scan"
|
||||
KERNEL!="sd*", GOTO="end_mpath_scan"
|
||||
PROGRAM=="/bin/sh -c 'for i in $sys/$devpath/holders/dm-[0-9]*; do [ -e $$i ] && exit 0; done; exit 1;' ", GOTO="end_mpath_scan"
|
||||
RUN+="/sbin/modprobe dm-multipath"
|
||||
RUN+="/bin/echo 'queuing multipath scan'"
|
||||
RUN+="/sbin/initqueue --settled --onetime --unique --name mpscan /sbin/multipath-scan"
|
||||
RUN+="/bin/sh -c '>/tmp/.multipath-scan-%k;'"
|
||||
LABEL="end_mpath_scan"
|
@@ -14,10 +14,12 @@ is_mpath() {
|
||||
return 1
|
||||
}
|
||||
|
||||
# Do mpath if we appear to be using it for /
|
||||
rootdev=$(find_root_block_device)
|
||||
if [[ $rootdev ]]; then
|
||||
check_block_and_slaves is_mpath "$rootdev" && exit 0
|
||||
if [[ $1 = -h ]]; then
|
||||
rootdev=$(find_root_block_device)
|
||||
if [[ $rootdev ]]; then
|
||||
check_block_and_slaves is_mpath "$rootdev" && exit 0
|
||||
fi
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exit 1
|
||||
exit 0
|
@@ -1,9 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -f /etc/multipath.conf ]; then
|
||||
inst /etc/multipath.conf
|
||||
fi
|
||||
|
||||
if ldd $(which multipath) 2>/dev/null |grep -q lib64; then
|
||||
LIBDIR="/lib64"
|
||||
else
|
||||
@@ -19,6 +15,8 @@ for f in \
|
||||
/sbin/xdrgetuid \
|
||||
/sbin/xdrgetprio \
|
||||
/etc/xdrdevices.conf \
|
||||
/etc/multipath.conf \
|
||||
/etc/multipath/wwids \
|
||||
$(ls $LIBDIR/libmultipath* $LIBDIR/multipath/* 2>/dev/null) \
|
||||
;do
|
||||
[ -e "$f" ] && inst "$f"
|
||||
@@ -28,5 +26,3 @@ inst_hook pre-trigger 02 "$moddir/multipathd.sh"
|
||||
inst_hook pre-pivot 02 "$moddir/multipathd-stop.sh"
|
||||
inst_rules 40-multipath.rules
|
||||
|
||||
inst "$moddir/multipath-scan.sh" /sbin/multipath-scan
|
||||
inst_rules "$moddir/9-multipath-scan.rules"
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
mp_mod_test() {
|
||||
local mpfuncs='scsi_register_device_handler|dm_dirty_log_type_register|dm_register_path_selector|dm_register_target'
|
||||
nm -uPA "$1" | egrep -q "$mpfuncs"
|
||||
egrep -q "$mpfuncs" "$1"
|
||||
}
|
||||
|
||||
instmods $(filter_kernel_modules mp_mod_test)
|
||||
|
@@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# scan for multipaths if udev has settled
|
||||
|
||||
. /lib/dracut-lib.sh
|
||||
|
||||
[ -d /etc/multipath ] || mkdir -p /etc/multipath
|
||||
mpdevs=$(
|
||||
for f in /tmp/.multipath-scan-* ; do
|
||||
[ -e "$f" ] || continue
|
||||
echo -n "${f##/tmp/.multipath-scan-} "
|
||||
done
|
||||
)
|
||||
|
||||
[ -e /etc/multipath.conf ] || exit 1
|
||||
multipath ${mpdevs}
|
@@ -1,6 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -e /etc/multipath.conf ]; then
|
||||
multipathd
|
||||
if [ -e /etc/multipath.conf -a -e /etc/multipath/wwids ]; then
|
||||
modprobe dm-multipath
|
||||
multipathd
|
||||
else
|
||||
rm /etc/udev/rules.d/??-multipath.rules 2>/dev/null
|
||||
fi
|
||||
|
||||
|
@@ -1,3 +1,5 @@
|
||||
#!/bin/bash
|
||||
dracut_install -o ps grep more cat rm strace free showmount
|
||||
dracut_install -o ping netstat rpcinfo vi scp ping6 ssh
|
||||
dracut_install -o fsck fsck.ext2 fsck.ext4 fsck.ext3 fsck.ext4dev fsck.vfat
|
||||
|
||||
|
@@ -7,8 +7,8 @@
|
||||
# Write udev rules
|
||||
{
|
||||
if [ -n "$fcoe_mac" ] ; then
|
||||
printf 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="%s", RUN+="/sbin/fcoe-up $env{INTERFACE} %s"\n' "$fcoe_mac" "$fcoe_dcb"
|
||||
printf 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="%s", RUN+="/sbin/initqueue --onetime --unique --name fcoe-up-$env{INTERFACE} /sbin/fcoe-up $env{INTERFACE} %s"\n' "$fcoe_mac" "$fcoe_dcb"
|
||||
else
|
||||
printf 'ACTION=="add", SUBSYSTEM=="net", NAME=="%s", RUN+="/sbin/fcoe-up $env{INTERFACE} %s"\n' "$fcoe_interface" "$fcoe_dcb"
|
||||
printf 'ACTION=="add", SUBSYSTEM=="net", NAME=="%s", RUN+="/sbin/initqueue --onetime --unique --name fcoe-up-$env{INTERFACE} /sbin/fcoe-up $env{INTERFACE} %s"\n' "$fcoe_interface" "$fcoe_dcb"
|
||||
fi
|
||||
} > /etc/udev/rules.d/60-fcoe.rules
|
||||
|
@@ -11,17 +11,27 @@ PATH=$PATH:/sbin:/usr/sbin
|
||||
# Huh? Missing arguments ??
|
||||
[ -z "$1" -o -z "$2" ] && exit 1
|
||||
|
||||
export PS4="fcoe-up.$1.$$ + "
|
||||
exec >>/dev/initlog.pipe 2>>/dev/initlog.pipe
|
||||
. /lib/dracut-lib.sh
|
||||
|
||||
netif=$1
|
||||
dcb=$2
|
||||
|
||||
/sbin/ip link set "$netif" up
|
||||
wait_for_if_up "$netif"
|
||||
|
||||
if [ "$dcb" = "dcb" ]; then
|
||||
# Note lldpad will stay running after switchroot, the system initscripts
|
||||
# are to kill it and start a new lldpad to take over. Data is transfered
|
||||
# between the 2 using a shm segment
|
||||
lldpad -d
|
||||
# stupid tools, need sleep
|
||||
sleep 1
|
||||
dcbtool sc "$netif" dcb on
|
||||
sleep 1
|
||||
dcbtool sc "$netif" app:fcoe e:1 a:1 w:1
|
||||
sleep 1
|
||||
fipvlan "$netif" -c -s
|
||||
else
|
||||
echo -n "$netif" > /sys/module/fcoe/parameters/create
|
||||
|
@@ -4,6 +4,8 @@ dracut_install ip
|
||||
inst dcbtool
|
||||
inst fipvlan
|
||||
inst lldpad
|
||||
inst vconfig
|
||||
|
||||
mkdir -p "$initdir/var/lib/lldpad"
|
||||
|
||||
inst "$moddir/fcoe-up" "/sbin/fcoe-up"
|
||||
|
@@ -1,2 +1,2 @@
|
||||
#!/bin/bash
|
||||
instmods fcoe
|
||||
instmods fcoe 8021q
|
||||
|
@@ -33,7 +33,7 @@ iroot=${iroot#iscsi:}
|
||||
|
||||
# XXX modprobe crc32c should go in the cmdline parser, but I haven't yet
|
||||
# figured out a way how to check whether this is built-in or not
|
||||
modprobe crc32c
|
||||
modprobe crc32c 2>/dev/null
|
||||
|
||||
|
||||
[ -e /tmp/root.info ] && . /tmp/root.info
|
||||
@@ -67,112 +67,126 @@ arg=$(getarg iscsi_in_username)
|
||||
arg=$(getarg iscsi_in_password)
|
||||
[ -n "$arg" ] && iscsi_in_password=$arg
|
||||
|
||||
# override conf/commandline options by dhcp root_path
|
||||
# FIXME this assumes that all values have been provided
|
||||
OLDIFS="$IFS"
|
||||
IFS=@
|
||||
set $iroot
|
||||
if [ $# -gt 1 ]; then
|
||||
authinfo=$1; shift
|
||||
iroot=$*
|
||||
handle_netroot()
|
||||
{
|
||||
iroot=$1
|
||||
# override conf/commandline options by dhcp root_path
|
||||
# FIXME this assumes that all values have been provided
|
||||
OLDIFS="$IFS"
|
||||
IFS=@
|
||||
set $iroot
|
||||
if [ $# -gt 1 ]; then
|
||||
authinfo=$1; shift
|
||||
iroot=$*
|
||||
# allow empty authinfo to allow having an @ in iscsi_target_name like this:
|
||||
# netroot=iscsi:@192.168.1.100::3260::iqn.2009-01.com.example:testdi@sk
|
||||
if [ -n "$authinfo" ]; then
|
||||
IFS=:
|
||||
set $authinfo
|
||||
iscsi_username=$1
|
||||
iscsi_password=$2
|
||||
if [ $# -gt 2 ]; then
|
||||
iscsi_in_username=$3
|
||||
iscsi_in_password=$4
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if [ -n "$authinfo" ]; then
|
||||
IFS=:
|
||||
set $authinfo
|
||||
iscsi_username=$1
|
||||
iscsi_password=$2
|
||||
if [ $# -gt 2 ]; then
|
||||
iscsi_in_username=$3
|
||||
iscsi_in_password=$4
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
IFS="$OLDIFS"
|
||||
IFS="$OLDIFS"
|
||||
|
||||
local v=${iroot}:
|
||||
local i
|
||||
set --
|
||||
while [ -n "$v" ]; do
|
||||
if [ "${v#\[*:*:*\]:}" != "$v" ]; then
|
||||
local v=${iroot}:
|
||||
local i
|
||||
set --
|
||||
while [ -n "$v" ]; do
|
||||
if [ "${v#\[*:*:*\]:}" != "$v" ]; then
|
||||
# handle IPv6 address
|
||||
i="${v%%\]:*}"
|
||||
i="${i##\[}"
|
||||
set -- "$@" "$i"
|
||||
v=${v#\[$i\]:}
|
||||
else
|
||||
set -- "$@" "${v%%:*}"
|
||||
v=${v#*:}
|
||||
fi
|
||||
done
|
||||
iscsi_target_ip=$1; shift
|
||||
iscsi_protocol=$1; shift # ignored
|
||||
iscsi_target_port=$1; shift
|
||||
iscsi_lun=$1; shift
|
||||
IFS=:
|
||||
iscsi_target_name=$*
|
||||
IFS="$OLDIFS"
|
||||
i="${v%%\]:*}"
|
||||
i="${i##\[}"
|
||||
set -- "$@" "$i"
|
||||
v=${v#\[$i\]:}
|
||||
else
|
||||
set -- "$@" "${v%%:*}"
|
||||
v=${v#*:}
|
||||
fi
|
||||
done
|
||||
iscsi_target_ip=$1; shift
|
||||
iscsi_protocol=$1; shift # ignored
|
||||
iscsi_target_port=$1; shift
|
||||
iscsi_lun=$1; shift
|
||||
IFS=:
|
||||
iscsi_target_name=$*
|
||||
IFS="$OLDIFS"
|
||||
# XXX is this needed?
|
||||
getarg ro && iscsirw=ro
|
||||
getarg rw && iscsirw=rw
|
||||
fsopts=${fsopts+$fsopts,}${iscsirw}
|
||||
getarg ro && iscsirw=ro
|
||||
getarg rw && iscsirw=rw
|
||||
fsopts=${fsopts+$fsopts,}${iscsirw}
|
||||
|
||||
if [ -z $iscsi_initiator ]; then
|
||||
if [ -z $iscsi_initiator ]; then
|
||||
# XXX Where are these from?
|
||||
[ -f /etc/initiatorname.iscsi ] && . /etc/initiatorname.iscsi
|
||||
[ -f /etc/iscsi/initiatorname.iscsi ] && . /etc/iscsi/initiatorname.iscsi
|
||||
iscsi_initiator=$InitiatorName
|
||||
[ -f /etc/initiatorname.iscsi ] && . /etc/initiatorname.iscsi
|
||||
[ -f /etc/iscsi/initiatorname.iscsi ] && . /etc/iscsi/initiatorname.iscsi
|
||||
iscsi_initiator=$InitiatorName
|
||||
|
||||
# XXX rfc3720 says 'SCSI Initiator Name: The iSCSI Initiator Name specifies
|
||||
# the worldwide unique name of the initiator.' Could we use hostname/ip
|
||||
# if missing?
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z $iscsi_target_port ]; then
|
||||
iscsi_target_port=3260
|
||||
fi
|
||||
if [ -z $iscsi_target_port ]; then
|
||||
iscsi_target_port=3260
|
||||
fi
|
||||
|
||||
if [ -z $iscsi_target_group ]; then
|
||||
iscsi_target_group=1
|
||||
fi
|
||||
if [ -z $iscsi_target_group ]; then
|
||||
iscsi_target_group=1
|
||||
fi
|
||||
|
||||
if [ -z $iscsi_initiator ]; then
|
||||
if [ -z $iscsi_initiator ]; then
|
||||
# XXX is this correct?
|
||||
iscsi_initiator=$(iscsi-iname)
|
||||
fi
|
||||
iscsi_initiator=$(iscsi-iname)
|
||||
fi
|
||||
|
||||
if [ -z $iscsi_lun ]; then
|
||||
iscsi_lun=0
|
||||
fi
|
||||
if [ -z $iscsi_lun ]; then
|
||||
iscsi_lun=0
|
||||
fi
|
||||
|
||||
echo "InitiatorName='$iscsi_initiator'" > /dev/.initiatorname.iscsi
|
||||
echo "InitiatorName='$iscsi_initiator'" > /dev/.initiatorname.iscsi
|
||||
|
||||
# FIXME $iscsi_protocol??
|
||||
|
||||
if [ -n "${root%%block:*}" ]; then
|
||||
if [ -n "${root%%block:*}" ]; then
|
||||
# if root is not specified try to mount the whole iSCSI LUN
|
||||
printf 'SYMLINK=="disk/by-path/*-iscsi-*-%s", SYMLINK+="root"\n' $iscsi_lun >> /etc/udev/rules.d/99-iscsi-root.rules
|
||||
fi
|
||||
printf 'SYMLINK=="disk/by-path/*-iscsi-*-%s", SYMLINK+="root"\n' $iscsi_lun >> /etc/udev/rules.d/99-iscsi-root.rules
|
||||
fi
|
||||
|
||||
# inject new exit_if_exists
|
||||
echo 'settle_exit_if_exists="--exit-if-exists=/dev/root"; rm "$job"' > /initqueue/iscsi-settle.sh
|
||||
# inject new exit_if_exists
|
||||
echo 'settle_exit_if_exists="--exit-if-exists=/dev/root"; rm "$job"' > /initqueue/iscsi-settle.sh
|
||||
|
||||
# force udevsettle to break
|
||||
> /initqueue/work
|
||||
# force udevsettle to break
|
||||
> /initqueue/work
|
||||
|
||||
iscsistart -i $iscsi_initiator -t $iscsi_target_name \
|
||||
-g $iscsi_target_group -a $iscsi_target_ip \
|
||||
-p $iscsi_target_port \
|
||||
${iscsi_username+-u $iscsi_username} \
|
||||
${iscsi_password+-w $iscsi_password} \
|
||||
${iscsi_in_username+-U $iscsi_in_username} \
|
||||
${iscsi_in_password+-W $iscsi_in_password} || exit 1
|
||||
iscsistart -i $iscsi_initiator -t $iscsi_target_name \
|
||||
-g $iscsi_target_group -a $iscsi_target_ip \
|
||||
-p $iscsi_target_port \
|
||||
${iscsi_username+-u $iscsi_username} \
|
||||
${iscsi_password+-w $iscsi_password} \
|
||||
${iscsi_in_username+-U $iscsi_in_username} \
|
||||
${iscsi_in_password+-W $iscsi_in_password} || :
|
||||
|
||||
# install mount script
|
||||
if [ -n "${root%%block:*}" ]; then
|
||||
if [ -n "${root%%block:*}" ]; then
|
||||
# if root is not specified try to mount the whole iSCSI LUN
|
||||
echo "iscsi_lun=$iscsi_lun . /bin/mount-lun.sh " > /mount/01-$$-iscsi.sh
|
||||
echo "iscsi_lun=$iscsi_lun . /bin/mount-lun.sh " > /mount/01-$$-iscsi.sh
|
||||
fi
|
||||
}
|
||||
|
||||
# loop over all netroot parameter
|
||||
if getarg netroot; then
|
||||
for nroot in $(getargs netroot); do
|
||||
[ "${netroot%%:*}" = "iscsi" ] || continue
|
||||
handle_netroot ${nroot##iscsi:}
|
||||
done
|
||||
else
|
||||
handle_netroot $iroot
|
||||
fi
|
||||
|
||||
# now we have a root filesystem somewhere in /dev/sda*
|
||||
|
@@ -16,16 +16,13 @@ else
|
||||
fi
|
||||
|
||||
dracut_install $(ls {/usr,}$LIBDIR/libnfsidmap_nsswitch.so* 2>/dev/null )
|
||||
#dracut_install $(ls {/usr,}$LIBDIR/libnfsidmap*.so* 2>/dev/null )
|
||||
dracut_install $(ls {/usr,}$LIBDIR/libnfsidmap/*.so 2>/dev/null )
|
||||
dracut_install $(ls {/usr,}$LIBDIR/libnfsidmap*.so* 2>/dev/null )
|
||||
|
||||
nsslibs=$(for j in $(for i in \
|
||||
$(egrep -v '^#.*' /etc/nsswitch.conf|cut -f2 -d :\
|
||||
|fgrep -v NOTFOUND); do \
|
||||
echo "libnss_${i}.so";\
|
||||
done|sort -u); do \
|
||||
echo -n "|$j";\
|
||||
done)
|
||||
nsslibs=${nsslibs##|}
|
||||
nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \
|
||||
| tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|')
|
||||
nsslibs=${nsslibs#|}
|
||||
nsslibs=${nsslibs%|}
|
||||
|
||||
dracut_install $(for i in $(ls {/usr,}$LIBDIR/libnss*.so 2>/dev/null); do echo $i;done | egrep "$nsslibs")
|
||||
|
||||
|
0
modules.d/95nfs/nfsroot-cleanup.sh
Normal file → Executable file
0
modules.d/95nfs/nfsroot-cleanup.sh
Normal file → Executable file
11
modules.d/95resume/resume-genrules.sh
Normal file → Executable file
11
modules.d/95resume/resume-genrules.sh
Normal file → Executable file
@@ -1,13 +1,16 @@
|
||||
if [ -n "$resume" ]; then
|
||||
{
|
||||
printf "KERNEL==\"%s\", ACTION==\"add|change\", SYMLINK+=\"/dev/resume\"\n" \
|
||||
${resume#/dev/};
|
||||
printf "SYMLINK==\"%s\", ACTION==\"add|change\", SYMLINK+=\"/dev/resume\"\n" \
|
||||
${resume#/dev/};
|
||||
} >> /dev/.udev/rules.d/99-resume-link.rules
|
||||
|
||||
{
|
||||
printf "KERNEL==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/bin/sh -c 'echo %%M:%%m > /sys/power/resume'\"\n" \
|
||||
${resume#/dev/};
|
||||
printf "SYMLINK==\"%s\", ACTION==\"add|change\", ENV{ID_FS_TYPE}==\"suspend|swsuspend|swsupend\", RUN+=\"/bin/sh -c 'echo %%M:%%m > /sys/power/resume'\"\n" \
|
||||
${resume#/dev/};
|
||||
printf "KERNEL==\"%s\", ACTION==\"add|change\", SYMLINK+=\"/dev/resume\"\n" \
|
||||
${resume#/dev/};
|
||||
printf "SYMLINK==\"%s\", ACTION==\"add|change\", SYMLINK+=\"/dev/resume\"\n" \
|
||||
${resume#/dev/};
|
||||
} >> /etc/udev/rules.d/99-resume.rules
|
||||
|
||||
printf '[ -e "%s" ] && { ln -s "%s" /dev/resume; rm "$job"; }\n' \
|
||||
|
4
modules.d/95rootfs-block/block-genrules.sh
Normal file → Executable file
4
modules.d/95rootfs-block/block-genrules.sh
Normal file → Executable file
@@ -1,10 +1,10 @@
|
||||
if [ "${root%%:*}" = "block" ]; then
|
||||
(
|
||||
{
|
||||
printf 'KERNEL=="%s", SYMLINK+="root"\n' \
|
||||
${root#block:/dev/}
|
||||
printf 'SYMLINK=="%s", SYMLINK+="root"\n' \
|
||||
${root#block:/dev/}
|
||||
) >> /etc/udev/rules.d/99-mount.rules
|
||||
} >> /dev/.udev/rules.d/99-root.rules
|
||||
|
||||
printf '[ -e "%s" ] && { ln -s "%s" /dev/root 2>/dev/null; rm "$job"; }\n' \
|
||||
"${root#block:}" "${root#block:}" >> /initqueue-settled/blocksymlink.sh
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user