wok-4.x rev 3665

Up syslinux (3.82) + add ifmem.c32
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Jul 10 10:50:27 2009 +0200 (2009-07-10)
parents fd3a74d77594
children f779db80fe51
files syslinux-extra/receipt syslinux-modules/receipt syslinux-tools/receipt syslinux/receipt syslinux/stuff/extra/ifmem.c
line diff
     1.1 --- a/syslinux-extra/receipt	Thu Jul 09 10:12:42 2009 +0200
     1.2 +++ b/syslinux-extra/receipt	Fri Jul 10 10:50:27 2009 +0200
     1.3 @@ -1,7 +1,7 @@
     1.4  # SliTaz package receipt.
     1.5  
     1.6  PACKAGE="syslinux-extra"
     1.7 -VERSION="3.73"
     1.8 +VERSION="3.82"
     1.9  CATEGORY="system-tools"
    1.10  SHORT_DESC="MBR/FAT/EXT3/PXE bootloader files"
    1.11  MAINTAINER="pankso@slitaz.org"
     2.1 --- a/syslinux-modules/receipt	Thu Jul 09 10:12:42 2009 +0200
     2.2 +++ b/syslinux-modules/receipt	Fri Jul 10 10:50:27 2009 +0200
     2.3 @@ -1,9 +1,9 @@
     2.4  # SliTaz package receipt.
     2.5  
     2.6  PACKAGE="syslinux-modules"
     2.7 -VERSION="3.73"
     2.8 +VERSION="3.82"
     2.9  CATEGORY="system-tools"
    2.10 -SHORT_DESC="C32 modules for syslinux"
    2.11 +SHORT_DESC="modules for syslinux"
    2.12  MAINTAINER="pankso@slitaz.org"
    2.13  WANTED="syslinux"
    2.14  WEB_SITE="http://syslinux.zytor.com/"
    2.15 @@ -13,7 +13,16 @@
    2.16  genpkg_rules()
    2.17  {
    2.18      mkdir -p $fs/usr/share/boot
    2.19 -    for i in mboot sanboot chain elf reboot ifcpu64 linux sdi menu vesamenu; do
    2.20 -    	lzma e $src/com32/*/$i.c32 $fs/usr/share/boot/$i.c32.lzma 2> /dev/null
    2.21 +    for i in $src/com32/*/*.c32 ; do
    2.22 +	case "$i" in
    2.23 +	*/reboot.c32|*/ifmem.c32) continue;;
    2.24 +	esac
    2.25 +	lzma e $i $fs/usr/share/boot/$(basename $i).lzma 2> /dev/null
    2.26 +    done
    2.27 +    for i in $src/modules/*.com ; do
    2.28 +	case "$i" in
    2.29 +	*/poweroff.com) continue;;
    2.30 +	esac
    2.31 +	cp $i $fs/usr/share/boot/$(basename $i) 2> /dev/null
    2.32      done
    2.33  }
     3.1 --- a/syslinux-tools/receipt	Thu Jul 09 10:12:42 2009 +0200
     3.2 +++ b/syslinux-tools/receipt	Fri Jul 10 10:50:27 2009 +0200
     3.3 @@ -1,7 +1,7 @@
     3.4  # SliTaz package receipt.
     3.5  
     3.6  PACKAGE="syslinux-tools"
     3.7 -VERSION="3.73"
     3.8 +VERSION="3.82"
     3.9  CATEGORY="system-tools"
    3.10  SHORT_DESC="Misc perl tools"
    3.11  MAINTAINER="pascal.bellard@slitaz.org"
     4.1 --- a/syslinux/receipt	Thu Jul 09 10:12:42 2009 +0200
     4.2 +++ b/syslinux/receipt	Fri Jul 10 10:50:27 2009 +0200
     4.3 @@ -1,7 +1,7 @@
     4.4  # SliTaz package receipt.
     4.5  
     4.6  PACKAGE="syslinux"
     4.7 -VERSION="3.73"
     4.8 +VERSION="3.82"
     4.9  CATEGORY="base-system"
    4.10  SHORT_DESC="LiveCD ISO bootloader (isolinux)"
    4.11  MAINTAINER="pankso@slitaz.org"
    4.12 @@ -17,6 +17,10 @@
    4.13  {
    4.14      cd $src
    4.15      cp ../stuff/tools/keytab-lilo.pl .
    4.16 +    cp ../stuff/extra/ifmem.c com32/modules
    4.17 +    grep -q ifmem.c32 com32/modules/Makefile ||
    4.18 +	sed -i 's/ifcpu64.c32/ifcpu64.c32 ifmem.c32/' com32/modules/Makefile
    4.19 +    make -C com32
    4.20      for i in /usr/share/kbd/keymaps/i386/*/*.map.gz; do
    4.21          [ "$(basename $(dirname $i))" = "include" ] && continue
    4.22          j=$(basename $i)
    4.23 @@ -31,6 +35,8 @@
    4.24      mkdir -p $fs/boot/isolinux
    4.25      cp -a $src/core/isolinux.bin $fs/boot/isolinux
    4.26      cp -a $src/com32/modules/reboot.c32 $fs/boot/isolinux
    4.27 +    cp -a $src/com32/modules/ifmem.c32 $fs/boot/isolinux
    4.28 +    cp -a $src/modules/poweroff.com $fs/boot/isolinux
    4.29      cp stuff/*.* $fs/boot/isolinux
    4.30      while read cfg kbd loc ; do
    4.31          sed -e "s/^display/kbdmap $cfg.kbd\ndisplay/" \
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/syslinux/stuff/extra/ifmem.c	Fri Jul 10 10:50:27 2009 +0200
     5.3 @@ -0,0 +1,77 @@
     5.4 +/* ----------------------------------------------------------------------- *
     5.5 + *
     5.6 + *   Copyright 2009 Pascal Bellard - All Rights Reserved
     5.7 + *
     5.8 + *   This program is free software; you can redistribute it and/or modify
     5.9 + *   it under the terms of the GNU General Public License as published by
    5.10 + *   the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
    5.11 + *   Boston MA 02110-1301, USA; either version 2 of the License, or
    5.12 + *   (at your option) any later version; incorporated herein by reference.
    5.13 + *
    5.14 + * ----------------------------------------------------------------------- */
    5.15 +
    5.16 +/*
    5.17 + * ifmem.c
    5.18 + *
    5.19 + * Run one command if the memory is large enought, and another if it isn't.
    5.20 + *
    5.21 + * Usage:
    5.22 + *
    5.23 + *    label boot_kernel
    5.24 + *        kernel ifmem.c
    5.25 + *        append size_in_KB boot_large [size_in_KB boot_medium] boot_small
    5.26 + *
    5.27 + *    label boot_large
    5.28 + *        kernel vmlinuz_large_memory
    5.29 + *        append ...
    5.30 + *
    5.31 + *    label boot_small
    5.32 + *        kernel vmlinuz_small_memory
    5.33 + *        append ...
    5.34 + */
    5.35 +
    5.36 +#include <inttypes.h>
    5.37 +#include <com32.h>
    5.38 +#include <console.h>
    5.39 +#include <stdio.h>
    5.40 +#include <string.h>
    5.41 +#include <alloca.h>
    5.42 +#include <stdlib.h>
    5.43 +#include <syslinux/boot.h>
    5.44 +
    5.45 +static long memory_size(void)
    5.46 +{
    5.47 +  com32sys_t ireg, oreg;
    5.48 +
    5.49 +  memset(&ireg, 0, sizeof ireg);
    5.50 +
    5.51 +  ireg.eax.w[0] = 0xe801;
    5.52 +  __intcall(0x15, &ireg, &oreg);
    5.53 +
    5.54 +  return  oreg.ecx.w[0] + ( oreg.edx.w[0] << 6);
    5.55 +}
    5.56 +
    5.57 +int main(int argc, char *argv[])
    5.58 +{
    5.59 +  char *s;
    5.60 +  int i;
    5.61 +
    5.62 +  for (s = argv[1]; *s && (*s < '0' || *s > '9'); s++);
    5.63 +
    5.64 +  if (argc < 4 || !*s) {
    5.65 +    openconsole(&dev_null_r, &dev_stdcon_w);
    5.66 +    perror("\nUsage: ifmem.c32 size_KB boot_large_memory boot_small_memory\n");
    5.67 +    return 1;
    5.68 +  }
    5.69 +
    5.70 +  for (i = 1; i + 2 < argc; ) { 
    5.71 +    i++; // size
    5.72 +    if (memory_size() >= strtoul(s, NULL, 0)) break;
    5.73 +    s = argv[++i];
    5.74 +  }
    5.75 +  if (argv[i])
    5.76 +    syslinux_run_command(argv[i]);
    5.77 +  else
    5.78 +    syslinux_run_default();
    5.79 +  return -1;
    5.80 +}