diff options
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | doc/C/parted.8 | 2 | ||||
-rw-r--r-- | include/parted/disk.in.h | 3 | ||||
-rw-r--r-- | libparted/disk.c | 2 | ||||
-rw-r--r-- | libparted/labels/gpt.c | 12 |
5 files changed, 17 insertions, 4 deletions
@@ -4,6 +4,8 @@ GNU parted NEWS -*- outline -*- ** New Features + Support GPT partition attribute bit 63 as no_automount flag. + Add type commands to set type-id on MS-DOS and type-uuid on GPT. * Noteworthy changes in release 3.5 (2022-04-18) [stable] diff --git a/doc/C/parted.8 b/doc/C/parted.8 index ab34be7..3069c33 100644 --- a/doc/C/parted.8 +++ b/doc/C/parted.8 @@ -120,7 +120,7 @@ or an LVM logical volume if necessary. Change the state of the \fIflag\fP on \fIpartition\fP to \fIstate\fP. Supported flags are: "boot", "root", "swap", "hidden", "raid", "lvm", "lba", "legacy_boot", "irst", "msftres", "esp", "chromeos_kernel", "bls_boot", "linux-home", -"bios_grub", and "palo". +"no_automount", "bios_grub", and "palo". \fIstate\fP should be either "on" or "off". .TP .B unit \fIunit\fP diff --git a/include/parted/disk.in.h b/include/parted/disk.in.h index f649bcc..402d78a 100644 --- a/include/parted/disk.in.h +++ b/include/parted/disk.in.h @@ -88,10 +88,11 @@ enum _PedPartitionFlag { PED_PARTITION_CHROMEOS_KERNEL=19, PED_PARTITION_BLS_BOOT=20, PED_PARTITION_LINUX_HOME=21, + PED_PARTITION_NO_AUTOMOUNT=22, }; // NOTE: DO NOT define using enums #define PED_PARTITION_FIRST_FLAG 1 // PED_PARTITION_BOOT -#define PED_PARTITION_LAST_FLAG 21 // PED_PARTITION_LINUX_HOME +#define PED_PARTITION_LAST_FLAG 22 // PED_PARTITION_NO_AUTOMOUNT enum _PedDiskTypeFeature { PED_DISK_TYPE_EXTENDED=1, /**< supports extended partitions */ diff --git a/libparted/disk.c b/libparted/disk.c index 0ed3d91..45f35fd 100644 --- a/libparted/disk.c +++ b/libparted/disk.c @@ -2579,6 +2579,8 @@ ped_partition_flag_get_name (PedPartitionFlag flag) return N_("bls_boot"); case PED_PARTITION_LINUX_HOME: return N_("linux-home"); + case PED_PARTITION_NO_AUTOMOUNT: + return N_("no_automount"); default: ped_exception_throw ( diff --git a/libparted/labels/gpt.c b/libparted/labels/gpt.c index 1993863..780fb70 100644 --- a/libparted/labels/gpt.c +++ b/libparted/labels/gpt.c @@ -252,7 +252,8 @@ struct __attribute__ ((packed)) _GuidPartitionEntryAttributes_t uint64_t NoBlockIOProtocol:1; uint64_t LegacyBIOSBootable:1; uint64_t Reserved:45; - uint64_t GuidSpecific:16; + uint64_t GuidSpecific:15; + uint64_t NoAutomount:1; #else # warning "Using crippled partition entry type" uint32_t RequiredToFunction:1; @@ -260,7 +261,8 @@ struct __attribute__ ((packed)) _GuidPartitionEntryAttributes_t uint32_t LegacyBIOSBootable:1; uint32_t Reserved:30; uint32_t LOST:5; - uint32_t GuidSpecific:16; + uint32_t GuidSpecific:15; + uint32_t NoAutomount:1; #endif }; @@ -1637,6 +1639,9 @@ gpt_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state) case PED_PARTITION_LEGACY_BOOT: gpt_part_data->attributes.LegacyBIOSBootable = state; return 1; + case PED_PARTITION_NO_AUTOMOUNT: + gpt_part_data->attributes.NoAutomount = state; + return 1; case PED_PARTITION_ROOT: case PED_PARTITION_LBA: default: @@ -1662,6 +1667,8 @@ gpt_partition_get_flag (const PedPartition *part, PedPartitionFlag flag) return gpt_part_data->attributes.RequiredToFunction; case PED_PARTITION_LEGACY_BOOT: return gpt_part_data->attributes.LegacyBIOSBootable; + case PED_PARTITION_NO_AUTOMOUNT: + return gpt_part_data->attributes.NoAutomount; case PED_PARTITION_LBA: case PED_PARTITION_ROOT: default: @@ -1681,6 +1688,7 @@ gpt_partition_is_flag_available (const PedPartition *part, { case PED_PARTITION_HIDDEN: case PED_PARTITION_LEGACY_BOOT: + case PED_PARTITION_NO_AUTOMOUNT: return 1; case PED_PARTITION_ROOT: case PED_PARTITION_LBA: |