Package: memtest86+
Version: 4.20-1.1
Followup-For: Bug #612371

Dear Maintainer,

I added two more variables in /etc/default/grub for being able to 
enabling/disabling the serial and the multiboot menuentry.

Here is what I did:
1.) In /etc/default/grub I added these lines:
GRUB_MEMTEST_ENABLE_SERIAL=false
GRUB_MEMTEST_ENABLE_MULTIBOOT=false
2.) In /usr/sbin/grub-mkconfig I added these variables to the list of exportet 
variables:
at line 280:
  GRUB_MEMTEST_SERIAL_PARAMS \
  GRUB_MEMTEST_ENABLE_SERIAL \
  GRUB_MEMTEST_ENABLE_MULTIBOOT
3.) I modified /etc/grub.d/20_memtest86+:
Two times:
....
 if [ "${GRUB_MEMTEST_ENABLE_SERIAL}" = "true" ]; then
 ...
 fi
....
One time:
if [ "${GRUB_MEMTEST_ENABLE_MULTIBOOT}" = "true" ]; then
 ...
fi

I'm not sure if it's the best solution, but at least it works...
See my attached patch-files.


-- System Information:
Debian Release: 7.8
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable'), (500, 'oldstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=de_DE (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/dash

Versions of packages memtest86+ depends on:
ii  debconf [debconf-2.0]  1.5.49

memtest86+ recommends no packages.

Versions of packages memtest86+ suggests:
ii  grub-pc              1.99-27+deb7u2
pn  hwtools              <none>
pn  kernel-patch-badram  <none>
pn  memtest86            <none>
pn  memtester            <none>
pn  mtools               <none>

-- Configuration Files:
/etc/grub.d/20_memtest86+ changed [not included]

-- debconf information excluded
--- /tmp/grub-mkconfig	2011-09-19 05:12:37.000000000 +0200
+++ /usr/sbin/grub-mkconfig	2015-02-18 16:56:41.151090002 +0100
@@ -276,7 +276,10 @@
   GRUB_DISABLE_OS_PROBER \
   GRUB_INIT_TUNE \
   GRUB_SAVEDEFAULT \
-  GRUB_BADRAM
+  GRUB_BADRAM \
+  GRUB_MEMTEST_SERIAL_PARAMS \
+  GRUB_MEMTEST_ENABLE_SERIAL \
+  GRUB_MEMTEST_ENABLE_MULTIBOOT
 
 if test "x${grub_cfg}" != "x"; then
   rm -f ${grub_cfg}.new
--- /tmp/20_memtest86+	2010-10-19 18:32:29.000000000 +0200
+++ /etc/grub.d/20_memtest86+	2015-02-18 17:47:52.385794462 +0100
@@ -30,16 +30,21 @@
   cat << EOF
 	$LX	$MEMTESTPATH
 }
-menuentry "Memory test (memtest86+, serial console 115200)" {
+EOF
+ if [ "${GRUB_MEMTEST_ENABLE_SERIAL}" = "true" ]; then
+  cat << EOF
+menuentry "Memory test (memtest86+, serial console)" {
 EOF
   printf '%s\n' "${prepare_boot_cache}"
   cat << EOF
-	$LX	$MEMTESTPATH console=ttyS0,115200n8
+	$LX	$MEMTESTPATH console=${GRUB_MEMTEST_SERIAL_PARAMS}
 }
 EOF
+ fi
 fi
 
-if test -e /boot/memtest86+_multiboot.bin ; then
+if [ "${GRUB_MEMTEST_ENABLE_MULTIBOOT}" = "true" ]; then
+ if test -e /boot/memtest86+_multiboot.bin ; then
   MEMTESTPATH=$( make_system_path_relative_to_its_root "/boot/memtest86+_multiboot.bin" )
   echo "Found memtest86+ multiboot image: $MEMTESTPATH" >&2
   cat << EOF
@@ -49,11 +54,16 @@
   cat << EOF
 	multiboot	$MEMTESTPATH
 }
-menuentry "Memory test (memtest86+, serial console 115200, experimental multiboot)" {
+EOF
+  if [ "${GRUB_MEMTEST_ENABLE_SERIAL}" = "true" ]; then
+   cat << EOF
+menuentry "Memory test (memtest86+, experimental multiboot, serial console)" {
 EOF
   printf '%s\n' "${prepare_boot_cache}"
   cat << EOF
-	multiboot	$MEMTESTPATH console=ttyS0,115200n8
+	multiboot	$MEMTESTPATH console=${GRUB_MEMTEST_SERIAL_PARAMS}
 }
 EOF
+  fi
+ fi
 fi

Reply via email to