From 870280a0185736b433b81eac956ab27eace6a812 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Wed, 13 Oct 2010 16:59:18 +0200 Subject: [PATCH] Small adjustments and bug fix with new MIPS boot facility. --- libisofs/image.c | 2 +- libisofs/libisofs.h | 8 +++++--- libisofs/system_area.c | 7 ++++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/libisofs/image.c b/libisofs/image.c index 54a2858..02abb9a 100644 --- a/libisofs/image.c +++ b/libisofs/image.c @@ -636,7 +636,7 @@ int iso_image_get_mips_boot_files(IsoImage *image, char *paths[15], int flag) int i; for (i = 0; i < image->num_mips_boot_files; i++) - paths[i] = image->mips_boot_file_paths[image->num_mips_boot_files]; + paths[i] = image->mips_boot_file_paths[i]; for (; i < 15; i++) paths[i] = NULL; return image->num_mips_boot_files; diff --git a/libisofs/libisofs.h b/libisofs/libisofs.h index ef70608..b4ad231 100644 --- a/libisofs/libisofs.h +++ b/libisofs/libisofs.h @@ -2968,13 +2968,15 @@ int iso_image_get_system_area(IsoImage *img, char data[32768], int *options, int flag); /** - * Add a MIPS Big Endian boot file to the image. Up to 15 such files can be - * written into a MIPS Big Endian Volume Header if this is enabled by + * Add a MIPS Big Endian boot file path to the image. Up to 15 such files can + * be written into a MIPS Big Endian Volume Header if this is enabled by * value 1 in iso_write_opts_set_system_area() option bits 2 to 7. + * The data files which shall serve as MIPS boot files have to be brought into + * the image by the normal means. * @param img * The image to be manipulated. * @param path - * Absolute path of the boot file in the ISO 9660 Rock Ridge tree + * Absolute path of the boot file in the ISO 9660 Rock Ridge tree. * @param flag * Bitfield for control purposes, unused yet, submit 0 * @return diff --git a/libisofs/system_area.c b/libisofs/system_area.c index ebfb7c6..6dfe501 100644 --- a/libisofs/system_area.c +++ b/libisofs/system_area.c @@ -236,7 +236,8 @@ static int make_mips_volume_header(Ecma119Image *t, uint8_t *buf, int flag) int ret; #endif - memset(buf, 0, 16 * BLOCK_SIZE); + /* Bytes 512 to 32767 may come from image or external file */ + memset(buf, 0, 512); image_size = t->curblock * 2048; @@ -425,14 +426,14 @@ int iso_write_system_area(Ecma119Image *t, uint8_t *buf) ret = make_mips_volume_header(t, buf, 0); if (ret != ISO_SUCCESS) return ret; - } else if(t->partition_offset > 0) { + } else if(t->partition_offset > 0 && sa_type == 0) { /* Write a simple partition table. */ ret = make_grub_msdos_label(img_blocks, buf, 2); if (ret != ISO_SUCCESS) /* error should never happen */ return ISO_ASSERT_FAILURE; } - if (t->partition_offset > 0) { + if (t->partition_offset > 0 && sa_type == 0) { /* Adjust partition table to partition offset */ img_blocks = t->curblock; /* value might be altered */ ret = iso_offset_partition_start(img_blocks, t->partition_offset,