Bug#229649: patch to add this

Jason Thomas Jason Thomas <jason@debian.org>, 229649@bugs.debian.org
Wed, 18 Aug 2004 17:03:05 +1000


--/unnNtmY43mpUSKx
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

tags 229649 + patch
thanks

Heres a patch to add this

-- 
Jason

"I hope you learn speaking English proper I hope speak I me you."
     -- Branden Robinson, 2001

--/unnNtmY43mpUSKx
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="grub_memtest86-entry.diff"

diff -Naur grub-0.95+cvs20040624.orig/debian/update-grub grub-0.95+cvs20040624/debian/update-grub
--- grub-0.95+cvs20040624.orig/debian/update-grub	2004-08-18 16:48:13.000000000 +1000
+++ grub-0.95+cvs20040624/debian/update-grub	2004-08-18 17:01:38.000000000 +1000
@@ -256,6 +256,9 @@
 # this does not include the alternative kernels
 	howmany="all"
 
+# should grub create a memtest86 entry
+	memtest86="true"
+
 # stores the command line arguments
 	command_line_arguments=$1
 
@@ -590,6 +593,9 @@
 # Extract the howmany value
 howmany=$(GetMenuOpt "howmany" "$howmany")
 
+# Extract the memtest86 value
+memtest86=$(GetMenuOpt "memtest86" "$memtest86")
+
 # Generate the menu options we want to insert
 buffer=$(tempfile)
 echo $start >> $buffer
@@ -648,6 +654,13 @@
 echo "# howmany=$howmany" >> $buffer
 echo >> $buffer
 
+
+echo "## should update-grub create memtest86 boot option" >> $buffer
+echo "## e.g. memtest86=true" >> $buffer
+echo "##      memtest86=false" >> $buffer
+echo "# memtest86=$memtest86" >> $buffer
+echo >> $buffer
+
 echo "## ## End Default Options ##" >> $buffer
 echo >> $buffer
 
@@ -677,6 +690,12 @@
 	sortedKernels="/boot/vmlinuz $sortedKernels"
 fi
 
+# figure out where grub looks for the kernels at boot time
+kernel_dir=/boot
+if [ -n "$boot_device" ] ; then
+	kernel_dir=
+fi
+
 ## heres where we start writing out the kernel entries
 counter=0
 for kern in $sortedKernels ; do
@@ -691,12 +710,6 @@
 	initrdName=$(FindInitrdName "/boot" "$kernelVersion")
 	initrd=""
 
-	# figure out where grub looks for the kernels at boot time
-	kernel_dir=/boot
-	if [ -n "$boot_device" ] ; then
-		kernel_dir=
-	fi
-
 	kernel=$kernel_dir/$kernelName
 	if [ -n "$initrdName" ] ; then
 		initrd=$kernel_dir/$initrdName
@@ -743,6 +756,20 @@
 	fi
 done
 
+if test ! x"$memtest86" = x"false" ; then
+	if test -f "$kernel_dir/memtest86.bin" ; then
+		kernelVersion="memtest86"
+		kernel="$kernel_dir/memtest86.bin"
+		currentOpt=
+		initrd=
+
+		echo "Found kernel: $kernel"
+
+		write_kernel_entry "$kernelVersion" "" "" "$grub_root_device" \
+		"$kernel" "$currentOpt" "" "$initrd"
+	fi
+fi
+
 echo $end >> $buffer
 
 echo -n "Updating $menu ... "

--/unnNtmY43mpUSKx--