| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
To make sure that older scripts trying to use the resize command do not
accidentally run the new resizepart command by mistake, this undocumented
stub command will throw an error if called.
|
|
|
|
|
|
| |
Have command_print_summary print nothing if the command summary is NULL.
This allows for a command to be registered, but not documented in the
output of help.
|
|
|
|
|
|
| |
This function was throwing a PED_EXCEPTION_ERROR with only the
PED_EXCEPTION_CANCEL option. Converted to a PED_EXCEPTION_WARNING
with the option to continue anyhow.
|
|
|
|
|
| |
Add resizepart command to resize ( change the end position ) an existing
partition. Note that it does nothing to a filesystem in the partition.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
gpt was using a static local variable to suppress repeatedly reporting
an error if you chose to ignore it. This is incorrect as the variable is
global to all disks, and ignoring the error on one should not suppress its
reporting on another. Moving the flag to the PedDisk object made it
effectively useless because parted was destroying the PedDisk and reloading
the partition table on every command.
Parted has been reworked to cache the PedDisk once loaded, and only discard
it when changing disks, or creating a new disklabel.
|
|
|
|
|
|
|
|
|
|
| |
The CPPFunction typedef (among others) have been deprecated in favour of
specific prototyped typedefs since readline 4.2 (circa 2001).
It's been working since because compatibility typedefs have been in
place until they where removed in the recent readline 6.3 release.
Switch to the new style to avoid build breakage.
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
|
|
|
|
| |
Fix the help text to show *disk* flags instead of partition flags.
|
|
|
|
|
|
|
| |
feof() seems to not detect EOF after readline() hits it, so parted went
into an infinite loop prompting for input on EOF. Change test to use the
got_ctrl_c variable instead, which is set when readline hits EOF and
returns NULL. This also makes parted properly exit on ctrl-c.
|
|
|
|
| |
Run "make update-copyright".
|
|
|
|
|
| |
* parted/strlist.c (gettext_to_wchar): Tighten up test for
mbsrtowcs failure and remove unnecessary wcslen use.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The latter is obsolete, and might be removed in future Automake versions.
Moreover, it's already been removed in Automake-NG, so its use would make
a port to Automake-NG more difficult.
* parted/Makefile.am (INCLUDES): Rename ...
(AM_CPPFLAGS): ... like this.
* partprobe/Makefile.am: Likewise.
* libparted/fs/Makefile.am: Likewise.
* libparted/Makefile.am: Likewise.
* libparted/labels/Makefile.am: Likewise.
Copyright-paperwork-exempt: yes
|
|
|
|
|
|
| |
* parted/parted.c (disk_print_flags): Avoid NULL-dereference on
failed malloc. Use xrealloc, not ped_realloc.
(partition_print_flags): Likewise; nearly identical code.
|
|
|
|
|
|
|
|
|
| |
This adds a 'Disk Flags:' line the displays the active disk flags.
In machine mode this is appended to the disk info line, after the
device model.
* parted/parted.c (disk_print_flags): New function
(_print_disk_info): Add Disk Flags information.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
* parted/parted.c (do_print): Remove invalid free.
Bug introduced via v1.8.8.1-19-gb56d69c.
* NEWS (Bug fixes): Mention this.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
everywhere, for those who perform non-srcdir builds from a pristine
cloned directory. There is no problem when building from a tarball,
since that includes include/parted/*.h files under $(top_srcdir).
* libparted/Makefile.am: Insert it.
* libparted/fs/Makefile.am: Likewise.
* libparted/labels/Makefile.am: Likewise.
* libparted/tests/Makefile.am: Likewise.
* parted/Makefile.am: Likewise.
* partprobe/Makefile.am: Likewise.
* tests/Makefile.am: Likewise.
|
|
|
|
|
|
| |
* parted/strlist.c (wchar_strcasecmp): Add pure attribute; make static.
(wchar_strncasecmp): Likewise.
(wchar_strdup): Likewise.
|
|
|
|
| |
Run "make update-copyright".
|
|
|
|
| |
* parted/ui.h (help_msg): Declare as __noreturn__.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
* libparted/timer.c (ped_timer_new_nested): Mark literal floating point
constants with "f" suffix, since they are compared against "float"s.
* parted/parted.c (_timer_handler): Likewise.
|
|
|
|
|
|
|
|
|
| |
* parted/parted.c (do_print): Do not exit successfully when issuing
an error about an "unrecognised disk label" or when both GPT primary
and backup tables are corrupted.
* tests/t0101-print-empty.sh: Adjust expected exit code to match
new behavior.
* NEWS (Bug fixes): Mention this.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before, if the user specified start and end in mkpart command using
IEC units, parted created a partition that starts and ends exactly on
these positions. With such behavior, it is impossible to create
partitions as follows: 1MiB-2MiB, 2MiB-3MiB - parted would complain
that it cannot create the second partition, because the first one
occupied sectors 2048-4096 and the second one sectors 4096-3072,
so they would overlap at sector 4096.
With this patch, if the user uses IEC units to specify end of the
partition, parted creates the partition which ends one sector before
the specified position.
See also
https://lists.gnu.org/archive/html/bug-parted/2011-10/msg00009.html
* parted/ui.c (command_line_get_sector): Add parameter to retrieve
raw input from user.
* parted/ui.h (command_line_get_sector): Adjust prototype of function.
* parted/parted.c (_adjust_end_if_iec): New function.
(_strip_trailing_spaces): New function.
(_string_ends_with_iec_unit): New function.
(do_mkpart): Call _adjust_end_if_iec(). Use new parameter of
command_line_get_sector function.
(do_rescue): Adjust call to command_line_get_sector.
* bootstrap.conf (gnulib_modules): Add these: c-ctype, c-strcase.
* tests/t0207-IEC-binary-notation.sh: Adjust to new semantics.
* NEWS: Mention the changed behavior.
Notable adjustments:
- s/isspace/c_isblank/ so that parsing is locale-independent
- avoid an array-bounds error:
* parted/parted.c (_strip_trailing_spaces): Don't deref str[-1]
for an empty string.
|
| |
|
|
|
|
|
|
| |
This changes the two strlist print functions so that instead of just
sending output to stdout, they can send it to any FILE *. Now the
caller can send errors to stderr instead of stdout.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The following parted message is not very useful:
Error: You requested a partition from 2.00MiB to 3.00MiB.
The closest location we can manage is 2.00MiB to 3.00MiB.
Improve the message by including exact geometry (in sectors):
...requested a partition from 2.00MiB to 3.00MiB (sectors 2048..3072).
... location we can manage is 2.00MiB to 3.00MiB (sectors 2049..3072).
* parted/parted.c (do_mkpart): Include exact partition geometry in
the warning message.
* tests/t-lib-helpers.sh (normalize_part_diag_): Adapt to
handle the new form of the diagnostic.
* tests/t7000-scripting.sh: Adapt and change the name
of a temporary file.
|
|
|
|
|
|
| |
is_start_exact and is_end_exact were removed from the source.
* parted/parted.c (constraint_from_start_end): Remove obsolete
documentation of the function.
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
* parted/ui.c (command_line_get_fs_type): Don't leak an input "word".
|
|
|
|
|
| |
* parted/ui.c (command_line_get_fs_type): Don't leak an FS type name
string.
|
|
|
|
|
| |
* parted/table.c (table_add_row): Use sizeof(*VAR), rather than
erroneous sizeof(explicit_type) that just happened to be ok.
|
|
|
|
| |
* parted/parted.c (do_mkpart): Rename inner added_ok to add_ok.
|
|
|
|
|
| |
* parted/Makefile.am (parted_CFLAGS): Remove unused (and interfering)
definition.
|
|
|
|
|
|
| |
* parted/parted.c (do_print): Remove now-unused "error" label.
(_print_disk_info): Use one more "const" attribute, to avoid
compiler warnings.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
'parted $dev print' on a device without a partition table used to fail
with an 'unrecognised disk label' error, without printing the following:
disk model, transport, size, sector size, BIOS geometry
all of which are available, and do not dependent on the partition table.
With this patch, parted prints all of this information (BIOS geometry
only if 'unit cyl' is specified) and reports success even if the disk
does not have a valid partition table.
As a side efect, 'parted $dev print devices/all/list' now prints
information about all the devices, even if $dev does not have a
partition table.
* parted/parted.c (_print_disk_info): New function.
(do_print): Do not immediately fail if the partition table is not
recognized, but print disk information and report success instead.
* NEWS (Changes in behavior): Mention it.
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
|
|
|
|
|
|
|
| |
* parted/parted.c (_print_disk_geometry): New function.
(do_print): Use _print_disk_geometry.
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Run "make update-copyright".
|
|
|
|
| |
* parted/parted.c (do_align_check): Always return 1 in interactive mode.
|
|
|
|
|
|
| |
* parted/parted.c (do_align_check): rework the function so that
it reports partition alignment in interactive mode as described in
documentation.
|
|
|
|
|
|
| |
* parted/parted.c (do_align_check): Initialize align_type to
default alignment; this prevents reading of uninitialized memory
later in command_line_get_align_type()
|
|
|
|
| |
* parted/parted.c (_done_messages): Free unit_msg.
|
|
|
|
|
|
|
|
|
|
| |
* libparted/fs/xfs/platform_defs.h [__sparc__] (O_DIRECT):
Remove now-unneeded definition.
* parted/table.c (wchar_t): Remove definition.
* parted/strlist.c (wchar_t): Likewise.
* .x-sc_prohibit_always-defined_macros: New file.
Exempt two files from this syntax-check rule.
* Makefile.am (EXTRA_DIST): Add it here.
|
|
|
|
| |
* parted/ui.c (help_msg): Tell where to report bugs.
|
|
|
|
|
|
| |
This lets one more "syntax-check" test pass.
Run this command:
git ls-files|grep -v gnulib|xargs perl -pi -0777 -e 's/\n\n+$/\n/'
|
|
|
|
|
|
|
|
|
| |
* debug/clearfat/clearfat.c (AUTHORS): Point to the git repo.
* parted/parted.c (AUTHORS): Likewise.
* partprobe/partprobe.c (AUTHORS): Likewise.
* parted/parted.c: Include "version.h".
(_version): Use Version, not VERSION.
|
|
|
|
|
|
|
|
|
|
| |
* parted/Makefile.am (version.c, version.h): Generate.
(parted_LDADD): Add libver.a.
(noinst_LIBRARIES, nodist_libver_a_SOURCES): Define.
(BUILT_SOURCES): Initialize and append.
(MAINTAINERCLEANFILES): Update.
* parted/parted.c: Include "version.h".
(_version): Use the new global variable, Version, not VERSION.
|