summaryrefslogtreecommitdiffstats
path: root/disk-utils/fdisk-menu.c
Commit message (Collapse)AuthorAgeFilesLines
* fdisk: initialize buffers for get_user_reply() [coverity scan]Karel Zak2019-05-141-1/+1
| | | | | | It's probably unnecessary, but better be safe than sorry. Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: fix error message on 'd' commandKarel Zak2018-08-011-2/+4
| | | | | | | | | | | Command (m for help): d No partition is defined yet! Could not delete partition 93840461057817 <--- ! Don't print 'Could not delete..' if no partition is defined yet. Addresses: https://github.com/karelzak/util-linux/issues/667 Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: fix typos using codespellRuediger Meier2018-02-161-1/+1
| | | | | | Some more funny typos, please review carefully. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* 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>
* 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>
* 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-241-3/+16
| | | | | | | | | | | | | 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: use fdisk_reread_changes()Karel Zak2017-07-141-1/+5
| | | | | | Let's make fdisk usable for disks where some partitions are mounted. 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: add static keyword to where needed [smatch scan]Sami Kerola2017-02-201-8/+8
| | | | | | | text-utils/rev.c:68:9: warning: symbol 'buf' was not declared. Should it be static? Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* fdisk: improve --wipe functionalityKarel Zak2017-02-141-15/+18
| | | | | | | | | * 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>
* 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 various typosSebastian Rasmussen2016-05-311-3/+3
| | | | | | | Fix various typos in error messages, warnings, debug strings, comments and names of static functions. Signed-off-by: Sebastian Rasmussen <sebras@gmail.com>
* fdisk: Add support for altering GPT sizeSassan Panahinejad2016-05-181-0/+8
| | | | Adds an options (l) to the GPT menu to resize the GPT.
* fdisk: add --wipe-partitions=auto|never|defaultKarel Zak2016-05-041-1/+37
| | | | | | | | | | | | | The option allows to remove filesystes/RAIDs from newly created partitions before the partition table is updated (and partition device created). The default is "auto" in this case wipe is enabled in interactive mode only and user's confirmation (yes/no dialog) is required. Note that keep filesystem signature on partition is pretty valid use-case, so we don't erase anything by default. Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: remove dead assignment [clang analyze]Karel Zak2016-03-291-1/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: fix icc/clang compiler warningsRuediger Meier2016-03-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | clang warning: libmount/src/tab.c:1833:6: warning: variable 'rc' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (!mpc) ^~~~ icc printf warnings: libmount/src/monitor.c(348): warning #2279: printf/scanf format not a string literal and no format arguments DBG(MONITOR, ul_debugobj(mn, status == 1 ? " success" : " nothing")); ^ login-utils/vipw.c(348): warning #2279: printf/scanf format not a string literal and no format arguments : _("You are using shadow passwords on this system.\n")); ^ icc enum warnings: disk-utils/fdisk-menu.c(150): warning #188: enumerated type mixed with another type .exclude = FDISK_DISKLABEL_GPT | FDISK_DISKLABEL_BSD, ^ libsmartcols/src/table_print.c(750): warning #188: enumerated type mixed with another type &width, align, ^ Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* fdisk: fix warning, uninitialized variableRuediger Meier2016-03-081-1/+1
| | | | | | This was a typo in 4afb337e. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* fdisk: make 'f' command more verboseKarel Zak2016-02-031-0/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* textual: adjust grammar and punctuation of some messagesBenno Schulenberg2015-08-031-1/+1
| | | | | | | Also equalize three messages to one other one, and fix a typo in USE_COLORS_BY_DEFAULT. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* fdisk: value is never read [clang analyze]Karel Zak2015-07-291-1/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: value is never read [clang analyze]Karel Zak2015-07-291-1/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: add 'F' command to list free unpartitioned spaceKarel Zak2015-07-281-0/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: add the 'i'nfo commandJean-Loup 'clippix' Bogalho2015-05-111-0/+4
| | | | | | | Add the 'i'nfo command to fdisk that prints details about a specific partition. Details are everything the function 'fdisk_label_get_field' can return. Signed-off-by: Jean-Loup 'clippix' Bogalho <clippix@lse.epita.fr>
* fdisk: check return and robust label usage [coverity scan]Karel Zak2015-01-281-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* textual: fix spellos and inconsistencies in several program messagesBenno Schulenberg2015-01-261-3/+3
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* libfdisk: rename and move functionKarel Zak2014-11-261-9/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: remove flags from fdisk_ask APIKarel Zak2014-11-211-4/+2Star
| | | | | | We don't use it for anything usable, lets kill this over-engineering. Signed-off-by: Karel Zak <kzak@redhat.com>
* cfdisk: remove [Load] from menuKarel Zak2014-11-131-2/+2
| | | | | | | | | 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/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: add support for sfdisk scriptsKarel Zak2014-11-121-0/+78
| | | | | | | | | New commands 'I' and 'O' allows to read and write sfdisk compatible scripts by fdisk. It means that you can save your work (partition table) and later use it (in fdisk, sfdisk or cfdisk) to create a new partition table. Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (gpt) use generic API to change UUID and nameKarel Zak2014-10-071-2/+28
| | | | 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>
* libfdisk: use reference counting for contextKarel Zak2014-08-281-4/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: add independent debug stuffKarel Zak2014-08-151-16/+16
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: use libfdisk public API onlyKarel Zak2014-08-151-18/+31
| | | | 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-15/+15
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: make disk sync() optionalKarel Zak2014-07-151-1/+1
| | | | | | | ... this allows to avoid unnecessary sync() from cfdisk. Reported-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: support colors customizationKarel Zak2014-05-131-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: add partitions reorder operation to label APIKarel Zak2014-04-181-4/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: properly implement read-only modeKarel Zak2014-03-211-0/+4
| | | | | | | | | | Don't use fallback to read-only mode in fdisk_context_assign_device(), it's application responsibility open the device in the right mode. The commands fdisk and cfdisk check (and report) read-only mode now. Reported-by: Maciej Małecki <me@mmalecki.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: use new debug functionsKarel Zak2014-03-211-15/+15
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: ove fdisks to disk-utilsKarel Zak2014-03-111-0/+880
Signed-off-by: Karel Zak <kzak@redhat.com>