diff options
author | Bill Peck <bpeck@redhat.com> | 2013-05-23 14:48:38 -0400 |
---|---|---|
committer | Bill Peck <bpeck@redhat.com> | 2013-05-23 14:48:38 -0400 |
commit | 994903f001c042ea4067331f8f668e5ddc9de51c (patch) | |
tree | 3ad42636cfecdc950d0147f5e733e5596981e008 | |
parent | 845402ded9b351974480841077745037899ecdd3 (diff) | |
download | tests-994903f001c042ea4067331f8f668e5ddc9de51c.tar.gz tests-994903f001c042ea4067331f8f668e5ddc9de51c.tar.xz tests-994903f001c042ea4067331f8f668e5ddc9de51c.zip |
Fix for rhel3
-rwxr-xr-x | kernel/kernelinstall/runtest.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/kernelinstall/runtest.sh b/kernel/kernelinstall/runtest.sh index 21073ef..3debc27 100755 --- a/kernel/kernelinstall/runtest.sh +++ b/kernel/kernelinstall/runtest.sh @@ -401,7 +401,12 @@ function SelectKernelGrubby () fi # match vmlinuz with $VR and $EXTRA, take first shortest match - vmlinuz=$(rpm -ql $testkernbase.$kernarch | grep -e /vmlinu.-$VR | grep "$EXTRA" | awk '{print length"\t"$0}' | sort -n | cut -f2- | head -1) + if [ -e "/etc/grub.conf" ]; then + # If /etc/grub.conf exists, make sure the requested kernel exists in /etc/grub.conf + vmlinuz=$(for kernel in $(rpm -ql $testkernbase | grep -e /vmlinu.-$VR | grep "$EXTRA" | awk '{print length"\t"$0}' | sort -n | cut -f2-); do grep -q ${kernel#/boot} /etc/grub.conf && echo $kernel; done | head -1) + else + vmlinuz=$(rpm -ql $testkernbase.$kernarch | grep -e /vmlinu.-$VR | grep "$EXTRA" | awk '{print length"\t"$0}' | sort -n | cut -f2- | head -1) + fi if [ -n "$vmlinuz" ]; then grubby --set-default "$vmlinuz" |