diff options
author | natano <natano@openbsd.org> | 2016-10-23 11:09:38 +0000 |
---|---|---|
committer | natano <natano@openbsd.org> | 2016-10-23 11:09:38 +0000 |
commit | 77bbe232ffc13c556489cd68244cadc94f0bbded (patch) | |
tree | 6d484d5a93af744897dccec25977fdfa5bdc1934 /usr.sbin/makefs | |
parent | Remove the msdos no_create option. (diff) | |
download | wireguard-openbsd-77bbe232ffc13c556489cd68244cadc94f0bbded.tar.xz wireguard-openbsd-77bbe232ffc13c556489cd68244cadc94f0bbded.zip |
No verbose flag for cd9660.
Diffstat (limited to 'usr.sbin/makefs')
-rw-r--r-- | usr.sbin/makefs/cd9660.c | 61 | ||||
-rw-r--r-- | usr.sbin/makefs/cd9660.h | 4 | ||||
-rw-r--r-- | usr.sbin/makefs/cd9660/cd9660_eltorito.c | 33 | ||||
-rw-r--r-- | usr.sbin/makefs/cd9660/cd9660_write.c | 21 | ||||
-rw-r--r-- | usr.sbin/makefs/msdos/msdosfs_vfsops.c | 3 |
5 files changed, 7 insertions, 115 deletions
diff --git a/usr.sbin/makefs/cd9660.c b/usr.sbin/makefs/cd9660.c index 4e99c0acc19..1632411e65c 100644 --- a/usr.sbin/makefs/cd9660.c +++ b/usr.sbin/makefs/cd9660.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cd9660.c,v 1.12 2016/10/23 10:32:42 natano Exp $ */ +/* $OpenBSD: cd9660.c,v 1.13 2016/10/23 11:09:38 natano Exp $ */ /* $NetBSD: cd9660.c,v 1.52 2015/12/24 15:52:37 christos Exp $ */ /* @@ -193,7 +193,6 @@ cd9660_set_defaults(iso9660_disk *diskStructure) diskStructure->sectorSize = 2048; /* Set up defaults in our own structure */ - diskStructure->verbose_level = 0; diskStructure->isoLevel = 2; diskStructure->rock_ridge_enabled = 0; @@ -287,8 +286,6 @@ cd9660_prep_opts(fsinfo_t *fsopts) OPT_STR("publisher", "Publisher Identifier"), OPT_BOOL("rockridge", rock_ridge_enabled, "Enable Rock-Ridge extensions"), - OPT_NUM("verbose", verbose_level, - 0, 2, "Turns on verbose output"), OPT_STR("volumeid", "Volume Set Identifier"), { .name = NULL } }; @@ -447,9 +444,6 @@ cd9660_makefs(const char *image, const char *dir, fsnode *root, cd9660node *real_root; iso9660_disk *diskStructure = fsopts->fs_specific; - if (diskStructure->verbose_level > 0) - printf("%s: ISO level is %i\n", __func__, - diskStructure->isoLevel); if (diskStructure->isoLevel < 2 && diskStructure->allow_multidot) errx(EXIT_FAILURE, "allow-multidot requires iso level of 2"); @@ -458,10 +452,6 @@ cd9660_makefs(const char *image, const char *dir, fsnode *root, assert(dir != NULL); assert(root != NULL); - if (diskStructure->verbose_level > 0) - printf("%s: image %s directory %s root %p\n", __func__, - image, dir, root); - /* Set up some constants. Later, these will be defined with options */ /* Counter needed for path tables */ @@ -489,9 +479,6 @@ cd9660_makefs(const char *image, const char *dir, fsnode *root, "Tree conversion failed", __func__); } else if (error != 0) { errx(EXIT_FAILURE, "%s: tree conversion failed", __func__); - } else { - if (diskStructure->verbose_level > 0) - printf("%s: tree converted\n", __func__); } /* Add the dot and dot dot records */ @@ -499,9 +486,6 @@ cd9660_makefs(const char *image, const char *dir, fsnode *root, cd9660_setup_root_node(diskStructure); - if (diskStructure->verbose_level > 0) - printf("%s: done converting tree\n", __func__); - /* Rock ridge / SUSP init pass */ if (diskStructure->rock_ridge_enabled) { cd9660_susp_initialize(diskStructure, diskStructure->rootNode, @@ -533,11 +517,6 @@ cd9660_makefs(const char *image, const char *dir, fsnode *root, diskStructure->dataFirstSector = diskStructure->primaryBigEndianTableSector + pathTableSectors; - if (diskStructure->verbose_level > 0) - printf("%s: Path table conversion complete. " - "Each table is %i bytes, or %" PRIu64 " sectors.\n", - __func__, - diskStructure->pathTableLength, pathTableSectors); startoffset = diskStructure->sectorSize*diskStructure->dataFirstSector; @@ -562,18 +541,6 @@ cd9660_makefs(const char *image, const char *dir, fsnode *root, /* Add padding sectors, just for testing purposes right now */ /* diskStructure->totalSectors+=150; */ - /* Debugging output */ - if (diskStructure->verbose_level > 0) { - printf("%s: Sectors 0-15 reserved\n", __func__); - printf("%s: Primary path tables starts in sector %" - PRId64 "\n", __func__, - diskStructure->primaryLittleEndianTableSector); - printf("%s: File data starts in sector %" - PRId64 "\n", __func__, diskStructure->dataFirstSector); - printf("%s: Total sectors: %" - PRId64 "\n", __func__, diskStructure->totalSectors); - } - /* * Add padding sectors at the end * TODO: Clean this up and separate padding @@ -583,17 +550,8 @@ cd9660_makefs(const char *image, const char *dir, fsnode *root, cd9660_write_image(diskStructure, image); - if (diskStructure->verbose_level > 1) { - debug_print_volume_descriptor_information(diskStructure); - debug_print_tree(diskStructure, real_root, 0); - debug_print_path_tree(real_root); - } - /* Clean up data structures */ cd9660_free_structure(real_root); - - if (diskStructure->verbose_level > 0) - printf("%s: done\n", __func__); } /* Generic function pointer - implement later */ @@ -725,8 +683,6 @@ cd9660_setup_volume_descriptors(iso9660_disk *diskStructure) temp->next = t; temp = t; t->sector = 17; - if (diskStructure->verbose_level > 0) - printf("Setting up boot volume descriptor\n"); cd9660_setup_boot_volume_descriptor(diskStructure, t); sector++; } @@ -806,11 +762,9 @@ static int cd9660_translate_node(iso9660_disk *diskStructure, fsnode *node, cd9660node *newnode) { - if (node == NULL) { - if (diskStructure->verbose_level > 0) - printf("%s: NULL node passed, returning\n", __func__); + if (node == NULL) return 0; - } + newnode->isoDirRecord = emalloc(sizeof(*newnode->isoDirRecord)); /* Set the node pointer */ newnode->node = node; @@ -1006,9 +960,6 @@ cd9660_rename_filename(iso9660_disk *diskStructure, cd9660node *iter, int num, int maxlength; char *tmp; - if (diskStructure->verbose_level > 0) - printf("Rename_filename called\n"); - /* TODO : A LOT of chanes regarding 8.3 filenames */ if (diskStructure->isoLevel == 1) maxlength = 8; @@ -2058,12 +2009,6 @@ cd9660_add_generic_bootimage(iso9660_disk *diskStructure, const char *bootimage) return 0; } - if (diskStructure->verbose_level > 0) { - printf("Generic boot image image has size %lld\n", - (long long)stbuf.st_size); - } - diskStructure->has_generic_bootimage = 1; - return 1; } diff --git a/usr.sbin/makefs/cd9660.h b/usr.sbin/makefs/cd9660.h index f079a0e40a7..4cf3f1e31ad 100644 --- a/usr.sbin/makefs/cd9660.h +++ b/usr.sbin/makefs/cd9660.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cd9660.h,v 1.7 2016/10/23 10:32:42 natano Exp $ */ +/* $OpenBSD: cd9660.h,v 1.8 2016/10/23 11:09:38 natano Exp $ */ /* $NetBSD: cd9660.h,v 1.21 2015/12/24 15:52:37 christos Exp $ */ /* @@ -259,8 +259,6 @@ typedef struct _iso9660_disk { int include_padding_areas; - int verbose_level; - /* SUSP options and variables */ int64_t susp_continuation_area_start_sector; int64_t susp_continuation_area_size; diff --git a/usr.sbin/makefs/cd9660/cd9660_eltorito.c b/usr.sbin/makefs/cd9660/cd9660_eltorito.c index 0516334d47c..d9015cd0f19 100644 --- a/usr.sbin/makefs/cd9660/cd9660_eltorito.c +++ b/usr.sbin/makefs/cd9660/cd9660_eltorito.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cd9660_eltorito.c,v 1.4 2016/10/17 00:09:26 deraadt Exp $ */ +/* $OpenBSD: cd9660_eltorito.c,v 1.5 2016/10/23 11:09:38 natano Exp $ */ /* $NetBSD: cd9660_eltorito.c,v 1.20 2013/01/28 21:03:28 christos Exp $ */ /* @@ -94,10 +94,6 @@ cd9660_add_boot_disk(iso9660_disk *diskStructure, const char *boot_info) *filename++ = '\0'; - if (diskStructure->verbose_level > 0) { - printf("Found bootdisk with system %s, and filename %s\n", - sysname, filename); - } new_image = ecalloc(1, sizeof(*new_image)); new_image->loadSegment = 0; /* default for now */ @@ -146,17 +142,10 @@ cd9660_add_boot_disk(iso9660_disk *diskStructure, const char *boot_info) break; } - if (diskStructure->verbose_level > 0) - printf("%s\n", mode_msg); - new_image->size = stbuf.st_size; new_image->num_sectors = howmany(new_image->size, diskStructure->sectorSize) * howmany(diskStructure->sectorSize, 512); - if (diskStructure->verbose_level > 0) { - printf("New image has size %d, uses %d 512-byte sectors\n", - new_image->size, new_image->num_sectors); - } new_image->sector = -1; /* Bootable by default */ new_image->bootable = ET_BOOTABLE; @@ -382,12 +371,6 @@ cd9660_setup_boot(iso9660_disk *diskStructure, int first_sector) catalog_sectors = howmany(num_entries * 0x20, diskStructure->sectorSize); used_sectors += catalog_sectors; - if (diskStructure->verbose_level > 0) { - printf("%s: there will be %i entries consuming %i sectors. " - "Catalog is %i sectors\n", __func__, num_entries, - used_sectors, catalog_sectors); - } - /* Populate sector numbers */ sector = first_sector + catalog_sectors; TAILQ_FOREACH(tmp_disk, &diskStructure->boot_images, image_list) { @@ -580,30 +563,16 @@ cd9660_write_boot(iso9660_disk *diskStructure, FILE *fd) diskStructure->sectorSize, SEEK_SET) == -1) err(1, "fseeko"); - if (diskStructure->verbose_level > 0) { - printf("Writing boot catalog to sector %" PRId64 "\n", - diskStructure->boot_catalog_sector); - } LIST_FOREACH(e, &diskStructure->boot_entries, ll_struct) { - if (diskStructure->verbose_level > 0) { - printf("Writing catalog entry of type %d\n", - e->entry_type); - } /* * It doesnt matter which one gets written * since they are the same size */ fwrite(&(e->entry_data.VE), 1, 32, fd); } - if (diskStructure->verbose_level > 0) - printf("Finished writing boot catalog\n"); /* copy boot images */ TAILQ_FOREACH(t, &diskStructure->boot_images, image_list) { - if (diskStructure->verbose_level > 0) { - printf("Writing boot image from %s to sectors %d\n", - t->filename, t->sector); - } cd9660_copy_file(diskStructure, fd, t->sector, t->filename); if (t->system == ET_SYS_MAC) diff --git a/usr.sbin/makefs/cd9660/cd9660_write.c b/usr.sbin/makefs/cd9660/cd9660_write.c index 7e5c6bd64d5..b706d4283a6 100644 --- a/usr.sbin/makefs/cd9660/cd9660_write.c +++ b/usr.sbin/makefs/cd9660/cd9660_write.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cd9660_write.c,v 1.4 2016/10/23 10:32:42 natano Exp $ */ +/* $OpenBSD: cd9660_write.c,v 1.5 2016/10/23 11:09:38 natano Exp $ */ /* $NetBSD: cd9660_write.c,v 1.17 2013/10/19 17:16:37 christos Exp $ */ /* @@ -65,9 +65,6 @@ cd9660_write_image(iso9660_disk *diskStructure, const char* image) image); } - if (diskStructure->verbose_level > 0) - printf("Writing image\n"); - if (diskStructure->has_generic_bootimage) { status = cd9660_copy_file(diskStructure, fd, 0, diskStructure->generic_bootimage); @@ -86,9 +83,6 @@ cd9660_write_image(iso9660_disk *diskStructure, const char* image) goto cleanup_bad_image; } - if (diskStructure->verbose_level > 0) - printf("Volume descriptors written\n"); - /* * Write the path tables: there are actually four, but right * now we are only concearned with two. @@ -99,9 +93,6 @@ cd9660_write_image(iso9660_disk *diskStructure, const char* image) goto cleanup_bad_image; } - if (diskStructure->verbose_level > 0) - printf("Path tables written\n"); - /* Write the directories and files */ status = cd9660_write_file(diskStructure, fd, diskStructure->rootNode); if (status == 0) { @@ -118,19 +109,12 @@ cd9660_write_image(iso9660_disk *diskStructure, const char* image) cd9660_write_filedata(diskStructure, fd, diskStructure->totalSectors - 1, buf, 1); - if (diskStructure->verbose_level > 0) - printf("Files written\n"); fclose(fd); - - if (diskStructure->verbose_level > 0) - printf("Image closed\n"); return 1; cleanup_bad_image: fclose(fd); unlink(image); - if (diskStructure->verbose_level > 0) - printf("Bad image cleaned up\n"); return 0; } @@ -428,9 +412,6 @@ cd9660_copy_file(iso9660_disk *diskStructure, FILE *fd, off_t start_sector, return 0; } - if (diskStructure->verbose_level > 1) - printf("Writing file: %s\n",filename); - if (fseeko(fd, start_sector * diskStructure->sectorSize, SEEK_SET) == -1) err(1, "fseeko"); diff --git a/usr.sbin/makefs/msdos/msdosfs_vfsops.c b/usr.sbin/makefs/msdos/msdosfs_vfsops.c index 4c71bf725fa..2125fdf82fc 100644 --- a/usr.sbin/makefs/msdos/msdosfs_vfsops.c +++ b/usr.sbin/makefs/msdos/msdosfs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: msdosfs_vfsops.c,v 1.9 2016/10/22 22:20:24 natano Exp $ */ +/* $OpenBSD: msdosfs_vfsops.c,v 1.10 2016/10/23 11:09:38 natano Exp $ */ /*- * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. @@ -87,7 +87,6 @@ msdosfs_mount(struct mkfsvnode *devvp, int flags) uint8_t SecPerClust; int ronly = 0, error; int bsize; - struct msdos_options *m = devvp->fs->fs_specific; struct timezone tz; unsigned secsize = 512; |