summaryrefslogtreecommitdiffstats
path: root/disk-utils
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* sfdisk: --quiet fixesKarel Zak2017-02-101-4/+6
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/412 Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: add copyright to helpKarel Zak2017-02-021-1/+4
| | | | | | ... to make it obvious this is a new cfdisk. Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: support UI refresh on ^LKarel Zak2017-02-011-2/+14
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/404 Signed-off-by: Karel Zak <kzak@redhat.com>
* partx: add --sector-size optionKarel Zak2017-01-132-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | /dev/sdc is 4K disk: # fdisk -l /dev/sdc Disk /dev/sdc: 100 MiB, 104857600 bytes, 25600 sectors ... Device Boot Start End Sectors Size Id Type /dev/sdc1 1024 25599 24576 96M 83 Linux let's use it as disk image: # dd if=/dev/sdc of=~/sdc.img # losetup -f ~/sdc.img old version: # partx --show /dev/loop0 NR START END SECTORS SIZE NAME UUID 1 1024 25599 24576 12M 6a4ba75b-01 new version: # partx --show /dev/loop0 --sector-size 4096 NR START END SECTORS SIZE NAME UUID 1 8192 204799 196608 96M 6a4ba75b-01 Addresses: https://github.com/karelzak/util-linux/issues/396 Signed-off-by: Karel Zak <kzak@redhat.com>
* man: fix couple tools/checkmans.sh warningsSami Kerola2017-01-102-2/+2
| | | | | | | | | | <standard input>:407: warning: macro `fi.' not defined (possibly missing space after `fi') From: cat ./disk-utils/fsck.8 | troff -mandoc -ww -z <standard input>:71: warning: escape character ignored before `1' From: cat ./disk-utils/partx.8 | troff -mandoc -ww -z Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* sfdisk: unused parameter 'sf' [-Wunused-parameter]Karel Zak2017-01-051-2/+7
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* disk-utils/mkfs.minix: Set ninodes after checking maxNate Clark2017-01-041-1/+1
| | | | | | | | | | | ninodes in the superblock needs to be set after inodes is checked against MINIX_MAX_INODES otherwise a value larger than MINIX_MAX_INODES can be attempted to be stored in the superblock. Without this change the command "mkfs.minix -2 -i 65530 <dev>" would write a minix superblock with ninodes set to 0. Signed-off-by: Nate Clark <nate@neworld.us>
* Use --help suggestion on invalid optionKarel Zak2016-12-1917-18/+18
| | | | | | | | The current default is to print all usage() output. This is overkill in many case. Addresses: https://github.com/karelzak/util-linux/issues/338 Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: replace FTP by HTTPS in kernel.org URLsSébastien Helleu2016-12-1920-20/+20
| | | | | | | The links to ftp://ftp.kernel.org/ are replaced by https://www.kernel.org/. Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: don't be silent when list non-existing deviceKarel Zak2016-12-131-2/+6
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/376 Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: various pages: Format pathnames as italic (.I)Michael Kerrisk2016-12-092-7/+7
| | | | | | | | | In the majority of pages, pathnames are formatted as Italic, which is the norm. However, there are several cases where they are formatted as bold. This patch fixes a number of those exceptions. Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
* misc: spelling, always use "cannot" instead of "can not"Ruediger Meier2016-11-301-1/+1
| | | | | | Just to be consistent ... Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* sfdisk: support empty label use-caseKarel Zak2016-11-304-9/+50
| | | | | | | | | | | | | | | By default sfdisk creates partition table when a first partition is specified, otherwise the device is not modified. This force users to create at least one partition. This commit allows to create empty label without partitions if "label: <name>" header line is specified by script. The commit also modifies "New situation:" output to list label name and label identifier. Addresses: https://github.com/karelzak/util-linux/issues/374 Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: cleanup --dump error messagesKarel Zak2016-11-301-1/+4
| | | | | | | | | | | | | old: # truncate -s 1G empty && ./sfdisk --dump empty sfdisk: failed to dump partition table: Success new: # truncate -s 1G empty && ./sfdisk --dump empty sfdisk: empty: does not contain a recognized partition table. Addresses: https://github.com/karelzak/util-linux/issues/375 Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: don't be silent when list non-existing deviceKarel Zak2016-11-291-6/+10
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/376 Signed-off-by: Karel Zak <kzak@redhat.com>
* Fix formatting errors in page cross referencesMichael Kerrisk (man-pages)2016-11-291-1/+1
| | | | | | | | | | | | These pages had errors such as .BR page (x) . which should be .BR page (x). Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
* Place SEE ALSO entries in orderMichael Kerrisk (man-pages)2016-11-298-15/+15
| | | | | | | | | | | | This patch does only the following: * Order SEE ALSO entries first by section name, then alphabetically within section * Adds one or two missing commas in SEE ALSO lists * Removes one or two periods that were (inconsistently) used at the end of SEE ALSO lists. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
* fdisk: fix memleak in list_disk_geometry()Ruediger Meier2016-10-271-1/+3
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* fdisk: fix compiler warningKarel Zak2016-10-261-2/+2
| | | | | | | | disk-utils/fdisk-menu.c: In function ‘gpt_menu_cb’: disk-utils/fdisk-menu.c:709: warning: passing argument 6 of ‘fdisk_ask_number’ from incompatible pointer type ./libfdisk/src/libfdisk.h:688: note: expected ‘uintmax_t *’ but argument is of type ‘long unsigned int *’ Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: fix unsigned int usage for ctype.h functionsKarel Zak2016-10-261-2/+2
| | | | | Reported-by: "Yuriy M. Kaminskiy" <yumkam@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* cramfs: revert crc32 changesKarel Zak2016-10-192-11/+21
| | | | | | | | We cannot use our crc32 without changes in the code, because our ul_crc32() assumes that post-conditioning (xor) is done by application. The zlib implementation does everything. Signed-off-by: Karel Zak <kzak@redhat.com>
* cramfs: add missing includesKarel Zak2016-10-192-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/crc32: prefix public functionsGustavo Zacarias2016-10-192-9/+9
| | | | | | | | | | | Make the publicly-visible crc32 library functions prefixed by ul_, such as crc32() -> ul_crc32(). This is because it clashes with the crc32() function from zlib. For newer versions of glib (2.50+) zlib and libblkid are required dependencies and otherwise results in build failure when building statically. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
* isosize: fix read() result checkKarel Zak2016-10-041-1/+1
|
* sfdisk: cleanup before going out of scope [coverity scan]Karel Zak2016-10-041-5/+12
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: free before going out of scope [coverity scan]Karel Zak2016-10-041-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* isosize: don't ignore read() result [coverity scan]Karel Zak2016-10-041-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fsck.cramfs: don't ignore read() result [coverity scan]Karel Zak2016-10-041-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: fix mountpoint detectionKarel Zak2016-10-041-21/+26
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: support LIBSMARTCOLS_DEBUG_PADDING=onKarel Zak2016-09-072-0/+4
| | | | | | | | | | | | This env.variable forces libsmartcols to use visible padding chars. The standard debug has to be enabled (to minimize overhead for non-debug execution). For example: $ LIBSMARTCOLS_DEBUG=all LIBSMARTCOLS_DEBUG_PADDING=on findmnt 2> ~/log Signed-off-by: Karel Zak <kzak@redhat.com>
* fsck: remove fs-specific options from man pageKarel Zak2016-09-061-65/+12Star
| | | | | | | | Let's force users to read fs-specific man pages rather than try to be smart and maintain some non-fsck options in fsck.8. Reported-by: Matej Cepl <mcepl@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: add --no-tell-kernelKarel Zak2016-09-022-3/+17
| | | | | | | | The option forces sfdisk to not call re-read partitions ioctl after write PT. Requested-by: Scott Moser <smoser@ubuntu.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: make non-interactive output more readableKarel Zak2016-08-311-14/+26
| | | | | | | | | | | | | | | | | | | | | # echo -e ',1M\n,2M' | sfdisk /dev/sdc Old version: >>> Created a new DOS disklabel with disk identifier 0x8fc7d065. Created a new partition 1 of type 'Linux' and of size 1 MiB. /dev/sdc2: Created a new partition 2 of type 'Linux' and of size 2 MiB. /dev/sdc3: New version: >>> Created a new DOS disklabel with disk identifier 0x9afe17c0. /dev/sdc1: Created a new partition 1 of type 'Linux' and of size 1 MiB. /dev/sdc2: Created a new partition 2 of type 'Linux' and of size 2 MiB. /dev/sdc3: Done. Addresses: https://github.com/karelzak/util-linux/issues/337 Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: use PAGER for 'l' command.Karel Zak2016-08-261-0/+6
| | | | | | | The list of the partition types is too long. Let's try to use $PAGER. Reported-by: Bruce Dubbs <bruce.dubbs@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* include/closestream: define exit codesKarel Zak2016-08-162-2/+7
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: add show-pt-geometry to usage() and sfdisk.8Karel Zak2016-08-082-2/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: Add --show-pt-geometry compatibility codeStanislav Brabec2016-08-081-1/+4
| | | | | | | --show-pt-geometry existed since cf3f26bf (2006), and it is used by third party tools. To prevent failure of these tools, add a minimal compatibility code. Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
* misc: simplify if clauses [oclint]Sami Kerola2016-07-215-42/+30Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>