diff --git a/initrd_hooks/lipnsa.hook.sh b/initrd_hooks/lipnsa.hook.sh index 94be07c01fc8fe163f36e4485713a8395a36e759..2760be628c63b79c489edb2ed1c5dedd946964bd 100755 --- a/initrd_hooks/lipnsa.hook.sh +++ b/initrd_hooks/lipnsa.hook.sh @@ -3,15 +3,25 @@ # Lars Beckers, larsb@fsmpi.rwth-aachen.de, September 2014 LIPSTICK="/root/cdrom" -if [ -n "$1" ] && [ ! "$1" == "--help" ]; then +LOGFUNCTIONSSOURCE="/scripts/casper-functions" +TARGET="/root" + +if [ -e "${LOGFUNCTIONSSOURCE}" ]; then + source ${LOGFUNCTIONSSOURCE} +else + echo "Warning: ${LOGFUNCTIONSSOURCE} does not exist. Cannot source casper functions!" +fi + +if [ -n "$1" ] && [ -d "$1" ]; then LIPSTICK="$1" + shift +else + log_warning_msg "LIPSTICK mount point not specified. Falling back to ${LIPSTICK}." fi LIPSTATS="${LIPSTICK}/lipstats" -TARGET="/root" -LOGFUNCTIONSSOURCE="/scripts/casper-functions" -if [ "$1" == "--help" ]; then +if [ $# -gt 0 ]; then echo "collects system information, i.e. hardware and what the kernel thinks about it" echo "called as liphook before leaving initramfs" echo "usage: lipnsa.sh" @@ -41,8 +51,6 @@ if [ "$1" == "--help" ]; then exit fi -source ${LOGFUNCTIONSSOURCE} - if [ -f /proc/cmdline ]; then grep fnord /proc/cmdline if [ $? == 0 ]; then