New -as mkisofs options -jigdo-* and -md5-list as of genisoimage

This commit is contained in:
Thomas Schmitt 2010-09-29 09:24:20 +00:00
parent ea0b38d44c
commit c35834e0c1
13 changed files with 239 additions and 5 deletions

View File

@ -1,6 +1,7 @@
SVN trunk (to become libisoburn-0.6.r4pl00.tar.gz) SVN trunk (to become libisoburn-0.6.4.pl00.tar.gz)
=============================================================================== ===============================================================================
* New API calls isoburn_igopt_attach_jte() and isoburn_igopt_detach_jte() * New API calls isoburn_igopt_attach_jte() and isoburn_igopt_detach_jte()
* New -as mkisofs options -jigdo-* and -md5-list as of genisoimage
libisoburn-0.6.2.pl00.tar.gz Sat Sep 18 2010 libisoburn-0.6.2.pl00.tar.gz Sat Sep 18 2010

View File

@ -195,6 +195,17 @@ else
fi fi
AC_SUBST(ZLIB_DEF) AC_SUBST(ZLIB_DEF)
dnl ts B00928
AC_ARG_ENABLE(libjte,
[ --enable-libjte Enable use of libjte by xorriso, default=yes],
, enable_libjte=yes)
if test "x$enable_libjte" = xyes; then
LIBJTE_DEF="-DXorriso_with_libjtE"
AC_CHECK_HEADER(libjte/libjte.h, AC_CHECK_LIB(jte, libjte_new, , LIBJTE_DEF= ), LIBJTE_DEF= )
else
LIBJTE_DEF=
fi
AC_SUBST(LIBJTE_DEF)
dnl ts B00107 dnl ts B00107
dnl Just for the case that it is necessary to give link option -lcdio not only dnl Just for the case that it is necessary to give link option -lcdio not only
@ -333,7 +344,7 @@ else
CFLAGS="$CFLAGS -DDEBUG" CFLAGS="$CFLAGS -DDEBUG"
fi fi
CFLAGS="$CFLAGS $READLINE_DEF $LIBACL_DEF $XATTR_DEF $EXTF_DEF $EXTF_SUID_DEF $ZLIB_DEF $XORRISO_DVD_OBS_64K" CFLAGS="$CFLAGS $READLINE_DEF $LIBACL_DEF $XATTR_DEF $EXTF_DEF $EXTF_SUID_DEF $ZLIB_DEF $LIBJTE_DEF $XORRISO_DVD_OBS_64K"
AC_CONFIG_FILES([ AC_CONFIG_FILES([
Makefile Makefile

View File

@ -165,6 +165,7 @@ Xorriso_option_help;
Xorriso_option_hide; Xorriso_option_hide;
Xorriso_option_history; Xorriso_option_history;
Xorriso_option_iso_rr_pattern; Xorriso_option_iso_rr_pattern;
Xorriso_option_jigdo;
Xorriso_option_joliet; Xorriso_option_joliet;
Xorriso_option_list_delimiter; Xorriso_option_list_delimiter;
Xorriso_option_list_formats; Xorriso_option_list_formats;

View File

@ -25,6 +25,11 @@
#include <sys/time.h> #include <sys/time.h>
#include <time.h> #include <time.h>
#include <errno.h> #include <errno.h>
#include <stdint.h>
#ifdef Xorriso_with_libjtE
#include <libjte/libjte.h>
#endif
#include "xorriso.h" #include "xorriso.h"
#include "xorriso_private.h" #include "xorriso_private.h"
@ -215,6 +220,11 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
m->vol_expiration_time= 0; m->vol_expiration_time= 0;
m->vol_effective_time= 0; m->vol_effective_time= 0;
m->vol_uuid[0]= 0; m->vol_uuid[0]= 0;
#ifdef Xorriso_with_libjtE
m->libjte_handle= NULL;
#endif
m->loaded_boot_bin_lba= 0; m->loaded_boot_bin_lba= 0;
m->loaded_boot_cat_path[0]= 0; m->loaded_boot_cat_path[0]= 0;
m->allow_graft_points= 0; m->allow_graft_points= 0;
@ -417,6 +427,11 @@ int Xorriso_destroy(struct XorrisO **xorriso, int flag)
Xorriso_destroy_hln_array(m, 0); Xorriso_destroy_hln_array(m, 0);
Xorriso_destroy_di_array(m, 0); Xorriso_destroy_di_array(m, 0);
#ifdef Xorriso_with_libjtE
if(m->libjte_handle)
libjte_destroy(&(m->libjte_handle));
#endif
Xorriso_detach_libraries(m, flag&1); Xorriso_detach_libraries(m, flag&1);
free((char *) m); free((char *) m);

View File

@ -712,6 +712,14 @@ int Xorriso_genisofs_help(struct XorrisO *xorriso, int flag)
" -biblio FILE Set Bibliographic filename", " -biblio FILE Set Bibliographic filename",
" -copyright FILE Set Copyright filename", " -copyright FILE Set Copyright filename",
" -p PREP, -preparer PREP Set Volume preparer", " -p PREP, -preparer PREP Set Volume preparer",
" -jigdo-jigdo FILE Produce a jigdo .jigdo file as well as the .iso",
" -jigdo-template FILE Produce a jigdo .template file as well as the .iso",
" -jigdo-min-file-size SIZE Minimum size for a file to be listed in the jigdo file",
" -jigdo-force-md5 PATTERN Pattern(s) where files MUST match an externally-supplied MD5sum",
" -jigdo-exclude PATTERN Pattern(s) to exclude from the jigdo file",
" -jigdo-map PATTERN1=PATTERN2",
" Pattern(s) to map paths (e.g. Debian=/mirror/debian)",
" -md5-list FILE File containing MD5 sums of the files that should be checked",
" -b FILE, -eltorito-boot FILE", " -b FILE, -eltorito-boot FILE",
" Set El Torito boot image name", " Set El Torito boot image name",
" -eltorito-alt-boot Start specifying alternative El Torito boot parameters", " -eltorito-alt-boot Start specifying alternative El Torito boot parameters",
@ -853,7 +861,7 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
int *delay_opt_list= NULL, delay_opt_count= 0; int *delay_opt_list= NULL, delay_opt_count= 0;
char sfe[5*SfileadrL], adr[SfileadrL+8], ra_text[80], pathspec[2*SfileadrL]; char sfe[5*SfileadrL], adr[SfileadrL+8], ra_text[80], pathspec[2*SfileadrL];
char *ept, *add_pt, eff_path[SfileadrL], indev[SfileadrL+8], msc[80], *cpt; char *ept, *add_pt, eff_path[SfileadrL], indev[SfileadrL+8], msc[80], *cpt;
char *boot_path; char *boot_path, *jkey;
static char *sort_weight_args[4]= {"", "-exec", "sort_weight", ""}; static char *sort_weight_args[4]= {"", "-exec", "sort_weight", ""};
strcpy(ra_text, xorriso->report_about_text); strcpy(ra_text, xorriso->report_about_text);
@ -1310,7 +1318,40 @@ not_enough_args:;
if(ret<=0) if(ret<=0)
goto problem_handler_2; goto problem_handler_2;
file_mode= mode_or; file_mode= mode_or;
} else if(strncmp(argv[i], "-jigdo-", 7) == 0) {
if(i+1>=argc)
goto not_enough_args;
i++;
cpt= argv[i - 1] + 7;
if(strcmp(cpt, "jigdo") == 0)
jkey= "jigdo_path";
else if(strcmp(cpt, "template") == 0)
jkey= "template_path";
else if(strcmp(cpt, "min-file-size") == 0)
jkey= "min_size";
else if(strcmp(cpt, "force-md5") == 0)
jkey= "demand_md5";
else if(strcmp(cpt, "exclude") == 0)
jkey= "exclude";
else if(strcmp(cpt, "map") == 0)
jkey= "mapping";
else {
i--;
goto is_unknown_option_2;
}
ret= Xorriso_jigdo_interpreter(xorriso, jkey, argv[i], 0);
if(ret <= 0)
goto problem_handler_2;
} else if(strncmp(argv[i], "-md5-list", 7) == 0) {
if(i+1>=argc)
goto not_enough_args;
i++;
ret= Xorriso_jigdo_interpreter(xorriso, "md5_path", argv[i], 0);
if(ret <= 0)
goto problem_handler_2;
} else if(argv[i][0]=='-' && argv[i][1]!=0) { } else if(argv[i][0]=='-' && argv[i][1]!=0) {
is_unknown_option_2:;
ret= Xorriso_genisofs_count_args(xorriso, argc - i, argv + i, &count, 1); ret= Xorriso_genisofs_count_args(xorriso, argc - i, argv + i, &count, 1);
if(ret > 0) { if(ret > 0) {
sprintf(xorriso->info_text, "-as %s: Unsupported option %s", sprintf(xorriso->info_text, "-as %s: Unsupported option %s",

View File

@ -23,11 +23,15 @@
#include <sys/time.h> #include <sys/time.h>
#include <time.h> #include <time.h>
#include <errno.h> #include <errno.h>
#include <stdint.h>
/* for -charset */ /* for -charset */
#include <iconv.h> #include <iconv.h>
#include <langinfo.h> #include <langinfo.h>
#ifdef Xorriso_with_libjtE
#include <libjte/libjte.h>
#endif
#include "xorriso.h" #include "xorriso.h"
#include "xorriso_private.h" #include "xorriso_private.h"
@ -521,3 +525,117 @@ int Xorriso_preparer_string(struct XorrisO *xorriso, char xorriso_id[129],
return(1); return(1);
} }
#ifdef Xorriso_with_libjtE
int Xorriso_assert_jte_handle(struct XorrisO *xorriso, int flag)
{
int ret;
if(xorriso->libjte_handle == NULL) {
ret= libjte_new(&(xorriso->libjte_handle), 0);
if(ret <= 0 || xorriso->libjte_handle == NULL)
return(0);
}
return(1);
}
#endif /* Xorriso_with_libjtE */
int Xorriso_jigdo_interpreter(struct XorrisO *xorriso, char *aspect, char *arg,
int flag)
{
#ifdef Xorriso_with_libjtE
int ret, num;
struct libjte_env *jte;
if(strcmp(aspect, "clear") == 0) {
if(xorriso->libjte_handle != NULL)
libjte_destroy(&(xorriso->libjte_handle));
return(1);
}
ret= Xorriso_assert_jte_handle(xorriso, 0);
if(ret <= 0)
return(ret);
jte= xorriso->libjte_handle;
if(strcmp(aspect, "verbose") == 0) {
if(strcmp(arg, "on") == 0)
libjte_set_verbose(jte, 1);
else if(strcmp(arg, "off") == 0)
libjte_set_verbose(jte, 0);
else
goto bad_arg;
} else if(strcmp(aspect, "template_path") == 0) {
ret= libjte_set_template_out(jte, arg);
if(ret <= 0)
goto jte_failed;
} else if(strcmp(aspect, "jigdo_path") == 0) {
ret= libjte_set_jjigdo_out(jte, arg);
if(ret <= 0)
goto jte_failed;
} else if(strcmp(aspect, "md5_path") == 0) {
ret= libjte_set_jmd5_list(jte, arg);
if(ret <= 0)
goto jte_failed;
} else if(strcmp(aspect, "min_size") == 0) {
num= Scanf_io_size(arg, 0);
ret= libjte_set_jte_min_size(jte, num);
if(ret <= 0)
goto jte_failed;
} else if(strcmp(aspect, "checksum_iso") == 0) {
ret= libjte_set_checksum_algo_iso(jte, arg);
if(ret <= 0)
goto jte_failed;
} else if(strcmp(aspect, "checksum_template") == 0) {
ret= libjte_set_checksum_algo_tmpl(jte, arg);
if(ret <= 0)
goto jte_failed;
} else if(strcmp(aspect, "compression") == 0) {
ret= libjte_set_jte_template_compression(jte, arg);
if(ret <= 0)
goto jte_failed;
} else if(strcmp(aspect, "exclude") == 0) {
ret= libjte_add_exclude(jte, arg);
if(ret <= 0)
goto jte_failed;
} else if(strcmp(aspect, "demand_md5") == 0) {
ret= libjte_add_include(jte, arg);
if(ret <= 0)
goto jte_failed;
} else if(strcmp(aspect, "mapping") == 0) {
ret= libjte_add_mapping(jte, arg);
if(ret <= 0)
goto jte_failed;
} else {
sprintf(xorriso->info_text, "-jigdo: unknown aspect '%s'", aspect);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
}
return(1);
bad_arg:
sprintf(xorriso->info_text, "-jigdo %s : unknown argument '%s'", aspect, arg);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
jte_failed:
sprintf(xorriso->info_text, "Experienced libjte failure with: -jigdo %s %s",
aspect, arg);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
#else /* Xorriso_with_libjtE */
sprintf(xorriso->info_text,
"Jigdo Template Extraction was not enabled at compile time");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
#endif /* ! Xorriso_with_libjtE */
}

View File

@ -47,6 +47,17 @@ int Xorriso_option_iso_rr_pattern(struct XorrisO *xorriso, char *mode,int flag)
} }
/* Option -jigdo aspect argument */
int Xorriso_option_jigdo(struct XorrisO *xorriso, char *aspect, char *arg,
int flag)
{
int ret;
ret= Xorriso_jigdo_interpreter(xorriso, aspect, arg, 0);
return(ret);
}
/* Option -joliet "on"|"off" */ /* Option -joliet "on"|"off" */
int Xorriso_option_joliet(struct XorrisO *xorriso, char *mode, int flag) int Xorriso_option_joliet(struct XorrisO *xorriso, char *mode, int flag)
{ {

View File

@ -478,7 +478,7 @@ int Xorriso_count_args(struct XorrisO *xorriso, int argc, char **argv,
static char arg2_commands[][40]= { static char arg2_commands[][40]= {
"assert_volid","boot_image","compare","compare_r","drive_class", "assert_volid","boot_image","compare","compare_r","drive_class",
"errfile_log","error_behavior","extract","extract_single", "errfile_log","error_behavior","extract","extract_single",
"load","logfile", "jigdo","load","logfile",
"map","map_single","page","return_with", "map","map_single","page","return_with",
"scdbackup_tag","update","update_r","volume_date", "scdbackup_tag","update","update_r","volume_date",
"" ""

View File

@ -25,6 +25,11 @@
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <stdint.h>
#ifdef Xorriso_with_libjtE
#include <libjte/libjte.h>
#endif
#include "xorriso.h" #include "xorriso.h"
#include "xorriso_private.h" #include "xorriso_private.h"
@ -138,6 +143,12 @@ no_track:;
} else if(padding < xorriso->alignment) } else if(padding < xorriso->alignment)
padding= xorriso->alignment; padding= xorriso->alignment;
} }
#ifdef Xorriso_with_libjtE
if(xorriso->libjte_handle != NULL)
padding= 0; /* JTE : no multi-session, no_emul_toc, and no padding */
#endif /* ! Xorriso_with_libjtE */
burn_track_define_data(tracks[0], 0, padding * 2048, 0, BURN_MODE1); burn_track_define_data(tracks[0], 0, padding * 2048, 0, BURN_MODE1);
Xorriso_process_msg_queues(xorriso,0); Xorriso_process_msg_queues(xorriso,0);
@ -733,6 +744,19 @@ int Xorriso_write_session(struct XorrisO *xorriso, int flag)
xorriso->vol_expiration_time, xorriso->vol_effective_time, xorriso->vol_expiration_time, xorriso->vol_effective_time,
xorriso->vol_uuid); xorriso->vol_uuid);
#ifdef Xorriso_with_libjtE
if(xorriso->libjte_handle) {
ret= libjte_set_outfile(xorriso->libjte_handle, xorriso->outdev);
if(ret <= 0)
goto ex;
/* >>> Check whether the mandatory parameters are set */;
isoburn_igopt_attach_jte(sopts, xorriso->libjte_handle);
}
#endif /* Xorriso_with_libjtE */
/* Make final abort check before starting expensive activities */ /* Make final abort check before starting expensive activities */
ret= Xorriso_eval_problem_status(xorriso, 1, 0); ret= Xorriso_eval_problem_status(xorriso, 1, 0);
if(ret<0) if(ret<0)

View File

@ -854,6 +854,10 @@ int Xorriso_option_history(struct XorrisO *xorriso, char *line, int flag);
int Xorriso_option_iso_rr_pattern(struct XorrisO *xorriso, char *mode, int Xorriso_option_iso_rr_pattern(struct XorrisO *xorriso, char *mode,
int flag); int flag);
/* Option -jigdo aspect argument */
int Xorriso_option_jigdo(struct XorrisO *xorriso, char *aspect, char *arg,
int flag);
/* Option -joliet "on"|"off" */ /* Option -joliet "on"|"off" */
int Xorriso_option_joliet(struct XorrisO *xorriso, char *mode, int flag); int Xorriso_option_joliet(struct XorrisO *xorriso, char *mode, int flag);

View File

@ -326,6 +326,11 @@ struct XorrisO { /* the global context of xorriso */
and timezone 0 */ and timezone 0 */
char vol_uuid[17]; char vol_uuid[17];
#ifdef Xorriso_with_libjtE
/* Parameters and state of Jigdo Template Export environment */
struct libjte_env *libjte_handle;
#endif
/* LBA of boot image after image loading */ /* LBA of boot image after image loading */
int loaded_boot_bin_lba; int loaded_boot_bin_lba;
/* Path of the catalog node after image loading */ /* Path of the catalog node after image loading */

View File

@ -1 +1 @@
#define Xorriso_timestamP "2010.09.29.091541" #define Xorriso_timestamP "2010.09.29.092348"

View File

@ -540,5 +540,8 @@ int Xorriso_set_hidden(struct XorrisO *xorriso, void *in_node, char *path,
int Xorriso_preparer_string(struct XorrisO *xorriso, char xorriso_id[129], int Xorriso_preparer_string(struct XorrisO *xorriso, char xorriso_id[129],
int flag); int flag);
int Xorriso_jigdo_interpreter(struct XorrisO *xorriso, char *aspect, char *arg,
int flag);
#endif /* Xorrisoburn_includeD */ #endif /* Xorrisoburn_includeD */