Made Libisofs_with_rr_reloc_diR unconditional
This commit is contained in:
parent
8b2edd7ca4
commit
942ec97c7b
@ -90,14 +90,8 @@ void ecma119_image_free(Ecma119Image *t)
|
|||||||
writer->free_data(writer);
|
writer->free_data(writer);
|
||||||
free(writer);
|
free(writer);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef Libisofs_with_rr_reloc_diR
|
|
||||||
|
|
||||||
if (t->rr_reloc_dir != NULL)
|
if (t->rr_reloc_dir != NULL)
|
||||||
free(t->rr_reloc_dir);
|
free(t->rr_reloc_dir);
|
||||||
|
|
||||||
#endif /* Libisofs_with_rr_reloc_diR */
|
|
||||||
|
|
||||||
if (t->input_charset != NULL)
|
if (t->input_charset != NULL)
|
||||||
free(t->input_charset);
|
free(t->input_charset);
|
||||||
if (t->output_charset != NULL)
|
if (t->output_charset != NULL)
|
||||||
@ -1721,9 +1715,6 @@ int ecma119_image_new(IsoImage *src, IsoWriteOpts *opts, Ecma119Image **img)
|
|||||||
target->rrip_1_10_px_ino = opts->rrip_1_10_px_ino;
|
target->rrip_1_10_px_ino = opts->rrip_1_10_px_ino;
|
||||||
target->aaip_susp_1_10 = opts->aaip_susp_1_10;
|
target->aaip_susp_1_10 = opts->aaip_susp_1_10;
|
||||||
target->dir_rec_mtime = opts->dir_rec_mtime;
|
target->dir_rec_mtime = opts->dir_rec_mtime;
|
||||||
|
|
||||||
#ifdef Libisofs_with_rr_reloc_diR
|
|
||||||
|
|
||||||
target->rr_reloc_dir = NULL;
|
target->rr_reloc_dir = NULL;
|
||||||
if (opts->rr_reloc_dir != NULL) {
|
if (opts->rr_reloc_dir != NULL) {
|
||||||
target->rr_reloc_dir = strdup(opts->rr_reloc_dir);
|
target->rr_reloc_dir = strdup(opts->rr_reloc_dir);
|
||||||
@ -1734,9 +1725,6 @@ int ecma119_image_new(IsoImage *src, IsoWriteOpts *opts, Ecma119Image **img)
|
|||||||
}
|
}
|
||||||
target->rr_reloc_flags = opts->rr_reloc_flags;
|
target->rr_reloc_flags = opts->rr_reloc_flags;
|
||||||
target->rr_reloc_node = NULL;
|
target->rr_reloc_node = NULL;
|
||||||
|
|
||||||
#endif /* Libisofs_with_rr_reloc_diR */
|
|
||||||
|
|
||||||
target->sort_files = opts->sort_files;
|
target->sort_files = opts->sort_files;
|
||||||
|
|
||||||
target->replace_uid = opts->replace_uid ? 1 : 0;
|
target->replace_uid = opts->replace_uid ? 1 : 0;
|
||||||
@ -2509,8 +2497,6 @@ int bs_set_size(struct burn_source *bs, off_t size)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef Libisofs_with_rr_reloc_diR
|
|
||||||
|
|
||||||
static
|
static
|
||||||
int dive_to_depth_8(IsoDir *dir, int depth)
|
int dive_to_depth_8(IsoDir *dir, int depth)
|
||||||
{
|
{
|
||||||
@ -2569,9 +2555,6 @@ int make_reloc_dir_if_needed(IsoImage *img, IsoWriteOpts *opts, int flag)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* Libisofs_with_rr_reloc_diR */
|
|
||||||
|
|
||||||
|
|
||||||
int iso_image_create_burn_source(IsoImage *image, IsoWriteOpts *opts,
|
int iso_image_create_burn_source(IsoImage *image, IsoWriteOpts *opts,
|
||||||
struct burn_source **burn_src)
|
struct burn_source **burn_src)
|
||||||
{
|
{
|
||||||
@ -2588,8 +2571,6 @@ int iso_image_create_burn_source(IsoImage *image, IsoWriteOpts *opts,
|
|||||||
return ISO_OUT_OF_MEM;
|
return ISO_OUT_OF_MEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef Libisofs_with_rr_reloc_diR
|
|
||||||
|
|
||||||
if (!opts->allow_deep_paths) {
|
if (!opts->allow_deep_paths) {
|
||||||
ret = make_reloc_dir_if_needed(image, opts, 0);
|
ret = make_reloc_dir_if_needed(image, opts, 0);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
@ -2598,8 +2579,6 @@ int iso_image_create_burn_source(IsoImage *image, IsoWriteOpts *opts,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* Libisofs_with_rr_reloc_diR */
|
|
||||||
|
|
||||||
ret = ecma119_image_new(image, opts, &target);
|
ret = ecma119_image_new(image, opts, &target);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
free(source);
|
free(source);
|
||||||
@ -2715,14 +2694,8 @@ int iso_write_opts_new(IsoWriteOpts **opts, int profile)
|
|||||||
wopts->fat = 0;
|
wopts->fat = 0;
|
||||||
wopts->fifo_size = 1024; /* 2 MB buffer */
|
wopts->fifo_size = 1024; /* 2 MB buffer */
|
||||||
wopts->sort_files = 1; /* file sorting is always good */
|
wopts->sort_files = 1; /* file sorting is always good */
|
||||||
|
|
||||||
#ifdef Libisofs_with_rr_reloc_diR
|
|
||||||
|
|
||||||
wopts->rr_reloc_dir = NULL;
|
wopts->rr_reloc_dir = NULL;
|
||||||
wopts->rr_reloc_flags = 0;
|
wopts->rr_reloc_flags = 0;
|
||||||
|
|
||||||
#endif /* Libisofs_with_rr_reloc_diR */
|
|
||||||
|
|
||||||
wopts->system_area_data = NULL;
|
wopts->system_area_data = NULL;
|
||||||
wopts->system_area_options = 0;
|
wopts->system_area_options = 0;
|
||||||
wopts->vol_creation_time = 0;
|
wopts->vol_creation_time = 0;
|
||||||
@ -2765,14 +2738,8 @@ void iso_write_opts_free(IsoWriteOpts *opts)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
free(opts->output_charset);
|
free(opts->output_charset);
|
||||||
|
|
||||||
#ifdef Libisofs_with_rr_reloc_diR
|
|
||||||
|
|
||||||
if (opts->rr_reloc_dir != NULL)
|
if (opts->rr_reloc_dir != NULL)
|
||||||
free(opts->rr_reloc_dir);
|
free(opts->rr_reloc_dir);
|
||||||
|
|
||||||
#endif /* Libisofs_with_rr_reloc_diR */
|
|
||||||
|
|
||||||
if (opts->system_area_data != NULL)
|
if (opts->system_area_data != NULL)
|
||||||
free(opts->system_area_data);
|
free(opts->system_area_data);
|
||||||
if (opts->prep_partition != NULL)
|
if (opts->prep_partition != NULL)
|
||||||
|
@ -153,16 +153,10 @@ needs_transl:;
|
|||||||
|
|
||||||
int ecma119_is_dedicated_reloc_dir(Ecma119Image *img, Ecma119Node *node)
|
int ecma119_is_dedicated_reloc_dir(Ecma119Image *img, Ecma119Node *node)
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef Libisofs_with_rr_reloc_diR
|
|
||||||
|
|
||||||
if (img->rr_reloc_node == node &&
|
if (img->rr_reloc_node == node &&
|
||||||
node != img->root && node != img->partition_root &&
|
node != img->root && node != img->partition_root &&
|
||||||
(img->rr_reloc_flags & 2))
|
(img->rr_reloc_flags & 2))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
#endif /* Libisofs_with_rr_reloc_diR */
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -474,9 +468,6 @@ int create_tree(Ecma119Image *image, IsoNode *iso, Ecma119Node **tree,
|
|||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
goto ex;
|
goto ex;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef Libisofs_with_rr_reloc_diR
|
|
||||||
|
|
||||||
if (depth == 1) { /* root is default */
|
if (depth == 1) { /* root is default */
|
||||||
image->rr_reloc_node = node;
|
image->rr_reloc_node = node;
|
||||||
} else if (depth == 2) {
|
} else if (depth == 2) {
|
||||||
@ -486,10 +477,6 @@ int create_tree(Ecma119Image *image, IsoNode *iso, Ecma119Node **tree,
|
|||||||
strcmp(iso->name, image->rr_reloc_dir) == 0)
|
strcmp(iso->name, image->rr_reloc_dir) == 0)
|
||||||
image->rr_reloc_node = node;
|
image->rr_reloc_node = node;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* Libisofs_with_rr_reloc_diR */
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
ret = ISO_SUCCESS;
|
ret = ISO_SUCCESS;
|
||||||
pos = dir->children;
|
pos = dir->children;
|
||||||
@ -962,9 +949,6 @@ int reorder_tree(Ecma119Image *img, Ecma119Node *dir,
|
|||||||
max_path = pathlen + 1 + max_child_name_len(dir);
|
max_path = pathlen + 1 + max_child_name_len(dir);
|
||||||
|
|
||||||
if (level > 8 || max_path > 255) {
|
if (level > 8 || max_path > 255) {
|
||||||
|
|
||||||
#ifdef Libisofs_with_rr_reloc_diR
|
|
||||||
|
|
||||||
reloc = img->rr_reloc_node;
|
reloc = img->rr_reloc_node;
|
||||||
if (reloc == NULL) {
|
if (reloc == NULL) {
|
||||||
if (img->eff_partition_offset > 0) {
|
if (img->eff_partition_offset > 0) {
|
||||||
@ -973,17 +957,6 @@ int reorder_tree(Ecma119Image *img, Ecma119Node *dir,
|
|||||||
reloc = img->root;
|
reloc = img->root;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
if (img->eff_partition_offset > 0) {
|
|
||||||
reloc = img->partition_root;
|
|
||||||
} else {
|
|
||||||
reloc = img->root;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* ! Libisofs_with_rr_reloc_diR */
|
|
||||||
|
|
||||||
ret = reparent(dir, reloc);
|
ret = reparent(dir, reloc);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
return ret;
|
return ret;
|
||||||
@ -1238,13 +1211,7 @@ int ecma119_tree_create(Ecma119Image *img)
|
|||||||
* above could insert new directories into the relocation directory.
|
* above could insert new directories into the relocation directory.
|
||||||
* Note that recurse = 0, as we don't need to recurse.
|
* Note that recurse = 0, as we don't need to recurse.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef Libisofs_with_rr_reloc_diR
|
|
||||||
ret = mangle_tree(img, img->rr_reloc_node, 0);
|
ret = mangle_tree(img, img->rr_reloc_node, 0);
|
||||||
#else
|
|
||||||
ret = mangle_tree(img, NULL, 0);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -7627,11 +7627,6 @@ struct burn_source {
|
|||||||
/* currently none being tested */
|
/* currently none being tested */
|
||||||
|
|
||||||
|
|
||||||
/* Perform the operations promised by iso_write_opts_set_rr_reloc() */
|
|
||||||
#define Libisofs_with_rr_reloc_diR yes
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ---------------------------- Experiments ---------------------------- */
|
/* ---------------------------- Experiments ---------------------------- */
|
||||||
|
|
||||||
|
|
||||||
|
@ -1246,17 +1246,11 @@ size_t rrip_calc_len(Ecma119Image *t, Ecma119Node *n, int type, size_t used_up,
|
|||||||
/* we need to add a RE entry */
|
/* we need to add a RE entry */
|
||||||
su_size += 4;
|
su_size += 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef Libisofs_with_rr_reloc_diR
|
|
||||||
|
|
||||||
} else if(ecma119_is_dedicated_reloc_dir(t, n) &&
|
} else if(ecma119_is_dedicated_reloc_dir(t, n) &&
|
||||||
(t->rr_reloc_flags & 1)) {
|
(t->rr_reloc_flags & 1)) {
|
||||||
/* The dedicated relocation directory shall be marked by RE */
|
/* The dedicated relocation directory shall be marked by RE */
|
||||||
su_size += 4;
|
su_size += 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* Libisofs_with_rr_reloc_diR */
|
|
||||||
|
|
||||||
} else if (n->type == ECMA119_SPECIAL) {
|
} else if (n->type == ECMA119_SPECIAL) {
|
||||||
if (S_ISBLK(n->node->mode) || S_ISCHR(n->node->mode)) {
|
if (S_ISBLK(n->node->mode) || S_ISCHR(n->node->mode)) {
|
||||||
/* block or char device, we need a PN entry */
|
/* block or char device, we need a PN entry */
|
||||||
@ -1442,18 +1436,12 @@ int rrip_get_susp_fields(Ecma119Image *t, Ecma119Node *n, int type,
|
|||||||
goto add_susp_cleanup;
|
goto add_susp_cleanup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef Libisofs_with_rr_reloc_diR
|
|
||||||
|
|
||||||
} else if(ecma119_is_dedicated_reloc_dir(t, n) &&
|
} else if(ecma119_is_dedicated_reloc_dir(t, n) &&
|
||||||
(t->rr_reloc_flags & 1)) {
|
(t->rr_reloc_flags & 1)) {
|
||||||
/* The dedicated relocation directory shall be marked by RE */
|
/* The dedicated relocation directory shall be marked by RE */
|
||||||
ret = rrip_add_RE(t, node, info);
|
ret = rrip_add_RE(t, node, info);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto add_susp_cleanup;
|
goto add_susp_cleanup;
|
||||||
|
|
||||||
#endif /* Libisofs_with_rr_reloc_diR */
|
|
||||||
|
|
||||||
}
|
}
|
||||||
} else if (n->type == ECMA119_SPECIAL) {
|
} else if (n->type == ECMA119_SPECIAL) {
|
||||||
if (S_ISBLK(n->node->mode) || S_ISCHR(n->node->mode)) {
|
if (S_ISBLK(n->node->mode) || S_ISCHR(n->node->mode)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user