summaryrefslogtreecommitdiffstats
path: root/disk-utils
Commit message (Collapse)AuthorAgeFilesLines
...
* blockdev: correct man page name in --helpRuediger Meier2017-06-291-1/+1
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* docs: remove some old history from manpagesRuediger Meier2017-06-292-4/+3Star
| | | | | | | | We assume that users will have a kernel >= 2.6.0 and removel references to earlier kernels. There are still a few ones left. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* blockdev: improve --help and man pageRuediger Meier2017-06-272-13/+30
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: consolidate all --help option descriptionsRuediger Meier2017-06-275-13/+10Star
| | | | | | | | Now we are always using the same text also for commands which had still hardcoded descriptions or where we can't use the standard print_usage_help_options macro. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: introduce print_usage_help_options()Ruediger Meier2017-06-2715-30/+16Star
| | | | | | | | | | | | Consolidate --help and --version descriptions. We are now able to align them to the other options. We changed include/c.h. The rest of this patch was generated by sed, plus manually setting the right alignment numbers. We do not change anything but white spaces in the --help output. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: cosmetics, remove argument from usage(FILE*)Ruediger Meier2017-06-262-6/+8
| | | | | | | | | | | | | | This patch is trivial and changes nothing, because we were always using usage(stdout) Now all our usage() functions look very similar. If wanted we could auto-generate another big cosmetical patch to remove all the useless "FILE *out" constants and use printf and puts rather than their f* friends. Such patch could be automatically synchronized with the translation project (newlines!) to not make the translators sick. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: never use usage(stderr)Ruediger Meier2017-06-2613-81/+117
| | | | | | | Here we fix all cases where we have usage(FILE*) functions. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: never use usage(ERROR)Ruediger Meier2017-06-262-21/+26
| | | | | | | | | | We are using better/shorter error messages and somtimes also errtryhelp(). Here we fix all cases where the usage function took an int argument for exit_code. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: cleanup and fix --unknownopt issuesRuediger Meier2017-06-261-10/+17
| | | | | | | | | | | | | | | | Fixed checkusage.sh warnings: rtcwake: --unknownopt, non-empty stdout rtcwake: --unknownopt, stderr too long: 21 blockdev: --unknownopt, stderr too long: 28 lsipc: --unknownopt, stderr too long: 77 pg: --unknownopt, stderr too long: 23 renice: --unknownopt, stderr too long: 18 sulogin: --unknownopt, stderr too long: 17 write: --unknownopt, stderr too long: 12 Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: consolidate usage() "Available columns"Karel Zak2017-06-262-3/+2Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch '170622' of github.com:jwpi/util-linuxKarel Zak2017-06-261-1/+1
|\ | | | | | | | | | | | | | | * '170622' of github.com:jwpi/util-linux: Docs: move option naming to howto-contribute.txt Docs: update howto-usage-function.txt Docs: add a comment for constants to boilerplate.c include/c.h: add USAGE_COMMANDS and USAGE_COLUMNS
| * include/c.h: add USAGE_COMMANDS and USAGE_COLUMNSJ William Piggott2017-06-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * login-utils/lslogins.c: all uses changed * misc-utils/findmnt.c: likewise * sys-utils/blkzone.c: likewise * disk-utils/sfdisk.c: likewise * sys-utils/lscpu.c: likewise * sys-utils/lsmem.c: likewise * sys-utils/wdctl.c: likewise Signed-off-by: J William Piggott <elseifthen@gmx.com>
* | Merge branch 'fix-exit-codes' of https://github.com/rudimeier/util-linuxKarel Zak2017-06-265-4/+12
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | * 'fix-exit-codes' of https://github.com/rudimeier/util-linux: misc: fix optutils.h related exit codes misc: fix xalloc.h related exit codes misc: fix more strutils related exit codes lib: fix strutils.h, remove STRTOXX_EXIT_CODE misc: fix some broken exit codes
| * | misc: fix xalloc.h related exit codesRuediger Meier2017-06-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Found by: grep -L "XALLOC_EXIT_CODE" $(grep -l "xalloc\.h" \ $(git grep -l "_EX_\|FINDFS_\|BLKID_EXIT\|EX_USAGE" -- "*.c")) Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * | misc: fix more strutils related exit codesRuediger Meier2017-06-224-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found by grep: grep -l "\bEXIT_\|exit *( *[0-9][0-9] *)\|strutils\.h" $(grep -L \ strutils_set_exitcode $(git grep -l "_EX_\|FINDFS_\|BLKID_EXIT\|EX_USAGE" -- "*.c")) The Command shows also some false positives (fstrim.c, context_mount.c, ...) Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * | lib: fix strutils.h, remove STRTOXX_EXIT_CODERuediger Meier2017-06-221-2/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | As discussed on the mailing list. We fix all places where the non-working define STRTOXX_EXIT_CODE was used. Regarding tunelp, also see 7e3c80a7. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * | misc: fix some broken exit codesRuediger Meier2017-06-223-3/+3
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | These tools have special exit codes. They got changed mistakenly. See: findfs 0e1fa6b6 fsck 658c0891 fsck.cramfs 922ec175 mkfs.cramfs 16154b1f tunelp 2ab428f6 FIXME: STRTOXX_EXIT_CODE doesn't work as it should. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | mkfs.cramfs: add --help and --versionRuediger Meier2017-06-252-15/+27
| | | | | | | | | | | | | | Note, we were already using errtryhelp() without providing a --help option. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | fsck: add --help and --versionRuediger Meier2017-06-222-7/+26
|/ | | | | | | | | | Also cleanup usage() function, never write usage to stderr. FIXME: - currently strtou32_or_err() exits with wrong exit code. - option -C does not use a safe strto*_err function Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: fix reassigned values before old ones has been used [cppcheck]Sami Kerola2017-06-141-1/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* isosize: avoid reading more data than what is neededSami Kerola2017-06-141-47/+10Star
| | | | | | | | | | | In same go fix error reporting when input file is not long enough. $ touch empty $ isosize empty isosize: empty: might not be an ISO filesystem isosize: read error on empty: Success Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* misc: fix ggc-7 fallthrough warningsSami Kerola2017-06-141-1/+1
| | | | | | | | | | | | | | | | | | | (Original patch and commit message edited by Rudi.) gcc-7 adds -Wimplicit-fallthrough=3 to our default flag -Wextra. This warning can be silenced by using comment /* fallthrough */ which is also recognized by other tools like coverity. There are also other valid comments (see man gcc-7) but we consolidate this style now. We could have also used __attribute__((fallthrough)) but the comment looks nice and does not need to be ifdef'ed for compatibility. Reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=7652 Reference: https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/ Reviewed-by: Ruediger Meier <ruediger.meier@ga-group.nl> Suggested-by: Karel Zak <kzak@redhat.com> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* fdformat: clear progress message before printing "done"Jakub Wilk2017-06-021-1/+1
| | | | | | | | | | | | Before: Formatting ... done1 After: Formatting ... done Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
* cfdisk: fix compiler warningKarel Zak2017-05-311-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: disambiguate units of --show-sizeChris Morin2017-05-222-4/+17
| | | | | | | [kzak@redhat.com: - use optutils.h] Signed-off-by: Chris Morin <chris.morin2@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: consolidate smartcols error messagesKarel Zak2017-05-182-7/+12
| | | | | | ... just to keep translators happy Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: add hints for scanners [coverity scan]Karel Zak2017-05-171-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mkswap: use memcpy() for non-terminated string [coverity scan]Karel Zak2017-05-171-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fsck.minix: add hint for scanners [coverity scan]Karel Zak2017-05-171-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: check scols_line_refer_data() return code [coverity scan]Karel Zak2017-05-171-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: add hints for scanners [coverity scan]Karel Zak2017-05-171-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fsck.minix: fix crashSami Kerola2017-05-161-1/+7
| | | | | | | | | disk-utils/fsck.minix.c:421:30: runtime error: index 513 out of bounds for type 'unsigned short [512]' Addresses: https://github.com/karelzak/util-linux/issues/373 Reported-by: Hanno Bock <hanno@gentoo.org> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* fdisk: fix type dialogKarel Zak2017-05-111-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: inform on 'p' about wiped partitionsKarel Zak2017-05-091-0/+7
| | | | | | | | | | | | | | | The wipe operation is potentially dangerous. Let's inform about it always by 'p' (list) command to make sure user knowns about it. Command (m for help): p ... Device Boot Start End Sectors Size Id Type /dev/sdc1 2048 204799 202752 99M 83 Linux Filesystem/RAID signature on partition 1 will be wiped. Addresses: https://github.com/karelzak/util-linux/issues/437 Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: add to the man page missing optionKarel Zak2017-05-091-0/+11
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* partx: add --list-types optionSami Kerola2017-05-032-15/+19
| | | | | | | Use libblkid as the source of truth what partition type names exist, and are supported. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* docs: try to convince open(2) O_DIRECT rather than using raw deviceSami Kerola2017-05-031-0/+4
| | | | | | | Tell in manual page that one should use open(2) O_DIRECT flag rather than raw device. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* bash-completion: update disk-utilsSami Kerola2017-04-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fdformat: Add --from, --to, and --repair options. Commit: e0402441a143533d33d3c450471b2cd655407d77 fdisk: Add --output [1], --bytes [2], --wipe [3], --wipe-partition [4], and remove --geom- from from --cylinders, --heads, --sector options [5]. Commit [1]: fff8ad5882308825a131c645e4d28bcaef943351 Commit [2]: 354f8cc8cf06de44656fb83705c57062d04d1565 Commit [3]: cb9a4b0033eca429689a403be2a192fe2842f2e9 Commit [4]: ba465623d84b9e330f248a477d078b5f280b7943 Commit [5]: 4b4e391a28b4dfeb69781c20190bffe8622d1907 fsck.cramfs: Broken since first commit. Commit: bf60993cf2442f67bd47bcfcf6bd49c7392c2ba1 mkswap: Provide random uuid when completing --uuid argument. partx: Add --sector-size option. Fix also list of known partition types to match with libblkid blkid_idinfo names. The fix is also applied to manual page. Commit: f8a4a0d4f2fd569252029bd004e24ee433b43fe8 Reference: git grep -A 4 blkid_idinfo libblkid/src/partitions | grep name sfdisk: Add --reoder, --delete, --mode-dataa, -no-tell-kernel, --wipe, and --wipe-partitions options. In same go fix some option argument completions. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* Fix menu spelling in cfdisk debug messagesKarel Zak2017-03-221-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk, sfdisk: avoid non-ANSI function declarations [smatch scan]Sami Kerola2017-03-142-0/+2
| | | | | | | | | | | | | | | Adding _FUNCTION_DEF definition will exclude compatibility type definitions that do include void key word in empty argument list. /usr/include/readline/rltypedefs.h:35:23: warning: non-ANSI function declaration of function 'Function' These functions has been replaced by set of new ones in readline 4.2 (April 2001), and removed in 6.3 (February 2014). Reference: https://cnswww.cns.cwru.edu/php/chet/readline/CHANGES Rererence: https://blueslugs.com/blog/2016-10-23-updating-cppfunction-in-old-readline-consumers/ Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* misc: stop mixing declarations and codeSami Kerola2017-03-132-2/+4
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* sfdisk: note about small partition in man pageKarel Zak2017-03-021-2/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: add note about alignment to man pageKarel Zak2017-03-021-3/+14
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/417 Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: add static keyword to where needed [smatch scan]Sami Kerola2017-02-208-22/+22
| | | | | | | text-utils/rev.c:68:9: warning: symbol 'buf' was not declared. Should it be static? Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* misc: do not use plain 0 as NULL [smatch scan]Sami Kerola2017-02-2012-59/+59
| | | | | | | | | | text-utils/tailf.c:69:21: warning: Using plain integer as NULL pointer Since many 'struct option' has used zero as NULL make them more readable in same go by reindenting, and using named argument requirements. Reference: https://lwn.net/Articles/93577/ Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* cfdisk: avoid use of VLA in combination with sizeof() [smatch scan]Sami Kerola2017-02-201-2/+5
| | | | | | | | | disk-utils/cfdisk.c:1066:29: error: cannot size expression One should use sizeof() only when variable size can be known at time of compilation. That is not the case with variable length arrays. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* cfdisk: use buffer editor for ui_get_string()Karel Zak2017-02-161-53/+46Star
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/403 Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: improve --wipe functionalityKarel Zak2017-02-144-44/+47
| | | | | | | | | * always (except --wipe=never) wipe old partition tables * improve warn messages * improve man page Addresses: https://github.com/karelzak/util-linux/issues/410 Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: improve --wipe functionalityKarel Zak2017-02-142-22/+40
| | | | | | | | | * always (except --wipe=never) wipe old partition tables * improve warn messages * improve man page Addresses: https://github.com/karelzak/util-linux/issues/410 Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: Fix word repetitionsYuri Chornoivan2017-02-131-1/+1
|