#!/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/installkernel -a -f /boot/vmlinuz-$KERNEL_VERSION -a -f /boot/System.map-$KERNEL_VERSION ]; then cp /boot/vmlinuz-$KERNEL_VERSION /boot/.vmlinuz-$KERNEL_VERSION-qstor cp /boot/System.map-$KERNEL_VERSION /boot/.System.map-$KERNEL_VERSION-qstor rm -f /boot/vmlinuz-$KERNEL_VERSION /boot/System.map-$KERNEL_VERSION /sbin/installkernel $KERNEL_VERSION /boot/.vmlinuz-$KERNEL_VERSION-qstor /boot/.System.map-$KERNEL_VERSION-qstor rm -f /boot/.vmlinuz-$KERNEL_VERSION-qstor /boot/.System.map-$KERNEL_VERSION-qstor elif [ -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 elif [ -f /etc/SUSE-brand ]; then dracut -f --regenerate-all else echo "Dont know how to create initrd image" fi