Updating dracut files for adv conf
This commit is contained in:
parent
1ba30b74b1
commit
54d952b315
@ -60,7 +60,7 @@ function check_config()
|
||||
then
|
||||
MKDUMPRD=$DRACUT_CMD
|
||||
else
|
||||
MKDUMPRD="dracut -c /etc/kdump-adv-conf/initramfs.conf"
|
||||
MKDUMPRD="dracut -f -c /etc/kdump-adv-conf/initramfs.conf"
|
||||
fi
|
||||
# We always rebuild here, since it takes longer
|
||||
# to figure out if anything has changed
|
||||
@ -111,7 +111,7 @@ function check_config()
|
||||
[ "$kernel_time" -gt "$image_time" ]; then
|
||||
echo "Detected $KDUMP_CONFIG_FILE or $kdump_kernel change"
|
||||
echo "Rebuilding $kdump_initrd"
|
||||
$MKDUMPRD -d -f $kdump_initrd $kdump_kver
|
||||
$MKDUMPRD $kdump_initrd $kdump_kver
|
||||
if [ $? != 0 ]; then
|
||||
echo "Failed to run mkdumprd"
|
||||
$LOGGER "mkdumprd: failed to make kdump initrd"
|
||||
|
@ -1,3 +0,0 @@
|
||||
#!/bin/bash
|
||||
[[ $1 = -d ]] && echo udev-rules
|
||||
exit 0
|
@ -1,108 +0,0 @@
|
||||
getarg() {
|
||||
local o line
|
||||
if [ -z "$CMDLINE" ]; then
|
||||
read CMDLINE_ETC </etc/cmdline;
|
||||
read CMDLINE </proc/cmdline;
|
||||
CMDLINE="$CMDLINE $CMDLINE_ETC"
|
||||
fi
|
||||
for o in $CMDLINE; do
|
||||
[ "$o" = "$1" ] && return 0
|
||||
[ "${o%%=*}" = "${1%=}" ] && { echo ${o#*=}; return 0; }
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
getargs() {
|
||||
local o line found
|
||||
if [ -z "$CMDLINE" ]; then
|
||||
read CMDLINE_ETC </etc/cmdline;
|
||||
read CMDLINE </proc/cmdline;
|
||||
CMDLINE="$CMDLINE $CMDLINE_ETC"
|
||||
fi
|
||||
for o in $CMDLINE; do
|
||||
[ "$o" = "$1" ] && return 0
|
||||
if [ "${o%%=*}" = "${1%=}" ]; then
|
||||
echo -n "${o#*=} ";
|
||||
found=1;
|
||||
fi
|
||||
done
|
||||
[ -n "$found" ] && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
source_all() {
|
||||
local f
|
||||
[ "$1" ] && [ -d "/$1" ] || return
|
||||
for f in "/$1"/*.sh; do [ -f "$f" ] && . "$f"; done
|
||||
}
|
||||
|
||||
source_conf() {
|
||||
local f
|
||||
[ "$1" ] && [ -d "/$1" ] || return
|
||||
for f in "/$1"/*.conf; do [ -f "$f" ] && . "$f"; done
|
||||
}
|
||||
|
||||
die() {
|
||||
{
|
||||
echo "<1>dracut: FATAL: $@";
|
||||
echo "<1>dracut: Refusing to continue";
|
||||
} > /dev/kmsg
|
||||
|
||||
{
|
||||
echo "dracut: FATAL: $@";
|
||||
echo "dracut: Refusing to continue";
|
||||
} >&2
|
||||
|
||||
exit 1
|
||||
}
|
||||
|
||||
warn() {
|
||||
echo "<4>dracut Warning: $@" > /dev/kmsg
|
||||
echo "dracut Warning: $@" >&2
|
||||
}
|
||||
|
||||
info() {
|
||||
if [ -z "$DRACUT_QUIET" ]; then
|
||||
DRACUT_QUIET="no"
|
||||
getarg quiet && DRACUT_QUIET="yes"
|
||||
fi
|
||||
echo "<6>dracut: $@" > /dev/kmsg
|
||||
[ "$DRACUT_QUIET" != "yes" ] && \
|
||||
echo "dracut: $@"
|
||||
}
|
||||
|
||||
vinfo() {
|
||||
while read line; do
|
||||
info $line;
|
||||
done
|
||||
}
|
||||
|
||||
check_occurances() {
|
||||
# Count the number of times the character $ch occurs in $str
|
||||
# Return 0 if the count matches the expected number, 1 otherwise
|
||||
local str="$1"
|
||||
local ch="$2"
|
||||
local expected="$3"
|
||||
local count=0
|
||||
|
||||
while [ "${str#*$ch}" != "${str}" ]; do
|
||||
str="${str#*$ch}"
|
||||
count=$(( $count + 1 ))
|
||||
done
|
||||
|
||||
[ $count -eq $expected ]
|
||||
}
|
||||
|
||||
incol2() {
|
||||
local dummy check;
|
||||
local file="$1";
|
||||
local str="$2";
|
||||
|
||||
[ -z "$file" ] && return;
|
||||
[ -z "$str" ] && return;
|
||||
|
||||
while read dummy check restofline; do
|
||||
[ "$check" = "$str" ] && return 0
|
||||
done < $file
|
||||
return 1
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ "$1" = "--onetime" ]; then
|
||||
onetime="yes"
|
||||
shift
|
||||
fi
|
||||
echo "$@" > /tmp/$$.sh
|
||||
if [ -n "$onetime" ]; then
|
||||
echo '[ -e "$job" ] && rm "$job"' >> /tmp/$$.sh
|
||||
fi
|
||||
mv /tmp/$$.sh /initqueue/
|
||||
>> /initqueue/work
|
@ -1,23 +1,3 @@
|
||||
#!/bin/bash
|
||||
dracut_install mount mknod mkdir modprobe pidof sleep chroot \
|
||||
sed ls flock cp mv dmesg rm ln
|
||||
if [ ! -e "${initdir}/bin/sh" ]; then
|
||||
dracut_install bash
|
||||
(ln -s bash "${initdir}/bin/sh" || :)
|
||||
fi
|
||||
# install our scripts and hooks
|
||||
rm -f $initdir/init
|
||||
inst "/etc/kdump-adv-conf/init" "/init"
|
||||
inst "$moddir/initqueue" "/sbin/initqueue"
|
||||
mkdir -p ${initdir}/initqueue
|
||||
mkdir -p ${initdir}/tmp
|
||||
# Bail out if switch_root does not exist
|
||||
if which switch_root >/dev/null 2>&1; then
|
||||
dracut_install switch_root
|
||||
else
|
||||
inst "$moddir/switch_root" "/sbin/switch_root" \
|
||||
|| derror "Failed to install switch_root"
|
||||
fi
|
||||
inst "$moddir/dracut-lib.sh" "/lib/dracut-lib.sh"
|
||||
inst_hook cmdline 10 "$moddir/parse-root-opts.sh"
|
||||
inst_hook cmdline 20 "$moddir/parse-blacklist.sh"
|
||||
inst_hook pre-pivot 50 "$moddir/selinux-loadpolicy.sh"
|
||||
|
@ -1,5 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
for p in $(getargs rdblacklist=); do
|
||||
echo "blacklist $p" >> /etc/modprobe.d/initramfsblacklist.conf
|
||||
done
|
@ -1,13 +0,0 @@
|
||||
root=$(getarg root=)
|
||||
|
||||
if rflags="$(getarg rootflags=)"; then
|
||||
getarg rw && rflags="${rflags},rw" || rflags="${rflags},ro"
|
||||
else
|
||||
getarg rw && rflags=rw || rflags=ro
|
||||
fi
|
||||
|
||||
fstype="$(getarg rootfstype=)"
|
||||
if [ -z "$fstype" ]; then
|
||||
fstype="auto"
|
||||
fi
|
||||
|
@ -1,11 +0,0 @@
|
||||
#!/bin/sh
|
||||
# FIXME: load selinux policy. this should really be done after we switchroot
|
||||
if [ -x "$NEWROOT/usr/sbin/load_policy" ] && [ -e "$NEWROOT/etc/sysconfig/selinux" ]; then
|
||||
chroot $NEWROOT /usr/sbin/load_policy -i
|
||||
if [ $? -eq 3 ]; then
|
||||
echo "Initial SELinux policy load failed and enforcing mode requested."
|
||||
echo "Not continuing"
|
||||
sleep 100d
|
||||
exit 1
|
||||
fi
|
||||
fi
|
@ -6,4 +6,4 @@
|
||||
#########################################################
|
||||
|
||||
|
||||
dracutmodules="base crypt lvm kernel-modules rootfs-block udev-rules"
|
||||
dracutmodules="base kdumpbase crypt lvm kernel-modules rootfs-block udev-rules"
|
||||
|
@ -28,7 +28,7 @@ Source100: dracut-files.tbz2
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
Requires(pre): coreutils chkconfig sed zlib
|
||||
Requires: busybox >= 1.2.0
|
||||
Requires: busybox >= 1.2.0, dracut
|
||||
BuildRequires: dash
|
||||
BuildRequires: zlib-devel zlib zlib-static elfutils-devel-static glib2-devel
|
||||
BuildRequires: pkgconfig intltool gettext
|
||||
|
2
sources
2
sources
@ -1,4 +1,4 @@
|
||||
d9f2ecd3c3307905f24130a25816e6cc kexec-tools-2.0.0.tar.bz2
|
||||
3e802d638dce0080b910f15908c04a24 kexec-tools-po.tar.gz
|
||||
190f8878aa7e7b63a96fde5d59538eec makedumpfile-1.3.3.tar.gz
|
||||
95149c97537d0fb65eda72f4e53a0316 dracut-files.tbz2
|
||||
925dc7a5121fbb8eab854375d7ea4d1d dracut-files.tbz2
|
||||
|
Loading…
Reference in New Issue
Block a user