Compare commits
46 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
de50e9c002 | ||
![]() |
868f935e23 | ||
![]() |
4ba662ff90 | ||
![]() |
dc7085ceeb | ||
![]() |
9444bf6161 | ||
![]() |
06ca27cdf5 | ||
![]() |
dd82da4e27 | ||
![]() |
190047f161 | ||
![]() |
748867d177 | ||
![]() |
b806625d41 | ||
![]() |
dba2055979 | ||
![]() |
aa23dcd8ae | ||
![]() |
5bbbfeaf19 | ||
![]() |
9b6c5fd7c7 | ||
![]() |
904a76376f | ||
![]() |
52814c0ee3 | ||
![]() |
d124904f2b | ||
![]() |
7fd850d58e | ||
![]() |
71bb2ecd79 | ||
![]() |
6e0348f33b | ||
![]() |
27458b10ff | ||
![]() |
bf27e473cb | ||
![]() |
549442cc2a | ||
![]() |
98836432c1 | ||
![]() |
d988dc30df | ||
![]() |
c5f8b69ad7 | ||
![]() |
2beee35d5e | ||
![]() |
1ae8b8aa02 | ||
![]() |
8f092d0dda | ||
![]() |
d624f60682 | ||
![]() |
5decf6d813 | ||
![]() |
1a1c80febe | ||
![]() |
7b3ff4e055 | ||
![]() |
56b58c0a94 | ||
![]() |
ad2565c8ff | ||
![]() |
9f3d191fce | ||
![]() |
f17c5fa573 | ||
![]() |
99369bea1c | ||
![]() |
45ef8eb723 | ||
![]() |
bc6eae15ab | ||
![]() |
475f3a8128 | ||
![]() |
6b1e7a6ca4 | ||
![]() |
bbaa0d5917 | ||
![]() |
3c4bfd685a | ||
![]() |
9dde7a66b5 | ||
![]() |
34b56de12a |
7
AUTHORS
7
AUTHORS
@@ -11,9 +11,9 @@ Michal Soltys <soltys@ziu.info>
|
||||
Amerigo Wang <amwang@redhat.com>
|
||||
Colin Guthrie <colin@mageia.org>
|
||||
Andrey Borzenkov <arvidjaar@gmail.com>
|
||||
Peter Jones <pjones@redhat.com>
|
||||
Andreas Thienemann <andreas@bawue.net>
|
||||
Hans de Goede <hdegoede@redhat.com>
|
||||
Peter Jones <pjones@redhat.com>
|
||||
John Reiser <jreiser@bitwagon.com>
|
||||
Luca Berra <bluca@vodka.it>
|
||||
Daniel Drake <dsd@laptop.org>
|
||||
@@ -31,6 +31,7 @@ Milan Broz <mbroz@redhat.com>
|
||||
Roberto Sassu <roberto.sassu@polito.it>
|
||||
Anton Blanchard <anton@samba.org>
|
||||
Bill Nottingham <notting@redhat.com>
|
||||
Colin Walters <walters@verbum.org>
|
||||
David Cantrell <dcantrell@redhat.com>
|
||||
Dennis Gilmore <dennis@ausil.us>
|
||||
Jon Ander Hernandez <jonan.h@gmail.com>
|
||||
@@ -43,7 +44,6 @@ Radek Vykydal <rvykydal@redhat.com>
|
||||
Wim Muskee <wimmuskee@gmail.com>
|
||||
Alan Jenkins <alan-jenkins@tuffmail.co.uk>
|
||||
Alan Pevec <apevec@redhat.com>
|
||||
Colin Walters <walters@verbum.org>
|
||||
Frederick Grose <fgrose@sugarlabs.org>
|
||||
Ian Dall <ian@beware.dropbear.id.au>
|
||||
James Buren <ryuo@frugalware.org>
|
||||
@@ -59,6 +59,7 @@ Adam Williamson <awilliam@redhat.com>
|
||||
Alexander Todorov <atodorov@redhat.com>
|
||||
Andy Lutomirski <luto@mit.edu>
|
||||
Anssi Hannula <anssi@mageia.org>
|
||||
Brandon Philips <brandon@ifup.co>
|
||||
Canek Peláez Valdés <caneko@gmail.com>
|
||||
Chris Leech <cleech@redhat.com>
|
||||
Christian Heinz <christian.ch.heinz@gmail.com>
|
||||
@@ -70,10 +71,12 @@ Duane Griffin <duaneg@dghda.com>
|
||||
Glen Gray <slaine@slaine.org>
|
||||
Hermann Gausterer <git-dracut-2012@mrq1.org>
|
||||
James Laska <jlaska@redhat.com>
|
||||
James Lee <jlee@thestaticvoid.com>
|
||||
Jan Stodola <jstodola@redhat.com>
|
||||
Jiri Pirko <jiri@resnulli.us>
|
||||
Joe Lawrence <Joe.Lawrence@stratus.com>
|
||||
Kevin Yung <Kevin.Yung@myob.com>
|
||||
Kyle McMartin <kyle@redhat.com>
|
||||
Lars R. Damerow <lars@pixar.com>
|
||||
Lennert Buytenhek <buytenh@wantstofly.org>
|
||||
Lubomir Rintel <lkundrak@v3.sk>
|
||||
|
31
NEWS
31
NEWS
@@ -1,3 +1,29 @@
|
||||
dracut-031
|
||||
==========
|
||||
- do not include the resume dracut module in hostonly mode,
|
||||
if no swap is present
|
||||
- don't warn twice about omitted modules
|
||||
- use systemd-cat for logging on systemd systems, if logfile is unset
|
||||
- fixed PARTUUID parsing
|
||||
- support kernel module signing keys
|
||||
- do not install the usrmount dracut module in hostonly mode,
|
||||
if /sbin/init does not live in /usr
|
||||
- add debian udev rule files
|
||||
- add support for bcache
|
||||
- network: handle bootif style interfaces
|
||||
e.g. ip=77-77-6f-6f-64-73:dhcp
|
||||
- add support for kmod static devnodes
|
||||
- add vlan support for iBFT
|
||||
|
||||
Contributions from:
|
||||
Harald Hoyer
|
||||
Amadeusz Żołnowski
|
||||
Brandon Philips
|
||||
Colin Walters
|
||||
James Lee
|
||||
Kyle McMartin
|
||||
Peter Jones
|
||||
|
||||
dracut-030
|
||||
==========
|
||||
- support new persistent network interface names
|
||||
@@ -14,6 +40,11 @@ dracut-030
|
||||
- dmraid, let dmraid setup its own partitions
|
||||
- sosreport renamed to rdsosreport
|
||||
|
||||
Contributions from:
|
||||
Harald Hoyer
|
||||
Konrad Rzeszutek Wilk
|
||||
WANG Chao
|
||||
|
||||
dracut-029
|
||||
==========
|
||||
- wait for IPv6 autoconfiguration
|
||||
|
@@ -283,12 +283,11 @@ get_fs_env() {
|
||||
printf "%s" "${line#ID_FS_TYPE=}";
|
||||
exit 0;
|
||||
fi
|
||||
done; [[ $found ]] && exit 0; exit 1; }) ; then
|
||||
done; [[ $found ]] && exit 0; exit 1; }) ; then
|
||||
if [[ $ID_FS_TYPE ]]; then
|
||||
printf "%s" "$ID_FS_TYPE"
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Fallback, if we don't have udev information
|
||||
@@ -314,9 +313,9 @@ get_fs_env() {
|
||||
# $ get_maj_min /dev/sda2
|
||||
# 8:2
|
||||
get_maj_min() {
|
||||
local _maj _min
|
||||
read _maj _min < <(stat -L -c '%t %T' "$1" 2>/dev/null)
|
||||
printf "%s" "$((0x$_maj)):$((0x$_min))"
|
||||
local _maj _min _majmin
|
||||
_majmin="$(stat -L -c '%t:%T' "$1" 2>/dev/null)"
|
||||
printf "%s" "$((0x${_majmin%:*})):$((0x${_majmin#*:}))"
|
||||
}
|
||||
|
||||
# find_block_device <mountpoint>
|
||||
@@ -334,11 +333,35 @@ find_block_device() {
|
||||
_find_mpt="$1"
|
||||
if [[ $use_fstab != yes ]]; then
|
||||
[[ -d $_find_mpt/. ]]
|
||||
while read _majmin _dev; do
|
||||
if [[ -b $_dev ]]; then
|
||||
if ! [[ $_majmin ]] || [[ $_majmin == 0:* ]]; then
|
||||
read _majmin < <(get_maj_min $_dev)
|
||||
findmnt -e -v -n -o 'MAJ:MIN,SOURCE' --target "$_find_mpt" | { \
|
||||
while read _majmin _dev; do
|
||||
if [[ -b $_dev ]]; then
|
||||
if ! [[ $_majmin ]] || [[ $_majmin == 0:* ]]; then
|
||||
_majmin=$(get_maj_min $_dev)
|
||||
fi
|
||||
if [[ $_majmin ]]; then
|
||||
echo $_majmin
|
||||
else
|
||||
echo $_dev
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
if [[ $_dev = *:* ]]; then
|
||||
echo $_dev
|
||||
return 0
|
||||
fi
|
||||
done; return 1; } && return 0
|
||||
fi
|
||||
# fall back to /etc/fstab
|
||||
|
||||
findmnt -e --fstab -v -n -o 'MAJ:MIN,SOURCE' --target "$_find_mpt" | { \
|
||||
while read _majmin _dev; do
|
||||
if ! [[ $_dev ]]; then
|
||||
_dev="$_majmin"
|
||||
unset _majmin
|
||||
fi
|
||||
if [[ -b $_dev ]]; then
|
||||
[[ $_majmin ]] || _majmin=$(get_maj_min $_dev)
|
||||
if [[ $_majmin ]]; then
|
||||
echo $_majmin
|
||||
else
|
||||
@@ -350,29 +373,7 @@ find_block_device() {
|
||||
echo $_dev
|
||||
return 0
|
||||
fi
|
||||
done < <(findmnt -e -v -n -o 'MAJ:MIN,SOURCE' --target "$_find_mpt")
|
||||
fi
|
||||
# fall back to /etc/fstab
|
||||
|
||||
while read _majmin _dev; do
|
||||
if ! [[ $_dev ]]; then
|
||||
_dev="$_majmin"
|
||||
unset _majmin
|
||||
fi
|
||||
if [[ -b $_dev ]]; then
|
||||
[[ $_majmin ]] || read _majmin < <(get_maj_min $_dev)
|
||||
if [[ $_majmin ]]; then
|
||||
echo $_majmin
|
||||
else
|
||||
echo $_dev
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
if [[ $_dev = *:* ]]; then
|
||||
echo $_dev
|
||||
return 0
|
||||
fi
|
||||
done < <(findmnt -e --fstab -v -n -o 'MAJ:MIN,SOURCE' --target "$_find_mpt")
|
||||
done; return 1; } && return 0
|
||||
|
||||
return 1
|
||||
}
|
||||
@@ -389,20 +390,22 @@ find_mp_fstype() {
|
||||
local _fs
|
||||
|
||||
if [[ $use_fstab != yes ]]; then
|
||||
findmnt -e -v -n -o 'FSTYPE' --target "$1" | { \
|
||||
while read _fs; do
|
||||
[[ $_fs ]] || continue
|
||||
[[ $_fs = "autofs" ]] && continue
|
||||
echo -n $_fs
|
||||
return 0
|
||||
done; return 1; } && return 0
|
||||
fi
|
||||
|
||||
findmnt --fstab -e -v -n -o 'FSTYPE' --target "$1" | { \
|
||||
while read _fs; do
|
||||
[[ $_fs ]] || continue
|
||||
[[ $_fs = "autofs" ]] && continue
|
||||
echo -n $_fs
|
||||
return 0
|
||||
done < <(findmnt -e -v -n -o 'FSTYPE' --target "$1")
|
||||
fi
|
||||
|
||||
while read _fs; do
|
||||
[[ $_fs ]] || continue
|
||||
[[ $_fs = "autofs" ]] && continue
|
||||
echo -n $_fs
|
||||
return 0
|
||||
done < <(findmnt --fstab -e -v -n -o 'FSTYPE' --target "$1")
|
||||
done; return 1; } && return 0
|
||||
|
||||
return 1
|
||||
}
|
||||
@@ -421,20 +424,22 @@ find_dev_fstype() {
|
||||
[[ "$_find_dev" = /dev* ]] || _find_dev="/dev/block/$_find_dev"
|
||||
|
||||
if [[ $use_fstab != yes ]]; then
|
||||
findmnt -e -v -n -o 'FSTYPE' --source "$_find_dev" | { \
|
||||
while read _fs; do
|
||||
[[ $_fs ]] || continue
|
||||
[[ $_fs = "autofs" ]] && continue
|
||||
echo -n $_fs
|
||||
return 0
|
||||
done; return 1; } && return 0
|
||||
fi
|
||||
|
||||
findmnt --fstab -e -v -n -o 'FSTYPE' --source "$_find_dev" | { \
|
||||
while read _fs; do
|
||||
[[ $_fs ]] || continue
|
||||
[[ $_fs = "autofs" ]] && continue
|
||||
echo -n $_fs
|
||||
return 0
|
||||
done < <(findmnt -e -v -n -o 'FSTYPE' --source "$_find_dev")
|
||||
fi
|
||||
|
||||
while read _fs; do
|
||||
[[ $_fs ]] || continue
|
||||
[[ $_fs = "autofs" ]] && continue
|
||||
echo -n $_fs
|
||||
return 0
|
||||
done < <(findmnt --fstab -e -v -n -o 'FSTYPE' --source "$_find_dev")
|
||||
done; return 1; } && return 0
|
||||
|
||||
return 1
|
||||
|
||||
@@ -475,12 +480,12 @@ check_block_and_slaves() {
|
||||
"$1" $2 && return
|
||||
check_vol_slaves "$@" && return 0
|
||||
if [[ -f /sys/dev/block/$2/../dev ]]; then
|
||||
check_block_and_slaves $1 $(cat "/sys/dev/block/$2/../dev") && return 0
|
||||
check_block_and_slaves $1 $(<"/sys/dev/block/$2/../dev") && return 0
|
||||
fi
|
||||
[[ -d /sys/dev/block/$2/slaves ]] || return 1
|
||||
for _x in /sys/dev/block/$2/slaves/*/dev; do
|
||||
[[ -f $_x ]] || continue
|
||||
check_block_and_slaves $1 $(cat "$_x") && return 0
|
||||
check_block_and_slaves $1 $(<"$_x") && return 0
|
||||
done
|
||||
return 1
|
||||
}
|
||||
@@ -489,16 +494,16 @@ check_block_and_slaves_all() {
|
||||
local _x _ret=1
|
||||
[[ -b /dev/block/$2 ]] || return 1 # Not a block device? So sorry.
|
||||
if "$1" $2; then
|
||||
_ret=0
|
||||
_ret=0
|
||||
fi
|
||||
check_vol_slaves "$@" && return 0
|
||||
if [[ -f /sys/dev/block/$2/../dev ]]; then
|
||||
check_block_and_slaves_all $1 $(cat "/sys/dev/block/$2/../dev") && _ret=0
|
||||
check_block_and_slaves_all $1 $(<"/sys/dev/block/$2/../dev") && _ret=0
|
||||
fi
|
||||
[[ -d /sys/dev/block/$2/slaves ]] || return 1
|
||||
for _x in /sys/dev/block/$2/slaves/*/dev; do
|
||||
[[ -f $_x ]] || continue
|
||||
check_block_and_slaves_all $1 $(cat "$_x") && _ret=0
|
||||
check_block_and_slaves_all $1 $(<"$_x") && _ret=0
|
||||
done
|
||||
return $_ret
|
||||
}
|
||||
@@ -516,7 +521,7 @@ for_each_host_dev_and_slaves_all()
|
||||
for _dev in ${host_devs[@]}; do
|
||||
[[ -b "$_dev" ]] || continue
|
||||
if check_block_and_slaves_all $_func $(get_maj_min $_dev); then
|
||||
_ret=0
|
||||
_ret=0
|
||||
fi
|
||||
done
|
||||
return $_ret
|
||||
@@ -1226,7 +1231,7 @@ module_installkernel() {
|
||||
else
|
||||
unset check depends install installkernel
|
||||
installkernel() { true; }
|
||||
. $_moddir/module-setup.sh
|
||||
. $_moddir/module-setup.sh
|
||||
installkernel
|
||||
_ret=$?
|
||||
unset check depends install installkernel
|
||||
@@ -1255,7 +1260,6 @@ check_mount() {
|
||||
[[ $2 ]] || mods_checked_as_dep+=" $_mod "
|
||||
|
||||
if [[ " $omit_dracutmodules " == *\ $_mod\ * ]]; then
|
||||
dinfo "dracut module '$_mod' will not be installed, because it's in the list to be omitted!"
|
||||
return 1
|
||||
fi
|
||||
|
||||
@@ -1406,6 +1410,14 @@ install_kmod_with_fw() {
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $silent_omit_drivers ]]; then
|
||||
local _kmod=${1##*/}
|
||||
_kmod=${_kmod%.ko}
|
||||
_kmod=${_kmod/-/_}
|
||||
[[ "$_kmod" =~ $silent_omit_drivers ]] && return 0
|
||||
[[ "${1##*/lib/modules/$kernel/}" =~ $silent_omit_drivers ]] && return 0
|
||||
fi
|
||||
|
||||
inst_simple "$1" "/lib/modules/$kernel/${1##*/lib/modules/$kernel/}"
|
||||
ret=$?
|
||||
[[ $DRACUT_KERNEL_LAZY_HASHDIR ]] && \
|
||||
@@ -1456,6 +1468,7 @@ for_each_kmod_dep() {
|
||||
|
||||
dracut_kernel_post() {
|
||||
local _moddirname=${srcmods%%/lib/modules/*}
|
||||
local _pid
|
||||
|
||||
if [[ $DRACUT_KERNEL_LAZY_HASHDIR ]] && [[ -f "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist" ]]; then
|
||||
xargs -r modprobe -a ${_moddirname+-d ${_moddirname}/} \
|
||||
@@ -1479,6 +1492,8 @@ dracut_kernel_post() {
|
||||
done < "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist.dep"
|
||||
fi
|
||||
) &
|
||||
_pid=$(jobs -p | while read a ; do printf ":$a";done)
|
||||
_pid=${_pid##*:}
|
||||
|
||||
if [[ $DRACUT_INSTALL ]]; then
|
||||
xargs -r modinfo -k $kernel -F firmware < "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist.dep" \
|
||||
@@ -1498,7 +1513,7 @@ dracut_kernel_post() {
|
||||
done
|
||||
fi
|
||||
|
||||
wait
|
||||
wait $_pid
|
||||
fi
|
||||
|
||||
for _f in modules.builtin.bin modules.builtin; do
|
||||
@@ -1522,7 +1537,7 @@ dracut_kernel_post() {
|
||||
[[ $DRACUT_KERNEL_LAZY_HASHDIR ]] && rm -fr -- "$DRACUT_KERNEL_LAZY_HASHDIR"
|
||||
}
|
||||
|
||||
module_is_host_only() { (
|
||||
module_is_host_only() {
|
||||
local _mod=$1
|
||||
_mod=${_mod##*/}
|
||||
_mod=${_mod%.ko}
|
||||
@@ -1541,7 +1556,6 @@ module_is_host_only() { (
|
||||
modinfo -F filename "$_mod" &>/dev/null || return 0
|
||||
|
||||
return 1
|
||||
)
|
||||
}
|
||||
|
||||
find_kernel_modules_by_path () {
|
||||
@@ -1663,7 +1677,7 @@ 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; do [[ "$line" =~ $_filter_not_found ]] || echo $line;done | derror
|
||||
_ret=$?
|
||||
return $_ret
|
||||
}
|
||||
|
@@ -117,30 +117,38 @@ dlog_init() {
|
||||
if [ -z "$fileloglvl" ]; then
|
||||
[ -w "$logfile" ] && fileloglvl=4 || fileloglvl=0
|
||||
elif (( $fileloglvl > 0 )); then
|
||||
__oldumask=$(umask)
|
||||
umask 0377
|
||||
! [ -e "$logfile" ] && >"$logfile"
|
||||
umask $__oldumask
|
||||
if [ -w "$logfile" -a -f "$logfile" ]; then
|
||||
if [[ $logfile ]]; then
|
||||
__oldumask=$(umask)
|
||||
umask 0377
|
||||
! [ -e "$logfile" ] && >"$logfile"
|
||||
umask $__oldumask
|
||||
if [ -w "$logfile" -a -f "$logfile" ]; then
|
||||
# Mark new run in the log file
|
||||
echo >>"$logfile"
|
||||
if command -v date >/dev/null; then
|
||||
echo "=== $(date) ===" >>"$logfile"
|
||||
echo >>"$logfile"
|
||||
if command -v date >/dev/null; then
|
||||
echo "=== $(date) ===" >>"$logfile"
|
||||
else
|
||||
echo "===============================================" >>"$logfile"
|
||||
fi
|
||||
echo >>"$logfile"
|
||||
else
|
||||
echo "===============================================" >>"$logfile"
|
||||
fi
|
||||
echo >>"$logfile"
|
||||
else
|
||||
# We cannot log to file, so turn this facility off.
|
||||
fileloglvl=0
|
||||
ret=1
|
||||
errmsg="'$logfile' is not a writable file"
|
||||
fileloglvl=0
|
||||
ret=1
|
||||
errmsg="'$logfile' is not a writable file"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if (( $sysloglvl > 0 )); then
|
||||
if ! [ -S /dev/log -a -w /dev/log ] || ! command -v logger >/dev/null
|
||||
then
|
||||
if [[ -d /run/systemd/journal ]] && type -P systemd-cat &>/dev/null && (( $UID == 0 )) ; then
|
||||
readonly _dlogdir="$(mktemp --tmpdir="$TMPDIR/" -d -t dracut-log.XXXXXX)"
|
||||
readonly _systemdcatfile="$_dlogdir/systemd-cat"
|
||||
mkfifo "$_systemdcatfile"
|
||||
readonly _dlogfd=15
|
||||
systemd-cat -t 'dracut' <"$_systemdcatfile" &
|
||||
exec 15>"$_systemdcatfile"
|
||||
elif ! [ -S /dev/log -a -w /dev/log ] || ! command -v logger >/dev/null; then
|
||||
# We cannot log to syslog, so turn this facility off.
|
||||
sysloglvl=0
|
||||
ret=1
|
||||
@@ -306,15 +314,23 @@ _dlvl2syslvl() {
|
||||
_do_dlog() {
|
||||
local lvl="$1"; shift
|
||||
local lvlc=$(_lvl2char "$lvl") || return 0
|
||||
local msg="$lvlc: $*"
|
||||
local msg="$*"
|
||||
local lmsg="$lvlc: $*"
|
||||
|
||||
(( $lvl <= $stdloglvl )) && echo "$msg" >&2
|
||||
|
||||
if (( $lvl <= $sysloglvl )); then
|
||||
logger -t "dracut[$$]" -p $(_lvl2syspri $lvl) "$msg"
|
||||
if [[ "$_dlogfd" ]]; then
|
||||
echo "<$(_dlvl2syslvl $lvl)>$msg" >&$_dlogfd
|
||||
else
|
||||
logger -t "dracut[$$]" -p $(_lvl2syspri $lvl) "$msg"
|
||||
fi
|
||||
fi
|
||||
|
||||
if (( $lvl <= $fileloglvl )) && [[ -w "$logfile" ]] && [[ -f "$logfile" ]]; then
|
||||
echo "$msg" >>"$logfile"
|
||||
echo "$lmsg" >>"$logfile"
|
||||
fi
|
||||
|
||||
(( $lvl <= $kmsgloglvl )) && \
|
||||
echo "<$(_dlvl2syslvl $lvl)>dracut[$$] $msg" >/dev/kmsg
|
||||
}
|
||||
|
@@ -3,15 +3,12 @@
|
||||
# i18n
|
||||
i18n_vars="/etc/sysconfig/keyboard:KEYTABLE-KEYMAP /etc/sysconfig/i18n:SYSFONT-FONT,FONTACM-FONT_MAP,FONT_UNIMAP"
|
||||
i18n_default_font="latarcyrheb-sun16"
|
||||
omit_drivers+=' .*/fs/ocfs/.* i2o_scsi'
|
||||
stdloglvl=3
|
||||
logfile=/var/log/dracut.log
|
||||
fileloglvl=6
|
||||
sysloglvl=5
|
||||
install_items+=" vi /etc/virc ps grep cat rm "
|
||||
prefix="/"
|
||||
systemdutildir=/usr/lib/systemd
|
||||
systemdsystemunitdir=/usr/lib/systemd/system
|
||||
systemdsystemconfdir=/etc/systemd/system
|
||||
udevdir=/usr/lib/udev
|
||||
add_dracutmodules+=" systemd "
|
||||
hostonly="yes"
|
||||
|
@@ -10,5 +10,6 @@ ro_mnt=yes
|
||||
|
||||
# i18n
|
||||
i18n_vars="/etc/conf.d/keymaps:keymap-KEYMAP,extended_keymaps-EXT_KEYMAPS /etc/conf.d/consolefont:consolefont-FONT,consoletranslation-FONT_MAP /etc/rc.conf:unicode-UNICODE"
|
||||
i18n_default_font="LatArCyrHeb-16"
|
||||
|
||||
omit_drivers+=" i2o_scsi"
|
||||
|
133
dracut.sh
133
dracut.sh
@@ -245,24 +245,24 @@ dropindirs_sort()
|
||||
local -a files
|
||||
local f d
|
||||
|
||||
readarray -t files < <(
|
||||
for d in "$@"; do
|
||||
for i in "$d/"*"$suffix"; do
|
||||
if [[ -e "$i" ]]; then
|
||||
printf "%s\n" "${i##*/}"
|
||||
fi
|
||||
done
|
||||
done | sort -Vu
|
||||
)
|
||||
|
||||
for f in "${files[@]}"; do
|
||||
for d in "$@"; do
|
||||
if [[ -e "$d/$f" ]]; then
|
||||
printf "%s\n" "$d/$f"
|
||||
continue 2
|
||||
for d in "$@"; do
|
||||
for i in "$d/"*"$suffix"; do
|
||||
if [[ -e "$i" ]]; then
|
||||
printf "%s\n" "${i##*/}"
|
||||
fi
|
||||
done
|
||||
done
|
||||
done | sort -Vu | {
|
||||
readarray -t files
|
||||
|
||||
for f in "${files[@]}"; do
|
||||
for d in "$@"; do
|
||||
if [[ -e "$d/$f" ]]; then
|
||||
printf "%s\n" "$d/$f"
|
||||
continue 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
}
|
||||
}
|
||||
|
||||
verbosity_mod_l=0
|
||||
@@ -683,7 +683,15 @@ if [[ $early_microcode = yes ]]; then
|
||||
}
|
||||
fi
|
||||
# clean up after ourselves no matter how we die.
|
||||
trap 'ret=$?;[[ $outfile ]] && [[ -f $outfile.$$ ]] && rm -f -- "$outfile.$$";[[ $keep ]] && echo "Not removing $initdir." >&2 || { [[ $initdir ]] && rm -rf -- "$initdir"; [[ $microcode_dir ]] && rm -Rf -- "$microcode_dir"; exit $ret; };' EXIT
|
||||
trap '
|
||||
ret=$?;
|
||||
[[ $outfile ]] && [[ -f $outfile.$$ ]] && rm -f -- "$outfile.$$";
|
||||
[[ $keep ]] && echo "Not removing $initdir." >&2 || { [[ $initdir ]] && rm -rf -- "$initdir"; };
|
||||
[[ $keep ]] && echo "Not removing $microcode_dir." >&2 || { [[ $microcode_dir ]] && rm -Rf -- "$microcode_dir"; };
|
||||
[[ $_dlogdir ]] && rm -Rf -- "$_dlogdir";
|
||||
exit $ret;
|
||||
' EXIT
|
||||
|
||||
# clean up after ourselves no matter how we die.
|
||||
trap 'exit 1;' SIGINT
|
||||
|
||||
@@ -761,7 +769,7 @@ for ((i=0; i < ${#dracut_args[@]}; i++)); do
|
||||
dracut_args[$i]="\"${dracut_args[$i]}\""
|
||||
#" keep vim happy
|
||||
done
|
||||
ddebug "Executing: $0 ${dracut_args[@]}"
|
||||
dinfo "Executing: $0 ${dracut_args[@]}"
|
||||
|
||||
[[ $do_list = yes ]] && {
|
||||
for mod in $dracutbasedir/modules.d/*; do
|
||||
@@ -855,70 +863,70 @@ if [[ $hostonly ]]; then
|
||||
for mp in \
|
||||
"/" \
|
||||
"/etc" \
|
||||
"/usr" \
|
||||
"/usr/bin" \
|
||||
"/usr/sbin" \
|
||||
"/usr/lib" \
|
||||
"/usr/lib64" \
|
||||
"/bin" \
|
||||
"/sbin" \
|
||||
"/lib" \
|
||||
"/lib64" \
|
||||
"/boot";
|
||||
do
|
||||
mp=$(readlink -f "$mp")
|
||||
mountpoint "$mp" >/dev/null 2>&1 || continue
|
||||
_dev="$(readlink -f "/dev/block/$(find_block_device "$mp")")"
|
||||
[[ "$_mp" == "/" ]] && root_dev="$_dev"
|
||||
push host_devs "$_dev"
|
||||
done
|
||||
|
||||
while read dev type rest; do
|
||||
[[ -b $dev ]] || continue
|
||||
[[ "$type" == "partition" ]] || continue
|
||||
while read _d _m _t _o _r; do
|
||||
[[ "$_d" == \#* ]] && continue
|
||||
[[ $_d ]] || continue
|
||||
[[ $_t != "swap" ]] || [[ $_m != "swap" ]] && continue
|
||||
[[ "$_o" == *noauto* ]] && continue
|
||||
[[ "$_d" == UUID\=* ]] && _d="/dev/disk/by-uuid/${_d#UUID=}"
|
||||
[[ "$_d" == LABEL\=* ]] && _d="/dev/disk/by-label/$_d#LABEL=}"
|
||||
[[ "$_d" -ef "$dev" ]] || continue
|
||||
if [[ -f /proc/swaps ]] && [[ -f /etc/fstab ]]; then
|
||||
while read dev type rest; do
|
||||
[[ -b $dev ]] || continue
|
||||
[[ "$type" == "partition" ]] || continue
|
||||
|
||||
while read _mapper _a _p _o; do
|
||||
[[ $_mapper = \#* ]] && continue
|
||||
[[ "$_d" -ef /dev/mapper/"$_mapper" ]] || continue
|
||||
[[ "$_o" ]] || _o="$_p"
|
||||
while read _d _m _t _o _r; do
|
||||
[[ "$_d" == \#* ]] && continue
|
||||
[[ $_d ]] || continue
|
||||
[[ $_t != "swap" ]] || [[ $_m != "swap" ]] && continue
|
||||
[[ "$_o" == *noauto* ]] && continue
|
||||
[[ "$_d" == UUID\=* ]] && _d="/dev/disk/by-uuid/${_d#UUID=}"
|
||||
[[ "$_d" == LABEL\=* ]] && _d="/dev/disk/by-label/$_d#LABEL=}"
|
||||
[[ "$_d" -ef "$dev" ]] || continue
|
||||
|
||||
if [[ -f /etc/crypttab ]]; then
|
||||
while read _mapper _a _p _o; do
|
||||
[[ $_mapper = \#* ]] && continue
|
||||
[[ "$_d" -ef /dev/mapper/"$_mapper" ]] || continue
|
||||
[[ "$_o" ]] || _o="$_p"
|
||||
# skip mkswap swap
|
||||
[[ $_o == *swap* ]] && continue 2
|
||||
done < /etc/crypttab
|
||||
[[ $_o == *swap* ]] && continue 2
|
||||
done < /etc/crypttab
|
||||
fi
|
||||
|
||||
push host_devs "$(readlink -f "$dev")"
|
||||
break
|
||||
done < /etc/fstab
|
||||
done < /proc/swaps
|
||||
push host_devs "$(readlink -f "$dev")"
|
||||
break
|
||||
done < /etc/fstab
|
||||
done < /proc/swaps
|
||||
fi
|
||||
fi
|
||||
|
||||
_get_fs_type() { (
|
||||
_get_fs_type() {
|
||||
[[ $1 ]] || return
|
||||
if [[ -b /dev/block/$1 ]] && ID_FS_TYPE=$(get_fs_env "/dev/block/$1"); then
|
||||
printf "%s\n" "$(readlink -f "/dev/block/$1")" "$ID_FS_TYPE"
|
||||
host_fs_types["$(readlink -f "/dev/block/$1")"]="$ID_FS_TYPE"
|
||||
return 1
|
||||
fi
|
||||
if [[ -b $1 ]] && ID_FS_TYPE=$(get_fs_env "$1"); then
|
||||
printf "%s\n" "$(readlink -f "$1")" "$ID_FS_TYPE"
|
||||
host_fs_types["$(readlink -f "$1")"]="$ID_FS_TYPE"
|
||||
return 1
|
||||
fi
|
||||
if fstype=$(find_dev_fstype "$1"); then
|
||||
printf "%s\n" "$1" "$fstype"
|
||||
host_fs_types["$1"]="$fstype"
|
||||
return 1
|
||||
fi
|
||||
return 1
|
||||
) }
|
||||
}
|
||||
|
||||
for dev in "${host_devs[@]}"; do
|
||||
while read key; do
|
||||
read val
|
||||
host_fs_types["$key"]="$val"
|
||||
done < <(
|
||||
_get_fs_type "$dev"
|
||||
check_block_and_slaves_all _get_fs_type "$(get_maj_min "$dev")"
|
||||
)
|
||||
for dev in ${host_devs[@]}; do
|
||||
_get_fs_type "$dev"
|
||||
check_block_and_slaves_all _get_fs_type "$(get_maj_min "$dev")"
|
||||
done
|
||||
|
||||
[[ -d $udevdir ]] \
|
||||
@@ -1167,11 +1175,6 @@ if [[ $kernel_only != yes ]]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if (( maxloglvl >= 5 )); then
|
||||
ddebug "Listing sizes of included files:"
|
||||
du -c "$initdir" | sort -n | ddebug
|
||||
fi
|
||||
|
||||
PRELINK_BIN="$(command -v prelink)"
|
||||
if [[ $UID = 0 ]] && [[ $PRELINK_BIN ]]; then
|
||||
if [[ $DRACUT_FIPS_MODE ]]; then
|
||||
@@ -1258,6 +1261,7 @@ if [[ $early_microcode = yes ]]; then
|
||||
done
|
||||
(cd "$microcode_dir/d"; find . | cpio -o -H newc --quiet >../ucode.cpio)
|
||||
fi
|
||||
|
||||
rm -f -- "$outfile"
|
||||
dinfo "*** Creating image file ***"
|
||||
if [[ $early_microcode = yes ]]; then
|
||||
@@ -1272,7 +1276,8 @@ fi
|
||||
mv -- "$outfile.$$" "$outfile"
|
||||
dinfo "*** Creating image file done ***"
|
||||
|
||||
dinfo "Wrote $outfile:"
|
||||
dinfo "$(ls -l "$outfile")"
|
||||
if (( maxloglvl >= 5 )); then
|
||||
lsinitrd "$outfile"| ddebug
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
@@ -78,7 +78,7 @@ Provides: dracut-kernel = %{version}-%{release}
|
||||
|
||||
Obsoletes: dracut <= 029
|
||||
Obsoletes: dracut-norescue
|
||||
Provides: dracut-horescue
|
||||
Provides: dracut-norescue
|
||||
|
||||
Requires: bash >= 4
|
||||
Requires: coreutils
|
||||
@@ -95,6 +95,7 @@ Requires: kpartx
|
||||
%if 0%{?fedora} || 0%{?rhel} > 6
|
||||
Requires: util-linux >= 2.21
|
||||
Requires: systemd >= 199
|
||||
Requires: procps-ng
|
||||
Conflicts: grubby < 8.23
|
||||
%else
|
||||
Requires: udev > 166
|
||||
@@ -269,9 +270,6 @@ echo 'hostonly="no"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/02-generic-i
|
||||
echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/02-rescue.conf
|
||||
%endif
|
||||
|
||||
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
|
||||
install -m 0644 dracut.logrotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/dracut_log
|
||||
|
||||
# create compat symlink
|
||||
mkdir -p $RPM_BUILD_ROOT/sbin
|
||||
ln -s /usr/bin/dracut $RPM_BUILD_ROOT/sbin/dracut
|
||||
@@ -320,6 +318,7 @@ rm -rf -- $RPM_BUILD_ROOT
|
||||
%else
|
||||
%{dracutlibdir}/modules.d/00bootchart
|
||||
%endif
|
||||
%{dracutlibdir}/modules.d/03modsign
|
||||
%{dracutlibdir}/modules.d/03rescue
|
||||
%{dracutlibdir}/modules.d/04watchdog
|
||||
%{dracutlibdir}/modules.d/05busybox
|
||||
@@ -329,6 +328,7 @@ rm -rf -- $RPM_BUILD_ROOT
|
||||
%{dracutlibdir}/modules.d/50drm
|
||||
%{dracutlibdir}/modules.d/50plymouth
|
||||
%{dracutlibdir}/modules.d/80cms
|
||||
%{dracutlibdir}/modules.d/90bcache
|
||||
%{dracutlibdir}/modules.d/90btrfs
|
||||
%{dracutlibdir}/modules.d/90crypt
|
||||
%{dracutlibdir}/modules.d/90dm
|
||||
@@ -367,7 +367,6 @@ rm -rf -- $RPM_BUILD_ROOT
|
||||
%{dracutlibdir}/modules.d/99fs-lib
|
||||
%{dracutlibdir}/modules.d/99img-lib
|
||||
%{dracutlibdir}/modules.d/99shutdown
|
||||
%config(noreplace) %{_sysconfdir}/logrotate.d/dracut_log
|
||||
%attr(0644,root,root) %ghost %config(missingok,noreplace) %{_localstatedir}/log/dracut.log
|
||||
%dir %{_sharedstatedir}/initramfs
|
||||
%if %{defined _unitdir}
|
||||
|
@@ -55,8 +55,29 @@ mount_boot()
|
||||
fi
|
||||
}
|
||||
|
||||
do_rhevh_check()
|
||||
{
|
||||
KERNEL=$(uname -r)
|
||||
kpath=${1}
|
||||
|
||||
# If we're on RHEV-H, the kernel is in /dev/.initramfs/live/vmlinuz0
|
||||
HMAC_SUM_ORIG=$(cat /boot/.vmlinuz-${KERNEL}.hmac | while read a b; do printf "%s\n" $a; done)
|
||||
HMAC_SUM_CALC=$(sha512hmac $kpath | while read a b; do printf "%s\n" $a; done || return 1)
|
||||
if [ -z "$HMAC_SUM_ORIG" ] || [ -z "$HMAC_SUM_CALC" ] || [ "${HMAC_SUM_ORIG}" != "${HMAC_SUM_CALC}" ]; then
|
||||
warn "HMAC sum mismatch"
|
||||
return 1
|
||||
fi
|
||||
info "rhevh_check OK"
|
||||
return 0
|
||||
}
|
||||
|
||||
do_fips()
|
||||
{
|
||||
local _v
|
||||
local _s
|
||||
local _v
|
||||
local _module
|
||||
|
||||
KERNEL=$(uname -r)
|
||||
|
||||
if ! [ -e "/boot/.vmlinuz-${KERNEL}.hmac" ]; then
|
||||
@@ -67,17 +88,37 @@ do_fips()
|
||||
FIPSMODULES=$(cat /etc/fipsmodules)
|
||||
|
||||
info "Loading and integrity checking all crypto modules"
|
||||
for module in $FIPSMODULES; do
|
||||
if [ "$module" != "tcrypt" ]; then
|
||||
modprobe ${module}
|
||||
mv /etc/modprobe.d/fips.conf /etc/modprobe.d/fips.conf.bak
|
||||
for _module in $FIPSMODULES; do
|
||||
if [ "$_module" != "tcrypt" ]; then
|
||||
if ! modprobe "${_module}"; then
|
||||
# check if kernel provides generic algo
|
||||
_found=0
|
||||
while read _k _s _v; do
|
||||
[ "$_k" != "name" -a "$_k" != "driver" ] && continue
|
||||
[ "$_k" = "driver" ] && _v=$(str_replace "$_v" "_" "-")
|
||||
[ "$_v" != "$_module" ] && continue
|
||||
_found=1
|
||||
break
|
||||
done </proc/crypto
|
||||
[ "$_found" = "0" ] && return 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
mv /etc/modprobe.d/fips.conf.bak /etc/modprobe.d/fips.conf
|
||||
|
||||
info "Self testing crypto algorithms"
|
||||
modprobe tcrypt || return 1
|
||||
rmmod tcrypt
|
||||
|
||||
info "Checking integrity of kernel"
|
||||
sha512hmac -c "/boot/.vmlinuz-${KERNEL}.hmac" || return 1
|
||||
if [ -e "$NEWROOT/dev/.initramfs/live/vmlinuz0" ]; then
|
||||
do_rhevh_check "$NEWROOT/dev/.initramfs/live/vmlinuz0" || return 1
|
||||
elif [ -e "$NEWROOT/dev/.initramfs/live/isolinux/vmlinuz0" ]; then
|
||||
do_rhevh_check "$NEWROOT/dev/.initramfs/live/isolinux/vmlinuz0" || return 1
|
||||
else
|
||||
sha512hmac -c "/boot/.vmlinuz-${KERNEL}.hmac" || return 1
|
||||
fi
|
||||
|
||||
info "All initrd crypto checks done"
|
||||
|
||||
|
13
modules.d/03modsign/load-modsign-keys.sh
Normal file
13
modules.d/03modsign/load-modsign-keys.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/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
|
||||
#
|
||||
# Copyright 2013 Red Hat, Inc.
|
||||
# Peter Jones <pjones@redhat.com>
|
||||
|
||||
for x in /lib/modules/keys/* ; do
|
||||
[ "${x}" = "/lib/modules/keys/*" ] && break
|
||||
keyctl padd asymmetric "" @s < ${x}
|
||||
done
|
37
modules.d/03modsign/module-setup.sh
Normal file
37
modules.d/03modsign/module-setup.sh
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/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
|
||||
#
|
||||
# Copyright 2013 Red Hat, Inc.
|
||||
# Peter Jones <pjones@redhat.com>
|
||||
|
||||
check() {
|
||||
[[ -x /usr/bin/keyctl ]] || return 1
|
||||
|
||||
# do not include module in hostonly mode,
|
||||
# if no keys are present
|
||||
if [[ $hostonly ]]; then
|
||||
x=$(echo /lib/modules/keys/*)
|
||||
[[ "${x}" = "/lib/modules/keys/*" ]] && return 255
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
install() {
|
||||
inst_dir /lib/modules/keys
|
||||
inst_binary /usr/bin/keyctl
|
||||
|
||||
inst_hook pre-trigger 01 "$moddir/load-modsign-keys.sh"
|
||||
|
||||
for x in /lib/modules/keys/* ; do
|
||||
[[ "${x}" = "/lib/modules/keys/*" ]] && break
|
||||
inst_simple "${x}"
|
||||
done
|
||||
}
|
@@ -287,6 +287,17 @@ for p in $(getargs ip=); do
|
||||
# skip ibft
|
||||
[ "$autoconf" = "ibft" ] && continue
|
||||
|
||||
case "$dev" in
|
||||
??:??:??:??:??:??) # MAC address
|
||||
_dev=$(iface_for_mac $dev)
|
||||
[ -n "$_dev" ] && dev="$_dev"
|
||||
;;
|
||||
??-??-??-??-??-??) # MAC address in BOOTIF form
|
||||
_dev=$(iface_for_mac $(fix_bootif $dev))
|
||||
[ -n "$_dev" ] && dev="$_dev"
|
||||
;;
|
||||
esac
|
||||
|
||||
# If this option isn't directed at our interface, skip it
|
||||
[ -n "$dev" ] && [ "$dev" != "$netif" ] && \
|
||||
[ "$use_bridge" != 'true' ] && \
|
||||
|
@@ -205,16 +205,33 @@ ibft_to_cmdline() {
|
||||
mac=$(read a < ${iface}/mac; echo $a)
|
||||
[ -z "$mac" ] && continue
|
||||
dev=$(set_ifname ibft $mac)
|
||||
dhcp=$(read a < ${iface}/dhcp; echo $a)
|
||||
[ -e ${iface}/dhcp ] && dhcp=$(read a < ${iface}/dhcp; echo $a)
|
||||
if [ -e ${iface}/vlan ]; then
|
||||
vlan=$(read a < ${iface}/vlan; echo $a)
|
||||
echo "vlan=$vlan:$dev"
|
||||
fi
|
||||
|
||||
if [ -n "$dhcp" ]; then
|
||||
echo "ip=$dev:dhcp"
|
||||
elif [ -e ${iface}/ip-addr ]; then
|
||||
[ -e ${iface}/ip-addr ] && ip=$(read a < ${iface}/ip-addr; echo $a)
|
||||
[ -e ${iface}/gateway ] && gw=$(read a < ${iface}/gateway; echo $a)
|
||||
[ -e ${iface}/subnet-mask ] && mask=$(read a < ${iface}/subnet-mask; echo $a)
|
||||
[ -e ${iface}/hostname ] && hostname=$(read a < ${iface}/hostname; echo $a)
|
||||
if [ -n "$ip" ] && [ -n "$mask" ]; then
|
||||
echo "ip=$ip::$gw:$mask:$hostname:$dev:none"
|
||||
else
|
||||
warn "${iface} does not contain a valid iBFT configuration"
|
||||
warn "ip-addr=$ip"
|
||||
warn "gateway=$gw"
|
||||
warn "subnet-mask=$mask"
|
||||
warn "hostname=$hostname"
|
||||
fi
|
||||
else
|
||||
ip=$(read a < ${iface}/ip-addr; echo $a)
|
||||
gw=$(read a < ${iface}/gateway; echo $a)
|
||||
mask=$(read a < ${iface}/subnet-mask; echo $a)
|
||||
hostname=$(read a < ${iface}/hostname; echo $a)
|
||||
echo "ip=$ip::$gw:$mask:$hostname:$dev:none"
|
||||
info "${iface} does not contain a valid iBFT configuration"
|
||||
ls -l ${iface} | vinfo
|
||||
fi
|
||||
|
||||
echo $mac > /tmp/net.${dev}.has_ibft_config
|
||||
done
|
||||
) >> /etc/cmdline.d/40-ibft.conf
|
||||
|
@@ -12,7 +12,7 @@ depends() {
|
||||
}
|
||||
|
||||
install() {
|
||||
local _dir _crt _found
|
||||
local _dir _crt _found _lib
|
||||
inst_simple "$moddir/url-lib.sh" "/lib/url-lib.sh"
|
||||
dracut_install curl
|
||||
# also install libs for curl https
|
||||
@@ -22,8 +22,10 @@ install() {
|
||||
inst_libdir_file "libsqlite3.so*"
|
||||
|
||||
for _dir in $libdirs; do
|
||||
[[ -d $_dir ]] || continue
|
||||
_crt=$(grep -F --binary-files=text -z .crt $_dir/libcurl.so)
|
||||
[[ -d $_dir ]] || continue
|
||||
for _lib in $_dir/libcurl.so.*; do
|
||||
[[ -e $_lib ]] || continue
|
||||
_crt=$(grep -F --binary-files=text -z .crt $_lib)
|
||||
[[ $_crt ]] || continue
|
||||
[[ $_crt == /*/* ]] || continue
|
||||
if ! inst_simple "$_crt"; then
|
||||
@@ -31,6 +33,7 @@ install() {
|
||||
continue
|
||||
fi
|
||||
_found=1
|
||||
done
|
||||
done
|
||||
[[ $_found ]] || dwarn "Couldn't find SSL CA cert bundle; HTTPS won't work."
|
||||
}
|
||||
|
30
modules.d/90bcache/module-setup.sh
Executable file
30
modules.d/90bcache/module-setup.sh
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
check() {
|
||||
type -P probe-bcache >/dev/null || return 1
|
||||
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
for fs in "${host_fs_types[@]}"; do
|
||||
[[ $fs = "bcache" ]] && return 0
|
||||
done
|
||||
return 255
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
instmods bcache
|
||||
}
|
||||
|
||||
install() {
|
||||
dracut_install probe-bcache ${udevdir}/bcache-register
|
||||
inst_rules 61-bcache.rules
|
||||
}
|
||||
|
@@ -57,7 +57,7 @@ install() {
|
||||
inst_hook cleanup 30 "$moddir/crypt-cleanup.sh"
|
||||
fi
|
||||
|
||||
if [[ $hostonly ]]; then
|
||||
if [[ $hostonly ]] && [[ -f /etc/cryptab ]]; then
|
||||
# filter /etc/crypttab for the devices we need
|
||||
while read _mapper _dev _rest; do
|
||||
[[ $_mapper = \#* ]] && continue
|
||||
|
@@ -23,7 +23,7 @@ else
|
||||
{
|
||||
printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", '
|
||||
printf -- 'ENV{ID_FS_UUID}=="*%s*", ' $luksid
|
||||
printf -- 'RUN+="%s --unique --onetime ' $(command -v initqueue)
|
||||
printf -- 'RUN+="%s --settled --unique --onetime ' $(command -v initqueue)
|
||||
printf -- '--name cryptroot-ask-%%k %s ' $(command -v cryptroot-ask)
|
||||
printf -- '$env{DEVNAME} luks-$env{ID_FS_UUID} %s"\n' $tout
|
||||
} >> /etc/udev/rules.d/70-luks.rules.new
|
||||
@@ -31,7 +31,7 @@ else
|
||||
{
|
||||
printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", '
|
||||
printf -- 'ENV{ID_FS_UUID}=="*%s*", ' $luksid
|
||||
printf -- 'RUN+="%s --unique --onetime ' $(command -v initqueue)
|
||||
printf -- 'RUN+="%s --settled --unique --onetime ' $(command -v initqueue)
|
||||
printf -- '--name systemd-cryptsetup-%%k %s start ' $(command -v systemctl)
|
||||
printf -- 'systemd-cryptsetup@luks$$(dev_unit_name -$env{ID_FS_UUID}).service"\n'
|
||||
} >> /etc/udev/rules.d/70-luks.rules.new
|
||||
@@ -51,13 +51,13 @@ else
|
||||
if [ -z "$DRACUT_SYSTEMD" ]; then
|
||||
{
|
||||
printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="%s ' $(command -v initqueue)
|
||||
printf -- '--unique --onetime --name cryptroot-ask-%%k '
|
||||
printf -- '--unique --settled --onetime --name cryptroot-ask-%%k '
|
||||
printf -- '%s $env{DEVNAME} luks-$env{ID_FS_UUID} %s"\n' $(command -v cryptroot-ask) $tout
|
||||
} >> /etc/udev/rules.d/70-luks.rules.new
|
||||
else
|
||||
{
|
||||
printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="%s ' $(command -v initqueue)
|
||||
printf -- '--unique --onetime --name crypt-run-generator-%%k '
|
||||
printf -- '--unique --settled --onetime --name crypt-run-generator-%%k '
|
||||
printf -- '%s $env{DEVNAME} luks-$env{ID_FS_UUID}"\n' $(command -v crypt-run-generator)
|
||||
} >> /etc/udev/rules.d/70-luks.rules.new
|
||||
fi
|
||||
|
@@ -29,6 +29,8 @@ install() {
|
||||
# Gentoo ebuild for LVM2 prior to 2.02.63-r1 doesn't install above rules
|
||||
# files, but provides the one below:
|
||||
inst_rules 64-device-mapper.rules
|
||||
# debian udev rules
|
||||
inst_rules 60-persistent-storage-dm.rules 55-dm.rules
|
||||
|
||||
inst_rules "$moddir/11-dm.rules"
|
||||
|
||||
|
@@ -47,7 +47,8 @@ installkernel() {
|
||||
if [[ "$(uname -p)" == arm* ]]; then
|
||||
# arm specific modules
|
||||
hostonly='' instmods sdhci_esdhc_imx mmci sdhci_tegra mvsdio omap omapdrm \
|
||||
omap_hsmmc panel-tfp410 sdhci_dove ahci_platform pata_imx sata_mv
|
||||
omap_hsmmc panel-tfp410 sdhci_dove ahci_platform pata_imx sata_mv \
|
||||
ehci-tegra
|
||||
fi
|
||||
|
||||
# install virtual machine support
|
||||
@@ -60,8 +61,7 @@ installkernel() {
|
||||
# if the required list is not set via the filesystems variable
|
||||
if ! [[ $hostonly ]]; then
|
||||
if [[ -z $filesystems ]]; then
|
||||
omit_drivers="${omit_drivers}|kernel/fs/nfs|kernel/fs/nfsd|kernel/fs/lockd" \
|
||||
omit_drivers="${omit_drivers##|}" \
|
||||
silent_omit_drivers="kernel/fs/nfs|kernel/fs/nfsd|kernel/fs/lockd" \
|
||||
instmods '=fs'
|
||||
fi
|
||||
else
|
||||
|
@@ -65,6 +65,8 @@ install() {
|
||||
# Gentoo ebuild for LVM2 prior to 2.02.63-r1 doesn't install above rules
|
||||
# files, but provides the one below:
|
||||
inst_rules 64-device-mapper.rules
|
||||
# debian udev rules
|
||||
inst_rules 56-lvm.rules 60-persistent-storage-lvm.rules
|
||||
|
||||
inst_script "$moddir/lvm_scan.sh" /sbin/lvm_scan
|
||||
inst_hook cmdline 30 "$moddir/parse-lvm.sh"
|
||||
|
@@ -11,6 +11,4 @@ _do_mdmon_takeover() {
|
||||
|
||||
if command -v mdmon >/dev/null; then
|
||||
_do_mdmon_takeover $1
|
||||
else
|
||||
:
|
||||
fi
|
||||
|
@@ -2,6 +2,18 @@
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
check() {
|
||||
# No point trying to support resume, if no swap partition exist
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
for fs in "${host_fs_types[@]}"; do
|
||||
[[ $fs = swap ]] && return 0
|
||||
done
|
||||
return 255
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
install() {
|
||||
local _bin
|
||||
# Optional uswsusp support
|
||||
|
@@ -31,6 +31,7 @@ depends() {
|
||||
|
||||
install() {
|
||||
dracut_install umount
|
||||
dracut_install tr
|
||||
if ! dracut_module_included "systemd"; then
|
||||
inst_hook cmdline 95 "$moddir/parse-block.sh"
|
||||
inst_hook pre-udev 30 "$moddir/block-genrules.sh"
|
||||
|
@@ -10,11 +10,15 @@ case "$root" in
|
||||
rootok=1 ;;
|
||||
block:UUID=*|UUID=*)
|
||||
root="${root#block:}"
|
||||
root="${root#UUID=}"
|
||||
root="$(echo $root | tr "[:upper:]" "[:lower:]")"
|
||||
root="block:/dev/disk/by-uuid/${root#UUID=}"
|
||||
rootok=1 ;;
|
||||
block:PARTUUID=*|PARTUUID=*)
|
||||
root="${root#block:}"
|
||||
root="block:/dev/disk/by-partuuid/${root#PARTUUID=}"
|
||||
root="${root#PARTUUID=}"
|
||||
root="$(echo $root | tr "[:upper:]" "[:lower:]")"
|
||||
root="block:/dev/disk/by-partuuid/${root}"
|
||||
rootok=1 ;;
|
||||
block:PARTLABEL=*|PARTLABEL=*)
|
||||
root="${root#block:}"
|
||||
|
@@ -36,6 +36,8 @@ install() {
|
||||
"$moddir/61-persistent-storage.rules"
|
||||
|
||||
prepare_udev_rules 59-persistent-storage.rules 61-persistent-storage.rules
|
||||
# debian udev rules
|
||||
inst_rules 91-permissions.rules
|
||||
|
||||
{
|
||||
for i in cdrom tape dialout floppy; do
|
||||
|
@@ -12,7 +12,7 @@ Description=dracut pre-trigger hook
|
||||
Documentation=man:dracut-pre-trigger.service(8)
|
||||
DefaultDependencies=no
|
||||
Before=systemd-udev-trigger.service dracut-initqueue.service
|
||||
After=dracut-pre-udev.service systemd-udevd.service
|
||||
After=dracut-pre-udev.service systemd-udevd.service systemd-tmpfiles-setup-dev.service
|
||||
Wants=dracut-pre-udev.service systemd-udevd.service
|
||||
ConditionPathExists=/etc/initrd-release
|
||||
ConditionDirectoryNotEmpty=|/lib/dracut/hooks/pre-trigger
|
||||
|
@@ -8,7 +8,7 @@
|
||||
[Unit]
|
||||
Description=Restore /run/initramfs
|
||||
Documentation=man:dracut-shutdown.service(8)
|
||||
After=getty@tty1.service prefdm.service
|
||||
After=getty@tty1.service display-manager.service
|
||||
Before=systemd-reboot.service shutdown.target
|
||||
DefaultDependencies=no
|
||||
ConditionPathExists=/run/initramfs/.need_shutdown
|
||||
|
@@ -5,6 +5,8 @@
|
||||
check() {
|
||||
[[ $mount_needs ]] && return 1
|
||||
if [[ -x $systemdutildir/systemd ]]; then
|
||||
SYSTEMD_VERSION=$($systemdutildir/systemd --version | { read a b a; echo $b; })
|
||||
(( $SYSTEMD_VERSION >= 198 )) && return 0
|
||||
return 255
|
||||
fi
|
||||
|
||||
@@ -18,12 +20,6 @@ depends() {
|
||||
install() {
|
||||
local _mods
|
||||
|
||||
# SYSTEMD_VERSION=$($systemdutildir/systemd --version | { read a b a; echo $b; })
|
||||
# if (( $SYSTEMD_VERSION < 198 )); then
|
||||
# dfatal "systemd version $SYSTEMD_VERSION is too low. Need at least version 198."
|
||||
# exit 1
|
||||
# fi
|
||||
|
||||
if [[ "$prefix" == /run/* ]]; then
|
||||
dfatal "systemd does not work with a prefix, which contains \"/run\"!!"
|
||||
exit 1
|
||||
@@ -69,6 +65,8 @@ install() {
|
||||
$systemdsystemunitdir/timers.target \
|
||||
$systemdsystemunitdir/paths.target \
|
||||
$systemdsystemunitdir/umount.target \
|
||||
$systemdsystemunitdir/kmod-static-nodes.service \
|
||||
$systemdsystemunitdir/systemd-tmpfiles-setup-dev.service \
|
||||
$systemdsystemunitdir/systemd-ask-password-console.path \
|
||||
$systemdsystemunitdir/systemd-udevd-control.socket \
|
||||
$systemdsystemunitdir/systemd-udevd-kernel.socket \
|
||||
@@ -88,6 +86,7 @@ install() {
|
||||
$systemdsystemunitdir/systemd-journald.service \
|
||||
$systemdsystemunitdir/systemd-vconsole-setup.service \
|
||||
$systemdsystemunitdir/systemd-random-seed-load.service \
|
||||
\
|
||||
$systemdsystemunitdir/sysinit.target.wants/systemd-modules-load.service \
|
||||
$systemdsystemunitdir/sysinit.target.wants/systemd-ask-password-console.path \
|
||||
$systemdsystemunitdir/sysinit.target.wants/systemd-journald.service \
|
||||
@@ -96,6 +95,8 @@ install() {
|
||||
$systemdsystemunitdir/sockets.target.wants/systemd-journald.socket \
|
||||
$systemdsystemunitdir/sysinit.target.wants/systemd-udevd.service \
|
||||
$systemdsystemunitdir/sysinit.target.wants/systemd-udev-trigger.service \
|
||||
$systemdsystemunitdir/sysinit.target.wants/kmod-static-nodes.service \
|
||||
$systemdsystemunitdir/sysinit.target.wants/systemd-tmpfiles-setup-dev.service \
|
||||
\
|
||||
$systemdsystemunitdir/ctrl-alt-del.target \
|
||||
$systemdsystemunitdir/syslog.socket \
|
||||
@@ -108,7 +109,7 @@ install() {
|
||||
$systemdsystemunitdir/slices.target \
|
||||
$systemdsystemunitdir/system.slice \
|
||||
\
|
||||
journalctl systemctl echo swapoff systemd-cgls
|
||||
journalctl systemctl echo swapoff systemd-cgls systemd-tmpfiles
|
||||
|
||||
dracut_install -o \
|
||||
/usr/lib/modules-load.d/*.conf \
|
||||
|
@@ -3,7 +3,10 @@
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
check() {
|
||||
local _init
|
||||
[[ $mount_needs ]] && return 1
|
||||
_init=$(readlink -f /sbin/init)
|
||||
[[ "$init" == "${init##/usr}" ]] && return 255
|
||||
return 0
|
||||
}
|
||||
|
||||
|
@@ -77,8 +77,10 @@ _getcmdline() {
|
||||
CMDLINE_ETC_D="$CMDLINE_ETC_D $_line";
|
||||
done <"$_i";
|
||||
done
|
||||
read -r CMDLINE </proc/cmdline;
|
||||
CMDLINE="$CMDLINE_ETC_D $CMDLINE_ETC $CMDLINE"
|
||||
if [ -e /proc/cmdline ]; then
|
||||
read -r CMDLINE </proc/cmdline;
|
||||
CMDLINE="$CMDLINE_ETC_D $CMDLINE_ETC $CMDLINE"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -927,6 +929,31 @@ wait_for_loginit()
|
||||
rm -f -- /run/initramfs/loginit.pipe /run/initramfs/loginit.pid
|
||||
}
|
||||
|
||||
# pidof version for root
|
||||
if ! command -v pidof >/dev/null 2>/dev/null; then
|
||||
pidof() {
|
||||
local _cmd
|
||||
local _exe
|
||||
local _rl
|
||||
local i
|
||||
_cmd="$1"
|
||||
[ -z "$_cmd" ] && return 1
|
||||
_exe=$(type -P "$1")
|
||||
for i in /proc/*/exe; do
|
||||
[ -e "$i" ] || return 1
|
||||
if [ -n "$_exe" ]; then
|
||||
[ "$i" -ef "$_cmd" ] || continue
|
||||
else
|
||||
_rl=$(readlink -f "$i");
|
||||
[ "${_rl%/$_cmd}" != "$_rl" ] || continue
|
||||
fi
|
||||
i=${i%/exe}
|
||||
echo ${i##/proc/}
|
||||
done
|
||||
return 0
|
||||
}
|
||||
fi
|
||||
|
||||
_emergency_shell()
|
||||
{
|
||||
local _name="$1"
|
||||
|
@@ -81,6 +81,20 @@ if ! ismounted /run; then
|
||||
rm -fr -- /newrun
|
||||
fi
|
||||
|
||||
if command -v kmod >/dev/null 2>/dev/null; then
|
||||
kmod static-nodes --format=tmpfiles 2>/dev/null | \
|
||||
while read type file mode a a a majmin; do
|
||||
case $type in
|
||||
d)
|
||||
mkdir -m $mode -p $file
|
||||
;;
|
||||
c)
|
||||
mknod -m $mode $file $type ${majmin%:*} ${majmin#*:}
|
||||
;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
||||
trap "action_on_fail Signal caught!" 0
|
||||
|
||||
[ -d /run/initramfs ] || mkdir -p -m 0755 /run/initramfs
|
||||
@@ -278,8 +292,8 @@ if [ $UDEVVERSION -lt 168 ]; then
|
||||
udevadm control --stop-exec-queue
|
||||
|
||||
HARD=""
|
||||
while pidof systemd-udevd >/dev/null 2>&1; do
|
||||
for pid in $(pidof systemd-udevd); do
|
||||
while pidof udevd >/dev/null 2>&1; do
|
||||
for pid in $(pidof udevd); do
|
||||
kill $HARD $pid >/dev/null 2>&1
|
||||
done
|
||||
HARD="-9"
|
||||
|
@@ -13,11 +13,12 @@ depends() {
|
||||
|
||||
install() {
|
||||
local _d
|
||||
dracut_install mount mknod mkdir pidof sleep chroot \
|
||||
|
||||
dracut_install mount mknod mkdir sleep chroot \
|
||||
sed ls flock cp mv dmesg rm ln rmmod mkfifo umount readlink setsid
|
||||
inst $(command -v modprobe) /sbin/modprobe
|
||||
|
||||
dracut_install -o findmnt less
|
||||
dracut_install -o findmnt less kmod
|
||||
|
||||
if [ ! -e "${initdir}/bin/sh" ]; then
|
||||
dracut_install bash
|
||||
|
@@ -6,11 +6,11 @@ done
|
||||
rm -f -- /etc/lvm/lvm.conf
|
||||
udevadm control --reload
|
||||
# save a partition at the beginning for future flagging purposes
|
||||
sfdisk -C 1280 -H 2 -S 32 -L /dev/sda <<EOF
|
||||
,16
|
||||
,400
|
||||
,400
|
||||
,400
|
||||
sfdisk -C 2560 -H 2 -S 32 -L /dev/sda <<EOF
|
||||
,32
|
||||
,800
|
||||
,800
|
||||
,800
|
||||
EOF
|
||||
mdadm --create /dev/md0 --run --auto=yes --level=5 --raid-devices=3 /dev/sda2 /dev/sda3 /dev/sda4
|
||||
# wait for the array to finish initailizing, otherwise this sometimes fails
|
||||
|
@@ -5,7 +5,7 @@ KVERSION=${KVERSION-$(uname -r)}
|
||||
|
||||
# Uncomment this to debug failures
|
||||
#DEBUGFAIL="rd.shell rd.udev.log-priority=debug loglevel=70 systemd.log_target=kmsg"
|
||||
#DEBUGFAIL="rd.debug rd.break=pre-mount rd.shell"
|
||||
#DEBUGFAIL="rd.break rd.shell"
|
||||
test_run() {
|
||||
DISKIMAGE=$TESTDIR/TEST-10-RAID-root.img
|
||||
$testdir/run-qemu \
|
||||
@@ -21,7 +21,7 @@ test_setup() {
|
||||
DISKIMAGE=$TESTDIR/TEST-10-RAID-root.img
|
||||
# Create the blank file to use as a root filesystem
|
||||
rm -f -- $DISKIMAGE
|
||||
dd if=/dev/null of=$DISKIMAGE bs=1M seek=40
|
||||
dd if=/dev/null of=$DISKIMAGE bs=1M seek=80
|
||||
|
||||
kernel=$KVERSION
|
||||
# Create what will eventually be our root filesystem onto an overlay
|
||||
|
@@ -65,11 +65,11 @@ do_test_run() {
|
||||
|
||||
run_client "root=iscsi" \
|
||||
"root=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0" \
|
||||
"ip=192.168.50.101::192.168.50.1:255.255.255.0:iscsi-1:eth0:off" \
|
||||
"ip=192.168.50.101::192.168.50.1:255.255.255.0:iscsi-1:ens3:off" \
|
||||
|| return 1
|
||||
|
||||
run_client "netroot=iscsi" \
|
||||
"root=LABEL=sysroot ip=192.168.50.101::192.168.50.1:255.255.255.0:iscsi-1:eth0:off" \
|
||||
"root=LABEL=sysroot ip=192.168.50.101::192.168.50.1:255.255.255.0:iscsi-1:ens3:off" \
|
||||
"netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target1 netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target2" \
|
||||
|| return 1
|
||||
return 0
|
||||
|
@@ -97,31 +97,31 @@ test_client() {
|
||||
client_test "MULTINIC root=nfs BOOTIF=" \
|
||||
00 01 02 \
|
||||
"root=nfs:192.168.50.1:/nfs/client BOOTIF=52-54-00-12-34-00" \
|
||||
"eth0" || return 1
|
||||
"ens3" || return 1
|
||||
|
||||
# PXE Style BOOTIF= with dhcp root-path
|
||||
client_test "MULTINIC root=dhcp BOOTIF=" \
|
||||
00 01 02 \
|
||||
"root=dhcp BOOTIF=52-54-00-12-34-02" \
|
||||
"eth2" || return 1
|
||||
"ens5" || return 1
|
||||
|
||||
# Multinic case, where only one nic works
|
||||
client_test "MULTINIC root=nfs ip=dhcp" \
|
||||
FF 00 FE \
|
||||
"root=nfs:192.168.50.1:/nfs/client ip=dhcp" \
|
||||
"eth1" || return 1
|
||||
"ens4" || return 1
|
||||
|
||||
# Require two interfaces
|
||||
client_test "MULTINIC root=nfs ip=eth1:dhcp ip=eth2:dhcp bootdev=eth1" \
|
||||
client_test "MULTINIC root=nfs ip=ens4:dhcp ip=ens5:dhcp bootdev=ens4" \
|
||||
00 01 02 \
|
||||
"root=nfs:192.168.50.1:/nfs/client ip=eth1:dhcp ip=eth2:dhcp bootdev=eth1" \
|
||||
"eth1 eth2" || return 1
|
||||
"root=nfs:192.168.50.1:/nfs/client ip=ens4:dhcp ip=ens5:dhcp bootdev=ens4" \
|
||||
"ens4 ens5" || return 1
|
||||
|
||||
# Require three interfaces with dhcp root-path
|
||||
client_test "MULTINIC root=dhcp ip=eth0:dhcp ip=eth1:dhcp ip=eth2:dhcp bootdev=eth2" \
|
||||
client_test "MULTINIC root=dhcp ip=ens3:dhcp ip=ens4:dhcp ip=ens5:dhcp bootdev=ens5" \
|
||||
00 01 02 \
|
||||
"root=dhcp ip=eth0:dhcp ip=eth1:dhcp ip=eth2:dhcp bootdev=eth2" \
|
||||
"eth0 eth1 eth2" || return 1
|
||||
"root=dhcp ip=ens3:dhcp ip=ens4:dhcp ip=ens5:dhcp bootdev=ens5" \
|
||||
"ens3 ens4 ens5" || return 1
|
||||
|
||||
kill_server
|
||||
return 0
|
||||
|
Reference in New Issue
Block a user