CVS commit: src/usr.sbin/makefs/cd9660
Module Name:src Committed By: nonaka Date: Wed Mar 28 06:48:55 UTC 2018 Modified Files: src/usr.sbin/makefs/cd9660: cd9660_eltorito.c Log Message: Correctly mark the last El Torito section header. Pointed out by Benno Rice via DM. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/usr.sbin/makefs/cd9660/cd9660_eltorito.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/makefs/cd9660/cd9660_eltorito.c diff -u src/usr.sbin/makefs/cd9660/cd9660_eltorito.c:1.22 src/usr.sbin/makefs/cd9660/cd9660_eltorito.c:1.23 --- src/usr.sbin/makefs/cd9660/cd9660_eltorito.c:1.22 Thu Nov 9 01:28:05 2017 +++ src/usr.sbin/makefs/cd9660/cd9660_eltorito.c Wed Mar 28 06:48:55 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660_eltorito.c,v 1.22 2017/11/09 01:28:05 nonaka Exp $ */ +/* $NetBSD: cd9660_eltorito.c,v 1.23 2018/03/28 06:48:55 nonaka Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -40,7 +40,7 @@ #include #if defined(__RCSID) && !defined(__lint) -__RCSID("$NetBSD: cd9660_eltorito.c,v 1.22 2017/11/09 01:28:05 nonaka Exp $"); +__RCSID("$NetBSD: cd9660_eltorito.c,v 1.23 2018/03/28 06:48:55 nonaka Exp $"); #endif /* !__lint */ #ifdef DEBUG @@ -497,6 +497,12 @@ cd9660_setup_boot(iso9660_disk *diskStru LIST_INSERT_AFTER(head, temp, ll_struct); } + /* Find the last Section Header entry and mark it as the last. */ + head = NULL; + LIST_FOREACH(next, >boot_entries, ll_struct) { + if (next->entry_type == ET_ENTRY_SH) + head = next; + } if (head != NULL) head->entry_data.SH.header_indicator[0] = ET_SECTION_HEADER_LAST;
CVS commit: src/usr.sbin/makefs/cd9660
Module Name:src Committed By: nonaka Date: Thu Nov 9 01:28:06 UTC 2017 Modified Files: src/usr.sbin/makefs/cd9660: cd9660_eltorito.c Log Message: Initialize boot_catalog_entry's entry_type properly. This had been missing but the type was used in cd9660_setup_boot(). >From OpenBSD usr.sbin/makefs/cd9660/cd9660_eltorito.c r1.10. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/usr.sbin/makefs/cd9660/cd9660_eltorito.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/makefs/cd9660/cd9660_eltorito.c diff -u src/usr.sbin/makefs/cd9660/cd9660_eltorito.c:1.21 src/usr.sbin/makefs/cd9660/cd9660_eltorito.c:1.22 --- src/usr.sbin/makefs/cd9660/cd9660_eltorito.c:1.21 Tue Jan 24 11:22:43 2017 +++ src/usr.sbin/makefs/cd9660/cd9660_eltorito.c Thu Nov 9 01:28:05 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660_eltorito.c,v 1.21 2017/01/24 11:22:43 nonaka Exp $ */ +/* $NetBSD: cd9660_eltorito.c,v 1.22 2017/11/09 01:28:05 nonaka Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -40,7 +40,7 @@ #include #if defined(__RCSID) && !defined(__lint) -__RCSID("$NetBSD: cd9660_eltorito.c,v 1.21 2017/01/24 11:22:43 nonaka Exp $"); +__RCSID("$NetBSD: cd9660_eltorito.c,v 1.22 2017/11/09 01:28:05 nonaka Exp $"); #endif /* !__lint */ #ifdef DEBUG @@ -247,6 +247,7 @@ cd9660_boot_setup_validation_entry(char size_t i; entry = cd9660_init_boot_catalog_entry(); + entry->entry_type = ET_ENTRY_VE; ve = >entry_data.VE; ve->header_id[0] = 1; @@ -281,6 +282,7 @@ cd9660_boot_setup_default_entry(struct c if (default_entry == NULL) return NULL; + default_entry->entry_type = ET_ENTRY_IE; ie = _entry->entry_data.IE; ie->boot_indicator[0] = disk->bootable; @@ -308,6 +310,7 @@ cd9660_boot_setup_section_head(char plat if (entry == NULL) return NULL; + entry->entry_type = ET_ENTRY_SH; sh = >entry_data.SH; /* More by default. The last one will manually be set to 0x91 */ sh->header_indicator[0] = ET_SECTION_HEADER_MORE; @@ -324,6 +327,7 @@ cd9660_boot_setup_section_entry(struct c if ((entry = cd9660_init_boot_catalog_entry()) == NULL) return NULL; + entry->entry_type = ET_ENTRY_SE; se = >entry_data.SE; se->boot_indicator[0] = ET_BOOTABLE;
CVS commit: src/usr.sbin/makefs/cd9660
Module Name:src Committed By: martin Date: Fri May 30 13:14:48 UTC 2014 Modified Files: src/usr.sbin/makefs/cd9660: iso9660_rrip.c Log Message: PR kern/48852 (which should have been bin/ in retrospect): apply patch from Thomas Schmitt to fix rockridge encoding of device nodes. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/makefs/cd9660/iso9660_rrip.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/makefs/cd9660/iso9660_rrip.c diff -u src/usr.sbin/makefs/cd9660/iso9660_rrip.c:1.13 src/usr.sbin/makefs/cd9660/iso9660_rrip.c:1.14 --- src/usr.sbin/makefs/cd9660/iso9660_rrip.c:1.13 Tue Jul 30 16:02:23 2013 +++ src/usr.sbin/makefs/cd9660/iso9660_rrip.c Fri May 30 13:14:47 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: iso9660_rrip.c,v 1.13 2013/07/30 16:02:23 reinoud Exp $ */ +/* $NetBSD: iso9660_rrip.c,v 1.14 2014/05/30 13:14:47 martin Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -44,7 +44,7 @@ #include sys/cdefs.h #if defined(__RCSID) !defined(__lint) -__RCSID($NetBSD: iso9660_rrip.c,v 1.13 2013/07/30 16:02:23 reinoud Exp $); +__RCSID($NetBSD: iso9660_rrip.c,v 1.14 2014/05/30 13:14:47 martin Exp $); #endif /* !__lint */ static void cd9660_rrip_initialize_inode(cd9660node *); @@ -657,13 +657,14 @@ cd9660node_rrip_pn(struct ISO_SUSP_ATTRI pn_field-attr.rr_entry.PN.h.length[0] = 20; pn_field-attr.rr_entry.PN.h.version[0] = 1; - if (sizeof (fnode-inode-st.st_dev) 32) - cd9660_bothendian_dword((uint64_t)fnode-inode-st.st_dev 32, + if (sizeof (fnode-inode-st.st_rdev) 4) + cd9660_bothendian_dword( + (uint64_t)fnode-inode-st.st_rdev 32, pn_field-attr.rr_entry.PN.high); else cd9660_bothendian_dword(0, pn_field-attr.rr_entry.PN.high); - cd9660_bothendian_dword(fnode-inode-st.st_dev 0x, + cd9660_bothendian_dword(fnode-inode-st.st_rdev 0x, pn_field-attr.rr_entry.PN.low); return 1; }
CVS commit: src/usr.sbin/makefs/cd9660
Module Name:src Committed By: christos Date: Mon Apr 2 19:01:21 UTC 2012 Modified Files: src/usr.sbin/makefs/cd9660: cd9660_eltorito.c Log Message: Pull FreeBSD fix from Andreas Tobbler: - Write the ISO9660 descriptor after the apm partition entries. - Fill the needed pmPartStatus flags. At least the OpenBIOS implementation relies on these flags. This commit fixes the panic seen on OS-X when inserting a FreeBSD/ppc disc. Additionally OpenBIOS recognizes the partition where the boot code is located. This lets us load a FreeBSD/ppc PowerMac kernel inside qemu. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/usr.sbin/makefs/cd9660/cd9660_eltorito.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/makefs/cd9660/cd9660_eltorito.c diff -u src/usr.sbin/makefs/cd9660/cd9660_eltorito.c:1.17 src/usr.sbin/makefs/cd9660/cd9660_eltorito.c:1.18 --- src/usr.sbin/makefs/cd9660/cd9660_eltorito.c:1.17 Wed Jun 22 22:35:56 2011 +++ src/usr.sbin/makefs/cd9660/cd9660_eltorito.c Mon Apr 2 15:01:21 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660_eltorito.c,v 1.17 2011/06/23 02:35:56 enami Exp $ */ +/* $NetBSD: cd9660_eltorito.c,v 1.18 2012/04/02 19:01:21 christos Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -35,10 +35,11 @@ #include cd9660.h #include cd9660_eltorito.h +#include sys/bootblock.h #include sys/cdefs.h #if defined(__RCSID) !defined(__lint) -__RCSID($NetBSD: cd9660_eltorito.c,v 1.17 2011/06/23 02:35:56 enami Exp $); +__RCSID($NetBSD: cd9660_eltorito.c,v 1.18 2012/04/02 19:01:21 christos Exp $); #endif /* !__lint */ #ifdef DEBUG @@ -541,9 +542,20 @@ cd9660_write_apm_partition_entry(FILE *f off_t sector_start, off_t nsectors, off_t sector_size, const char *part_name, const char *part_type) { - uint32_t apm32; + uint32_t apm32, part_status; uint16_t apm16; + /* See Apple Tech Note 1189 for the details about the pmPartStatus + * flags. + * Below the flags which are default: + * - IsValid 0x01 + * - IsAllocated 0x02 + * - IsReadable 0x10 + * - IsWritable 0x20 + */ + part_status = APPLE_PS_VALID | APPLE_PS_ALLOCATED | APPLE_PS_READABLE | + APPLE_PS_WRITABLE; + if (fseeko(fd, (off_t)(idx + 1) * sector_size, SEEK_SET) == -1) err(1, fseeko); @@ -565,6 +577,17 @@ cd9660_write_apm_partition_entry(FILE *f fwrite(part_name, strlen(part_name) + 1, 1, fd); fseek(fd, 32 - strlen(part_name) - 1, SEEK_CUR); fwrite(part_type, strlen(part_type) + 1, 1, fd); + fseek(fd, 32 - strlen(part_type) - 1, SEEK_CUR); + + apm32 = 0; + /* pmLgDataStart */ + fwrite(apm32, sizeof(apm32), 1, fd); + /* pmDataCnt */ + apm32 = htobe32(nsectors); + fwrite(apm32, sizeof(apm32), 1, fd); + /* pmPartStatus */ + apm32 = htobe32(part_status); + fwrite(apm32, sizeof(apm32), 1, fd); return 0; } @@ -669,12 +692,6 @@ cd9660_write_boot(FILE *fd) cd9660_write_apm_partition_entry(fd, 0, total_parts, 1, total_parts, 512, Apple, Apple_partition_map); - /* Write ISO9660 descriptor, enclosing the whole disk */ - cd9660_write_apm_partition_entry(fd, 1, total_parts, 0, - diskStructure.totalSectors * - (diskStructure.sectorSize / 512), 512, ISO9660, - CD_ROM_Mode_1); - /* Write all partition entries */ apm_partitions = 0; TAILQ_FOREACH(t, diskStructure.boot_images, image_list) { @@ -682,11 +699,17 @@ cd9660_write_boot(FILE *fd) continue; cd9660_write_apm_partition_entry(fd, - 2 + apm_partitions++, total_parts, + 1 + apm_partitions++, total_parts, t-sector * (diskStructure.sectorSize / 512), t-num_sectors * (diskStructure.sectorSize / 512), 512, CD Boot, Apple_Bootstrap); } + + /* Write ISO9660 descriptor, enclosing the whole disk */ + cd9660_write_apm_partition_entry(fd, 2 + apm_partitions, + total_parts, 0, diskStructure.totalSectors * + (diskStructure.sectorSize / 512), 512, ISO9660, + CD_ROM_Mode_1); } return 0;
CVS commit: src/usr.sbin/makefs/cd9660
Module Name:src Committed By: tsutsui Date: Sat May 28 11:59:29 UTC 2011 Modified Files: src/usr.sbin/makefs/cd9660: iso9660_rrip.c Log Message: - remove unnecessary (pasto?) line on RRIP PL handling for moved dir - RRIP RE length should be 4, not 0 To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/makefs/cd9660/iso9660_rrip.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/makefs/cd9660/iso9660_rrip.c diff -u src/usr.sbin/makefs/cd9660/iso9660_rrip.c:1.8 src/usr.sbin/makefs/cd9660/iso9660_rrip.c:1.9 --- src/usr.sbin/makefs/cd9660/iso9660_rrip.c:1.8 Sat Jan 10 22:06:29 2009 +++ src/usr.sbin/makefs/cd9660/iso9660_rrip.c Sat May 28 11:59:29 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: iso9660_rrip.c,v 1.8 2009/01/10 22:06:29 bjh21 Exp $ */ +/* $NetBSD: iso9660_rrip.c,v 1.9 2011/05/28 11:59:29 tsutsui Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -43,7 +43,7 @@ #include sys/cdefs.h #if defined(__RCSID) !defined(__lint) -__RCSID($NetBSD: iso9660_rrip.c,v 1.8 2009/01/10 22:06:29 bjh21 Exp $); +__RCSID($NetBSD: iso9660_rrip.c,v 1.9 2011/05/28 11:59:29 tsutsui Exp $); #endif /* !__lint */ static void cd9660_rrip_initialize_inode(cd9660node *); @@ -444,7 +444,6 @@ cd9660_rrip_PL(current,node-dot_dot_record); TAILQ_INSERT_TAIL(node-dot_dot_record-head, current, rr_ll); - TAILQ_INSERT_TAIL(node-head, current, rr_ll); } } return 1; @@ -498,7 +497,7 @@ int cd9660_rrip_RE(struct ISO_SUSP_ATTRIBUTES *p, cd9660node *node __unused) { - p-attr.rr_entry.RE.h.length[0] = 0; + p-attr.rr_entry.RE.h.length[0] = 4; p-attr.rr_entry.RE.h.version[0] = 1; return 1; }
CVS commit: src/usr.sbin/makefs/cd9660
Module Name:src Committed By: christos Date: Mon May 23 00:21:50 UTC 2011 Modified Files: src/usr.sbin/makefs/cd9660: cd9660_eltorito.c Log Message: include system headers after config.h To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/makefs/cd9660/cd9660_eltorito.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/makefs/cd9660/cd9660_eltorito.c diff -u src/usr.sbin/makefs/cd9660/cd9660_eltorito.c:1.15 src/usr.sbin/makefs/cd9660/cd9660_eltorito.c:1.16 --- src/usr.sbin/makefs/cd9660/cd9660_eltorito.c:1.15 Sun May 22 17:51:39 2011 +++ src/usr.sbin/makefs/cd9660/cd9660_eltorito.c Sun May 22 20:21:50 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660_eltorito.c,v 1.15 2011/05/22 21:51:39 christos Exp $ */ +/* $NetBSD: cd9660_eltorito.c,v 1.16 2011/05/23 00:21:50 christos Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -32,14 +32,15 @@ * OF SUCH DAMAGE. */ -#include sys/endian.h #include cd9660.h #include cd9660_eltorito.h +#include sys/endian.h + #include sys/cdefs.h #if defined(__RCSID) !defined(__lint) -__RCSID($NetBSD: cd9660_eltorito.c,v 1.15 2011/05/22 21:51:39 christos Exp $); +__RCSID($NetBSD: cd9660_eltorito.c,v 1.16 2011/05/23 00:21:50 christos Exp $); #endif /* !__lint */ #ifdef DEBUG
CVS commit: src/usr.sbin/makefs/cd9660
Module Name:src Committed By: christos Date: Wed Mar 23 13:11:52 UTC 2011 Modified Files: src/usr.sbin/makefs/cd9660: cd9660_strings.c Log Message: Fix typos in character ranges from: Baptiste Daroussin bapt at freebsd dot org To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/makefs/cd9660/cd9660_strings.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/makefs/cd9660/cd9660_strings.c diff -u src/usr.sbin/makefs/cd9660/cd9660_strings.c:1.4 src/usr.sbin/makefs/cd9660/cd9660_strings.c:1.5 --- src/usr.sbin/makefs/cd9660/cd9660_strings.c:1.4 Tue Jan 16 12:32:05 2007 +++ src/usr.sbin/makefs/cd9660/cd9660_strings.c Wed Mar 23 09:11:51 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660_strings.c,v 1.4 2007/01/16 17:32:05 hubertf Exp $ */ +/* $NetBSD: cd9660_strings.c,v 1.5 2011/03/23 13:11:51 christos Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -46,7 +46,7 @@ #include cd9660.h #if defined(__RCSID) !defined(__lint) -__RCSID($NetBSD: cd9660_strings.c,v 1.4 2007/01/16 17:32:05 hubertf Exp $); +__RCSID($NetBSD: cd9660_strings.c,v 1.5 2011/03/23 13:11:51 christos Exp $); #endif /* !__lint */ @@ -62,19 +62,19 @@ } static inline int -cd9660_is_a_char(char c) +cd9660_is_d_char(char c) { return (isupper((unsigned char)c) || c == '_' - || (c = '0' c = '?')); + || (c = '0' c = '9')); } static inline int -cd9660_is_d_char(char c) +cd9660_is_a_char(char c) { return (isupper((unsigned char)c) || c == '_' - || (c = '%' c = '9') + || (c = '%' c = '?') || (c = ' ' c = '\')); }
CVS commit: src/usr.sbin/makefs/cd9660
Module Name:src Committed By: wiz Date: Tue Jan 4 09:48:21 UTC 2011 Modified Files: src/usr.sbin/makefs/cd9660: cd9660_write.c Log Message: Fix fd leaks in error cases. Found by cppcheck. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/makefs/cd9660/cd9660_write.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/makefs/cd9660/cd9660_write.c diff -u src/usr.sbin/makefs/cd9660/cd9660_write.c:1.13 src/usr.sbin/makefs/cd9660/cd9660_write.c:1.14 --- src/usr.sbin/makefs/cd9660/cd9660_write.c:1.13 Fri Oct 22 00:49:15 2010 +++ src/usr.sbin/makefs/cd9660/cd9660_write.c Tue Jan 4 09:48:21 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660_write.c,v 1.13 2010/10/22 00:49:15 christos Exp $ */ +/* $NetBSD: cd9660_write.c,v 1.14 2011/01/04 09:48:21 wiz Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -37,7 +37,7 @@ #include sys/cdefs.h #if defined(__RCSID) !defined(__lint) -__RCSID($NetBSD: cd9660_write.c,v 1.13 2010/10/22 00:49:15 christos Exp $); +__RCSID($NetBSD: cd9660_write.c,v 1.14 2011/01/04 09:48:21 wiz Exp $); #endif /* !__lint */ static int cd9660_write_volume_descriptors(FILE *); @@ -460,6 +460,7 @@ if (ferror(rf)) { warn(%s: fread, __func__); free(buf); + (void)fclose(rf); return 0; } @@ -467,6 +468,7 @@ if (ferror(fd)) { warn(%s: fwrite, __func__); free(buf); + (void)fclose(rf); return 0; } sector++;
CVS commit: src/usr.sbin/makefs/cd9660
Module Name:src Committed By: mbalmer Date: Sun Nov 22 18:43:28 UTC 2009 Modified Files: src/usr.sbin/makefs/cd9660: cd9660_write.c Log Message: make sense To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/makefs/cd9660/cd9660_write.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/makefs/cd9660/cd9660_write.c diff -u src/usr.sbin/makefs/cd9660/cd9660_write.c:1.11 src/usr.sbin/makefs/cd9660/cd9660_write.c:1.12 --- src/usr.sbin/makefs/cd9660/cd9660_write.c:1.11 Sun Nov 22 18:40:27 2009 +++ src/usr.sbin/makefs/cd9660/cd9660_write.c Sun Nov 22 18:43:27 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660_write.c,v 1.11 2009/11/22 18:40:27 mbalmer Exp $ */ +/* $NetBSD: cd9660_write.c,v 1.12 2009/11/22 18:43:27 mbalmer Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -37,7 +37,7 @@ #include sys/cdefs.h #if defined(__RCSID) !defined(__lint) -__RCSID($NetBSD: cd9660_write.c,v 1.11 2009/11/22 18:40:27 mbalmer Exp $); +__RCSID($NetBSD: cd9660_write.c,v 1.12 2009/11/22 18:43:27 mbalmer Exp $); #endif /* !__lint */ static int cd9660_write_volume_descriptors(FILE *); @@ -502,7 +502,7 @@ } /* - * If we had to go the continuation area, head back to + * If we had to go to the continuation area, head back to * where we should be. */ if (in_ca)