| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
| |
This adds a basic support for the Flash-Friendly File System. So
we can manipulate the file system by using the PedFileSystem API and we
can do basic device probing for autodetecting the current fs.
Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
|
|
|
| |
Removed a reference to the removed function ped_file_system_create in
the docs for ped_file_system_clobber.
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
|
|
| |
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 type is used by the Boot Loader Specification to identify a
compatible /boot 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>
|
|
|
|
|
|
|
|
|
|
|
| |
DASDs attached to KVM guest as virtio-blk devices are only handled
properly, if the unique DASD geometry is detected. Commit id
61dd3d4c5eb782eb43caa95342e63727db3f8281 has prevented proper geometry
detection. Fixed by making sure that HDIO_GETGEO takes precedence
on s390[x].
Signed-off-by: Viktor Mihajlovski <mihajlov@linux.ibm.com>
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
| |
By running make update-copyright
|
| |
|
|
|
|
|
|
|
| |
I flubbed this in e35af6cbc43f5b279e6f0d65ccc904b1ac6c63d2 by trying to
switch to using a pointer and ended up writing off the end. Switch the
loop in alpha_bootblock_checksum back to use [i] index. It's easier
to read anyway.
|
|
|
|
|
|
| |
Constructing a pointer into a char array results in warnings about casting
changing alignment. This changes how the boot sector is handled by adding the
label to BSDDiskData with the correct offset (64 bytes).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GCC 9 fails to compile a few C source files which call abs() function.
An example of the error messages was as follows:
CC dos.lo
dos.c: In function '_best_solution':
dos.c:1773:13: error: absolute value function 'abs' given an argument of type 'long long int' but has parameter of type 'int' which may cause truncation of value [-Werror=absolute-value]
1773 | a_delta = abs (part->geom.start - a->start);
| ^~~
dos.c:1774:13: error: absolute value function 'abs' given an argument of type 'long long int' but has parameter of type 'int' which may cause truncation of value [-Werror=absolute-value]
1774 | b_delta = abs (part->geom.start - b->start);
| ^~~
cc1: all warnings being treated as errors
To avoid the errors, replace abs() function calls with llabs().
Signed-off-by: Shin'ichiro Kawasaki <kawasaki@juno.dti.ne.jp>
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
| |
|
|
|
|
|
| |
This confuses gcc, making it think the uuid_t is unaligned when it really comes
from a efi_guid_t entry in _GPTDiskData.
|
| |
|
|
|
|
|
| |
The strings are short, so using memcpy isn't much slower (if at all). This
fixes gcc complaining about strncpy possibly copying a non-terminated string.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GCC 8 fails to compile libparted/labels/pt-tools.c with an error:
CC pt-tools.lo
In file included from pt-tools.c:114:
pt-tools.c: In function 'pt_limit_lookup':
pt-limit.gperf:78:1: error: function might be candidate for attribute 'pure' [-Werror=suggest-attribute=pure]
cc1: all warnings being treated as errors
"Pure" attribute is required for the function pt_limit_lookup() because
it does not change program status other than its return value.
To avoid the build failure, add _GL_ATTRIBUTE_PURE to the function.
The attribute cannot be added in libparted/gperf/pt-limit.c because it
is generated by gperf during the build process. Instead, add the
attribute in libparted/gperf/pt-tools.c which includes the generated
function.
Signed-off-by: Shin'ichiro Kawasaki <kawasaki@juno.dti.ne.jp>
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
| |
|
|
|
|
|
|
| |
The casts to uint16_t need to know that this will be aligned. The struct is
actually 512 bytes, so it normally does end up aligned. This just makes sure
the compiler knows it and stops warning about the casts.
|
|
|
|
| |
Caught by make syntax-check
|
|
|
|
| |
Caught by make syntax-check
|
|
|
|
| |
Caught by make syntax-check
|
|
|
|
|
|
| |
You have to add 1 *before* doing the endian conversion, not after.
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, the affs code in libparted prints a debug line to stdout when
an Amiga FFS partition is probed. This confuses tools that parse stdout.
A prominent example is the partitioner (partman) in Debian's installer,
which parses stdout from a tool (parted_devices) that uses libparted to
scan the system's block devices. As of now, Debian cannot be installed
on a typical Amiga:
https://lists.debian.org/debian-68k/2019/07/msg00015.html
This patch removes this unexpected printf().
Cc: glaubitz@debian.org
Signed-off-by: Max Staudt <max@enpas.org>
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. is_valid_nilfs_sb: make sure the subtraction bytes - sumoff - 4
won't give a negative number. That as the len argument to
__efi_crc32() would give a very large number for the latter's for
loop limit, since len is unsigned long.
2. nilfs2_probe: Read and allocate enough sectors to hold a
struct nilfs2_super_block. is_valid_nilfs_sb() will be passing
up to 1024 bytes to __efi_crc32(). If only one 512 byte sector
had been allocated with alloca and read from disk that would cause
reads off the the end of the stack even if bytes were more than
sumoff - 4.
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Windows 10 uses a recovery partition which is sometimes marked with
partition type 0x27 on MBR systems. It wasn't possible to handle such
a partition with parted. Therefore the partition type PARTITION_MSFT_RECOVERY
is now used properly also on MBR when the flag msftres is set.
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
parted currently shows the same generic model name for all NVMe devices:
# parted /dev/nvme0n1 -s print | grep Model
Model: NVMe Device (nvme)
If the model information is available in sysfs, display that instead:
# parted /dev/nvme0n1 -s print | grep Model
Model: THNSN5512GPU7 NVMe TOSHIBA 512GB (nvme)
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
|
|
|
| |
All of these locations appear to have intentional fallthroughs. Add
comments that GCC will detect to mute warnings w/ -Wimplicit-fallthrough.
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is needed for libparted based applications (like Gparted) to correctly
choose MBR id and GPT GUID for UDF filesystem. MBR id for UDF is 0x07 and
GPT GUID is Microsoft Basic Data, see why: https://serverfault.com/a/829172
Without registering a new libparted fs code it is not possible to assign
MBR id or GPT GUID.
Detection of UDF filesystem is done by checking presence of UDF VSD (NSR02
or NSR03 identifier) and UDF AVDP at expected locations (blocks 256, -257,
-1, 512).
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
|
|
|
|
|
| |
These need to be 1 less than the allocated size of the buffer, strncpy
will fill shorter strings with zeros, but there needs to be room for at
least one 0x00 at the end if the string is the same length as the buffer
and has no terminating 0x00.
Related: rhbz#1602652
|
|
|
|
|
|
|
| |
According to the UEFI specification version 2.7, Section 5.2.3,
Table 16, the ending CHS address in the protective MBR should be set
to 0xFFFFFF. This also agrees with the behaviour of fdisk from
util-linux-2.32.
|
|
|
|
|
| |
The atari label gets false positives easily, so probe it after
all other labels have said no.
|
|
|
|
|
|
| |
As Colin Watson pointed out way back in 2014, when I removed the
512 byte sector size restriction from the fs recognition code,
I missed the same from the fat resize code.
|
|
|
|
|
|
|
|
|
| |
Now that file system operations have been removed from libparted,
libreiserfs is no longer used. Remove references to it, along with the
dynamic loading build infrastructure which was only used for
libreiserfs.
Signed-off-by: Colin Watson <cjwatson@ubuntu.com>
|
|
|
|
|
|
|
|
|
|
| |
Make check failed due to some warnings treated as errors. One was
caused by a warning that a function could have the noreturn attribute.
It seems that this had previously been disabled but gcc has changed
the flag from -Wmissing-noreturn to -Wsuggest-attribute=noreturn. The
recently added volser.c test also caused a few warnings when not
compiled on s390x because most of the functions were no used, so #if
those out as well.
|
|
|
|
| |
Since glibc 2.27 this header is required.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
gpt.c uses iconv so it should link with it. Otherwise, on platforms
where libiconv is a separate library, we get a link failure of parted:
CCLD parted
../libparted/.libs/libparted.so: undefined reference to `libiconv'
../libparted/.libs/libparted.so: undefined reference to `libiconv_open'
../libparted/.libs/libparted.so: undefined reference to `libiconv_close'
Since iconv functionality is needed unconditionally (not only when
gettext is enabled), AM_ICONV needs to be added to configure.ac.
|
|
|
|
| |
glibc no longer includes this header. locale.h should work just fine.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The function is setting udev cookies, but not using them when waiting
for the task. This results in leaked cookies, which can eventually
exhaust the available number of semaphores.
'dmsetup udevcookies' will show a cookie remaining afterwards, and 'ipcs -s'
will show the semaphores in use.
Also simplified the exit so that the task is always destroyed and memory
is all freed in the same path.
Resolves: rhbz#1455564
|
|
|
|
|
|
|
|
| |
The test case uses a temporary file in libparted/tests under
Check framwork.It can be issued by "make check" in the test dir.
Signed-off-by: Wang Dong <dongdwdw@linux.vnet.ibm.com>
Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
| |
The partition table of DASD-LDL device with the dasd disk label
should not be changed according to its character in Linux.
When the user tries to modify the partition table, an exception
will be raised to inform user of this character.
Signed-off-by: Wang Dong <dongdwdw@linux.vnet.ibm.com>
Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
| |
DASD-LDL does not support flag now, so all the flags are
unavailable to it.
Signed-off-by: Andre Wild <wild@linux.vnet.ibm.com>
Signed-off-by: Wang Dong <dongdwdw@linux.vnet.ibm.com>
Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
boot_region_length (or BootSize in the MacOS dialect) is the length
of the driver code in the driver partition. This length is used
to compute the checksum of the driver.
libparted updates this value by setting the whole size of the partition
without computing the checksum of the driver using this size.
As the checksum is wrong, the driver is broken and cannot be loaded
by the MacOS ROM, and thus the disk is not bootable anymore.
Moreover, parted try to update the driver list and makes it disappear.
As parted is not able to insert a driver in a partition,
the driver is generally inserted by the Apple HD Tool,
this patch removes the line updating the driver size.
We also simplify the driver list scan and fix endianess use.
This has been tested... and it works, now.
I have updated a bootable disk with parted on x86_64 and
then been able to boot it (again) on a Mac LC III.
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
|
| |
Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Moving get_sector_size() from disk.c to common.c allows
us to use it in _implemented_disk_label() to test for
512-byte sectors. This change is required to be able to
enable this test for atari partition tables for which
support is added in a follow-up patch.
Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
|
|
|
| |
The filesystem type is still detected as befor, but now setting the
'swap' flag will set the partition GUID to PARTITION_SWAP_GUID.
Signed-off-by: Brian C. Lane <bcl@redhat.com>
|
|
|
|
|
|
|
|
|
| |
The test case uses a temporary file in libparted/tests under
Check framwork. It can be issued by "make check" in the test dir.
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|