wok-6.x rev 19192
syslinux: no i18n menu with custom config
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Jun 05 16:28:03 2016 +0200 (2016-06-05) |
parents | 8e0ca9e60f25 |
children | 2638f54b93f1 |
files | syslinux/stuff/extra/readconfig.u |
line diff
1.1 --- a/syslinux/stuff/extra/readconfig.u Sun Jun 05 10:06:19 2016 +0200 1.2 +++ b/syslinux/stuff/extra/readconfig.u Sun Jun 05 16:28:03 2016 +0200 1.3 @@ -1,14 +1,41 @@ 1.4 --- com32/menu/readconfig.c 1.5 +++ com32/menu/readconfig.c 1.6 -@@ -874,6 +874,12 @@ 1.7 +@@ -23,6 +23,7 @@ 1.8 + #include <com32.h> 1.9 + #include <syslinux/adv.h> 1.10 + #include <syslinux/config.h> 1.11 ++#include <syslinux/disk.h> 1.12 + 1.13 + #include "menu.h" 1.14 + 1.15 +@@ -874,6 +875,31 @@ 1.16 } 1.17 } else if (looking_at(p, "start")) { 1.18 start_menu = m; 1.19 + } else if ((ep = looking_at(p, "startifnoarg"))) { 1.20 ++ const union syslinux_derivative_info *sdi; 1.21 ++ int custom = 0; 1.22 + size_t size; 1.23 + int slot; 1.24 ++ sdi = syslinux_derivative_info(); 1.25 ++ if (sdi->c.filesystem == SYSLINUX_FS_ISOLINUX) { 1.26 ++ struct disk_info diskinfo; 1.27 ++ char *custom_buffer; 1.28 ++ int got_config; 1.29 ++ 1.30 ++ disk_get_params(sdi->iso.drive_number, &diskinfo); 1.31 ++ custom_buffer = disk_read_sectors(&diskinfo, 32768 / diskinfo.bps, 1); 1.32 ++ got_config = (16 + *(unsigned long *) (custom_buffer + 80)) 1.33 ++ * 2048 / diskinfo.bps; 1.34 ++ free(custom_buffer); 1.35 ++ custom_buffer = disk_read_sectors(&diskinfo, got_config, 1); 1.36 ++ if (!memcmp(custom_buffer,"#!boot ",7)) { 1.37 ++ custom++; 1.38 ++ } 1.39 ++ free(custom_buffer); 1.40 ++ } 1.41 + slot = strtoul(ep, &ep, 0); 1.42 -+ if (!syslinux_getadv(slot, &size)) 1.43 ++ if (!custom && !syslinux_getadv(slot, &size)) 1.44 + start_menu = m; 1.45 } else if (looking_at(p, "help")) { 1.46 if (ld.label) {