diff --git a/kdump_build_helpers/populate_udev_files b/kdump_build_helpers/populate_udev_files new file mode 100755 index 0000000..e54aadc --- /dev/null +++ b/kdump_build_helpers/populate_udev_files @@ -0,0 +1,24 @@ +#!/bin/sh + +. /etc/kdump-adv-conf/mkdumprd2_functions + +BASE_DIR=$1 +STAGE_DIR=$BASE_DIR/stage + +# This just grabs all the essential bits from udev into the initramfs +for i in `rpm -qli udev | grep ^/ | grep -v man | grep -v doc` +do + if [ ! -e $i ] + then + continue + fi + + if [ -d $i ] + then + mkdir -p $STAGE_DIR/$i + else + MODE=`stat $i | grep "Access: (" | sed -e 's/\(Access: (\)\([0-7]\{4\}\)\(.*\)/\2/'` + install_with_deps $i $MODE + fi +done +exit 0 diff --git a/kdump_initscripts/kdumpinit.rootfs b/kdump_initscripts/kdumpinit.rootfs new file mode 100644 index 0000000..cbf7e6d --- /dev/null +++ b/kdump_initscripts/kdumpinit.rootfs @@ -0,0 +1,33 @@ +#!/bin/msh + +################################################### +# Start by setting up the console to work as a user +# expects +################################################### +exec >/dev/console 2>&1 +export TERM=linux +export PS1='initramfs-test:\w\$ ' +stty sane + + +################################################## +# Start udev up +################################################## +start_udev + +################################################## +# Load all the modules based on +# /etc/module_load_list +################################################## +load_all_modules + + + + + + + +################################################## +# Reboot the system to get back to production +################################################## +reboot -f diff --git a/kdump_runtime_helpers/start_udev b/kdump_runtime_helpers/start_udev new file mode 100755 index 0000000..d84ede2 --- /dev/null +++ b/kdump_runtime_helpers/start_udev @@ -0,0 +1,14 @@ +if [ ! -x /bin/udevd ] +then + echo "udev isn't installed in this initramfs!" + exit 0 +fi + +# Sart the daemon +udevd --daemon + +# Trigger coldplug events +udevadm trigger >/dev/null 2>&1 + +#Wait for events to complete +udevadm settle --timeout=30 >/dev/null 2>&1 diff --git a/manifest b/manifest index bbb5a73..faa070e 100644 --- a/manifest +++ b/manifest @@ -11,7 +11,6 @@ # 1) reg # reg # A regular file copy from the source to the dst directory -# # 2) creg # creg # like reg, but only copy if the source file exists @@ -47,6 +46,13 @@ #################################################### exec populate_kdump_std_files + +#################################################### +# Pull in udev so that we can easily setup block +# devices for lvm and all that +#################################################### +exec populate_udev_files + #################################################### # This is a rudimentary module population script # It looks at the currently loaded modules, copies them @@ -56,12 +62,6 @@ exec populate_kdump_std_files ################################################### exec generate_module_list -################################################### -# If we have one, copy the critical disk list -# so we don't try to start lvm/mdraid to early -################################################### -creg /etc/kdump-adv-conf/critical_disks /etc - ################################################### # Lets get all our lvm and mdraid configs on board ################################################### @@ -77,4 +77,4 @@ gen awk /etc/fstab '/^[^#]/{print $1 " /mnt"$2 " "$3 " "$4 " "$5 " "$6}' /etc/fs # Grab the standard initscript to capture to the local # rootfs ################################################### -ren /usr/share/kexec-tools/kdumpinit.rootfs /init +#ren /usr/share/kexec-tools/kdumpinit.rootfs /init diff --git a/mkdumprd2_functions b/mkdumprd2_functions index 00a82da..3ccfdb1 100755 --- a/mkdumprd2_functions +++ b/mkdumprd2_functions @@ -13,7 +13,7 @@ load_dependent_libs() local BIN=$1 local LIB="" - ldd $BIN | grep -q "not a dynamic executable" + ldd $BIN 2>/dev/null | grep -q "not a dynamic executable" if [ $? == 0 ] then #There are no dependencies, we're done