From 2049dfc996352d4800b61e6ff13825bb43479412 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Mon, 16 Dec 2024 18:16:17 +0100 Subject: [PATCH] New API calls isoburn_igopt_set_gpt_with_gaps() and isoburn_igopt_get_gpt_with_gaps() --- libisoburn/isoburn.c | 29 +++++++++++++++++++ libisoburn/isoburn.h | 3 ++ libisoburn/libisoburn.h | 55 +++++++++++++++++++++++++++++++++++++ libisoburn/libisoburn.ver | 2 ++ xorriso/xorriso_timestamp.h | 2 +- 5 files changed, 90 insertions(+), 1 deletion(-) diff --git a/libisoburn/isoburn.c b/libisoburn/isoburn.c index f7f06414..d087c4ce 100644 --- a/libisoburn/isoburn.c +++ b/libisoburn/isoburn.c @@ -572,6 +572,9 @@ int isoburn_make_iso_write_opts(struct isoburn *out_o, iso_write_opts_set_iso_mbr_part_type(wopts, opts->iso_mbr_part_type); iso_write_opts_set_iso_type_guid(wopts, opts->iso_gpt_type_guid, opts->iso_gpt_flag & 1); + iso_write_opts_set_gpt_with_gaps(wopts, !!(opts->iso_gpt_flag & 2), + !!(opts->iso_gpt_flag & 4), + !!(opts->iso_gpt_flag & 8)); iso_write_opts_set_disc_label(wopts, opts->ascii_disc_label); ret= 1; @@ -1890,6 +1893,7 @@ int isoburn_igopt_set_part_type_guid(struct isoburn_imgen_opts *opts, return(1); } + int isoburn_igopt_get_part_type_guid(struct isoburn_imgen_opts *opts, int num_entries, uint8_t guids[][16], int valids[]) @@ -1910,6 +1914,31 @@ int isoburn_igopt_get_part_type_guid(struct isoburn_imgen_opts *opts, return(max_entry); } + +int isoburn_igopt_set_gpt_with_gaps(struct isoburn_imgen_opts *opts, + int with_gaps, int with_gaps_no_sort, + int with_gaps_no_iso) +{ + opts->iso_gpt_flag &= ~(2 | 4 | 8); + opts->iso_gpt_flag |= (!!with_gaps) << 1; + opts->iso_gpt_flag |= (!!with_gaps_no_sort) << 2; + opts->iso_gpt_flag |= (!!with_gaps_no_iso) << 3; + return(1); +} + + +int isoburn_igopt_get_gpt_with_gaps(struct isoburn_imgen_opts *opts, + int *with_gaps, int *with_gaps_no_sort, + int *with_gaps_no_iso) +{ + *with_gaps= !!(opts->iso_gpt_flag & 2); + *with_gaps_no_sort= !!(opts->iso_gpt_flag & 4); + *with_gaps_no_iso= !!(opts->iso_gpt_flag & 8); + return(1); +} + + + int isoburn_igopt_set_appended_as_apm(struct isoburn_imgen_opts *opts, int apm) { opts->appended_as_apm= !!apm; diff --git a/libisoburn/isoburn.h b/libisoburn/isoburn.h index d32e66ce..eac10d02 100644 --- a/libisoburn/isoburn.h +++ b/libisoburn/isoburn.h @@ -746,6 +746,9 @@ struct isoburn_imgen_opts { */ uint8_t iso_gpt_type_guid[16]; /* bit0= iso_gpt_type_guid is valid + bit1= gaps in the image coverage are allowed + bit2= with bit1: do not sort GPT partition array by start block + bit3= with bit1: do not create partition 1 for ISO filesystem */ int iso_gpt_flag; diff --git a/libisoburn/libisoburn.h b/libisoburn/libisoburn.h index 6d90e43e..5dd59ea0 100644 --- a/libisoburn/libisoburn.h +++ b/libisoburn/libisoburn.h @@ -2142,6 +2142,61 @@ int isoburn_igopt_get_part_type_guid(struct isoburn_imgen_opts *opts, int num_entries, uint8_t guids[][16], int valids[]); +/** Control whether the GPT partition table is allowed to leave some parts of + the emerging ISO image uncovered, whether the partition entries in the + GPT get sorted by their start block addresses, and whether partition 1 + gets created to represent the ISO 9660 filesystem. + Default is that the partition entries get sorted and all gaps get filled + by additional GPT partition entries. Partition 1 is by default created for + the ISO filesystem if partition offset is 16, no partition 1 was created for + other reasons, and no other partition overlaps with the range from LBA 16 to + the end of the ISO 9660 filesystem. + Note that GPT for ISOLINUX isohybrid does not get gaps filled, anyways. + @since 1.5.8 + @param opts + The option set to be inquired. + @param with_gaps + If 0, fill gaps. + If 1, do not fill gaps. + @param with_gaps_no_sort + In case that with_gaps is 1: + If 0, sort partitions by start block addresses. + If 1, do not sort partitions. + @param with_gaps_no_iso + In case that with_gaps is 1: + If 0, create partition 1 for the ISO filesystem if possible. + If 1, do not create partition for the ISO filesystem if not already + created for other reasons. + @return + <=0 = error, 1 = success + */ +int isoburn_igopt_set_gpt_with_gaps(struct isoburn_imgen_opts *opts, + int with_gaps, int with_gaps_no_sort, + int with_gaps_no_iso); + +/** Inquire the current settings made by isoburn_igopts_set_gpt_with_gaps(). + @since 1.5.8 + @param opts + The option set to be manipulated. + @param with_gaps + If 0, fill gaps. + If 1, do not fill gaps. + @param with_gaps_no_sort + In case that with_gaps is 1: + If 0, sort partitions by start block addresses. + If 1, do not sort partitions. + @param with_gaps_no_iso + In case that with_gaps is 1: + If 0, create partition 1 for the ISO filesystem if possible. + If 1, do not create partition for the ISO filesystem if not already + created for other reasons. + @return + <=0 = error, 1 = success + */ +int isoburn_igopt_get_gpt_with_gaps(struct isoburn_imgen_opts *opts, + int *with_gaps, int *with_gaps_no_sort, + int *with_gaps_no_iso); + /** Control whether partitions created by iso_write_opts_set_partition_img() are to be represented in Apple Partition Map. @since 1.4.4 diff --git a/libisoburn/libisoburn.ver b/libisoburn/libisoburn.ver index eb724979..9892edc8 100644 --- a/libisoburn/libisoburn.ver +++ b/libisoburn/libisoburn.ver @@ -372,6 +372,8 @@ isoburn_get_attached_start_lba_v2; isoburn_get_mount_params_v2; isoburn_igopt_get_data_start_v2; isoburn_igopt_get_effective_lba_v2; +isoburn_igopt_get_gpt_with_gaps; +isoburn_igopt_set_gpt_with_gaps; isoburn_prepare_blind_grow_v2; isoburn_read_iso_head_v2; isoburn_toc_disc_get_sectors_v2; diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index a9c8d425..872a61df 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2024.11.03.191323" +#define Xorriso_timestamP "2024.12.16.171512"