It appears images in the public cloud uses Grub 2 instead of Grub 1
configuration.
Change-Id: I138f8d118d81ae2b64bae84e1f0cc4a0f0d3771f
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
# run quietly, so we may not notice the failure. This script retries for a
# few times before giving up.
initramfs_ver=$(rpm -q kernel | tail -1 | sed "s/kernel-/initramfs-/")
# run quietly, so we may not notice the failure. This script retries for a
# few times before giving up.
initramfs_ver=$(rpm -q kernel | tail -1 | sed "s/kernel-/initramfs-/")
+ grub_conf="/boot/grub/grub.conf"
+ # Public cloud does not use /boot/grub/grub.conf and uses grub2 instead.
+ if [ ! -e "$grub_conf" ]; then
+ echo "$grub_conf not found. Using Grub 2 conf instead."
+ grub_conf="/boot/grub2/grub.cfg"
+ fi
+
- if grep "$initramfs_ver" /boot/grub/grub.conf; then
+ if grep "$initramfs_ver" "$grub_conf"; then
break
fi
echo "Kernel initrd missing. Retrying to install kernel..."
yum reinstall -y kernel
done
break
fi
echo "Kernel initrd missing. Retrying to install kernel..."
yum reinstall -y kernel
done
- if ! grep "$initramfs_ver" /boot/grub/grub.conf; then
+ if ! grep "$initramfs_ver" "$grub_conf"; then
cat /boot/grub/grub.conf
echo "ERROR: Failed to install kernel."
exit 1
cat /boot/grub/grub.conf
echo "ERROR: Failed to install kernel."
exit 1