Implemented support for eltorito on MS discs
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include "util.h"
|
||||
#include "volume.h"
|
||||
#include "eltorito.h"
|
||||
#include "messages.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
@@ -40,14 +41,14 @@ create_node(struct ecma119_write_target *t,
|
||||
}
|
||||
ret->info.file = file;
|
||||
ret->type = JOLIET_FILE;
|
||||
} else {
|
||||
} else if (ISO_ISBOOT(iso)) {
|
||||
/* it's boot catalog info */
|
||||
struct iso_tree_node_boot_catalog *iso_b =
|
||||
(struct iso_tree_node_boot_catalog *) iso;
|
||||
struct iso_file *file;
|
||||
file = iso_b->catalog->file;
|
||||
ret->info.file = file;
|
||||
ret->type = JOLIET_FILE;
|
||||
struct iso_tree_node_boot *boot = (struct iso_tree_node_boot*) iso;
|
||||
ret->info.boot_img = boot->img;
|
||||
ret->type = JOLIET_BOOT;
|
||||
} else {
|
||||
/* this should never happen */
|
||||
assert(0);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -66,7 +67,7 @@ create_tree(struct ecma119_write_target *t,
|
||||
|
||||
switch (iso->type) {
|
||||
case LIBISO_NODE_FILE:
|
||||
case LIBISO_NODE_BOOTCATALOG:
|
||||
case LIBISO_NODE_BOOT:
|
||||
root = create_node(t, parent, iso);
|
||||
break;
|
||||
case LIBISO_NODE_DIR:
|
||||
@@ -85,9 +86,13 @@ create_tree(struct ecma119_write_target *t,
|
||||
}
|
||||
break;
|
||||
default:
|
||||
//TODO replace this printf
|
||||
printf("Can't add this kind of node to a Joliet tree");
|
||||
{
|
||||
char msg[512];
|
||||
sprintf(msg, "Can't add %s to Joliet tree. This kind of files "
|
||||
"can only be added to a Rock Ridget tree. Skipping", iso->name);
|
||||
iso_msg_note(LIBISO_JOLIET_WRONG_FILE_TYPE, msg);
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return root;
|
||||
@@ -271,8 +276,19 @@ write_one_dir_record(struct ecma119_write_target *t,
|
||||
if (node->type == JOLIET_DIR) {
|
||||
len = node->info.dir.len;
|
||||
block = node->info.dir.block;
|
||||
} else if (node->type == JOLIET_BOOT) {
|
||||
assert(t->eltorito);
|
||||
if (node->info.boot_img) {
|
||||
block = t->imgblock;
|
||||
len = t->catalog->image->node->node.attrib.st_size;
|
||||
} else {
|
||||
/* we always assume 2048 as catalog len */
|
||||
block = t->catblock;
|
||||
len = 2048;
|
||||
}
|
||||
} else {
|
||||
/* file */
|
||||
assert(node->type == JOLIET_FILE);
|
||||
len = node->info.file->size;
|
||||
block = node->info.file->block;
|
||||
}
|
||||
|
Reference in New Issue
Block a user