#!/bin/sh set -x KERNEL_VERSION=`uname -r` INSTALL_PATH="/boot/" #each system has its own way, based on the presence of a few executables, we can assume certain things echo "Recreating initrd image" if [ -x /sbin/new-kernel-pkg ]; then if [ -x /sbin/dracut ]; then /sbin/new-kernel-pkg --mkinitrd --dracut --host-only --depmod --install $KERNEL_VERSION else /sbin/new-kernel-pkg --mkinitrd --depmod --install $KERNEL_VERSION fi /sbin/new-kernel-pkg --rpmposttrans $KERNEL_VERSION elif [ -x /usr/sbin/update-initramfs ]; then /usr/sbin/update-initramfs -c -t -k $KERNEL_VERSION elif [ -x /sbin/mkinitrd -a -d /lib/modules/$KERNEL_VERSION ]; then #Assume SLES For now /sbin/mkinitrd -k vmlinuz-$KERNEL_VERSION \ -i initrd-$KERNEL_VERSION \ -b $INSTALL_PATH else echo "Dont know how to create initrd image" fi