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
This commit is contained in:
Ed Maste 2023-03-30 12:45:18 -04:00 committed by Oscar Zhao
parent c7b53f1b07
commit c9969a3c5c

View File

@ -41,6 +41,14 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
/*
* Partition Status Information from Apple Tech Note 1189
*/
#define APPLE_PS_VALID 0x00000001 /* Entry is valid */
#define APPLE_PS_ALLOCATED 0x00000002 /* Entry is allocated */
#define APPLE_PS_READABLE 0x00000010 /* Entry is readable */
#define APPLE_PS_WRITABLE 0x00000020 /* Entry is writable */
#ifdef DEBUG
#define ELTORITO_DPRINTF(__x) printf __x
#else
@ -574,15 +582,8 @@ cd9660_write_apm_partition_entry(FILE *fd, int idx, int total_partitions,
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 = 0x01 | 0x02 | 0x10 | 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");