summaryrefslogtreecommitdiffstats
path: root/disk-utils
Commit message (Collapse)AuthorAgeFilesLines
...
| * partx: add --output-all optionSami Kerola2018-05-032-1/+11
| | | | | | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | fdisk: fix typo in debug stringVaclav Dolezal2018-05-091-1/+1
|/ | | | Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
* fdisk: fix compiler warning [-Wmaybe-uninitialized]Karel Zak2018-05-031-1/+1
| | | | | Reported-by: L A Walsh <lkml@tlinx.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: fix missing prototype for `get_wch`Patrick Steinhardt2018-04-111-0/+4
| | | | | | | | | | | | The header <ncursesw/ncurses.h> defines the get_wch(3) function only when `NCURSES_WIDECHAR` is defined. This define is actually getting set in the same header file, but only in case `_XOPEN_SOURCE` is defined and has a value of 500 or higher. As we already have the precedence of defining `_XOPEN_SOURCE` to a value of 600 in some other files, simply define it to the minimum required value of 500 in "cfdisk.c". This silences a warning for `get_wch` being unknown. Signed-off-by: Patrick Steinhardt <ps@pks.im>
* libfdisk: (docs) update yearKarel Zak2018-03-202-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: ignore private Stratis devicesTony Asleson2018-03-091-1/+1
| | | | | | | | [kzak@redhat.com: - tiny coding style changes] References: 20e1c3dc03399d6988ef35dedc1364cfc12e9263 Signed-off-by: Tony Asleson <tasleson@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* fsck: cleanup find_fsck()Karel Zak2018-02-191-6/+14
| | | | | | | | * remove static variable * return 0 or 1 * optionally return allocated path to the program Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'maybe-for-v2.32' of https://github.com/rudimeier/util-linuxKarel Zak2018-02-163-3/+3
|\ | | | | | | | | | | | | | | | | * 'maybe-for-v2.32' of https://github.com/rudimeier/util-linux: tests: use pgrep instead of ps --ppid ... misc: fix typos using codespell lsns: fix clang compiler warning tests: add udevadm settle to sfdisk/resize build-sys: disable bz2 tarball and fix some am warnings
| * misc: fix typos using codespellRuediger Meier2018-02-163-3/+3
| | | | | | | | | | | | Some more funny typos, please review carefully. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | fsck: coding style cleanupKarel Zak2018-02-161-2/+4
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | fsck: use xasprintf to avoid buffer overruns with an insane fs typeTheodore Ts'o2018-02-161-6/+9
|/ | | | | | | | | This prevents a crash when running the command: fsck -t AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA /dev/sda Reported-by: Hornseth_Brenan@bah.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
* fsck.cramfs: fix error messageRuediger Meier2018-01-241-1/+6
| | | | | | errno is invalid in case that we just read(3) too short. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* fsck.cramfs: fix crash when superblock size is too smallRuediger Meier2018-01-241-1/+1
| | | | | | | | | | | This hopefully fixes the original problem addressed by the reverted patch 7cb962c7. The bug was introduced by myself in f991dbd3 "fsck.cramfs: allow smaller superblock sizes" CC: Tobias Stoeckmann <tobias@stoeckmann.org> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* Revert "fsck.cramfs: Fix bus error on broken file system."Ruediger Meier2018-01-241-7/+6Star
| | | | | | | | | | | | | | | | | | This reverts commit 7cb962c77015e9383b53eeb22ce732cb5216bbc3. It can't be right that we mmap (start + super.size) bytes from a file which is usually only super.size bytes large. The patch "fixed" a problem when super.size is bad but now it fails for the correct case: $ mkdir -p root/subdir $ ./mkfs.cramfs -p root cramfs $ ./fsck.cramfs cramfs Bus error (core dumped) We will fix the original problem later. CC: Tobias Stoeckmann <tobias@stoeckmann.org> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* sfdisk: add hint about udev and flock to the man pageKarel Zak2018-01-171-0/+16
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/563 Signed-off-by: Karel Zak <kzak@redhat.com>
* include/debug: introduce __UL_INIT_DEBUG_FROM_STRING()Karel Zak2018-01-173-3/+3
| | | | | | | Let's make it possible to use debug.h without environment variables. Suggested-by: J William Piggott <elseifthen@gmx.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: cleanup shortcuts in man page tooKarel Zak2018-01-121-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (script) support R (RAID) and V (LVM) shortcutsKarel Zak2018-01-092-2/+8
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/560 Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: extend API to provide label specific geometry rangesKarel Zak2018-01-021-8/+26
| | | | | | | Now fdisk provides DOS specific geometry ranges in expert menu. Addresses: https://github.com/karelzak/util-linux/issues/556 Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: wait before re-readKarel Zak2018-01-021-1/+8
| | | | | | | | | | | | The original old (v2.13) fdisk had sleep(2) beany ideafore re-read ioctl. It seems overkill, but short sleep is probably a good idea as we call re-read on sfdisk start and at the end. It's possible that sfdisk is too fast and the initial re-read is not gone yet. It would be nice to have something more elegant than sleep, any idea? Addresses: https://github.com/karelzak/util-linux/issues/557 Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/md5: use ul_/UL_ prefixKarel Zak2017-12-121-6/+7
| | | | | | | The symbols names are too generic. Addresses: https://github.com/karelzak/util-linux/issues/548 Signed-off-by: Karel Zak <kzak@redhat.com>
* blockdev: be more explicit for BLKSSZ in blockdev.8Karel Zak2017-11-131-1/+1
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/535 Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: create empty label on 'write' commandKarel Zak2017-11-031-1/+1
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/528 Signed-off-by: Karel Zak <kzak@redhat.com>
* fsck.cramfs: Fix bus error on broken file system.Tobias Stoeckmann2017-11-021-6/+7
| | | | | | | | | | | | | | | | | The utility fsck.cramfs is prone to a bus error on file systems for big endian systems with non-standard header sizes. While calculating the crc32 checksum, it does not properly handle a possible offset for bootcodes, resulting in out of boundary access of mmap'ed area. You can trigger the issue with the following commands: $ mkdir -p cramfs-poc/root/subdir $ cd cramfs-poc $ mkfs.cramfs -p -N big root cramfs $ echo -ne \\00\\x4c | dd of=cramfs bs=1 seek=518 count=2 conv=notrunc $ fsck.cramfs cramfs Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
* sfdisk: allow to disable bootable flag on all partitionsKarel Zak2017-11-022-5/+13
| | | | | | | | | Let use '-' rather than a partition number to disable the bootable flag on all partitions: sfdisk --activate /dev/sdc - Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: allow to use --activate for PMBRKarel Zak2017-11-021-3/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: (gpt) make PMBR accessible from main menuKarel Zak2017-11-021-4/+6
| | | | | | Don't force users to go to expert menu to toggle between GPT and PMBR. Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: cleanup die-on-signal codeKarel Zak2017-09-261-16/+47
| | | | | | | Let's keep signal handler simple and don't cleanup terminal from the handler. Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: make resize code more readableKarel Zak2017-09-261-10/+10
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* swaplabel: fix --disable-libuuid compilationKarel Zak2017-09-151-0/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: replace magic number 37 with UUID_STR_LENPhilip Prindeville2017-09-051-1/+1
| | | | Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
* fdisk: use strutils to trim whitespace from inputVaclav Dolezal2017-08-291-6/+1Star
| | | | Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
* fdisk: fix copy from readline and whitespace strippingVaclav Dolezal2017-08-281-3/+3
| | | | | | | | | | | | | | | | | | | | | Bug fixed: --- 678: fdisk: ASK: asking for number ['Partition number', <1,4>, default=1, range: 1-4] 678: fdisk: ASK: asking for user replay [interactive] Partition number (1-4, default 1): 12345 678: fdisk: ASK: user's reply: >>>12345<<< Value out of range. 678: fdisk: ASK: asking for user replay [interactive] Partition number (1-4, default 1): 1 678: fdisk: ASK: user's reply: >>>12345<<< Value out of range. 678: fdisk: ASK: asking for user replay [interactive] Partition number (1-4, default 1): 678: fdisk: ASK: user's reply: >>>22345<<< Value out of range. --- Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
* fdisk: minor fixes to make readline workVaclav Dolezal2017-08-281-3/+4
| | | | Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
* fdisk: add missing includeKarel Zak2017-08-241-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: fix readline interaction with signalsKarel Zak2017-08-243-63/+102
| | | | | | | | | | | | | The high-level readline API is crazy to use with signals. Fortunately the library provides low-level rl_callback_* API. In this case we can use poll() to wait for input and control all signals, etc. This patch also a little changes fdisk behavior on CTRL+C and CTRL+D. The signals does not kill fdisk, but forces fdisk to return to the main menu, if already in the main menu then exit. If the disk layout has been modified than ask "Do you really want to exit...". Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: handle SIGINT in dialogs as cancelVaclav Dolezal2017-08-241-2/+27
| | | | | | | [kzak@redhat.com: - use sig_atomic_t] Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: add wrap_fgets() for getting user inputVaclav Dolezal2017-08-241-31/+26Star
| | | | | | | make function wrapping rl_fgets() and fputs()&fgets() to remove code duplication in get_user_reply(). Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
* isosize: usage() and coding style cleanupKarel Zak2017-08-211-13/+17
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* isosize: iterate over all arguments even when something failsKarel Zak2017-08-212-13/+45
| | | | | | | | | | Earlier the command exit too early if one of the arguments failed. After this change all arguments are examined, and command return value will have information what happen during processing. Based on patch from Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: add missing 0x7F key mappingKarel Zak2017-08-151-0/+1
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/499 Signed-off-by: Karel Zak <kzak@redhat.com>
* blockdev: document --setro more properlyKarel Zak2017-08-141-1/+2
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/498 Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: add resize functionKarel Zak2017-07-191-7/+49
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: use fdisk_reread_changes()Karel Zak2017-07-141-1/+11
| | | | | | Let's make cfdisk usable for disks where some partitions are mounted. Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: use fdisk_reread_changes()Karel Zak2017-07-143-1/+15
| | | | | | Let's make fdisk usable for disks where some partitions are mounted. Signed-off-by: Karel Zak <kzak@redhat.com>
* partx: move partx.h to include/Karel Zak2017-07-142-74/+4Star
| | | | | | Let's make the ioctls usable also for libfdisk. Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: use fdisk_device_is_used()Karel Zak2017-07-141-27/+1Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: don't use CDROM_GET_CAPABILITY ioctl for DM devicesKarel Zak2017-07-121-1/+1
| | | | | | | | | For some reason kernel commit e980f62353c697cbf0c4325e43df6e44399aeb64 add extra warning when the ioctl is used for DM devices. It seems we can avoid this ioctl when the device has dm/uuid. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1469532 Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: reset context after failed scriptKarel Zak2017-07-101-2/+8
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/481 Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: consolidate macro style USAGE_HELP_OPTIONSRuediger Meier2017-06-2920-34/+34
| | | | | | | | | changed in include/c.h and applied via sed: sed -i 's/fprintf.*\(USAGE_MAN_TAIL.*\)/printf(\1/' $(git ls-files -- "*.c") sed -i 's/print_usage_help_options\(.*\);/printf(USAGE_HELP_OPTIONS\1);/' $(git ls-files -- "*.c") Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>