Compare commits
351 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
04bf862d97 | ||
![]() |
3f979ee495 | ||
![]() |
3944c4b136 | ||
![]() |
97ff396a97 | ||
![]() |
8ff624df9f | ||
![]() |
5711f54312 | ||
![]() |
c3cdd9f6e1 | ||
![]() |
1339095dba | ||
![]() |
4358ace43c | ||
![]() |
8b52e96f09 | ||
![]() |
0ad2471c3a | ||
![]() |
b52cfbeaa5 | ||
![]() |
6755c20855 | ||
![]() |
7c433a0b43 | ||
![]() |
d5e5855b74 | ||
![]() |
3b1d78880f | ||
![]() |
4d9d767da2 | ||
![]() |
b562bc55a8 | ||
![]() |
dfec3c2d8b | ||
![]() |
8c5d18c2cb | ||
![]() |
d6e23c46c2 | ||
![]() |
4f0c7fc917 | ||
![]() |
c4184b5cf1 | ||
![]() |
1a61d85ef2 | ||
![]() |
514aeec5b4 | ||
![]() |
6964169368 | ||
![]() |
acf82efd52 | ||
![]() |
e409c9e8f8 | ||
![]() |
0e5c01f8b8 | ||
![]() |
311aee1bff | ||
![]() |
0b7bfacfea | ||
![]() |
3ac9cdb1c5 | ||
![]() |
c071990c2c | ||
![]() |
ee84640963 | ||
![]() |
f8139a8b28 | ||
![]() |
cfa365a32d | ||
![]() |
a1b4efe6a7 | ||
![]() |
3586a7aa77 | ||
![]() |
81b67232dc | ||
![]() |
27c9d1f20f | ||
![]() |
10e59202c7 | ||
![]() |
7b56b90582 | ||
![]() |
3e3ed34f03 | ||
![]() |
50f8ae457c | ||
![]() |
a601870064 | ||
![]() |
8cd8820547 | ||
![]() |
471439f564 | ||
![]() |
e668f3bc36 | ||
![]() |
351de47882 | ||
![]() |
07d9319d54 | ||
![]() |
7c5ec0f5be | ||
![]() |
79bc77d2f4 | ||
![]() |
874b013573 | ||
![]() |
ffa0ee5d16 | ||
![]() |
a742c80778 | ||
![]() |
04ba461045 | ||
![]() |
6d58fa27a4 | ||
![]() |
822a7ae504 | ||
![]() |
b0b60c8e05 | ||
![]() |
4851deca54 | ||
![]() |
437dad70e9 | ||
![]() |
a3e464ca43 | ||
![]() |
be82884d35 | ||
![]() |
180e9d7851 | ||
![]() |
d3d52b20e9 | ||
![]() |
23446ef1e0 | ||
![]() |
ec06c5d3b5 | ||
![]() |
d3be9275c7 | ||
![]() |
13efce5d1b | ||
![]() |
f53ede36fb | ||
![]() |
97cb17c792 | ||
![]() |
3b82ac1696 | ||
![]() |
99ccbc30df | ||
![]() |
e93d0bea38 | ||
![]() |
833e0f9e83 | ||
![]() |
c902aba0d4 | ||
![]() |
2bc5054a64 | ||
![]() |
b67d810785 | ||
![]() |
bbbdba2ec3 | ||
![]() |
863e18b4cd | ||
![]() |
a18d5494eb | ||
![]() |
cbb4b50e02 | ||
![]() |
ae43adb70d | ||
![]() |
ddfefd05fc | ||
![]() |
25e08a0973 | ||
![]() |
6f92423c89 | ||
![]() |
5641b0974b | ||
![]() |
5c44f43e69 | ||
![]() |
3c20ac5377 | ||
![]() |
afcc697cb8 | ||
![]() |
636d2d46a5 | ||
![]() |
21a209735a | ||
![]() |
bee086532f | ||
![]() |
df1e8127da | ||
![]() |
481ee9e6fc | ||
![]() |
9f0878540b | ||
![]() |
9119059723 | ||
![]() |
28eae10b70 | ||
![]() |
363469d757 | ||
![]() |
dea0634544 | ||
![]() |
1bcb63f97c | ||
![]() |
b0472eac11 | ||
![]() |
d6e34d362a | ||
![]() |
7075a402d7 | ||
![]() |
5729ae8029 | ||
![]() |
a7d3ad67c7 | ||
![]() |
7e9341434f | ||
![]() |
6ac2c83570 | ||
![]() |
05b879ed2a | ||
![]() |
38e217704a | ||
![]() |
e97ed33775 | ||
![]() |
04942c4569 | ||
![]() |
296d013f1a | ||
![]() |
64a69cb49f | ||
![]() |
70598ac292 | ||
![]() |
2a12e97475 | ||
![]() |
8a430ab25b | ||
![]() |
2a5a7fb662 | ||
![]() |
f182cb9599 | ||
![]() |
9dc0c244b8 | ||
![]() |
b4fb539c9b | ||
![]() |
18423f7951 | ||
![]() |
6dcc5e1158 | ||
![]() |
e3e1f406bb | ||
![]() |
496e3d962d | ||
![]() |
7cddd7b838 | ||
![]() |
93342718cd | ||
![]() |
4ba44e899c | ||
![]() |
36e8ce4fb0 | ||
![]() |
4089949033 | ||
![]() |
eb8f202ed0 | ||
![]() |
c59779cf93 | ||
![]() |
1dc360790d | ||
![]() |
e0dc6cd4f6 | ||
![]() |
ebc82d38b7 | ||
![]() |
c9364f6ea2 | ||
![]() |
332ecaa900 | ||
![]() |
3e7a05f2a5 | ||
![]() |
733c71ce9e | ||
![]() |
a17d5cf494 | ||
![]() |
bea41b898a | ||
![]() |
e683985d10 | ||
![]() |
4b6b46bb2a | ||
![]() |
fe116c1670 | ||
![]() |
7700b3df4c | ||
![]() |
486030575d | ||
![]() |
ce8f354dbd | ||
![]() |
a262ad91e8 | ||
![]() |
681462eca8 | ||
![]() |
9492008435 | ||
![]() |
22e837b645 | ||
![]() |
0a68a26cff | ||
![]() |
8b257fcc86 | ||
![]() |
c64a94caa9 | ||
![]() |
8d40852e8c | ||
![]() |
cd72830807 | ||
![]() |
206345ce9b | ||
![]() |
4d25892179 | ||
![]() |
6df523517f | ||
![]() |
118ca9ecfc | ||
![]() |
3838dc47c3 | ||
![]() |
5c84d51b3f | ||
![]() |
517d27a75f | ||
![]() |
3ae60e559f | ||
![]() |
7c2311660f | ||
![]() |
bd44831b82 | ||
![]() |
e3eec4b8a2 | ||
![]() |
fe273e3901 | ||
![]() |
3244bf5981 | ||
![]() |
56663e7e32 | ||
![]() |
f34a2ef14d | ||
![]() |
c4d8793c67 | ||
![]() |
54e28d79b9 | ||
![]() |
2e34f38095 | ||
![]() |
9ebf4a5d3c | ||
![]() |
a3a2266046 | ||
![]() |
4aad3438f7 | ||
![]() |
442abd16d2 | ||
![]() |
8f4ee8c71b | ||
![]() |
15eed1e4f1 | ||
![]() |
36894743e3 | ||
![]() |
ae8e6ed5af | ||
![]() |
552c37e156 | ||
![]() |
1f8abe81a9 | ||
![]() |
25b987fed6 | ||
![]() |
414dc51ca2 | ||
![]() |
ca4108b78e | ||
![]() |
c440d302f1 | ||
![]() |
3ae03005b8 | ||
![]() |
99d4fd6bb7 | ||
![]() |
3a04bddeed | ||
![]() |
fa45d0d9c9 | ||
![]() |
3659d64df3 | ||
![]() |
370035d561 | ||
![]() |
2b2033e561 | ||
![]() |
78a78e4239 | ||
![]() |
856f8265aa | ||
![]() |
cf864c1b80 | ||
![]() |
26d14fb3d3 | ||
![]() |
e1e4ee9d7c | ||
![]() |
778b354360 | ||
![]() |
af67d62151 | ||
![]() |
027565d023 | ||
![]() |
66fd7e4329 | ||
![]() |
56d2aed1c8 | ||
![]() |
27dcc3a583 | ||
![]() |
5cac9e14ec | ||
![]() |
d9935e4664 | ||
![]() |
f95b78f3eb | ||
![]() |
84125ddae1 | ||
![]() |
2f0f1b0bbc | ||
![]() |
34a1ec6a36 | ||
![]() |
972d6b44ba | ||
![]() |
3947f07d93 | ||
![]() |
3c90cc2f48 | ||
![]() |
1c08ad507b | ||
![]() |
ab2f95e45e | ||
![]() |
eda73c0ad2 | ||
![]() |
f44b084660 | ||
![]() |
cfd51d2be2 | ||
![]() |
d829e7fce2 | ||
![]() |
246d285561 | ||
![]() |
192990ce85 | ||
![]() |
7a3e1a0e4a | ||
![]() |
3507635bc6 | ||
![]() |
b4692d07ee | ||
![]() |
05065741f0 | ||
![]() |
b09faad877 | ||
![]() |
7e50abfdb8 | ||
![]() |
a49cac2e65 | ||
![]() |
5058ae2d29 | ||
![]() |
2f954621cc | ||
![]() |
d681635512 | ||
![]() |
80043e21c1 | ||
![]() |
37383f7123 | ||
![]() |
7e692cfd43 | ||
![]() |
e3250e2055 | ||
![]() |
29763cb72d | ||
![]() |
d4ce0e5e09 | ||
![]() |
23ad117c49 | ||
![]() |
cea907f6bf | ||
![]() |
5f2baf7dc6 | ||
![]() |
8a203398ef | ||
![]() |
967cc19ab1 | ||
![]() |
6770af96d4 | ||
![]() |
e7ba1392e1 | ||
![]() |
c23d6ce6ea | ||
![]() |
e81836f328 | ||
![]() |
4f03054e54 | ||
![]() |
85752f0f5f | ||
![]() |
7c752ffaef | ||
![]() |
e27ecc9ae8 | ||
![]() |
8e3f653749 | ||
![]() |
e84af01462 | ||
![]() |
338bad6393 | ||
![]() |
504c0a8fec | ||
![]() |
bc140a0b29 | ||
![]() |
ccb8ce0403 | ||
![]() |
95957248a1 | ||
![]() |
99128f2b64 | ||
![]() |
80626ded3e | ||
![]() |
9efb74a32d | ||
![]() |
49fe860b22 | ||
![]() |
b96ea1e196 | ||
![]() |
4a3f3ba68c | ||
![]() |
a628b7caf5 | ||
![]() |
11b5db88c2 | ||
![]() |
e02a29e7a2 | ||
![]() |
ae488efa5e | ||
![]() |
32125a976b | ||
![]() |
068531232b | ||
![]() |
2db6d71118 | ||
![]() |
4e1f8d0c5f | ||
![]() |
28d03673f9 | ||
![]() |
ba7dab6dba | ||
![]() |
caa72f8290 | ||
![]() |
eab9b75c8a | ||
![]() |
ece72160ce | ||
![]() |
54b68829b6 | ||
![]() |
7b46244bb9 | ||
![]() |
ad8638e04e | ||
![]() |
611c895772 | ||
![]() |
4ef45f13f4 | ||
![]() |
f4eb0d9804 | ||
![]() |
5ea0be0a8c | ||
![]() |
4adeefc4ab | ||
![]() |
6cd7001b35 | ||
![]() |
fecc1d69e5 | ||
![]() |
8ca5e8c319 | ||
![]() |
267a109a81 | ||
![]() |
44537b7bf8 | ||
![]() |
e54d961160 | ||
![]() |
f1a38e5294 | ||
![]() |
6525182bfc | ||
![]() |
1ea5879085 | ||
![]() |
f232f6623d | ||
![]() |
30f6c80d7a | ||
![]() |
54483dd773 | ||
![]() |
b0d844fa74 | ||
![]() |
fbc4620f05 | ||
![]() |
7e59d55042 | ||
![]() |
5a57582050 | ||
![]() |
899f5962ac | ||
![]() |
26cd262a6a | ||
![]() |
05d2a14526 | ||
![]() |
773d6a7ded | ||
![]() |
7eb0bc7bc4 | ||
![]() |
f46c2fff71 | ||
![]() |
5580e4c176 | ||
![]() |
8dcc483053 | ||
![]() |
bb8c16d121 | ||
![]() |
486a8f33e2 | ||
![]() |
ba9f3d3326 | ||
![]() |
78c982667a | ||
![]() |
28f3f537c4 | ||
![]() |
83c9ff7dbb | ||
![]() |
827ec27a9c | ||
![]() |
0fa5dbedc5 | ||
![]() |
ce7f408dfd | ||
![]() |
c4b529f503 | ||
![]() |
c96f1b1e6b | ||
![]() |
ed2005fa5b | ||
![]() |
7a94a4326f | ||
![]() |
1427102692 | ||
![]() |
056a3f2427 | ||
![]() |
8fa1afb65c | ||
![]() |
19bb14c346 | ||
![]() |
56d57a70ec | ||
![]() |
1230f3bcff | ||
![]() |
636cc1ef63 | ||
![]() |
535f61ca4a | ||
![]() |
4e58a1ffc7 | ||
![]() |
48b7ab1b35 | ||
![]() |
9cf339ada3 | ||
![]() |
2c19a5fa78 | ||
![]() |
2e094b20a6 | ||
![]() |
fb0e5184a6 | ||
![]() |
100d575ec9 | ||
![]() |
b31250e7e6 | ||
![]() |
ddfea6b54c | ||
![]() |
12819a5799 | ||
![]() |
d4dd3521bb | ||
![]() |
e920bfb1e8 | ||
![]() |
3c530fc528 | ||
![]() |
37502d2733 | ||
![]() |
ebe7411691 | ||
![]() |
fd9f902477 | ||
![]() |
2c7f7a337a | ||
![]() |
3aaf6ccc83 | ||
![]() |
a9f4b9cdb0 | ||
![]() |
0626cbe923 |
3
.dir-locals.el
Normal file
3
.dir-locals.el
Normal file
@@ -0,0 +1,3 @@
|
||||
((nil . ((setq sh-basic-offset: 4)
|
||||
(setq indent-tabs-mode nil)
|
||||
)))
|
1
.kateconfig
Normal file
1
.kateconfig
Normal file
@@ -0,0 +1 @@
|
||||
kate: space-indent on; tab-width 4; indent-width 4; replace-tabs on; eol unix;
|
9
.kateproject
Normal file
9
.kateproject
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "Kate"
|
||||
, "files": [ { "git": 1 } ]
|
||||
, "build": {
|
||||
"directory": "build"
|
||||
, "build": "make -j $(getconf _NPROCESSORS_ONLN) all"
|
||||
, "clean": "make clean"
|
||||
}
|
||||
}
|
4
.mailmap
4
.mailmap
@@ -10,7 +10,9 @@ Andrey Borzenkov <arvidjaar@gmail.com> <arvidjaar@mail.ru>
|
||||
Dan Horák <dhorak@redhat.com> <dan@danny.cz>
|
||||
John Reiser <jreiser@bitwagon.com> <jreiser@BitWagon.com>
|
||||
Luca Berra <bluca@vodka.it> <bluca@comedia.it>
|
||||
Dave Young <dyoung@redhat.com> dyoung@redhat.com
|
||||
Dave Young <dyoung@redhat.com> <dyoung@redhat.com>
|
||||
Dave Young <dyoung@redhat.com> <dave@redhat.com>
|
||||
Frederick Grose <fgrose@sugarlabs.org> <fgrose@gmail.com>
|
||||
Frederic Crozat <fcrozat@suse.com> <fcrozat@mandriva.com>
|
||||
Shawn W Dunn <sfalken@opensuse.org> <sfalken@opensuse.org>
|
||||
Kyle McMartin <kmcmarti@redhat.com> <kyle@redhat.com>
|
||||
|
@@ -1,32 +1,46 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
if [[ -f /etc/kernel/cmdline ]]; then
|
||||
readarray -t BOOT_OPTIONS < /etc/kernel/cmdline
|
||||
fi
|
||||
|
||||
if ! [[ "${BOOT_OPTIONS[@]}" ]]; then
|
||||
readarray -t BOOT_OPTIONS < /proc/cmdline
|
||||
fi
|
||||
|
||||
unset noimageifnotneeded
|
||||
|
||||
for ((i=0; i < "${#BOOT_OPTIONS[@]}"; i++)); do
|
||||
if [[ ${BOOT_OPTIONS[$i]} == root\=PARTUUID\=* ]]; then
|
||||
noimageifnotneeded="yes"
|
||||
break
|
||||
fi
|
||||
done
|
||||
COMMAND="$1"
|
||||
KERNEL_VERSION="$2"
|
||||
BOOT_DIR_ABS="$3"
|
||||
KERNEL_IMAGE="$4"
|
||||
|
||||
ret=0
|
||||
case "$1" in
|
||||
case "$COMMAND" in
|
||||
add)
|
||||
dracut ${noimageifnotneeded:+--noimageifnotneeded} "$3"/initrd "$2"
|
||||
INITRD_IMAGE_PREGENERATED=${KERNEL_IMAGE%/*}/initrd
|
||||
if [[ -f ${INITRD_IMAGE_PREGENERATED} ]]; then
|
||||
# we found an initrd at the same place as the kernel
|
||||
# use this and don't generate a new one
|
||||
cp --reflink=auto "$INITRD_IMAGE_PREGENERATED" "$BOOT_DIR_ABS/initrd" \
|
||||
&& chown root:root "$BOOT_DIR_ABS/initrd" \
|
||||
&& chmod 0600 "$BOOT_DIR_ABS/initrd" \
|
||||
&& exit 0
|
||||
fi
|
||||
|
||||
if [[ -f /etc/kernel/cmdline ]]; then
|
||||
read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
|
||||
elif [[ -f /usr/lib/kernel/cmdline ]]; then
|
||||
read -r -d '' -a BOOT_OPTIONS < /usr/lib/kernel/cmdline
|
||||
fi
|
||||
|
||||
if ! [[ ${BOOT_OPTIONS[*]} ]]; then
|
||||
read -r -d '' -a BOOT_OPTIONS < /proc/cmdline
|
||||
fi
|
||||
|
||||
unset noimageifnotneeded
|
||||
|
||||
for ((i=0; i < "${#BOOT_OPTIONS[@]}"; i++)); do
|
||||
if [[ ${BOOT_OPTIONS[$i]} == root\=PARTUUID\=* ]]; then
|
||||
noimageifnotneeded="yes"
|
||||
break
|
||||
fi
|
||||
done
|
||||
dracut ${noimageifnotneeded:+--noimageifnotneeded} "$BOOT_DIR_ABS"/initrd "$KERNEL_VERSION"
|
||||
ret=$?
|
||||
;;
|
||||
remove)
|
||||
rm -f -- "$3"/initrd
|
||||
rm -f -- "$BOOT_DIR_ABS"/initrd
|
||||
ret=$?
|
||||
;;
|
||||
esac
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
export LANG=C
|
||||
|
||||
@@ -59,7 +57,7 @@ if [[ ! -f $INITRDFILE ]]; then
|
||||
fi
|
||||
|
||||
if [[ ! -f $NEW_KERNEL_IMAGE ]]; then
|
||||
cp "$KERNEL_IMAGE" "$NEW_KERNEL_IMAGE"
|
||||
cp --reflink=auto "$KERNEL_IMAGE" "$NEW_KERNEL_IMAGE"
|
||||
((ret+=$?))
|
||||
fi
|
||||
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
export LANG=C
|
||||
|
||||
@@ -42,12 +40,22 @@ fi
|
||||
[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
|
||||
|
||||
if [[ -f /etc/kernel/cmdline ]]; then
|
||||
readarray -t BOOT_OPTIONS < /etc/kernel/cmdline
|
||||
read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
|
||||
elif [[ -f /usr/lib/kernel/cmdline ]]; then
|
||||
read -r -d '' -a BOOT_OPTIONS < /usr/lib/kernel/cmdline
|
||||
fi
|
||||
|
||||
if ! [[ "${BOOT_OPTIONS[@]}" ]]; then
|
||||
readarray -t BOOT_OPTIONS < /proc/cmdline
|
||||
read -r -d '' -a line < /proc/cmdline
|
||||
for i in "${line[@]}"; do
|
||||
[[ "${i#initrd=*}" != "$i" ]] && continue
|
||||
BOOT_OPTIONS+=("$i")
|
||||
done
|
||||
fi
|
||||
if ! [[ $BOOT_OPTIONS ]]; then
|
||||
|
||||
if ! [[ ${BOOT_OPTIONS[*]} ]]; then
|
||||
echo "Could not determine the kernel command line parameters." >&2
|
||||
echo "Please specify the kernel command line in /etc/kernel/cmdline!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -71,11 +79,11 @@ case "$COMMAND" in
|
||||
|
||||
[[ -d "$BOOT_DIR_ABS" ]] || mkdir -p "$BOOT_DIR_ABS"
|
||||
|
||||
if ! cp "$KERNEL_IMAGE" "$BOOT_DIR_ABS"/linux; then
|
||||
if ! cp --reflink=auto "$KERNEL_IMAGE" "$BOOT_DIR_ABS"/linux; then
|
||||
echo "Can't copy '$KERNEL_IMAGE to '$BOOT_DIR_ABS/linux'!" >&2
|
||||
fi
|
||||
|
||||
dracut --no-hostonly -a "rescue" "$BOOT_DIR_ABS"/initrd "$2"
|
||||
dracut --no-hostonly -a "rescue" "$BOOT_DIR_ABS"/initrd "$KERNEL_VERSION"
|
||||
((ret+=$?))
|
||||
|
||||
{
|
||||
|
67
AUTHORS
67
AUTHORS
@@ -7,36 +7,43 @@ Warren Togami <wtogami@redhat.com>
|
||||
Jeremy Katz <katzj@redhat.com>
|
||||
Dave Young <dyoung@redhat.com>
|
||||
David Dillow <dave@thedillows.org>
|
||||
Hannes Reinecke <hare@suse.de>
|
||||
Michal Soltys <soltys@ziu.info>
|
||||
Amerigo Wang <amwang@redhat.com>
|
||||
Colin Guthrie <colin@mageia.org>
|
||||
Amerigo Wang <amwang@redhat.com>
|
||||
Thomas Renninger <trenn@suse.de>
|
||||
WANG Chao <chaowang@redhat.com>
|
||||
Andrey Borzenkov <arvidjaar@gmail.com>
|
||||
Peter Jones <pjones@redhat.com>
|
||||
WANG Chao <chaowang@redhat.com>
|
||||
Andreas Thienemann <andreas@bawue.net>
|
||||
Hannes Reinecke <hare@suse.de>
|
||||
Hans de Goede <hdegoede@redhat.com>
|
||||
Alexander Tsoy <alexander@tsoy.me>
|
||||
John Reiser <jreiser@bitwagon.com>
|
||||
Luca Berra <bluca@vodka.it>
|
||||
Thomas Renninger <trenn@suse.de>
|
||||
Alexander Tsoy <alexander@tsoy.me>
|
||||
Daniel Drake <dsd@laptop.org>
|
||||
Brian C. Lane <bcl@redhat.com>
|
||||
Daniel Drake <dsd@laptop.org>
|
||||
Dan Horák <dhorak@redhat.com>
|
||||
Baoquan He <bhe@redhat.com>
|
||||
Leho Kraav <leho@kraav.com>
|
||||
Kamil Rytarowski <n54@gmx.com>
|
||||
Marc Grimme <grimme@atix.de>
|
||||
NeilBrown <neilb@suse.de>
|
||||
Peter Rajnoha <prajnoha@redhat.com>
|
||||
Radek Vykydal <rvykydal@redhat.com>
|
||||
Thorsten Behrens <tbehrens@suse.com>
|
||||
Chao Wang <chaowang@redhat.com>
|
||||
Colin Walters <walters@verbum.org>
|
||||
Cristian Rodríguez <crrodriguez@opensuse.org>
|
||||
Fabian Deutsch <fabiand@fedoraproject.org>
|
||||
Frederic Crozat <fcrozat@suse.com>
|
||||
James Lee <jlee@thestaticvoid.com>
|
||||
Jesse Keating <jkeating@redhat.com>
|
||||
Milan Broz <mbroz@redhat.com>
|
||||
Radek Vykydal <rvykydal@redhat.com>
|
||||
Nicolas Chauvet <kwizart@gmail.com>
|
||||
Roberto Sassu <roberto.sassu@polito.it>
|
||||
Anton Blanchard <anton@samba.org>
|
||||
Bill Nottingham <notting@redhat.com>
|
||||
Chapman Flack <g2@anastigmatix.net>
|
||||
David Cantrell <dcantrell@redhat.com>
|
||||
Dennis Gilmore <dennis@ausil.us>
|
||||
Jon Ander Hernandez <jonan.h@gmail.com>
|
||||
@@ -44,21 +51,32 @@ Juan RP <xtraeme@gmail.com>
|
||||
Lance Albertson <lance@osuosl.org>
|
||||
Marian Ganisin <mganisin@redhat.com>
|
||||
Michael Ploujnikov <plouj@somanetworks.com>
|
||||
Peter Robinson <pbrobinson@gmail.com>
|
||||
Stefan Reimer <it@startux.de>
|
||||
Stig Telfer <stelfer@cray.com>
|
||||
Vasiliy Tolstov <v.tolstov@selfip.ru>
|
||||
Ville Skyttä <ville.skytta@iki.fi>
|
||||
Wim Muskee <wimmuskee@gmail.com>
|
||||
Alan Jenkins <alan-jenkins@tuffmail.co.uk>
|
||||
Alan Pevec <apevec@redhat.com>
|
||||
Cristian Rodríguez <crrodriguez@opensuse.org>
|
||||
Alex Harpin <development@landsofshadow.co.uk>
|
||||
Daniel Schaal <farbing@web.de>
|
||||
Erwan Velu <erwan.velu@enovance.com>
|
||||
Frederick Grose <fgrose@sugarlabs.org>
|
||||
Hari Bathini <hbathini@linux.vnet.ibm.com>
|
||||
Ian Dall <ian@beware.dropbear.id.au>
|
||||
James Buren <ryuo@frugalware.org>
|
||||
James Lee <jlee@thestaticvoid.com>
|
||||
Jan Synacek <jsynacek@redhat.com>
|
||||
Joey Boggs <jboggs@redhat.com>
|
||||
Koen Kooi <koen@dominion.thruhere.net>
|
||||
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
|
||||
Kyle McMartin <kmcmarti@redhat.com>
|
||||
Lubomir Rintel <lkundrak@v3.sk>
|
||||
Lukas Wunner <lukas@wunner.de>
|
||||
Mike Snitzer <snitzer@redhat.com>
|
||||
Minfei Huang <mhuang@redhat.com>
|
||||
Przemysław Rudy <prudy1@o2.pl>
|
||||
Stefan Reimer <it@startux.de>
|
||||
Thomas Backlund <tmb@mageia.org>
|
||||
Thomas Lange <lange@informatik.uni-koeln.de>
|
||||
Till Maas <opensource@till.name>
|
||||
Vivek Goyal <vgoyal@redhat.com>
|
||||
@@ -67,52 +85,63 @@ Adam Williamson <awilliam@redhat.com>
|
||||
Alexander Todorov <atodorov@redhat.com>
|
||||
Andy Lutomirski <luto@mit.edu>
|
||||
Anssi Hannula <anssi@mageia.org>
|
||||
Antony Messerli <amesserl@rackspace.com>
|
||||
Brandon Philips <brandon@ifup.co>
|
||||
Canek Peláez Valdés <caneko@gmail.com>
|
||||
Chao Fan <cfan@redhat.com>
|
||||
Chris Leech <cleech@redhat.com>
|
||||
Christian Heinz <christian.ch.heinz@gmail.com>
|
||||
Christian Rodrigues <crrodriguez@opensuse.org>
|
||||
Cong Wang <amwang@redhat.com>
|
||||
Daniel Schaal <farbing@web.de>
|
||||
Daniel Drake <drake@endlessm.com>
|
||||
Dave Jones <davej@redhat.com>
|
||||
Dave Young <dave@redhat.com>
|
||||
Dennis Schridde <devurandom@gmx.net>
|
||||
Dimitri John Ledkov <dimitri.j.ledkov@intel.com>
|
||||
Duane Griffin <duaneg@dghda.com>
|
||||
Gerd von Egidy <gerd.von.egidy@intra2net.com>
|
||||
Glen Gray <slaine@slaine.org>
|
||||
Hari Bathini <hbathini@linux.vnet.ibm.com>
|
||||
Hermann Gausterer <git-dracut-2012@mrq1.org>
|
||||
James Laska <jlaska@redhat.com>
|
||||
Jan Stodola <jstodola@redhat.com>
|
||||
Jiri Pirko <jiri@resnulli.us>
|
||||
Joe Lawrence <Joe.Lawrence@stratus.com>
|
||||
Jonas Jonsson <jonas@websystem.se>
|
||||
Julian Wolf <juwolf@suse.com>
|
||||
Kevin Yung <Kevin.Yung@myob.com>
|
||||
Kyle McMartin <kmcmarti@redhat.com>
|
||||
Kyle McMartin <kyle@redhat.com>
|
||||
Lars R. Damerow <lars@pixar.com>
|
||||
Lennert Buytenhek <buytenh@wantstofly.org>
|
||||
Lubomir Rintel <lkundrak@v3.sk>
|
||||
Lukas Nykryn <lnykryn@redhat.com>
|
||||
Major Hayden <major@mhtx.net>
|
||||
Marian Csontos <mcsontos@redhat.com>
|
||||
Marko Myllynen <myllynen@redhat.com>
|
||||
Matt <smoothsailing72@hotmail.com>
|
||||
Matt Smith <shadowfax@gmx.com>
|
||||
Michal Schmidt <mschmidt@redhat.com>
|
||||
Mike Gorse <mgorse@suse.com>
|
||||
Moritz 'Morty' Strübe <morty@gmx.net>
|
||||
Munehiro Matsuda <haro@kgt.co.jp>
|
||||
Nicolas Chauvet <kwizart@gmail.com>
|
||||
Nikoli <nikoli@gmx.us>
|
||||
Nikoli <nikoli@lavabit.com>
|
||||
Olivier Blin <dev@blino.org>
|
||||
P J P <ppandit@redhat.com>
|
||||
Paolo Bonzini <pbonzini@redhat.com>
|
||||
Peter Robinson <pbrobinson@fedoraproject.org>
|
||||
Praveen_Paladugu@Dell.com <Praveen_Paladugu@Dell.com>
|
||||
Pádraig Brady <P@draigBrady.com>
|
||||
Quentin Armitage <quentin@armitage.org.uk>
|
||||
Robert Buchholz <rbu@goodpoint.de>
|
||||
Rusty Bird <rustybird@openmailbox.org>
|
||||
Sergey Fionov <fionov@gmail.com>
|
||||
Shawn W Dunn <sfalken@opensuse.org>
|
||||
Srinivasa T N <seenutn@linux.vnet.ibm.com>
|
||||
Thilo Bangert <thilo.bangert@gmx.net>
|
||||
Thomas Backlund <tmb@mageia.org>
|
||||
Tobias Geerinckx <tobias.geerinckx@gmail.com>
|
||||
Tom Gundersen <teg@jklm.no>
|
||||
Tomasz Torcz <tomek@pipebreaker.pl>
|
||||
Vadim Kuznetsov <vadimk@gentoo.org>
|
||||
Ville Skyttä <ville.skytta@iki.fi>
|
||||
Vaughan Cao <vaughan.cao@oracle.com>
|
||||
Vratislav Podzimek <vpodzime@redhat.com>
|
||||
Yanko Kaneti <yaneti@declera.com>
|
||||
jloeser <jloeser@suse.de>
|
||||
maximilian attems <max@stro.at>
|
||||
xtraeme <xtraeme@voidlinux.eu>
|
||||
|
57
Makefile
57
Makefile
@@ -13,8 +13,9 @@ sysconfdir ?= ${prefix}/etc
|
||||
bindir ?= ${prefix}/bin
|
||||
mandir ?= ${prefix}/share/man
|
||||
CFLAGS ?= -O2 -g -Wall
|
||||
CFLAGS += -std=gnu99 -D_FILE_OFFSET_BITS=64
|
||||
CFLAGS += -std=gnu99 -D_FILE_OFFSET_BITS=64 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
|
||||
bashcompletiondir ?= ${datadir}/bash-completion/completions
|
||||
pkgconfigdatadir ?= $(datadir)/pkgconfig
|
||||
|
||||
man1pages = lsinitrd.1
|
||||
|
||||
@@ -28,20 +29,20 @@ man8pages = dracut.8 \
|
||||
dracut-catimages.8 \
|
||||
mkinitrd.8 \
|
||||
mkinitrd-suse.8 \
|
||||
modules.d/98systemd/dracut-cmdline.service.8 \
|
||||
modules.d/98systemd/dracut-initqueue.service.8 \
|
||||
modules.d/98systemd/dracut-mount.service.8 \
|
||||
modules.d/98systemd/dracut-shutdown.service.8 \
|
||||
modules.d/98systemd/dracut-pre-mount.service.8 \
|
||||
modules.d/98systemd/dracut-pre-pivot.service.8 \
|
||||
modules.d/98systemd/dracut-pre-trigger.service.8 \
|
||||
modules.d/98systemd/dracut-pre-udev.service.8
|
||||
modules.d/98dracut-systemd/dracut-cmdline.service.8 \
|
||||
modules.d/98dracut-systemd/dracut-initqueue.service.8 \
|
||||
modules.d/98dracut-systemd/dracut-mount.service.8 \
|
||||
modules.d/98dracut-systemd/dracut-shutdown.service.8 \
|
||||
modules.d/98dracut-systemd/dracut-pre-mount.service.8 \
|
||||
modules.d/98dracut-systemd/dracut-pre-pivot.service.8 \
|
||||
modules.d/98dracut-systemd/dracut-pre-trigger.service.8 \
|
||||
modules.d/98dracut-systemd/dracut-pre-udev.service.8
|
||||
|
||||
manpages = $(man1pages) $(man5pages) $(man7pages) $(man8pages)
|
||||
|
||||
.PHONY: install clean archive rpm testimage test all check AUTHORS doc dracut-version.sh
|
||||
|
||||
all: dracut-version.sh dracut-install skipcpio/skipcpio
|
||||
all: dracut-version.sh dracut.pc dracut-install skipcpio/skipcpio
|
||||
|
||||
DRACUT_INSTALL_OBJECTS = \
|
||||
install/dracut-install.o \
|
||||
@@ -96,7 +97,15 @@ dracut.html: dracut.asc $(manpages) dracut.css dracut.usage.asc
|
||||
http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl dracut.xml
|
||||
rm -f -- dracut.xml
|
||||
|
||||
install: dracut-version.sh
|
||||
dracut.pc: Makefile.inc Makefile
|
||||
@echo "Name: dracut" > dracut.pc
|
||||
@echo "Description: dracut" >> dracut.pc
|
||||
@echo "Version: $(VERSION)$(GITVERSION)" >> dracut.pc
|
||||
@echo "dracutdir=$(pkglibdir)" >> dracut.pc
|
||||
@echo "dracutmodulesdir=$(pkglibdir)/modules.d" >> dracut.pc
|
||||
@echo "dracutconfdir=$(pkglibdir)/dracut.conf.d" >> dracut.pc
|
||||
|
||||
install: all
|
||||
mkdir -p $(DESTDIR)$(pkglibdir)
|
||||
mkdir -p $(DESTDIR)$(bindir)
|
||||
mkdir -p $(DESTDIR)$(sysconfdir)
|
||||
@@ -124,10 +133,10 @@ ifneq ($(enable_documentation),no)
|
||||
endif
|
||||
if [ -n "$(systemdsystemunitdir)" ]; then \
|
||||
mkdir -p $(DESTDIR)$(systemdsystemunitdir); \
|
||||
ln -srf $(DESTDIR)$(pkglibdir)/modules.d/98systemd/dracut-shutdown.service $(DESTDIR)$(systemdsystemunitdir)/dracut-shutdown.service; \
|
||||
mkdir -p $(DESTDIR)$(systemdsystemunitdir)/shutdown.target.wants; \
|
||||
ln -srf $(DESTDIR)$(pkglibdir)/modules.d/98dracut-systemd/dracut-shutdown.service $(DESTDIR)$(systemdsystemunitdir)/dracut-shutdown.service; \
|
||||
mkdir -p $(DESTDIR)$(systemdsystemunitdir)/sysinit.target.wants; \
|
||||
ln -s ../dracut-shutdown.service \
|
||||
$(DESTDIR)$(systemdsystemunitdir)/shutdown.target.wants/dracut-shutdown.service; \
|
||||
$(DESTDIR)$(systemdsystemunitdir)/sysinit.target.wants/dracut-shutdown.service; \
|
||||
mkdir -p $(DESTDIR)$(systemdsystemunitdir)/initrd.target.wants; \
|
||||
for i in \
|
||||
dracut-cmdline.service \
|
||||
@@ -138,7 +147,7 @@ endif
|
||||
dracut-pre-trigger.service \
|
||||
dracut-pre-udev.service \
|
||||
; do \
|
||||
ln -srf $(DESTDIR)$(pkglibdir)/modules.d/98systemd/$$i $(DESTDIR)$(systemdsystemunitdir); \
|
||||
ln -srf $(DESTDIR)$(pkglibdir)/modules.d/98dracut-systemd/$$i $(DESTDIR)$(systemdsystemunitdir); \
|
||||
ln -s ../$$i \
|
||||
$(DESTDIR)$(systemdsystemunitdir)/initrd.target.wants/$$i; \
|
||||
done \
|
||||
@@ -155,6 +164,8 @@ endif
|
||||
mkdir -p $(DESTDIR)${bashcompletiondir}
|
||||
install -m 0644 dracut-bash-completion.sh $(DESTDIR)${bashcompletiondir}/dracut
|
||||
install -m 0644 lsinitrd-bash-completion.sh $(DESTDIR)${bashcompletiondir}/lsinitrd
|
||||
mkdir -p $(DESTDIR)${pkgconfigdatadir}
|
||||
install -m 0644 dracut.pc $(DESTDIR)${pkgconfigdatadir}/dracut.pc
|
||||
|
||||
dracut-version.sh:
|
||||
@echo "DRACUT_VERSION=$(VERSION)$(GITVERSION)" > dracut-version.sh
|
||||
@@ -188,7 +199,9 @@ rpm: dracut-$(VERSION).tar.xz syncheck
|
||||
rpmbuild=$$(mktemp -d -t rpmbuild-dracut.XXXXXX); src=$$(pwd); \
|
||||
cp dracut-$(VERSION).tar.xz "$$rpmbuild"; \
|
||||
LC_MESSAGES=C $$src/git2spec.pl $(VERSION) "$$rpmbuild" < dracut.spec > $$rpmbuild/dracut.spec; \
|
||||
(cd "$$rpmbuild"; rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" \
|
||||
(cd "$$rpmbuild"; \
|
||||
wget https://www.gnu.org/licenses/lgpl-2.1.txt; \
|
||||
rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" \
|
||||
--define "_specdir $$PWD" --define "_srcrpmdir $$PWD" \
|
||||
--define "_rpmdir $$PWD" -ba dracut.spec; ) && \
|
||||
( mv "$$rpmbuild"/$$(arch)/*.rpm .; mv "$$rpmbuild"/*.src.rpm .;rm -fr -- "$$rpmbuild"; ls *.rpm )
|
||||
@@ -210,7 +223,11 @@ check: all syncheck rpm
|
||||
@$(MAKE) -C test check
|
||||
|
||||
testimage: all
|
||||
./dracut.sh -l -a debug -f test-$(shell uname -r).img $(shell uname -r)
|
||||
./dracut.sh -N -l -a debug -f test-$(shell uname -r).img $(shell uname -r)
|
||||
@echo wrote test-$(shell uname -r).img
|
||||
|
||||
debugtestimage: all
|
||||
./dracut.sh --debug -l -a debug -f test-$(shell uname -r).img $(shell uname -r)
|
||||
@echo wrote test-$(shell uname -r).img
|
||||
|
||||
testimages: all
|
||||
@@ -219,12 +236,16 @@ testimages: all
|
||||
./dracut.sh -l -a debug --no-kernel -f test-dracut.img $(shell uname -r)
|
||||
@echo wrote test-dracut.img
|
||||
|
||||
debughostimage: all
|
||||
./dracut.sh --debug -H -l -f test-$(shell uname -r).img $(shell uname -r)
|
||||
@echo wrote test-$(shell uname -r).img
|
||||
|
||||
hostimage: all
|
||||
./dracut.sh -H -l -f test-$(shell uname -r).img $(shell uname -r)
|
||||
@echo wrote test-$(shell uname -r).img
|
||||
|
||||
AUTHORS:
|
||||
git shortlog --numbered --summary -e |while read a rest; do echo $$rest;done > AUTHORS
|
||||
git shortlog --numbered --summary -e |while read a rest || [ -n "$$rest" ]; do echo $$rest;done > AUTHORS
|
||||
|
||||
dracut.html.sign: dracut-$(VERSION).tar.xz dracut.html
|
||||
gpg-sign-all dracut-$(VERSION).tar.xz dracut.html
|
||||
|
114
NEWS
114
NEWS
@@ -1,3 +1,117 @@
|
||||
dracut-042
|
||||
==========
|
||||
- fixed dmsetup shutdown
|
||||
- new kernel command line option "rd.live.overlay.thin"
|
||||
This option changes the underlying mechanism for the overlay in the
|
||||
dmsquash module.
|
||||
Instead of a plain dm snapshot a dm thin snapshot is used. The advantage
|
||||
of the thin snapshot is, that the TRIM command is recognized, which
|
||||
means that at runtime, only the occupied blocks will be claimed from
|
||||
memory, and freed blocks will really be freed in ram.
|
||||
- dmsquash: Add squashfs support to rd.live.fsimg
|
||||
Previously rd.live.fsimg only supported filesystems residing in
|
||||
(compressed) archives.
|
||||
Now rd.live.fsimg can also be used when a squashfs image is used.
|
||||
This is achieved by extracting the rootfs image from the squashfs and
|
||||
then continue with the default routines for rd.live.fsimg.
|
||||
- lvm: add support for LVM system id
|
||||
- split up the systemd dracut module
|
||||
Basic systemd functionality is in 00systemd now.
|
||||
Switching root and the initrd.target is in 00systemd-initrd.
|
||||
Dracut additions to the systemd initrd are in 98dracut-systemd.
|
||||
- support for creating a UEFI boot executable via argument "--uefi"
|
||||
With an EFI stub, the kernel, the initramfs and a kernel cmdline can be
|
||||
glued together to a single UEFI executable, which can be booted by a
|
||||
UEFI BIOS.
|
||||
- network: split out kernel-network-modules, now in 90kernel-network-modules
|
||||
- support for ethernet point-to-point connections configured via DHCP
|
||||
- kernel-modules: install all HID drivers
|
||||
- dracut.pc pkg-config file
|
||||
- mount /dev, /dev/shm and /run noexec
|
||||
|
||||
dracut-041
|
||||
==========
|
||||
- fixed the shutdown loop
|
||||
- fixed gzip compression for versions, which do not have --rsyncable
|
||||
- fixed ifcfg generation for persistent interface names
|
||||
- multipath:
|
||||
* new option to turn off multipath "rd.multipath=0" completly
|
||||
* preload scsi dh modules
|
||||
* start multipathd via systemd service
|
||||
- do not fail, if user pressed ESC during media check
|
||||
- fixed systemd-journal by symlinking /var/log to /run/initramfs/log
|
||||
- initrd-release moved to /usr/lib
|
||||
- lots of iSCSI fixes
|
||||
- new "rd.timeout" to specify the systemd JobTimeoutSec for devices
|
||||
- if $initrd/etc/cmdline.d/* has a "root=" and the kernel cmdline does not,
|
||||
generate a mount unit for it
|
||||
- increased the initqueue timeout for non systemd initramfs to 180s
|
||||
- $initrd/etc/cmdline.d/ hostonly files are now generated for NFS
|
||||
- make use of systemd-hibernate-resume, if available
|
||||
- fixed ldconfig parsing for hwcap output
|
||||
- network: add support for comma separated autoconf options like ip=eth0:auto6,dhcp
|
||||
- new parameter "rd.live.overlay.size" to specify the overlay for live images
|
||||
- changed the test suite for the new sfdisk syntax
|
||||
- added cache tools for dm-cache setups
|
||||
|
||||
dracut-040
|
||||
==========
|
||||
- fixed dracut module dependency checks
|
||||
- fixed test suite
|
||||
|
||||
dracut-039
|
||||
==========
|
||||
- DRACUT_PATH can now be used to specify the PATH used by dracut
|
||||
to search for binaries instead of the default
|
||||
/usr/sbin:/sbin:/usr/bin:/bin
|
||||
This should be set in the distribution config file
|
||||
/usr/lib/dracut/dracut.conf.d/01-dist.conf
|
||||
- add "--loginstall <DIR>" and loginstall="<DIR>" options
|
||||
to record all files, which are installed from the host fs
|
||||
- "rd.writable.fsimg" - support for read/write filesystem images
|
||||
- "rd.route" kernel command line parameter added
|
||||
- "--install-optional" and install_optional_items added
|
||||
- find plymouth pkglibdir on debian
|
||||
- torrent support for live images
|
||||
root=live:torrent://example.com/liveboot.img.torrent
|
||||
and generally added as a download handler
|
||||
- disable microcode, if the kernel does not support it
|
||||
- speed up ldconfig_paths()
|
||||
- more ARM modules
|
||||
- fixed inst*() functions and "-H" handling
|
||||
- fixed bridge setup
|
||||
- added --force-drivers parameter and force_drivers=+ config option
|
||||
to enforce driver loading at early boot time
|
||||
- documented "iso-scan/filename" usage in grub
|
||||
- various bugfixes
|
||||
|
||||
dracut-038
|
||||
==========
|
||||
- "rd.cmdline=ask" will ask the user on the console to enter additional
|
||||
kernel command line parameters
|
||||
- "rd.hostonly=0" removes all "hostonly" added custom files,
|
||||
which is useful in combination with "rd.auto" or other specific parameters,
|
||||
if you want to boot on the same hardware, but the compiled in configuration
|
||||
does not match your setup anymore
|
||||
- inst* functions and dracut-install now accept the "-H" flag, which logs all
|
||||
installed files to /lib/dracut/hostonly-files. This is used to remove those
|
||||
files, if rd.hostonly is given on the kernel command line
|
||||
- strstr now only does literal string match,
|
||||
please use strglob and strglobin for globs
|
||||
- fixed unpacking of the microcode image on shutdown
|
||||
- added systemd-gpt-auto-generator
|
||||
- fcoe: wait for lldpad to be ready
|
||||
- network: handle "ip=dhcp6"
|
||||
- network: DCHPv6: set valid_lft and preferred_lft
|
||||
- dm: support dm-cache
|
||||
- fstab: do not mount and fsck from fstab if using systemd
|
||||
- break at switch_root only for bare rd.break and not for any rd.break=...
|
||||
- nbd: make use of "--systemd-mark", otherwise it gets killed on switch_root
|
||||
- fcoe-uefi: fixed cmdline parameter generation
|
||||
- iscsi: deprecate "ip=ibft", use "rd.iscsi.ibft[=1]" from now on
|
||||
- "lsinitrd -m" now only lists the dracut modules of the image
|
||||
- a lot of small bugfixes
|
||||
|
||||
dracut-037
|
||||
==========
|
||||
- dracut: hostonly_cmdline variable and command line switch
|
||||
|
@@ -1,14 +1,17 @@
|
||||
For the testsuite to work, you will have to install at least the following software packages:
|
||||
dash
|
||||
asciidoc
|
||||
mdadm
|
||||
lvm2
|
||||
cryptsetup
|
||||
nfs-utils
|
||||
netbsd-iscsi
|
||||
nbd
|
||||
dhcp (dhcp-server on openSUSE)
|
||||
dash \
|
||||
bridge-utils \
|
||||
asciidoc \
|
||||
mdadm \
|
||||
lvm2 \
|
||||
cryptsetup \
|
||||
nfs-utils \
|
||||
netbsd-iscsi \
|
||||
nbd \
|
||||
dhcp-server \
|
||||
iscsi-initiator-utils
|
||||
|
||||
|
||||
TEST-04-FULL-SYSTEMD: systemd >= 187
|
||||
|
||||
How to run the testsuite:
|
||||
|
6
TODO
6
TODO
@@ -6,6 +6,8 @@ Items are ordered in priority.
|
||||
|
||||
INITRAMFS TODO
|
||||
|
||||
- search domain string
|
||||
- peerdns=no
|
||||
- allow dual stack configuration (IPv4, IPv6) for the same interface
|
||||
- "bind-mount" kernel drivers in real root for the rescue image,
|
||||
if the real root does not have any kernel modules for this kernel
|
||||
@@ -28,6 +30,7 @@ GENERATOR TODO
|
||||
|
||||
- report errors on missing files in check()
|
||||
- remove wait for swap devs, if no "resume=" is given on the kernel command line
|
||||
- remove wait for swap devs, if the "resume" dracut module is not included (omitted)
|
||||
- add presets (predefined set of modules)
|
||||
- add interpreter/plugin-scripts to be sourced at the beginning or end (can use dracut-functions)
|
||||
- add mechanism for module specific command line options
|
||||
@@ -47,3 +50,6 @@ Future Enhancement Requests
|
||||
- run ssh server to enter crypto password or perform debugging (supported by debian)
|
||||
- https://bugzilla.redhat.com/show_bug.cgi?id=524727 - dracut + encrypted root + networking
|
||||
|
||||
- lsinitrd --print-cmdline
|
||||
- dracut --print-cmdline error if additional arguments
|
||||
- library for cmdline
|
||||
|
2
configure
vendored
2
configure
vendored
@@ -1,6 +1,4 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
# We don't support srcdir != builddir
|
||||
echo \#buildapi-variable-no-builddir >/dev/null
|
||||
|
@@ -1,7 +1,4 @@
|
||||
#
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
#
|
||||
# Copyright 2013 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
@@ -34,13 +31,17 @@ _dracut() {
|
||||
--local --hostonly --no-hostonly --fstab --help --bzip2 --lzma
|
||||
--xz --no-compress --gzip --list-modules --show-modules --keep
|
||||
--printsize --regenerate-all --noimageifnotneeded --early-microcode
|
||||
--no-early-microcode --print-cmdline --prelink --noprelink'
|
||||
--no-early-microcode --print-cmdline --prelink --noprelink --reproducible
|
||||
--uefi
|
||||
'
|
||||
|
||||
[ARG]='-a -m -o -d -I -k -c -L --kver --add --force-add --add-drivers
|
||||
--omit-drivers --modules --omit --drivers --filesystems --install
|
||||
--fwdir --libdirs --fscks --add-fstab --mount --device --nofscks
|
||||
--kmoddir --conf --confdir --tmpdir --stdlog --compress --prefix
|
||||
--kernel-cmdline --sshkey --persistent-policy'
|
||||
--kernel-cmdline --sshkey --persistent-policy --install-optional
|
||||
--loginstall --uefi-stub --kernel-image
|
||||
'
|
||||
)
|
||||
|
||||
if __contains_word "$prev" ${OPTS[ARG]}; then
|
||||
@@ -49,7 +50,7 @@ _dracut() {
|
||||
comps=$(compgen -d -- "$cur")
|
||||
compopt -o filenames
|
||||
;;
|
||||
-c|--conf|--sshkey|--add-fstab|--add-device|-I|--install)
|
||||
-c|--conf|--sshkey|--add-fstab|--add-device|-I|--install|--install-optional)
|
||||
comps=$(compgen -f -- "$cur")
|
||||
compopt -o filenames
|
||||
;;
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/bash --norc
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
#
|
||||
# Copyright 2009 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
#
|
||||
# functions used by dracut and other tools.
|
||||
#
|
||||
@@ -33,7 +31,11 @@ if [[ $initdir ]] && ! [[ -d $initdir ]]; then
|
||||
fi
|
||||
|
||||
# Generic substring function. If $2 is in $1, return 0.
|
||||
strstr() { [[ $1 = *$2* ]]; }
|
||||
strstr() { [[ $1 = *"$2"* ]]; }
|
||||
# Generic glob matching function. If glob pattern $2 matches anywhere in $1, OK
|
||||
strglobin() { [[ $1 = *$2* ]]; }
|
||||
# Generic glob matching function. If glob pattern $2 matches all of $1, OK
|
||||
strglob() { [[ $1 = $2 ]]; }
|
||||
|
||||
# helper function for check() in module-setup.sh
|
||||
# to check for required installed binaries
|
||||
@@ -49,7 +51,7 @@ require_binaries() {
|
||||
|
||||
for cmd in "$@"; do
|
||||
if ! find_binary "$cmd" &>/dev/null; then
|
||||
dinfo "$_module_name: Could not find command '$cmd'!"
|
||||
dinfo "dracut module '${_module_name#[0-9][0-9]}' will not be installed, because command '$cmd' could not be found!"
|
||||
((_ret++))
|
||||
fi
|
||||
done
|
||||
@@ -102,18 +104,7 @@ fi
|
||||
|
||||
ldconfig_paths()
|
||||
{
|
||||
local a i
|
||||
declare -A a
|
||||
for i in $(
|
||||
ldconfig -pN 2>/dev/null | while read a b c d; do
|
||||
[[ "$c" != "=>" ]] && continue
|
||||
printf "%s\n" ${d%/*};
|
||||
done
|
||||
); do
|
||||
[[ "$i" = "/lib" || "$i" = "/usr/lib" || "$i" = "/lib64" || "$i" = "/usr/lib64" ]] && continue
|
||||
a["$i"]=1;
|
||||
done;
|
||||
printf "%s\n" ${!a[@]}
|
||||
ldconfig -pN 2>/dev/null | grep -E -v '/(lib|lib64|usr/lib|usr/lib64)/[^/]*$' | sed -n 's,.* => \(.*\)/.*,\1,p' | sort | uniq
|
||||
}
|
||||
|
||||
# Detect lib paths
|
||||
@@ -175,7 +166,13 @@ srcmods="/lib/modules/$kernel/"
|
||||
}
|
||||
export srcmods
|
||||
|
||||
if ! type dinfo >/dev/null 2>&1; then
|
||||
# is_func <command>
|
||||
# Check whether $1 is a function.
|
||||
is_func() {
|
||||
[[ "$(type -t "$1")" = "function" ]]
|
||||
}
|
||||
|
||||
if ! is_func dinfo >/dev/null 2>&1; then
|
||||
. "$dracutbasedir/dracut-logger.sh"
|
||||
dlog_init
|
||||
fi
|
||||
@@ -208,12 +205,6 @@ mksubdirs() {
|
||||
[[ -e ${1%/*} ]] || mkdir -m 0755 -p -- "${1%/*}"
|
||||
}
|
||||
|
||||
# is_func <command>
|
||||
# Check whether $1 is a function.
|
||||
is_func() {
|
||||
[[ "$(type -t "$1")" = "function" ]]
|
||||
}
|
||||
|
||||
# Function prints global variables in format name=value line by line.
|
||||
# $@ = list of global variables' name
|
||||
print_vars() {
|
||||
@@ -221,7 +212,7 @@ print_vars() {
|
||||
|
||||
for _var in "$@"
|
||||
do
|
||||
eval printf -v _value "%s" "\$$_var"
|
||||
eval printf -v _value "%s" \""\$$_var"\"
|
||||
[[ ${_value} ]] && printf '%s="%s"\n' "$_var" "$_value"
|
||||
done
|
||||
}
|
||||
@@ -318,7 +309,7 @@ get_fs_env() {
|
||||
[[ $1 ]] || return
|
||||
unset ID_FS_TYPE
|
||||
ID_FS_TYPE=$(blkid -u filesystem -o export -- "$1" \
|
||||
| while read line; do
|
||||
| while read line || [ -n "$line" ]; do
|
||||
if [[ "$line" == TYPE\=* ]]; then
|
||||
printf "%s" "${line#TYPE=}";
|
||||
exit 0;
|
||||
@@ -385,6 +376,7 @@ get_persistent_dev() {
|
||||
return
|
||||
fi
|
||||
done
|
||||
printf -- "%s" "$1"
|
||||
}
|
||||
|
||||
expand_persistent_dev() {
|
||||
@@ -443,7 +435,7 @@ find_block_device() {
|
||||
if [[ $use_fstab != yes ]]; then
|
||||
[[ -d $_find_mpt/. ]]
|
||||
findmnt -e -v -n -o 'MAJ:MIN,SOURCE' --target "$_find_mpt" | { \
|
||||
while read _majmin _dev; do
|
||||
while read _majmin _dev || [ -n "$_dev" ]; do
|
||||
if [[ -b $_dev ]]; then
|
||||
if ! [[ $_majmin ]] || [[ $_majmin == 0:* ]]; then
|
||||
_majmin=$(get_maj_min $_dev)
|
||||
@@ -464,7 +456,7 @@ find_block_device() {
|
||||
# fall back to /etc/fstab
|
||||
|
||||
findmnt -e --fstab -v -n -o 'MAJ:MIN,SOURCE' --target "$_find_mpt" | { \
|
||||
while read _majmin _dev; do
|
||||
while read _majmin _dev || [ -n "$_dev" ]; do
|
||||
if ! [[ $_dev ]]; then
|
||||
_dev="$_majmin"
|
||||
unset _majmin
|
||||
@@ -500,7 +492,7 @@ find_mp_fstype() {
|
||||
|
||||
if [[ $use_fstab != yes ]]; then
|
||||
findmnt -e -v -n -o 'FSTYPE' --target "$1" | { \
|
||||
while read _fs; do
|
||||
while read _fs || [ -n "$_fs" ]; do
|
||||
[[ $_fs ]] || continue
|
||||
[[ $_fs = "autofs" ]] && continue
|
||||
printf "%s" "$_fs"
|
||||
@@ -509,7 +501,7 @@ find_mp_fstype() {
|
||||
fi
|
||||
|
||||
findmnt --fstab -e -v -n -o 'FSTYPE' --target "$1" | { \
|
||||
while read _fs; do
|
||||
while read _fs || [ -n "$_fs" ]; do
|
||||
[[ $_fs ]] || continue
|
||||
[[ $_fs = "autofs" ]] && continue
|
||||
printf "%s" "$_fs"
|
||||
@@ -536,7 +528,7 @@ find_dev_fstype() {
|
||||
|
||||
if [[ $use_fstab != yes ]]; then
|
||||
findmnt -e -v -n -o 'FSTYPE' --source "$_find_dev" | { \
|
||||
while read _fs; do
|
||||
while read _fs || [ -n "$_fs" ]; do
|
||||
[[ $_fs ]] || continue
|
||||
[[ $_fs = "autofs" ]] && continue
|
||||
printf "%s" "$_fs"
|
||||
@@ -545,7 +537,7 @@ find_dev_fstype() {
|
||||
fi
|
||||
|
||||
findmnt --fstab -e -v -n -o 'FSTYPE' --source "$_find_dev" | { \
|
||||
while read _fs; do
|
||||
while read _fs || [ -n "$_fs" ]; do
|
||||
[[ $_fs ]] || continue
|
||||
[[ $_fs = "autofs" ]] && continue
|
||||
printf "%s" "$_fs"
|
||||
@@ -696,10 +688,12 @@ for_each_host_dev_and_slaves()
|
||||
# but you cannot create the logical volume without the volume group.
|
||||
# And the volume group might be bigger than the devices the LV needs.
|
||||
check_vol_slaves() {
|
||||
local _lv _vg _pv
|
||||
local _lv _vg _pv _dm
|
||||
for i in /dev/mapper/*; do
|
||||
[[ $i == /dev/mapper/control ]] && continue
|
||||
_lv=$(get_maj_min $i)
|
||||
_dm=/sys/dev/block/$_lv/dm
|
||||
[[ -f $_dm/uuid && $(<$_dm/uuid) =~ LVM-* ]] || continue
|
||||
if [[ $_lv = $2 ]]; then
|
||||
_vg=$(lvm lvs --noheadings -o vg_name $i 2>/dev/null)
|
||||
# strip space
|
||||
@@ -735,13 +729,14 @@ fs_get_option() {
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
if ! [[ $DRACUT_INSTALL ]]; then
|
||||
DRACUT_INSTALL=$(find_binary dracut-install)
|
||||
fi
|
||||
|
||||
if ! [[ $DRACUT_INSTALL ]] && [[ -x $dracutbasedir/dracut-install ]]; then
|
||||
DRACUT_INSTALL=$dracutbasedir/dracut-install
|
||||
elif ! [[ $DRACUT_INSTALL ]] && [[ -x $dracutbasedir/install/dracut-install ]]; then
|
||||
DRACUT_INSTALL=$dracutbasedir/install/dracut-install
|
||||
fi
|
||||
|
||||
if ! [[ -x $DRACUT_INSTALL ]]; then
|
||||
@@ -757,33 +752,46 @@ inst_dir() {
|
||||
}
|
||||
|
||||
inst() {
|
||||
local _hostonly_install
|
||||
if [[ "$1" == "-H" ]]; then
|
||||
_hostonly_install="-H"
|
||||
shift
|
||||
fi
|
||||
[[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
|
||||
#dinfo "$DRACUT_INSTALL -l $@"
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-H} "$@"
|
||||
(($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-H} "$@" || :
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"
|
||||
(($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || :
|
||||
}
|
||||
|
||||
inst_simple() {
|
||||
local _hostonly_install
|
||||
if [[ "$1" == "-H" ]]; then
|
||||
_hostonly_install="-H"
|
||||
shift
|
||||
fi
|
||||
[[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
|
||||
[[ -e $1 ]] || return 1 # no source
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} "$@"
|
||||
(($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} "$@" || :
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${_hostonly_install:+-H} "$@"
|
||||
(($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${_hostonly_install:+-H} "$@" || :
|
||||
}
|
||||
|
||||
inst_symlink() {
|
||||
local _hostonly_install
|
||||
if [[ "$1" == "-H" ]]; then
|
||||
_hostonly_install="-H"
|
||||
shift
|
||||
fi
|
||||
[[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
|
||||
[[ -L $1 ]] || return 1
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-H} "$@"
|
||||
(($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-H} "$@" || :
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"
|
||||
(($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || :
|
||||
}
|
||||
|
||||
inst_multiple() {
|
||||
local ret
|
||||
#dinfo "initdir=$initdir $DRACUT_INSTALL -l $@"
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} -a ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-H} "$@"
|
||||
ret=$?
|
||||
(($ret != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} -a ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-H} "$@" || :
|
||||
return $ret
|
||||
local _ret
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} -a ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@"
|
||||
_ret=$?
|
||||
(($_ret != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} -a ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || :
|
||||
return $_ret
|
||||
}
|
||||
|
||||
dracut_install() {
|
||||
@@ -791,20 +799,31 @@ dracut_install() {
|
||||
}
|
||||
|
||||
inst_library() {
|
||||
local _hostonly_install
|
||||
if [[ "$1" == "-H" ]]; then
|
||||
_hostonly_install="-H"
|
||||
shift
|
||||
fi
|
||||
[[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
|
||||
[[ -e $1 ]] || return 1 # no source
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-H} "$@"
|
||||
(($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-H} "$@" || :
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"
|
||||
(($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || :
|
||||
}
|
||||
|
||||
inst_binary() {
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-H} "$@"
|
||||
(($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-H} "$@" || :
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@"
|
||||
(($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@" || :
|
||||
}
|
||||
|
||||
inst_script() {
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-H} "$@"
|
||||
(($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-H} "$@" || :
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@"
|
||||
(($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@" || :
|
||||
}
|
||||
|
||||
mark_hostonly() {
|
||||
for i in "$@"; do
|
||||
echo "$i" >> "$initdir/lib/dracut/hostonly-files"
|
||||
done
|
||||
}
|
||||
|
||||
# find symlinks linked to given library file
|
||||
@@ -958,7 +977,7 @@ inst_rules_wildcard() {
|
||||
_found=$_rule
|
||||
fi
|
||||
done
|
||||
if [ -n ${hostonly} ] ; then
|
||||
if [[ -n ${hostonly} ]] ; then
|
||||
for _rule in ${_target}/$1 ; do
|
||||
if [[ -f $_rule ]]; then
|
||||
inst_rule_programs "$_rule"
|
||||
@@ -978,7 +997,7 @@ prepare_udev_rules() {
|
||||
for f in "$@"; do
|
||||
f="${initdir}/etc/udev/rules.d/$f"
|
||||
[ -e "$f" ] || continue
|
||||
while read line; do
|
||||
while read line || [ -n "$line" ]; do
|
||||
if [ "${line%%IMPORT PATH_ID}" != "$line" ]; then
|
||||
if [ $UDEVVERSION -ge 174 ]; then
|
||||
printf '%sIMPORT{builtin}="path_id"\n' "${line%%IMPORT PATH_ID}"
|
||||
@@ -1111,7 +1130,7 @@ inst_opt_decompress() {
|
||||
# or the "check" script, if module-setup.sh is not found
|
||||
# "check $hostonly" is called
|
||||
module_check() {
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1})
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; })
|
||||
local _ret
|
||||
local _forced=0
|
||||
local _hostonly=$hostonly
|
||||
@@ -1142,7 +1161,7 @@ module_check() {
|
||||
# or the "check" script, if module-setup.sh is not found
|
||||
# "mount_needs=1 check 0" is called
|
||||
module_check_mount() {
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1})
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; })
|
||||
local _ret
|
||||
mount_needs=1
|
||||
[[ -d $_moddir ]] || return 1
|
||||
@@ -1167,7 +1186,7 @@ module_check_mount() {
|
||||
# execute the depends() function of module-setup.sh of <dracut module>
|
||||
# or the "depends" script, if module-setup.sh is not found
|
||||
module_depends() {
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1})
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; })
|
||||
local _ret
|
||||
[[ -d $_moddir ]] || return 1
|
||||
if [[ ! -f $_moddir/module-setup.sh ]]; then
|
||||
@@ -1190,7 +1209,7 @@ module_depends() {
|
||||
# execute the cmdline() function of module-setup.sh of <dracut module>
|
||||
# or the "cmdline" script, if module-setup.sh is not found
|
||||
module_cmdline() {
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1})
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; })
|
||||
local _ret
|
||||
[[ -d $_moddir ]] || return 1
|
||||
if [[ ! -f $_moddir/module-setup.sh ]]; then
|
||||
@@ -1211,7 +1230,7 @@ module_cmdline() {
|
||||
# execute the install() function of module-setup.sh of <dracut module>
|
||||
# or the "install" script, if module-setup.sh is not found
|
||||
module_install() {
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1})
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; })
|
||||
local _ret
|
||||
[[ -d $_moddir ]] || return 1
|
||||
if [[ ! -f $_moddir/module-setup.sh ]]; then
|
||||
@@ -1232,7 +1251,7 @@ module_install() {
|
||||
# execute the installkernel() function of module-setup.sh of <dracut module>
|
||||
# or the "installkernel" script, if module-setup.sh is not found
|
||||
module_installkernel() {
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1})
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; })
|
||||
local _ret
|
||||
[[ -d $_moddir ]] || return 1
|
||||
if [[ ! -f $_moddir/module-setup.sh ]]; then
|
||||
@@ -1254,7 +1273,7 @@ module_installkernel() {
|
||||
# device and filesystem types in "${host_fs_types[@]}"
|
||||
check_mount() {
|
||||
local _mod=$1
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1})
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; })
|
||||
local _ret
|
||||
local _moddep
|
||||
|
||||
@@ -1289,13 +1308,17 @@ check_mount() {
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
for _moddep in $(module_depends $_mod); do
|
||||
# handle deps as if they were manually added
|
||||
[[ " $add_dracutmodules " == *\ $_moddep\ * ]] || \
|
||||
add_dracutmodules+=" $_moddep "
|
||||
[[ " $force_add_dracutmodules " == *\ $_moddep\ * ]] || \
|
||||
force_add_dracutmodules+=" $_moddep "
|
||||
[[ " $dracutmodules " == *\ $_mod\ * ]] \
|
||||
&& [[ " $dracutmodules " != *\ $_moddep\ * ]] \
|
||||
&& dracutmodules+=" $_moddep "
|
||||
[[ " $add_dracutmodules " == *\ $_mod\ * ]] \
|
||||
&& [[ " $add_dracutmodules " != *\ $_moddep\ * ]] \
|
||||
&& add_dracutmodules+=" $_moddep "
|
||||
[[ " $force_add_dracutmodules " == *\ $_mod\ * ]] \
|
||||
&& [[ " $force_add_dracutmodules " != *\ $_moddep\ * ]] \
|
||||
&& force_add_dracutmodules+=" $_moddep "
|
||||
# if a module we depend on fail, fail also
|
||||
if ! check_module $_moddep; then
|
||||
derror "dracut module '$_mod' depends on '$_moddep', which can't be installed"
|
||||
@@ -1315,7 +1338,7 @@ check_mount() {
|
||||
# that the modules were checked for the dependency tracking process
|
||||
check_module() {
|
||||
local _mod=$1
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1})
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; })
|
||||
local _ret
|
||||
local _moddep
|
||||
# If we are already scheduled to be loaded, no need to check again.
|
||||
@@ -1333,7 +1356,7 @@ check_module() {
|
||||
fi
|
||||
|
||||
if [[ " $dracutmodules $add_dracutmodules $force_add_dracutmodules" == *\ $_mod\ * ]]; then
|
||||
if [[ " $force_add_dracutmodules " == *\ $_mod\ * ]]; then
|
||||
if [[ " $dracutmodules $force_add_dracutmodules " == *\ $_mod\ * ]]; then
|
||||
module_check $_mod 1; ret=$?
|
||||
else
|
||||
module_check $_mod 0; ret=$?
|
||||
@@ -1344,7 +1367,11 @@ check_module() {
|
||||
# module not in our list
|
||||
if [[ $dracutmodules = all ]]; then
|
||||
# check, if we can and should install this module
|
||||
module_check $_mod || return 1
|
||||
module_check $_mod; ret=$?
|
||||
if [[ $ret != 0 ]]; then
|
||||
[[ $2 ]] && return 1
|
||||
[[ $ret != 255 ]] && return 1
|
||||
fi
|
||||
else
|
||||
# skip this module
|
||||
return 1
|
||||
@@ -1353,10 +1380,15 @@ check_module() {
|
||||
|
||||
for _moddep in $(module_depends $_mod); do
|
||||
# handle deps as if they were manually added
|
||||
[[ " $add_dracutmodules " == *\ $_moddep\ * ]] || \
|
||||
add_dracutmodules+=" $_moddep "
|
||||
[[ " $force_add_dracutmodules " == *\ $_moddep\ * ]] || \
|
||||
force_add_dracutmodules+=" $_moddep "
|
||||
[[ " $dracutmodules " == *\ $_mod\ * ]] \
|
||||
&& [[ " $dracutmodules " != *\ $_moddep\ * ]] \
|
||||
&& dracutmodules+=" $_moddep "
|
||||
[[ " $add_dracutmodules " == *\ $_mod\ * ]] \
|
||||
&& [[ " $add_dracutmodules " != *\ $_moddep\ * ]] \
|
||||
&& add_dracutmodules+=" $_moddep "
|
||||
[[ " $force_add_dracutmodules " == *\ $_mod\ * ]] \
|
||||
&& [[ " $force_add_dracutmodules " != *\ $_moddep\ * ]] \
|
||||
&& force_add_dracutmodules+=" $_moddep "
|
||||
# if a module we depend on fail, fail also
|
||||
if ! check_module $_moddep; then
|
||||
derror "dracut module '$_mod' depends on '$_moddep', which can't be installed"
|
||||
@@ -1388,11 +1420,19 @@ for_each_module_dir() {
|
||||
|
||||
# Report any missing dracut modules, the user has specified
|
||||
_modcheck="$add_dracutmodules $force_add_dracutmodules"
|
||||
[[ $dracutmodules != all ]] && _modcheck="$m $dracutmodules"
|
||||
[[ $dracutmodules != all ]] && _modcheck="$_modcheck $dracutmodules"
|
||||
for _mod in $_modcheck; do
|
||||
[[ " $mods_to_load " == *\ $_mod\ * ]] && continue
|
||||
[[ " $omit_dracutmodules " == *\ $_mod\ * ]] && continue
|
||||
|
||||
[[ " $force_add_dracutmodules " != *\ $_mod\ * ]] \
|
||||
&& [[ " $dracutmodules " != *\ $_mod\ * ]] \
|
||||
&& [[ " $omit_dracutmodules " == *\ $_mod\ * ]] \
|
||||
&& continue
|
||||
|
||||
derror "dracut module '$_mod' cannot be found or installed."
|
||||
[[ " $force_add_dracutmodules " == *\ $_mod\ * ]] && exit 1
|
||||
[[ " $dracutmodules " == *\ $_mod\ * ]] && exit 1
|
||||
[[ " $add_dracutmodules " == *\ $_mod\ * ]] && exit 1
|
||||
done
|
||||
}
|
||||
|
||||
@@ -1411,7 +1451,7 @@ install_kmod_with_fw() {
|
||||
|
||||
if [[ $omit_drivers ]]; then
|
||||
local _kmod=${1##*/}
|
||||
_kmod=${_kmod%.ko}
|
||||
_kmod=${_kmod%.ko*}
|
||||
_kmod=${_kmod/-/_}
|
||||
if [[ "$_kmod" =~ $omit_drivers ]]; then
|
||||
dinfo "Omitting driver $_kmod"
|
||||
@@ -1425,7 +1465,7 @@ install_kmod_with_fw() {
|
||||
|
||||
if [[ $silent_omit_drivers ]]; then
|
||||
local _kmod=${1##*/}
|
||||
_kmod=${_kmod%.ko}
|
||||
_kmod=${_kmod%.ko*}
|
||||
_kmod=${_kmod/-/_}
|
||||
[[ "$_kmod" =~ $silent_omit_drivers ]] && return 0
|
||||
[[ "${1##*/lib/modules/$kernel/}" =~ $silent_omit_drivers ]] && return 0
|
||||
@@ -1472,7 +1512,7 @@ for_each_kmod_dep() {
|
||||
local _func=$1 _kmod=$2 _cmd _modpath _options
|
||||
shift 2
|
||||
modprobe "$@" --ignore-install --show-depends $_kmod 2>&${_fderr} | (
|
||||
while read _cmd _modpath _options; do
|
||||
while read _cmd _modpath _options || [ -n "$_cmd" ]; do
|
||||
[[ $_cmd = insmod ]] || continue
|
||||
$_func ${_modpath} || exit $?
|
||||
done
|
||||
@@ -1488,16 +1528,16 @@ dracut_kernel_post() {
|
||||
--ignore-install --show-depends --set-version $kernel \
|
||||
< "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist" 2>/dev/null \
|
||||
| sort -u \
|
||||
| while read _cmd _modpath _options; do
|
||||
| while read _cmd _modpath _options || [ -n "$_cmd" ]; do
|
||||
[[ $_cmd = insmod ]] || continue
|
||||
echo "$_modpath"
|
||||
done > "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist.dep"
|
||||
|
||||
(
|
||||
if [[ $DRACUT_INSTALL ]] && [[ -z $_moddirname ]]; then
|
||||
xargs -r $DRACUT_INSTALL ${initdir:+-D "$initdir"} -a < "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist.dep"
|
||||
xargs -r $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} -a < "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist.dep"
|
||||
else
|
||||
while read _modpath; do
|
||||
while read _modpath || [ -n "$_modpath" ]; do
|
||||
local _destpath=$_modpath
|
||||
[[ $_moddirname ]] && _destpath=${_destpath##$_moddirname/}
|
||||
_destpath=${_destpath##*/lib/modules/$kernel/}
|
||||
@@ -1505,16 +1545,16 @@ dracut_kernel_post() {
|
||||
done < "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist.dep"
|
||||
fi
|
||||
) &
|
||||
_pid=$(jobs -p | while read a ; do printf ":$a";done)
|
||||
_pid=$(jobs -p | while read a || [ -n "$a" ]; do printf ":$a";done)
|
||||
_pid=${_pid##*:}
|
||||
|
||||
if [[ $DRACUT_INSTALL ]]; then
|
||||
xargs -r modinfo -k $kernel -F firmware < "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist.dep" \
|
||||
| while read line; do
|
||||
| while read line || [ -n "$line" ]; do
|
||||
for _fwdir in $fw_dir; do
|
||||
echo $_fwdir/$line;
|
||||
done;
|
||||
done | xargs -r $DRACUT_INSTALL ${initdir:+-D "$initdir"} -a -o
|
||||
done | xargs -r $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} -a -o
|
||||
else
|
||||
for _fw in $(xargs -r modinfo -k $kernel -F firmware < "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist.dep"); do
|
||||
for _fwdir in $fw_dir; do
|
||||
@@ -1549,7 +1589,7 @@ module_is_host_only() {
|
||||
local _mod=$1
|
||||
local _modenc a i _k _s _v _aliases
|
||||
_mod=${_mod##*/}
|
||||
_mod=${_mod%.ko}
|
||||
_mod=${_mod%.ko*}
|
||||
_modenc=${_mod//-/_}
|
||||
|
||||
[[ " $add_drivers " == *\ ${_mod}\ * ]] && return 0
|
||||
@@ -1595,7 +1635,7 @@ find_kernel_modules_by_path () {
|
||||
|
||||
_OLDIFS=$IFS
|
||||
IFS=:
|
||||
while read a rest; do
|
||||
while read a rest || [ -n "$a" ]; do
|
||||
[[ $a = */$1/* ]] || [[ $a = updates/* ]] || continue
|
||||
printf "%s\n" "$srcmods/$a"
|
||||
done < "$srcmods/modules.dep"
|
||||
@@ -1639,11 +1679,18 @@ instmods() {
|
||||
--*) _mpargs+=" $_mod" ;;
|
||||
*)
|
||||
_mod=${_mod##*/}
|
||||
# Check for aliased modules
|
||||
_modalias=$(modinfo -k $kernel -F filename $_mod 2> /dev/null)
|
||||
_modalias=${_modalias%.ko*}
|
||||
if [[ $_modalias ]] && [ "${_modalias##*/}" != "${_mod%.ko*}" ] ; then
|
||||
_mod=${_modalias##*/}
|
||||
fi
|
||||
|
||||
# if we are already installed, skip this module and go on
|
||||
# to the next one.
|
||||
if [[ $DRACUT_KERNEL_LAZY_HASHDIR ]] && \
|
||||
[[ -f "$DRACUT_KERNEL_LAZY_HASHDIR/${_mod%.ko}.ko" ]]; then
|
||||
read _ret <"$DRACUT_KERNEL_LAZY_HASHDIR/${_mod%.ko}.ko"
|
||||
[[ -f "$DRACUT_KERNEL_LAZY_HASHDIR/${_mod%.ko*}" ]]; then
|
||||
read _ret <"$DRACUT_KERNEL_LAZY_HASHDIR/${_mod%.ko*}"
|
||||
return $_ret
|
||||
fi
|
||||
|
||||
@@ -1673,7 +1720,7 @@ instmods() {
|
||||
((_ret+=$?))
|
||||
else
|
||||
[[ $DRACUT_KERNEL_LAZY_HASHDIR ]] && \
|
||||
echo $_mod >> "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist"
|
||||
echo ${_mod%.ko*} >> "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
@@ -1683,20 +1730,18 @@ instmods() {
|
||||
function instmods_1() {
|
||||
local _mod _mpargs
|
||||
if (($# == 0)); then # filenames from stdin
|
||||
while read _mod; do
|
||||
while read _mod || [ -n "$_mod" ]; do
|
||||
inst1mod "${_mod%.ko*}" || {
|
||||
if [[ "$_check" == "yes" ]]; then
|
||||
[[ "$_silent" == "no" ]] && dfatal "Failed to install module $_mod"
|
||||
return 1
|
||||
if [[ "$_check" == "yes" ]] && [[ "$_silent" == "no" ]]; then
|
||||
dfatal "Failed to install module $_mod"
|
||||
fi
|
||||
}
|
||||
done
|
||||
fi
|
||||
while (($# > 0)); do # filenames as arguments
|
||||
inst1mod ${1%.ko*} || {
|
||||
if [[ "$_check" == "yes" ]]; then
|
||||
[[ "$_silent" == "no" ]] && dfatal "Failed to install module $1"
|
||||
return 1
|
||||
if [[ "$_check" == "yes" ]] && [[ "$_silent" == "no" ]]; then
|
||||
dfatal "Failed to install module $1"
|
||||
fi
|
||||
}
|
||||
shift
|
||||
@@ -1708,10 +1753,28 @@ instmods() {
|
||||
# Capture all stderr from modprobe to _fderr. We could use {var}>...
|
||||
# redirections, but that would make dracut require bash4 at least.
|
||||
eval "( instmods_1 \"\$@\" ) ${_fderr}>&1" \
|
||||
| while read line; do [[ "$line" =~ $_filter_not_found ]] || echo $line;done | derror
|
||||
| while read line || [ -n "$line" ]; do [[ "$line" =~ $_filter_not_found ]] || echo $line;done | derror
|
||||
_ret=$?
|
||||
return $_ret
|
||||
}
|
||||
|
||||
check_kernel_config()
|
||||
{
|
||||
local _config_opt="$1"
|
||||
local _config_file
|
||||
[[ -f /boot/config-$kernel ]] \
|
||||
&& _config_file="/boot/config-$kernel"
|
||||
[[ -f /lib/modules/$kernel/config ]] \
|
||||
&& _config_file="/lib/modules/$kernel/config"
|
||||
|
||||
# no kernel config file, so return true
|
||||
[[ $_config_file ]] || return 0
|
||||
|
||||
grep -q -F "${_config_opt}=" "$_config_file" && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
|
||||
# get_cpu_vendor
|
||||
# Only two values are returned: AMD or Intel
|
||||
get_cpu_vendor ()
|
||||
|
@@ -1,13 +1,21 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
set -e
|
||||
|
||||
# do some sanity checks first
|
||||
[ -e /run/initramfs/bin/sh ] && exit 0
|
||||
[ -e /run/initramfs/.need_shutdown ] || exit 0
|
||||
|
||||
KERNEL_VERSION="$(uname -r)"
|
||||
|
||||
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
|
||||
SKIP="$dracutbasedir/skipcpio"
|
||||
[[ -x $SKIP ]] || SKIP=cat
|
||||
|
||||
[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
|
||||
|
||||
mount -o ro /boot &>/dev/null
|
||||
|
||||
if [[ $MACHINE_ID ]] && [[ -d /boot/${MACHINE_ID} || -L /boot/${MACHINE_ID} ]] ; then
|
||||
IMG="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
|
||||
fi
|
||||
@@ -16,11 +24,12 @@ fi
|
||||
cd /run/initramfs
|
||||
|
||||
[ -f .need_shutdown -a -f "$IMG" ] || exit 1
|
||||
if zcat "$IMG" | cpio -id --quiet >/dev/null; then
|
||||
|
||||
if $SKIP "$IMG" | zcat | cpio -id --no-absolute-filenames --quiet >/dev/null; then
|
||||
rm -f -- .need_shutdown
|
||||
elif xzcat "$IMG" | cpio -id --quiet >/dev/null; then
|
||||
elif $SKIP "$IMG" | xzcat | cpio -id --no-absolute-filenames --quiet >/dev/null; then
|
||||
rm -f -- .need_shutdown
|
||||
elif lz4 -d -c "$IMG" | cpio -id --quiet >/dev/null; then
|
||||
elif $SKIP "$IMG" | lz4 -d -c | cpio -id --no-absolute-filenames --quiet >/dev/null; then
|
||||
rm -f -- .need_shutdown
|
||||
else
|
||||
# something failed, so we clean up
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 et filetype=sh
|
||||
#
|
||||
# logging faciality module for dracut both at build- and boot-time
|
||||
#
|
||||
@@ -367,7 +365,7 @@ dlog() {
|
||||
if (( $# > 1 )); then
|
||||
_do_dlog "$@"
|
||||
else
|
||||
while read line; do
|
||||
while read line || [ -n "$line" ]; do
|
||||
_do_dlog "$1" "$line"
|
||||
done
|
||||
fi
|
||||
|
38
dracut.8.asc
38
dracut.8.asc
@@ -31,7 +31,7 @@ early userspace.
|
||||
For a complete list of kernel command line options see *dracut.cmdline*(7).
|
||||
|
||||
If you are dropped to an emergency shell, while booting your initramfs,
|
||||
the file _/run/initramfs/rdsosreport.txt_ is created, which can be safed to a
|
||||
the file _/run/initramfs/rdsosreport.txt_ is created, which can be saved to a
|
||||
(to be mounted by hand) partition (usually /boot) or a USB stick.
|
||||
Additional debugging info can be produced by adding **rd.debug** to the kernel
|
||||
command line. _/run/initramfs/rdsosreport.txt_ contains all logs and the output
|
||||
@@ -136,6 +136,19 @@ example:
|
||||
----
|
||||
===============================
|
||||
|
||||
**--force-drivers** _<list of kernel modules>_::
|
||||
See add-drivers above. But in this case it is ensured that the drivers
|
||||
are tried to be loaded early via modprobe.
|
||||
+
|
||||
[NOTE]
|
||||
===============================
|
||||
If [LIST] has multiple arguments, then you have to put these in quotes. For
|
||||
example:
|
||||
----
|
||||
# dracut --force-drivers "kmodule1 kmodule2" ...
|
||||
----
|
||||
===============================
|
||||
|
||||
**--omit-drivers** _<list of kernel modules>_::
|
||||
specify a space-separated list of kernel modules not to add to the
|
||||
initramfs.
|
||||
@@ -349,6 +362,9 @@ example:
|
||||
----
|
||||
===============================
|
||||
|
||||
**--install-optional** _<file list>_::
|
||||
install the space separated list of files into the initramfs, if they exist.
|
||||
|
||||
**--gzip**::
|
||||
Compress the generated initramfs using gzip. This will be done by default,
|
||||
unless another compression option or --no-compress is passed. Equivalent to
|
||||
@@ -409,6 +425,9 @@ will not be able to boot.
|
||||
Do not compress the generated initramfs. This will override any other
|
||||
compression options.
|
||||
|
||||
**--reproducible**::
|
||||
Create reproducible images.
|
||||
|
||||
**--list-modules**::
|
||||
List all available dracut modules.
|
||||
|
||||
@@ -443,6 +462,23 @@ will not be able to boot.
|
||||
Regenerate all initramfs images at the default location with the kernel
|
||||
versions found on the system. Additional parameters are passed through.
|
||||
|
||||
**--loginstall _<DIR>_::
|
||||
Log all files installed from the host to _<DIR>_.
|
||||
|
||||
**--uefi::
|
||||
Instead of creating an initramfs image, dracut will create an UEFI executable,
|
||||
which can be executed by an UEFI BIOS.
|
||||
|
||||
**--uefi-stub _<FILE>_::
|
||||
Specifies the UEFI stub loader, which will load the attached kernel, initramfs and
|
||||
kernel command line and boots the kernel. The default is
|
||||
_/lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_
|
||||
or _/usr/lib/gummiboot/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_
|
||||
|
||||
**--kernel-image _<FILE>_::
|
||||
Specifies the kernel image, which to include in the UEFI executable. The default is
|
||||
_/lib/modules/<KERNEL-VERSION>/vmlinuz_ or _/boot/vmlinuz-<KERNEL-VERSION>_
|
||||
|
||||
FILES
|
||||
-----
|
||||
_/var/log/dracut.log_::
|
||||
|
@@ -81,6 +81,14 @@ rootfstype=ext3
|
||||
enable autoassembly of special devices like cryptoLUKS, dmraid, mdraid or
|
||||
lvm. Default is off as of dracut version >= 024.
|
||||
|
||||
**rd.hostonly=0**::
|
||||
removes all compiled in configuration of the host system the initramfs image
|
||||
was built on. This helps booting, if any disk layout changed, especially in
|
||||
combination with rd.auto or other parameters specifying the layout.
|
||||
|
||||
**rd.cmdline=ask**::
|
||||
prompts the user for additional kernel command line parameters
|
||||
|
||||
**rd.fstab=0**::
|
||||
do not honor special mount options for the root filesystem found in
|
||||
_/etc/fstab_ of the real root.
|
||||
@@ -101,6 +109,23 @@ resume=UUID=3f5ad593-4546-4a94-a374-bcfb68aa11f7
|
||||
the init system performs fsck before remount, you might want to use this
|
||||
option to avoid duplication.
|
||||
|
||||
iso-scan/filename
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
Using iso-scan/filename with a Fedora/Red Hat/CentOS Live iso should just work
|
||||
by copying the original kernel cmdline parameters.
|
||||
|
||||
[listing]
|
||||
.Example
|
||||
--
|
||||
menuentry 'Live Fedora 20' --class fedora --class gnu-linux --class gnu --class os {
|
||||
set isolabel=Fedora-Live-LXDE-x86_64-20-1
|
||||
set isofile="/boot/iso/Fedora-Live-LXDE-x86_64-20-1.iso"
|
||||
loopback loop $isofile
|
||||
linux (loop)/isolinux/vmlinuz0 boot=isolinux iso-scan/filename=$isofile root=live:LABEL=$isolabel ro rd.live.image quiet rhgb
|
||||
initrd (loop)/isolinux/initrd0.img
|
||||
}
|
||||
--
|
||||
|
||||
Misc
|
||||
~~~~
|
||||
@@ -117,11 +142,16 @@ Misc
|
||||
have been loaded. This parameter can be specified multiple times.
|
||||
|
||||
**rd.retry=**__<seconds>__::
|
||||
specify how long dracut should wait for devices to appear.
|
||||
specify how long dracut should retry the initqueue to configure devices.
|
||||
The default is 30 seconds. After 2/3 of the time, degraded raids are force
|
||||
started. If you have hardware, which takes a very long time to announce its
|
||||
drives, you might want to extend this value.
|
||||
|
||||
**rd.timeout=**__<seconds>__::
|
||||
specify how long dracut should wait for devices to appear. The
|
||||
default is '0', which means 'forever'. Note that this timeout
|
||||
should be longer than rd.retry to allow for proper configuration.
|
||||
|
||||
**rd.noverifyssl**::
|
||||
accept self-signed certificates for ssl downloads.
|
||||
|
||||
@@ -133,7 +163,7 @@ Misc
|
||||
Debug
|
||||
~~~~~
|
||||
If you are dropped to an emergency shell, the file
|
||||
_/run/initramfs/rdsosreport.txt_ is created, which can be safed to a (to be
|
||||
_/run/initramfs/rdsosreport.txt_ is created, which can be saved to a (to be
|
||||
mounted by hand) partition (usually /boot) or a USB stick. Additional debugging
|
||||
info can be produced by adding **rd.debug** to the kernel command line.
|
||||
_/run/initramfs/rdsosreport.txt_ contains all logs and the output of some tools.
|
||||
@@ -354,6 +384,11 @@ DM RAID
|
||||
only activate the raid sets with the given UUID. This parameter can be
|
||||
specified multiple times.
|
||||
|
||||
MULTIPATH
|
||||
~~~~~~~~~
|
||||
**rd.multipath=0**::
|
||||
disable multipath detection
|
||||
|
||||
FIPS
|
||||
~~~~
|
||||
**rd.fips**::
|
||||
@@ -437,7 +472,7 @@ USB Android phone::
|
||||
* enp0s29u1u2
|
||||
=====================
|
||||
|
||||
**ip=**__{dhcp|on|any|dhcp6|auto6|ibft}__::
|
||||
**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.
|
||||
@@ -446,8 +481,6 @@ USB Android phone::
|
||||
|
||||
dhcp6::: IPv6 DHCP
|
||||
|
||||
ibft::: iBFT autoconfiguration
|
||||
|
||||
**ip=**__<interface>__:__{dhcp|on|any|dhcp6|auto6}__[:[__<mtu>__][:__<macaddr>__]]::
|
||||
This parameter can be specified multiple times.
|
||||
+
|
||||
@@ -487,6 +520,19 @@ WARNING: Do **not** use the default kernel naming scheme for the interface name,
|
||||
as it can conflict with the kernel names. So, don't use "eth[0-9]+" for the
|
||||
interface name. Better name it "bootnet" or "bluesocket".
|
||||
|
||||
**rd.route=**__<net>__/__<netmask>__:__<gateway>__[:__<interface>__]::
|
||||
Add a static route with route options, which are separated by a colon.
|
||||
IPv6 addresses have to be put in brackets.
|
||||
+
|
||||
[listing]
|
||||
.Example
|
||||
--
|
||||
rd.route=192.168.200.0/24:192.168.100.222:ens10
|
||||
rd.route=192.168.200.0/24:192.168.100.222
|
||||
rd.route=192.168.200.0/24::ens10
|
||||
rd.route=[2001:DB8:3::/8]:[2001:DB8:2::1]:ens10
|
||||
--
|
||||
|
||||
**bootdev=**__<interface>__::
|
||||
specify network interface to use routing and netroot information from.
|
||||
Required if multiple ip= lines are used.
|
||||
@@ -534,7 +580,7 @@ NFS
|
||||
~~~
|
||||
**root=**\[_<server-ip>_:]__<root-dir>__[:__<nfs-options>__]::
|
||||
mount nfs share from <server-ip>:/<root-dir>, if no server-ip is given, use
|
||||
dhcp next_server. if server-ip is an IPv6 address it has to be put in
|
||||
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 ",".
|
||||
|
||||
@@ -661,6 +707,9 @@ will result in
|
||||
iscsistart -b --param node.session.timeo.replacement_timeout=30
|
||||
--
|
||||
|
||||
**rd.iscsi.ibft** **rd.iscsi.ibft=1**:
|
||||
Turn on iBFT autoconfiguration for the interfaces
|
||||
|
||||
FCoE
|
||||
~~~~
|
||||
**fcoe=**__<edd|interface|MAC>__:__{dcb|nodcb}__::
|
||||
@@ -711,10 +760,119 @@ 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,protocol=bar
|
||||
--
|
||||
|
||||
Booting live images
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
Dracut offers multiple options for live booted images:
|
||||
|
||||
=====================
|
||||
squashfs with read-only filesystem image::: The system will boot with a read
|
||||
only filesystem from the squashfs and apply a writable device mapper snapshot
|
||||
over the read only filesystem. Using this method ensures a relatively fast
|
||||
boot and lower RAM usage. Users **must be careful** to avoid writing too many
|
||||
blocks to the snapshot volume. Once the blocks of the snapshot are exhaused,
|
||||
the live filesystem becomes unusable and requires a reboot.
|
||||
+
|
||||
The filesystem structure is expected to be:
|
||||
+
|
||||
[listing]
|
||||
--
|
||||
squashfs.img | Squashfs downloaded via network
|
||||
!(mount)
|
||||
/LiveOS
|
||||
|- ext3fs.img | Filesystem image to mount read-only
|
||||
!(mount)
|
||||
/bin | Live filesystem
|
||||
/boot |
|
||||
/dev |
|
||||
... |
|
||||
--
|
||||
+
|
||||
Dracut uses this method of live booting by default. No additional command line
|
||||
options are required other than **root=live:<URL>** to specify the location
|
||||
of your squashed filesystem.
|
||||
+
|
||||
writable filesystem image::: The system will retrieve a compressed filesystem
|
||||
image, connect it to a loopback device, and mount it as a writable volume. More
|
||||
RAM is required during boot but the live filesystem is easier to manage if it
|
||||
becomes full. Users can make a filesystem image of any size and that size will
|
||||
be maintained when the system boots.
|
||||
+
|
||||
The filesystem structure is expected to be:
|
||||
+
|
||||
[listing]
|
||||
--
|
||||
rootfs.tgz | Compressed tarball containing fileystem image
|
||||
!(unpack)
|
||||
/rootfs.img | Filesystem image
|
||||
!(mount)
|
||||
/bin | Live filesystem
|
||||
/boot |
|
||||
/dev |
|
||||
... |
|
||||
--
|
||||
+
|
||||
To use this boot option, ensure that **rd.writable_fsimg=1** is in your kernel
|
||||
command line and add the **root=live:<URL>** to specify the location
|
||||
of your compressed filesystem image tarball.
|
||||
=====================
|
||||
|
||||
**root=**live:__<url>__::
|
||||
Boots a live image retrieved from __<url>__. Valid handlers: __http, https, ftp, torrent, tftp__.
|
||||
+
|
||||
[listing]
|
||||
.Example
|
||||
--
|
||||
root=live:http://example.com/liveboot.img
|
||||
root=live:ftp://ftp.example.com/liveboot.img
|
||||
root=live:torrent://example.com/liveboot.img.torrent
|
||||
--
|
||||
|
||||
**rd.live.debug=**1::
|
||||
Enables debug output from the live boot process.
|
||||
|
||||
**rd.live.dir=**__<path>__::
|
||||
Specifies the directory within the squashfs where the ext3fs.img or rootfs.img
|
||||
can be found. By default, this is __LiveOS__.
|
||||
|
||||
**rd.live.ram=**1::
|
||||
Copy the complete image to RAM and use this for booting. This is useful
|
||||
when the image resides on i.e. a DVD which needs to be ejected later on.
|
||||
|
||||
**rd.live.overlay=**_<devspec>_:_(<pathspec>|auto)__
|
||||
Allow the usage of a permanent overlay.
|
||||
_<devspec>_ specifies the path to a device with a mountable filesystem.
|
||||
_<pathspec>_ is the path to a file within that filesystem, which shall be used to
|
||||
persist the changes made to the device specified by **root=live:__<url>__** option.
|
||||
+
|
||||
[listing]
|
||||
.Example
|
||||
--
|
||||
rd.live.overlay=/dev/sdb1:persistent-overlay.img
|
||||
--
|
||||
|
||||
**rd.live.overlay.thin=**1::
|
||||
Enables the usage of thin snapshots instead of classic dm snapshots.
|
||||
The advantage of thin snapshots is, that they support discards, and will free
|
||||
blocks which are not claimed by the filesystem. In this use case this means,
|
||||
that memory is given back to the kernel, when the filesystem does not claim it
|
||||
anymore.
|
||||
|
||||
**rd.writable.fsimg=**1::
|
||||
Enables writable filesystem support. The system will boot with a fully
|
||||
writable filesystem without snapshots __(see notes above about available live boot options)__.
|
||||
You can use the **rootflags** option to set mount options for the live
|
||||
filesystem as well __(see documentation about rootflags in the **Standard** section above)__.
|
||||
This implies that the whole image is copied to RAM before the boot continues.
|
||||
+
|
||||
NOTE: There must be enough free RAM available to hold the complete image.
|
||||
+
|
||||
This method is very suitable for diskless boots.
|
||||
|
||||
|
||||
Plymouth Boot Splash
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
**plymouth.enable=0**::
|
||||
disable the plymouth bootsplash completly.
|
||||
disable the plymouth bootsplash completely.
|
||||
|
||||
**rd.plymouth=0**::
|
||||
disable the plymouth bootsplash only for the initramfs.
|
||||
@@ -832,6 +990,8 @@ rd_NO_MD:: rd.md=0
|
||||
|
||||
rd_MD_UUID:: rd.md.uuid
|
||||
|
||||
rd_NO_MULTIPATH: rd.multipath=0
|
||||
|
||||
rd_NFS_DOMAIN:: rd.nfs.domain
|
||||
|
||||
iscsi_initiator:: rd.iscsi.initiator
|
||||
|
@@ -10,7 +10,8 @@ dracut.conf - configuration file(s) for dracut
|
||||
|
||||
SYNOPSIS
|
||||
--------
|
||||
_/etc/dracut.conf_ _/etc/dracut.conf.d/*.conf_
|
||||
_/etc/dracut.conf_
|
||||
_/etc/dracut.conf.d/\*.conf_
|
||||
_/usr/lib/dracut/dracut.conf.d/*.conf_
|
||||
|
||||
Description
|
||||
@@ -49,6 +50,10 @@ Configuration files must have the extension .conf; other extensions are ignored.
|
||||
Specify a space-separated list of kernel modules to add to the initramfs.
|
||||
The kernel modules have to be specified without the ".ko" suffix.
|
||||
|
||||
*force_drivers+=*" __<list of kernel modules>__ "::
|
||||
See add_drivers above. But in this case it is ensured that the drivers
|
||||
are tried to be loaded early via modprobe.
|
||||
|
||||
*omit_drivers+=*" __<kernel modules>__ "::
|
||||
Specify a space-separated list of kernel modules not to add to the
|
||||
initramfs. The kernel modules have to be specified without the ".ko" suffix.
|
||||
@@ -66,6 +71,17 @@ Configuration files must have the extension .conf; other extensions are ignored.
|
||||
*install_items+=*" __<file>__[ __<file>__ ...] "::
|
||||
Specify additional files to include in the initramfs, separated by spaces.
|
||||
|
||||
*install_optional_items+=*" __<file>__[ __<file>__ ...] "::
|
||||
Specify additional files to include in the initramfs, separated by spaces,
|
||||
if they exist.
|
||||
|
||||
*compress=*"__{bzip2|lzma|xz|gzip|lzo|lz4|<compressor [args ...]>}__"::
|
||||
Compress the generated initramfs using the passed compression program. If
|
||||
you pass it just the name of a compression program, it will call that
|
||||
program with known-working arguments. If you pass arguments, it will be called
|
||||
with exactly those arguments. Depending on what you pass, this may result in
|
||||
an initramfs that the kernel cannot decompress.
|
||||
|
||||
*do_strip=*"__{yes|no}__"::
|
||||
Strip binaries in the initramfs (default=yes)
|
||||
|
||||
@@ -76,7 +92,7 @@ Configuration files must have the extension .conf; other extensions are ignored.
|
||||
Host-Only mode: Install only what is needed for booting the local host
|
||||
instead of a generic host and generate host-specific configuration.
|
||||
|
||||
*hostonly_cmdline*"__{yes|no}__"::
|
||||
*hostonly_cmdline=*"__{yes|no}__"::
|
||||
If set, store the kernel command line arguments needed in the initramfs
|
||||
|
||||
*persistent_policy=*"__<policy>__"::
|
||||
@@ -175,6 +191,22 @@ provide a valid _/etc/fstab_.
|
||||
*i18n_install_all=*"__{yes|no}__"::
|
||||
Install everything regardless of generic or hostonly mode.
|
||||
|
||||
*reproducible=*"__{yes|no}__"::
|
||||
Create reproducible images.
|
||||
|
||||
*loginstall=*"__<DIR>__"::
|
||||
Log all files installed from the host to _<DIR>_.
|
||||
|
||||
*uefi_stub=*"_<FILE>_"::
|
||||
Specifies the UEFI stub loader, which will load the attached kernel, initramfs and
|
||||
kernel command line and boots the kernel. The default is
|
||||
_/lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_
|
||||
or _/usr/lib/gummiboot/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_
|
||||
|
||||
*kernel_image=*"_<FILE>_"::
|
||||
Specifies the kernel image, which to include in the UEFI executable. The default is
|
||||
_/lib/modules/<KERNEL-VERSION>/vmlinuz_ or _/boot/vmlinuz-<KERNEL-VERSION>_
|
||||
|
||||
Files
|
||||
-----
|
||||
_/etc/dracut.conf_::
|
||||
|
@@ -2,11 +2,13 @@
|
||||
|
||||
# i18n
|
||||
i18n_vars="/etc/sysconfig/keyboard:KEYTABLE-KEYMAP /etc/sysconfig/i18n:SYSFONT-FONT,FONTACM-FONT_MAP,FONT_UNIMAP"
|
||||
i18n_default_font="latarcyrheb-sun16"
|
||||
i18n_default_font="eurlatgr"
|
||||
i18n_install_all="yes"
|
||||
|
||||
|
||||
stdloglvl=3
|
||||
sysloglvl=5
|
||||
install_items+=" vi /etc/virc ps grep cat rm "
|
||||
install_optional_items+=" vi /etc/virc ps grep cat rm "
|
||||
prefix="/"
|
||||
systemdutildir=/usr/lib/systemd
|
||||
systemdsystemunitdir=/usr/lib/systemd/system
|
||||
@@ -14,3 +16,4 @@ systemdsystemconfdir=/etc/systemd/system
|
||||
udevdir=/usr/lib/udev
|
||||
hostonly="yes"
|
||||
hostonly_cmdline="no"
|
||||
early_microcode="yes"
|
||||
|
@@ -1,3 +1,24 @@
|
||||
# SUSE specifc dracut settings
|
||||
#
|
||||
# SUSE by default always builds a as small as possible initrd for performance
|
||||
# and resource reasons.
|
||||
# If you like to build a generic initrd which works on other platforms than
|
||||
# on the one dracut/mkinitrd got called comment out below setting(s).
|
||||
hostonly="yes"
|
||||
hostonly_cmdline="yes"
|
||||
|
||||
compress="xz -0 --check=crc32 --memlimit-compress=50%"
|
||||
|
||||
i18n_vars="/etc/sysconfig/language:RC_LANG-LANG,RC_LC_ALL-LC_ALL /etc/sysconfig/console:CONSOLE_UNICODEMAP-FONT_UNIMAP,CONSOLE_FONT-FONT,CONSOLE_SCREENMAP-FONT_MAP /etc/sysconfig/keyboard:KEYTABLE-KEYMAP"
|
||||
omit_drivers+=" i2o_scsi"
|
||||
|
||||
# Below adds additional tools to the initrd which are not urgently necessary to
|
||||
# bring up the system, but help to debug problems.
|
||||
# See /usr/lib/dracut/modules.d/95debug/module-setup.sh which additional tools
|
||||
# are installed and add more if you need them. This specifically helps if you
|
||||
# use:
|
||||
# rd.break=[cmdline|pre-udev|pre-trigger|initqueue|pre-mount|
|
||||
# mount|pre-pivot|cleanup]
|
||||
# boot parameter or if you are forced to enter the dracut emergency shell.
|
||||
|
||||
# add_dracutmodules+=debug
|
||||
|
@@ -19,7 +19,7 @@ you can replace init with your own version of _99base_, this is not encouraged.
|
||||
Instead you should use, if possible, the hooks of dracut. All hooks, and the
|
||||
point of time in which they are executed, are described in <<stages>>.
|
||||
|
||||
The main script, which creates the initramfs is dracut itsself. It parses all
|
||||
The main script, which creates the initramfs is dracut itself. It parses all
|
||||
arguments and sets up the directory, in which everything is installed. It then
|
||||
executes all check, install, installkernel scripts found in the modules, which
|
||||
are to be processed. After everything is installed, the install directory is
|
||||
|
505
dracut.sh
505
dracut.sh
@@ -1,6 +1,4 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
#!/bin/bash --norc
|
||||
#
|
||||
# Generator script for a dracut initramfs
|
||||
# Tries to retain some degree of compatibility with the command line
|
||||
@@ -81,6 +79,10 @@ Creates initial ramdisk images for preloading modules
|
||||
exclusively include in the initramfs.
|
||||
--add-drivers [LIST] Specify a space-separated list of kernel
|
||||
modules to add to the initramfs.
|
||||
--force-drivers [LIST] Specify a space-separated list of kernel
|
||||
modules to add to the initramfs and make sure they
|
||||
are tried to be loaded via modprobe same as passing
|
||||
rd.driver.pre=DRIVER kernel parameter.
|
||||
--omit-drivers [LIST] Specify a space-separated list of kernel
|
||||
modules not to add to the initramfs.
|
||||
--filesystems [LIST] Specify a space-separated list of kernel filesystem
|
||||
@@ -158,6 +160,8 @@ Creates initial ramdisk images for preloading modules
|
||||
in the final initramfs.
|
||||
-I, --install [LIST] Install the space separated list of files into the
|
||||
initramfs.
|
||||
--install-optional [LIST] Install the space separated list of files into the
|
||||
initramfs, if they exist.
|
||||
--gzip Compress the generated initramfs using gzip.
|
||||
This will be done by default, unless another
|
||||
compression option or --no-compress is passed.
|
||||
@@ -170,10 +174,10 @@ Creates initial ramdisk images for preloading modules
|
||||
--xz Compress the generated initramfs using xz.
|
||||
Make sure that your kernel has xz support compiled
|
||||
in, otherwise you will not be able to boot.
|
||||
--lzo Compress the generated initramfs using lzop.
|
||||
--lzo Compress the generated initramfs using lzop.
|
||||
Make sure that your kernel has lzo support compiled
|
||||
in, otherwise you will not be able to boot.
|
||||
--lz4 Compress the generated initramfs using lz4.
|
||||
--lz4 Compress the generated initramfs using lz4.
|
||||
Make sure that your kernel has lz4 support compiled
|
||||
in, otherwise you will not be able to boot.
|
||||
--compress [COMPRESSION] Compress the generated initramfs with the
|
||||
@@ -189,6 +193,12 @@ Creates initial ramdisk images for preloading modules
|
||||
--printsize Print out the module install size
|
||||
--sshkey [SSHKEY] Add ssh key to initramfs (use with ssh-client module)
|
||||
--logfile [FILE] Logfile to use (overrides configuration setting)
|
||||
--reproducible Create reproducible images
|
||||
--loginstall [DIR] Log all files installed from the host to [DIR]
|
||||
--uefi Create an UEFI executable with the kernel cmdline and
|
||||
kernel combined
|
||||
--uefi-stub [FILE] Use the UEFI stub [FILE] to create an UEFI executable
|
||||
--kernel-image [FILE] location of the kernel image
|
||||
|
||||
If [LIST] has multiple arguments, then you have to put these in quotes.
|
||||
|
||||
@@ -213,6 +223,16 @@ push() {
|
||||
done
|
||||
}
|
||||
|
||||
# Fills up host_devs stack variable and makes sure there are no duplicates
|
||||
push_host_devs() {
|
||||
local _dev
|
||||
for _dev in ${host_devs[@]}; do
|
||||
[ "$_dev" = "$1" ] && return
|
||||
done
|
||||
push host_devs "$1"
|
||||
}
|
||||
|
||||
|
||||
# function pop()
|
||||
# pops the last value from a stack
|
||||
# assigns value to second argument variable
|
||||
@@ -299,12 +319,14 @@ rearrange_params()
|
||||
--long add: \
|
||||
--long force-add: \
|
||||
--long add-drivers: \
|
||||
--long force-drivers: \
|
||||
--long omit-drivers: \
|
||||
--long modules: \
|
||||
--long omit: \
|
||||
--long drivers: \
|
||||
--long filesystems: \
|
||||
--long install: \
|
||||
--long install-optional: \
|
||||
--long fwdir: \
|
||||
--long libdirs: \
|
||||
--long fscks: \
|
||||
@@ -369,6 +391,11 @@ rearrange_params()
|
||||
--long noimageifnotneeded \
|
||||
--long early-microcode \
|
||||
--long no-early-microcode \
|
||||
--long reproducible \
|
||||
--long loginstall: \
|
||||
--long uefi \
|
||||
--long uefi-stub: \
|
||||
--long kernel-image: \
|
||||
-- "$@")
|
||||
|
||||
if (( $? != 0 )); then
|
||||
@@ -463,12 +490,16 @@ while :; do
|
||||
-a|--add) push add_dracutmodules_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;;
|
||||
--force-add) push force_add_dracutmodules_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;;
|
||||
--add-drivers) push add_drivers_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;;
|
||||
--force-drivers) push force_drivers_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;;
|
||||
--omit-drivers) push omit_drivers_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;;
|
||||
-m|--modules) push dracutmodules_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;;
|
||||
-o|--omit) push omit_dracutmodules_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;;
|
||||
-d|--drivers) push drivers_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;;
|
||||
--filesystems) push filesystems_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;;
|
||||
-I|--install) push install_items_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;;
|
||||
--install-optional)
|
||||
push install_optional_items_l \
|
||||
"$2"; PARMS_TO_STORE+=" '$2'"; shift;;
|
||||
--fwdir) push fw_dir_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;;
|
||||
--libdirs) push libdirs_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;;
|
||||
--fscks) push fscks_l "$2"; PARMS_TO_STORE+=" '$2'"; shift;;
|
||||
@@ -486,6 +517,7 @@ while :; do
|
||||
-L|--stdlog) stdloglvl_l="$2"; PARMS_TO_STORE+=" '$2'"; shift;;
|
||||
--compress) compress_l="$2"; PARMS_TO_STORE+=" '$2'"; shift;;
|
||||
--prefix) prefix_l="$2"; PARMS_TO_STORE+=" '$2'"; shift;;
|
||||
--loginstall) loginstall_l="$2"; PARMS_TO_STORE+=" '$2'"; shift;;
|
||||
--rebuild) if [ $rebuild_file == $outfile ]; then
|
||||
force=yes
|
||||
fi
|
||||
@@ -551,7 +583,12 @@ while :; do
|
||||
--printsize) printsize="yes";;
|
||||
--regenerate-all) regenerate_all="yes";;
|
||||
--noimageifnotneeded) noimageifnotneeded="yes";;
|
||||
|
||||
--reproducible) reproducible_l="yes";;
|
||||
--uefi) uefi="yes";;
|
||||
--uefi-stub)
|
||||
uefi_stub_l="$2"; PARMS_TO_STORE+=" '$2'"; shift;;
|
||||
--kernel-image)
|
||||
kernel_image_l="$2"; PARMS_TO_STORE+=" '$2'"; shift;;
|
||||
--) shift; break;;
|
||||
|
||||
*) # should not even reach this point
|
||||
@@ -620,21 +657,10 @@ if ! [[ $outfile ]]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
for i in /usr/sbin /sbin /usr/bin /bin; do
|
||||
rl=$i
|
||||
if [ -L "$i" ]; then
|
||||
rl=$(readlink -f $i)
|
||||
fi
|
||||
if [[ "$NPATH" != *:$rl* ]] ; then
|
||||
NPATH+=":$rl"
|
||||
fi
|
||||
done
|
||||
export PATH="${NPATH#:}"
|
||||
unset LC_MESSAGES
|
||||
unset LC_CTYPE
|
||||
export LC_ALL=C
|
||||
export LANG=C
|
||||
unset NPATH
|
||||
unset LD_LIBRARY_PATH
|
||||
unset LD_PRELOAD
|
||||
unset GREP_OPTIONS
|
||||
@@ -679,6 +705,20 @@ for f in $(dropindirs_sort ".conf" "$confdir" "$dracutbasedir/dracut.conf.d"); d
|
||||
[[ -e $f ]] && . "$f"
|
||||
done
|
||||
|
||||
DRACUT_PATH=${DRACUT_PATH:-/sbin /bin /usr/sbin /usr/bin}
|
||||
|
||||
for i in $DRACUT_PATH; do
|
||||
rl=$i
|
||||
if [ -L "$i" ]; then
|
||||
rl=$(readlink -f $i)
|
||||
fi
|
||||
if [[ "$NPATH" != *:$rl* ]] ; then
|
||||
NPATH+=":$rl"
|
||||
fi
|
||||
done
|
||||
export PATH="${NPATH#:}"
|
||||
unset NPATH
|
||||
|
||||
# these optins add to the stuff in the config file
|
||||
if (( ${#add_dracutmodules_l[@]} )); then
|
||||
while pop add_dracutmodules_l val; do
|
||||
@@ -716,6 +756,12 @@ if (( ${#install_items_l[@]} )); then
|
||||
done
|
||||
fi
|
||||
|
||||
if (( ${#install_optional_items_l[@]} )); then
|
||||
while pop install_optional_items_l val; do
|
||||
install_optional_items+=" $val "
|
||||
done
|
||||
fi
|
||||
|
||||
# these options override the stuff in the config file
|
||||
if (( ${#dracutmodules_l[@]} )); then
|
||||
dracutmodules=''
|
||||
@@ -769,12 +815,13 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
|
||||
[[ $prefix = "/" ]] && unset prefix
|
||||
[[ $hostonly_l ]] && hostonly=$hostonly_l
|
||||
[[ $hostonly_cmdline_l ]] && hostonly_cmdline=$hostonly_cmdline_l
|
||||
[[ "$hostonly" == "yes" ]] && ! [[ $hostonly_cmdline ]] && hostonly_cmdline="yes"
|
||||
[[ $persistent_policy_l ]] && persistent_policy=$persistent_policy_l
|
||||
[[ $use_fstab_l ]] && use_fstab=$use_fstab_l
|
||||
[[ $mdadmconf_l ]] && mdadmconf=$mdadmconf_l
|
||||
[[ $lvmconf_l ]] && lvmconf=$lvmconf_l
|
||||
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
|
||||
[[ $fw_dir ]] || fw_dir="/lib/firmware/updates /lib/firmware"
|
||||
[[ $fw_dir ]] || fw_dir="/lib/firmware/updates /lib/firmware /lib/firmware/$kernel"
|
||||
[[ $tmpdir_l ]] && tmpdir="$tmpdir_l"
|
||||
[[ $tmpdir ]] || tmpdir=/var/tmp
|
||||
[[ $INITRD_COMPRESS ]] && compress=$INITRD_COMPRESS
|
||||
@@ -785,16 +832,38 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
|
||||
[[ $early_microcode_l ]] && early_microcode=$early_microcode_l
|
||||
[[ $early_microcode ]] || early_microcode=no
|
||||
[[ $logfile_l ]] && logfile="$logfile_l"
|
||||
[[ $reproducible_l ]] && reproducible="$reproducible_l"
|
||||
[[ $loginstall_l ]] && loginstall="$loginstall_l"
|
||||
[[ $uefi_stub_l ]] && uefi_stub="$uefi_stub_l"
|
||||
[[ $kernel_image_l ]] && kernel_image="$kernel_image_l"
|
||||
|
||||
# eliminate IFS hackery when messing with fw_dir
|
||||
fw_dir=${fw_dir//:/ }
|
||||
|
||||
# check for logfile and try to create one if it doesn't exist
|
||||
if [[ -n "$logfile" ]];then
|
||||
if [[ ! -f "$logfile" ]];then
|
||||
touch "$logfile"
|
||||
if [ ! $? -eq 0 ] ;then
|
||||
printf "%s\n" "dracut: touch $logfile failed." >&2
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# handle compression options.
|
||||
[[ $compress ]] || compress="gzip"
|
||||
case $compress in
|
||||
bzip2) compress="bzip2 -9";;
|
||||
bzip2) compress="bzip2 -9";
|
||||
command -v lbzip2 > /dev/null 2>&1 && compress="lbzip2 -9";;
|
||||
lzma) compress="lzma -9 -T0";;
|
||||
xz) compress="xz --check=crc32 --lzma2=dict=1MiB -T0";;
|
||||
gzip) compress="gzip -9"; command -v pigz > /dev/null 2>&1 && compress="pigz -9";;
|
||||
gzip) compress="gzip -n -9";
|
||||
if command -v pigz > /dev/null 2>&1; then
|
||||
compress="pigz -9 -n -T -R"
|
||||
elif command -v gzip --help 2>&1 | grep -q rsyncable; then
|
||||
compress="gzip -n -9 --rsyncable"
|
||||
fi
|
||||
;;
|
||||
lzo) compress="lzop -9";;
|
||||
lz4) compress="lz4 -l -9";;
|
||||
esac
|
||||
@@ -805,6 +874,8 @@ fi
|
||||
[[ $hostonly = yes ]] && hostonly="-h"
|
||||
[[ $hostonly != "-h" ]] && unset hostonly
|
||||
|
||||
[[ $reproducible == yes ]] && DRACUT_REPRODUCIBLE=1
|
||||
|
||||
readonly TMPDIR="$tmpdir"
|
||||
readonly initdir="$(mktemp --tmpdir="$TMPDIR/" -d -t initramfs.XXXXXX)"
|
||||
[ -d "$initdir" ] || {
|
||||
@@ -824,6 +895,7 @@ trap '
|
||||
ret=$?;
|
||||
[[ $keep ]] && echo "Not removing $initdir." >&2 || { [[ $initdir ]] && rm -rf -- "$initdir"; };
|
||||
[[ $keep ]] && echo "Not removing $early_cpio_dir." >&2 || { [[ $early_cpio_dir ]] && rm -Rf -- "$early_cpio_dir"; };
|
||||
[[ $keep ]] && echo "Not removing $uefi_outdir." >&2 || { [[ $uefi_outdir ]] && rm -Rf -- "$uefi_outdir"; };
|
||||
[[ $_dlogdir ]] && rm -Rf -- "$_dlogdir";
|
||||
exit $ret;
|
||||
' EXIT
|
||||
@@ -834,6 +906,17 @@ trap 'exit 1;' SIGINT
|
||||
export DRACUT_KERNEL_LAZY="1"
|
||||
export DRACUT_RESOLVE_LAZY="1"
|
||||
|
||||
if [[ $print_cmdline ]]; then
|
||||
stdloglvl=0
|
||||
sysloglvl=0
|
||||
fileloglvl=0
|
||||
kmsgloglvl=0
|
||||
fi
|
||||
|
||||
if [[ -f $dracutbasedir/dracut-version.sh ]]; then
|
||||
. $dracutbasedir/dracut-version.sh
|
||||
fi
|
||||
|
||||
if [[ -f $dracutbasedir/dracut-functions.sh ]]; then
|
||||
. $dracutbasedir/dracut-functions.sh
|
||||
else
|
||||
@@ -852,11 +935,7 @@ if ! [[ $print_cmdline ]]; then
|
||||
rm -fr -- ${initdir}/*
|
||||
fi
|
||||
|
||||
if [[ -f $dracutbasedir/dracut-version.sh ]]; then
|
||||
. $dracutbasedir/dracut-version.sh
|
||||
fi
|
||||
|
||||
# Verify bash version, current minimum is 3.1
|
||||
# Verify bash version, current minimum is 4
|
||||
if (( BASH_VERSINFO[0] < 4 )); then
|
||||
dfatal 'You need at least Bash 4 to use dracut, sorry.'
|
||||
exit 1
|
||||
@@ -880,6 +959,13 @@ if (( ${#add_drivers_l[@]} )); then
|
||||
fi
|
||||
add_drivers=${add_drivers/-/_}
|
||||
|
||||
if (( ${#force_drivers_l[@]} )); then
|
||||
while pop force_drivers_l val; do
|
||||
force_drivers+=" $val "
|
||||
done
|
||||
fi
|
||||
force_drivers=${force_drivers/-/_}
|
||||
|
||||
if (( ${#omit_drivers_l[@]} )); then
|
||||
while pop omit_drivers_l val; do
|
||||
omit_drivers+=" $val "
|
||||
@@ -896,6 +982,7 @@ fi
|
||||
omit_drivers_corrected=""
|
||||
for d in $omit_drivers; do
|
||||
[[ " $drivers $add_drivers " == *\ $d\ * ]] && continue
|
||||
[[ " $drivers $force_drivers " == *\ $d\ * ]] && continue
|
||||
omit_drivers_corrected+="$d|"
|
||||
done
|
||||
omit_drivers="${omit_drivers_corrected%|}"
|
||||
@@ -907,6 +994,7 @@ for ((i=0; i < ${#dracut_args[@]}; i++)); do
|
||||
dracut_args[$i]="\"${dracut_args[$i]}\""
|
||||
#" keep vim happy
|
||||
done
|
||||
|
||||
dinfo "Executing: $0 ${dracut_args[@]}"
|
||||
|
||||
[[ $do_list = yes ]] && {
|
||||
@@ -951,6 +1039,78 @@ if [[ ! $print_cmdline ]]; then
|
||||
dfatal "No permission to write $outfile."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $loginstall ]]; then
|
||||
if ! mkdir -p "$loginstall"; then
|
||||
dfatal "Could not create directory to log installed files to '$loginstall'."
|
||||
exit 1
|
||||
fi
|
||||
loginstall=$(readlink -f "$loginstall")
|
||||
fi
|
||||
|
||||
if [[ $uefi = yes ]]; then
|
||||
if ! command -v objcopy &>/dev/null; then
|
||||
dfatal "Need 'objcopy' to create a UEFI executable"
|
||||
exit 1
|
||||
fi
|
||||
unset EFI_MACHINE_TYPE_NAME
|
||||
case $(arch) in
|
||||
x86_64)
|
||||
EFI_MACHINE_TYPE_NAME=x64;;
|
||||
ia32)
|
||||
EFI_MACHINE_TYPE_NAME=ia32;;
|
||||
*)
|
||||
dfatal "Architecture '$(arch)' not supported to create a UEFI executable"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
if ! [[ -s $uefi_stub ]]; then
|
||||
for uefi_stub in \
|
||||
"/lib/systemd/boot/efi/linux${EFI_MACHINE_TYPE_NAME}.efi.stub" \
|
||||
"/usr/lib/gummiboot/linux${EFI_MACHINE_TYPE_NAME}.efi.stub"; do
|
||||
[[ -s $uefi_stub ]] || continue
|
||||
break
|
||||
done
|
||||
fi
|
||||
if ! [[ -s $uefi_stub ]]; then
|
||||
dfatal "Can't find a uefi stub '$uefi_stub' to create a UEFI executable"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [[ $kernel_image ]]; then
|
||||
for kernel_image in "/lib/modules/$kernel/vmlinuz" "/boot/vmlinuz-$kernel"; do
|
||||
[[ -s "$kernel_image" ]] || continue
|
||||
break
|
||||
done
|
||||
fi
|
||||
if ! [[ -s $kernel_image ]]; then
|
||||
dfatal "Can't find a kernel image '$kernel_image' to create a UEFI executable"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $acpi_override = yes ]] && ! check_kernel_config CONFIG_ACPI_INITRD_TABLE_OVERRIDE; then
|
||||
dwarn "Disabling ACPI override, because kernel does not support it. CONFIG_ACPI_INITRD_TABLE_OVERRIDE!=y"
|
||||
unset acpi_override
|
||||
fi
|
||||
|
||||
if [[ $early_microcode = yes ]]; then
|
||||
if [[ $hostonly ]]; then
|
||||
[[ $(get_cpu_vendor) == "AMD" ]] \
|
||||
&& ! check_kernel_config CONFIG_MICROCODE_AMD_EARLY \
|
||||
&& unset early_microcode
|
||||
[[ $(get_cpu_vendor) == "Intel" ]] \
|
||||
&& ! check_kernel_config CONFIG_MICROCODE_INTEL_EARLY \
|
||||
&& unset early_microcode
|
||||
else
|
||||
! check_kernel_config CONFIG_MICROCODE_AMD_EARLY \
|
||||
&& ! check_kernel_config CONFIG_MICROCODE_INTEL_EARLY \
|
||||
&& unset early_microcode
|
||||
fi
|
||||
[[ $early_microcode != yes ]] \
|
||||
&& dwarn "Disabling early microcode, because kernel does not support it. CONFIG_MICROCODE_[AMD|INTEL]_EARLY!=y"
|
||||
fi
|
||||
|
||||
# Need to be able to have non-root users read stuff (rpcbind etc)
|
||||
@@ -969,26 +1129,42 @@ declare -A host_fs_types
|
||||
|
||||
for line in "${fstab_lines[@]}"; do
|
||||
set -- $line
|
||||
dev="$1"
|
||||
#dev mp fs fsopts
|
||||
push host_devs "$1"
|
||||
host_fs_types["$1"]="$3"
|
||||
case "$dev" in
|
||||
UUID=*)
|
||||
dev=$(blkid -l -t UUID=${dev#UUID=} -o device)
|
||||
;;
|
||||
LABEL=*)
|
||||
dev=$(blkid -l -t LABEL=${dev#LABEL=} -o device)
|
||||
;;
|
||||
PARTUUID=*)
|
||||
dev=$(blkid -l -t PARTUUID=${dev#PARTUUID=} -o device)
|
||||
;;
|
||||
PARTLABEL=*)
|
||||
dev=$(blkid -l -t PARTLABEL=${dev#PARTLABEL=} -o device)
|
||||
;;
|
||||
esac
|
||||
[ -z "$dev" ] && dwarn "Bad fstab entry $@" && continue
|
||||
push_host_devs "$dev"
|
||||
host_fs_types["$dev"]="$3"
|
||||
done
|
||||
|
||||
for f in $add_fstab; do
|
||||
[[ -e $f ]] || continue
|
||||
while read dev rest; do
|
||||
push host_devs "$dev"
|
||||
while read dev rest || [ -n "$dev" ]; do
|
||||
push_host_devs "$dev"
|
||||
done < "$f"
|
||||
done
|
||||
|
||||
for dev in $add_device; do
|
||||
push host_devs "$dev"
|
||||
push_host_devs "$dev"
|
||||
done
|
||||
|
||||
if (( ${#add_device_l[@]} )); then
|
||||
while pop add_device_l val; do
|
||||
add_device+=" $val "
|
||||
push host_devs "$val"
|
||||
push_host_devs "$val"
|
||||
done
|
||||
fi
|
||||
|
||||
@@ -1017,17 +1193,17 @@ if [[ $hostonly ]]; then
|
||||
_dev=$(find_block_device "$mp")
|
||||
_bdev=$(readlink -f "/dev/block/$_dev")
|
||||
[[ -b $_bdev ]] && _dev=$_bdev
|
||||
push host_devs $_dev
|
||||
push_host_devs $_dev
|
||||
[[ "$mp" == "/" ]] && root_dev="$_dev"
|
||||
push host_devs "$_dev"
|
||||
push_host_devs "$_dev"
|
||||
done
|
||||
|
||||
if [[ -f /proc/swaps ]] && [[ -f /etc/fstab ]]; then
|
||||
while read dev type rest; do
|
||||
while read dev type rest || [ -n "$dev" ]; do
|
||||
[[ -b $dev ]] || continue
|
||||
[[ "$type" == "partition" ]] || continue
|
||||
|
||||
while read _d _m _t _o _r; do
|
||||
while read _d _m _t _o _r || [ -n "$_d" ]; do
|
||||
[[ "$_d" == \#* ]] && continue
|
||||
[[ $_d ]] || continue
|
||||
[[ $_t != "swap" ]] && continue
|
||||
@@ -1037,7 +1213,7 @@ if [[ $hostonly ]]; then
|
||||
[[ "$_d" -ef "$dev" ]] || continue
|
||||
|
||||
if [[ -f /etc/crypttab ]]; then
|
||||
while read _mapper _a _p _o; do
|
||||
while read _mapper _a _p _o || [ -n "$_mapper" ]; do
|
||||
[[ $_mapper = \#* ]] && continue
|
||||
[[ "$_d" -ef /dev/mapper/"$_mapper" ]] || continue
|
||||
[[ "$_o" ]] || _o="$_p"
|
||||
@@ -1048,7 +1224,9 @@ if [[ $hostonly ]]; then
|
||||
done < /etc/crypttab
|
||||
fi
|
||||
|
||||
push host_devs "$(readlink -f "$dev")"
|
||||
_dev="$(readlink -f "$dev")"
|
||||
push_host_devs "$_dev"
|
||||
push swap_devs "$_dev"
|
||||
break
|
||||
done < /etc/fstab
|
||||
done < /proc/swaps
|
||||
@@ -1056,8 +1234,8 @@ if [[ $hostonly ]]; then
|
||||
# record all host modaliases
|
||||
declare -A host_modalias
|
||||
find /sys/devices/ -name uevent -print > "$initdir/.modalias"
|
||||
while read m; do
|
||||
while read line; do
|
||||
while read m || [ -n "$m" ]; do
|
||||
while read line || [ -n "$line" ]; do
|
||||
[[ "$line" != MODALIAS\=* ]] && continue
|
||||
modalias="${line##MODALIAS=}" && [[ $modalias ]] && host_modalias["$modalias"]=1
|
||||
break
|
||||
@@ -1066,14 +1244,14 @@ if [[ $hostonly ]]; then
|
||||
|
||||
rm -f -- "$initdir/.modalias"
|
||||
|
||||
while read _k _s _v; do
|
||||
while read _k _s _v || [ -n "$_k" ]; do
|
||||
[ "$_k" != "name" -a "$_k" != "driver" ] && continue
|
||||
host_modalias["$_v"]=1
|
||||
done </proc/crypto
|
||||
|
||||
# check /proc/modules
|
||||
declare -A host_modules
|
||||
while read m rest; do
|
||||
while read m rest || [ -n "$m" ]; do
|
||||
host_modules["$m"]=1
|
||||
done </proc/modules
|
||||
fi
|
||||
@@ -1113,7 +1291,7 @@ for dev in "${!host_fs_types[@]}"; do
|
||||
fi
|
||||
if [[ $journaldev ]]; then
|
||||
dev="$(readlink -f "$dev")"
|
||||
push host_devs "$dev"
|
||||
push_host_devs "$dev"
|
||||
_get_fs_type "$dev"
|
||||
check_block_and_slaves_all _get_fs_type "$(get_maj_min "$dev")"
|
||||
fi
|
||||
@@ -1144,15 +1322,26 @@ fi
|
||||
|
||||
[[ -d "$systemdsystemconfdir" ]] || systemdsystemconfdir=/etc/systemd/system
|
||||
|
||||
export initdir dracutbasedir dracutmodules \
|
||||
[[ -d $tmpfilesdir ]] \
|
||||
|| tmpfilesdir=$(pkg-config systemd --variable=tmpfilesdir 2>/dev/null)
|
||||
|
||||
if ! [[ -d "$tmpfilesdir" ]]; then
|
||||
[[ -f /lib/tmpfiles.d ]] && tmpfilesdir=/lib/tmpfiles.d
|
||||
[[ -f /usr/lib/tmpfiles.d ]] && tmpfilesdir=/usr/lib/tmpfiles.d
|
||||
fi
|
||||
|
||||
export initdir dracutbasedir \
|
||||
dracutmodules force_add_dracutmodules add_dracutmodules omit_dracutmodules \
|
||||
mods_to_load \
|
||||
fw_dir drivers_dir debug no_kernel kernel_only \
|
||||
omit_drivers mdadmconf lvmconf root_dev \
|
||||
use_fstab fstab_lines libdirs fscks nofscks ro_mnt \
|
||||
stdloglvl sysloglvl fileloglvl kmsgloglvl logfile \
|
||||
debug host_fs_types host_devs sshkey add_fstab \
|
||||
debug host_fs_types host_devs swap_devs sshkey add_fstab \
|
||||
DRACUT_VERSION udevdir prefix filesystems drivers \
|
||||
systemdutildir systemdsystemunitdir systemdsystemconfdir \
|
||||
host_modalias host_modules hostonly_cmdline
|
||||
host_modalias host_modules hostonly_cmdline loginstall \
|
||||
tmpfilesdir
|
||||
|
||||
mods_to_load=""
|
||||
# check all our modules to see if they should be sourced.
|
||||
@@ -1162,14 +1351,24 @@ for_each_module_dir check_mount
|
||||
|
||||
dracut_module_included "fips" && export DRACUT_FIPS_MODE=1
|
||||
|
||||
if [[ $print_cmdline ]]; then
|
||||
modules_loaded=" "
|
||||
do_print_cmdline()
|
||||
{
|
||||
local -A _mods_to_print
|
||||
for i in $modules_loaded $mods_to_load; do
|
||||
_mods_to_print[$i]=1
|
||||
done
|
||||
|
||||
# source our modules.
|
||||
for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
|
||||
_d_mod=${moddir##*/}; _d_mod=${_d_mod#[0-9][0-9]}
|
||||
[[ ${_mods_to_print[$_d_mod]} ]] || continue
|
||||
module_cmdline "$_d_mod"
|
||||
done
|
||||
unset moddir
|
||||
}
|
||||
|
||||
if [[ $print_cmdline ]]; then
|
||||
do_print_cmdline
|
||||
printf "\n"
|
||||
exit 0
|
||||
fi
|
||||
@@ -1188,7 +1387,7 @@ if [[ $prefix ]]; then
|
||||
fi
|
||||
|
||||
if [[ $kernel_only != yes ]]; then
|
||||
for d in usr/bin usr/sbin bin etc lib sbin tmp usr var $libdirs; do
|
||||
for d in usr/bin usr/sbin bin etc lib sbin tmp usr var var/tmp $libdirs; do
|
||||
[[ -e "${initdir}${prefix}/$d" ]] && continue
|
||||
if [ -L "/$d" ]; then
|
||||
inst_symlink "/$d" "${prefix}/$d"
|
||||
@@ -1207,7 +1406,6 @@ if [[ $kernel_only != yes ]]; then
|
||||
|
||||
ln -sfn ../run "$initdir/var/run"
|
||||
ln -sfn ../run/lock "$initdir/var/lock"
|
||||
ln -sfn ../run/log "$initdir/var/log"
|
||||
else
|
||||
for d in lib "$libdir"; do
|
||||
[[ -e "${initdir}${prefix}/$d" ]] && continue
|
||||
@@ -1236,36 +1434,35 @@ modules_loaded=" "
|
||||
# source our modules.
|
||||
for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
|
||||
_d_mod=${moddir##*/}; _d_mod=${_d_mod#[0-9][0-9]}
|
||||
if [[ "$mods_to_load" == *\ $_d_mod\ * ]]; then
|
||||
if [[ $show_modules = yes ]]; then
|
||||
printf "%s\n" "$_d_mod"
|
||||
else
|
||||
dinfo "*** Including module: $_d_mod ***"
|
||||
fi
|
||||
if [[ $kernel_only == yes ]]; then
|
||||
[[ "$mods_to_load" == *\ $_d_mod\ * ]] || continue
|
||||
if [[ $show_modules = yes ]]; then
|
||||
printf "%s\n" "$_d_mod"
|
||||
else
|
||||
dinfo "*** Including module: $_d_mod ***"
|
||||
fi
|
||||
if [[ $kernel_only == yes ]]; then
|
||||
module_installkernel "$_d_mod" || {
|
||||
dfatal "installkernel failed in module $_d_mod"
|
||||
exit 1
|
||||
}
|
||||
else
|
||||
module_install "$_d_mod"
|
||||
if [[ $no_kernel != yes ]]; then
|
||||
module_installkernel "$_d_mod" || {
|
||||
dfatal "installkernel failed in module $_d_mod"
|
||||
exit 1
|
||||
}
|
||||
else
|
||||
module_install "$_d_mod"
|
||||
if [[ $no_kernel != yes ]]; then
|
||||
module_installkernel "$_d_mod" || {
|
||||
dfatal "installkernel failed in module $_d_mod"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
fi
|
||||
mods_to_load=${mods_to_load// $_d_mod /}
|
||||
modules_loaded+="$_d_mod "
|
||||
fi
|
||||
mods_to_load=${mods_to_load// $_d_mod /}
|
||||
modules_loaded+="$_d_mod "
|
||||
|
||||
#print the module install size
|
||||
if [ -n "$printsize" ]; then
|
||||
_isize_new=$(du -sk ${initdir}|cut -f1)
|
||||
_isize_delta=$((_isize_new - _isize))
|
||||
printf "%s\n" "$_d_mod install size: ${_isize_delta}k"
|
||||
_isize=$_isize_new
|
||||
fi
|
||||
#print the module install size
|
||||
if [ -n "$printsize" ]; then
|
||||
_isize_new=$(du -sk ${initdir}|cut -f1)
|
||||
_isize_delta=$((_isize_new - _isize))
|
||||
printf "%s\n" "$_d_mod install size: ${_isize_delta}k"
|
||||
_isize=$_isize_new
|
||||
fi
|
||||
done
|
||||
unset moddir
|
||||
@@ -1287,6 +1484,13 @@ if [[ $no_kernel != yes ]]; then
|
||||
if [[ $add_drivers ]]; then
|
||||
hostonly='' instmods -c $add_drivers
|
||||
fi
|
||||
if [[ $force_drivers ]]; then
|
||||
hostonly='' instmods -c $force_drivers
|
||||
rm -f $initdir/etc/cmdline.d/20-force_driver.conf
|
||||
for mod in $force_drivers; do
|
||||
echo "rd.driver.pre=$mod" >>$initdir/etc/cmdline.d/20-force_drivers.conf
|
||||
done
|
||||
fi
|
||||
if [[ $filesystems ]]; then
|
||||
hostonly='' instmods -c $filesystems
|
||||
fi
|
||||
@@ -1308,6 +1512,7 @@ fi
|
||||
|
||||
if [[ $kernel_only != yes ]]; then
|
||||
(( ${#install_items[@]} > 0 )) && inst_multiple ${install_items[@]}
|
||||
(( ${#install_optional_items[@]} > 0 )) && inst_multiple -o ${install_optional_items[@]}
|
||||
|
||||
[[ $kernel_cmdline ]] && printf "%s\n" "$kernel_cmdline" >> "${initdir}/etc/cmdline.d/01-default.conf"
|
||||
|
||||
@@ -1316,6 +1521,7 @@ if [[ $kernel_only != yes ]]; then
|
||||
[ -z "${line[3]}" ] && line[3]="defaults"
|
||||
[ -z "${line[4]}" ] && line[4]="0"
|
||||
[ -z "${line[5]}" ] && line[5]="2"
|
||||
strstr "${line[2]}" "nfs" && line[5]="0"
|
||||
echo "${line[@]}" >> "${initdir}/etc/fstab"
|
||||
done
|
||||
|
||||
@@ -1334,34 +1540,44 @@ if [[ $kernel_only != yes ]]; then
|
||||
|
||||
if [[ $DRACUT_RESOLVE_LAZY ]] && [[ $DRACUT_INSTALL ]]; then
|
||||
dinfo "*** Resolving executable dependencies ***"
|
||||
find "$initdir" -type f \
|
||||
'(' -perm -0100 -or -perm -0010 -or -perm -0001 ')' \
|
||||
-not -path '*.ko' -print0 \
|
||||
find "$initdir" -type f -perm /0111 -not -path '*.ko' -print0 \
|
||||
| xargs -r -0 $DRACUT_INSTALL ${initdir:+-D "$initdir"} -R ${DRACUT_FIPS_MODE:+-H} --
|
||||
dinfo "*** Resolving executable dependencies done***"
|
||||
fi
|
||||
|
||||
# libpthread workaround: pthread_cancel wants to dlopen libgcc_s.so
|
||||
for _dir in $libdirs; do
|
||||
for _f in "$_dir/libpthread.so"*; do
|
||||
[[ -e "$_f" ]] || continue
|
||||
inst_libdir_file "libgcc_s.so*"
|
||||
break 2
|
||||
done
|
||||
done
|
||||
fi
|
||||
|
||||
while pop include_src src && pop include_target tgt; do
|
||||
if [[ $src && $tgt ]]; then
|
||||
while pop include_src src && pop include_target target; do
|
||||
if [[ $src && $target ]]; then
|
||||
if [[ -f $src ]]; then
|
||||
inst $src $tgt
|
||||
inst $src $target
|
||||
else
|
||||
ddebug "Including directory: $src"
|
||||
mkdir -p "${initdir}/${tgt}"
|
||||
destdir="${initdir}/${target}"
|
||||
mkdir -p "$destdir"
|
||||
# check for preexisting symlinks, so we can cope with the
|
||||
# symlinks to $prefix
|
||||
for i in "$src"/*; do
|
||||
[[ -e "$i" || -h "$i" ]] || continue
|
||||
s=${initdir}/${tgt}/${i#$src/}
|
||||
if [[ -d "$i" ]]; then
|
||||
if ! [[ -e "$s" ]]; then
|
||||
mkdir -m 0755 -p "$s"
|
||||
chmod --reference="$i" "$s"
|
||||
# Objectname is a file or a directory
|
||||
for objectname in "$src"/*; do
|
||||
[[ -e "$objectname" || -h "$objectname" ]] || continue
|
||||
if [[ -d "$objectname" ]]; then
|
||||
# objectname is a directory, let's compute the final directory name
|
||||
object_destdir=${destdir}/${objectname#$src/}
|
||||
if ! [[ -e "$object_destdir" ]]; then
|
||||
mkdir -m 0755 -p "$object_destdir"
|
||||
chmod --reference="$objectname" "$object_destdir"
|
||||
fi
|
||||
cp --reflink=auto --sparse=auto -fa -t "$s" "$i"/*
|
||||
cp --reflink=auto --sparse=auto -fa -t "$object_destdir" "$objectname"/*
|
||||
else
|
||||
cp --reflink=auto --sparse=auto -fa -t "$s" "$i"
|
||||
cp --reflink=auto --sparse=auto -fa -t "$destdir" "$objectname"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
@@ -1382,20 +1598,18 @@ if [[ $kernel_only != yes ]]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $do_prelink == yes ]]; then
|
||||
PRELINK_BIN="$(command -v prelink)"
|
||||
if [[ $UID = 0 ]] && [[ $PRELINK_BIN ]]; then
|
||||
if [[ $DRACUT_FIPS_MODE ]]; then
|
||||
dinfo "*** Installing prelink files ***"
|
||||
inst_multiple -o prelink /etc/prelink.conf /etc/prelink.conf.d/*.conf /etc/prelink.cache
|
||||
else
|
||||
dinfo "*** Pre-linking files ***"
|
||||
inst_multiple -o prelink /etc/prelink.conf /etc/prelink.conf.d/*.conf
|
||||
chroot "$initdir" "$PRELINK_BIN" -a
|
||||
rm -f -- "$initdir/$PRELINK_BIN"
|
||||
rm -fr -- "$initdir"/etc/prelink.*
|
||||
dinfo "*** Pre-linking files done ***"
|
||||
fi
|
||||
PRELINK_BIN="$(command -v prelink)"
|
||||
if [[ $UID = 0 ]] && [[ $PRELINK_BIN ]]; then
|
||||
if [[ $DRACUT_FIPS_MODE ]]; then
|
||||
dinfo "*** Installing prelink files ***"
|
||||
inst_multiple -o prelink /etc/prelink.conf /etc/prelink.conf.d/*.conf /etc/prelink.cache
|
||||
elif [[ $do_prelink == yes ]]; then
|
||||
dinfo "*** Pre-linking files ***"
|
||||
inst_multiple -o prelink /etc/prelink.conf /etc/prelink.conf.d/*.conf
|
||||
chroot "$initdir" "$PRELINK_BIN" -a
|
||||
rm -f -- "$initdir/$PRELINK_BIN"
|
||||
rm -fr -- "$initdir"/etc/prelink.*
|
||||
dinfo "*** Pre-linking files done ***"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -1423,7 +1637,7 @@ if [[ $do_strip = yes ]] && ! [[ $DRACUT_FIPS_MODE ]]; then
|
||||
|
||||
# strip kernel modules, but do not touch signed modules
|
||||
find "$initdir" -type f -path '*/lib/modules/*.ko' -print0 \
|
||||
| while read -r -d $'\0' f; do
|
||||
| while read -r -d $'\0' f || [ -n "$f" ]; do
|
||||
SIG=$(tail -c 28 "$f")
|
||||
[[ $SIG == '~Module signature appended~' ]] || { printf "%s\000" "$f"; }
|
||||
done | xargs -r -0 strip -g
|
||||
@@ -1466,7 +1680,7 @@ if [[ $acpi_override = yes ]] && [[ -d $acpi_table_dir ]]; then
|
||||
mkdir -p $_dest_dir
|
||||
for table in $acpi_table_dir/*.aml; do
|
||||
dinfo " Adding ACPI table: $table"
|
||||
cp $table $_dest_dir
|
||||
cp -a $table $_dest_dir
|
||||
create_early_cpio="yes"
|
||||
done
|
||||
fi
|
||||
@@ -1477,22 +1691,65 @@ if ! ( echo $PARMS_TO_STORE > $initdir/lib/dracut/build-parameter.txt ); then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $hostonly_cmdline ]] ; then
|
||||
unset _stored_cmdline
|
||||
if [ -d $initdir/etc/cmdline.d ];then
|
||||
dinfo "Stored kernel commandline:"
|
||||
for conf in $initdir/etc/cmdline.d/*.conf ; do
|
||||
[ -e "$conf" ] || continue
|
||||
dinfo "$(< $conf)"
|
||||
_stored_cmdline=1
|
||||
done
|
||||
fi
|
||||
if ! [[ $_stored_cmdline ]]; then
|
||||
dinfo "No dracut internal kernel commandline stored in initrd"
|
||||
fi
|
||||
fi
|
||||
rm -f -- "$outfile"
|
||||
dinfo "*** Creating image file ***"
|
||||
dinfo "*** Creating image file '$outfile' ***"
|
||||
|
||||
if [[ $uefi = yes ]]; then
|
||||
uefi_outfile="$outfile"
|
||||
readonly uefi_outdir="$(mktemp --tmpdir="$TMPDIR/" -d -t initrd.XXXXXX)"
|
||||
# redirect initrd output
|
||||
outfile="$uefi_outdir/initrd"
|
||||
fi
|
||||
|
||||
if [[ $DRACUT_REPRODUCIBLE ]]; then
|
||||
find "$initdir" -newer "$dracutbasedir/dracut-functions.sh" -print0 \
|
||||
| xargs -r -0 touch -h -m -c -r "$dracutbasedir/dracut-functions.sh"
|
||||
|
||||
[[ "$(cpio --help)" == *--reproducible* ]] && CPIO_REPRODUCIBLE=1
|
||||
fi
|
||||
|
||||
[[ "$UID" != 0 ]] && cpio_owner_root="-R 0:0"
|
||||
|
||||
if [[ $create_early_cpio = yes ]]; then
|
||||
echo 1 > "$early_cpio_dir/d/early_cpio"
|
||||
|
||||
if [[ $DRACUT_REPRODUCIBLE ]]; then
|
||||
find "$early_cpio_dir/d" -newer "$dracutbasedir/dracut-functions.sh" -print0 \
|
||||
| xargs -r -0 touch -h -m -c -r "$dracutbasedir/dracut-functions.sh"
|
||||
fi
|
||||
|
||||
# The microcode blob is _before_ the initramfs blob, not after
|
||||
(cd "$early_cpio_dir/d"; find . -print0 | cpio --null $cpio_owner_root -H newc -o --quiet > $outfile)
|
||||
(
|
||||
cd "$early_cpio_dir/d"
|
||||
find . -print0 | sort -z \
|
||||
| cpio ${CPIO_REPRODUCIBLE:+--reproducible} --null $cpio_owner_root -H newc -o --quiet > $outfile
|
||||
)
|
||||
fi
|
||||
if ! ( umask 077; cd "$initdir"; find . -print0 | cpio --null $cpio_owner_root -H newc -o --quiet | \
|
||||
$compress >> "$outfile"; ); then
|
||||
|
||||
if ! (
|
||||
umask 077; cd "$initdir"
|
||||
find . -print0 | sort -z \
|
||||
| cpio ${CPIO_REPRODUCIBLE:+--reproducible} --null $cpio_owner_root -H newc -o --quiet \
|
||||
| $compress >> "$outfile"
|
||||
); then
|
||||
dfatal "dracut: creation of $outfile failed"
|
||||
exit 1
|
||||
fi
|
||||
dinfo "*** Creating image file done ***"
|
||||
dinfo "*** Creating initrd image file '$outfile' done ***"
|
||||
|
||||
if (( maxloglvl >= 5 )); then
|
||||
if [[ $allowlocal ]]; then
|
||||
@@ -1502,4 +1759,32 @@ if (( maxloglvl >= 5 )); then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $uefi = yes ]]; then
|
||||
if [[ $kernel_cmdline ]]; then
|
||||
echo -n "$kernel_cmdline" > "$uefi_outdir/cmdline.txt"
|
||||
elif [[ $hostonly_cmdline = yes ]] && [ -d $initdir/etc/cmdline.d ];then
|
||||
for conf in $initdir/etc/cmdline.d/*.conf ; do
|
||||
[ -e "$conf" ] || continue
|
||||
printf "%s " "$(< $conf)" >> "$uefi_outdir/cmdline.txt"
|
||||
done
|
||||
else
|
||||
do_print_cmdline > "$uefi_outdir/cmdline.txt"
|
||||
fi
|
||||
echo -ne "\x00" >> "$uefi_outdir/cmdline.txt"
|
||||
|
||||
dinfo "Using UEFI kernel cmdline:"
|
||||
dinfo $(< "$uefi_outdir/cmdline.txt")
|
||||
|
||||
[[ -s /usr/lib/os-release ]] && uefi_osrelease="/usr/lib/os-release"
|
||||
[[ -s /etc/os-release ]] && uefi_osrelease="/etc/os-release"
|
||||
|
||||
objcopy \
|
||||
${uefi_osrelease:+--add-section .osrel=$uefi_osrelease --change-section-vma .osrel=0x20000} \
|
||||
--add-section .cmdline="$uefi_outdir/cmdline.txt" --change-section-vma .cmdline=0x30000 \
|
||||
--add-section .linux="$kernel_image" --change-section-vma .linux=0x40000 \
|
||||
--add-section .initrd="$outfile" --change-section-vma .initrd=0x3000000 \
|
||||
"$uefi_stub" "$uefi_outfile"
|
||||
dinfo "*** Creating UEFI image file '$uefi_outfile' done ***"
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
40
dracut.spec
40
dracut.spec
@@ -30,6 +30,8 @@ URL: https://dracut.wiki.kernel.org/
|
||||
# Source can be generated by
|
||||
# http://git.kernel.org/?p=boot/dracut/dracut.git;a=snapshot;h=%{version};sf=tgz
|
||||
Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar.xz
|
||||
Source1: https://www.gnu.org/licenses/lgpl-2.1.txt
|
||||
|
||||
|
||||
BuildRequires: bash git
|
||||
|
||||
@@ -193,18 +195,8 @@ Requires: %{name} = %{version}-%{release}
|
||||
This package contains tools to assemble the local initrd and host configuration.
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}-%{version}
|
||||
|
||||
%if %{defined PATCH1}
|
||||
git init
|
||||
git config user.email "dracut-maint@redhat.com"
|
||||
git config user.name "Fedora dracut team"
|
||||
git add .
|
||||
git commit -a -q -m "%{version} baseline."
|
||||
|
||||
# Apply all the patches.
|
||||
git am -p1 %{patches}
|
||||
%endif
|
||||
%autosetup -n %{name}-%{version} -S git_am
|
||||
cp %{SOURCE1} .
|
||||
|
||||
%build
|
||||
%configure --systemdsystemunitdir=%{_unitdir} --bashcompletiondir=$(pkg-config --variable=completionsdir bash-completion) --libdir=%{_prefix}/lib \
|
||||
@@ -283,21 +275,17 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
|
||||
> $RPM_BUILD_ROOT/etc/system-fips
|
||||
%endif
|
||||
|
||||
# create compat symlink
|
||||
mkdir -p $RPM_BUILD_ROOT%{_sbindir}
|
||||
ln -sr $RPM_BUILD_ROOT%{_bindir}/dracut $RPM_BUILD_ROOT%{_sbindir}/dracut
|
||||
|
||||
%clean
|
||||
rm -rf -- $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,0755)
|
||||
%if %{with doc}
|
||||
%doc README HACKING TODO COPYING AUTHORS NEWS dracut.html dracut.png dracut.svg
|
||||
%doc README HACKING TODO AUTHORS NEWS dracut.html dracut.png dracut.svg
|
||||
%endif
|
||||
%{!?_licensedir:%global license %%doc}
|
||||
%license COPYING lgpl-2.1.txt
|
||||
%{_bindir}/dracut
|
||||
# compat symlink
|
||||
%{_sbindir}/dracut
|
||||
%{_datadir}/bash-completion/completions/dracut
|
||||
%{_datadir}/bash-completion/completions/lsinitrd
|
||||
%if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999
|
||||
@@ -319,6 +307,7 @@ rm -rf -- $RPM_BUILD_ROOT
|
||||
%endif
|
||||
%dir %{_sysconfdir}/dracut.conf.d
|
||||
%dir %{dracutlibdir}/dracut.conf.d
|
||||
%{_datadir}/pkgconfig/dracut.pc
|
||||
|
||||
%if %{with doc}
|
||||
%{_mandir}/man8/dracut.8*
|
||||
@@ -340,6 +329,8 @@ rm -rf -- $RPM_BUILD_ROOT
|
||||
%{dracutlibdir}/modules.d/00bootchart
|
||||
%endif
|
||||
%{dracutlibdir}/modules.d/00bash
|
||||
%{dracutlibdir}/modules.d/00systemd
|
||||
%{dracutlibdir}/modules.d/01systemd-initrd
|
||||
%{dracutlibdir}/modules.d/03modsign
|
||||
%{dracutlibdir}/modules.d/03rescue
|
||||
%{dracutlibdir}/modules.d/04watchdog
|
||||
@@ -384,7 +375,7 @@ rm -rf -- $RPM_BUILD_ROOT
|
||||
%{dracutlibdir}/modules.d/98pollcdrom
|
||||
%{dracutlibdir}/modules.d/98selinux
|
||||
%{dracutlibdir}/modules.d/98syslog
|
||||
%{dracutlibdir}/modules.d/98systemd
|
||||
%{dracutlibdir}/modules.d/98dracut-systemd
|
||||
%{dracutlibdir}/modules.d/98usrmount
|
||||
%{dracutlibdir}/modules.d/99base
|
||||
%{dracutlibdir}/modules.d/99fs-lib
|
||||
@@ -394,7 +385,7 @@ rm -rf -- $RPM_BUILD_ROOT
|
||||
%dir %{_sharedstatedir}/initramfs
|
||||
%if %{defined _unitdir}
|
||||
%{_unitdir}/dracut-shutdown.service
|
||||
%{_unitdir}/shutdown.target.wants/dracut-shutdown.service
|
||||
%{_unitdir}/sysinit.target.wants/dracut-shutdown.service
|
||||
%{_unitdir}/dracut-cmdline.service
|
||||
%{_unitdir}/dracut-initqueue.service
|
||||
%{_unitdir}/dracut-mount.service
|
||||
@@ -417,7 +408,9 @@ rm -rf -- $RPM_BUILD_ROOT
|
||||
|
||||
%files network
|
||||
%defattr(-,root,root,0755)
|
||||
%{dracutlibdir}/modules.d/02systemd-networkd
|
||||
%{dracutlibdir}/modules.d/40network
|
||||
%{dracutlibdir}/modules.d/90kernel-network-modules
|
||||
%{dracutlibdir}/modules.d/95fcoe
|
||||
%{dracutlibdir}/modules.d/95iscsi
|
||||
%{dracutlibdir}/modules.d/90livenet
|
||||
@@ -441,11 +434,6 @@ rm -rf -- $RPM_BUILD_ROOT
|
||||
|
||||
%files fips-aesni
|
||||
%defattr(-,root,root,0755)
|
||||
|
||||
%if %{with doc}
|
||||
%doc COPYING
|
||||
%endif
|
||||
|
||||
%{dracutlibdir}/modules.d/02fips-aesni
|
||||
|
||||
%files caps
|
||||
|
@@ -209,7 +209,7 @@ be specified once.
|
||||
----
|
||||
# mkdir -p rd.live.overlay/etc/cmdline.d
|
||||
# mkdir -p rd.live.overlay/etc/conf.d
|
||||
# echo "ip=auto" >> rd.live.overlay/etc/cmdline.d/mycmdline.conf
|
||||
# echo "ip=dhcp" >> rd.live.overlay/etc/cmdline.d/mycmdline.conf
|
||||
# echo export FOO=testtest >> rd.live.overlay/etc/conf.d/testvar.conf
|
||||
# echo export BAR=testtest >> rd.live.overlay/etc/conf.d/testvar.conf
|
||||
# tree rd.live.overlay/
|
||||
@@ -246,22 +246,7 @@ specified multiple times.
|
||||
If your root partition is on a network drive, you have to have the network
|
||||
dracut modules installed to create a network aware initramfs image.
|
||||
|
||||
On a Red Hat Enterprise Linux or Fedora system, this means, you have to install
|
||||
the _dracut-network_ rpm package:
|
||||
|
||||
|
||||
----
|
||||
# yum install dracut-network
|
||||
----
|
||||
|
||||
The resulting initramfs image can be served by a boot manager residing on your
|
||||
local hard drive or it can be served by a PXE/TFTP server.
|
||||
|
||||
How to setup your PXE/TFTP server can be found in the
|
||||
http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/[Red
|
||||
Hat Enterprise Linux Storage Administration Guide].
|
||||
|
||||
If you specify ip=auto on the kernel command line, then dracut asks a dhcp
|
||||
If you specify ip=dhcp on the kernel command line, then dracut asks a dhcp
|
||||
server about the ip adress for the machine. The dhcp server can also serve an
|
||||
additional root-path, which will set the root device for dracut. With this
|
||||
mechanism, you have static configuration on your client machine and a
|
||||
@@ -300,7 +285,7 @@ This will reduce the size of the initramfs image significantly.
|
||||
If the boot process does not succeed, you have several options to debug the
|
||||
situation. Some of the basic operations are covered here. For more information
|
||||
you should also visit:
|
||||
http://fedoraproject.org/wiki/How_to_debug_Dracut_problems
|
||||
https://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html
|
||||
|
||||
|
||||
[[identifying-your-problem-area]]
|
||||
@@ -528,7 +513,7 @@ on _pre-shutdown_ or _shutdown_.
|
||||
To do this from an already booted system:
|
||||
----
|
||||
# mkdir -p /run/initramfs/etc/cmdline.d
|
||||
# echo "rd.break=pre-shutdown" > /run/initramfs/etc/cmdline.d/debug.conf
|
||||
# echo "rd.debug rd.break=pre-shutdown rd.break=shutdown" > /run/initramfs/etc/cmdline.d/debug.conf
|
||||
# touch /run/initramfs/.need_shutdown
|
||||
----
|
||||
|
||||
|
1
install/.kateconfig
Normal file
1
install/.kateconfig
Normal file
@@ -0,0 +1 @@
|
||||
kate: space-indent on; tab-width 8; indent-width 8; replace-tabs on; eol unix;
|
@@ -1,5 +1,3 @@
|
||||
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
|
||||
|
||||
/* dracut-install.c -- install files and executables
|
||||
|
||||
Copyright (C) 2012 Harald Hoyer
|
||||
@@ -53,8 +51,11 @@ static bool arg_optional = false;
|
||||
static bool arg_all = false;
|
||||
static bool arg_resolvelazy = false;
|
||||
static bool arg_resolvedeps = false;
|
||||
static bool arg_hostonly = false;
|
||||
static char *destrootdir = NULL;
|
||||
|
||||
static char *logdir = NULL;
|
||||
static char *logfile = NULL;
|
||||
FILE *logfile_f = NULL;
|
||||
static Hashmap *items = NULL;
|
||||
static Hashmap *items_failed = NULL;
|
||||
|
||||
@@ -221,7 +222,8 @@ static int cp(const char *src, const char *dst)
|
||||
if (ret == 0) {
|
||||
struct timeval tv[2];
|
||||
if (fchown(dest_desc, sb.st_uid, sb.st_gid) != 0)
|
||||
fchown(dest_desc, (__uid_t) - 1, sb.st_gid);
|
||||
if(fchown(dest_desc, (uid_t) - 1, sb.st_gid) != 0)
|
||||
log_error("Failed to chown %s: %m", dst);
|
||||
tv[0].tv_sec = sb.st_atime;
|
||||
tv[0].tv_usec = 0;
|
||||
tv[1].tv_sec = sb.st_mtime;
|
||||
@@ -327,18 +329,25 @@ static int resolve_deps(const char *src)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
_cleanup_free_ char *buf = malloc(LINE_MAX);
|
||||
_cleanup_free_ char *buf = NULL;
|
||||
size_t linesize = LINE_MAX;
|
||||
_cleanup_pclose_ FILE *fptr = NULL;
|
||||
_cleanup_free_ char *cmd = NULL;
|
||||
|
||||
buf = malloc(LINE_MAX);
|
||||
if (buf == NULL)
|
||||
return -errno;
|
||||
|
||||
if (strstr(src, ".so") == 0) {
|
||||
_cleanup_close_ int fd = -1;
|
||||
fd = open(src, O_RDONLY | O_CLOEXEC);
|
||||
if (fd < 0)
|
||||
return -errno;
|
||||
|
||||
read(fd, buf, LINE_MAX);
|
||||
ret = read(fd, buf, LINE_MAX);
|
||||
if (ret == -1)
|
||||
return -errno;
|
||||
|
||||
buf[LINE_MAX - 1] = '\0';
|
||||
if (buf[0] == '#' && buf[1] == '!') {
|
||||
/* we have a shebang */
|
||||
@@ -366,7 +375,7 @@ static int resolve_deps(const char *src)
|
||||
fptr = popen(cmd, "r");
|
||||
|
||||
while (!feof(fptr)) {
|
||||
char *p, *q;
|
||||
char *p;
|
||||
|
||||
if (getline(&buf, &linesize, fptr) <= 0)
|
||||
continue;
|
||||
@@ -379,6 +388,11 @@ static int resolve_deps(const char *src)
|
||||
break;
|
||||
}
|
||||
|
||||
/* musl ldd */
|
||||
if (strstr(buf, "Not a valid dynamic program"))
|
||||
break;
|
||||
|
||||
/* glibc */
|
||||
if (strstr(buf, "not a dynamic executable"))
|
||||
break;
|
||||
|
||||
@@ -400,6 +414,8 @@ static int resolve_deps(const char *src)
|
||||
|
||||
p = strchr(p, '/');
|
||||
if (p) {
|
||||
char *q;
|
||||
|
||||
for (q = p; *q && *q != ' ' && *q != '\n'; q++) ;
|
||||
*q = '\0';
|
||||
|
||||
@@ -467,6 +483,36 @@ static int hmac_install(const char *src, const char *dst, const char *hmacpath)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void mark_hostonly(const char *path)
|
||||
{
|
||||
_cleanup_free_ char *fulldstpath = NULL;
|
||||
_cleanup_fclose_ FILE *f = NULL;
|
||||
int ret;
|
||||
|
||||
ret = asprintf(&fulldstpath, "%s/lib/dracut/hostonly-files", destrootdir);
|
||||
if (ret < 0) {
|
||||
log_error("Out of memory!");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
f = fopen(fulldstpath, "a");
|
||||
|
||||
if (f == NULL) {
|
||||
log_error("Could not open '%s' for writing.", fulldstpath);
|
||||
return;
|
||||
}
|
||||
|
||||
fprintf(f, "%s\n", path);
|
||||
}
|
||||
|
||||
void dracut_log_cp(const char *path)
|
||||
{
|
||||
int ret;
|
||||
ret = fprintf(logfile_f, "%s\n", path);
|
||||
if (ret < 0)
|
||||
log_error("Could not append '%s' to logfile '%s': %m", path, logfile);
|
||||
}
|
||||
|
||||
static int dracut_install(const char *src, const char *dst, bool isdir, bool resolvedeps, bool hashdst)
|
||||
{
|
||||
struct stat sb, db;
|
||||
@@ -628,7 +674,13 @@ static int dracut_install(const char *src, const char *dst, bool isdir, bool res
|
||||
|
||||
log_debug("dracut_install ret = %d", ret);
|
||||
log_info("cp '%s' '%s'", src, fulldstpath);
|
||||
|
||||
if (arg_hostonly)
|
||||
mark_hostonly(dst);
|
||||
|
||||
ret += cp(src, fulldstpath);
|
||||
if (ret == 0 && logfile_f)
|
||||
dracut_log_cp(src);
|
||||
|
||||
log_debug("dracut_install ret = %d", ret);
|
||||
|
||||
@@ -654,6 +706,7 @@ static void usage(int status)
|
||||
" -o --optional If SOURCE does not exist, do not fail\n"
|
||||
" -d --dir SOURCE is a directory\n"
|
||||
" -l --ldd Also install shebang executables and libraries\n"
|
||||
" -L --logdir <DIR> Log files, which were installed from the host to <DIR>\n"
|
||||
" -R --resolvelazy Only install shebang executables and libraries\n"
|
||||
" for all SOURCE files\n"
|
||||
" -H --fips Also install all '.SOURCE.hmac' files\n"
|
||||
@@ -706,13 +759,15 @@ static int parse_argv(int argc, char *argv[])
|
||||
{"ldd", no_argument, NULL, 'l'},
|
||||
{"resolvelazy", no_argument, NULL, 'R'},
|
||||
{"optional", no_argument, NULL, 'o'},
|
||||
{"hostonly", no_argument, NULL, 'H'},
|
||||
{"all", no_argument, NULL, 'a'},
|
||||
{"fips", no_argument, NULL, 'H'},
|
||||
{"fips", no_argument, NULL, 'f'},
|
||||
{"destrootdir", required_argument, NULL, 'D'},
|
||||
{"logdir", required_argument, NULL, 'L'},
|
||||
{NULL, 0, NULL, 0}
|
||||
};
|
||||
|
||||
while ((c = getopt_long(argc, argv, "adhloD:HR", options, NULL)) != -1) {
|
||||
while ((c = getopt_long(argc, argv, "adfhlL:oD:HR", options, NULL)) != -1) {
|
||||
switch (c) {
|
||||
case ARG_VERSION:
|
||||
puts(PROGRAM_VERSION_STRING);
|
||||
@@ -741,9 +796,15 @@ static int parse_argv(int argc, char *argv[])
|
||||
case 'D':
|
||||
destrootdir = strdup(optarg);
|
||||
break;
|
||||
case 'H':
|
||||
case 'L':
|
||||
logdir = strdup(optarg);
|
||||
break;
|
||||
case 'f':
|
||||
arg_hmac = true;
|
||||
break;
|
||||
case 'H':
|
||||
arg_hostonly = true;
|
||||
break;
|
||||
case 'h':
|
||||
usage(EXIT_SUCCESS);
|
||||
break;
|
||||
@@ -846,9 +907,9 @@ static int install_one(const char *src, const char *dst)
|
||||
int ret = 0;
|
||||
|
||||
if (strchr(src, '/') == NULL) {
|
||||
char **q = NULL;
|
||||
char **p = find_binary(src);
|
||||
if (p) {
|
||||
char **q = NULL;
|
||||
STRV_FOREACH(q, p) {
|
||||
char *newsrc = *q;
|
||||
log_debug("dracut_install '%s' '%s'", newsrc, dst);
|
||||
@@ -882,9 +943,9 @@ static int install_all(int argc, char **argv)
|
||||
log_debug("Handle '%s'", argv[i]);
|
||||
|
||||
if (strchr(argv[i], '/') == NULL) {
|
||||
char **q = NULL;
|
||||
char **p = find_binary(argv[i]);
|
||||
if (p) {
|
||||
char **q = NULL;
|
||||
STRV_FOREACH(q, p) {
|
||||
char *newsrc = *q;
|
||||
log_debug("dracut_install '%s'", newsrc);
|
||||
@@ -962,6 +1023,23 @@ int main(int argc, char **argv)
|
||||
goto finish;
|
||||
}
|
||||
|
||||
if (logdir) {
|
||||
int ret;
|
||||
|
||||
ret = asprintf(&logfile, "%s/%d.log", logdir, getpid());
|
||||
if (ret < 0) {
|
||||
log_error("Out of memory!");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
logfile_f = fopen(logfile, "a");
|
||||
if (logfile_f == NULL) {
|
||||
log_error("Could not open %s for logging: %m", logfile);
|
||||
r = EXIT_FAILURE;
|
||||
goto finish;
|
||||
}
|
||||
}
|
||||
|
||||
r = EXIT_SUCCESS;
|
||||
|
||||
if (((optind + 1) < argc) && (strcmp(argv[optind + 1], destrootdir) == 0)) {
|
||||
@@ -990,6 +1068,8 @@ int main(int argc, char **argv)
|
||||
r = EXIT_SUCCESS;
|
||||
|
||||
finish:
|
||||
if (logfile_f)
|
||||
fclose(logfile_f);
|
||||
|
||||
while ((i = hashmap_steal_first(items)))
|
||||
item_free(i);
|
||||
|
@@ -1,5 +1,3 @@
|
||||
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
|
||||
|
||||
/***
|
||||
This file is part of systemd.
|
||||
|
||||
|
@@ -1,5 +1,3 @@
|
||||
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
|
||||
|
||||
#ifndef foohashmaphfoo
|
||||
#define foohashmaphfoo
|
||||
|
||||
|
@@ -1,5 +1,3 @@
|
||||
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
|
||||
|
||||
/***
|
||||
This file is part of systemd.
|
||||
|
||||
@@ -103,11 +101,10 @@ void log_set_facility(int facility) {
|
||||
static int write_to_console(
|
||||
int level,
|
||||
const char*file,
|
||||
int line,
|
||||
unsigned int line,
|
||||
const char *func,
|
||||
const char *buffer) {
|
||||
|
||||
char location[64];
|
||||
struct iovec iovec[5];
|
||||
unsigned n = 0;
|
||||
|
||||
@@ -119,7 +116,9 @@ static int write_to_console(
|
||||
IOVEC_SET_STRING(iovec[n++], "dracut-install: ");
|
||||
|
||||
if (show_location) {
|
||||
snprintf(location, sizeof(location), "(%s:%u) ", file, line);
|
||||
char location[64];
|
||||
if (snprintf(location, sizeof(location), "(%s:%u) ", file, line) <= 0)
|
||||
return -errno;
|
||||
IOVEC_SET_STRING(iovec[n++], location);
|
||||
}
|
||||
|
||||
|
@@ -1,5 +1,3 @@
|
||||
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
|
||||
|
||||
#ifndef foologhfoo
|
||||
#define foologhfoo
|
||||
|
||||
|
@@ -1,5 +1,3 @@
|
||||
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
|
||||
|
||||
#pragma once
|
||||
|
||||
/***
|
||||
@@ -207,7 +205,7 @@ static inline size_t IOVEC_INCREMENT(struct iovec *i, unsigned n, size_t k) {
|
||||
for (j = 0; j < n; j++) {
|
||||
size_t sub;
|
||||
|
||||
if (_unlikely_(k <= 0))
|
||||
if (_unlikely_(k == 0))
|
||||
break;
|
||||
|
||||
sub = MIN(i[j].iov_len, k);
|
||||
|
@@ -1,5 +1,3 @@
|
||||
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
|
||||
|
||||
/***
|
||||
This file is part of systemd.
|
||||
|
||||
@@ -84,7 +82,7 @@ char **strv_copy(char * const *l) {
|
||||
return r;
|
||||
}
|
||||
|
||||
unsigned strv_length(char * const *l) {
|
||||
unsigned int strv_length(char * const *l) {
|
||||
unsigned n = 0;
|
||||
|
||||
if (!l)
|
||||
@@ -299,7 +297,7 @@ char **strv_split_quoted(const char *s) {
|
||||
|
||||
char **strv_split_newlines(const char *s) {
|
||||
char **l;
|
||||
unsigned n;
|
||||
unsigned int n;
|
||||
|
||||
assert(s);
|
||||
|
||||
@@ -311,7 +309,7 @@ char **strv_split_newlines(const char *s) {
|
||||
return NULL;
|
||||
|
||||
n = strv_length(l);
|
||||
if (n <= 0)
|
||||
if (n == 0)
|
||||
return l;
|
||||
|
||||
if (isempty(l[n-1])) {
|
||||
@@ -491,9 +489,9 @@ char **strv_parse_nulstr(const char *s, size_t l) {
|
||||
unsigned c = 0, i = 0;
|
||||
char **v;
|
||||
|
||||
assert(s || l <= 0);
|
||||
assert(s || l == 0);
|
||||
|
||||
if (l <= 0)
|
||||
if (l == 0)
|
||||
return new0(char*, 1);
|
||||
|
||||
for (p = s; p < s + l; p++)
|
||||
|
@@ -1,5 +1,3 @@
|
||||
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
|
||||
|
||||
#pragma once
|
||||
|
||||
/***
|
||||
@@ -34,7 +32,7 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(char**, strv_free);
|
||||
#define _cleanup_strv_free_ _cleanup_(strv_freep)
|
||||
|
||||
char **strv_copy(char * const *l);
|
||||
unsigned strv_length(char * const *l) _pure_;
|
||||
unsigned int strv_length(char * const *l) _pure_;
|
||||
|
||||
char **strv_merge(char **a, char **b);
|
||||
char **strv_merge_concat(char **a, char **b, const char *suffix);
|
||||
|
@@ -1,5 +1,3 @@
|
||||
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
|
||||
|
||||
/***
|
||||
This file is part of systemd.
|
||||
|
||||
@@ -224,7 +222,7 @@ char *strappend(const char *s, const char *suffix) {
|
||||
char *strjoin(const char *x, ...) {
|
||||
va_list ap;
|
||||
size_t l;
|
||||
char *r, *p;
|
||||
char *r;
|
||||
|
||||
va_start(ap, x);
|
||||
|
||||
@@ -257,6 +255,8 @@ char *strjoin(const char *x, ...) {
|
||||
return NULL;
|
||||
|
||||
if (x) {
|
||||
char *p;
|
||||
|
||||
p = stpcpy(r, x);
|
||||
|
||||
va_start(ap, x);
|
||||
|
@@ -1,5 +1,3 @@
|
||||
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
|
||||
|
||||
#ifndef fooutilhfoo
|
||||
#define fooutilhfoo
|
||||
|
||||
@@ -22,6 +20,8 @@
|
||||
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||
***/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include <sched.h>
|
||||
#include <limits.h>
|
||||
|
@@ -1,7 +1,4 @@
|
||||
#
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
#
|
||||
# Copyright 2013 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
|
98
lsinitrd.sh
98
lsinitrd.sh
@@ -1,6 +1,4 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
#
|
||||
# Copyright 2005-2010 Harald Hoyer <harald@redhat.com>
|
||||
# Copyright 2005-2010 Red Hat, Inc. All rights reserved.
|
||||
@@ -27,6 +25,7 @@ usage()
|
||||
echo
|
||||
echo "-h, --help print a help message and exit."
|
||||
echo "-s, --size sort the contents of the initramfs by size."
|
||||
echo "-m, --mod list modules."
|
||||
echo "-f, --file <filename> print the contents of <filename>."
|
||||
echo "-k, --kver <kernel version> inspect the initramfs of <kernel version>."
|
||||
echo
|
||||
@@ -37,13 +36,15 @@ usage()
|
||||
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
|
||||
|
||||
sorted=0
|
||||
modules=0
|
||||
declare -A filenames
|
||||
|
||||
unset POSIXLY_CORRECT
|
||||
TEMP=$(getopt \
|
||||
-o "shf:k:" \
|
||||
-o "shmf:k:" \
|
||||
--long kver: \
|
||||
--long file: \
|
||||
--long mod \
|
||||
--long help \
|
||||
--long size \
|
||||
-- "$@")
|
||||
@@ -61,6 +62,7 @@ while (($# > 0)); do
|
||||
-f|--file) filenames[${2#/}]=1; shift;;
|
||||
-s|--size) sorted=1;;
|
||||
-h|--help) usage; exit 0;;
|
||||
-m|--mod) modules=1;;
|
||||
--) shift;break;;
|
||||
*) usage; exit 1;;
|
||||
esac
|
||||
@@ -106,6 +108,12 @@ if ! [[ -f "$image" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dracutlibdirs() {
|
||||
for d in lib64/dracut lib/dracut usr/lib64/dracut usr/lib/dracut; do
|
||||
echo "$d/$1"
|
||||
done
|
||||
}
|
||||
|
||||
extract_files()
|
||||
{
|
||||
(( ${#filenames[@]} == 1 )) && nofileinfo=1
|
||||
@@ -119,6 +127,14 @@ extract_files()
|
||||
done
|
||||
}
|
||||
|
||||
list_modules()
|
||||
{
|
||||
echo "dracut modules:"
|
||||
$CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- \
|
||||
$(dracutlibdirs modules.txt) 2>/dev/null
|
||||
((ret+=$?))
|
||||
}
|
||||
|
||||
list_files()
|
||||
{
|
||||
echo "========================================================================"
|
||||
@@ -133,7 +149,7 @@ list_files()
|
||||
|
||||
|
||||
if (( ${#filenames[@]} <= 0 )); then
|
||||
echo "Image: $image: $(du -h $image | while read a b; do echo $a;done)"
|
||||
echo "Image: $image: $(du -h $image | while read a b || [ -n "$a" ]; do echo $a;done)"
|
||||
echo "========================================================================"
|
||||
fi
|
||||
|
||||
@@ -160,27 +176,38 @@ case $bin in
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ $SKIP ]]; then
|
||||
read -N 6 bin < <($SKIP "$image")
|
||||
fi
|
||||
|
||||
case $bin in
|
||||
$'\x1f\x8b'*)
|
||||
CAT="zcat --";;
|
||||
BZh*)
|
||||
CAT="bzcat --";;
|
||||
$'\x71\xc7'*|070701)
|
||||
CAT="cat --"
|
||||
;;
|
||||
$'\x02\x21'*)
|
||||
CAT="lz4 -d -c";;
|
||||
*)
|
||||
CAT="xzcat --";
|
||||
if echo "test"|xz|xzcat --single-stream >/dev/null 2>&1; then
|
||||
CAT="xzcat --single-stream --"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
CAT=$({
|
||||
if [[ $SKIP ]]; then
|
||||
$SKIP "$image"
|
||||
else
|
||||
cat "$image"
|
||||
fi } | {
|
||||
read -N 6 bin
|
||||
case $bin in
|
||||
$'\x1f\x8b'*)
|
||||
echo "zcat --"
|
||||
;;
|
||||
BZh*)
|
||||
echo "bzcat --"
|
||||
;;
|
||||
$'\x71\xc7'*|070701)
|
||||
echo "cat --"
|
||||
;;
|
||||
$'\x02\x21'*)
|
||||
echo "lz4 -d -c"
|
||||
;;
|
||||
$'\x89'LZO$'\0'*)
|
||||
echo "lzop -d -c"
|
||||
;;
|
||||
*)
|
||||
if echo "test"|xz|xzcat --single-stream >/dev/null 2>&1; then
|
||||
echo "xzcat --single-stream --"
|
||||
else
|
||||
echo "xzcat --"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
})
|
||||
|
||||
skipcpio()
|
||||
{
|
||||
@@ -197,17 +224,22 @@ ret=0
|
||||
if (( ${#filenames[@]} > 0 )); then
|
||||
extract_files
|
||||
else
|
||||
version=$($CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- 'lib/dracut/dracut-*' 'usr/lib/dracut/dracut-*' 2>/dev/null)
|
||||
version=$($CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- \
|
||||
$(dracutlibdirs 'dracut-*') 2>/dev/null)
|
||||
((ret+=$?))
|
||||
echo "Version: $version"
|
||||
echo
|
||||
echo -n "Arguments: "
|
||||
$CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- 'lib/dracut/build-parameter.txt' 'usr/lib/dracut/build-parameter.txt' 2>/dev/null
|
||||
echo
|
||||
echo "dracut modules:"
|
||||
$CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- 'lib/dracut/modules.txt' 'usr/lib/dracut/modules.txt' 2>/dev/null
|
||||
((ret+=$?))
|
||||
list_files
|
||||
if [ "$modules" -eq 1 ]; then
|
||||
list_modules
|
||||
echo "========================================================================"
|
||||
else
|
||||
echo -n "Arguments: "
|
||||
$CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- \
|
||||
$(dracutlibdirs build-parameter.txt) 2>/dev/null
|
||||
echo
|
||||
list_modules
|
||||
list_files
|
||||
fi
|
||||
fi
|
||||
|
||||
exit $ret
|
||||
|
@@ -76,7 +76,9 @@ OPTIONS
|
||||
|
||||
**-A**::
|
||||
Create a so called "monster initrd" which includes all available
|
||||
features and modules.
|
||||
features and modules. This calls dracut with --no-hostonly and
|
||||
--no-hostonly-cmdline parameters internally, instead of the default
|
||||
--hostonly and --hostonly-cmdline.
|
||||
|
||||
**-v, --verbose**::
|
||||
increase verbosity level
|
||||
@@ -85,9 +87,6 @@ OPTIONS
|
||||
Disable logging to _/var/log/YaST2/mkinitrd.log_. This is useful for
|
||||
testing if you don’t want to clutter the system log.
|
||||
|
||||
**--force**::
|
||||
overwrite existing initramfs file.
|
||||
|
||||
**--help**::
|
||||
print a help message and exit.
|
||||
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/bash --norc
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
#
|
||||
# mkinitrd compability wrapper for SUSE.
|
||||
#
|
||||
@@ -22,8 +20,6 @@
|
||||
|
||||
boot_dir="/boot"
|
||||
quiet=0
|
||||
host_only=1
|
||||
force=0
|
||||
logfile=/var/log/YaST2/mkinitrd.log
|
||||
dracut_cmd=dracut
|
||||
|
||||
@@ -70,10 +66,7 @@ usage () {
|
||||
$cmd " -j device Journal device"
|
||||
$cmd " -D interface Run dhcp on the specified interface."
|
||||
$cmd " -I interface Configure the specified interface statically."
|
||||
$cmd " -a acpi_dsdt Attach compiled ACPI DSDT (Differentiated"
|
||||
$cmd " System Description Table) to initrd. This"
|
||||
$cmd " replaces the DSDT of the BIOS. Defaults to"
|
||||
$cmd " the ACPI_DSDT variable in /etc/sysconfig/kernel."
|
||||
$cmd " -a acpi_dsdt Obsolete, do not use."
|
||||
$cmd " -s size Add splash animation and bootscreen to initrd."
|
||||
|
||||
[[ $1 = '-n' ]] && exit 0
|
||||
@@ -206,8 +199,6 @@ default_kernel_images() {
|
||||
for initrd_image in $initrd_images;do
|
||||
targets="$targets $initrd_image"
|
||||
done
|
||||
host_only=1
|
||||
force=1
|
||||
}
|
||||
|
||||
while (($# > 0)); do
|
||||
@@ -220,8 +211,6 @@ while (($# > 0)); do
|
||||
for kernel_image in $kernel_images;do
|
||||
kernels="$kernels ${kernel_image#*-}"
|
||||
done
|
||||
host_only=1
|
||||
force=1
|
||||
;;
|
||||
-i) read_arg initrd_images "$@" || shift $?
|
||||
for initrd_image in $initrd_images;do
|
||||
@@ -263,7 +252,7 @@ while (($# > 0)); do
|
||||
dracut_cmdline="${dracut_cmdline} ip=$(ipconfig $static_if)":
|
||||
;;
|
||||
-a) read_arg acpi_dsdt "$@" || shift $?
|
||||
echo "mkinitrd: custom DSDT not yet supported"
|
||||
echo "Obsolete -a param, use acpi_table_dir= and acpi_override= variables in /etc/dracut.conf.d/"
|
||||
exit 1
|
||||
;;
|
||||
-s) read_arg boot_splash "$@" || shift $?
|
||||
@@ -277,7 +266,6 @@ while (($# > 0)); do
|
||||
--version|-R)
|
||||
echo "mkinitrd: dracut compatibility wrapper"
|
||||
exit 0;;
|
||||
--force) force=1;;
|
||||
--quiet|-q) quiet=1;;
|
||||
*) if [[ ! $targets ]]; then
|
||||
targets=$1
|
||||
@@ -291,15 +279,17 @@ while (($# > 0)); do
|
||||
done
|
||||
|
||||
[[ $targets && $kernels ]] || default_kernel_images
|
||||
[[ $targets && $kernels ]] || (error "No kernel found in $boot_dir" && usage)
|
||||
if [[ ! $targets || ! $kernels ]];then
|
||||
error "No kernel found in $boot_dir"
|
||||
fi
|
||||
|
||||
# We can have several targets/kernels, transform the list to an array
|
||||
targets=( $targets )
|
||||
[[ $kernels ]] && kernels=( $kernels )
|
||||
|
||||
[[ $logfile ]] && dracut_args="${dracut_args} --logfile $logfile"
|
||||
[[ $host_only == 1 ]] && dracut_args="${dracut_args} --hostonly"
|
||||
[[ $force == 1 ]] && dracut_args="${dracut_args} --force"
|
||||
dracut_args="${dracut_args} --force"
|
||||
|
||||
[[ $dracut_cmdline ]] && dracut_args="${dracut_args} --kernel-cmdline ${dracut_cmdline}"
|
||||
[ -z "$(type -p update-bootloader)" ] && skip_update_bootloader=1
|
||||
|
||||
@@ -308,11 +298,9 @@ if [ -f /etc/sysconfig/kernel ] ; then
|
||||
. /etc/sysconfig/kernel
|
||||
fi
|
||||
[[ $module_list ]] || module_list="${INITRD_MODULES}"
|
||||
basicmodules="$basicmodules ${module_list}"
|
||||
[[ $domu_module_list ]] || domu_module_list="${DOMU_INITRD_MODULES}"
|
||||
[[ $acpi_dsdt ]] || acpi_dsdt="${ACPI_DSDT}"
|
||||
shopt -s extglob
|
||||
|
||||
echo "Creating: target|kernel|dracut args|basicmodules "
|
||||
for ((i=0 ; $i<${#targets[@]} ; i++)); do
|
||||
|
||||
if [[ $img_vers ]];then
|
||||
@@ -322,28 +310,34 @@ for ((i=0 ; $i<${#targets[@]} ; i++)); do
|
||||
fi
|
||||
kernel="${kernels[$i]}"
|
||||
|
||||
if is_xen_kernel $kernel $rootfs ; then
|
||||
modules_all="${module_list} ${domu_module_list}"
|
||||
else
|
||||
modules_all="${module_list}"
|
||||
fi
|
||||
|
||||
# Remove leading and trailing spaces needs (set above): shopt -s extglob
|
||||
modules_all=${modules_all%%+([[:space:]])}
|
||||
modules_all=${modules_all##+([[:space:]])}
|
||||
|
||||
echo "Creating initrd: $target"
|
||||
|
||||
# Duplicate code: No way found how to redirect output based on $quiet
|
||||
if [[ $quiet == 1 ]];then
|
||||
echo "$target|$kernel|$dracut_args|$basicmodules"
|
||||
if is_xen_kernel $kernel $rootfs ; then
|
||||
basicmodules="$basicmodules ${domu_module_list}"
|
||||
fi
|
||||
if [[ $basicmodules ]]; then
|
||||
$dracut_cmd $dracut_args --add-drivers "$basicmodules" "$target" \
|
||||
"$kernel" &>/dev/null
|
||||
else
|
||||
# Duplicate code: --force-drivers must not be called with empty string
|
||||
# -> dracut bug workarounded ugly, because of complex whitespace
|
||||
# expansion magics
|
||||
if [ -n "${modules_all}" ];then
|
||||
$dracut_cmd $dracut_args --force-drivers "${modules_all}" "$target" "$kernel" &>/dev/null
|
||||
else
|
||||
$dracut_cmd $dracut_args "$target" "$kernel" &>/dev/null
|
||||
fi
|
||||
fi
|
||||
else
|
||||
if is_xen_kernel $kernel $rootfs ; then
|
||||
basicmodules="$basicmodules ${domu_module_list}"
|
||||
fi
|
||||
if [[ $basicmodules ]]; then
|
||||
$dracut_cmd $dracut_args --add-drivers "$basicmodules" "$target" \
|
||||
"$kernel"
|
||||
else
|
||||
if [ -n "${modules_all}" ];then
|
||||
$dracut_cmd $dracut_args --force-drivers "${modules_all}" "$target" "$kernel"
|
||||
else
|
||||
$dracut_cmd $dracut_args "$target" "$kernel"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
@@ -20,7 +18,8 @@ depends() {
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
instmods autofs4 ipv6
|
||||
hostonly='' instmods autofs4 ipv6
|
||||
instmods -s efivarfs
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
@@ -44,6 +43,7 @@ install() {
|
||||
$systemdutildir/systemd-modules-load \
|
||||
$systemdutildir/systemd-vconsole-setup \
|
||||
$systemdutildir/system-generators/systemd-fstab-generator \
|
||||
$systemdutildir/system-generators/systemd-gpt-auto-generator \
|
||||
\
|
||||
$systemdsystemunitdir/cryptsetup.target \
|
||||
$systemdsystemunitdir/emergency.target \
|
||||
@@ -51,14 +51,14 @@ install() {
|
||||
$systemdsystemunitdir/basic.target \
|
||||
$systemdsystemunitdir/halt.target \
|
||||
$systemdsystemunitdir/kexec.target \
|
||||
$systemdsystemunitdir/initrd.target \
|
||||
$systemdsystemunitdir/initrd-fs.target \
|
||||
$systemdsystemunitdir/initrd-root-fs.target \
|
||||
$systemdsystemunitdir/local-fs.target \
|
||||
$systemdsystemunitdir/local-fs-pre.target \
|
||||
$systemdsystemunitdir/remote-fs.target \
|
||||
$systemdsystemunitdir/remote-fs-pre.target \
|
||||
$systemdsystemunitdir/multi-user.target \
|
||||
$systemdsystemunitdir/network.target \
|
||||
$systemdsystemunitdir/network-pre.target \
|
||||
$systemdsystemunitdir/network-online.target \
|
||||
$systemdsystemunitdir/nss-lookup.target \
|
||||
$systemdsystemunitdir/nss-user-lookup.target \
|
||||
$systemdsystemunitdir/poweroff.target \
|
||||
@@ -83,6 +83,7 @@ install() {
|
||||
$systemdsystemunitdir/systemd-udevd-kernel.socket \
|
||||
$systemdsystemunitdir/systemd-ask-password-plymouth.path \
|
||||
$systemdsystemunitdir/systemd-journald.socket \
|
||||
$systemdsystemunitdir/systemd-journald-audit.socket \
|
||||
$systemdsystemunitdir/systemd-ask-password-console.service \
|
||||
$systemdsystemunitdir/systemd-modules-load.service \
|
||||
$systemdsystemunitdir/systemd-halt.service \
|
||||
@@ -97,6 +98,7 @@ install() {
|
||||
$systemdsystemunitdir/systemd-journald.service \
|
||||
$systemdsystemunitdir/systemd-vconsole-setup.service \
|
||||
$systemdsystemunitdir/systemd-random-seed-load.service \
|
||||
$systemdsystemunitdir/systemd-random-seed.service \
|
||||
$systemdsystemunitdir/systemd-sysctl.service \
|
||||
\
|
||||
$systemdsystemunitdir/sysinit.target.wants/systemd-modules-load.service \
|
||||
@@ -105,6 +107,8 @@ install() {
|
||||
$systemdsystemunitdir/sockets.target.wants/systemd-udevd-control.socket \
|
||||
$systemdsystemunitdir/sockets.target.wants/systemd-udevd-kernel.socket \
|
||||
$systemdsystemunitdir/sockets.target.wants/systemd-journald.socket \
|
||||
$systemdsystemunitdir/sockets.target.wants/systemd-journald-audit.socket \
|
||||
$systemdsystemunitdir/sockets.target.wants/systemd-journald-dev-log.socket \
|
||||
$systemdsystemunitdir/sysinit.target.wants/systemd-udevd.service \
|
||||
$systemdsystemunitdir/sysinit.target.wants/systemd-udev-trigger.service \
|
||||
$systemdsystemunitdir/sysinit.target.wants/kmod-static-nodes.service \
|
||||
@@ -112,17 +116,20 @@ install() {
|
||||
$systemdsystemunitdir/sysinit.target.wants/systemd-sysctl.service \
|
||||
\
|
||||
$systemdsystemunitdir/ctrl-alt-del.target \
|
||||
$systemdsystemunitdir/reboot.target \
|
||||
$systemdsystemunitdir/systemd-reboot.service \
|
||||
$systemdsystemunitdir/syslog.socket \
|
||||
$systemdsystemunitdir/initrd-switch-root.target \
|
||||
$systemdsystemunitdir/initrd-switch-root.service \
|
||||
$systemdsystemunitdir/initrd-cleanup.service \
|
||||
$systemdsystemunitdir/initrd-udevadm-cleanup-db.service \
|
||||
$systemdsystemunitdir/initrd-parse-etc.service \
|
||||
\
|
||||
$systemdsystemunitdir/slices.target \
|
||||
$systemdsystemunitdir/system.slice \
|
||||
\
|
||||
journalctl systemctl echo swapoff systemd-cgls systemd-tmpfiles
|
||||
$tmpfilesdir/systemd.conf \
|
||||
\
|
||||
journalctl systemctl \
|
||||
echo swapoff \
|
||||
kmod insmod rmmod modprobe modinfo depmod lsmod \
|
||||
mount umount reboot poweroff \
|
||||
systemd-cgls systemd-tmpfiles
|
||||
|
||||
inst_multiple -o \
|
||||
/usr/lib/modules-load.d/*.conf \
|
||||
@@ -132,7 +139,7 @@ install() {
|
||||
local _line i
|
||||
for i in "$1"/*.conf; do
|
||||
[[ -f $i ]] || continue
|
||||
while read _line; do
|
||||
while read _line || [ -n "$_line" ]; do
|
||||
case $_line in
|
||||
\#*)
|
||||
;;
|
||||
@@ -149,7 +156,7 @@ install() {
|
||||
[[ $_mods ]] && instmods $_mods
|
||||
|
||||
if [[ $hostonly ]]; then
|
||||
inst_multiple -o \
|
||||
inst_multiple -H -o \
|
||||
/etc/systemd/journald.conf \
|
||||
/etc/systemd/system.conf \
|
||||
/etc/hostname \
|
||||
@@ -170,38 +177,28 @@ install() {
|
||||
|
||||
# install adm user/group for journald
|
||||
inst_multiple nologin
|
||||
egrep '^systemd-journal:' "$initdir/etc/passwd" 2>/dev/null >> "$initdir/etc/passwd"
|
||||
egrep '^systemd-journal:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
egrep '^adm:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
egrep '^systemd-journal:' /etc/group >> "$initdir/etc/group"
|
||||
egrep '^wheel:' /etc/group >> "$initdir/etc/group"
|
||||
egrep '^adm:' /etc/group >> "$initdir/etc/group"
|
||||
|
||||
ln_r $systemdutildir/systemd "/init"
|
||||
ln_r $systemdutildir/systemd "/sbin/init"
|
||||
|
||||
inst_script "$moddir/dracut-emergency.sh" /bin/dracut-emergency
|
||||
inst_simple "$moddir/emergency.service" ${systemdsystemunitdir}/emergency.service
|
||||
inst_simple "$moddir/dracut-emergency.service" ${systemdsystemunitdir}/dracut-emergency.service
|
||||
inst_simple "$moddir/emergency.service" ${systemdsystemunitdir}/rescue.service
|
||||
|
||||
ln_r "${systemdsystemunitdir}/initrd.target" "${systemdsystemunitdir}/default.target"
|
||||
|
||||
inst_script "$moddir/dracut-cmdline.sh" /bin/dracut-cmdline
|
||||
inst_script "$moddir/dracut-pre-udev.sh" /bin/dracut-pre-udev
|
||||
inst_script "$moddir/dracut-pre-trigger.sh" /bin/dracut-pre-trigger
|
||||
inst_script "$moddir/dracut-initqueue.sh" /bin/dracut-initqueue
|
||||
inst_script "$moddir/dracut-pre-mount.sh" /bin/dracut-pre-mount
|
||||
inst_script "$moddir/dracut-mount.sh" /bin/dracut-mount
|
||||
inst_script "$moddir/dracut-pre-pivot.sh" /bin/dracut-pre-pivot
|
||||
|
||||
inst_script "$moddir/rootfs-generator.sh" /lib/systemd/system-generators/dracut-rootfs-generator
|
||||
|
||||
inst_binary true
|
||||
ln_r $(type -P true) "/usr/bin/loginctl"
|
||||
ln_r $(type -P true) "/bin/loginctl"
|
||||
inst_rules 70-uaccess.rules 71-seat.rules 73-seat-late.rules 99-systemd.rules
|
||||
inst_rules \
|
||||
70-uaccess.rules \
|
||||
71-seat.rules \
|
||||
73-seat-late.rules \
|
||||
90-vconsole.rules \
|
||||
99-systemd.rules
|
||||
|
||||
for i in \
|
||||
emergency.target \
|
||||
dracut-emergency.service \
|
||||
rescue.service \
|
||||
rescue.target \
|
||||
systemd-ask-password-console.service \
|
||||
systemd-ask-password-plymouth.service \
|
||||
; do
|
||||
@@ -210,20 +207,6 @@ install() {
|
||||
"${systemdsystemunitdir}/${i}.wants/systemd-vconsole-setup.service"
|
||||
done
|
||||
|
||||
mkdir -p "${initdir}/$systemdsystemunitdir/initrd.target.wants"
|
||||
for i in \
|
||||
dracut-cmdline.service \
|
||||
dracut-initqueue.service \
|
||||
dracut-mount.service \
|
||||
dracut-pre-mount.service \
|
||||
dracut-pre-pivot.service \
|
||||
dracut-pre-trigger.service \
|
||||
dracut-pre-udev.service \
|
||||
; do
|
||||
inst_simple "$moddir/${i}" "$systemdsystemunitdir/${i}"
|
||||
ln_r "$systemdsystemunitdir/${i}" "$systemdsystemunitdir/initrd.target.wants/${i}"
|
||||
done
|
||||
|
||||
mkdir -p "$initdir/etc/systemd"
|
||||
# turn off RateLimit for journal
|
||||
{
|
||||
@@ -232,5 +215,6 @@ install() {
|
||||
echo "RateLimitBurst=0"
|
||||
} >> "$initdir/etc/systemd/journald.conf"
|
||||
|
||||
ln_r "${systemdsystemunitdir}/multi-user.target" "${systemdsystemunitdir}/default.target"
|
||||
}
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
if ! fipsmode=$(getarg fips) || [ $fipsmode = "0" ]; then
|
||||
rm -f -- /etc/modprobe.d/fips.conf >/dev/null 2>&1
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
if ! fipsmode=$(getarg fips) || [ $fipsmode = "0" ]; then
|
||||
rm -f -- /etc/modprobe.d/fips.conf >/dev/null 2>&1
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
mount_boot()
|
||||
{
|
||||
@@ -61,8 +59,8 @@ do_rhevh_check()
|
||||
kpath=${1}
|
||||
|
||||
# If we're on RHEV-H, the kernel is in /run/initramfs/live/vmlinuz0
|
||||
HMAC_SUM_ORIG=$(cat $NEWROOT/boot/.vmlinuz-${KERNEL}.hmac | while read a b; do printf "%s\n" $a; done)
|
||||
HMAC_SUM_CALC=$(sha512hmac $kpath | while read a b; do printf "%s\n" $a; done || return 1)
|
||||
HMAC_SUM_ORIG=$(cat $NEWROOT/boot/.vmlinuz-${KERNEL}.hmac | while read a b || [ -n "$a" ]; do printf "%s\n" $a; done)
|
||||
HMAC_SUM_CALC=$(sha512hmac $kpath | while read a b || [ -n "$a" ]; do printf "%s\n" $a; done || return 1)
|
||||
if [ -z "$HMAC_SUM_ORIG" ] || [ -z "$HMAC_SUM_CALC" ] || [ "${HMAC_SUM_ORIG}" != "${HMAC_SUM_CALC}" ]; then
|
||||
warn "HMAC sum mismatch"
|
||||
return 1
|
||||
@@ -94,7 +92,7 @@ do_fips()
|
||||
if ! modprobe "${_module}"; then
|
||||
# check if kernel provides generic algo
|
||||
_found=0
|
||||
while read _k _s _v; do
|
||||
while read _k _s _v || [ -n "$_k" ]; do
|
||||
[ "$_k" != "name" -a "$_k" != "driver" ] && continue
|
||||
[ "$_v" != "$_module" ] && continue
|
||||
_found=1
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
@@ -16,10 +14,11 @@ depends() {
|
||||
installkernel() {
|
||||
local _fipsmodules _mod
|
||||
_fipsmodules="aead aes_generic aes-x86_64 ansi_cprng arc4 blowfish camellia cast6 cbc ccm "
|
||||
_fipsmodules+="chainiv crc32c crct10dif_generic cryptomgr crypto_null ctr cts deflate des des3_ede dm-crypt dm-mod "
|
||||
_fipsmodules+="chainiv crc32c crct10dif_generic cryptomgr crypto_null ctr cts deflate des des3_ede dm-crypt dm-mod drbg "
|
||||
_fipsmodules+="ecb eseqiv fcrypt gcm ghash_generic hmac khazad lzo md4 md5 michael_mic rmd128 "
|
||||
_fipsmodules+="rmd160 rmd256 rmd320 rot13 salsa20 seed seqiv serpent sha1 sha224 sha256 sha256_generic "
|
||||
_fipsmodules+="sha384 sha512 sha512_generic tcrypt tea tnepres twofish wp256 wp384 wp512 xeta xtea xts zlib"
|
||||
_fipsmodules+="aes_s390 des_s390 prng sha256_s390 sha_common des_check_key ghash_s390 sha1_s390 sha512_s390"
|
||||
|
||||
mkdir -m 0755 -p "${initdir}/etc/modprobe.d"
|
||||
|
||||
@@ -42,7 +41,8 @@ install() {
|
||||
|
||||
inst_libdir_file libsoftokn3.so libsoftokn3.so \
|
||||
libsoftokn3.chk libfreebl3.so libfreebl3.chk \
|
||||
libssl.so 'hmaccalc/sha512hmac.hmac' libssl.so.10
|
||||
libssl.so 'hmaccalc/sha512hmac.hmac' libssl.so.10 \
|
||||
libfreeblpriv3.so libfreeblpriv3.chk
|
||||
|
||||
inst_multiple -o prelink
|
||||
inst_simple /etc/system-fips
|
||||
|
68
modules.d/01systemd-initrd/module-setup.sh
Executable file
68
modules.d/01systemd-initrd/module-setup.sh
Executable file
@@ -0,0 +1,68 @@
|
||||
#!/bin/bash
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
[[ $mount_needs ]] && return 1
|
||||
|
||||
if ! dracut_module_included "systemd"; then
|
||||
derror "dracut-systemd needs systemd in the initramfs"
|
||||
return 1
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
echo "systemd"
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
local _mods
|
||||
|
||||
inst_multiple -o \
|
||||
$systemdsystemunitdir/initrd.target \
|
||||
$systemdsystemunitdir/initrd-fs.target \
|
||||
$systemdsystemunitdir/initrd-root-fs.target \
|
||||
$systemdsystemunitdir/initrd-switch-root.target \
|
||||
$systemdsystemunitdir/initrd-switch-root.service \
|
||||
$systemdsystemunitdir/initrd-cleanup.service \
|
||||
$systemdsystemunitdir/initrd-udevadm-cleanup-db.service \
|
||||
$systemdsystemunitdir/initrd-parse-etc.service
|
||||
|
||||
ln_r "${systemdsystemunitdir}/initrd.target" "${systemdsystemunitdir}/default.target"
|
||||
|
||||
if [ -e /etc/os-release ]; then
|
||||
. /etc/os-release
|
||||
VERSION+=" "
|
||||
PRETTY_NAME+=" "
|
||||
else
|
||||
VERSION=""
|
||||
PRETTY_NAME=""
|
||||
fi
|
||||
NAME=dracut
|
||||
ID=dracut
|
||||
VERSION+="dracut-$DRACUT_VERSION"
|
||||
PRETTY_NAME+="dracut-$DRACUT_VERSION (Initramfs)"
|
||||
VERSION_ID=$DRACUT_VERSION
|
||||
ANSI_COLOR="0;34"
|
||||
|
||||
{
|
||||
echo NAME=\"$NAME\"
|
||||
echo VERSION=\"$VERSION\"
|
||||
echo ID=$ID
|
||||
echo VERSION_ID=$VERSION_ID
|
||||
echo PRETTY_NAME=\"$PRETTY_NAME\"
|
||||
echo ANSI_COLOR=\"$ANSI_COLOR\"
|
||||
} > $initdir/usr/lib/initrd-release
|
||||
echo dracut-$DRACUT_VERSION > $initdir/lib/dracut/dracut-$DRACUT_VERSION
|
||||
ln -sf ../usr/lib/initrd-release $initdir/etc/initrd-release
|
||||
ln -sf initrd-release $initdir/usr/lib/os-release
|
||||
ln -sf initrd-release $initdir/etc/os-release
|
||||
}
|
||||
|
@@ -1,12 +1,10 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
capsmode=$(getarg rd.caps)
|
||||
|
||||
if [ "$capsmode" = "1" ]; then
|
||||
CAPS_INIT_DROP=$(getarg rd.caps.initdrop=)
|
||||
CAPS_USERMODEHELPER_BSET=$(capsh --drop="$CAPS_INIT_DROP" -- -c 'while read a b ; do [ "$a" = "CapBnd:" ] && echo $((0x${b:$((${#b}-8)):8})) $((0x${b:$((${#b}-16)):8})) && break; done < /proc/self/status')
|
||||
CAPS_USERMODEHELPER_BSET=$(capsh --drop="$CAPS_INIT_DROP" -- -c 'while read a b || [ -n "$a" ]; do [ "$a" = "CapBnd:" ] && echo $((0x${b:$((${#b}-8)):8})) $((0x${b:$((${#b}-16)):8})) && break; done < /proc/self/status')
|
||||
CAPS_MODULES_DISABLED=$(getarg rd.caps.disablemodules=)
|
||||
CAPS_KEXEC_DISABLED=$(getarg rd.caps.disablekexec=)
|
||||
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
|
71
modules.d/02systemd-networkd/module-setup.sh
Executable file
71
modules.d/02systemd-networkd/module-setup.sh
Executable file
@@ -0,0 +1,71 @@
|
||||
#!/bin/bash
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
[[ $mount_needs ]] && return 1
|
||||
|
||||
if ! dracut_module_included "systemd"; then
|
||||
derror "dracut-systemd needs systemd in the initramfs"
|
||||
return 1
|
||||
fi
|
||||
|
||||
return 255
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
echo "systemd kernel-network-modules"
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
inst_multiple -o \
|
||||
$systemdutildir/systemd-networkd \
|
||||
$systemdutildir/systemd-networkd-wait-online \
|
||||
$systemdsystemunitdir/systemd-networkd-wait-online.service \
|
||||
$systemdsystemunitdir/systemd-networkd.service \
|
||||
$systemdsystemunitdir/systemd-networkd.socket \
|
||||
$systemdutildir/network/99-default.link \
|
||||
networkctl ip
|
||||
|
||||
#hostnamectl timedatectl
|
||||
# $systemdutildir/systemd-timesyncd \
|
||||
# $systemdutildir/systemd-timedated \
|
||||
# $systemdutildir/systemd-hostnamed \
|
||||
# $systemdutildir/systemd-resolvd \
|
||||
# $systemdutildir/systemd-resolve-host \
|
||||
# $systemdsystemunitdir/systemd-resolved.service \
|
||||
# $systemdsystemunitdir/systemd-hostnamed.service \
|
||||
# $systemdsystemunitdir/systemd-timesyncd.service \
|
||||
# $systemdsystemunitdir/systemd-timedated.service \
|
||||
# $systemdsystemunitdir/time-sync.target \
|
||||
# /etc/systemd/resolved.conf \
|
||||
|
||||
|
||||
# inst_dir /var/lib/systemd/clock
|
||||
|
||||
egrep '^systemd-network:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
egrep '^systemd-network:' /etc/group >> "$initdir/etc/group"
|
||||
# egrep '^systemd-timesync:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
# egrep '^systemd-timesync:' /etc/group >> "$initdir/etc/group"
|
||||
|
||||
_arch=$(uname -m)
|
||||
inst_libdir_file {"tls/$_arch/",tls/,"$_arch/",}"libnss_dns.so.*" \
|
||||
{"tls/$_arch/",tls/,"$_arch/",}"libnss_mdns4_minimal.so.*" \
|
||||
{"tls/$_arch/",tls/,"$_arch/",}"libnss_myhostname.so.*" \
|
||||
{"tls/$_arch/",tls/,"$_arch/",}"libnss_resolve.so.*"
|
||||
|
||||
for i in \
|
||||
systemd-networkd-wait-online.service \
|
||||
systemd-networkd.service \
|
||||
systemd-networkd.socket
|
||||
# systemd-timesyncd.service
|
||||
do
|
||||
systemctl --root "$initdir" enable "$i"
|
||||
done
|
||||
}
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
#
|
||||
# Licensed under the GPLv2
|
||||
#
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
#
|
||||
# Licensed under the GPLv2
|
||||
#
|
||||
@@ -29,7 +27,7 @@ depends() {
|
||||
# called by dracut
|
||||
install() {
|
||||
inst_dir /lib/modules/keys
|
||||
inst_binary /usr/bin/keyctl
|
||||
inst_binary keyctl
|
||||
|
||||
inst_hook pre-trigger 01 "$moddir/load-modsign-keys.sh"
|
||||
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
[ -n "$DRACUT_SYSTEMD" ] && exit 0
|
||||
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
@@ -42,7 +40,7 @@ install() {
|
||||
*) cmd=grep ;;
|
||||
esac
|
||||
|
||||
for INCL in $($cmd "^include " $MAP | while read a a b; do echo ${a//\"/}; done); do
|
||||
for INCL in $($cmd "^include " $MAP | while read a a b || [ -n "$a" ]; do echo ${a//\"/}; done); do
|
||||
for FN in $(find ${kbddir}/keymaps -type f -name $INCL\*); do
|
||||
findkeymap $FN
|
||||
done
|
||||
@@ -116,12 +114,12 @@ install() {
|
||||
rm -f -- "${initdir}${kbddir}/consoletrans/utflist"
|
||||
find "${initdir}${kbddir}/" -name README\* -delete
|
||||
find "${initdir}${kbddir}/" -name '*.gz' -print -quit \
|
||||
| while read line; do
|
||||
| while read line || [ -n "$line" ]; do
|
||||
inst_multiple gzip
|
||||
done
|
||||
|
||||
find "${initdir}${kbddir}/" -name '*.bz2' -print -quit \
|
||||
| while read line; do
|
||||
| while read line || [ -n "$line" ]; do
|
||||
inst_multiple bzip2
|
||||
done
|
||||
}
|
||||
@@ -247,7 +245,7 @@ install() {
|
||||
if checks; then
|
||||
install_base
|
||||
|
||||
if [[ ${hostonly} ]] && ! [[ ${i18n_install_all} ]]; then
|
||||
if [[ ${hostonly} ]] && ! [[ ${i18n_install_all} == "yes" ]]; then
|
||||
install_local_i18n || install_all_kbd
|
||||
else
|
||||
install_all_kbd
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
inst_key_val() {
|
||||
local _value
|
||||
@@ -12,7 +10,7 @@ inst_key_val() {
|
||||
_value="$(getarg $@)"
|
||||
[ -z "${_value}" ] && _value=$_default
|
||||
if [ -n "${_value}" ]; then
|
||||
printf '%s="%s"\n' $key ${_value} >> $_file
|
||||
printf '%s="%s"\n' ${_key} ${_value} >> $_file
|
||||
fi
|
||||
unset _file
|
||||
unset _value
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
ROOT="$1"
|
||||
|
||||
@@ -76,7 +74,7 @@ rm -f -- "$testfile"
|
||||
find_mount() {
|
||||
local dev mnt etc wanted_dev
|
||||
wanted_dev="$(readlink -e -q $1)"
|
||||
while read dev mnt etc; do
|
||||
while read dev mnt etc || [ -n "$dev" ]; do
|
||||
[ "$dev" = "$wanted_dev" ] && echo "$dev" && return 0
|
||||
done < /proc/mounts
|
||||
return 1
|
||||
@@ -95,7 +93,7 @@ else
|
||||
return 1
|
||||
fi
|
||||
|
||||
while read a m a; do
|
||||
while read a m a || [ -n "$m" ]; do
|
||||
[ "$m" = "$1" ] && return 0
|
||||
done < /proc/mounts
|
||||
return 1
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
if getargbool 0 rd.convertfs; then
|
||||
if getargbool 0 rd.debug; then
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
PATH=/usr/sbin:/usr/bin:/sbin:/bin
|
||||
|
||||
@@ -45,7 +43,13 @@ setup_interface() {
|
||||
valid_lft ${lease_time} preferred_lft ${lease_time} \
|
||||
dev $netif
|
||||
|
||||
[ -n "$gw" ] && echo ip route add default via $gw dev $netif > /tmp/net.$netif.gw
|
||||
if [ -n "$gw" ] ; then
|
||||
if [ "$mask" == "255.255.255.255" ] ; then
|
||||
# point-to-point connection => set explicit route to gateway
|
||||
echo ip route add $gw dev $netif > /tmp/net.$netif.gw
|
||||
fi
|
||||
echo ip route replace default via $gw dev $netif >> /tmp/net.$netif.gw
|
||||
fi
|
||||
|
||||
[ -n "${search}${domain}" ] && echo "search $search $domain" > /tmp/net.$netif.resolv.conf
|
||||
if [ -n "$namesrv" ] ; then
|
||||
@@ -64,13 +68,17 @@ setup_interface6() {
|
||||
search=$(printf -- "$new_domain_search")
|
||||
namesrv=$new_domain_name_servers
|
||||
hostname=$new_host_name
|
||||
lease_time=$new_dhcp_lease_time
|
||||
[ -n "$new_dhcp_lease_time" ] && lease_time=$new_dhcp_lease_time
|
||||
[ -n "$new_max_life" ] && lease_time=$new_max_life
|
||||
preferred_lft=$lease_time
|
||||
[ -n "$new_preferred_life" ] && preferred_lft=$new_preferred_life
|
||||
|
||||
[ -f /tmp/net.$netif.override ] && . /tmp/net.$netif.override
|
||||
|
||||
ip -6 addr add ${new_ip6_address}/${new_ip6_prefixlen} \
|
||||
dev ${netif} scope global valid_lft ${lease_time} \
|
||||
preferred_lft ${lease_time}
|
||||
dev ${netif} scope global \
|
||||
${lease_time:+valid_lft $lease_time} \
|
||||
${preferred_lft:+preferred_lft ${preferred_lft}}
|
||||
|
||||
[ -n "${search}${domain}" ] && echo "search $search $domain" > /tmp/net.$netif.resolv.conf
|
||||
if [ -n "$namesrv" ] ; then
|
||||
@@ -91,8 +99,9 @@ case $reason in
|
||||
;;
|
||||
|
||||
PREINIT6)
|
||||
echo "dhcp: PREINIT $netif up"
|
||||
echo "dhcp: PREINIT6 $netif up"
|
||||
linkup $netif
|
||||
wait_for_ipv6_dad $netif
|
||||
;;
|
||||
|
||||
BOUND)
|
||||
@@ -109,7 +118,7 @@ case $reason in
|
||||
fi
|
||||
unset layer2
|
||||
setup_interface
|
||||
set | while read line; do
|
||||
set | while read line || [ -n "$line" ]; do
|
||||
[ "${line#new_}" = "$line" ] && continue
|
||||
echo "$line"
|
||||
done >/tmp/dhclient.$netif.dhcpopts
|
||||
@@ -130,7 +139,7 @@ case $reason in
|
||||
echo "dhcp: BOND6 setting $netif"
|
||||
setup_interface6
|
||||
|
||||
set | while read line; do
|
||||
set | while read line || [ -n "$line" ]; do
|
||||
[ "${line#new_}" = "$line" ] && continue
|
||||
echo "$line"
|
||||
done >/tmp/dhclient.$netif.dhcpopts
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
# This script is sourced, so root should be set. But let's be paranoid
|
||||
[ -z "$root" ] && root=$(getarg root=)
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
# if there are no ifname parameters, just use NAME=KERNEL
|
||||
if ! getarg ifname= >/dev/null ; then
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
#
|
||||
# We don't need to check for ip= errors here, that is handled by the
|
||||
# cmdline parser script
|
||||
@@ -60,7 +58,7 @@ fi
|
||||
# bridge this interface?
|
||||
if [ -e /tmp/bridge.info ]; then
|
||||
. /tmp/bridge.info
|
||||
for ethname in $ethnames ; do
|
||||
for ethname in $bridgeslaves ; do
|
||||
if [ "$netif" = "$ethname" ]; then
|
||||
if [ "$netif" = "$bondname" ] && [ -n "$DO_BOND_SETUP" ] ; then
|
||||
: # We need to really setup bond (recursive call)
|
||||
@@ -106,6 +104,7 @@ do_dhcp() {
|
||||
}
|
||||
|
||||
load_ipv6() {
|
||||
[ -d /proc/sys/net/ipv6 ] && return
|
||||
modprobe ipv6
|
||||
i=0
|
||||
while [ ! -d /proc/sys/net/ipv6 ]; do
|
||||
@@ -130,12 +129,12 @@ do_ipv6auto() {
|
||||
|
||||
# Handle static ip configuration
|
||||
do_static() {
|
||||
strstr $ip '*:*:*' && load_ipv6
|
||||
strglobin $ip '*:*:*' && load_ipv6
|
||||
|
||||
linkup $netif
|
||||
[ -n "$macaddr" ] && ip link set address $macaddr dev $netif
|
||||
[ -n "$mtu" ] && ip link set mtu $mtu dev $netif
|
||||
if strstr $ip '*:*:*'; then
|
||||
if strglobin $ip '*:*:*'; then
|
||||
# note no ip addr flush for ipv6
|
||||
ip addr add $ip/$mask ${srv:+peer $srv} dev $netif
|
||||
wait_for_ipv6_dad $netif
|
||||
@@ -144,7 +143,7 @@ do_static() {
|
||||
ip addr add $ip/$mask ${srv:+peer $srv} brd + dev $netif
|
||||
fi
|
||||
|
||||
[ -n "$gw" ] && echo ip route add default via $gw dev $netif > /tmp/net.$netif.gw
|
||||
[ -n "$gw" ] && echo ip route replace default via $gw dev $netif > /tmp/net.$netif.gw
|
||||
[ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
|
||||
|
||||
return 0
|
||||
@@ -188,6 +187,7 @@ if [ -e /tmp/bond.${netif}.info ]; then
|
||||
|
||||
for slave in $bondslaves ; do
|
||||
ip link set $slave down
|
||||
cat /sys/class/net/$slave/address > /tmp/net.${netif}.${slave}.hwaddr
|
||||
echo "+$slave" > /sys/class/net/$bondname/bonding/slaves
|
||||
linkup $slave
|
||||
done
|
||||
@@ -216,7 +216,7 @@ if [ -e /tmp/team.info ]; then
|
||||
fi
|
||||
done
|
||||
# Do not add slaves now
|
||||
teamd -d -U -n -t $teammaster -f /etc/teamd/$teammaster.conf
|
||||
teamd -d -U -n -N -t $teammaster -f /etc/teamd/$teammaster.conf
|
||||
for slave in $working_slaves; do
|
||||
# team requires the slaves to be down before joining team
|
||||
ip link set $slave down
|
||||
@@ -234,7 +234,7 @@ if [ -e /tmp/bridge.info ]; then
|
||||
if [ "$netif" = "$bridgename" ] && [ ! -e /tmp/net.$bridgename.up ]; then
|
||||
brctl addbr $bridgename
|
||||
brctl setfd $bridgename 0
|
||||
for ethname in $ethnames ; do
|
||||
for ethname in $bridgeslaves ; do
|
||||
if [ "$ethname" = "$bondname" ] ; then
|
||||
DO_BOND_SETUP=yes ifup $bondname -m
|
||||
elif [ "$ethname" = "$teammaster" ] ; then
|
||||
@@ -324,17 +324,19 @@ for p in $(getargs ip=); do
|
||||
eval '[ "$'$i'" ] && echo '$i'="$'$i'"'
|
||||
done > /tmp/net.$netif.override
|
||||
|
||||
case $autoconf in
|
||||
dhcp|on|any)
|
||||
do_dhcp -4 ;;
|
||||
dhcp6)
|
||||
load_ipv6
|
||||
do_dhcp -6 ;;
|
||||
auto6)
|
||||
do_ipv6auto ;;
|
||||
*)
|
||||
do_static ;;
|
||||
esac
|
||||
for autoopt in $(str_replace "$autoconf" "," " "); do
|
||||
case $autoopt in
|
||||
dhcp|on|any)
|
||||
do_dhcp -4 ;;
|
||||
dhcp6)
|
||||
load_ipv6
|
||||
do_dhcp -6 ;;
|
||||
auto6)
|
||||
do_ipv6auto ;;
|
||||
*)
|
||||
do_static ;;
|
||||
esac
|
||||
done
|
||||
|
||||
> /tmp/net.${netif}.up
|
||||
|
||||
@@ -364,7 +366,12 @@ fi
|
||||
|
||||
# no ip option directed at our interface?
|
||||
if [ ! -e /tmp/net.${netif}.up ]; then
|
||||
do_dhcp -4
|
||||
if getargs 'ip=dhcp6'; then
|
||||
load_ipv6
|
||||
do_dhcp -6
|
||||
else
|
||||
do_dhcp -4
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
for f in /tmp/dhclient.*.pid; do
|
||||
[ -e $f ] || continue
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
@@ -13,60 +11,13 @@ check() {
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
echo "kernel-network-modules"
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
# Include wired net drivers, excluding wireless
|
||||
|
||||
net_module_filter() {
|
||||
local _net_drivers='eth_type_trans|register_virtio_device|usbnet_open'
|
||||
local _unwanted_drivers='/(wireless|isdn|uwb|net/ethernet|net/phy|net/team)/'
|
||||
local _ret
|
||||
# subfunctions inherit following FDs
|
||||
local _merge=8 _side2=9
|
||||
function nmf1() {
|
||||
local _fname _fcont
|
||||
while read _fname; do
|
||||
[[ $_fname =~ $_unwanted_drivers ]] && continue
|
||||
case "$_fname" in
|
||||
*.ko) _fcont="$(< $_fname)" ;;
|
||||
*.ko.gz) _fcont="$(gzip -dc $_fname)" ;;
|
||||
*.ko.xz) _fcont="$(xz -dc $_fname)" ;;
|
||||
esac
|
||||
[[ $_fcont =~ $_net_drivers
|
||||
&& ! $_fcont =~ iw_handler_get_spy ]] \
|
||||
&& echo "$_fname"
|
||||
done
|
||||
return 0
|
||||
}
|
||||
function rotor() {
|
||||
local _f1 _f2
|
||||
while read _f1; do
|
||||
echo "$_f1"
|
||||
if read _f2; then
|
||||
echo "$_f2" 1>&${_side2}
|
||||
fi
|
||||
done | nmf1 1>&${_merge}
|
||||
return 0
|
||||
}
|
||||
# Use two parallel streams to filter alternating modules.
|
||||
set +x
|
||||
eval "( ( rotor ) ${_side2}>&1 | nmf1 ) ${_merge}>&1"
|
||||
[[ $debug ]] && set -x
|
||||
return 0
|
||||
}
|
||||
|
||||
{ find_kernel_modules_by_path drivers/net; if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then find_kernel_modules_by_path drivers/s390/net; fi; } \
|
||||
| net_module_filter | instmods
|
||||
|
||||
#instmods() will take care of hostonly
|
||||
instmods \
|
||||
=drivers/net/phy \
|
||||
=drivers/net/team \
|
||||
=drivers/net/ethernet \
|
||||
ecb arc4 bridge stp llc ipv6 bonding 8021q af_packet virtio_net
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
@@ -81,7 +32,8 @@ install() {
|
||||
inst_script "$moddir/netroot.sh" "/sbin/netroot"
|
||||
inst_script "$moddir/dhclient-script.sh" "/sbin/dhclient-script"
|
||||
inst_simple "$moddir/net-lib.sh" "/lib/net-lib.sh"
|
||||
inst_simple "$moddir/dhclient.conf" "/etc/dhclient.conf"
|
||||
inst_simple -H "/etc/dhclient.conf"
|
||||
cat "$moddir/dhclient.conf" >> "${initdir}/etc/dhclient.conf"
|
||||
inst_hook pre-udev 50 "$moddir/ifname-genrules.sh"
|
||||
inst_hook pre-udev 60 "$moddir/net-genrules.sh"
|
||||
inst_hook cmdline 91 "$moddir/dhcp-root.sh"
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
getargbool 0 rd.neednet && NEEDNET=1
|
||||
|
||||
@@ -16,7 +14,7 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
|
||||
# bridge: attempt only the defined interface
|
||||
if [ -e /tmp/bridge.info ]; then
|
||||
. /tmp/bridge.info
|
||||
IFACES="$IFACES ${ethnames%% *}"
|
||||
IFACES="$IFACES ${bridgeslaves%% *}"
|
||||
MASTER_IFACES="$MASTER_IFACES $bridgename"
|
||||
fi
|
||||
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
get_ip() {
|
||||
local iface="$1" ip=""
|
||||
@@ -89,19 +87,34 @@ ifdown() {
|
||||
|
||||
setup_net() {
|
||||
local netif="$1" f="" gw_ip="" netroot_ip="" iface="" IFACES=""
|
||||
local _p
|
||||
[ -e /tmp/net.$netif.did-setup ] && return
|
||||
[ -e /sys/class/net/$netif/address ] && \
|
||||
[ -e /tmp/net.$(cat /sys/class/net/$netif/address).did-setup ] && return
|
||||
[ -e "/tmp/net.ifaces" ] && read IFACES < /tmp/net.ifaces
|
||||
[ -z "$IFACES" ] && IFACES="$netif"
|
||||
# run the scripts written by ifup
|
||||
[ -e /tmp/net.$netif.gw ] && . /tmp/net.$netif.gw
|
||||
[ -e /tmp/net.$netif.hostname ] && . /tmp/net.$netif.hostname
|
||||
[ -e /tmp/net.$netif.override ] && . /tmp/net.$netif.override
|
||||
[ -e /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts
|
||||
# set up resolv.conf
|
||||
[ -e /tmp/net.$netif.resolv.conf ] && \
|
||||
cp -f /tmp/net.$netif.resolv.conf /etc/resolv.conf
|
||||
[ -e /tmp/net.$netif.gw ] && . /tmp/net.$netif.gw
|
||||
|
||||
# add static route
|
||||
for _p in $(getargs rd.route); do
|
||||
route_to_var "$_p" || continue
|
||||
[ -n "$route_dev" ] && [ "$route_dev" != "$netif" ] && continue
|
||||
ip route add "$route_mask" ${route_gw:+via "$route_gw"} ${route_dev:+dev "$route_dev"}
|
||||
if strstr ":" "$route_mask"; then
|
||||
printf -- "%s\n" "$route_mask ${route_gw:+via $route_gw} ${route_dev:+dev $route_dev}" \
|
||||
> /tmp/net.route6."$netif"
|
||||
else
|
||||
printf -- "%s\n" "$route_mask ${route_gw:+via $route_gw} ${route_dev:+dev $route_dev}" \
|
||||
> /tmp/net.route."$netif"
|
||||
fi
|
||||
done
|
||||
|
||||
# Handle STP Timeout: arping the default gateway.
|
||||
# (or the root server, if a) it's local or b) there's no gateway.)
|
||||
@@ -228,20 +241,25 @@ ibft_to_cmdline() {
|
||||
fi
|
||||
|
||||
if [ -e ${iface}/vlan ]; then
|
||||
vlan=$(read a < ${iface}/vlan; echo $a)
|
||||
if [ "$vlan" -ne "0" ]; then
|
||||
case "$vlan" in
|
||||
[0-9]*)
|
||||
echo "vlan=$dev.$vlan:$dev"
|
||||
;;
|
||||
*)
|
||||
echo "vlan=$vlan:$dev"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
vlan=$(read a < ${iface}/vlan; echo $a)
|
||||
if [ "$vlan" -ne "0" ]; then
|
||||
case "$vlan" in
|
||||
[0-9]*)
|
||||
echo "vlan=$dev.$vlan:$dev"
|
||||
echo $mac > /tmp/net.${dev}.${vlan}.has_ibft_config
|
||||
;;
|
||||
*)
|
||||
echo "vlan=$vlan:$dev"
|
||||
echo $mac > /tmp/net.${vlan}.has_ibft_config
|
||||
;;
|
||||
esac
|
||||
else
|
||||
echo $mac > /tmp/net.${dev}.has_ibft_config
|
||||
fi
|
||||
else
|
||||
echo $mac > /tmp/net.${dev}.has_ibft_config
|
||||
fi
|
||||
|
||||
echo $mac > /tmp/net.${dev}.has_ibft_config
|
||||
done
|
||||
) >> /etc/cmdline.d/40-ibft.conf
|
||||
}
|
||||
@@ -251,66 +269,63 @@ parse_iscsi_root()
|
||||
local v
|
||||
v=${1#iscsi:}
|
||||
|
||||
# extract authentication info
|
||||
# extract authentication info
|
||||
case "$v" in
|
||||
*@*:*:*:*:*)
|
||||
authinfo=${v%%@*}
|
||||
v=${v#*@}
|
||||
# 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
|
||||
OLDIFS="$IFS"
|
||||
IFS=:
|
||||
set $authinfo
|
||||
IFS="$OLDIFS"
|
||||
if [ $# -gt 4 ]; then
|
||||
warn "Wrong authentication info in iscsi: parameter!"
|
||||
return 1
|
||||
fi
|
||||
iscsi_username=$1
|
||||
iscsi_password=$2
|
||||
if [ $# -gt 2 ]; then
|
||||
iscsi_in_username=$3
|
||||
iscsi_in_password=$4
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
*@*:*:*:*:*)
|
||||
authinfo=${v%%@*}
|
||||
v=${v#*@}
|
||||
# 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
|
||||
OLDIFS="$IFS"
|
||||
IFS=:
|
||||
set $authinfo
|
||||
IFS="$OLDIFS"
|
||||
if [ $# -gt 4 ]; then
|
||||
warn "Wrong authentication info in iscsi: parameter!"
|
||||
return 1
|
||||
fi
|
||||
iscsi_username=$1
|
||||
iscsi_password=$2
|
||||
if [ $# -gt 2 ]; then
|
||||
iscsi_in_username=$3
|
||||
iscsi_in_password=$4
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# extract target ip
|
||||
# extract target ip
|
||||
case "$v" in
|
||||
[[]*[]]:*)
|
||||
iscsi_target_ip=${v#[[]}
|
||||
iscsi_target_ip=${iscsi_target_ip%%[]]*}
|
||||
v=${v#[[]$iscsi_target_ip[]]:}
|
||||
;;
|
||||
*)
|
||||
iscsi_target_ip=${v%%[:]*}
|
||||
v=${v#$iscsi_target_ip:}
|
||||
;;
|
||||
[[]*[]]:*)
|
||||
iscsi_target_ip=${v#[[]}
|
||||
iscsi_target_ip=${iscsi_target_ip%%[]]*}
|
||||
v=${v#[[]$iscsi_target_ip[]]:}
|
||||
;;
|
||||
*)
|
||||
iscsi_target_ip=${v%%[:]*}
|
||||
v=${v#$iscsi_target_ip:}
|
||||
;;
|
||||
esac
|
||||
|
||||
# extract target name
|
||||
unset iscsi_target_name
|
||||
# extract target name
|
||||
case "$v" in
|
||||
*:iqn.*)
|
||||
iscsi_target_name=iqn.${v##*:iqn.}
|
||||
v=${v%:iqn.*}:
|
||||
;;
|
||||
*:eui.*)
|
||||
iscsi_target_name=iqn.${v##*:eui.}
|
||||
v=${v%:iqn.*}:
|
||||
;;
|
||||
*:naa.*)
|
||||
iscsi_target_name=iqn.${v##*:naa.}
|
||||
v=${v%:iqn.*}:
|
||||
;;
|
||||
*)
|
||||
warn "Invalid iscii target name, should begin with 'iqn.' or 'eui.' or 'naa.'"
|
||||
return 1
|
||||
;;
|
||||
*:iqn.*)
|
||||
iscsi_target_name=iqn.${v##*:iqn.}
|
||||
v=${v%:iqn.*}:
|
||||
;;
|
||||
*:eui.*)
|
||||
iscsi_target_name=eui.${v##*:eui.}
|
||||
v=${v%:eui.*}:
|
||||
;;
|
||||
*:naa.*)
|
||||
iscsi_target_name=naa.${v##*:naa.}
|
||||
v=${v%:naa.*}:
|
||||
;;
|
||||
esac
|
||||
|
||||
# parse the rest
|
||||
# parse the rest
|
||||
OLDIFS="$IFS"
|
||||
IFS=:
|
||||
set $v
|
||||
@@ -318,17 +333,34 @@ parse_iscsi_root()
|
||||
|
||||
iscsi_protocol=$1; shift # ignored
|
||||
iscsi_target_port=$1; shift
|
||||
if [ $# -eq 3 ]; then
|
||||
iscsi_iface_name=$1; shift
|
||||
|
||||
if [ -n "$iscsi_target_name" ]; then
|
||||
if [ $# -eq 3 ]; then
|
||||
iscsi_iface_name=$1; shift
|
||||
fi
|
||||
if [ $# -eq 2 ]; then
|
||||
iscsi_netdev_name=$1; shift
|
||||
fi
|
||||
iscsi_lun=$1; shift
|
||||
if [ $# -ne 0 ]; then
|
||||
warn "Invalid parameter in iscsi: parameter!"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
if [ $# -eq 2 ]; then
|
||||
iscsi_netdev_name=$1; shift
|
||||
|
||||
|
||||
if [ $# -gt 3 ] && [ -n "$1$2" ]; then
|
||||
if [ -z "$3" ] || [ "$3" -ge 0 ] 2>/dev/null ; then
|
||||
iscsi_iface_name=$1; shift
|
||||
iscsi_netdev_name=$1; shift
|
||||
fi
|
||||
fi
|
||||
|
||||
iscsi_lun=$1; shift
|
||||
if [ $# -ne 0 ]; then
|
||||
warn "Invalid parameter in iscsi: parameter!"
|
||||
return 1
|
||||
fi
|
||||
|
||||
iscsi_target_name=$(printf "%s:" "$@")
|
||||
iscsi_target_name=${iscsi_target_name%:}
|
||||
}
|
||||
|
||||
ip_to_var() {
|
||||
@@ -369,7 +401,7 @@ ip_to_var() {
|
||||
if [ -n "${9}" -a -n "${10}" -a -n "${11}" -a -n "${12}" -a -n "${13}" -a -n "${14}" ]; then
|
||||
macaddr="${9}:${10}:${11}:${12}:${13}:${14}"
|
||||
fi
|
||||
;;
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
@@ -377,7 +409,7 @@ ip_to_var() {
|
||||
# ip=<ipv4-address> means anaconda-style static config argument cluster:
|
||||
# ip=<ip> gateway=<gw> netmask=<nm> hostname=<host> mtu=<mtu>
|
||||
# ksdevice={link|bootif|ibft|<MAC>|<ifname>}
|
||||
if strstr "$autoconf" "*.*.*.*"; then
|
||||
if strglob "$autoconf" "*.*.*.*"; then
|
||||
ip="$autoconf"
|
||||
gw=$(getarg gateway=)
|
||||
mask=$(getarg netmask=)
|
||||
@@ -395,6 +427,33 @@ ip_to_var() {
|
||||
fi
|
||||
}
|
||||
|
||||
route_to_var() {
|
||||
local v=${1}:
|
||||
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
|
||||
|
||||
unset route_mask route_gw route_dev
|
||||
case $# in
|
||||
2) [ -n "$1" ] && route_mask="$1"; [ -n "$2" ] && route_gw="$2"
|
||||
return 0;;
|
||||
3) [ -n "$1" ] && route_mask="$1"; [ -n "$2" ] && route_gw="$2"; [ -n "$3" ] && route_dev="$3"
|
||||
return 0;;
|
||||
*) return 1;;
|
||||
esac
|
||||
}
|
||||
|
||||
parse_ifname_opts() {
|
||||
local IFS=:
|
||||
set $1
|
||||
@@ -461,7 +520,7 @@ wait_for_ipv6_dad() {
|
||||
local cnt=0
|
||||
local li
|
||||
while [ $cnt -lt 500 ]; do
|
||||
li=$(ip -6 addr show dev $1)
|
||||
li=$(ip -6 addr show dev $1 scope link)
|
||||
strstr "$li" "tentative" || return 0
|
||||
sleep 0.1
|
||||
cnt=$(($cnt+1))
|
||||
@@ -490,18 +549,23 @@ linkup() {
|
||||
}
|
||||
|
||||
type hostname >/dev/null 2>&1 || \
|
||||
hostname() {
|
||||
cat /proc/sys/kernel/hostname
|
||||
hostname() {
|
||||
cat /proc/sys/kernel/hostname
|
||||
}
|
||||
|
||||
iface_has_link() {
|
||||
local cnt=0
|
||||
local interface="$1" flags=""
|
||||
[ -n "$interface" ] || return 2
|
||||
interface="/sys/class/net/$interface"
|
||||
[ -d "$interface" ] || return 2
|
||||
linkup "$1"
|
||||
[ "$(cat $interface/carrier)" = 1 ] || return 1
|
||||
# XXX Do we need to reset the flags here? anaconda never bothered..
|
||||
while [ $cnt -lt 50 ]; do
|
||||
[ "$(cat $interface/carrier)" = 1 ] && return 0
|
||||
sleep 0.1
|
||||
cnt=$(($cnt+1))
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
find_iface_with_link() {
|
||||
@@ -516,3 +580,69 @@ find_iface_with_link() {
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
is_persistent_ethernet_name() {
|
||||
local _netif="$1"
|
||||
local _name_assign_type="0"
|
||||
|
||||
[ -f "/sys/class/net/$_netif/name_assign_type" ] \
|
||||
&& _name_assign_type=$(cat "/sys/class/net/$_netif/name_assign_type")
|
||||
|
||||
# NET_NAME_ENUM 1
|
||||
[ "$_name_assign_type" = "1" ] && return 1
|
||||
|
||||
# NET_NAME_PREDICTABLE 2
|
||||
[ "$_name_assign_type" = "2" ] && return 0
|
||||
|
||||
case "$_netif" in
|
||||
# udev persistent interface names
|
||||
eno[0-9]|eno[0-9][0-9]|eno[0-9][0-9][0-9]*)
|
||||
;;
|
||||
ens[0-9]|ens[0-9][0-9]|ens[0-9][0-9][0-9]*)
|
||||
;;
|
||||
enp[0-9]s[0-9]*|enp[0-9][0-9]s[0-9]*|enp[0-9][0-9][0-9]*s[0-9]*)
|
||||
;;
|
||||
enP*p[0-9]s[0-9]*|enP*p[0-9][0-9]s[0-9]*|enP*p[0-9][0-9][0-9]*s[0-9]*)
|
||||
;;
|
||||
# biosdevname
|
||||
em[0-9]|em[0-9][0-9]|em[0-9][0-9][0-9]*)
|
||||
;;
|
||||
p[0-9]p[0-9]*|p[0-9][0-9]p[0-9]*|p[0-9][0-9][0-9]*p[0-9]*)
|
||||
;;
|
||||
*)
|
||||
return 1
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
|
||||
is_kernel_ethernet_name() {
|
||||
local _netif="$1"
|
||||
local _name_assign_type="1"
|
||||
|
||||
if [ -e "/sys/class/net/$_netif/name_assign_type" ]; then
|
||||
_name_assign_type=$(cat "/sys/class/net/$_netif/name_assign_type")
|
||||
|
||||
case "$_name_assign_type" in
|
||||
2|3|4)
|
||||
# NET_NAME_PREDICTABLE 2
|
||||
# NET_NAME_USER 3
|
||||
# NET_NAME_RENAMED 4
|
||||
return 1
|
||||
;;
|
||||
1|*)
|
||||
# NET_NAME_ENUM 1
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# fallback to error prone manual name check
|
||||
case "$_netif" in
|
||||
eth[0-9]|eth[0-9][0-9]|eth[0-9][0-9][0-9]*)
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
return 1
|
||||
esac
|
||||
|
||||
}
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
PATH=/usr/sbin:/usr/bin:/sbin:/bin
|
||||
command -v getarg >/dev/null || . /lib/dracut-lib.sh
|
||||
|
@@ -1,11 +1,9 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
#
|
||||
# Format:
|
||||
# bridge=<bridgename>:<ethnames>
|
||||
# bridge=<bridgename>:<bridgeslaves>
|
||||
#
|
||||
# <ethnames> is a comma-separated list of physical (ethernet) interfaces
|
||||
# <bridgeslaves> is a comma-separated list of physical (ethernet) interfaces
|
||||
# bridge without parameters assumes bridge=br0:eth0
|
||||
#
|
||||
|
||||
@@ -25,20 +23,20 @@ parsebridge() {
|
||||
v=${v#*:}
|
||||
done
|
||||
|
||||
unset bridgename ethnames
|
||||
unset bridgename bridgeslaves
|
||||
case $# in
|
||||
0) bridgename=br0; ethnames=$iface ;;
|
||||
0) bridgename=br0; bridgeslaves=$iface ;;
|
||||
1) die "bridge= requires two parameters" ;;
|
||||
2) bridgename=$1; ethnames=$(str_replace "$2" "," " ") ;;
|
||||
2) bridgename=$1; bridgeslaves=$(str_replace "$2" "," " ") ;;
|
||||
*) die "bridge= requires two parameters" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
unset bridgename ethnames
|
||||
unset bridgename bridgeslaves
|
||||
|
||||
iface=eth0
|
||||
|
||||
# Parse bridge for bridgename and ethnames
|
||||
# Parse bridge for bridgename and bridgeslaves
|
||||
if bridge="$(getarg bridge)"; then
|
||||
# Read bridge= parameters if they exist
|
||||
if [ -n "$bridge" ]; then
|
||||
@@ -47,9 +45,9 @@ if bridge="$(getarg bridge)"; then
|
||||
# Simple default bridge
|
||||
if [ -z "$bridgename" ]; then
|
||||
bridgename=br0
|
||||
ethnames=$iface
|
||||
bridgeslaves=$iface
|
||||
fi
|
||||
echo "bridgename=$bridgename" > /tmp/bridge.info
|
||||
echo "ethnames=\"$ethnames\"" >> /tmp/bridge.info
|
||||
echo "bridgeslaves=\"$bridgeslaves\"" >> /tmp/bridge.info
|
||||
return
|
||||
fi
|
||||
|
@@ -1,10 +1,8 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
command -v getarg >/dev/null || . /lib/dracut-lib.sh
|
||||
command -v ibft_to_cmdline >/dev/null || . /lib/net-lib.sh
|
||||
|
||||
# If ibft is requested, read ibft vals and write ip=XXX cmdline args
|
||||
[ "ibft" = "$(getarg ip=)" ] && ibft_to_cmdline
|
||||
|
||||
if getargbool 0 rd.iscsi.ibft -d "ip=ibft"; then
|
||||
ibft_to_cmdline
|
||||
fi
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
#
|
||||
# Format:
|
||||
# ifname=<interface>:<mac>
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
#
|
||||
# Format:
|
||||
# ip=[dhcp|on|any]
|
||||
@@ -25,6 +23,10 @@ fi
|
||||
if [ -z "$NEEDBOOTDEV" ] ; then
|
||||
count=0
|
||||
for p in $(getargs ip=); do
|
||||
case "$p" in
|
||||
ibft)
|
||||
continue;;
|
||||
esac
|
||||
count=$(( $count + 1 ))
|
||||
done
|
||||
[ $count -gt 1 ] && NEEDBOOTDEV=1
|
||||
@@ -62,24 +64,26 @@ for p in $(getargs ip=); do
|
||||
fi
|
||||
|
||||
# Error checking for autoconf in combination with other values
|
||||
case $autoconf in
|
||||
error) die "Error parsing option 'ip=$p'";;
|
||||
bootp|rarp|both) die "Sorry, ip=$autoconf is currenty unsupported";;
|
||||
none|off)
|
||||
[ -z "$ip" ] && \
|
||||
die "For argument 'ip=$p'\nValue '$autoconf' without static configuration does not make sense"
|
||||
[ -z "$mask" ] && \
|
||||
die "Sorry, automatic calculation of netmask is not yet supported"
|
||||
;;
|
||||
auto6);;
|
||||
dhcp|dhcp6|on|any) \
|
||||
[ -n "$NEEDBOOTDEV" ] && [ -z "$dev" ] && \
|
||||
die "Sorry, 'ip=$p' does not make sense for multiple interface configurations"
|
||||
[ -n "$ip" ] && \
|
||||
die "For argument 'ip=$p'\nSorry, setting client-ip does not make sense for '$autoconf'"
|
||||
;;
|
||||
*) die "For argument 'ip=$p'\nSorry, unknown value '$autoconf'";;
|
||||
esac
|
||||
for autoopt in $(str_replace "$autoconf" "," " "); do
|
||||
case $autoopt in
|
||||
error) die "Error parsing option 'ip=$p'";;
|
||||
bootp|rarp|both) die "Sorry, ip=$autoopt is currenty unsupported";;
|
||||
none|off)
|
||||
[ -z "$ip" ] && \
|
||||
die "For argument 'ip=$p'\nValue '$autoopt' without static configuration does not make sense"
|
||||
[ -z "$mask" ] && \
|
||||
die "Sorry, automatic calculation of netmask is not yet supported"
|
||||
;;
|
||||
auto6);;
|
||||
dhcp|dhcp6|on|any) \
|
||||
[ -n "$NEEDBOOTDEV" ] && [ -z "$dev" ] && \
|
||||
die "Sorry, 'ip=$p' does not make sense for multiple interface configurations"
|
||||
[ -n "$ip" ] && \
|
||||
die "For argument 'ip=$p'\nSorry, setting client-ip does not make sense for '$autoopt'"
|
||||
;;
|
||||
*) die "For argument 'ip=$p'\nSorry, unknown value '$autoopt'";;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -n "$dev" ] ; then
|
||||
# We don't like duplicate device configs
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
@@ -10,6 +8,7 @@ check() {
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
echo "network"
|
||||
return 0
|
||||
}
|
||||
|
||||
|
@@ -1,8 +1,8 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
# NFS root might have reached here before /tmp/net.ifaces was written
|
||||
type is_persistent_ethernet_name >/dev/null 2>&1 || . /lib/net-lib.sh
|
||||
|
||||
udevadm settle --timeout=30
|
||||
|
||||
if [ -e /tmp/bridge.info ]; then
|
||||
@@ -22,7 +22,7 @@ get_config_line_by_subchannel()
|
||||
local line
|
||||
|
||||
CHANNELS="$1"
|
||||
while read line; do
|
||||
while read line || [ -n "$line" ]; do
|
||||
if strstr "$line" "$CHANNELS"; then
|
||||
echo $line
|
||||
return 0
|
||||
@@ -80,12 +80,49 @@ print_s390() {
|
||||
return 0
|
||||
}
|
||||
|
||||
hw_bind() {
|
||||
local _netif="$1"
|
||||
local _macaddr="$2"
|
||||
|
||||
[ -n "$_macaddr" ] \
|
||||
&& echo "MACADDR=\"$_macaddr\""
|
||||
|
||||
print_s390 "$_netif" \
|
||||
&& return 0
|
||||
|
||||
[ -n "$_macaddr" ] && return 0
|
||||
|
||||
is_persistent_ethernet_name "$_netif" && return 0
|
||||
|
||||
[ -f "/sys/class/net/$_netif/addr_assign_type" ] \
|
||||
&& [ "$(cat "/sys/class/net/$_netif/addr_assign_type")" != "0" ] \
|
||||
&& return 1
|
||||
|
||||
[ -f "/sys/class/net/$_netif/address" ] \
|
||||
|| return 1
|
||||
|
||||
echo "HWADDR=\"$(cat /sys/class/net/$_netif/address)\""
|
||||
}
|
||||
|
||||
interface_bind() {
|
||||
local _netif="$1"
|
||||
local _macaddr="$2"
|
||||
|
||||
# see, if we can bind it to some hw parms
|
||||
if hw_bind "$_netif" "$_macaddr"; then
|
||||
# only print out DEVICE, if it's user assigned
|
||||
is_kernel_ethernet_name "$_netif" && return 0
|
||||
fi
|
||||
|
||||
echo "DEVICE=\"$_netif\""
|
||||
}
|
||||
|
||||
for netup in /tmp/net.*.did-setup ; do
|
||||
[ -f $netup ] || continue
|
||||
|
||||
netif=${netup%%.did-setup}
|
||||
netif=${netif##*/net.}
|
||||
strstr "$netif" ":*:*:*:*:" && continue
|
||||
strglobin "$netif" ":*:*:*:*:" && continue
|
||||
[ -e /tmp/ifcfg/ifcfg-$netif ] && continue
|
||||
unset bridge
|
||||
unset bond
|
||||
@@ -100,6 +137,8 @@ for netup in /tmp/net.*.did-setup ; do
|
||||
unset macaddr
|
||||
unset slave
|
||||
unset ethname
|
||||
unset vlan
|
||||
|
||||
[ -e /tmp/bond.${netif}.info ] && . /tmp/bond.${netif}.info
|
||||
|
||||
uuid=$(cat /proc/sys/kernel/random/uuid)
|
||||
@@ -112,17 +151,17 @@ for netup in /tmp/net.*.did-setup ; do
|
||||
if [ "$netif" = "$vlanname" ]; then
|
||||
vlan=yes
|
||||
fi
|
||||
[ -e /sys/class/net/$netif/address ] && \
|
||||
cat /sys/class/net/$netif/address > /tmp/net.$netif.hwaddr
|
||||
|
||||
{
|
||||
echo "# Generated by dracut initrd"
|
||||
echo "DEVICE=\"$netif\""
|
||||
echo "NAME=\"$netif\""
|
||||
interface_bind "$netif" "$macaddr"
|
||||
echo "ONBOOT=yes"
|
||||
echo "NETBOOT=yes"
|
||||
echo "UUID=\"$uuid\""
|
||||
strstr "$(ip -6 addr show dev $netif)" 'inet6' && echo "IPV6INIT=yes"
|
||||
if [ -f /tmp/dhclient.$netif.lease ]; then
|
||||
[ -f /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts
|
||||
strstr "$ip" '*:*:*' && echo "IPV6INIT=yes"
|
||||
if [ -f /tmp/net.$netif.has_ibft_config ]; then
|
||||
echo "BOOTPROTO=ibft"
|
||||
else
|
||||
@@ -132,7 +171,7 @@ for netup in /tmp/net.*.did-setup ; do
|
||||
else
|
||||
# If we've booted with static ip= lines, the override file is there
|
||||
[ -e /tmp/net.$netif.override ] && . /tmp/net.$netif.override
|
||||
if strstr "$ip" '*:*:*'; then
|
||||
if strglobin "$ip" '*:*:*'; then
|
||||
echo "IPV6INIT=yes"
|
||||
echo "IPV6_AUTOCONF=no"
|
||||
echo "IPV6ADDR=\"$ip/$mask\""
|
||||
@@ -149,7 +188,7 @@ for netup in /tmp/net.*.did-setup ; do
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if strstr "$gw" '*:*:*'; then
|
||||
if strglobin "$gw" '*:*:*'; then
|
||||
echo "IPV6_DEFAULTGW=\"$gw\""
|
||||
elif [ -n "$gw" ]; then
|
||||
echo "GATEWAY=\"$gw\""
|
||||
@@ -162,12 +201,7 @@ for netup in /tmp/net.*.did-setup ; do
|
||||
if [ -z "$bridge" ] && [ -z "$bond" ] && [ -z "$vlan" ]; then
|
||||
# standard interface
|
||||
{
|
||||
[ -n "$macaddr" ] && echo "MACADDR=\"$macaddr\""
|
||||
if ! print_s390 $netif; then
|
||||
[ -n "$macaddr" ] || echo "HWADDR=\"$(cat /sys/class/net/$netif/address)\""
|
||||
fi
|
||||
echo "TYPE=Ethernet"
|
||||
echo "NAME=\"$netif\""
|
||||
[ -n "$mtu" ] && echo "MTU=\"$mtu\""
|
||||
} >> /tmp/ifcfg/ifcfg-$netif
|
||||
fi
|
||||
@@ -192,17 +226,19 @@ for netup in /tmp/net.*.did-setup ; do
|
||||
|
||||
for slave in $bondslaves ; do
|
||||
# write separate ifcfg file for the raw eth interface
|
||||
{
|
||||
(
|
||||
echo "# Generated by dracut initrd"
|
||||
echo "DEVICE=\"$slave\""
|
||||
echo "NAME=\"$slave\""
|
||||
echo "TYPE=Ethernet"
|
||||
echo "ONBOOT=yes"
|
||||
echo "NETBOOT=yes"
|
||||
echo "HWADDR=\"$(cat /sys/class/net/$slave/address)\""
|
||||
echo "SLAVE=yes"
|
||||
echo "MASTER=\"$netif\""
|
||||
echo "NAME=\"$slave\""
|
||||
} >> /tmp/ifcfg/ifcfg-$slave
|
||||
echo "UUID=\"$(cat /proc/sys/kernel/random/uuid)\""
|
||||
unset macaddr
|
||||
[ -e /tmp/net.$slave.override ] && . /tmp/net.$slave.override
|
||||
interface_bind "$slave" "$macaddr"
|
||||
) >> /tmp/ifcfg/ifcfg-$slave
|
||||
done
|
||||
fi
|
||||
|
||||
@@ -212,50 +248,30 @@ for netup in /tmp/net.*.did-setup ; do
|
||||
echo "TYPE=Bridge"
|
||||
echo "NAME=\"$netif\""
|
||||
} >> /tmp/ifcfg/ifcfg-$netif
|
||||
if [ "$ethname" = "$bondname" ] ; then
|
||||
{
|
||||
echo "# Generated by dracut initrd"
|
||||
echo "DEVICE=\"$bondname\""
|
||||
echo "ONBOOT=yes"
|
||||
echo "NETBOOT=yes"
|
||||
# This variable is an indicator of a bond interface for initscripts
|
||||
echo "BONDING_OPTS=\"$bondoptions\""
|
||||
echo "BRIDGE=\"$netif\""
|
||||
echo "NAME=\"$bondname\""
|
||||
} >> /tmp/ifcfg/ifcfg-$bondname
|
||||
for slave in $bondslaves ; do
|
||||
# write separate ifcfg file for the raw eth interface
|
||||
{
|
||||
echo "# Generated by dracut initrd"
|
||||
echo "DEVICE=\"$slave\""
|
||||
echo "TYPE=Ethernet"
|
||||
echo "ONBOOT=yes"
|
||||
echo "NETBOOT=yes"
|
||||
echo "HWADDR=\"$(cat /sys/class/net/$slave/address)\""
|
||||
echo "SLAVE=yes"
|
||||
echo "MASTER=\"$bondname\""
|
||||
echo "NAME=\"$slave\""
|
||||
} >> /tmp/ifcfg/ifcfg-$slave
|
||||
done
|
||||
else
|
||||
for slave in $bridgeslaves ; do
|
||||
# write separate ifcfg file for the raw eth interface
|
||||
{
|
||||
(
|
||||
echo "# Generated by dracut initrd"
|
||||
echo "DEVICE=\"$ethname\""
|
||||
echo "NAME=\"$slave\""
|
||||
echo "TYPE=Ethernet"
|
||||
echo "ONBOOT=yes"
|
||||
echo "NETBOOT=yes"
|
||||
echo "HWADDR=\"$(cat /sys/class/net/$ethname/address)\""
|
||||
echo "BRIDGE=\"$netif\""
|
||||
echo "NAME=\"$ethname\""
|
||||
} >> /tmp/ifcfg/ifcfg-$ethname
|
||||
fi
|
||||
echo "BRIDGE=\"$bridgename\""
|
||||
echo "UUID=\"$(cat /proc/sys/kernel/random/uuid)\""
|
||||
unset macaddr
|
||||
[ -e /tmp/net.$slave.override ] && . /tmp/net.$slave.override
|
||||
interface_bind "$slave" "$macaddr"
|
||||
) >> /tmp/ifcfg/ifcfg-$slave
|
||||
done
|
||||
fi
|
||||
i=1
|
||||
for ns in $(getargs nameserver); do
|
||||
echo "DNS${i}=\"${ns}\"" >> /tmp/ifcfg/ifcfg-$netif
|
||||
i=$((i+1))
|
||||
done
|
||||
|
||||
[ -f /tmp/net.route6."$netif" ] && cp /tmp/net.route6."$netif" /tmp/ifcfg/route6-"$netif"
|
||||
[ -f /tmp/net.route."$netif" ] && cp /tmp/net.route."$netif" /tmp/ifcfg/route-"$netif"
|
||||
done
|
||||
|
||||
# Pass network opts
|
||||
|
@@ -17,6 +17,7 @@ depends() {
|
||||
install() {
|
||||
local _dir _crt _found _lib
|
||||
inst_simple "$moddir/url-lib.sh" "/lib/url-lib.sh"
|
||||
inst_multiple -o ctorrent
|
||||
inst_multiple curl
|
||||
# also install libs for curl https
|
||||
inst_libdir_file "libnsspem.so*"
|
||||
|
@@ -82,13 +82,45 @@ set_http_header() {
|
||||
echo "header = \"$1: $2\"" >> $CURL_HOME/.curlrc
|
||||
}
|
||||
|
||||
### TORRENT ##########################################################
|
||||
|
||||
ctorrent_args="-E 0 -e 0"
|
||||
|
||||
ctorrent_fetch_url() {
|
||||
local url="$1" outloc="$2"
|
||||
url=${url#*//}
|
||||
torrent_outloc="$outloc.torrent"
|
||||
echo "$url" > /proc/self/fd/0
|
||||
if [ -n "$outloc" ]; then
|
||||
curl $curl_args --output - -- "$url" > "$torrent_outloc" || return $?
|
||||
else
|
||||
local outdir="$(mkuniqdir /tmp torrent_fetch_url)"
|
||||
( cd "$outdir"; curl $curl_args --remote-name "$url" || return $? )
|
||||
torrent_outloc="$outdir/$(ls -A $outdir)"
|
||||
outloc=${torrent_outloc%.*}
|
||||
fi
|
||||
if ! [ -f "$torrent_outloc" ]; then
|
||||
warn "Downloading '$url' failed!"
|
||||
return 253
|
||||
fi
|
||||
ctorrent $ctorrent_args -s $outloc $torrent_outloc >&2
|
||||
if ! [ -f "$outloc" ]; then
|
||||
warn "Torrent download of '$url' failed!"
|
||||
return 253
|
||||
fi
|
||||
if [ -z "$2" ]; then echo "$outloc" ; fi
|
||||
}
|
||||
|
||||
command -v ctorrent >/dev/null \
|
||||
&& add_url_handler ctorrent_fetch_url torrent
|
||||
|
||||
### NFS ##############################################################
|
||||
|
||||
[ -e /lib/nfs-lib.sh ] && . /lib/nfs-lib.sh
|
||||
|
||||
nfs_already_mounted() {
|
||||
local server="$1" path="$2" localdir="" s="" p=""
|
||||
cat /proc/mounts | while read src mnt rest; do
|
||||
cat /proc/mounts | while read src mnt rest || [ -n "$src" ]; do
|
||||
splitsep ":" "$src" s p
|
||||
if [ "$server" = "$s" ]; then
|
||||
if [ "$path" = "$p" ]; then
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
@@ -24,7 +22,7 @@ installkernel() {
|
||||
local _merge=8 _side2=9
|
||||
function nmf1() {
|
||||
local _fname _fcont
|
||||
while read _fname; do
|
||||
while read _fname || [ -n "$_fname" ]; do
|
||||
case "$_fname" in
|
||||
*.ko) _fcont="$(< $_fname)" ;;
|
||||
*.ko.gz) _fcont="$(gzip -dc $_fname)" ;;
|
||||
@@ -37,7 +35,7 @@ installkernel() {
|
||||
}
|
||||
function rotor() {
|
||||
local _f1 _f2
|
||||
while read _f1; do
|
||||
while read _f1 || [ -n "$_f1" ]; do
|
||||
echo "$_f1"
|
||||
if read _f2; then
|
||||
echo "$_f2" 1>&${_side2}
|
||||
@@ -51,14 +49,31 @@ installkernel() {
|
||||
return 0
|
||||
}
|
||||
|
||||
if [[ "$(uname -p)" == arm* ]]; then
|
||||
# arm specific modules needed by drm
|
||||
instmods \
|
||||
"=drivers/gpu/drm/i2c" \
|
||||
"=drivers/gpu/drm/panel" \
|
||||
"=drivers/pwm" \
|
||||
"=drivers/video/backlight" \
|
||||
"=drivers/video/fbdev/omap2/displays-new" \
|
||||
${NULL}
|
||||
fi
|
||||
|
||||
instmods amdkfd hyperv_fb
|
||||
|
||||
for _modname in $(find_kernel_modules_by_path drivers/gpu/drm \
|
||||
| drm_module_filter) ; do
|
||||
# if the hardware is present, include module even if it is not currently loaded,
|
||||
# as we could e.g. be in the installer; nokmsboot boot parameter will disable
|
||||
# loading of the driver if needed
|
||||
if [[ $hostonly ]] && modinfo -F alias $_modname | sed -e 's,\?,\.,g' -e 's,\*,\.\*,g' \
|
||||
| grep -qxf - /sys/bus/pci/devices/*/modalias 2>/dev/null; then
|
||||
| grep -qxf - /sys/bus/{pci/devices,soc/devices/soc?}/*/modalias 2>/dev/null; then
|
||||
hostonly='' instmods $_modname
|
||||
# if radeon.ko is installed, we want amdkfd also
|
||||
if strstr "$_modname" radeon.ko; then
|
||||
hostonly='' instmods amdkfd
|
||||
fi
|
||||
continue
|
||||
fi
|
||||
instmods $_modname
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
CDROOT=0
|
||||
. /lib/gensplash-lib.sh
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
CDROOT=0
|
||||
. /lib/gensplash-lib.sh
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
if getargbool 1 rd.splash -d -n rd_NO_SPLASH; then
|
||||
info "Starting Gentoo Splash"
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
|
@@ -1,11 +1,9 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
[[ "$mount_needs" ]] && return 1
|
||||
require_binaries plymouthd plymouth
|
||||
require_binaries plymouthd plymouth plymouth-set-default-theme
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
@@ -15,12 +13,18 @@ depends() {
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
if grep -q nash /usr/libexec/plymouth/plymouth-populate-initrd \
|
||||
|| [ ! -x /usr/libexec/plymouth/plymouth-populate-initrd ]; then
|
||||
PKGLIBDIR="/usr/lib/plymouth"
|
||||
if type -P dpkg-architecture &>/dev/null; then
|
||||
PKGLIBDIR="/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/plymouth"
|
||||
fi
|
||||
[ -x /usr/libexec/plymouth/plymouth-populate-initrd ] && PKGLIBDIR="/usr/libexec/plymouth"
|
||||
|
||||
if grep -q nash ${PKGLIBDIR}/plymouth-populate-initrd \
|
||||
|| [ ! -x ${PKGLIBDIR}/plymouth-populate-initrd ]; then
|
||||
. "$moddir"/plymouth-populate-initrd.sh
|
||||
else
|
||||
PLYMOUTH_POPULATE_SOURCE_FUNCTIONS="$dracutfunctions" \
|
||||
/usr/libexec/plymouth/plymouth-populate-initrd -t "$initdir"
|
||||
${PKGLIBDIR}/plymouth-populate-initrd -t "$initdir"
|
||||
fi
|
||||
|
||||
inst_hook emergency 50 "$moddir"/plymouth-emergency.sh
|
||||
|
@@ -1,4 +1,3 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
plymouth --hide-splash 2>/dev/null || :
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
if type plymouth >/dev/null 2>&1 && [ -z "$DRACUT_SYSTEMD" ]; then
|
||||
plymouth --newroot=$NEWROOT
|
||||
|
@@ -1,6 +1,5 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
PLYMOUTH_LOGO_FILE="/usr/share/pixmaps/system-logo-white.png"
|
||||
PLYMOUTH_THEME=$(plymouth-set-default-theme)
|
||||
|
||||
@@ -27,7 +26,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 | while read a b c; do echo $b; done;)
|
||||
PLYMOUTH_PLUGIN=$(grep "^ModuleName=" /usr/share/plymouth/themes/default.plymouth | while read a b c || [ -n "$b" ]; do echo $b; done;)
|
||||
inst_libdir_file "plymouth/${PLYMOUTH_PLUGIN}.so"
|
||||
fi
|
||||
else
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
if type plymouthd >/dev/null 2>&1 && [ -z "$DRACUT_SYSTEMD" ]; then
|
||||
if getargbool 1 plymouth.enable && getargbool 1 rd.plymouth -d -n rd_NO_PLYMOUTH; then
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
@@ -9,6 +7,7 @@ mkdir -m 0755 -p /run/initramfs/state/etc/sysconfig/network-scripts
|
||||
function cms_write_config()
|
||||
{
|
||||
. /tmp/cms.conf
|
||||
SUBCHANNELS="$(echo $SUBCHANNELS | sed 'y/ABCDEF/abcdef/')"
|
||||
OLDIFS=$IFS
|
||||
IFS=,
|
||||
read -a subch_array <<< "indexzero,$SUBCHANNELS"
|
||||
@@ -26,7 +25,7 @@ function cms_write_config()
|
||||
|
||||
IFCFGFILE=/run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-$DEVICE
|
||||
|
||||
strstr "$IPADDR" '*:*:*' && ipv6=1
|
||||
strglobin "$IPADDR" '*:*:*' && ipv6=1
|
||||
|
||||
# to please NetworkManager on startup in loader before loader reconfigures net
|
||||
cat > /etc/sysconfig/network << EOF
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
@@ -8,7 +6,7 @@ DEVICE=$1
|
||||
|
||||
. /tmp/cms.conf
|
||||
|
||||
strstr "$IPADDR" '*:*:*' && ipv6=1
|
||||
strglobin "$IPADDR" '*:*:*' && ipv6=1
|
||||
|
||||
if [ "$ipv6" ] && ! str_starts "$IPADDR" "["; then
|
||||
IPADDR="[$IPADDR]"
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
@@ -44,146 +42,147 @@ function dasd_settle() {
|
||||
}
|
||||
|
||||
function dasd_settle_all() {
|
||||
for dasdccw in $(while read line; do echo ${line%%(*}; done < /proc/dasd/devices) ; do
|
||||
for dasdccw in $(while read line || [ -n "$line" ]; do echo "${line%%(*}"; done < /proc/dasd/devices) ; do
|
||||
if ! dasd_settle $dasdccw ; then
|
||||
echo $"Could not access DASD $dasdccw in time"
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
# prints a canonocalized device bus ID for a given devno of any format
|
||||
function canonicalize_devno()
|
||||
{
|
||||
case ${#1} in
|
||||
3) echo "0.0.0${1}" ;;
|
||||
4) echo "0.0.${1}" ;;
|
||||
*) echo "${1}" ;;
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
function canonicalize_devno()
|
||||
{
|
||||
case ${#1} in
|
||||
3) echo "0.0.0${1}" ;;
|
||||
4) echo "0.0.${1}" ;;
|
||||
*) echo "${1}" ;;
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
|
||||
# read file from CMS and write it to /tmp
|
||||
function readcmsfile() # $1=dasdport $2=filename
|
||||
{
|
||||
local dev
|
||||
local numcpus
|
||||
local devname
|
||||
local ret=0
|
||||
if [ $# -ne 2 ]; then return; fi
|
||||
function readcmsfile() # $1=dasdport $2=filename
|
||||
{
|
||||
local dev
|
||||
local numcpus
|
||||
local devname
|
||||
local ret=0
|
||||
if [ $# -ne 2 ]; then return; fi
|
||||
# precondition: udevd created dasda block device node
|
||||
if ! dasd_cio_free -d $1 ; then
|
||||
echo $"DASD $1 could not be cleared from device blacklist"
|
||||
return 1
|
||||
fi
|
||||
if ! dasd_cio_free -d $1 ; then
|
||||
echo $"DASD $1 could not be cleared from device blacklist"
|
||||
return 1
|
||||
fi
|
||||
|
||||
modprobe dasd_mod dasd=$CMSDASD
|
||||
modprobe dasd_eckd_mod
|
||||
udevadm settle
|
||||
modprobe dasd_mod dasd=$CMSDASD
|
||||
modprobe dasd_eckd_mod
|
||||
udevadm settle
|
||||
|
||||
# precondition: dasd_eckd_mod driver incl. dependencies loaded,
|
||||
# dasd_mod must be loaded without setting any DASD online
|
||||
dev=$(canonicalize_devno $1)
|
||||
numcpus=$(
|
||||
while read line; do
|
||||
if strstr "$line" "# processors"; then
|
||||
echo ${line##*:};
|
||||
break;
|
||||
fi;
|
||||
done < /proc/cpuinfo
|
||||
)
|
||||
dev=$(canonicalize_devno $1)
|
||||
numcpus=$(
|
||||
while read line || [ -n "$line" ]; do
|
||||
if strstr "$line" "# processors"; then
|
||||
echo ${line##*:};
|
||||
break;
|
||||
fi;
|
||||
done < /proc/cpuinfo
|
||||
)
|
||||
|
||||
if [ ${numcpus} -eq 1 ]; then
|
||||
echo 1 > /sys/bus/ccw/devices/$dev/online
|
||||
else
|
||||
if ! sysecho /sys/bus/ccw/devices/$dev/online 1; then
|
||||
echo $"DASD $dev could not be set online"
|
||||
return 1
|
||||
fi
|
||||
udevadm settle
|
||||
if ! dasd_settle $dev ; then
|
||||
echo $"Could not access DASD $dev in time"
|
||||
return 1
|
||||
fi
|
||||
if [ ${numcpus} -eq 1 ]; then
|
||||
echo 1 > /sys/bus/ccw/devices/$dev/online
|
||||
else
|
||||
if ! sysecho /sys/bus/ccw/devices/$dev/online 1; then
|
||||
echo $"DASD $dev could not be set online"
|
||||
return 1
|
||||
fi
|
||||
|
||||
udevadm settle
|
||||
|
||||
devname=$(cd /sys/bus/ccw/devices/$dev/block; set -- *; [ -b /dev/$1 ] && echo $1)
|
||||
devname=${devname:-dasda}
|
||||
|
||||
[[ -d /mnt ]] || mkdir /mnt
|
||||
if cmsfs-fuse --to=UTF-8 -a /dev/$devname /mnt; then
|
||||
cat /mnt/$2 > /run/initramfs/$2
|
||||
umount /mnt || umount -l /mnt
|
||||
udevadm settle
|
||||
else
|
||||
echo $"Could not read conf file $2 on CMS DASD $1."
|
||||
ret=1
|
||||
if ! dasd_settle $dev ; then
|
||||
echo $"Could not access DASD $dev in time"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if ! sysecho /sys/bus/ccw/devices/$dev/online 0; then
|
||||
echo $"DASD $dev could not be set offline again"
|
||||
udevadm settle
|
||||
|
||||
devname=$(cd /sys/bus/ccw/devices/$dev/block; set -- *; [ -b /dev/$1 ] && echo $1)
|
||||
devname=${devname:-dasda}
|
||||
|
||||
[[ -d /mnt ]] || mkdir /mnt
|
||||
if cmsfs-fuse --to=UTF-8 -a /dev/$devname /mnt; then
|
||||
cat /mnt/$2 > /run/initramfs/$2
|
||||
umount /mnt || umount -l /mnt
|
||||
udevadm settle
|
||||
else
|
||||
echo $"Could not read conf file $2 on CMS DASD $1."
|
||||
ret=1
|
||||
fi
|
||||
|
||||
if ! sysecho /sys/bus/ccw/devices/$dev/online 0; then
|
||||
echo $"DASD $dev could not be set offline again"
|
||||
#return 1
|
||||
fi
|
||||
udevadm settle
|
||||
fi
|
||||
udevadm settle
|
||||
|
||||
# unbind all dasds to unload the dasd modules for a clean start
|
||||
( cd /sys/bus/ccw/drivers/dasd-eckd; for i in *.*; do echo $i > unbind;done)
|
||||
udevadm settle
|
||||
modprobe -r dasd_eckd_mod
|
||||
udevadm settle
|
||||
modprobe -r dasd_diag_mod
|
||||
udevadm settle
|
||||
modprobe -r dasd_mod
|
||||
udevadm settle
|
||||
return $ret
|
||||
}
|
||||
( cd /sys/bus/ccw/drivers/dasd-eckd; for i in *.*; do echo $i > unbind;done)
|
||||
udevadm settle
|
||||
modprobe -r dasd_eckd_mod
|
||||
udevadm settle
|
||||
modprobe -r dasd_diag_mod
|
||||
udevadm settle
|
||||
modprobe -r dasd_mod
|
||||
udevadm settle
|
||||
return $ret
|
||||
}
|
||||
|
||||
processcmsfile()
|
||||
{
|
||||
source /tmp/cms.conf
|
||||
processcmsfile()
|
||||
{
|
||||
source /tmp/cms.conf
|
||||
SUBCHANNELS="$(echo $SUBCHANNELS | sed 'y/ABCDEF/abcdef/')"
|
||||
|
||||
if [[ $NETTYPE ]]; then
|
||||
(
|
||||
echo -n $NETTYPE,$SUBCHANNELS
|
||||
[[ $PORTNAME ]] && echo -n ",portname=$PORTNAME"
|
||||
[[ $LAYER2 ]] && echo -n ",layer2=$LAYER2"
|
||||
[[ "$NETTYPE" = "ctc" ]] && [[ $CTCPROT ]] && echo -n ",protocol=$CTCPROT"
|
||||
echo
|
||||
) >> /etc/ccw.conf
|
||||
if [[ $NETTYPE ]]; then
|
||||
(
|
||||
echo -n $NETTYPE,$SUBCHANNELS
|
||||
[[ $PORTNAME ]] && echo -n ",portname=$PORTNAME"
|
||||
[[ $LAYER2 ]] && echo -n ",layer2=$LAYER2"
|
||||
[[ "$NETTYPE" = "ctc" ]] && [[ $CTCPROT ]] && echo -n ",protocol=$CTCPROT"
|
||||
echo
|
||||
) >> /etc/ccw.conf
|
||||
|
||||
OLDIFS=$IFS
|
||||
IFS=,
|
||||
read -a subch_array <<< "indexzero,$SUBCHANNELS"
|
||||
IFS=$OLDIFS
|
||||
devbusid=${subch_array[1]}
|
||||
if [ "$NETTYPE" = "ctc" ]; then
|
||||
driver="ctcm"
|
||||
else
|
||||
driver=$NETTYPE
|
||||
fi
|
||||
OLDIFS=$IFS
|
||||
IFS=,
|
||||
read -a subch_array <<< "indexzero,$SUBCHANNELS"
|
||||
IFS=$OLDIFS
|
||||
devbusid=${subch_array[1]}
|
||||
if [ "$NETTYPE" = "ctc" ]; then
|
||||
driver="ctcm"
|
||||
else
|
||||
driver=$NETTYPE
|
||||
fi
|
||||
|
||||
printf 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="%s", KERNELS=="%s", ENV{INTERFACE}=="?*", RUN+="/sbin/initqueue --onetime --unique --name cmsifup-$env{INTERFACE} /sbin/cmsifup $env{INTERFACE}"\n' "$driver" "$devbusid" > /etc/udev/rules.d/99-cms.rules
|
||||
printf 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="%s", KERNELS=="%s", ENV{INTERFACE}=="?*", RUN+="/sbin/initqueue --onetime --unique --name cmsifup-$env{INTERFACE} /sbin/cmsifup $env{INTERFACE}"\n' "$driver" "$devbusid" > /etc/udev/rules.d/99-cms.rules
|
||||
# remove the default net rules
|
||||
rm -f -- /etc/udev/rules.d/91-default-net.rules
|
||||
[[ -f /etc/udev/rules.d/90-net.rules ]] \
|
||||
|| printf 'SUBSYSTEM=="net", ACTION=="online", RUN+="/sbin/initqueue --onetime --env netif=$env{INTERFACE} source_hook initqueue/online"\n' >> /etc/udev/rules.d/99-cms.rules
|
||||
udevadm control --reload
|
||||
znet_cio_free
|
||||
fi
|
||||
rm -f -- /etc/udev/rules.d/91-default-net.rules
|
||||
[[ -f /etc/udev/rules.d/90-net.rules ]] \
|
||||
|| printf 'SUBSYSTEM=="net", ACTION=="online", RUN+="/sbin/initqueue --onetime --env netif=$env{INTERFACE} source_hook initqueue/online"\n' >> /etc/udev/rules.d/99-cms.rules
|
||||
udevadm control --reload
|
||||
znet_cio_free
|
||||
fi
|
||||
|
||||
if [[ $DASD ]]; then
|
||||
echo $DASD | normalize_dasd_arg > /etc/dasd.conf
|
||||
echo "options dasd_mod dasd=$DASD" > /etc/modprobe.d/dasd_mod.conf
|
||||
dasd_cio_free
|
||||
fi
|
||||
if [[ $DASD ]] && [[ $DASD != "none" ]]; then
|
||||
echo $DASD | normalize_dasd_arg > /etc/dasd.conf
|
||||
echo "options dasd_mod dasd=$DASD" > /etc/modprobe.d/dasd_mod.conf
|
||||
dasd_cio_free
|
||||
fi
|
||||
|
||||
unset _do_zfcp
|
||||
for i in ${!FCP_*}; do
|
||||
echo "${!i}" | while read port rest; do
|
||||
case $port in
|
||||
unset _do_zfcp
|
||||
for i in ${!FCP_*}; do
|
||||
echo "${!i}" | while read port rest || [ -n "$port" ]; do
|
||||
case $port in
|
||||
*.*.*)
|
||||
;;
|
||||
*.*)
|
||||
@@ -192,23 +191,23 @@ function dasd_settle_all() {
|
||||
*)
|
||||
port="0.0.$port"
|
||||
;;
|
||||
esac
|
||||
echo $port $rest >> /etc/zfcp.conf
|
||||
done
|
||||
_do_zfcp=1
|
||||
esac
|
||||
echo $port $rest >> /etc/zfcp.conf
|
||||
done
|
||||
[[ $_do_zfcp ]] && zfcp_cio_free
|
||||
unset _do_zfcp
|
||||
}
|
||||
_do_zfcp=1
|
||||
done
|
||||
[[ $_do_zfcp ]] && zfcp_cio_free
|
||||
unset _do_zfcp
|
||||
}
|
||||
|
||||
[[ $CMSDASD ]] || CMSDASD=$(getarg "CMSDASD=")
|
||||
[[ $CMSCONFFILE ]] || CMSCONFFILE=$(getarg "CMSCONFFILE=")
|
||||
[[ $CMSDASD ]] || CMSDASD=$(getarg "CMSDASD=")
|
||||
[[ $CMSCONFFILE ]] || CMSCONFFILE=$(getarg "CMSCONFFILE=")
|
||||
|
||||
# Parse configuration
|
||||
if [ -n "$CMSDASD" -a -n "$CMSCONFFILE" ]; then
|
||||
if readcmsfile $CMSDASD $CMSCONFFILE; then
|
||||
ln -s /run/initramfs/$CMSCONFFILE /tmp/$CMSCONFFILE
|
||||
ln -s /run/initramfs/$CMSCONFFILE /tmp/cms.conf
|
||||
processcmsfile
|
||||
fi
|
||||
if [ -n "$CMSDASD" -a -n "$CMSCONFFILE" ]; then
|
||||
if readcmsfile $CMSDASD $CMSCONFFILE; then
|
||||
ln -s /run/initramfs/$CMSCONFFILE /tmp/$CMSCONFFILE
|
||||
ln -s /run/initramfs/$CMSCONFFILE /tmp/cms.conf
|
||||
processcmsfile
|
||||
fi
|
||||
fi
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
|
@@ -1,6 +1,4 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user