2 #ifndef LIBISO_LIBISOFS_H_
3 #define LIBISO_LIBISOFS_H_
46 #ifdef HAVE_INTTYPES_H
95 #define iso_lib_header_version_major 1
96 #define iso_lib_header_version_minor 5
97 #define iso_lib_header_version_micro 4
237 #define ISO_NODE_IS_DIR(n) (iso_node_get_type(n) == LIBISO_DIR)
238 #define ISO_NODE_IS_FILE(n) (iso_node_get_type(n) == LIBISO_FILE)
239 #define ISO_NODE_IS_SYMLINK(n) (iso_node_get_type(n) == LIBISO_SYMLINK)
240 #define ISO_NODE_IS_SPECIAL(n) (iso_node_get_type(n) == LIBISO_SPECIAL)
241 #define ISO_NODE_IS_BOOTCAT(n) (iso_node_get_type(n) == LIBISO_BOOT)
244 #define ISO_DIR(n) ((IsoDir*)(ISO_NODE_IS_DIR(n) ? n : NULL))
245 #define ISO_FILE(n) ((IsoFile*)(ISO_NODE_IS_FILE(n) ? n : NULL))
246 #define ISO_SYMLINK(n) ((IsoSymlink*)(ISO_NODE_IS_SYMLINK(n) ? n : NULL))
247 #define ISO_SPECIAL(n) ((IsoSpecial*)(ISO_NODE_IS_SPECIAL(n) ? n : NULL))
249 #define ISO_NODE(n) ((IsoNode*)n)
879 unsigned char **aa_string,
int flag);
906 #ifndef Libisofs_h_as_cpluspluS
1176 #ifndef Libisofs_h_as_cpluspluS
1518 uint8_t serial_number[8]);
1538 int hfsp_block_size,
int apm_block_size);
1966 char *name,
char *timestamp,
1988 int file_mode,
int uid,
int gid);
2294 int options,
int flag);
2349 time_t vol_creation_time, time_t vol_modification_time,
2350 time_t vol_expiration_time, time_t vol_effective_time,
2387 uint32_t block_offset_2k,
2388 int secs_512_per_head,
int heads_per_cyl);
2396 #define iso_libjte_req_major 2
2397 #define iso_libjte_req_minor 0
2398 #define iso_libjte_req_micro 0
2534 off_t *byte_count,
int flag);
2569 int *buf_fill,
int flag);
2725 uint8_t partition_type,
char *image_path,
int flag);
2770 uint8_t guid[16],
int valid);
3487 const char *data_preparer_id);
3537 const char *copyright_file_id);
3555 const char *abstract_file_id);
3640 char **creation_time,
char **modification_time,
3641 char **expiration_time,
char **effective_time);
3690 const char *catalog_path,
3788 char **content, off_t *size);
4186 int options,
int flag);
4233 int *options,
int flag);
4241 #define ISO_MAX_SYSAREA_LINE_LENGTH 4096
4249 #define ISO_SYSAREA_REPORT_DOC \
4251 "Report format for recognized System Area data.", \
4253 "No text will be reported if no System Area was loaded or if it was", \
4254 "entirely filled with 0-bytes.", \
4255 "Else there will be at least these three lines:", \
4256 " System area options: hex", \
4257 " see libisofs.h, parameter of iso_write_opts_set_system_area().", \
4258 " System area summary: word ... word", \
4259 " human readable interpretation of system area options and other info", \
4260 " The words are from the set:", \
4261 " { MBR, CHRP, PReP, GPT, APM, MIPS-Big-Endian, MIPS-Little-Endian,", \
4262 " SUN-SPARC-Disk-Label, HP-PA-PALO, DEC-Alpha, ", \
4263 " protective-msdos-label, isohybrid, grub2-mbr,", \
4264 " cyl-align-{auto,on,off,all}, not-recognized, }", \
4265 " The acronyms indicate boot data for particular hardware/firmware.", \
4266 " protective-msdos-label is an MBR conformant to specs of GPT.", \
4267 " isohybrid is an MBR implementing ISOLINUX isohybrid functionality.", \
4268 " grub2-mbr is an MBR with GRUB2 64 bit address patching.", \
4269 " cyl-align-on indicates that the ISO image MBR partition ends at a", \
4270 " cylinder boundary. cyl-align-all means that more MBR partitions", \
4271 " exist and all end at a cylinder boundary.", \
4272 " not-recognized tells about unrecognized non-zero system area data.", \
4273 " ISO image size/512 : decimal", \
4274 " size of ISO image in block units of 512 bytes.", \
4276 #define ISO_SYSAREA_REPORT_DOC_MBR \
4278 "If an MBR is detected, with at least one partition entry of non-zero size,", \
4279 "then there may be:", \
4280 " Partition offset : decimal", \
4281 " if not 0 then a second ISO 9660 superblock was found to which", \
4282 " MBR partition 1 or GPT partition 1 is pointing.", \
4283 " MBR heads per cyl : decimal", \
4284 " conversion factor between MBR C/H/S address and LBA. 0=inconsistent.", \
4285 " MBR secs per head : decimal", \
4286 " conversion factor between MBR C/H/S address and LBA. 0=inconsistent.", \
4287 " MBR partition table: N Status Type Start Blocks", \
4288 " headline for MBR partition table.", \
4289 " MBR partition : X hex hex decimal decimal", \
4290 " gives partition number, status byte, type byte, start block,", \
4291 " and number of blocks. 512 bytes per block.", \
4292 " MBR partition path : X path", \
4293 " the path of a file in the ISO image which begins at the partition", \
4294 " start block of partition X.", \
4295 " PReP boot partition: decimal decimal", \
4296 " gives start block and size of a PReP boot partition in ISO 9660", \
4297 " block units of 2048 bytes.", \
4299 #define ISO_SYSAREA_REPORT_DOC_GPT1 \
4301 "GUID Partition Table can coexist with MBR:", \
4303 " headline for GPT partition table. The fields are too wide for a", \
4304 " neat table. So they are listed with a partition number and a text.", \
4305 " GPT CRC should be : <hex> to match first 92 GPT header block bytes", \
4306 " GPT CRC found : <hex> matches all 512 bytes of GPT header block", \
4307 " libisofs-1.2.4 to 1.2.8 had a bug with the GPT header CRC. So", \
4308 " libisofs is willing to recognize GPT with the buggy CRC. These", \
4309 " two lines inform that most partition editors will not accept it.", \
4310 " GPT array CRC wrong: should be <hex>, found <hex>", \
4311 " GPT entry arrays are accepted even if their CRC does not match.", \
4312 " In this case, both CRCs are reported by this line.", \
4313 " GPT backup problems: text", \
4314 " reports about inconsistencies between main GPT and backup GPT.", \
4315 " The statements are comma separated:", \
4316 " Implausible header LBA <decimal>", \
4317 " Cannot read header block at 2k LBA <decimal>", \
4318 " Not a GPT 1.0 header of 92 bytes for 128 bytes per entry", \
4319 " Head CRC <hex> wrong. Should be <hex>", \
4320 " Head CRC <hex> wrong. Should be <hex>. Matches all 512 block bytes", \
4321 " Disk GUID differs (<hex_digits>)", \
4322 " Cannot read array block at 2k LBA <decimal>", \
4323 " Array CRC <hex> wrong. Should be <hex>", \
4324 " Entries differ for partitions <decimal> [... <decimal>]", \
4325 " GPT disk GUID : hex_digits", \
4326 " 32 hex digits giving the byte string of the disk's GUID", \
4327 " GPT entry array : decimal decimal word", \
4328 " start block of partition entry array and number of entries. 512 bytes", \
4329 " per block. The word may be \"separated\" if partitions are disjoint,", \
4330 " \"overlapping\" if they are not. In future there may be \"nested\"", \
4331 " as special case where all overlapping partitions are superset and", \
4332 " subset, and \"covering\" as special case of disjoint partitions", \
4333 " covering the whole GPT block range for partitions.", \
4334 " GPT lba range : decimal decimal decimal", \
4335 " addresses of first payload block, last payload block, and of the", \
4336 " GPT backup header block. 512 bytes per block." \
4338 #define ISO_SYSAREA_REPORT_DOC_GPT2 \
4340 " GPT partition name : X hex_digits", \
4341 " up to 144 hex digits giving the UTF-16LE name byte string of", \
4342 " partition X. Trailing 16 bit 0-characters are omitted.", \
4343 " GPT partname local : X text", \
4344 " the name of partition X converted to the local character set.", \
4345 " This line may be missing if the name cannot be converted, or is", \
4347 " GPT partition GUID : X hex_digits", \
4348 " 32 hex digits giving the byte string of the GUID of partition X.", \
4349 " GPT type GUID : X hex_digits", \
4350 " 32 hex digits giving the byte string of the type GUID of partition X.", \
4351 " GPT partition flags: X hex", \
4352 " 64 flag bits of partition X in hex representation.", \
4353 " Known bit meanings are:", \
4354 " bit0 = \"System Partition\" Do not alter.", \
4355 " bit2 = Legacy BIOS bootable (MBR partition type 0x80)", \
4356 " bit60= read-only", \
4357 " GPT start and size : X decimal decimal", \
4358 " start block and number of blocks of partition X. 512 bytes per block.", \
4359 " GPT partition path : X path", \
4360 " the path of a file in the ISO image which begins at the partition", \
4361 " start block of partition X.", \
4363 #define ISO_SYSAREA_REPORT_DOC_APM \
4365 "Apple partition map can coexist with MBR and GPT:", \
4367 " headline for human readers.", \
4368 " APM block size : decimal", \
4369 " block size of Apple Partition Map. 512 or 2048. This applies to", \
4370 " start address and size of all partitions in the APM.", \
4371 " APM gap fillers : decimal", \
4372 " tells the number of partitions with name \"Gap[0-9[0-9]]\" and type", \
4373 " \"ISO9660_data\".", \
4374 " APM partition name : X text", \
4375 " the name of partition X. Up to 32 characters.", \
4376 " APM partition type : X text", \
4377 " the type string of partition X. Up to 32 characters.", \
4378 " APM start and size : X decimal decimal", \
4379 " start block and number of blocks of partition X.", \
4380 " APM partition path : X path", \
4381 " the path of a file in the ISO image which begins at the partition", \
4382 " start block of partition X.", \
4384 #define ISO_SYSAREA_REPORT_DOC_MIPS \
4386 "If a MIPS Big Endian Volume Header is detected, there may be:", \
4387 " MIPS-BE volume dir : N Name Block Bytes", \
4388 " headline for human readers.", \
4389 " MIPS-BE boot entry : X upto8chr decimal decimal", \
4390 " tells name, 512-byte block address, and byte count of boot entry X.", \
4391 " MIPS-BE boot path : X path", \
4392 " tells the path to the boot image file in the ISO image which belongs", \
4393 " to the block address given by boot entry X.", \
4395 "If a DEC Boot Block for MIPS Little Endian is detected, there may be:", \
4396 " MIPS-LE boot map : LoadAddr ExecAddr SegmentSize SegmentStart", \
4397 " headline for human readers.", \
4398 " MIPS-LE boot params: decimal decimal decimal decimal", \
4399 " tells four numbers which are originally derived from the ELF header", \
4400 " of the boot file. The first two are counted in bytes, the other two", \
4401 " are counted in blocks of 512 bytes.", \
4402 " MIPS-LE boot path : path", \
4403 " tells the path to the boot file in the ISO image which belongs to the", \
4404 " address given by SegmentStart.", \
4405 " MIPS-LE elf offset : decimal", \
4406 " tells the relative 512-byte block offset inside the boot file:", \
4407 " SegmentStart - FileStartBlock", \
4409 #define ISO_SYSAREA_REPORT_DOC_SUN \
4411 "If a SUN SPARC Disk Label is present:", \
4412 " SUN SPARC disklabel: text", \
4413 " tells the disk label text.", \
4414 " SUN SPARC secs/head: decimal", \
4415 " tells the number of sectors per head.", \
4416 " SUN SPARC heads/cyl: decimal", \
4417 " tells the number of heads per cylinder.", \
4418 " SUN SPARC partmap : N IdTag Perms StartCyl NumBlock", \
4419 " headline for human readers.", \
4420 " SUN SPARC partition: X hex hex decimal decimal", \
4421 " gives partition number, type word, permission word, start cylinder,", \
4422 " and number of of blocks. 512 bytes per block. Type word may be: ", \
4423 " 0=unused, 2=root partition with boot, 4=user partition.", \
4424 " Permission word is 0x10 = read-only.", \
4425 " SPARC GRUB2 core : decimal decimal", \
4426 " tells byte address and byte count of the GRUB2 SPARC core file.", \
4427 " SPARC GRUB2 path : path", \
4428 " tells the path to the data file in the ISO image which belongs to the", \
4429 " address given by core.", \
4431 #define ISO_SYSAREA_REPORT_DOC_HPPA \
4433 "If a HP-PA PALO boot sector version 4 or 5 is present:", \
4434 " PALO header version: decimal", \
4435 " tells the PALO header version: 4 or 5.", \
4436 " HP-PA cmdline : text", \
4437 " tells the command line for the kernels.", \
4438 " HP-PA boot files : ByteAddr ByteSize Path", \
4439 " headline for human readers.", \
4440 " HP-PA 32-bit kernel: decimal decimal path", \
4441 " tells start byte, byte count, and file path of the 32-bit kernel.", \
4442 " HP-PA 64-bit kernel: decimal decimal path", \
4443 " tells the same for the 64-bit kernel.", \
4444 " HP-PA ramdisk : decimal decimal path", \
4445 " tells the same for the ramdisk file.", \
4446 " HP-PA bootloader : decimal decimal path", \
4447 " tells the same for the bootloader file.", \
4449 #define ISO_SYSAREA_REPORT_DOC_ALPHA \
4450 "If a DEC Alpha SRM boot sector is present:", \
4451 " DEC Alpha ldr size : decimal", \
4452 " tells the number of 512-byte blocks in DEC Alpha Secondary Bootstrap", \
4454 " DEC Alpha ldr adr : decimal", \
4455 " tells the start of the loader file in units of 512-byte blocks.", \
4456 " DEC Alpha ldr path : path", \
4457 " tells the path of a file in the ISO image which starts at the loader", \
4496 char ***reply,
int *line_count,
int flag);
4504 #define ISO_ELTORITO_REPORT_DOC \
4505 "Report format for recognized El Torito boot information.", \
4507 "No text will be reported if no El Torito information was found.", \
4508 "Else there will be at least these three lines", \
4509 " El Torito catalog : decimal decimal", \
4510 " tells the block address and number of 2048-blocks of the boot catalog.", \
4511 " El Torito images : N Pltf B Emul Ld_seg Hdpt Ldsiz LBA", \
4512 " is the headline of the boot image list.", \
4513 " El Torito boot img : X word char word hex hex decimal decimal", \
4514 " tells about boot image number X:", \
4515 " - Platform Id: \"BIOS\", \"PPC\", \"Mac\", \"UEFI\" or a hex number.", \
4516 " - Bootability: either \"y\" or \"n\".", \
4517 " - Emulation: \"none\", \"fd1.2\", \"fd1.4\", \"fd2.8\", \"hd\"", \
4518 " for no emulation, three floppy MB sizes, hard disk.", \
4519 " - Load Segment: start offset in boot image. 0x0000 means 0x07c0.", \
4520 " - Hard disk emulation partition type: MBR partition type code.", \
4521 " - Load size: number of 512-blocks to load with emulation mode \"none\".", \
4522 " - LBA: start block number in ISO filesystem (2048-block).", \
4524 "The following lines appear conditionally:", \
4525 " El Torito cat path : iso_rr_path", \
4526 " tells the path to the data file in the ISO image which belongs to", \
4527 " the block address where the boot catalog starts.", \
4528 " (This line is not reported if no path points to that block.)", \
4529 " El Torito img path : X iso_rr_path", \
4530 " tells the path to the data file in the ISO image which belongs to", \
4531 " the block address given by LBA of boot image X.", \
4532 " (This line is not reported if no path points to that block.)", \
4533 " El Torito img opts : X word ... word", \
4534 " tells the presence of extra features:", \
4535 " \"boot-info-table\" image got boot info table patching.", \
4536 " \"isohybrid-suitable\" image is suitable for ISOLINUX isohybrid MBR.", \
4537 " \"grub2-boot-info\" image got GRUB2 boot info patching.", \
4538 " (This line is not reported if no such options were detected.)", \
4539 " El Torito id string: X hex_digits", \
4540 " tells the id string of the catalog section which hosts boot image X.", \
4541 " (This line is not reported if the id string is all zero.)", \
4542 " El Torito sel crit : X hex_digits", \
4543 " tells the selection criterion of boot image X.", \
4544 " (This line is not reported if the criterion is all zero.)", \
4545 " El Torito img blks : X decimal", \
4546 " gives an upper limit of the number of 2048-blocks in the boot image", \
4547 " if it is not accessible via a path in the ISO directory tree.", \
4548 " The boot image is supposed to end before the start block of any", \
4549 " other entity of the ISO filesystem.", \
4550 " (This line is not reported if no limiting entity is found.)", \
4551 " El Torito hdsiz/512: X decimal", \
4552 " gives with a boot image of emulation type \"hd\" the lowest block", \
4553 " number which is above any partition end in the boot image's MBR", \
4554 " partition table. This can be considered the claimed size of the", \
4555 " emulated hard disk given in blocks of 512 bytes.", \
4556 " (This line is not reported if no partition is found in the image.)", \
4589 char ***reply,
int *line_count,
int flag);
4619 uint32_t
iso_crc32_gpt(
unsigned char *data,
int count,
int flag);
4737 char *kernel_32,
char *kernel_64,
char *ramdisk,
4761 char **kernel_32,
char **kernel_64,
char **ramdisk);
5282 const char *name,
IsoNode **node,
int flag);
5983 const char *name,
const char *dest,
6060 const char *name, mode_t mode,
6326 const char *path,
IsoNode **node);
6365 const char *name,
const char *path,
6366 off_t offset, off_t size,
6423 char *new_name,
IsoNode **new_node,
int flag);