Merge "Use common element select-boot-kernel-initrd"

This commit is contained in:
Jenkins 2014-06-27 07:00:14 +00:00 committed by Gerrit Code Review
commit ec200af0f8
2 changed files with 4 additions and 11 deletions

View File

@ -0,0 +1 @@
select-boot-kernel-initrd

View File

@ -3,16 +3,8 @@
set -eu
set -o pipefail
# 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
RET=$(/bin/select-boot-kernel-initrd)
KERNEL_VERSION=`echo ${RET%:*} | sed 's/vmlinuz-//g'`
RAMDISK=/boot/${RET#*:}
dracut --force --add "network" $RAMDISK $KERNEL_VERSION