wok view syslinux/stuff/extra/readconfig.u @ rev 19836

Up slitaz-tools
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Mar 11 09:26:27 2017 +0100 (2017-03-11)
parents 922ed71c2f6d
children
line source
1 --- com32/menu/readconfig.c
2 +++ com32/menu/readconfig.c
3 @@ -23,6 +23,7 @@
4 #include <com32.h>
5 #include <syslinux/adv.h>
6 #include <syslinux/config.h>
7 +#include <syslinux/disk.h>
9 #include "menu.h"
11 @@ -874,6 +875,31 @@
12 }
13 } else if (looking_at(p, "start")) {
14 start_menu = m;
15 + } else if ((ep = looking_at(p, "startifnoarg"))) {
16 + const union syslinux_derivative_info *sdi;
17 + int custom = 0;
18 + size_t size;
19 + int slot;
20 + sdi = syslinux_derivative_info();
21 + if (sdi->c.filesystem == SYSLINUX_FS_ISOLINUX) {
22 + struct disk_info diskinfo;
23 + char *custom_buffer;
24 + int got_config;
25 +
26 + disk_get_params(sdi->iso.drive_number, &diskinfo);
27 + custom_buffer = disk_read_sectors(&diskinfo, 32768 / diskinfo.bps, 1);
28 + got_config = (*(unsigned long *) (custom_buffer + 80))
29 + * 2048 / diskinfo.bps;
30 + free(custom_buffer);
31 + custom_buffer = disk_read_sectors(&diskinfo, got_config, 1);
32 + if (!memcmp(custom_buffer,"#!boot ",7)) {
33 + custom++;
34 + }
35 + free(custom_buffer);
36 + }
37 + slot = strtoul(ep, &ep, 0);
38 + if (!custom && !syslinux_getadv(slot, &size))
39 + start_menu = m;
40 } else if (looking_at(p, "help")) {
41 if (ld.label) {
42 ld.action = MA_HELP;