Commit Graph

209 Commits

Author SHA1 Message Date
Karel Zak 6ae5e1e09c fdisk: add bsd, dos and sgi menus
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:55 +02:00
Karel Zak 3b4f9f1644 fdisk: detect menu entries collisions in debug mode
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:55 +02:00
Karel Zak 2a1a67df86 fdisk: add sun menu
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:55 +02:00
Karel Zak 161b0d1aa9 fdisk: add new stuff to display menus
fdisk menus:

 - driven by menu and menu_entry structs
 - supports normal and expect mode
 - supports multiple independent menus
 - supports menu separators to make output more readable
 - allows to exclude by whole menu or menu entries by label type

TODO:
 - define per label menus
 - per menu callback
 - sensitive only to keys defined in the currently printed menu

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:55 +02:00
Karel Zak 67dac5c5a3 fdisk: (gpt) add t, v and x to menu
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:55 +02:00
Karel Zak ad3b5e74ba fdisk: revert add 'G' to create SGI label to the main menu
'G' does not make sense, fdisk menus are case insensitive. Yes...

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:55 +02:00
Karel Zak 414b6b0f90 fdisk: always allow 'p'rint command in expert menu
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:54 +02:00
Karel Zak d87c7ce2bf fdisk: add asktype "string" and support UUID partition change
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:54 +02:00
Karel Zak b4bfbaddfa libfdisk: (sun) move driver from fdisk to library
... and also add fdisk_info_new_partition()

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:54 +02:00
Karel Zak 0d75581e44 libfdisk: add fdisk_scround()
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:54 +02:00
Karel Zak aec8d88349 fdisk: (gpt, sun) use fdisk_partname()
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:54 +02:00
Karel Zak 0e5bafbed2 fdisk: (sun) use tt.c to list disk label
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:54 +02:00
Karel Zak b1b1a7b7e2 fdisk: (sun) consolidate 'p'rint output
* use label operation list()
 * use generic fdisk geometry output for sun
 * don't duplicate geometry information

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:53 +02:00
Karel Zak a5c1b0fa20 libfdisk: add fdisk_context_enable_details()
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:53 +02:00
Karel Zak 3c5fb4757f libfdisk: add list() label operation
... and use it for GPT

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:53 +02:00
Karel Zak 0c870c1c73 libfdisk: add new 'ask' type TABLE
The new type could be used to print table-like output (for example
list of the partitions).

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:53 +02:00
Karel Zak 2719215751 fdisk: (sun) remove dead code
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:53 +02:00
Karel Zak 4d9b5956cf sfdisk: don't use word 'disk'.
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-07-15 12:14:10 +02:00
Sami Kerola c1ed5e513c sfdisk: assigned value is never read [clang-analyzer]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-07-09 14:25:12 +02:00
Sami Kerola f7fe97da22 docs: add missing options to sfdisk manual
And improve what is said about four of the dangerous options.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-07-09 14:24:49 +02:00
Sami Kerola cdd834c37d sfdisk: make unhiding as complete as possible
It is unlikely anyone will ever need this, but I like idea commands being
complete.  The partition id's that can be unhide after this change are;

Hidden HPFS/NTFS
Hidden W95 FAT32
Hidden W95 FAT32 (LBA)
Hidden W95 FAT16 (LBA)

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-07-09 14:24:47 +02:00
Benno Schulenberg f5ad61d173 docs: make description of --activate clearer on man page of sfdisk
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-07-09 11:12:08 +02:00
Benno Schulenberg eb2be4fd8b docs: improve formatting and wording of man pages for fdisk and cfdisk
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-07-09 11:12:01 +02:00
Karel Zak 3b347e2638 sfdisk: fix typo
Reported-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-07-01 14:06:16 +02:00
Karel Zak 541a2cd3ab sfdisk: clean up unhide code
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-07-01 11:11:24 +02:00
Sami Kerola b7dcc9661b sfdisk: replace my_warn() with warnx()
This change adds program name in front of error messages.  Often that
helps user to know which command sent message, when the command is
executed as part of script.

Unfortunately the prefixing can break scripts, as someone might have
wrote automation which expects output in the format it has always been.
In programmer terms, the change has an ABI change, which some may find
annoying.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-07-01 11:07:33 +02:00
Sami Kerola 072a6c1973 docs: correct sfdisk --activate instructions
The activate can be enabled by renaming the command to 'activate'.  Quite
confusingly the option and command arguments are interchangeable, and
depending on which one is defined as --activate option argument the
command will behave different rather different ways.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-07-01 11:07:29 +02:00
Sami Kerola 1c2020990b sfdisk: use program_invocation_short_name to determine program name
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-07-01 11:07:27 +02:00
Sami Kerola b980b6b682 sfdisk: clean up usage() functions
Includes removal of unhide usage function, which was never implemented.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-07-01 11:07:25 +02:00
Sami Kerola 345e4af46f sfdisk: use libc error printing function, and symbolic exit values
The commit removes all references to perror(), and replaces them with
either warn() or err().

References: http://marc.info/?l=util-linux-ng&m=137060043804592&w=2
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-07-01 11:07:23 +02:00
Nathan Rossi 8c9c527774 fdisk: add support for the MicroBlaze architecture
Add support to fdisk for the MicroBlaze architecture.

Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
2013-06-13 13:29:58 +02:00
Karel Zak 76b86412c6 fdisk: don't use ptes[] in generic code
... the array is MBR specific.

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-06-12 17:39:09 +02:00
Sami Kerola e1d58c7796 cfdisk: add long options to the command
Includes update to bash completion, and manual as well.

[kzak@redhat.com: - remove <<< syntax from bash-completion script]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-20 13:40:15 +02:00
Karel Zak 4df7954d47 sfdisk: don't call BLKRRPART for non-block devices
Reported-by: Bertrand Jacquin <beber@meleeweb.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-20 13:10:52 +02:00
Karel Zak 4fb18cde32 libfdisk: do not use va_list in the Ask API
# fdisk /dev/sda
  Welcome to fdisk (util-linux 2.23).

  [...]

  Command (m for help): a
  Segmentation fault (core dumped)

It's too fragile, the va_list implementation is architecture specific
and it seems we need such thing in libfdisk at all.

Reported-by: "Gabor Z. Papp" <gzp@papp.hu>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-09 13:06:02 +02:00
Benno Schulenberg a48c321dd1 textual: fixing typos in a warning and an error message
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-04-26 13:55:29 +02:00
Karel Zak bf74d70c64 cfdisk: fix ambiguous code
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-26 13:54:24 +02:00
Sami Kerola 835d1b7d2e sfdisk: check writing to a file descriptor was successful
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-26 13:26:06 +02:00
Sami Kerola c8e8b916ab cfdisk: check writing to a file descriptor was successful
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-26 13:26:06 +02:00
Sami Kerola 1d3762ee53 cfdisk: check writing to a file was successful
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-26 13:26:06 +02:00
Yuri Chornoivan ef75bc880e Fix various typos 2013-04-26 12:50:03 +02:00
Karel Zak 76f17cf260 fdisk: fix list types
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-18 14:38:49 +02:00
Karel Zak 48469f9086 fdisks: fix compiler warning
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-17 17:35:47 +02:00
Sami Kerola c9f63764dc various: fix shadow declarations [smatch scan]
libmount/src/tab.c:990:34: warning: symbol 'fs' shadows an earlier one
libmount/src/tab.c:970:26: originally declared here
misc-utils/findmnt.c:492:30: warning: symbol 'tmp' shadows an earlier one
misc-utils/findmnt.c:473:14: originally declared here
fdisks/fdiskdoslabel.c:211:36: warning: symbol 'pe' shadows an earlier one
fdisks/fdiskdoslabel.c:180:20: originally declared here
fdisks/fdiskdoslabel.c:639:34: warning: symbol 'i' shadows an earlier one
fdisks/fdiskdoslabel.c:578:16: originally declared here
fdisks/fdiskdoslabel.c:947:21: warning: symbol 'i' shadows an earlier one
fdisks/fdiskdoslabel.c:924:16: originally declared here
fdisks/fdiskdoslabel.c:976:29: warning: symbol 'i' shadows an earlier one
fdisks/fdiskdoslabel.c:924:16: originally declared here
fdisks/fdiskdoslabel.c:984:29: warning: symbol 'i' shadows an earlier one
fdisks/fdiskdoslabel.c:924:16: originally declared here

[kzak@redhat.com: - don't use local 'tmp' in findmnt.c]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-09 12:19:25 +02:00
Sami Kerola 3acc206d39 various: fix variable and function declarations [smatch scan]
disk-utils/fsck.minix.c:511:9: warning: mixing declarations and code
fdisks/sfdisk.c:982:5: warning: mixing declarations and code
fdisks/sfdisk.c:1254:5: warning: mixing declarations and code
fdisks/sfdisk.c:1564:5: warning: mixing declarations and code
lib/mbsalign.c:279:7: warning: mixing declarations and code
libblkid/src/devname.c:378:17: warning: mixing declarations and code
libfdisk/src/alignment.c:219:9: warning: mixing declarations and code
term-utils/wall.c:111:9: warning: mixing declarations and code
text-utils/col.c:418:19: warning: non-ANSI function declaration of function 'flush_blanks'
text-utils/col.c:553:12: warning: non-ANSI function declaration of function 'alloc_line'
text-utils/rev.c:105:9: warning: mixing declarations and code
text-utils/tailf.c:245:9: warning: mixing declarations and code

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-09 12:17:20 +02:00
Karel Zak eb6a03f3bf build-sys: set dependence fdisk -> libfdisk -> libuuid
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-21 15:34:24 +01:00
Karel Zak 46e7eac121 fdisk: remove unwanted operator [smatch scan]
Reported-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-21 08:12:35 +01:00
Karel Zak 9ed268d0a7 fdisk: improve MBR detection
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-12 11:58:34 +01:00
Karel Zak d23c661c47 fdisk: no more AIX "support"
The whole AIX support in fdisk has been limited to pretty poor AIX
magic string detection and warning that the AIX is unsupported. It's
too expensive to maintain such fdisk driver.

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-12 11:37:33 +01:00
Karel Zak 38de0706e8 fdisk: use comma in the ask-partition-number dialog (again)
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-12 10:58:33 +01:00