History log of /freebsd-current/usr.sbin/makefs/cd9660/cd9660_eltorito.c
Revision Date Author Comments
# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# b61a5730 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-NetBSD identifier is obsolete, drop -NetBSD

The SPDX folks have obsoleted the BSD-2-Clause-NetBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix


# 22db5e5d 30-Mar-2023 Ed Maste <emaste@FreeBSD.org>

makefs: set the validation entry system type

Obtained from: NetBSD c3cb4dcc9c43
Sponsored by: The FreeBSD Foundation


# f0bef3d2 29-Mar-2023 Ed Maste <emaste@FreeBSD.org>

makefs: #define Apple Partition bits

NetBSD defines these in sys/bootblock.h, which we don't have. Add local
defintions in cd9660_eltorito.c (as OpenBSD did) to reduce diffs between
the three makefs implementations.

Obtained from: OpenBSD
Sponsored by: The FreeBSD Foundation


# 52c68e16 30-Mar-2023 Ed Maste <emaste@FreeBSD.org>

makefs: Whitespace cleanup to sync with NetBSD


# 9f2a5253 23-Mar-2023 Ed Maste <emaste@FreeBSD.org>

makefs: correct El Torito bood record

The boot catalog pointer is a DWord, but we previously populated it via
cd9660_bothendian_dword which overwrote four unused bytes following it.
See El Torito 1.0 (1995) Figure 7 for details.

PR: 203531
Reported by: Coverity Scan
Reported by: Thomas Schmitt <scdbackup@gmx.net>
Reviewed by: kevans
CID: 977470
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39231


# 53d8e037 17-Sep-2020 Ed Maste <emaste@FreeBSD.org>

makefs: connect cd9660 El Torito EFI boot image system type

Sponsored by: The FreeBSD Foundation


# 756e49c3 31-Mar-2018 Benno Rice <benno@FreeBSD.org>

Synchronise with NetBSD's version of EFI handling for El Torito images.

When I implemented my EFI support I failed to check if the upstream version
of makefs in NetBSD had done the same. Override my version with theirs to
make it easier to stay in sync with them in the future.

Reviewed by: imp, mav
Obtained from: NetBSD
MFC after: 1 week
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D14913


# 633cb765 23-Mar-2018 Benno Rice <benno@FreeBSD.org>

Don't try to modify El Torito section headers if there aren't any.

MFC after: 1 week


# ebf1c089 23-Mar-2018 Benno Rice <benno@FreeBSD.org>

Correctly mark the last El Torito section header.

Reported by: Thomas Schmitt <scdbackup@gmx.net>
Reviewed by: emaste, imp
MFC after: 1 week
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D14812


# 8dbc3905 23-Mar-2018 Benno Rice <benno@FreeBSD.org>

Allow makefs to properly tag UEFI El Torito boot images. Use them in amd64 ISOs.

UEFI booting requires an EFI System Partition (ESP). On most storage devices
this will be in a specific partition type. To allow booting from CD/ISO
filesystems, UEFI will look for an ESP in the form of a FAT filesystem image
embedded in the image. Historically FreeBSD has added one of these to its
amd64 ISO images but marked it as simply another i386 boot image. Luckily for
us most UEFI implementations are rather forgiving and work this out for us.

This change adds the ability to mark a boot image as being a UEFI image. It
also modifies our ISO generation to use this marking for the UEFI image we
embed.

Reported by: Thomas Schmitt <scdbackup@gmx.net>
Reviewed by: emaste, imp
MFC after: 1 week
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D14809


# 1de7b4b8 27-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

various: general adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.


# 856d87c5 08-May-2017 Ed Maste <emaste@FreeBSD.org>

makefs: use size_t as appropriate to clean up warnings

Sponsored by: The FreeBSD Foundation


# 5f5598b1 06-Apr-2017 Ed Maste <emaste@FreeBSD.org>

makefs: use emalloc and friends

The emalloc set of error-checking memory allocation routines were added
to libnetbsd in r316572. Use them in makefs to reduce differences with
NetBSD.

NetBSD revs:
cd9660.c 1.39
ffs.c 1.56
makefs.c 1.42
walk.c 1.27
cd9660/cd9660_archimedes.c 1.2
cd9660/cd9660_eltorito.c 1.20
cd9660/cd9660_write.c 1.16
cd9660/iso9660_rrip.c 1.12
ffs/buf.c 1.17
ffs/mkfs.c 1.26

Obtained from: NetBSD


# 1631d42a 22-Feb-2017 Ed Maste <emaste@FreeBSD.org>

makefs: eliminate global cd9660 structure

For diff reduction with NetBSD

NetBSD file versions:
cd9660.c 1.39
cd9660.h 1.19
cd9660/cd9660_debug.c 1.12
cd9660/cd9660_eltorito.c 1.20
cd9660/cd9660_write.c 1.16
cd9660/iso9660_rrip.c 1.12
cd9660/iso9660_rrip.h 1.6

Reviewed by: ngie
Obtained from: NetBSD
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D9627


# bff5cf16 02-Apr-2012 Andreas Tobler <andreast@FreeBSD.org>

- 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.

PR: powerpc/162091
MFC after: 1 week


# 3df5ecac 30-Dec-2011 Ulrich Spörlein <uqs@FreeBSD.org>

Spelling fixes for usr.sbin/


# 852f933d 10-Aug-2011 Marius Strobl <marius@FreeBSD.org>

Sync makefs(8) ISO 9660 support with NetBSD:
o cd9960 -> cd9660
o Move inclusion of sys/endian.h from cd9660_eltorito.c to cd9660.h
since actual user is not cd9660_eltorito.c but iso.h and
cd9660_eltorito.h.

Actually, include order/place of sys/endian.h doesn't matter on
netbsd since it is always included by sys/types.h but it's not
true on other system. This should fix cross build breakage on
freebsd introduced by rev. 1.16 of cd9660_eltorito.c.
Problem reported and fix suggested on twitter.
o Fix fd leaks in error cases. Found by cppcheck.
o RRIP RE length should be 4, not 0
o Apply fixes for PR bin/44114 (makefs(8) -t cd9660 -o rockridge creates
corrupted cd9660fs), iso9660_rrip.c part:
- cd9660_rrip_finalize_node() should check rr_real_parent in node->parent,
not in node itself in RRIP_PL case
- cd9660_rrip_initialize_node() should update only node passed as arg
so handle RRIP_PL in DOTDOT case

Fixes malformed dotdot entries in deep (more than 8 level) directories
moved into .rr_moved dir.

Should be pulled up to netbsd-5.
(no official ISO has such deep dirs, but cobalt restorecd is affected)

Reviewed by: mm
Approved by: re (kib)
Obtained from: NetBSD
MFC after: 3 days


# df73c41a 22-May-2011 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

Add analogs to the -chrp-boot and -prep-boot options to mkisofs.


# a3829099 06-May-2011 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

Simplify this code somewhat by only writing a 512-byte-sector APM map.
All firmwares can read it, we need to write one anyway for old OF
versions, and if a 512-byte one is present, OS X ignores the 2048-byte one
in favor of it.


# ebd3486c 04-May-2011 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

Fix boot on old machines (e.g. blue and white G3s) by synthesizing a
512-byte sector map instead unused space in the first 2048-byte sector.


# b3fa6d2c 03-May-2011 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

Add support for synthesizing an APM partition map to map Mac PowerPC
bootstrap partitions from the ISO9660 boot catalog. This preserves OS X's
ability to mount the CD, while allowing us a way to provide HFS-ified
bootstrap code for Open Firmware.


# 01a0f853 07-Nov-2010 Olivier Houchard <cognet@FreeBSD.org>

Sync with the latest version from NetBSD. It notably addds ISO9660 support.

Submitted by: bapt