wok rev 12349
syslinux: merge setarg ifarg & listarg modules
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Apr 19 18:35:25 2012 +0200 (2012-04-19) |
parents | 0e7a8e01fa4f |
children | 5c25d23ae728 |
files | syslinux/receipt syslinux/stuff/extra/md5sum.c syslinux/stuff/i18n.cfg syslinux/stuff/isolinux.cfg |
line diff
1.1 --- a/syslinux/receipt Thu Apr 19 10:18:06 2012 +0000 1.2 +++ b/syslinux/receipt Thu Apr 19 18:35:25 2012 +0200 1.3 @@ -81,7 +81,6 @@ 1.4 sl slovene sl_SI Slovenski 1.5 tr tr_q-latin5 tr_TR Turk 1.6 EOT 1.7 -# Missing: nl2 ru sg-latin1 trq 1.8 cat >> $fs/boot/isolinux/i18n.cfg <<EOT 1.9 1.10 LABEL exit 1.11 @@ -89,6 +88,12 @@ 1.12 MENU EXIT 1.13 MENU END 1.14 EOT 1.15 + sed -i 's/^LABEL us$/&\n MENU DEFAULT/' $fs/boot/isolinux/i18n.cfg 1.16 + for kbd in $(cd $src ; ls *.kbd); do 1.17 + [ -s $kbd.kbd ] || echo "Invalid file $kbd.kbd" 1.18 + grep -q " $kbd.kbd " $fs/boot/isolinux/i18n.cfg && continue 1.19 + echo "Missing: file $kbd.kbd" 1.20 + done 1.21 chown root.root $fs/boot/isolinux/* 1.22 } 1.23
2.1 --- a/syslinux/stuff/extra/md5sum.c Thu Apr 19 10:18:06 2012 +0000 2.2 +++ b/syslinux/stuff/extra/md5sum.c Thu Apr 19 18:35:25 2012 +0200 2.3 @@ -431,14 +431,20 @@ 2.4 return bytes >> 10; 2.5 } 2.6 2.7 +static void usage(const char *msg) 2.8 +{ 2.9 + fprintf(stderr,"\n%s\n.",msg); 2.10 + sleep(5); 2.11 + exit(1); 2.12 +} 2.13 + 2.14 static int main_ifmem(int argc, char *argv[]) 2.15 { 2.16 int i; 2.17 unsigned long ram_size; 2.18 2.19 if (argc < 4) { 2.20 - perror("\nUsage: ifmem.c32 size_KB boot_large_memory boot_small_memory\n"); 2.21 - return 1; 2.22 + usage("Usage: ifmem.c32 size_KB boot_large_memory boot_small_memory"); 2.23 } 2.24 2.25 // find target according to ram size 2.26 @@ -463,7 +469,7 @@ 2.27 i++; // next size or default label 2.28 } while (i + 1 < argc); 2.29 2.30 - if (i != argc) syslinux_run_command(argv[i]); 2.31 + if (i != argc) syslinux_run_command(argv[i]); 2.32 else syslinux_run_default(); 2.33 return -1; 2.34 } 2.35 @@ -549,20 +555,23 @@ 2.36 #include <syslinux/loadfile.h> 2.37 #include <syslinux/adv.h> 2.38 2.39 +static void setlinuxarg(int slot, int argc, char *argv[]) 2.40 +{ 2.41 + for (; argc--; argv++) 2.42 + syslinux_setadv(slot++, strlen(*argv), *argv); 2.43 +} 2.44 + 2.45 static int main_kbdmap(int argc, char *argv[]) 2.46 { 2.47 const struct syslinux_keyboard_map *const kmap = syslinux_keyboard_map(); 2.48 size_t map_size, size, i; 2.49 char *kbdmap, *msg; 2.50 2.51 - msg = "Usage: kbdmap archive.cpio mapfile [cmdline].."; 2.52 if (argc < 3) 2.53 - goto kbdmap_error; 2.54 + usage("Usage: kbdmap archive.cpio mapfile [cmdline].."); 2.55 2.56 // Save extra cmdline arguments 2.57 - for (i = 3; i < (size_t) argc; i++) { 2.58 - syslinux_setadv(i - 2, strlen(argv[i]), argv[i]); 2.59 - } 2.60 + setlinuxarg(1, argc - 3, argv + 3); 2.61 2.62 msg = "Load error"; 2.63 if (kmap->version != 1 || 2.64 @@ -746,8 +755,6 @@ 2.65 size_t dhcplen; 2.66 char **argp, *arg, *p; 2.67 2.68 - openconsole(&dev_null_r, &dev_stdcon_w); 2.69 - 2.70 (void)argc; 2.71 argp = argv + 1; 2.72 2.73 @@ -839,6 +846,75 @@ 2.74 return 1; 2.75 } 2.76 2.77 +static int main_setarg(int argc, char *argv[]) 2.78 +{ 2.79 + if (argc < 3) { 2.80 + usage("Usage: setarg.c32 argnum [args]..."); 2.81 + } 2.82 + setlinuxarg(atoi(argv[1]), argc - 2, argv + 2); 2.83 + return 0; 2.84 +} 2.85 + 2.86 +static int main_ifarg(int argc, char *argv[]) 2.87 +{ 2.88 + int i; 2.89 + size_t size; 2.90 + 2.91 + if (argc < 3) { 2.92 + usage("Usage: ifarg.c32 [argnum labelifset]... labelifnoneset"); 2.93 + } 2.94 + for (i = 1; i < argc - 1; i += 2) { 2.95 + if (syslinux_getadv(atoi(argv[i]), &size)) 2.96 + syslinux_run_command(argv[i+1]); 2.97 + } 2.98 + if (i != argc) syslinux_run_command(argv[i]); 2.99 + else syslinux_run_default(); 2.100 + return 0; 2.101 +} 2.102 + 2.103 +/* ----------------------------------------------------------------------- * 2.104 + * 2.105 + * Copyright 2007-2008 H. Peter Anvin - All Rights Reserved 2.106 + * 2.107 + * This program is free software; you can redistribute it and/or modify 2.108 + * it under the terms of the GNU General Public License as published by 2.109 + * the Free Software Foundation, Inc., 53 Temple Place Ste 330, 2.110 + * Boston MA 02111-1307, USA; either version 2 of the License, or 2.111 + * (at your option) any later version; incorporated herein by reference. 2.112 + * 2.113 + * ----------------------------------------------------------------------- */ 2.114 + 2.115 +static int main_listarg(int argc, char *argv[]) 2.116 +{ 2.117 + uint8_t *p, *ep; 2.118 + size_t s = syslinux_adv_size(); 2.119 + char buf[256]; 2.120 + 2.121 + (void) argc; 2.122 + (void) argv; 2.123 + p = syslinux_adv_ptr(); 2.124 + 2.125 + printf("args size: %zd bytes at %p\n", s, p); 2.126 + 2.127 + ep = p + s; /* Need at least opcode+len */ 2.128 + while (p < ep - 1 && *p) { 2.129 + int t = *p++; 2.130 + int l = *p++; 2.131 + 2.132 + if (p + l > ep) 2.133 + break; 2.134 + 2.135 + memcpy(buf, p, l); 2.136 + buf[l] = '\0'; 2.137 + 2.138 + printf("arg %3d: \"%s\"\n", t, buf); 2.139 + 2.140 + p += l; 2.141 + } 2.142 + sleep(5); 2.143 + return 0; 2.144 +} 2.145 + 2.146 int main(int argc, char *argv[]) 2.147 { 2.148 unsigned i; 2.149 @@ -851,7 +927,10 @@ 2.150 { "reboot", main_reboot }, 2.151 { "poweroff", main_poweroff }, 2.152 { "kbdmap", main_kbdmap }, 2.153 - { "linux", main_linux } 2.154 + { "linux", main_linux }, 2.155 + { "setarg", main_setarg }, 2.156 + { "ifarg", main_ifarg }, 2.157 + { "listarg", main_listarg } 2.158 }; 2.159 2.160 openconsole(&dev_null_r, &dev_stdcon_w);
3.1 --- a/syslinux/stuff/i18n.cfg Thu Apr 19 10:18:06 2012 +0000 3.2 +++ b/syslinux/stuff/i18n.cfg Thu Apr 19 18:35:25 2012 +0200 3.3 @@ -1,4 +1,7 @@ 3.4 # Languages submenu 3.5 MENU BEGIN ^lang 3.6 MENU TITLE Languages 3.7 +MENU TABMSG 3.8 +MENU START 3.9 +TIMEOUT 1 3.10
4.1 --- a/syslinux/stuff/isolinux.cfg Thu Apr 19 10:18:06 2012 +0000 4.2 +++ b/syslinux/stuff/isolinux.cfg Thu Apr 19 18:35:25 2012 +0200 4.3 @@ -8,11 +8,11 @@ 4.4 MENU BACKGROUND splash.jpg 4.5 MENU WIDTH 78 4.6 MENU MARGIN 6 4.7 -MENU ROWS 6 4.8 -MENU VSHIFT 6 4.9 -MENU TIMEOUTROW 14 4.10 -MENU TABMSGROW 12 4.11 -MENU CMDLINEROW 12 4.12 +MENU ROWS 12 4.13 +MENU VSHIFT 3 4.14 +MENU TIMEOUTROW 16 4.15 +MENU TABMSGROW 14 4.16 +MENU CMDLINEROW 14 4.17 4.18 # Menu colors 4.19 MENU COLOR border * #00000000 #00000000 none