2013-06-05 13:17:59 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2014-03-29 03:28:22 +00:00
|
|
|
set -eu
|
|
|
|
set -o pipefail
|
|
|
|
|
2013-10-17 11:11:30 +00:00
|
|
|
# Prioritize PAE if present
|
|
|
|
KERNEL=$(basename `ls -1rv /boot/vmlinuz* | grep PAE | grep -v debug | head -1`)
|
|
|
|
if [ ! $KERNEL ]; then
|
|
|
|
KERNEL=$(basename `ls -1rv /boot/vmlinuz* | grep -v debug | head -1`)
|
|
|
|
if [ ! $KERNEL ]; then
|
|
|
|
echo "No suitable kernel found."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
KERNEL_VERSION=`echo $KERNEL | sed 's/vmlinuz-//g'`
|
|
|
|
RAMDISK=/boot/initramfs-$KERNEL_VERSION.img
|
2013-06-05 13:17:59 +00:00
|
|
|
|
2013-10-17 11:11:30 +00:00
|
|
|
dracut --force --add "network" $RAMDISK $KERNEL_VERSION
|