From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1YXvTw-00081k-Pq for mharc-grub-devel@gnu.org; Tue, 17 Mar 2015 13:40:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37178) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXvTu-00081Z-6D for grub-devel@gnu.org; Tue, 17 Mar 2015 13:40:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YXvTp-0005mg-HM for grub-devel@gnu.org; Tue, 17 Mar 2015 13:40:41 -0400 Received: from web006.ispnoc.net ([178.21.20.23]:45062) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXvTp-0005lp-8r for grub-devel@gnu.org; Tue, 17 Mar 2015 13:40:37 -0400 Received: from 236.193.187.81.in-addr.arpa ([81.187.193.236] helo=[192.168.1.68]) by web006.ispnoc.net with esmtpsa (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.85) (envelope-from ) id 1YXvTe-00009J-GD; Tue, 17 Mar 2015 18:40:26 +0100 Message-ID: <55086710.8080506@gluglug.org.uk> Date: Tue, 17 Mar 2015 17:40:32 +0000 From: The Gluglug User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.3.0 MIME-Version: 1.0 To: lunar@torproject.org Subject: Re: [bug #44238] Add support for menu.c32 and vesamenu.c32 in lib/syslinux_parse References: 20150213202023.GF688@loar Content-Type: multipart/mixed; boundary="------------010001070103010304040907" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 178.21.20.23 Cc: grub-devel@gnu.org X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Mar 2015 17:40:43 -0000 This is a multi-part message in MIME format. --------------010001070103010304040907 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit -----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----- --------------010001070103010304040907 Content-Type: text/x-diff; name="0002-lib-syslinux_parse-add-support-for-vesa-menu.c32.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0002-lib-syslinux_parse-add-support-for-vesa-menu.c32.patch" >From 191aeee1b67ff30d6c868320a51cb9fb766874be Mon Sep 17 00:00:00 2001 From: Lunar 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 --------------010001070103010304040907 Content-Type: application/pgp-signature; name="0002-lib-syslinux_parse-add-support-for-vesa-menu.c32.patch.sig" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename*0="0002-lib-syslinux_parse-add-support-for-vesa-menu.c32.patch."; filename*1="sig" iQEcBAABAgAGBQJVCGcPAAoJEP9Ft0z50c+U86QIAKWLv6daK6A5oC/ySsuf+crhf5By0Gpy Lv90y0GREyeg0gn4PSFQZo6l90CoIfKjtDekHkNY5RxQ0ZLIuqp3QbrqOjii6Hs/QP9mj7Zf J9uESdMffDG5j/Oyw/vHnMnqY43UpzvbkkYd83WDc9WnS/7gpYV0xMHiuJkJZn7fhDp8DN7l Id2kBFOqVqwTYUk8ILsb6HeV+lC4Yei0ApJcT0dkOjIlKiBu5VLaMrVXNu5tUJqBcJSev7Tw hBwwAfSWhkcgDoBIhxSqUICV7LhNoIc2plguIvoY4+GmxXEVqSjHvDsZ9cyfcuTInM2g+eGC 7QYh0SehYWQvEeAMp/cIccg= --------------010001070103010304040907--