memtest86plus/memtest-setup
Warren Togami 41d91a7d18 - Bug #494157 rename elf binary so it doesn't accidentally copy the elf
binary during livecd-creator
- Put scripts into CVS
2009-04-24 17:33:51 +00:00

40 lines
914 B
Bash
Executable File

#!/bin/bash
# package name
PNAME="memtest86+"
# executable
ENAME="elf-memtest86+"
if [ -d /sys/firmware/efi ]; then
echo "memtest86+ does not support EFI platforms."
exit 254
fi
MTVERSION=`rpm -q --qf '%{version}' $PNAME`
MTPATH="/boot/$ENAME-$MTVERSION"
MENT=`cat /boot/grub/grub.conf | grep "$ENAME-$MTVERSION"` &> /dev/null
if [ "$MENT" != "" ]; 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 /$ENAME,kernel --type=netbsd /$ENAME," /boot/grub/grub.conf
sed -i -e"s,/$ENAME-$MTVERSION.*,/$ENAME-$MTVERSION," /boot/grub/grub.conf
fi
echo "Setup complete."