Add -V option to test/iso.c little testing app.

This commit is contained in:
Vreixo Formoso Lopes 2007-09-06 15:15:09 +00:00
parent d60193e2d5
commit 5c82fc5108

View File

@ -20,7 +20,7 @@
#define SECSIZE 2048 #define SECSIZE 2048
const char * const optstring = "JRL:b:h"; const char * const optstring = "JRL:b:hV:";
extern char *optarg; extern char *optarg;
extern int optind; extern int optind;
@ -35,6 +35,7 @@ void help()
"Options:\n" "Options:\n"
" -J Add Joliet support\n" " -J Add Joliet support\n"
" -R Add Rock Ridge support\n" " -R Add Rock Ridge support\n"
" -V label Volume Label\n"
" -L <num> Set the ISO level (1 or 2)\n" " -L <num> Set the ISO level (1 or 2)\n"
" -b file Specifies a boot image to add to image\n" " -b file Specifies a boot image to add to image\n"
" -h Print this message\n" " -h Print this message\n"
@ -55,6 +56,7 @@ int main(int argc, char **argv)
struct iso_tree_radd_dir_behavior behav = {0,0,0}; struct iso_tree_radd_dir_behavior behav = {0,0,0};
int level=1, flags=0; int level=1, flags=0;
char *boot_img = NULL; char *boot_img = NULL;
char *volid = "VOLID";
while ((c = getopt(argc, argv, optstring)) != -1) { while ((c = getopt(argc, argv, optstring)) != -1) {
switch(c) { switch(c) {
@ -75,6 +77,9 @@ int main(int argc, char **argv)
case 'b': case 'b':
boot_img = optarg; boot_img = optarg;
break; break;
case 'V':
volid = optarg;
break;
case '?': case '?':
usage(); usage();
exit(1); exit(1);
@ -108,7 +113,7 @@ int main(int argc, char **argv)
if (!root) { if (!root) {
err(1, "error opening input directory"); err(1, "error opening input directory");
} }
volume = iso_volume_new_with_root( "VOLID", "PUBID", "PREPID", root ); volume = iso_volume_new_with_root(volid, "PUBID", "PREPID", root);
if ( boot_img ) { if ( boot_img ) {
/* adds El-Torito boot info. Tunned for isolinux */ /* adds El-Torito boot info. Tunned for isolinux */