summaryrefslogtreecommitdiffstats
path: root/disk-utils/cfdisk.c
Commit message (Collapse)AuthorAgeFilesLines
...
* cfdisk: cleanup extra partitions info for slangKarel Zak2015-03-311-35/+18Star
| | | | | | | | | | | The patch removes problem with getch() on slang, now the code is based on subwin() and extra info window is persistent. A new problem is that slang does not keep sub-window border persistent. I'm going to ignore this slang problem... use ncurses dude! Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: provide extra partinfo with "x"Ondrej Oprala2015-03-271-12/+356
| | | | | | | | | | | | | | | | | | | | | The new 'extra' info provides: * filesystem information from libblkid (TYPE, UUID, LABEL) This feature is based on libblkid ability to probe specified area on the device. It allows to probe for filesystems although the partition devices (e.g. /dev/sda2) does not exist. For example from disk image: # cfdisk /home/archive/fs-images/disk.img * additional information from libfdisk (partition UUID, Name, ...) * mount information from libmount (from fstab or mountinfo) Signed-off-by: Ondrej Oprala <ooprala@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com> Co-Author: Karel Zak <kzak@redhat.com>
* colors: cleanup man pages, add hint to usage()Karel Zak2015-02-251-2/+4
| | | | | | | | cfdisk, fdisk, calm dmesg and hexdump Signed-off-by: Karel Zak <kzak@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: improve create-label UIKarel Zak2015-02-101-11/+15
| | | | | Reported-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: also recognize a lowercase 'l' for loading a script fileBenno Schulenberg2015-02-101-0/+1
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* cfdisk: do not startle the user with a false message when --zero is usedBenno Schulenberg2015-02-101-2/+3
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* cfdisk: improve ui_get_size() warningsKarel Zak2015-02-031-5/+10
| | | | | | | | | - don't reset to default after error - clean previous warnings after users response - remove unnecessary warning Reported-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: fix issues with very small partitionsKarel Zak2015-02-031-2/+3
| | | | | | | | | | | | - cfdisk: minimal partitions size is 1 sector - dos: when align last sector then don't set partition size to zero for very small partitions. - don't ignore tiny partitions before free space when define free-space start offset - improve some debug messages Reported-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: print "wrong order" warning after startup, colorize info messagesKarel Zak2015-02-031-2/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: force main menu to default to Quit/New menu itemsKarel Zak2015-02-031-8/+13
| | | | | Reported-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: disable some KEY_* in ui_get_wqstring()Karel Zak2015-02-021-0/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: default to Quit menu itemKarel Zak2015-02-021-0/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: make '?' an alias of 'h', to also show the help screenBenno Schulenberg2015-02-021-0/+1
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* cfdisk: punctuate the bottombar messages consistentlyBenno Schulenberg2015-02-021-6/+6
| | | | | | Also adjust the style of two comments and add another. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* cfdisk: improve wording and consistency of the size warningsBenno Schulenberg2015-02-021-2/+2
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* cfdisk: remove the mistaken B from the explanation of size suffixesBenno Schulenberg2015-02-021-2/+2
| | | | | | | Also reword the explanation to be clearer. It is not necessary to be complete -- that is what the man page is for. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* cfdisk: fix mem leak and main_menu_action() logic [coverity scan]Karel Zak2015-01-281-6/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: actually translate the table headers and the bottom lineBenno Schulenberg2015-01-261-2/+2
| | | | | | | The printout of the table headers and the bottomline descriptions were lacking calls to gettext(). Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* cfdisk: shorten the help screen to make it fit within 25 linesBenno Schulenberg2015-01-261-14/+7Star
| | | | | | | | | | When the terminal has less than 32 lines, the new cfdisk ignored the fact that the help-screen text was longer and just skipped printing the remaining lines. Instead of introducing a minipager for the help screen, just condense its text and remove unneeded lines. Now the text occupies just 25 lines, which should fit on most terminals. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* cfdisk: don't mess up the help screen by printing the PO file headerBenno Schulenberg2015-01-261-6/+5Star
| | | | | | | | | Asking for the translation of the empty string ("") produces the header of the PO file corresponding to the current locale, which messes up the help screen. So, don't use empty strings in the array of help strings but (arbitrary) double spaces. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* textual: fix spellos and inconsistencies in several program messagesBenno Schulenberg2015-01-261-2/+2
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* maint: fix shadow declarationSami Kerola2015-01-071-3/+3
| | | | | | | | | | | | | | | | This change fixes all shadow declarations. The worth while to mention fix is with libfdisk sun geometry. It comes from bitops.h cpu_to_be16 macro that further expands from include/bits/byteswap.h that has the shadowing. libfdisk/src/sun.c:961:173: warning: declaration of '__v' shadows a previous local [-Wshadow] libfdisk/src/sun.c:961:69: warning: shadowed declaration is here [-Wshadow] libfdisk/src/sun.c:961:178: warning: declaration of '__x' shadows a previous local [-Wshadow] libfdisk/src/sun.c:961:74: warning: shadowed declaration is here [-Wshadow] That could have caused earlier some unexpected results. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* textual: add a docstring to most of the utilitiesBenno Schulenberg2015-01-061-1/+3
| | | | | | | | | This adds a concise description of a tool to its usage text. A first form of this patch was proposed by Steven Honeyman (see http://www.spinics.net/lists/util-linux-ng/msg09994.html). Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* cfdisk: improve Dump dialogKarel Zak2015-01-051-9/+6Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: improve menu clean functionKarel Zak2015-01-051-7/+8
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: detect too small partition sizesKarel Zak2015-01-051-6/+15
| | | | | References: https://github.com/karelzak/util-linux/issues/136 Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: rename and move functionKarel Zak2014-11-261-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: cleanup menuitem draw functionsKarel Zak2014-11-131-19/+55
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: remove [Load] from menuKarel Zak2014-11-131-13/+0Star
| | | | | | | | | This functionality will be rarely used, so it does not make sense to waste screen space with this menu item. It's enough to provide this functionality in "Select label type" dialog (cfdisk --zero and then 'L' command). Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: add support for sfdisk scriptsKarel Zak2014-11-121-2/+110
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include/debug: fix typoKarel Zak2014-10-241-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: make it possible to use zero for size and startKarel Zak2014-10-151-1/+2
| | | | | | | | | | | | | | | | The zero may be valid size and start of the partition. This patch introduces: fdisk_partition_has_start() fdisk_partition_has_size() fdisk_partition_unset_size() fdisk_partition_unset_start() to make it possible to work with zero. The feature is internally implemented by magic constant ((type) -1) for undefined sizes and offsets. Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: ask on EOFKarel Zak2014-10-091-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: follow explicitly specified partition sizeKarel Zak2014-10-091-3/+10
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: return partno when add new partitionKarel Zak2014-10-071-1/+1
| | | | | | | * improve the way how sfdisk report results * the API change simplify applications Signed-off-by: Karel Zak <kzak@redhat.com>
* textual: use version printing macro everywhereSami Kerola2014-10-011-2/+1Star
| | | | | | | Only mount, umount, and blkid remains not using the macro because they are print also library references. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* cfdisk: don't modify ncurses LINES and COLSKarel Zak2014-10-011-29/+37
| | | | | | | | | | | | | | | | | | | | | | | | On Sun, Sep 28, 2014 at 01:48:38AM -0700, pv4 wrote: If ncurses is build with --enable-reentrant, building util-linux-2.25.1 fails with the folllowing error: disk-utils/cfdisk.c: In function 'resize': disk-utils/cfdisk.c:202:9: error: lvalue required as left operand of assignment LINES = ws.ws_row; ^ disk-utils/cfdisk.c:203:8: error: lvalue required as left operand of assignment COLS = ws.ws_col; ^ man COLS gives the following: Depending on the configuration, these may be actual variables, or macros (see curs_threads(3X)) which provide read-only access to curses's state. In either case, applications should treat them as read-only to avoid confusing the library. Addresses: https://github.com/karelzak/util-linux/issues/125 Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: use reference counting for contextKarel Zak2014-08-281-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: fix typo in the previous commitKarel Zak2014-08-261-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: wrong interpretation of yes in non-english languageKarel Zak2014-08-261-2/+2
| | | | | Reported-by: tnut@nutyx.org Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: use libfdisk public API onlyKarel Zak2014-08-151-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: use only public libfdisk APIKarel Zak2014-08-151-14/+20
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: final parttype API cleanupKarel Zak2014-08-141-13/+14
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: move get_parttypes to label APIKarel Zak2014-08-141-6/+8
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: make it possible to get fields for all labesKarel Zak2014-08-141-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: cleanup fdisk_is_label stuffKarel Zak2014-08-131-5/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: clean up API (context.c)Karel Zak2014-08-131-10/+10
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: add libfdisk independent debug stuffKarel Zak2014-08-131-33/+55
| | | | | | | | Now it's possible to use CFDISK_DEBUG=0xffff ./cfdisk to debug only cfdisk UI. Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: rename fdisk_column to fdisk_fieldKarel Zak2014-08-131-31/+29Star
| | | | | | .. to make the API and fdisk(s) code more readable. Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: remove dependence on libsmartcolsKarel Zak2014-08-131-7/+13
| | | | | | It's application business to convert libfdisk_table to string. Signed-off-by: Karel Zak <kzak@redhat.com>