Update to mkelfImage 1.12

- Fix bad heuristic in mkelfImage 1.11 where if I wasn't given a firmware
  type I assumed PCBIOS.
- Use objcopy to strip off extra symbols and the .ramdisk section if unused
- Fix typo linuxBIOS -> LinuxBIOS
This commit is contained in:
Eric W. Biederman 2002-01-27 00:44:08 +00:00
commit 75783e063d
3 changed files with 18 additions and 7 deletions

View file

@ -6,8 +6,8 @@
# the result will be a directory tree that you can run mkelfImage in
PREFIX=/usr/local/
PERLPATH=/usr/bin/perl
VERSION="1.11"
DATE="24 January 2002"
VERSION="1.12"
DATE="26 January 2002"
SHAREDIR=$(PREFIX)/share/mkelfImage
BINDIR=$(PREFIX)/bin

View file

@ -1085,8 +1085,10 @@ static int bootloader_query_firmware_class(struct param_info *info)
hdr = find_elf_note(info->data, 0, 0, EBN_FIRMWARE_TYPE);
if (!hdr) {
info->has_pcbios = 1;
detected_firmware_type = 1;
/* If I'm not explicitly told the firmware type
* do my best to guess it for myself.
*/
detected_firmware_type = 0;
} else {
note = (char *)hdr;
n_name = note + sizeof(*hdr);
@ -1149,7 +1151,7 @@ static void query_firmware_class(struct param_info *info)
/* Now print out the firmware type... */
puts("Firmware type:");
if (info->has_linuxbios) {
puts(" linuxBIOS");
puts(" LinuxBIOS");
}
if (info->has_pcbios) {
puts(" PCBIOS");

View file

@ -55,7 +55,7 @@ sub build_kernel_piggy
if ($elf_sig eq "\x7FELF") {
# It's an elf image
# Assume the input file uses contiguous memory...
system("objcopy ${src} -O binary ${dst}.obj");
system("$params->{OBJCOPY} ${src} -O binary ${dst}.obj");
die "rc = $?" unless ($? == 0);
}
elsif ($bootsector_sig == 0xAA55) {
@ -148,11 +148,20 @@ sub build_elf_image
$fd->print("initrd_base = $params->{INITRD_BASE};\n");
$fd->close();
my $script = "$params->{PREFIX}/elfImage.lds";
my $cmd = "$params->{LD} -o ${dst} -T $script " . join(" ", @srcs);
my $cmd = "$params->{LD} -o ${dst}.fat -T $script " . join(" ", @srcs);
print " Running $cmd";
system("$cmd");
die "rc = $?" unless ($? == 0);
my $cmd2 = "$params->{OBJCOPY} ${dst}.fat ${dst} -S -R .comment -R .note0";
if (!$params->{RAMDISK}) {
$cmd2 .= " -R .ramdisk";
}
print " Running $cmd";
system("$cmd2");
die "rc = $?" unless ($? == 0);
unlink("${dst}.obj",$lscript);
unlink("${dst}.fat",$lscript);
return $dst;
}