2009-05-20 16:42:31 +00:00
|
|
|
#!/bin/sh
|
2009-05-20 15:13:01 +00:00
|
|
|
|
|
|
|
###################################################
|
|
|
|
# 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
|
|
|
|
##################################################
|
2009-05-20 16:42:31 +00:00
|
|
|
load_modules
|
2009-05-20 15:13:01 +00:00
|
|
|
|
2009-07-02 19:33:05 +00:00
|
|
|
##################################################
|
|
|
|
# Assemble any existing lvm arrays
|
|
|
|
##################################################
|
|
|
|
assemble_lvm_array
|
|
|
|
|
|
|
|
|
|
|
|
##################################################
|
|
|
|
# Assemble any mdraid partitions that might exist
|
|
|
|
##################################################
|
|
|
|
#TODO - FILL ME IN
|
2009-05-20 15:13:01 +00:00
|
|
|
|
|
|
|
|
2009-07-02 19:33:05 +00:00
|
|
|
##################################################
|
|
|
|
# Mount the root file system
|
|
|
|
# Note that the sample manifest modified
|
|
|
|
# The /etc/fstab file to put the root file system
|
|
|
|
# under /mnt directly
|
|
|
|
##################################################
|
|
|
|
mount /mnt
|
|
|
|
if [ $? -ne 0]
|
|
|
|
echo "Failed to mount root fs for dump capture. rebooting"
|
|
|
|
reboot -f
|
|
|
|
fi
|
2009-05-20 15:13:01 +00:00
|
|
|
|
|
|
|
|
2009-07-02 19:33:05 +00:00
|
|
|
##################################################
|
|
|
|
# Now capture the core dump to the target fs
|
|
|
|
# Note we need to set the date here
|
|
|
|
##################################################
|
|
|
|
if [ -f /etc/clock ]
|
|
|
|
then
|
|
|
|
. /etc/clock
|
|
|
|
fi
|
|
|
|
if [ "$UTC" == "true" ]
|
|
|
|
then
|
|
|
|
TIME_FORMAT=-u
|
|
|
|
else
|
|
|
|
TIME_FORMAT=-l
|
|
|
|
fi
|
|
|
|
hwclock --hctosys $TIME_FORMAT
|
2009-05-20 15:13:01 +00:00
|
|
|
|
2009-07-02 19:33:05 +00:00
|
|
|
DATE=`date +%Y-%m-%d-%T`
|
2009-05-20 15:13:01 +00:00
|
|
|
|
2009-07-02 19:33:05 +00:00
|
|
|
cp /proc/vmcore /mnt/var/crash/$DATE/vmcore
|
|
|
|
|
2009-05-20 15:13:01 +00:00
|
|
|
##################################################
|
|
|
|
# Reboot the system to get back to production
|
|
|
|
##################################################
|
|
|
|
reboot -f
|