Implemented basic eltorito

This commit is contained in:
Mario Danic
2007-06-05 22:01:26 +00:00
parent 9746b5b273
commit 7faf1635a0
16 changed files with 872 additions and 97 deletions

View File

@@ -7,6 +7,7 @@
#include "tree.h"
#include "util.h"
#include "volume.h"
#include "eltorito.h"
#include <assert.h>
#include <string.h>
@@ -28,7 +29,7 @@ create_node(struct ecma119_write_target *t,
struct iso_tree_node_dir *dir = (struct iso_tree_node_dir *) iso;
ret->info.dir.children = calloc(sizeof(void*), dir->nchildren);
ret->type = JOLIET_DIR;
} else {
} else if (ISO_ISREG(iso)) {
/* it's a file */
struct iso_tree_node_file *iso_f = (struct iso_tree_node_file *) iso;
struct iso_file *file;
@@ -39,6 +40,14 @@ create_node(struct ecma119_write_target *t,
}
ret->info.file = file;
ret->type = JOLIET_FILE;
} else {
/* 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;
}
return ret;
@@ -55,11 +64,12 @@ create_tree(struct ecma119_write_target *t,
if ( iso->hide_flags & LIBISO_HIDE_ON_JOLIET )
return NULL;
switch (iso->attrib.st_mode & S_IFMT) {
case S_IFREG:
switch (iso->type) {
case LIBISO_NODE_FILE:
case LIBISO_NODE_BOOTCATALOG:
root = create_node(t, parent, iso);
break;
case S_IFDIR:
case LIBISO_NODE_DIR:
{
size_t i;
struct joliet_tree_node *node;
@@ -320,7 +330,6 @@ write_sup_vol_desc(struct ecma119_write_target *t, uint8_t *buf)
vol->vol_desc_type[0] = 2;
memcpy(vol->std_identifier, "CD001", 5);
vol->vol_desc_version[0] = 1;
memcpy(vol->system_id, "SYSID", 5);
if (vol_id)
memcpy(vol->volume_id, vol_id, vol_id_len);
memcpy(vol->esc_sequences, "%/E", 3);