#!/bin/bash if [ -d /sys/firmware/efi ]; then echo "memtest86+ does not support EFI platforms." exit 254 fi MTVERSION=`rpm -q --qf '%{version}' memtest86+` MTPATH="/boot/memtest86+-$MTVERSION" /sbin/grubby --info=$MTPATH > /dev/null 2> /dev/null if [ "$?" = 0 ]; then echo "$MTPATH is already configured. Exiting..." exit 0 fi if [ ! -f $MTPATH ]; then echo "ERROR: $MTPATH does not exist." exit 255 fi /sbin/new-memtest-pkg --install $MTVERSION --banner="Memtest86+" RETVAL="$?" if [ "$RETVAL" != "0" ]; then echo "ERROR: grubby failed to configure your bootloader for $MTPATH." exit $RETVAL else sed -i -e's,kernel /memtest86+,kernel --type=netbsd /memtest86+,' /boot/grub/grub.conf sed -i -e"s,/memtest86+-$MTVERSION.*,/memtest86+-$MTVERSION," /boot/grub/grub.conf fi echo "Setup complete."