Commit Graph

390 Commits

Author SHA1 Message Date
Karel Zak 314a0dd8fc cfdisk: add help screen
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-11 11:35:14 +01:00
Karel Zak 6d6d9c1a51 cfdisk: improve add parttype UI
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-11 11:35:14 +01:00
Karel Zak 6fed9601fc cfdisk: add parttype dialog
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-11 11:35:14 +01:00
Karel Zak c400e535aa fdisk: remove unnecessary code
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-11 11:35:14 +01:00
Karel Zak 63128bbfdc cfdisk: consolidate menu descriptions
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-11 11:35:14 +01:00
Karel Zak ed8a13e6ee cfdisk: menu actions refactoring
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-11 11:35:14 +01:00
Karel Zak 7aa0d52963 cfdisk: add create lebel UI
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-11 11:35:14 +01:00
Karel Zak ac27ea5c28 cfdisk: consolidate menu move code
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-11 11:35:14 +01:00
Karel Zak 8a7261140f cfdisk: supports also vertical menus
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-11 11:35:14 +01:00
Karel Zak d051ea93b3 cfdisk: reorder abstract PT according to output
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-11 11:35:14 +01:00
Karel Zak 5139eca74a libfdisk: add dump functions, make freespace code generic
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-11 11:35:14 +01:00
Karel Zak 8903f7dfc9 cfdisk: improve tree output
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-11 11:35:14 +01:00
Karel Zak 45333e9d71 cfdisk: use tree-mode for extended, colorize freesapce
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-11 11:35:14 +01:00
Karel Zak 872d23897c cfdisk: follow default end if possible
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-11 11:35:14 +01:00
Karel Zak d80921acdf cfdisk: use real partno
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-11 11:35:13 +01:00
Karel Zak 91ba41ca29 cfdisk: support <size>S, and long hint messages
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-11 11:35:13 +01:00
Karel Zak 2cec794994 libfdisk: rewrite freespace code
* use separate function to get free space
 * allow to use label-specific get_freespace() function
   (this is necessary for MBR extended partitions mess)

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-11 11:35:13 +01:00
Karel Zak b1f583304f cfdisk: add UI for linfdisk menus, ask for size
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-11 11:35:13 +01:00
Karel Zak 5f3504f8c0 fdisk: use ASKTYPE_MENU
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-11 11:35:13 +01:00
Karel Zak 849968b9ba fdisk: fix 'p'rint error on empty PT
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-11 11:35:13 +01:00
Karel Zak 83fa0f8036 cfdisk: improve info line and menu updates
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-11 11:35:13 +01:00
Karel Zak 1af8003bd8 cfdisk: improve info line, add Delete action
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-11 11:35:13 +01:00
Karel Zak 00b4f26a5d cfdisk: update menu according to the current partition
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-11 11:35:13 +01:00
Karel Zak 8460875df9 cfdisk: add menu action functions
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-11 11:35:13 +01:00
Karel Zak 8c3a5a440f cfdisk: basic UI stuff 2014-03-11 11:35:13 +01:00
Karel Zak 9f670072f4 libfdisk: remove tt stuff from API
The include/tt.h has to be used only internally by the library (for
example to convert fdisk_table to string).

The fdisk_ask API should not be more used for complex tasks like print
partition table. The application has to use fdisk_get_table() and
fdisk_table_to_string() or something else.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-11 11:35:13 +01:00
Karel Zak d6cfa8b327 libfdisk: add reference counting to fdisk_partition
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-11 11:35:12 +01:00
Karel Zak 851515216f libfdisk: remove fdisk_get_partition_type()
Let's use more generic:

	fdisk_get_partition()
        fdisk_partition_get_parttype()

rather than fdisk_get_partition_type().

The patch also improves fdisk_get_partition() semantic to allocate
a new partition struct if the argument is NULL.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-11 11:35:12 +01:00
Ondrej Oprala d0c9ddc3cc lib/colors: check for /etc/terminal-colors.d/[util].disable
[kzak@redhat.com: - move paths to pathnames.h,
                  - use static path buffer]

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-11 09:38:09 +01:00
Karel Zak 38d663a6b3 fdisk: fix usage(), -l [<disk>]
Add square brackets, <disk> is optional for -l.

Reported-by: Phillip Susi <psusi@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-19 18:30:40 +01:00
Karel Zak 433d05ff9a libfdisk: (gpt) allow to work with hybrid GPT
Notes:

 * fdisk don't sync hybrid MBR with GPT
 * hybrid MBR is ignored and not overwritten by PBMR
 * users is informed about expert command 'M' to toggle between MBR
   and GPT mode. It's possible to manually modify hybrid MBR.

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-23 16:59:45 +02:00
Karel Zak 2d8988bd26 fdisk: reorder intro warnings
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-23 10:46:10 +02:00
Karel Zak f362d863c4 fdisk: (gpt) add A,B,R,S expert commands to modify attributes
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-23 10:46:10 +02:00
Karel Zak 48d4d93159 fdisk: fix printf stuff
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-23 10:46:10 +02:00
Karel Zak f92e181034 fdisk: add 'M' to access GPT nested protective/hybrid MBR
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-23 10:45:14 +02:00
Karel Zak ba5ad6a49e fdisk: fix man warning
error: run: man --warnings=all fdisks/fdisk.8 >/dev/null
<standard input>:209: cannot use a space as a starting delimiter

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-21 12:50:18 +02:00
Karel Zak e39966c6a0 fdisk: fix printf stuff
Unfortunately, fdisk_warn/info/.. function was not marked by
printf __attribute__.

We don't want to break gettext stuff now, so all compiler warnings
have been fixed by casts. This is temporary solution, after release it
will be necessary to fix all the strings.

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-15 12:46:35 +02:00
Benno Schulenberg b4362b6f84 docs: standardize the phrases for --help and --version in all man pages
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-15 10:28:30 +02:00
Benno Schulenberg 870a6df59c docs: tweak wording, grammar and formatting of fdisk man page
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-14 14:54:49 +02:00
Karel Zak 565b7da63e fdisk: add -t <type> to enable only specified type
In some cases (for example hybrid GPT) it's useful to force fdisk to
read only specified disk label and ignore everything else.

For example:

	# fdisk -l /dev/sda

	Disk /dev/sda: 149.1 GiB, 160041885696 bytes, 312581808 sectors
	Units: sectors of 1 * 512 = 512 bytes
	Sector size (logical/physical): 512 bytes / 512 bytes
	I/O size (minimum/optimal): 512 bytes / 512 bytes
	Disklabel type: gpt
	Disk identifier: 3549290F-417C-4941-8503-F7835109B821

	Device           Start          End   Size Type
	/dev/sda1         2048      2050047  1000M EFI System
	/dev/sda2      2050048      6146047     2G Microsoft basic data
	/dev/sda3      6146048     26462207   9.7G Linux swap
	/dev/sda4     26462208     98142207  34.2G Microsoft basic data
	/dev/sda5     98142208    230662143  63.2G Microsoft basic data
	/dev/sda6    230662144    312580095  39.1G Microsoft basic data

but when GPT is disabled we can access PMBR:

	# fdisk -l -t dos /dev/sda

	Disk /dev/sda: 149.1 GiB, 160041885696 bytes, 312581808 sectors
	Units: sectors of 1 * 512 = 512 bytes
	Sector size (logical/physical): 512 bytes / 512 bytes
	I/O size (minimum/optimal): 512 bytes / 512 bytes
	Disklabel type: dos
	Disk identifier: 0x00000000

	Device    Boot Start       End    Blocks  Id System
	/dev/sda1          1 312581807 156290903+ ee GPT

Reported-by: Craig <util-linux_contact@magister.com.au>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-09 16:11:31 +02:00
Benno Schulenberg aaa4382636 textual: use consistent wording and punctuation in fdisk stuff
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-08 15:38:39 +02:00
Benno Schulenberg fd56121ac3 textual: change spelling of "disk label" to the more abundant "disklabel"
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-08 15:38:39 +02:00
Benno Schulenberg cfa5f791bf textual: use the standard angular brackets for non-literal arguments
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-08 15:38:39 +02:00
Michael Forney b09bc5088b build-sys: Check for type sighandler_t and use if present
__sighandler_t is libc implementation specific and should not be relied
upon. Instead, we fall back upon void (*)(int), as specified by POSIX.

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-04 11:51:34 +02:00
Karel Zak c1d26ddbe7 Merge branch 'master' of https://github.com/yurchor/util-linux 2013-09-30 15:56:31 +02:00
Mike Frysinger 2b8f22bd90 clean up term lib handling
The ncurses package has been providing pkg-config files for a while now.
So let's start using them to get the proper linker & compiler flags.  It
can make a difference when ncurses is configured in a way that requires
extra link time flags but util-linux doesn't provide them, or when the
headers live in a weird place and util-linux can't find them.

Since the NCURSES_LIBS is always defined for the Makefile, there's no need
to gate on the HAVE_NCURSES conditional.  When it's disabled, the var will
simply be empty.

With a minor tweak to how tinfo is handled, we can do the same thing -- we
just always use TINFO_LIBS in the Makefile's.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-09-30 13:41:07 +02:00
Yuri Chornoivan 0d0d12adf8 Fix various typos 2013-09-28 13:33:59 +03:00
Karel Zak 5afed1872e fdisk: use xalloc stuff
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-26 10:58:03 +02:00
Karel Zak 96dc2798a8 fdisk: print geometry for dos-compatible mode too 2013-09-25 17:36:21 +02:00
Karel Zak b572966747 fdisk: fix 'r' in BSD menu
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-17 15:58:09 +02:00