All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [bug #44238] Add support for menu.c32 and vesamenu.c32 in lib/syslinux_parse
@ 2015-03-17 17:40 The Gluglug
  0 siblings, 0 replies; 9+ messages in thread
From: The Gluglug @ 2015-03-17 17:40 UTC (permalink / raw)
  To: lunar; +Cc: grub-devel

[-- Attachment #1: Type: text/plain, Size: 1283 bytes --]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

This is a new rebased version of the patch that Lunar linked me to:
https://people.torproject.org/~lunar/volatile/2015-03-17-e3Yp1d7FifQ/0001-lib-syslinux_parse-add-support-for-vesa-menu.c32.patch

I also attached it.

Debian ISOLINUX menu is still broken (syslinux_configfile -i just
puts you back to the main screen but with the Debian background).
(same issue on gnewsense)
^ this also happens without the patch

Tails ISOLINUX menu now works. (without the patch, it would show the
same behaviour as with Debian, mentioned above)

I also tested Trisquel, Trisquel Mini and Parabola - these all still
work (they also worked before the patch).

Tested on a ThinkPad X60 running libreboot (deblobbed coreboot), with
the GRUB payload.

Regards,
Francis Rowe.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAEBAgAGBQJVCGcPAAoJEP9Ft0z50c+UjAcH/Ru66PfB/1VojyWXAWpFwTK/
j2cSXKZvAnca9mZPILAGX+YPTK64u9hhTnVbLmD6xEPtuNUrYJ0bOJMx3soOluhS
uKxkFpjJaLVQLT/xUyg3qyblkRzGhBmLks11RirVMPiQoD2B5CTjSFxVwOMEuWtp
QJOuE/PFq6kb7BitEE6a8u57G9sM/VsY3rZCHF/DsqNdlCcul0pnbfELHApF+xYo
As4TkwvwoxVc5OuWVVReGMKv7Kg6ysnM/KotAcmTSTaKL7Z9h1fcnNuCNs6EpTxC
p+KqWFayGFGXQBXuzt2UYdicvsd9Ot1jDZlq3rrxbPAVV5ak3MBSayxbxLJMNK0=
=1x6O
-----END PGP SIGNATURE-----

[-- Attachment #2: 0002-lib-syslinux_parse-add-support-for-vesa-menu.c32.patch --]
[-- Type: text/x-diff, Size: 5685 bytes --]

From 191aeee1b67ff30d6c868320a51cb9fb766874be Mon Sep 17 00:00:00 2001
From: Lunar <lunar@torproject.org>
Date: Fri, 13 Feb 2015 22:08:11 +0100
Subject: [PATCH] lib/syslinux_parse: add support for (vesa)menu.c32

Fixes Savannah bug #44238.
---
 grub-core/lib/syslinux_parse.c | 165 ++++++++++++++++++++++++++---------------
 1 file changed, 107 insertions(+), 58 deletions(-)

diff --git a/grub-core/lib/syslinux_parse.c b/grub-core/lib/syslinux_parse.c
index 22389eb..153260b 100644
--- a/grub-core/lib/syslinux_parse.c
+++ b/grub-core/lib/syslinux_parse.c
@@ -840,6 +840,82 @@ simplify_filename (char *str)
 }
 
 static grub_err_t
+print_config (struct output_buffer *outbuf,
+	      struct syslinux_menu *menu,
+              const char *filename, const char *basedir)
+{
+  struct syslinux_menu *menuptr;
+  grub_err_t err = GRUB_ERR_NONE;
+  char *new_cwd = NULL;
+  char *new_target_cwd = NULL;
+  char *newname = NULL;
+  int depth = 0;
+
+  new_cwd = get_read_filename (menu, basedir);
+  if (!new_cwd)
+    {
+      err = grub_errno;
+      goto out;
+    }
+  new_target_cwd = get_target_filename (menu, basedir);
+  if (!new_target_cwd)
+    {
+      err = grub_errno;
+      goto out;
+    }
+  newname = get_read_filename (menu, filename);
+  if (!newname)
+    {
+      err = grub_errno;
+      goto out;
+    }
+  simplify_filename (newname);
+
+  print_string ("#");
+  print_file (outbuf, menu, filename, NULL);
+  print_string (" ");
+  print (outbuf, newname, grub_strlen (newname));
+  print_string (":\n");
+
+  for (menuptr = menu; menuptr; menuptr = menuptr->parent, depth++)
+    if (grub_strcmp (menuptr->filename, newname) == 0
+        || depth > 20)
+      break;
+  if (menuptr)
+    {
+      print_string ("  syslinux_configfile -r ");
+      print_file (outbuf, menu, "/", NULL);
+      print_string (" -c ");
+      print_file (outbuf, menu, basedir, NULL);
+      print_string (" ");
+      print_file (outbuf, menu, filename, NULL);
+      print_string ("\n");
+    }
+  else
+    {
+      err = config_file (outbuf, menu->root_read_directory,
+                         menu->root_target_directory, new_cwd, new_target_cwd,
+                         newname, menu, menu->flavour);
+      if (err == GRUB_ERR_FILE_NOT_FOUND
+          || err == GRUB_ERR_BAD_FILENAME)
+        {
+          grub_errno = err = GRUB_ERR_NONE;
+          print_string ("# File ");
+          err = print (outbuf, newname, grub_strlen (newname));
+          if (err)
+            goto out;
+          print_string (" not found\n");
+        }
+    }
+
+ out:
+  grub_free (newname);
+  grub_free (new_cwd);
+  grub_free (new_target_cwd);
+  return err;
+}
+
+static grub_err_t
 write_entry (struct output_buffer *outbuf,
 	     struct syslinux_menu *menu,
 	     struct syslinux_menuentry *curentry)
@@ -1227,6 +1303,36 @@ write_entry (struct output_buffer *outbuf,
 	    break;
 	  }
 
+	if (grub_strcasecmp (basename, "menu.c32") == 0 ||
+	    grub_strcasecmp (basename, "vesamenu.c32") == 0)
+	  {
+	    char *ptr;
+	    char *end;
+
+	    ptr = curentry->append;
+	    if (!ptr)
+	      return grub_errno;
+
+	    while (*ptr)
+	      {
+		end = ptr;
+		for (end = ptr; *end && !grub_isspace (*end); end++);
+		if (*end)
+		  *end++ = '\0';
+
+		/* "~" is supposed to be current file, so let's skip it */
+		if (grub_strcmp (ptr, "~") != 0)
+		  {
+		    err = print_config (outbuf, menu, ptr, "");
+		    if (err != GRUB_ERR_NONE)
+		      break;
+                  }
+		for (ptr = end; *ptr && grub_isspace (*ptr); ptr++);
+	      }
+	    err = GRUB_ERR_NONE;
+	    break;
+	  }
+
 	/* FIXME: gdb, GFXBoot, Hdt, Ifcpu, Ifplop, Kbdmap,
 	   FIXME: Linux, Lua, Meminfo, rosh, Sanbboot  */
 
@@ -1239,70 +1345,13 @@ write_entry (struct output_buffer *outbuf,
       }
     case KERNEL_CONFIG:
       {
-	char *new_cwd, *new_target_cwd;
 	const char *ap;
 	ap = curentry->append;
 	if (!ap)
 	  ap = curentry->argument;
 	if (!ap)
 	  ap = "";
-	new_cwd = get_read_filename (menu, ap);
-	if (!new_cwd)
-	  return grub_errno;
-	new_target_cwd = get_target_filename (menu, ap);
-	if (!new_target_cwd)
-	  return grub_errno;
-
-	struct syslinux_menu *menuptr;
-	char *newname;
-	int depth = 0;
-	
-	newname = get_read_filename (menu, curentry->kernel_file);
-	if (!newname)
-	  return grub_errno;
-	simplify_filename (newname);
-
-	print_string ("#");
-	print_file (outbuf, menu, curentry->kernel_file, NULL);
-	print_string (" ");
-	print (outbuf, newname, grub_strlen (newname));
-	print_string (":\n");
-
-	for (menuptr = menu; menuptr; menuptr = menuptr->parent, depth++)
-	  if (grub_strcmp (menuptr->filename, newname) == 0
-	      || depth > 20)
-	    break;
-	if (menuptr)
-	  {
-	    print_string ("  syslinux_configfile -r ");
-	    print_file (outbuf, menu, "/", NULL);
-	    print_string (" -c ");
-	    print_file (outbuf, menu, ap, NULL);
-	    print_string (" ");
-	    print_file (outbuf, menu, curentry->kernel_file, NULL);
-	    print_string ("\n");
-	  }
-	else
-	  {
-	    err = config_file (outbuf, menu->root_read_directory,
-			       menu->root_target_directory, new_cwd, new_target_cwd,
-			       newname, menu, menu->flavour);
-	    if (err == GRUB_ERR_FILE_NOT_FOUND
-		|| err == GRUB_ERR_BAD_FILENAME)
-	      {
-		grub_errno = err = GRUB_ERR_NONE;
-		print_string ("# File ");
-		err = print (outbuf, newname, grub_strlen (newname));
-		if (err)
-		  return err;
-		print_string (" not found\n");
-	      }
-	    if (err)
-	      return err;
-	  }
-	grub_free (newname);
-	grub_free (new_cwd);
-	grub_free (new_target_cwd);
+	print_config (outbuf, menu, curentry->kernel_file, ap);
       }
       break;
     case KERNEL_NO_KERNEL:
-- 
1.9.1


[-- Attachment #3: 0002-lib-syslinux_parse-add-support-for-vesa-menu.c32.patch.sig --]
[-- Type: application/pgp-signature, Size: 287 bytes --]

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [bug #44238] Add support for menu.c32 and vesamenu.c32 in lib/syslinux_parse
  2015-02-14  6:15         ` Andrei Borzenkov
  2015-02-14  8:22           ` Lunar
@ 2015-03-17 17:41           ` The Gluglug
  1 sibling, 0 replies; 9+ messages in thread
From: The Gluglug @ 2015-03-17 17:41 UTC (permalink / raw)
  To: Andrei Borzenkov, Lunar; +Cc: The development of GNU GRUB

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi, see my other message that I sent a few minutes ago. Those problems
that I reported "elsewhere" no longer exist with the latest rebased patch.

On 14/02/15 06:15, Andrei Borzenkov wrote:
> В Fri, 13 Feb 2015 22:09:04 +0100 Lunar <lunar@torproject.org>
> пишет:
> 
>> Andrei Borzenkov:
>>> [… review and comments …]
>> 
>> Ok, here's another try.
>> 
> 
> It looks OK but as someone reported that your patches seem to
> cause problems elsewhere let's wait for confirmation.
> 
> @gluglug - could you test both update versions? Thank you.
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAEBAgAGBQJVCGdWAAoJEP9Ft0z50c+UkwIH/3qtVZWG5I9CQCyT4DrAPdfI
jYOEvQsMAyFmLlCQVd+3NUlS9txwd9M8eHQ0kYRRBkWVy6kNP2MQKjcQ/hCY/hEt
sOMM5f23lKWtUzc8mY3k+eV4SHjnYzCbRLu7UrUu0QCK/kNSXxg/dFKB9ylfNrVW
wuF7EUm62bz5N0R/sUDgcfrxecQBvK5D8bPdn8WQJfjeBlI7+vM+KOvx3xF82MXq
Oiot0ueJZlUwsDINw4s+d2+Yi6fH3Uf8TwxgGr/UzBAB5n6Li40wlCXMAhw3UC+9
/hhf561zkOGKL+0y1Ttu0sk9TRTT+2jFvXmkNGRDRjkOdAt/9bjvXLt2JMIBEOE=
=irs5
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [bug #44238] Add support for menu.c32 and vesamenu.c32 in lib/syslinux_parse
  2015-02-14  8:22           ` Lunar
@ 2015-02-14 17:48             ` Andrei Borzenkov
  0 siblings, 0 replies; 9+ messages in thread
From: Andrei Borzenkov @ 2015-02-14 17:48 UTC (permalink / raw)
  To: Lunar; +Cc: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 860 bytes --]

В Sat, 14 Feb 2015 09:22:19 +0100
Lunar <lunar@torproject.org> пишет:

> Andrei Borzenkov:
> > В Fri, 13 Feb 2015 22:09:04 +0100
> > Lunar <lunar@torproject.org> пишет:
> > 
> > > Andrei Borzenkov:
> > > > [… review and comments …]
> > > 
> > > Ok, here's another try.
> > > 
> > 
> > It looks OK but as someone reported that your patches seem to cause
> > problems elsewhere let's wait for confirmation.
> > 
> > @gluglug - could you test both update versions? Thank you.
> 
> fchmmr said that there was an issue with Trisquel 7.0 GNOME. But if
> there's one, it doesn't seem to be related to the patches.
> 

Well, one of your patches had double free, it may lead to unexpected
results. It would still be helpful to confirm that problem went away.

BTW if you could write test for syslinux parser it would be great!

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [bug #44238] Add support for menu.c32 and vesamenu.c32 in lib/syslinux_parse
  2015-02-14  6:15         ` Andrei Borzenkov
@ 2015-02-14  8:22           ` Lunar
  2015-02-14 17:48             ` Andrei Borzenkov
  2015-03-17 17:41           ` The Gluglug
  1 sibling, 1 reply; 9+ messages in thread
From: Lunar @ 2015-02-14  8:22 UTC (permalink / raw)
  To: The development of GNU GRUB


[-- Attachment #1.1: Type: text/plain, Size: 6837 bytes --]

Andrei Borzenkov:
> В Fri, 13 Feb 2015 22:09:04 +0100
> Lunar <lunar@torproject.org> пишет:
> 
> > Andrei Borzenkov:
> > > [… review and comments …]
> > 
> > Ok, here's another try.
> > 
> 
> It looks OK but as someone reported that your patches seem to cause
> problems elsewhere let's wait for confirmation.
> 
> @gluglug - could you test both update versions? Thank you.

fchmmr said that there was an issue with Trisquel 7.0 GNOME. But if
there's one, it doesn't seem to be related to the patches.

Attached is the output of grub-syslinux2cfg without and with the patches
applied on isolinux.cfg from Trisquel 7.0 GNOME. The differences are
only on the linux command lines and the `initrd=` option:

--- /tmp/without	2015-02-14 09:15:07.650468274 +0100
+++ /tmp/with	2015-02-14 09:19:32.398024195 +0100
@@ -23,22 +23,22 @@
  default='vesamenu.c32'
 menuentry 'Try Trisquel without installing' --hotkey 't' --id 'live' {
  if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
-  linux$linux_suffix '/'/'/casper/vmlinuz' cdrom-detect/try-usb=true persistent file=/cdrom/preseed/trisquel.seed boot=casper splash quiet noprompt --
+  linux$linux_suffix '/'/'/casper/vmlinuz' cdrom-detect/try-usb=true persistent file=/cdrom/preseed/trisquel.seed initrd=/casper/initrd boot=casper splash quiet noprompt --
   initrd$linux_suffix '/'/'/casper/initrd' 
 }
 menuentry 'Install Trisquel' --hotkey 'i' --id 'install' {
  if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
-  linux$linux_suffix '/'/'/casper/vmlinuz' cdrom-detect/try-usb=true file=/cdrom/preseed/trisquel.seed boot=casper splash quiet noprompt only-ubiquity --
+  linux$linux_suffix '/'/'/casper/vmlinuz' cdrom-detect/try-usb=true file=/cdrom/preseed/trisquel.seed initrd=/casper/initrd boot=casper splash quiet noprompt only-ubiquity --
   initrd$linux_suffix '/'/'/casper/initrd' 
 }
 menuentry 'Install Trisquel in text mode' --hotkey 'i' --id 'netinstall' {
  if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
-  linux$linux_suffix '/'/'/casper/vmlinuz.netinst' vga=788 quiet BOOT_IMAGE=linux --
+  linux$linux_suffix '/'/'/casper/vmlinuz.netinst' initrd=/casper/initrd.netinst vga=788 quiet BOOT_IMAGE=linux --
   initrd$linux_suffix '/'/'/casper/initrd.netinst' 
 }
 menuentry 'Check disc for defects' --hotkey 'c' --id 'check' {
  if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
-  linux$linux_suffix '/'/'/casper/vmlinuz' boot=casper integrity-check quiet splash --
+  linux$linux_suffix '/'/'/casper/vmlinuz' boot=casper integrity-check initrd=/casper/initrd quiet splash --
   initrd$linux_suffix '/'/'/casper/initrd' 
 }
 menuentry 'Test memory' --hotkey 'm' --id 'memtest' {
@@ -101,22 +101,22 @@
  default='live'
 menuentry 'Try Trisquel without installing' --hotkey 't' --id 'live' {
  if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
-  linux$linux_suffix '/'/'/casper/vmlinuz' cdrom-detect/try-usb=true persistent file=/cdrom/preseed/trisquel.seed boot=casper splash quiet noprompt --
+  linux$linux_suffix '/'/'/casper/vmlinuz' cdrom-detect/try-usb=true persistent file=/cdrom/preseed/trisquel.seed initrd=/casper/initrd boot=casper splash quiet noprompt --
   initrd$linux_suffix '/'/'/casper/initrd' 
 }
 menuentry 'Install Trisquel' --hotkey 'i' --id 'install' {
  if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
-  linux$linux_suffix '/'/'/casper/vmlinuz' cdrom-detect/try-usb=true file=/cdrom/preseed/trisquel.seed boot=casper splash quiet noprompt only-ubiquity --
+  linux$linux_suffix '/'/'/casper/vmlinuz' cdrom-detect/try-usb=true file=/cdrom/preseed/trisquel.seed initrd=/casper/initrd boot=casper splash quiet noprompt only-ubiquity --
   initrd$linux_suffix '/'/'/casper/initrd' 
 }
 menuentry 'Install Trisquel in text mode' --hotkey 'i' --id 'netinstall' {
  if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
-  linux$linux_suffix '/'/'/casper/vmlinuz.netinst' vga=788 quiet BOOT_IMAGE=linux --
+  linux$linux_suffix '/'/'/casper/vmlinuz.netinst' initrd=/casper/initrd.netinst vga=788 quiet BOOT_IMAGE=linux --
   initrd$linux_suffix '/'/'/casper/initrd.netinst' 
 }
 menuentry 'Check disc for defects' --hotkey 'c' --id 'check' {
  if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
-  linux$linux_suffix '/'/'/casper/vmlinuz' boot=casper integrity-check quiet splash --
+  linux$linux_suffix '/'/'/casper/vmlinuz' boot=casper integrity-check initrd=/casper/initrd quiet splash --
   initrd$linux_suffix '/'/'/casper/initrd' 
 }
 menuentry 'Test memory' --hotkey 'm' --id 'memtest' {
@@ -192,22 +192,22 @@
  default='vesamenu.c32'
 menuentry 'Try Trisquel without installing' --hotkey 't' --id 'live' {
  if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
-  linux$linux_suffix '/'/'/casper/vmlinuz' cdrom-detect/try-usb=true persistent file=/cdrom/preseed/trisquel.seed boot=casper splash quiet noprompt --
+  linux$linux_suffix '/'/'/casper/vmlinuz' cdrom-detect/try-usb=true persistent file=/cdrom/preseed/trisquel.seed initrd=/casper/initrd boot=casper splash quiet noprompt --
   initrd$linux_suffix '/'/'/casper/initrd' 
 }
 menuentry 'Install Trisquel' --hotkey 'i' --id 'install' {
  if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
-  linux$linux_suffix '/'/'/casper/vmlinuz' cdrom-detect/try-usb=true file=/cdrom/preseed/trisquel.seed boot=casper splash quiet noprompt only-ubiquity --
+  linux$linux_suffix '/'/'/casper/vmlinuz' cdrom-detect/try-usb=true file=/cdrom/preseed/trisquel.seed initrd=/casper/initrd boot=casper splash quiet noprompt only-ubiquity --
   initrd$linux_suffix '/'/'/casper/initrd' 
 }
 menuentry 'Install Trisquel in text mode' --hotkey 'i' --id 'netinstall' {
  if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
-  linux$linux_suffix '/'/'/casper/vmlinuz.netinst' vga=788 quiet BOOT_IMAGE=linux --
+  linux$linux_suffix '/'/'/casper/vmlinuz.netinst' initrd=/casper/initrd.netinst vga=788 quiet BOOT_IMAGE=linux --
   initrd$linux_suffix '/'/'/casper/initrd.netinst' 
 }
 menuentry 'Check disc for defects' --hotkey 'c' --id 'check' {
  if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
-  linux$linux_suffix '/'/'/casper/vmlinuz' boot=casper integrity-check quiet splash --
+  linux$linux_suffix '/'/'/casper/vmlinuz' boot=casper integrity-check initrd=/casper/initrd quiet splash --
   initrd$linux_suffix '/'/'/casper/initrd' 
 }
 menuentry 'Test memory' --hotkey 'm' --id 'memtest' {

-- 
Lunar                                             <lunar@torproject.org>

[-- Attachment #1.2: without --]
[-- Type: text/plain, Size: 12744 bytes --]

  background_image '/mnt/isolinux'/'splash.png'
set timeout=30
# D-I config version 2.0
  # UNSUPPORTED command 'menu hshift 13'
  # UNSUPPORTED command 'menu width 49'
  # UNSUPPORTED command 'menu margin 8'

  # UNSUPPORTED command 'menu title Installer boot menu\a'
  # UNSUPPORTED command 'menu color title	* #FFFFFFFF *'
  # UNSUPPORTED command 'menu color border	* #00000000 #00000000 none'
  # UNSUPPORTED command 'menu color sel		* #ffffffff #76a1d0ff *'
  # UNSUPPORTED command 'menu color hotsel	1;7;37;40 #ffffffff #76a1d0ff *'
  # UNSUPPORTED command 'menu color tabmsg	* #ffffffff #00000000 *'
  # UNSUPPORTED command 'menu color help		37;40 #ffdddd00 #00000000 none'
  # UNSUPPORTED command 'menu vshift 12'
  # UNSUPPORTED command 'menu rows 10'
  # UNSUPPORTED command 'menu helpmsgrow 15'
# The command line must be at least one line from the bottom.
  # UNSUPPORTED command 'menu cmdlinerow 16'
  # UNSUPPORTED command 'menu timeoutrow 16'
  # UNSUPPORTED command 'menu tabmsgrow 18'
  # UNSUPPORTED command 'menu tabmsg Press ENTER to boot or TAB to edit a menu entry'
 default='vesamenu.c32'
menuentry 'Try Trisquel without installing' --hotkey 't' --id 'live' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/casper/vmlinuz' cdrom-detect/try-usb=true persistent file=/cdrom/preseed/trisquel.seed boot=casper splash quiet noprompt --
  initrd$linux_suffix '/'/'/casper/initrd' 
}
menuentry 'Install Trisquel' --hotkey 'i' --id 'install' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/casper/vmlinuz' cdrom-detect/try-usb=true file=/cdrom/preseed/trisquel.seed boot=casper splash quiet noprompt only-ubiquity --
  initrd$linux_suffix '/'/'/casper/initrd' 
}
menuentry 'Install Trisquel in text mode' --hotkey 'i' --id 'netinstall' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/casper/vmlinuz.netinst' vga=788 quiet BOOT_IMAGE=linux --
  initrd$linux_suffix '/'/'/casper/initrd.netinst' 
}
menuentry 'Check disc for defects' --hotkey 'c' --id 'check' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/casper/vmlinuz' boot=casper integrity-check quiet splash --
  initrd$linux_suffix '/'/'/casper/initrd' 
}
menuentry 'Test memory' --hotkey 'm' --id 'memtest' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/isolinux/mt86plus' 
}
menuentry 'Boot from first hard disk' --hotkey 'b' --id 'hd' {
# File (host)//mnt/isolinux/gtk.cfg not found
  # UNSUPPORTED command 'menu begin advanced'
  # UNSUPPORTED command 'menu title Advanced options'
  # UNSUPPORTED command 'menu color title	* #FFFFFFFF *'
  # UNSUPPORTED command 'menu color border	* #00000000 #00000000 none'
  # UNSUPPORTED command 'menu color sel		* #ffffffff #76a1d0ff *'
  # UNSUPPORTED command 'menu color hotsel	1;7;37;40 #ffffffff #76a1d0ff *'
  # UNSUPPORTED command 'menu color tabmsg	* #ffffffff #00000000 *'
  # UNSUPPORTED command 'menu color help		37;40 #ffdddd00 #00000000 none'
  # UNSUPPORTED command 'menu vshift 12'
  # UNSUPPORTED command 'menu rows 10'
  # UNSUPPORTED command 'menu helpmsgrow 15'
# The command line must be at least one line from the bottom.
  # UNSUPPORTED command 'menu cmdlinerow 16'
  # UNSUPPORTED command 'menu timeoutrow 16'
  # UNSUPPORTED command 'menu tabmsgrow 18'
  # UNSUPPORTED command 'menu tabmsg Press ENTER to boot or TAB to edit a menu entry'
  root=hd0;
  chainloader +1;
}
menuentry 'Back..' --hotkey 'b' --id 'mainmenu' {
  # UNSUPPORTED command 'menu exit'
# File (host)//mnt/isolinux/adgtk.cfg not found
  # UNSUPPORTED command 'menu end'
  # UNSUPPORTED entry type 0
true;
}
menuentry 'Help' --hotkey 'h' --id 'help' {
  # UNSUPPORTED command 'ui gfxboot bootlogo'
#'/mnt/isolinux'/'prompt.cfg' (host)/mnt/isolinux/prompt.cfg:
  background_image '/mnt/isolinux/'/'splash.png'
set timeout=5
  # UNSUPPORTED command 'display f1.txt'
  # UNSUPPORTED command 'menu hshift 13'
  # UNSUPPORTED command 'menu width 49'
  # UNSUPPORTED command 'menu margin 8'

  # UNSUPPORTED command 'menu title Installer boot menu\a'
  # UNSUPPORTED command 'menu color title	* #FFFFFFFF *'
  # UNSUPPORTED command 'menu color border	* #00000000 #00000000 none'
  # UNSUPPORTED command 'menu color sel		* #ffffffff #76a1d0ff *'
  # UNSUPPORTED command 'menu color hotsel	1;7;37;40 #ffffffff #76a1d0ff *'
  # UNSUPPORTED command 'menu color tabmsg	* #ffffffff #00000000 *'
  # UNSUPPORTED command 'menu color help		37;40 #ffdddd00 #00000000 none'
  # UNSUPPORTED command 'menu vshift 12'
  # UNSUPPORTED command 'menu rows 10'
  # UNSUPPORTED command 'menu helpmsgrow 15'
# The command line must be at least one line from the bottom.
  # UNSUPPORTED command 'menu cmdlinerow 16'
  # UNSUPPORTED command 'menu timeoutrow 16'
  # UNSUPPORTED command 'menu tabmsgrow 18'
  # UNSUPPORTED command 'menu tabmsg Press ENTER to boot or TAB to edit a menu entry'
 default='live'
menuentry 'Try Trisquel without installing' --hotkey 't' --id 'live' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/casper/vmlinuz' cdrom-detect/try-usb=true persistent file=/cdrom/preseed/trisquel.seed boot=casper splash quiet noprompt --
  initrd$linux_suffix '/'/'/casper/initrd' 
}
menuentry 'Install Trisquel' --hotkey 'i' --id 'install' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/casper/vmlinuz' cdrom-detect/try-usb=true file=/cdrom/preseed/trisquel.seed boot=casper splash quiet noprompt only-ubiquity --
  initrd$linux_suffix '/'/'/casper/initrd' 
}
menuentry 'Install Trisquel in text mode' --hotkey 'i' --id 'netinstall' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/casper/vmlinuz.netinst' vga=788 quiet BOOT_IMAGE=linux --
  initrd$linux_suffix '/'/'/casper/initrd.netinst' 
}
menuentry 'Check disc for defects' --hotkey 'c' --id 'check' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/casper/vmlinuz' boot=casper integrity-check quiet splash --
  initrd$linux_suffix '/'/'/casper/initrd' 
}
menuentry 'Test memory' --hotkey 'm' --id 'memtest' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/isolinux/mt86plus' 
}
menuentry 'Boot from first hard disk' --hotkey 'b' --id 'hd' {
# File (host)//mnt/isolinux//gtk.cfg not found
  # UNSUPPORTED command 'menu begin advanced'
  # UNSUPPORTED command 'menu title Advanced options'
  # UNSUPPORTED command 'menu color title	* #FFFFFFFF *'
  # UNSUPPORTED command 'menu color border	* #00000000 #00000000 none'
  # UNSUPPORTED command 'menu color sel		* #ffffffff #76a1d0ff *'
  # UNSUPPORTED command 'menu color hotsel	1;7;37;40 #ffffffff #76a1d0ff *'
  # UNSUPPORTED command 'menu color tabmsg	* #ffffffff #00000000 *'
  # UNSUPPORTED command 'menu color help		37;40 #ffdddd00 #00000000 none'
  # UNSUPPORTED command 'menu vshift 12'
  # UNSUPPORTED command 'menu rows 10'
  # UNSUPPORTED command 'menu helpmsgrow 15'
# The command line must be at least one line from the bottom.
  # UNSUPPORTED command 'menu cmdlinerow 16'
  # UNSUPPORTED command 'menu timeoutrow 16'
  # UNSUPPORTED command 'menu tabmsgrow 18'
  # UNSUPPORTED command 'menu tabmsg Press ENTER to boot or TAB to edit a menu entry'
  root=hd0;
  chainloader +1;
}
menuentry 'Back..' --hotkey 'b' --id 'mainmenu' {
  # UNSUPPORTED command 'menu exit'
# File (host)//mnt/isolinux//adgtk.cfg not found
  # UNSUPPORTED command 'menu end'
  # UNSUPPORTED entry type 0
true;
}
menuentry 'Help' --hotkey 'h' --id 'help' {
#'/mnt/isolinux/'/'prompt.cfg' (host)/mnt/isolinux/prompt.cfg:
  syslinux_configfile -r '/'/'/' -c '/mnt/isolinux/'/'' '/mnt/isolinux/'/'prompt.cfg'
}
menuentry 'menu' --id 'menu' {
  # UNSUPPORTED command 'f1 f1.txt'
  # UNSUPPORTED command 'f2 f2.txt'
  # UNSUPPORTED command 'f3 f3.txt'
  # UNSUPPORTED command 'f4 f4.txt'
  # UNSUPPORTED command 'f5 f5.txt'
  # UNSUPPORTED command 'f6 f6.txt'
  # UNSUPPORTED command 'f7 f7.txt'
  # UNSUPPORTED command 'f8 f8.txt'
  # UNSUPPORTED command 'f9 f9.txt'
  # UNSUPPORTED command 'f0 f10.txt'
#'/mnt/isolinux/'/'isolinux.cfg' (host)/mnt/isolinux/isolinux.cfg:
  background_image '/mnt/isolinux//'/'splash.png'
set timeout=30
# D-I config version 2.0
  # UNSUPPORTED command 'menu hshift 13'
  # UNSUPPORTED command 'menu width 49'
  # UNSUPPORTED command 'menu margin 8'

  # UNSUPPORTED command 'menu title Installer boot menu\a'
  # UNSUPPORTED command 'menu color title	* #FFFFFFFF *'
  # UNSUPPORTED command 'menu color border	* #00000000 #00000000 none'
  # UNSUPPORTED command 'menu color sel		* #ffffffff #76a1d0ff *'
  # UNSUPPORTED command 'menu color hotsel	1;7;37;40 #ffffffff #76a1d0ff *'
  # UNSUPPORTED command 'menu color tabmsg	* #ffffffff #00000000 *'
  # UNSUPPORTED command 'menu color help		37;40 #ffdddd00 #00000000 none'
  # UNSUPPORTED command 'menu vshift 12'
  # UNSUPPORTED command 'menu rows 10'
  # UNSUPPORTED command 'menu helpmsgrow 15'
# The command line must be at least one line from the bottom.
  # UNSUPPORTED command 'menu cmdlinerow 16'
  # UNSUPPORTED command 'menu timeoutrow 16'
  # UNSUPPORTED command 'menu tabmsgrow 18'
  # UNSUPPORTED command 'menu tabmsg Press ENTER to boot or TAB to edit a menu entry'
 default='vesamenu.c32'
menuentry 'Try Trisquel without installing' --hotkey 't' --id 'live' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/casper/vmlinuz' cdrom-detect/try-usb=true persistent file=/cdrom/preseed/trisquel.seed boot=casper splash quiet noprompt --
  initrd$linux_suffix '/'/'/casper/initrd' 
}
menuentry 'Install Trisquel' --hotkey 'i' --id 'install' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/casper/vmlinuz' cdrom-detect/try-usb=true file=/cdrom/preseed/trisquel.seed boot=casper splash quiet noprompt only-ubiquity --
  initrd$linux_suffix '/'/'/casper/initrd' 
}
menuentry 'Install Trisquel in text mode' --hotkey 'i' --id 'netinstall' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/casper/vmlinuz.netinst' vga=788 quiet BOOT_IMAGE=linux --
  initrd$linux_suffix '/'/'/casper/initrd.netinst' 
}
menuentry 'Check disc for defects' --hotkey 'c' --id 'check' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/casper/vmlinuz' boot=casper integrity-check quiet splash --
  initrd$linux_suffix '/'/'/casper/initrd' 
}
menuentry 'Test memory' --hotkey 'm' --id 'memtest' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/isolinux/mt86plus' 
}
menuentry 'Boot from first hard disk' --hotkey 'b' --id 'hd' {
# File (host)//mnt/isolinux///gtk.cfg not found
  # UNSUPPORTED command 'menu begin advanced'
  # UNSUPPORTED command 'menu title Advanced options'
  # UNSUPPORTED command 'menu color title	* #FFFFFFFF *'
  # UNSUPPORTED command 'menu color border	* #00000000 #00000000 none'
  # UNSUPPORTED command 'menu color sel		* #ffffffff #76a1d0ff *'
  # UNSUPPORTED command 'menu color hotsel	1;7;37;40 #ffffffff #76a1d0ff *'
  # UNSUPPORTED command 'menu color tabmsg	* #ffffffff #00000000 *'
  # UNSUPPORTED command 'menu color help		37;40 #ffdddd00 #00000000 none'
  # UNSUPPORTED command 'menu vshift 12'
  # UNSUPPORTED command 'menu rows 10'
  # UNSUPPORTED command 'menu helpmsgrow 15'
# The command line must be at least one line from the bottom.
  # UNSUPPORTED command 'menu cmdlinerow 16'
  # UNSUPPORTED command 'menu timeoutrow 16'
  # UNSUPPORTED command 'menu tabmsgrow 18'
  # UNSUPPORTED command 'menu tabmsg Press ENTER to boot or TAB to edit a menu entry'
  root=hd0;
  chainloader +1;
}
menuentry 'Back..' --hotkey 'b' --id 'mainmenu' {
  # UNSUPPORTED command 'menu exit'
# File (host)//mnt/isolinux///adgtk.cfg not found
  # UNSUPPORTED command 'menu end'
  # UNSUPPORTED entry type 0
true;
}
menuentry 'Help' --hotkey 'h' --id 'help' {
  # UNSUPPORTED command 'ui gfxboot bootlogo'
#'/mnt/isolinux//'/'prompt.cfg' (host)/mnt/isolinux/prompt.cfg:
  syslinux_configfile -r '/'/'/' -c '/mnt/isolinux//'/'' '/mnt/isolinux//'/'prompt.cfg'
}
}
}


[-- Attachment #1.3: with --]
[-- Type: text/plain, Size: 13032 bytes --]

  background_image '/mnt/isolinux'/'splash.png'
set timeout=30
# D-I config version 2.0
  # UNSUPPORTED command 'menu hshift 13'
  # UNSUPPORTED command 'menu width 49'
  # UNSUPPORTED command 'menu margin 8'

  # UNSUPPORTED command 'menu title Installer boot menu\a'
  # UNSUPPORTED command 'menu color title	* #FFFFFFFF *'
  # UNSUPPORTED command 'menu color border	* #00000000 #00000000 none'
  # UNSUPPORTED command 'menu color sel		* #ffffffff #76a1d0ff *'
  # UNSUPPORTED command 'menu color hotsel	1;7;37;40 #ffffffff #76a1d0ff *'
  # UNSUPPORTED command 'menu color tabmsg	* #ffffffff #00000000 *'
  # UNSUPPORTED command 'menu color help		37;40 #ffdddd00 #00000000 none'
  # UNSUPPORTED command 'menu vshift 12'
  # UNSUPPORTED command 'menu rows 10'
  # UNSUPPORTED command 'menu helpmsgrow 15'
# The command line must be at least one line from the bottom.
  # UNSUPPORTED command 'menu cmdlinerow 16'
  # UNSUPPORTED command 'menu timeoutrow 16'
  # UNSUPPORTED command 'menu tabmsgrow 18'
  # UNSUPPORTED command 'menu tabmsg Press ENTER to boot or TAB to edit a menu entry'
 default='vesamenu.c32'
menuentry 'Try Trisquel without installing' --hotkey 't' --id 'live' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/casper/vmlinuz' cdrom-detect/try-usb=true persistent file=/cdrom/preseed/trisquel.seed initrd=/casper/initrd boot=casper splash quiet noprompt --
  initrd$linux_suffix '/'/'/casper/initrd' 
}
menuentry 'Install Trisquel' --hotkey 'i' --id 'install' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/casper/vmlinuz' cdrom-detect/try-usb=true file=/cdrom/preseed/trisquel.seed initrd=/casper/initrd boot=casper splash quiet noprompt only-ubiquity --
  initrd$linux_suffix '/'/'/casper/initrd' 
}
menuentry 'Install Trisquel in text mode' --hotkey 'i' --id 'netinstall' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/casper/vmlinuz.netinst' initrd=/casper/initrd.netinst vga=788 quiet BOOT_IMAGE=linux --
  initrd$linux_suffix '/'/'/casper/initrd.netinst' 
}
menuentry 'Check disc for defects' --hotkey 'c' --id 'check' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/casper/vmlinuz' boot=casper integrity-check initrd=/casper/initrd quiet splash --
  initrd$linux_suffix '/'/'/casper/initrd' 
}
menuentry 'Test memory' --hotkey 'm' --id 'memtest' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/isolinux/mt86plus' 
}
menuentry 'Boot from first hard disk' --hotkey 'b' --id 'hd' {
# File (host)//mnt/isolinux/gtk.cfg not found
  # UNSUPPORTED command 'menu begin advanced'
  # UNSUPPORTED command 'menu title Advanced options'
  # UNSUPPORTED command 'menu color title	* #FFFFFFFF *'
  # UNSUPPORTED command 'menu color border	* #00000000 #00000000 none'
  # UNSUPPORTED command 'menu color sel		* #ffffffff #76a1d0ff *'
  # UNSUPPORTED command 'menu color hotsel	1;7;37;40 #ffffffff #76a1d0ff *'
  # UNSUPPORTED command 'menu color tabmsg	* #ffffffff #00000000 *'
  # UNSUPPORTED command 'menu color help		37;40 #ffdddd00 #00000000 none'
  # UNSUPPORTED command 'menu vshift 12'
  # UNSUPPORTED command 'menu rows 10'
  # UNSUPPORTED command 'menu helpmsgrow 15'
# The command line must be at least one line from the bottom.
  # UNSUPPORTED command 'menu cmdlinerow 16'
  # UNSUPPORTED command 'menu timeoutrow 16'
  # UNSUPPORTED command 'menu tabmsgrow 18'
  # UNSUPPORTED command 'menu tabmsg Press ENTER to boot or TAB to edit a menu entry'
  root=hd0;
  chainloader +1;
}
menuentry 'Back..' --hotkey 'b' --id 'mainmenu' {
  # UNSUPPORTED command 'menu exit'
# File (host)//mnt/isolinux/adgtk.cfg not found
  # UNSUPPORTED command 'menu end'
  # UNSUPPORTED entry type 0
true;
}
menuentry 'Help' --hotkey 'h' --id 'help' {
  # UNSUPPORTED command 'ui gfxboot bootlogo'
#'/mnt/isolinux'/'prompt.cfg' (host)/mnt/isolinux/prompt.cfg:
  background_image '/mnt/isolinux/'/'splash.png'
set timeout=5
  # UNSUPPORTED command 'display f1.txt'
  # UNSUPPORTED command 'menu hshift 13'
  # UNSUPPORTED command 'menu width 49'
  # UNSUPPORTED command 'menu margin 8'

  # UNSUPPORTED command 'menu title Installer boot menu\a'
  # UNSUPPORTED command 'menu color title	* #FFFFFFFF *'
  # UNSUPPORTED command 'menu color border	* #00000000 #00000000 none'
  # UNSUPPORTED command 'menu color sel		* #ffffffff #76a1d0ff *'
  # UNSUPPORTED command 'menu color hotsel	1;7;37;40 #ffffffff #76a1d0ff *'
  # UNSUPPORTED command 'menu color tabmsg	* #ffffffff #00000000 *'
  # UNSUPPORTED command 'menu color help		37;40 #ffdddd00 #00000000 none'
  # UNSUPPORTED command 'menu vshift 12'
  # UNSUPPORTED command 'menu rows 10'
  # UNSUPPORTED command 'menu helpmsgrow 15'
# The command line must be at least one line from the bottom.
  # UNSUPPORTED command 'menu cmdlinerow 16'
  # UNSUPPORTED command 'menu timeoutrow 16'
  # UNSUPPORTED command 'menu tabmsgrow 18'
  # UNSUPPORTED command 'menu tabmsg Press ENTER to boot or TAB to edit a menu entry'
 default='live'
menuentry 'Try Trisquel without installing' --hotkey 't' --id 'live' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/casper/vmlinuz' cdrom-detect/try-usb=true persistent file=/cdrom/preseed/trisquel.seed initrd=/casper/initrd boot=casper splash quiet noprompt --
  initrd$linux_suffix '/'/'/casper/initrd' 
}
menuentry 'Install Trisquel' --hotkey 'i' --id 'install' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/casper/vmlinuz' cdrom-detect/try-usb=true file=/cdrom/preseed/trisquel.seed initrd=/casper/initrd boot=casper splash quiet noprompt only-ubiquity --
  initrd$linux_suffix '/'/'/casper/initrd' 
}
menuentry 'Install Trisquel in text mode' --hotkey 'i' --id 'netinstall' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/casper/vmlinuz.netinst' initrd=/casper/initrd.netinst vga=788 quiet BOOT_IMAGE=linux --
  initrd$linux_suffix '/'/'/casper/initrd.netinst' 
}
menuentry 'Check disc for defects' --hotkey 'c' --id 'check' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/casper/vmlinuz' boot=casper integrity-check initrd=/casper/initrd quiet splash --
  initrd$linux_suffix '/'/'/casper/initrd' 
}
menuentry 'Test memory' --hotkey 'm' --id 'memtest' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/isolinux/mt86plus' 
}
menuentry 'Boot from first hard disk' --hotkey 'b' --id 'hd' {
# File (host)//mnt/isolinux//gtk.cfg not found
  # UNSUPPORTED command 'menu begin advanced'
  # UNSUPPORTED command 'menu title Advanced options'
  # UNSUPPORTED command 'menu color title	* #FFFFFFFF *'
  # UNSUPPORTED command 'menu color border	* #00000000 #00000000 none'
  # UNSUPPORTED command 'menu color sel		* #ffffffff #76a1d0ff *'
  # UNSUPPORTED command 'menu color hotsel	1;7;37;40 #ffffffff #76a1d0ff *'
  # UNSUPPORTED command 'menu color tabmsg	* #ffffffff #00000000 *'
  # UNSUPPORTED command 'menu color help		37;40 #ffdddd00 #00000000 none'
  # UNSUPPORTED command 'menu vshift 12'
  # UNSUPPORTED command 'menu rows 10'
  # UNSUPPORTED command 'menu helpmsgrow 15'
# The command line must be at least one line from the bottom.
  # UNSUPPORTED command 'menu cmdlinerow 16'
  # UNSUPPORTED command 'menu timeoutrow 16'
  # UNSUPPORTED command 'menu tabmsgrow 18'
  # UNSUPPORTED command 'menu tabmsg Press ENTER to boot or TAB to edit a menu entry'
  root=hd0;
  chainloader +1;
}
menuentry 'Back..' --hotkey 'b' --id 'mainmenu' {
  # UNSUPPORTED command 'menu exit'
# File (host)//mnt/isolinux//adgtk.cfg not found
  # UNSUPPORTED command 'menu end'
  # UNSUPPORTED entry type 0
true;
}
menuentry 'Help' --hotkey 'h' --id 'help' {
#'/mnt/isolinux/'/'prompt.cfg' (host)/mnt/isolinux/prompt.cfg:
  syslinux_configfile -r '/'/'/' -c '/mnt/isolinux/'/'' '/mnt/isolinux/'/'prompt.cfg'
}
menuentry 'menu' --id 'menu' {
  # UNSUPPORTED command 'f1 f1.txt'
  # UNSUPPORTED command 'f2 f2.txt'
  # UNSUPPORTED command 'f3 f3.txt'
  # UNSUPPORTED command 'f4 f4.txt'
  # UNSUPPORTED command 'f5 f5.txt'
  # UNSUPPORTED command 'f6 f6.txt'
  # UNSUPPORTED command 'f7 f7.txt'
  # UNSUPPORTED command 'f8 f8.txt'
  # UNSUPPORTED command 'f9 f9.txt'
  # UNSUPPORTED command 'f0 f10.txt'
#'/mnt/isolinux/'/'isolinux.cfg' (host)/mnt/isolinux/isolinux.cfg:
  background_image '/mnt/isolinux//'/'splash.png'
set timeout=30
# D-I config version 2.0
  # UNSUPPORTED command 'menu hshift 13'
  # UNSUPPORTED command 'menu width 49'
  # UNSUPPORTED command 'menu margin 8'

  # UNSUPPORTED command 'menu title Installer boot menu\a'
  # UNSUPPORTED command 'menu color title	* #FFFFFFFF *'
  # UNSUPPORTED command 'menu color border	* #00000000 #00000000 none'
  # UNSUPPORTED command 'menu color sel		* #ffffffff #76a1d0ff *'
  # UNSUPPORTED command 'menu color hotsel	1;7;37;40 #ffffffff #76a1d0ff *'
  # UNSUPPORTED command 'menu color tabmsg	* #ffffffff #00000000 *'
  # UNSUPPORTED command 'menu color help		37;40 #ffdddd00 #00000000 none'
  # UNSUPPORTED command 'menu vshift 12'
  # UNSUPPORTED command 'menu rows 10'
  # UNSUPPORTED command 'menu helpmsgrow 15'
# The command line must be at least one line from the bottom.
  # UNSUPPORTED command 'menu cmdlinerow 16'
  # UNSUPPORTED command 'menu timeoutrow 16'
  # UNSUPPORTED command 'menu tabmsgrow 18'
  # UNSUPPORTED command 'menu tabmsg Press ENTER to boot or TAB to edit a menu entry'
 default='vesamenu.c32'
menuentry 'Try Trisquel without installing' --hotkey 't' --id 'live' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/casper/vmlinuz' cdrom-detect/try-usb=true persistent file=/cdrom/preseed/trisquel.seed initrd=/casper/initrd boot=casper splash quiet noprompt --
  initrd$linux_suffix '/'/'/casper/initrd' 
}
menuentry 'Install Trisquel' --hotkey 'i' --id 'install' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/casper/vmlinuz' cdrom-detect/try-usb=true file=/cdrom/preseed/trisquel.seed initrd=/casper/initrd boot=casper splash quiet noprompt only-ubiquity --
  initrd$linux_suffix '/'/'/casper/initrd' 
}
menuentry 'Install Trisquel in text mode' --hotkey 'i' --id 'netinstall' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/casper/vmlinuz.netinst' initrd=/casper/initrd.netinst vga=788 quiet BOOT_IMAGE=linux --
  initrd$linux_suffix '/'/'/casper/initrd.netinst' 
}
menuentry 'Check disc for defects' --hotkey 'c' --id 'check' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/casper/vmlinuz' boot=casper integrity-check initrd=/casper/initrd quiet splash --
  initrd$linux_suffix '/'/'/casper/initrd' 
}
menuentry 'Test memory' --hotkey 'm' --id 'memtest' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/isolinux/mt86plus' 
}
menuentry 'Boot from first hard disk' --hotkey 'b' --id 'hd' {
# File (host)//mnt/isolinux///gtk.cfg not found
  # UNSUPPORTED command 'menu begin advanced'
  # UNSUPPORTED command 'menu title Advanced options'
  # UNSUPPORTED command 'menu color title	* #FFFFFFFF *'
  # UNSUPPORTED command 'menu color border	* #00000000 #00000000 none'
  # UNSUPPORTED command 'menu color sel		* #ffffffff #76a1d0ff *'
  # UNSUPPORTED command 'menu color hotsel	1;7;37;40 #ffffffff #76a1d0ff *'
  # UNSUPPORTED command 'menu color tabmsg	* #ffffffff #00000000 *'
  # UNSUPPORTED command 'menu color help		37;40 #ffdddd00 #00000000 none'
  # UNSUPPORTED command 'menu vshift 12'
  # UNSUPPORTED command 'menu rows 10'
  # UNSUPPORTED command 'menu helpmsgrow 15'
# The command line must be at least one line from the bottom.
  # UNSUPPORTED command 'menu cmdlinerow 16'
  # UNSUPPORTED command 'menu timeoutrow 16'
  # UNSUPPORTED command 'menu tabmsgrow 18'
  # UNSUPPORTED command 'menu tabmsg Press ENTER to boot or TAB to edit a menu entry'
  root=hd0;
  chainloader +1;
}
menuentry 'Back..' --hotkey 'b' --id 'mainmenu' {
  # UNSUPPORTED command 'menu exit'
# File (host)//mnt/isolinux///adgtk.cfg not found
  # UNSUPPORTED command 'menu end'
  # UNSUPPORTED entry type 0
true;
}
menuentry 'Help' --hotkey 'h' --id 'help' {
  # UNSUPPORTED command 'ui gfxboot bootlogo'
#'/mnt/isolinux//'/'prompt.cfg' (host)/mnt/isolinux/prompt.cfg:
  syslinux_configfile -r '/'/'/' -c '/mnt/isolinux//'/'' '/mnt/isolinux//'/'prompt.cfg'
}
}
}


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [bug #44238] Add support for menu.c32 and vesamenu.c32 in lib/syslinux_parse
  2015-02-13 21:09       ` Lunar
@ 2015-02-14  6:15         ` Andrei Borzenkov
  2015-02-14  8:22           ` Lunar
  2015-03-17 17:41           ` The Gluglug
  0 siblings, 2 replies; 9+ messages in thread
From: Andrei Borzenkov @ 2015-02-14  6:15 UTC (permalink / raw)
  To: Lunar; +Cc: The development of GNU GRUB, The Gluglug

[-- Attachment #1: Type: text/plain, Size: 353 bytes --]

В Fri, 13 Feb 2015 22:09:04 +0100
Lunar <lunar@torproject.org> пишет:

> Andrei Borzenkov:
> > [… review and comments …]
> 
> Ok, here's another try.
> 

It looks OK but as someone reported that your patches seem to cause
problems elsewhere let's wait for confirmation.

@gluglug - could you test both update versions? Thank you.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [bug #44238] Add support for menu.c32 and vesamenu.c32 in lib/syslinux_parse
@ 2015-02-14  3:26 The Gluglug
  0 siblings, 0 replies; 9+ messages in thread
From: The Gluglug @ 2015-02-14  3:26 UTC (permalink / raw)
  To: arvidjaar; +Cc: lunar

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

<fchmmr> Lunar^, I updated to the latest GRUB and tested those 2
patches. Tails does indeed boot as you said. However, Trisquel
ISOLINUX menu now no longer appears: I see these 3 messages: "error:
syntax error.", "error: Incorrect command.", "error: syntax error.".
This is with Trisquel 7.0 GNOME, which you can find at
https://trisquel.info/
<fchmmr> Lunar^, shall we take this to #grub?
<fchmmr> Lunar^, this is with the very first patches that you sent. I
just noticed the follow-up patches that you posted to grub-devel; I'll
try those instead.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAEBAgAGBQJU3sBiAAoJEP9Ft0z50c+UDEUIAIQK0BmGQSoD51yfV4xIcvfG
xC82w8ddJICSfo2YZjSbKdcKJZvOKzxZgeudx2f2OVkta2VbHbN6qtNl2IXWxtvH
JdMAK9wb/5NQXJ16EGTOYxuzB7eXpyzsY8P44c0O1nS3UxtFsyEGWxS5Mm/JJHMD
ROGluN8D2cIgD3vnqtiOl7nOQCqx7ReOdNkUAn454KazP6N7hThtB/XGmF07i3+x
HukKTnx5s19wnottlbL+yqaQiYLpdlM3ZyXZ49ZHA0V0b6ULuM07wPe06V2n698G
Kak4fqgZsW3SipMOdMJUCSRAbrZ2+CmPUhCpzwcwlIQFVQfU+OKED+xqhkL+Jwc=
=FdlH
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [bug #44238] Add support for menu.c32 and vesamenu.c32 in lib/syslinux_parse
  2015-02-13 20:40     ` Andrei Borzenkov
@ 2015-02-13 21:09       ` Lunar
  2015-02-14  6:15         ` Andrei Borzenkov
  0 siblings, 1 reply; 9+ messages in thread
From: Lunar @ 2015-02-13 21:09 UTC (permalink / raw)
  To: The development of GNU GRUB


[-- Attachment #1.1: Type: text/plain, Size: 160 bytes --]

Andrei Borzenkov:
> [… review and comments …]

Ok, here's another try.

-- 
Lunar                                             <lunar@torproject.org>

[-- Attachment #1.2: 0001-lib-syslinux_parse-add-support-for-vesa-menu.c32.patch --]
[-- Type: text/x-diff, Size: 5894 bytes --]

From 9ce42bf6373bdf4c8c66e897e8b00908b5df03bf Mon Sep 17 00:00:00 2001
From: Lunar <lunar@torproject.org>
Date: Fri, 13 Feb 2015 22:08:11 +0100
Subject: [PATCH] lib/syslinux_parse: add support for (vesa)menu.c32

Fixes Savannah bug #44238.
---
 grub-core/lib/syslinux_parse.c | 165 ++++++++++++++++++++++++++---------------
 1 file changed, 107 insertions(+), 58 deletions(-)

diff --git a/grub-core/lib/syslinux_parse.c b/grub-core/lib/syslinux_parse.c
index 2c874b1..432456e 100644
--- a/grub-core/lib/syslinux_parse.c
+++ b/grub-core/lib/syslinux_parse.c
@@ -840,6 +840,82 @@ simplify_filename (char *str)
 }
 
 static grub_err_t
+print_config (struct output_buffer *outbuf,
+	      struct syslinux_menu *menu,
+              const char *filename, const char *basedir)
+{
+  struct syslinux_menu *menuptr;
+  grub_err_t err = GRUB_ERR_NONE;
+  char *new_cwd = NULL;
+  char *new_target_cwd = NULL;
+  char *newname = NULL;
+  int depth = 0;
+
+  new_cwd = get_read_filename (menu, basedir);
+  if (!new_cwd)
+    {
+      err = grub_errno;
+      goto out;
+    }
+  new_target_cwd = get_target_filename (menu, basedir);
+  if (!new_target_cwd)
+    {
+      err = grub_errno;
+      goto out;
+    }
+  newname = get_read_filename (menu, filename);
+  if (!newname)
+    {
+      err = grub_errno;
+      goto out;
+    }
+  simplify_filename (newname);
+
+  print_string ("#");
+  print_file (outbuf, menu, filename, NULL);
+  print_string (" ");
+  print (outbuf, newname, grub_strlen (newname));
+  print_string (":\n");
+
+  for (menuptr = menu; menuptr; menuptr = menuptr->parent, depth++)
+    if (grub_strcmp (menuptr->filename, newname) == 0
+        || depth > 20)
+      break;
+  if (menuptr)
+    {
+      print_string ("  syslinux_configfile -r ");
+      print_file (outbuf, menu, "/", NULL);
+      print_string (" -c ");
+      print_file (outbuf, menu, basedir, NULL);
+      print_string (" ");
+      print_file (outbuf, menu, filename, NULL);
+      print_string ("\n");
+    }
+  else
+    {
+      err = config_file (outbuf, menu->root_read_directory,
+                         menu->root_target_directory, new_cwd, new_target_cwd,
+                         newname, menu, menu->flavour);
+      if (err == GRUB_ERR_FILE_NOT_FOUND
+          || err == GRUB_ERR_BAD_FILENAME)
+        {
+          grub_errno = err = GRUB_ERR_NONE;
+          print_string ("# File ");
+          err = print (outbuf, newname, grub_strlen (newname));
+          if (err)
+            goto out;
+          print_string (" not found\n");
+        }
+    }
+
+ out:
+  grub_free (newname);
+  grub_free (new_cwd);
+  grub_free (new_target_cwd);
+  return err;
+}
+
+static grub_err_t
 write_entry (struct output_buffer *outbuf,
 	     struct syslinux_menu *menu,
 	     struct syslinux_menuentry *curentry)
@@ -1240,6 +1316,36 @@ write_entry (struct output_buffer *outbuf,
 	    break;
 	  }
 
+	if (grub_strcasecmp (basename, "menu.c32") == 0 ||
+	    grub_strcasecmp (basename, "vesamenu.c32") == 0)
+	  {
+	    char *ptr;
+	    char *end;
+
+	    ptr = curentry->append;
+	    if (!ptr)
+	      return grub_errno;
+
+	    while (*ptr)
+	      {
+		end = ptr;
+		for (end = ptr; *end && !grub_isspace (*end); end++);
+		if (*end)
+		  *end++ = '\0';
+
+		/* "~" is supposed to be current file, so let's skip it */
+		if (grub_strcmp (ptr, "~") != 0)
+		  {
+		    err = print_config (outbuf, menu, ptr, "");
+		    if (err != GRUB_ERR_NONE)
+		      break;
+                  }
+		for (ptr = end; *ptr && grub_isspace (*ptr); ptr++);
+	      }
+	    err = GRUB_ERR_NONE;
+	    break;
+	  }
+
 	/* FIXME: gdb, GFXBoot, Hdt, Ifcpu, Ifplop, Kbdmap,
 	   FIXME: Linux, Lua, Meminfo, rosh, Sanbboot  */
 
@@ -1252,70 +1358,13 @@ write_entry (struct output_buffer *outbuf,
       }
     case KERNEL_CONFIG:
       {
-	char *new_cwd, *new_target_cwd;
 	const char *ap;
 	ap = curentry->append;
 	if (!ap)
 	  ap = curentry->argument;
 	if (!ap)
 	  ap = "";
-	new_cwd = get_read_filename (menu, ap);
-	if (!new_cwd)
-	  return grub_errno;
-	new_target_cwd = get_target_filename (menu, ap);
-	if (!new_target_cwd)
-	  return grub_errno;
-
-	struct syslinux_menu *menuptr;
-	char *newname;
-	int depth = 0;
-	
-	newname = get_read_filename (menu, curentry->kernel_file);
-	if (!newname)
-	  return grub_errno;
-	simplify_filename (newname);
-
-	print_string ("#");
-	print_file (outbuf, menu, curentry->kernel_file, NULL);
-	print_string (" ");
-	print (outbuf, newname, grub_strlen (newname));
-	print_string (":\n");
-
-	for (menuptr = menu; menuptr; menuptr = menuptr->parent, depth++)
-	  if (grub_strcmp (menuptr->filename, newname) == 0
-	      || depth > 20)
-	    break;
-	if (menuptr)
-	  {
-	    print_string ("  syslinux_configfile -r ");
-	    print_file (outbuf, menu, "/", NULL);
-	    print_string (" -c ");
-	    print_file (outbuf, menu, ap, NULL);
-	    print_string (" ");
-	    print_file (outbuf, menu, curentry->kernel_file, NULL);
-	    print_string ("\n");
-	  }
-	else
-	  {
-	    err = config_file (outbuf, menu->root_read_directory,
-			       menu->root_target_directory, new_cwd, new_target_cwd,
-			       newname, menu, menu->flavour);
-	    if (err == GRUB_ERR_FILE_NOT_FOUND
-		|| err == GRUB_ERR_BAD_FILENAME)
-	      {
-		grub_errno = err = GRUB_ERR_NONE;
-		print_string ("# File ");
-		err = print (outbuf, newname, grub_strlen (newname));
-		if (err)
-		  return err;
-		print_string (" not found\n");
-	      }
-	    if (err)
-	      return err;
-	  }
-	grub_free (newname);
-	grub_free (new_cwd);
-	grub_free (new_target_cwd);
+	print_config (outbuf, menu, curentry->kernel_file, ap);
       }
       break;
     case KERNEL_NO_KERNEL:
-- 
1.9.1


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [bug #44238] Add support for menu.c32 and vesamenu.c32 in lib/syslinux_parse
  2015-02-13 20:20   ` Lunar
@ 2015-02-13 20:40     ` Andrei Borzenkov
  2015-02-13 21:09       ` Lunar
  0 siblings, 1 reply; 9+ messages in thread
From: Andrei Borzenkov @ 2015-02-13 20:40 UTC (permalink / raw)
  To: Lunar; +Cc: grub-devel

[-- Attachment #1: Type: text/plain, Size: 6516 bytes --]

В Fri, 13 Feb 2015 21:20:23 +0100
Lunar <lunar@torproject.org> пишет:

> From 9b441e5e6c602c71e522c594ca6cff72a12c078c Mon Sep 17 00:00:00 2001
> From: Lunar <lunar@torproject.org>
> Date: Sat, 14 Feb 2015 14:14:25 +0100
> Subject: [PATCH 1/2] lib/syslinux_parse: add support for (vesa)menu.c32
> 
> Fixes Savannah bug #44238.
> ---
>  grub-core/lib/syslinux_parse.c | 157 ++++++++++++++++++++++++++---------------
>  1 file changed, 99 insertions(+), 58 deletions(-)
> 
> diff --git a/grub-core/lib/syslinux_parse.c b/grub-core/lib/syslinux_parse.c
> index 2c874b1..b0d5f9e 100644
> --- a/grub-core/lib/syslinux_parse.c
> +++ b/grub-core/lib/syslinux_parse.c
> @@ -840,6 +840,74 @@ simplify_filename (char *str)
>  }
>  
>  static grub_err_t
> +print_config (struct output_buffer *outbuf,
> +	      struct syslinux_menu *menu,
> +              const char *filename, const char *basedir)
> +{
> +  grub_err_t err;
> +  char *new_cwd, *new_target_cwd;
> +
> +  new_cwd = get_read_filename (menu, basedir);
> +  if (!new_cwd)
> +    return grub_errno;
> +  new_target_cwd = get_target_filename (menu, basedir);
> +  if (!new_target_cwd)
> +    return grub_errno;
> +

Memory leak.

> +  struct syslinux_menu *menuptr;
> +  char *newname;
> +  int depth = 0;
> +

If you move code anyway, please move declarations to the beginning.

> +  newname = get_read_filename (menu, filename);
> +  if (!newname)
> +    return grub_errno;

Memory leak.

> +  simplify_filename (newname);
> +
> +  print_string ("#");
> +  print_file (outbuf, menu, filename, NULL);
> +  print_string (" ");
> +  print (outbuf, newname, grub_strlen (newname));
> +  print_string (":\n");
> +
> +  for (menuptr = menu; menuptr; menuptr = menuptr->parent, depth++)
> +    if (grub_strcmp (menuptr->filename, newname) == 0
> +        || depth > 20)
> +      break;
> +  if (menuptr)
> +    {
> +      print_string ("  syslinux_configfile -r ");
> +      print_file (outbuf, menu, "/", NULL);
> +      print_string (" -c ");
> +      print_file (outbuf, menu, basedir, NULL);
> +      print_string (" ");
> +      print_file (outbuf, menu, filename, NULL);
> +      print_string ("\n");
> +    }
> +  else
> +    {
> +      err = config_file (outbuf, menu->root_read_directory,
> +                         menu->root_target_directory, new_cwd, new_target_cwd,
> +                         newname, menu, menu->flavour);
> +      if (err == GRUB_ERR_FILE_NOT_FOUND
> +          || err == GRUB_ERR_BAD_FILENAME)
> +        {
> +          grub_errno = err = GRUB_ERR_NONE;
> +          print_string ("# File ");
> +          err = print (outbuf, newname, grub_strlen (newname));
> +          if (err)
> +            return err;

Memory leak.

> +          print_string (" not found\n");
> +        }
> +      if (err)
> +        return err;

Memory leak.

> +    }

Just use goto and free them all here. I understand that you just move
existing code but let's also fix them.

> +  grub_free (newname);
> +  grub_free (new_cwd);
> +  grub_free (new_target_cwd);
> +  return GRUB_ERR_NONE;
> +}
> +
> +static grub_err_t
>  write_entry (struct output_buffer *outbuf,
>  	     struct syslinux_menu *menu,
>  	     struct syslinux_menuentry *curentry)
> @@ -1240,6 +1308,36 @@ write_entry (struct output_buffer *outbuf,
>  	    break;
>  	  }
>  
> +	if (grub_strcasecmp (basename, "menu.c32") == 0 ||
> +	    grub_strcasecmp (basename, "vesamenu.c32") == 0)
> +	  {
> +	    char *ptr;
> +	    char *end;
> +
> +	    ptr = curentry->append;
> +	    if (!ptr)
> +	      return grub_errno;
> +
> +	    while (*ptr)
> +	      {
> +		end = ptr;
> +		for (end = ptr; *end && !grub_isspace (*end); end++);
> +		if (*end)
> +		  *end++ = '\0';
> +
> +		/* "~" is supposed to be current file, so let's skip it */
> +		if (grub_strcmp (ptr, "~") != 0)
> +		  {
> +		    err = print_config (outbuf, menu, ptr, "");
> +		    if (err != GRUB_ERR_NONE)
> +		      break;
> +                  }
> +		for (ptr = end; *ptr && grub_isspace (*ptr); ptr++);
> +	      }
> +	    err = GRUB_ERR_NONE;
> +	    break;
> +	  }
> +
>  	/* FIXME: gdb, GFXBoot, Hdt, Ifcpu, Ifplop, Kbdmap,
>  	   FIXME: Linux, Lua, Meminfo, rosh, Sanbboot  */
>  
> @@ -1252,70 +1350,13 @@ write_entry (struct output_buffer *outbuf,
>        }
>      case KERNEL_CONFIG:
>        {
> -	char *new_cwd, *new_target_cwd;
>  	const char *ap;
>  	ap = curentry->append;
>  	if (!ap)
>  	  ap = curentry->argument;
>  	if (!ap)
>  	  ap = "";
> -	new_cwd = get_read_filename (menu, ap);
> -	if (!new_cwd)
> -	  return grub_errno;
> -	new_target_cwd = get_target_filename (menu, ap);
> -	if (!new_target_cwd)
> -	  return grub_errno;
> -
> -	struct syslinux_menu *menuptr;
> -	char *newname;
> -	int depth = 0;
> -	
> -	newname = get_read_filename (menu, curentry->kernel_file);
> -	if (!newname)
> -	  return grub_errno;
> -	simplify_filename (newname);
> -
> -	print_string ("#");
> -	print_file (outbuf, menu, curentry->kernel_file, NULL);
> -	print_string (" ");
> -	print (outbuf, newname, grub_strlen (newname));
> -	print_string (":\n");
> -
> -	for (menuptr = menu; menuptr; menuptr = menuptr->parent, depth++)
> -	  if (grub_strcmp (menuptr->filename, newname) == 0
> -	      || depth > 20)
> -	    break;
> -	if (menuptr)
> -	  {
> -	    print_string ("  syslinux_configfile -r ");
> -	    print_file (outbuf, menu, "/", NULL);
> -	    print_string (" -c ");
> -	    print_file (outbuf, menu, ap, NULL);
> -	    print_string (" ");
> -	    print_file (outbuf, menu, curentry->kernel_file, NULL);
> -	    print_string ("\n");
> -	  }
> -	else
> -	  {
> -	    err = config_file (outbuf, menu->root_read_directory,
> -			       menu->root_target_directory, new_cwd, new_target_cwd,
> -			       newname, menu, menu->flavour);
> -	    if (err == GRUB_ERR_FILE_NOT_FOUND
> -		|| err == GRUB_ERR_BAD_FILENAME)
> -	      {
> -		grub_errno = err = GRUB_ERR_NONE;
> -		print_string ("# File ");
> -		err = print (outbuf, newname, grub_strlen (newname));
> -		if (err)
> -		  return err;
> -		print_string (" not found\n");
> -	      }
> -	    if (err)
> -	      return err;
> -	  }
> -	grub_free (newname);
> -	grub_free (new_cwd);
> -	grub_free (new_target_cwd);
> +	print_config (outbuf, menu, curentry->kernel_file, ap);
>        }
>        break;
>      case KERNEL_NO_KERNEL:


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [bug #44238] Add support for menu.c32 and vesamenu.c32 in lib/syslinux_parse
       [not found] ` <20150213-190108.sv89796.21318@savannah.gnu.org>
@ 2015-02-13 20:20   ` Lunar
  2015-02-13 20:40     ` Andrei Borzenkov
  0 siblings, 1 reply; 9+ messages in thread
From: Lunar @ 2015-02-13 20:20 UTC (permalink / raw)
  To: grub-devel


[-- Attachment #1.1: Type: text/plain, Size: 594 bytes --]

Andrei Borzenkov:
> Follow-up Comment #1, bug #44238 (project grub):
> 
> +	    while (*ptr)
> +	      {
> +		end = ptr;
> +		for (end = ptr; *end && !grub_isspace (*end); end++);
> +		if (*end)
> +		  *end++ = '\0';
> +
> +		/* "~" is supposed to be current file, so let's skip it */
> +		if (grub_strcmp (ptr, "~") == 0)
> +		  continue;
> 
> If you hit "~" you get endless loop.

Thanks for spotting the mistake.

> Could you post fixed version to grub-devel for easier review?

Attached.

-- 
Lunar                                             <lunar@torproject.org>

[-- Attachment #1.2: 0001-lib-syslinux_parse-add-support-for-vesa-menu.c32.patch --]
[-- Type: text/x-diff, Size: 5792 bytes --]

From 9b441e5e6c602c71e522c594ca6cff72a12c078c Mon Sep 17 00:00:00 2001
From: Lunar <lunar@torproject.org>
Date: Sat, 14 Feb 2015 14:14:25 +0100
Subject: [PATCH 1/2] lib/syslinux_parse: add support for (vesa)menu.c32

Fixes Savannah bug #44238.
---
 grub-core/lib/syslinux_parse.c | 157 ++++++++++++++++++++++++++---------------
 1 file changed, 99 insertions(+), 58 deletions(-)

diff --git a/grub-core/lib/syslinux_parse.c b/grub-core/lib/syslinux_parse.c
index 2c874b1..b0d5f9e 100644
--- a/grub-core/lib/syslinux_parse.c
+++ b/grub-core/lib/syslinux_parse.c
@@ -840,6 +840,74 @@ simplify_filename (char *str)
 }
 
 static grub_err_t
+print_config (struct output_buffer *outbuf,
+	      struct syslinux_menu *menu,
+              const char *filename, const char *basedir)
+{
+  grub_err_t err;
+  char *new_cwd, *new_target_cwd;
+
+  new_cwd = get_read_filename (menu, basedir);
+  if (!new_cwd)
+    return grub_errno;
+  new_target_cwd = get_target_filename (menu, basedir);
+  if (!new_target_cwd)
+    return grub_errno;
+
+  struct syslinux_menu *menuptr;
+  char *newname;
+  int depth = 0;
+
+  newname = get_read_filename (menu, filename);
+  if (!newname)
+    return grub_errno;
+  simplify_filename (newname);
+
+  print_string ("#");
+  print_file (outbuf, menu, filename, NULL);
+  print_string (" ");
+  print (outbuf, newname, grub_strlen (newname));
+  print_string (":\n");
+
+  for (menuptr = menu; menuptr; menuptr = menuptr->parent, depth++)
+    if (grub_strcmp (menuptr->filename, newname) == 0
+        || depth > 20)
+      break;
+  if (menuptr)
+    {
+      print_string ("  syslinux_configfile -r ");
+      print_file (outbuf, menu, "/", NULL);
+      print_string (" -c ");
+      print_file (outbuf, menu, basedir, NULL);
+      print_string (" ");
+      print_file (outbuf, menu, filename, NULL);
+      print_string ("\n");
+    }
+  else
+    {
+      err = config_file (outbuf, menu->root_read_directory,
+                         menu->root_target_directory, new_cwd, new_target_cwd,
+                         newname, menu, menu->flavour);
+      if (err == GRUB_ERR_FILE_NOT_FOUND
+          || err == GRUB_ERR_BAD_FILENAME)
+        {
+          grub_errno = err = GRUB_ERR_NONE;
+          print_string ("# File ");
+          err = print (outbuf, newname, grub_strlen (newname));
+          if (err)
+            return err;
+          print_string (" not found\n");
+        }
+      if (err)
+        return err;
+    }
+  grub_free (newname);
+  grub_free (new_cwd);
+  grub_free (new_target_cwd);
+  return GRUB_ERR_NONE;
+}
+
+static grub_err_t
 write_entry (struct output_buffer *outbuf,
 	     struct syslinux_menu *menu,
 	     struct syslinux_menuentry *curentry)
@@ -1240,6 +1308,36 @@ write_entry (struct output_buffer *outbuf,
 	    break;
 	  }
 
+	if (grub_strcasecmp (basename, "menu.c32") == 0 ||
+	    grub_strcasecmp (basename, "vesamenu.c32") == 0)
+	  {
+	    char *ptr;
+	    char *end;
+
+	    ptr = curentry->append;
+	    if (!ptr)
+	      return grub_errno;
+
+	    while (*ptr)
+	      {
+		end = ptr;
+		for (end = ptr; *end && !grub_isspace (*end); end++);
+		if (*end)
+		  *end++ = '\0';
+
+		/* "~" is supposed to be current file, so let's skip it */
+		if (grub_strcmp (ptr, "~") != 0)
+		  {
+		    err = print_config (outbuf, menu, ptr, "");
+		    if (err != GRUB_ERR_NONE)
+		      break;
+                  }
+		for (ptr = end; *ptr && grub_isspace (*ptr); ptr++);
+	      }
+	    err = GRUB_ERR_NONE;
+	    break;
+	  }
+
 	/* FIXME: gdb, GFXBoot, Hdt, Ifcpu, Ifplop, Kbdmap,
 	   FIXME: Linux, Lua, Meminfo, rosh, Sanbboot  */
 
@@ -1252,70 +1350,13 @@ write_entry (struct output_buffer *outbuf,
       }
     case KERNEL_CONFIG:
       {
-	char *new_cwd, *new_target_cwd;
 	const char *ap;
 	ap = curentry->append;
 	if (!ap)
 	  ap = curentry->argument;
 	if (!ap)
 	  ap = "";
-	new_cwd = get_read_filename (menu, ap);
-	if (!new_cwd)
-	  return grub_errno;
-	new_target_cwd = get_target_filename (menu, ap);
-	if (!new_target_cwd)
-	  return grub_errno;
-
-	struct syslinux_menu *menuptr;
-	char *newname;
-	int depth = 0;
-	
-	newname = get_read_filename (menu, curentry->kernel_file);
-	if (!newname)
-	  return grub_errno;
-	simplify_filename (newname);
-
-	print_string ("#");
-	print_file (outbuf, menu, curentry->kernel_file, NULL);
-	print_string (" ");
-	print (outbuf, newname, grub_strlen (newname));
-	print_string (":\n");
-
-	for (menuptr = menu; menuptr; menuptr = menuptr->parent, depth++)
-	  if (grub_strcmp (menuptr->filename, newname) == 0
-	      || depth > 20)
-	    break;
-	if (menuptr)
-	  {
-	    print_string ("  syslinux_configfile -r ");
-	    print_file (outbuf, menu, "/", NULL);
-	    print_string (" -c ");
-	    print_file (outbuf, menu, ap, NULL);
-	    print_string (" ");
-	    print_file (outbuf, menu, curentry->kernel_file, NULL);
-	    print_string ("\n");
-	  }
-	else
-	  {
-	    err = config_file (outbuf, menu->root_read_directory,
-			       menu->root_target_directory, new_cwd, new_target_cwd,
-			       newname, menu, menu->flavour);
-	    if (err == GRUB_ERR_FILE_NOT_FOUND
-		|| err == GRUB_ERR_BAD_FILENAME)
-	      {
-		grub_errno = err = GRUB_ERR_NONE;
-		print_string ("# File ");
-		err = print (outbuf, newname, grub_strlen (newname));
-		if (err)
-		  return err;
-		print_string (" not found\n");
-	      }
-	    if (err)
-	      return err;
-	  }
-	grub_free (newname);
-	grub_free (new_cwd);
-	grub_free (new_target_cwd);
+	print_config (outbuf, menu, curentry->kernel_file, ap);
       }
       break;
     case KERNEL_NO_KERNEL:
-- 
1.9.1


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-03-17 17:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-17 17:40 [bug #44238] Add support for menu.c32 and vesamenu.c32 in lib/syslinux_parse The Gluglug
  -- strict thread matches above, loose matches on Subject: below --
2015-02-14  3:26 The Gluglug
     [not found] <20150213-163409.sv98365.64186@savannah.gnu.org>
     [not found] ` <20150213-190108.sv89796.21318@savannah.gnu.org>
2015-02-13 20:20   ` Lunar
2015-02-13 20:40     ` Andrei Borzenkov
2015-02-13 21:09       ` Lunar
2015-02-14  6:15         ` Andrei Borzenkov
2015-02-14  8:22           ` Lunar
2015-02-14 17:48             ` Andrei Borzenkov
2015-03-17 17:41           ` The Gluglug

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.