| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
The preprocessor doesn't evaluate the enum, so it ends up being 0, which
causes problems for library users like pyparted which try to use the _LAST
value to conditionally include support for newer flags.
Instead just define the int that is the first and last entry in each enum.
Thanks to adamw and dcantrell for help arriving at a solution.
|
|
|
|
|
|
|
|
| |
Support the swap flag and fix reading flags from disk. Also
cleanup code by dropping the 2 flags "raid" and "lvm" from
DasdPartitionData and instead use "system" directly.
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Include the partition type-id and type-uuid in the JSON
output. Also add the the command 'type' to set them. Remove
redundant flags from DosPartitionData and use only the system
variable.
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
| |
By running make update-copyright
|
|
|
|
|
|
|
| |
This sets the partition GUID to the linux home type:
933AC7E1-2EB4-4F13-B844-0E14E2AEF915
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adding enums together doesn't create a new enum value, so when compiling
with warnings you will get warnings like:
warning: case value ‘96’ not in enumerated type
for PED_EXCEPTION_IGNORE_CANCEL
This moved the defines into the enum as new values so that they are
recognized as valid members of the enum with the values staying the
same.
NOTE: PED_EXCEPTION_OPTION_LAST *MUST* be the last of the individual
options, not the combined options.
Thanks to D. Hugh Redelmeier for this patch.
|
|
|
|
|
|
|
|
| |
gnulib redefines free using #define, causing problems with the
pt-common.h file. Work around that by including standard header files as
suggested by gnulib maintainer:
https://lists.gnu.org/archive/html/bug-gnulib/2021-01/msg00315.html
|
|
|
|
| |
By running make update-copyright
|
|
|
|
| |
By running make update-copyright
|
|
|
|
|
|
| |
This sets the partition GUID to bc13c2ff-59e6-4262-a352-b275fd6f7172 to
indicate that the partition is a Boot Loader Specification compatible
/boot partition.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds a GPT-only partition type flag, chromeos_kernel, for use on
Chrome OS machines, with GUID FE3A2A5D-4F32-41A7-B725-ACCC3285A309.
The firmware/bootloader in these machines relies on special images being
written to partitions of this type. Among multiple such partitions, it
decides which one it will boot from based on the GUID-specific partition
attributes. This patch is not intended to and does not manipulate these
bits.
Google refers to these partitions as "ChromeOS kernel" partitions. They
also define partitions for rootfs, firmware, and a reserved one; but
these are not necessary for the boot flow and are not included here.
Relevant ChromiumOS documentation:
https://www.chromium.org/chromium-os/chromiumos-design-docs/disk-format
Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
|
|
|
|
| |
By running make update-copyright
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GCC 8 fails to compile libparted/unit.c with an error:
CC unit.lo
unit.c:155:1: error: function might be candidate for attribute 'const' [-Werror=suggest-attribute=const]
ped_unit_get_name (PedUnit unit)
^~~~~~~~~~~~~~~~~
CC disk.lo
cc1: all warnings being treated as errors
Const attribute is required for the function ped_unit_get_name() because
its return value is not affected by program status. To avoid the build
failure, change attribute of the function from pure to const.
Signed-off-by: Shin'ichiro Kawasaki <kawasaki@juno.dti.ne.jp>
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
| |
Caught by make syntax-check
|
|
|
|
|
|
|
|
|
|
|
| |
The const and pure attributes conflict:
error: ignoring attribute 'const' because it conflicts with attribute 'pure' [-Werror=attributes]
pure functions may access global memory, const functions may not.
ped_unit_get_name() accesses non-local variable unit_names, so drop const.
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Recognize NVDIMM devices, so that "parted -s /dev/pmem7 p" now
prints "Model: NVDIMM Device (pmem)" instead of
"Model: Unknown (unknown)".
In order for a device to be recognized as NVDIMM, it has to
have a 'blkext' major number. But since this major can be
used also by other device types, we also check that the device
path contains 'pmem' as a substring.
* NEWS: Mention the change
* include/parted/device.h.in(PedDeviceType): Add PED_DEVICE_PMEM
* libparted/arch/linux.c(_device_probe_type): Recognize NVDIMM devices.
* libparted/arch/linux.c(linux_new): Handle NVDIMM devices.
* parted/parted.c(do_print): Add "pmem" to list of transports.
Signed-off-by: Sebastian Parschauer <sparschauer@suse.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Recognize RAM drives, so "parted -s /dev/ram0 p" now prints
"RAM Drive (brd)" instead of "Model: Unknown (unknown)".
In order for a device to be recognized as RAM drive, it has to
have major number 1. Also the BLKFLSBUF ioctl shouldn't be used
on RAM drives as it is used to zero the device.
* NEWS: Mention the change
* include/parted/device.h.in(PedDeviceType): Add PED_DEVICE_RAM.
* libparted/arch/linux.c(RAM_MAJOR): New define.
* libparted/arch/linux.c(_device_probe_type): Recognize RAM drives.
* libparted/arch/linux.c(linux_new): Handle RAM drives.
* libparted/arch/linux.c(_flush_cache): Skip RAM drives.
* parted/parted.c(do_print): Add "brd" to list of transports.
Signed-off-by: Sebastian Parschauer <sparschauer@suse.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Introduce a set of new functions from the fdasd utility of the s390-tools
to keep the code base in parted and s390-tools in sync.
These new functions are:
fdasd_check_volser(): validate the volser input
fdasd_get_volser(): get volume serial (volser)
fdasd_change_volser(): change volser with string
fdasd_reuse_vtoc(): re-create vtoc labels based on the existing vtoc
Signed-off-by: Wang Dong <dongdwdw@linux.vnet.ibm.com>
Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Update the fdasd_anchor_t data structure and the fdasd_cleanup()
function. Also correct vtoc_changed and vlabel_changed accounting
because they are important to rewrite vtoc to save the changes.
Wang Dong <dongdwdw@linux.vnet.ibm.com>
Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Merge volume label cdl and ldl. It is convenient to manipulate
the same structure. Also remove unused arguments in the functions.
Signed-off-by: Wang Dong <dongdwdw@linux.vnet.ibm.com>
Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Recognize NVMe Devices, so "parted -s /dev/nvme0n1" now prints
"NVMe Device (nvme)" instead of "Model: Unknown (unknown)".
In order for a device to be recognized as NVMe, it has to
have a 'blkext' major number. But since this major can be
used also by other device types, we also check the device
path contains 'nvme' as a substring.
* NEWS: Mention the change
* include/parted/device.h.in(PedDeviceType): Add PED_DEVICE_NVME
* libparted/arch/linux.c(BLKEXT_MAJOR): New define.
* libparted/arch/linux.c(_is_blkext_major): New function.
* libparted/arch/linux.c(_device_probe_type): Recognize NVMe devices.
* libparted/arch/linux.c(linux_new): Handle NVMe devices.
* parted/parted.c(do_print): Add "nvme" to list of transports.
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove the necessity for DASD-specific ioctls for partition handling.
This allows to correctly handle DASD-backed virtio block devices.
Note that this is necessary because virtio is just the transport.
A DASD, even if provided via virtio, still has it's unique
characteristics, which means that only traditional DASD partition
table formats can be used (no MBR, GPT, or similar).
Use bzero for initialization to make sure all struct members are
properly cleared. Also changed partition list handling code to be
more similar to upstream s390-tools fdasd.
Further, enhanced error handling capabilities by providing a
return code by fdasd_get_geometry.
Code is largely backported from s390-tools project.
Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
Acked-by: Stefan Haberland <stefan.haberland@de.ibm.com>
Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
| |
|
|
|
|
|
|
|
| |
This patch avoids setting 'dasd' as a default disk type for
'disk image file' at the time of probe.
Signed-off-by: Nageswara R Sastry <rnsastry@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
| |
Extended Address Volume (EAV) DASDs are ECKD DASDs with more than
65520 cylinders. This patch adds support for mklabel to properly
handle unformatted EAV DASDs.
Signed-off-by: Nageswara R Sastry <rnsastry@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Extended Address Volume (EAV) DASDs are ECKD DASDs with more than
65520 cylinders. This patch adds support for recognizing and
modifying partitions on EAV DASDs to Parted. The changes are
based on the EAV support added to version 1.8.1 [1] of the
s390-tools package.
[1] http://www.ibm.com/developerworks/linux/linux390/s390-tools-1.8.1.html
Signed-off-by: Nageswara R Sastry <rnsastry@linux.vnet.ibm.com>
Signed-off-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixed Block Access (FBA) DASDs are mainframe-specific disk devices
which are layed out as a sequence of 512-byte sectors. In contrast
to ECKD DASDs, these disks do not require formatting and resemble
the LBA layout of non-mainframe disks. Despite this resemblance,
the Linux kernel applies special handling during partition detection
for FBA DASDs, resulting in a single, immutable partition being
reported.
While actual FBA DASD hardware is no longer available, the z/VM
hypervisor can simulate FBA DASD disks, backed by either ECKD or
SCSI devices.
This patch adds support for recognizing FBA DASD partitions
to parted.
Signed-off-by: Nageswara R Sastry <rnsastry@linux.vnet.ibm.com>
Signed-off-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
|
|
|
|
|
|
| |
Enable probing for filesystems with non 512 byte sectors, and fix up each
filesystem to correctly handle that. Remove unused field from the fs type
structure listing acceptable sector sizes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds support for the ESP partition type on MS-DOS. It also aliases
it to the boot flag on GPT which sets the ESP GUID type.
* NEWS (New Features): Mention it.
* doc/C/parted.8: Document esp flag.
* doc/parted.texti: Document esp flag.
* include/parted/disk.in.h (_PedPartitionFlag): Add PED_PARTITION_ESP flag
* libparted/disk.c (ped_partition_flag_get_name): Add esp flag
* libparted/labels/dos.c (DosPartitionData): Likewise
(raw_part_parse): Likewise
(msdos_partition_new): Likewise
(msdos_partition_duplicate): Likewise
(msdos_partition_set_system): Likewise
(clear_flags): Likewise
(msdos_partition_set_flag): Likewise
(msdos_partition_get_flag): Likewise
(msdos_partition_is_flag_available): Likewise
* libparted/labels/gpt.c (gpt_partition_set_flag): Add PED_PARTITION_ESP
(gpt_partition_get_flag): Likewise
(gpt_partition_is_flag_available): Likewise
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds support for the irst partition type flag. Sets the type to
0x84 on MS-DOS and D3BFE2DE-3DAF-11DF-BA-40-E3A556D89593 on GPT.
* NEWS (New Features): Mention it.
* doc/C/parted.8: Document irst flag.
* doc/parted.texti: Document irst flag.
* include/parted/disk.in.h (_PedPartitionFlag): Add PED_PARTITION_IRST flag
* libparted/disk.c (ped_partition_flag_get_name): Add irst flag
* libparted/labels/dos.c (DosPartitionData): Likewise
(raw_part_parse): Likewise
(msdos_partition_new): Likewise
(msdos_partition_duplicate): Likewise
(msdos_partition_set_system): Likewise
(clear_flags): Likewise
(msdos_partition_set_flag): Likewise
(msdos_partition_get_flag): Likewise
(msdos_partition_is_flag_available): Likewise
* libparted/labels/gpt.c: Add PARTITION_IRST_GUID
(GPTPartitionData): Add irst flag
(_parse_part_entry): Likewise
(gpt_partition_new): Likewise
(gpt_partition_set_system): Likewise
(gpt_partition_set_flag): Likewise
(gpt_partition_get_flag): Likewise
(gpt_partition_is_flag_available): Likewise
|
|
|
|
| |
Run "make update-copyright".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* NEWS: Describe the new Linux-specific partition type code
and the new msftres flag that can be used to override this type
code, should it be necessary.
* doc/parted.texi: Describe of the new msftres flag.
* include/parted/disk.in.h [_PedPartitionFlag]: Add
PED_PARTITION_MSFT_DATA.
* libparted/disk.c: Add check for PED_PARTITION_MSFT_DATA, with
return of "msftdata", to ped_partition_flag_get_name()
* libparted/labels/gpt.c (PARTITION_LINUX_DATA_GUID): Define.
[_GPTPartitionData]: New member, "int msftdata".
(_parse_part_entry): Set the msftdata flag if and only if the
PARTITION_BASIC_DATA_GUID type code is in use;
(gpt_partition_new): Use the PARTITION_LINUX_DATA_GUID
type as the default type code
(gpt_partition_set_system): Set the PARTITION_BASIC_DATA_GUID type
code on partitions on which the msftdata flag is set and set
PARTITION_LINUX_DATA_GUID as the type by default.
Clear the msftdata flag in most tests in gpt_partition_set_flag()
(gpt_partition_set_flag): Add test for PED_PARTITION_MSFT_DATA, which
sets msftdata and other flags appropriately
(gpt_partition_get_flag): Add test for the PED_PARTITION_MSFT_DATA
item that returns the status of the msftdata flag
(gpt_partition_is_flag_available): Add test for
PED_PARTITION_MSFT_DATA item to
* tests/t0220-gpt-msftres.sh: Accommodate the fact that now,
partition table listings include "msftdata" for file systems
of type NTFS and FAT*.
For more discussion and justification, see
http://thread.gmane.org/gmane.comp.gnu.parted.bugs/10456
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
That is acceptable, because the GNU parted build system already
requires GNU make anyway: the $(subst ...) built-in is used in the
common recipe for the 'ss-1024', 'ss-2048' and 'ss-4096' targets
in Makefile.am.
* include/parted/Makefile.am (.in.h.h): Rename ...
(%.h: %.in.h): ... as this pattern rule.
(SUFFIXES): Delete, no more needed.
Copyright-paperwork-exempt: yes
|
|
|
|
|
| |
This just adds the code, without hooking it up yet.
* po/POTFILES.in: Add all libparted/fs/r/**.c files.
|
|
|
|
|
| |
* include/parted/parted.in.h (ped_realloc): Remove declaration.
* libparted/libparted.c (ped_realloc): Remove definition.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some BIOS systems will only boot from GPT partitions if the boot flag is
set on the protective MBR partition. This adds the ability to set this
flag using the disk_set and disk_toggle commands.
* include/parted/disk.in.h (_PedDiskFlag): Add PED_DISK_GPT_PMBR_BOOT
* libparted/disk.c (ped_disk_flag_get_name): Add PED_DISK_GPT_PMBR_BOOT
* libparted/labels/gpt.c (_GPTDiskData): Add pmbr_boot flag.
(gpt_alloc): Init pmbr_boot to 0.
(gpt_read_headers): Set pmbr_boot state from PMBR boot flag.
(_write_pmbr): Add pmbr_boot flag and set PMBR boot flag from it.
(gpt_write): Pass pmbr_boot flag through to _write_pmbr
(gpt_disk_set_flag): New function
(gpt_disk_is_flag_available): New function
(gpt_disk_get_flag): New function
(gpt_disk_ops): Add disk_set_flag, disk_get_flag, disk_is_flag_available
* parted/parted.c (do_disk_set): New function
(do_disk_toggle): New function
(_init_commands): Add do_disk_set and do_disk_toggle
* parted/ui.c (command_line_get_disk_flag): New function
* parted/ui.h: Add command_line_get_disk_flag prototype.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* debug/Makefile.am: As above.
* debug/test/Makefile.am: Likewise.
* doc/C/Makefile.am: Likewise.
* doc/pt_BR/Makefile.am: Likewise.
* include/Makefile.am: Likewise.
* include/parted/Makefile.am: Likewise.
* libparted/Makefile.am: Likewise.
* libparted/fs/Makefile.am: Likewise.
* libparted/tests/Makefile.am: Likewise.
* partprobe/Makefile.am: Likewise.
* doc/Makefile.am: Likewise, for mdate-sh and texinfo.tex.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Generate .h files from .in.h files, so that we can continue
to use _GL_ATTRIBUTE_PURE and _GL_ATTRIBUTE_CONST in the primary
sources, without including them in publicly-installed files.
Each generated (and later installed) header file gets expansions
of those macros.
* include/parted/Makefile.am: New rules.
* .gitignore: Ignore the generated files.
* Makefile.am (SUBDIRS): Reorder so we build in include/ before
libparted, i.e., so that we generate the .h files we'll need.
|
|
|
|
|
|
| |
However, we will replace those strings with their expansions when
installing them.
* include/parted/parted.h: Revert part of commit v3.0-83-gd51bfc0.
|
|
|
|
|
|
|
| |
Instead, use the bare __attribute__((__const__)).
* include/parted/parted.h (__attribute): Define.
(ped_get_version): Use open-coded __attribute.
Prompted by a report from Keshav P R.
|
|
|
|
| |
Run "make update-copyright".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use _GL_ATTRIBUTE_PURE or _GL_ATTRIBUTE_CONST. Mark static functions at
point of definition; extern ones at point of declaration.
* include/parted/crc32.h:
* include/parted/device.h: Likewise.
* include/parted/disk.h: Likewise.
* include/parted/exception.h: Likewise.
* include/parted/filesys.h: Likewise.
* include/parted/geom.h: Likewise.
* include/parted/natmath.h: Likewise.
* include/parted/parted.h: Likewise.
* include/parted/unit.h: Likewise.
* libparted/arch/linux.c: Likewise.
* libparted/disk.c: Likewise.
* libparted/exception.c: Likewise.
* libparted/fs/amiga/amiga.h: Likewise.
* libparted/labels/aix.c: Likewise.
* libparted/labels/bsd.c: Likewise.
* libparted/labels/dos.c: Likewise.
* libparted/labels/dvh.c: Likewise.
* libparted/labels/efi_crc32.c: Likewise.
* libparted/labels/gpt.c: Likewise.
* libparted/labels/mac.c: Likewise.
* libparted/labels/pc98.c: Likewise.
* libparted/labels/rdb.c: Likewise.
* libparted/labels/sun.c: Likewise.
* libparted/unit.c: Likewise.
* parted/ui.c: Likewise.
* parted/strlist.c: Likewise.
* parted/strlist.h: Likewise.
* libparted/tests/common.h (_implemented_disk_label): Mark as pure.
* libparted/cs/natmath.c (extended_euclid): Mark as pure.
|
|
|
|
|
|
|
| |
PedDeviceType was marked as deprecated before parted started using
git. Since it proved to be useful to differentiate between different
device types, and nobody seems interested in removing it from the API,
let's clear the deprecated flag.
|
|
|
|
|
|
|
|
| |
Stop using PED_DEVICE_FILE for loopback devices;
loopback are significantly different from plain files.
* include/parted/device.h (PedDeviceType): Add PED_DEVICE_LOOP.
* libparted/arch/linux.c (_device_probe_type): Detect loopback device.
* parted/parted.c (do_print): Add "loopback" to list of transports.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Note that we are removing the resize command, even though parted
appears to be the only free tool that provides the ability to
resize FAT16 and FAT32 file systems.
* parted/parted.c (do_mkfs, do_cp, do_mkpartfs): Remove functions.
(do_move, do_check, do_resize): Likewise.
(_init_commands): Remove each command-definition clause.
* parted/parted.c (_partition_warn_loss): Remove now-unused function.
* include/parted/filesys.h: Remove declarations of now-removed
FS-munging functions
|
|
|
|
|
|
| |
The action argument was a leftover from when the PED_ASSERT macro was
last changed. This removes that argument from the macro and from all
occurrences of it.
|
|
|
|
|
| |
* include/Makefile.am: Add newline at end of file.
* libparted/fs/jfs/Makefile.am: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add support for the Legacy BIOS Bootable flag in the GPT
Attribute field. This is used by software like syslinux to
determine which partition to boot when in BIOS mode.
See Page 105, Table 19 Bit 2 of the UEFI Spec 2.3 book.
* doc/C/parted.8: Document legacy_boot.
* doc/parted.texi: Document legacy_boot.
* include/parted/disk.h: Add PED_PARTITION_LEGACY_BOOT flag.
* libparted/disk.c (ped_partition_flag_get_name): Add legacy_boot flag.
* libparted/labels/gpt.c (_parse_part_entry):
(_partition_generate_part_entry, gpt_partition_new):
(gpt_partition_set_flag, gpt_partition_get_flag):
(gpt_partition_is_flag_available): Add legacy_boot flag support.
|