SHA256
1
0
forked from pool/syslinux
syslinux/isolinux-config
Steffen Winterfeldt 645ce1e6ec - update to version 4.03
* Major code base changes; all filesystem rewritten in C.
    This work was done primarily by Liu Aleaxander (Yuanhan Liu).
  * Better support for booting from MBRs which don't pass
    handover information.
  * EXTLINUX: Try to be smarter about finding the partition
    offset.
  * chain.c32: support chainloading Dell Real Mode Kernel (Gene
    Cumm).
  * chain.c32: fix booting in CHS mode.
  * Fix the -s option to the syslinux/extlinux installer (Arwin
    Vosselman).
  * isohybrid: fix padding of large images (PJ Pandit).
  * SYSLINUX: correctly handle the case where the -d option is
    specified with a non-absolute path, i.e. "syslinux -d
    syslinux" instead of "syslinux -d /syslinux".
  * ISOLINUX: recognize the directory names /boot/syslinux and
    /syslinux, and the filename syslinux.cfg in addition to the
    isolinux-specific names.  Thus, "syslinux.cfg" is now a
    generic name, whereas "isolinux.cfg" or "extlinux.conf" is
    specific to different derivative.
  * chain.c32: support setting alternate config filename for
    stage2 of GRUB Legacy (Gert Hulselmans).
  * whichsys.c32: execute specific command, based on Syslinux
    bootloader variant (Gert Hulselmans).
  * lua.c32: a lot of new bindings added to the "syslinux"
    namespace: VESA, PCI, DMI, kernel loading (Marcel Ritter).
  * btrfs: print a comprehensive error message if compressed or
    encrypted files are encountered (neither is currently

OBS-URL: https://build.opensuse.org/package/show/system:install:head/syslinux?expand=0&rev=25
2011-04-18 16:02:08 +00:00

70 lines
1.4 KiB
Perl

#! /usr/bin/perl
#
# Patch new base dir into isolinux.
#
# Makes some assumptions about memory layout in isolinux.
#
use Getopt::Long;
sub help;
$opt_base = undef;
$opt_help = undef;
GetOptions(
'help' => \$opt_help,
'base=s' => \$opt_base,
);
$file = shift;
help if $file eq '' || $opt_help;
open F, $file or die "$file: $!\n";
sysread F, $file_buf, -s($file);
close F;
if((length $file_buf > (8 << 10)) && ($file_buf =~ m#(/boot(/[\x20-\xff]*)\x00*)\x00isolinux.cfg\x00#s)) {
$format = 1;
}
elsif((length $file_buf > (8 << 10)) && ($file_buf =~ m#(/boot(/[\x20-\xff]*)\x00*)\x00/boot/syslinux\x00#s)) {
$format = 2;
}
die "$file: is not isolinux\n" unless $format;
$start = length $`;
$base_buf = $1;
$old_base = $2;
if(defined $opt_base) {
($base = $opt_base) =~ s#^/*##;
$base = "/boot/$base";
die "$opt_base: file name too long\n" if length($base) > length($base_buf);
$base_buf = $base . "\x00" x (length($base_buf) - length($base));
substr($file_buf, $start, length($base_buf)) = $base_buf;
open F, ">$file" or die "$file: $!\n";
syswrite F, $file_buf;
close F;
($old_base = $base) =~ s#^/boot##;
}
print "base=$old_base\n";
sub help
{
die
"usage: isolinux-config [options] isolinux_binary\n" .
"Configure isolinux.\n" .
"Options:\n" .
" --base dir\tset isolinux base directory to dir\n" .
" --help\tthis message\n";
}