Commit Graph

1228 Commits

Author SHA1 Message Date
Karel Zak 347332796f fdisk: (man) add info about order for -l
Reported-by: Dan Jacobson <jidanni@jidanni.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-08 10:56:47 +01:00
Karel Zak 8d720dbed6 fdisk: support partition type name in dialogs
Command (m for help): t

Selected partition 1
Partition type or alias (type L to list all): linux root x86
Changed type of partition 'Linux /usr (x86)' to 'Linux root (x86)'.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-23 09:25:57 +01:00
Karel Zak 45c2daa612 sfdisk: support for type="partition type name"
For example:

 # echo 'size=10MiB, type="linux usr x86"' | sfdisk /dev/sdc
 ...
 New situation:

 Device     Start   End Sectors Size Type
 /dev/sdc1   2048 22527   20480  10M Linux /usr (x86)

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-23 09:25:36 +01:00
ToddRK deba6720fb fsck.cramfs: fix fsck.cramfs crashes on blocksizes > 4K
fsck.cramfs crashes when extracting a cramfs image with a 16KB blocksize.
The read_buffer is hardcoded for a 4KB blocksize.  When using a blocksize
larger than 4KB, the program's code uses indexes that go past the end of the
allocated space for the read_buffer and this causes the crash.

The following changes fix the problem for me in the latest 2.36.1 release of
fsck.cramfs.c.  However there are hardcoded values of 4096 in the code that
might cause problems under other circumstances and I have not attempted to
fix those.

[kzak@redhat.com: - some coding style changes to code]

Fixes: https://github.com/karelzak/util-linux/issues/1232
Signed-off-by: ToddRK <ToddRK@example.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-28 12:46:49 +01:00
Karel Zak b105446e69 mkswap: remove deprecated SELinux matchpathcon()
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-13 14:58:43 +01:00
Karel Zak ca27216aa6 build-sys: remove fallback for security_context_t
It seems like overkill to provide this #ifdef. For example coreutils
use "char *" for all selinux contexts (since 2014).

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-13 13:12:19 +01:00
Karel Zak 4b447adf50 Merge branch '2020wk47' of https://github.com/kerolasa/util-linux
* '2020wk47' of https://github.com/kerolasa/util-linux:
  build-sys: sort various lists in configure.ac
  mkswap: tell how to fix insecure permissions and owner in warning
  lsipc: make default output byte sizes to be in human units
  man: add missing backslash to caret printing macro
  lscpu: fix variable shadowing
  uuidgen: give hint in usage() what uuid namepaces can be used
  uuidgen: use errx() rather than fprintf() when priting errors
  libuuid: simplify uuid_is_null() check
  uuidparse: use uuid type definitions from libuuid header
  uuidparse: use libuuid function to test nil uuid
2021-01-05 15:20:50 +01:00
Karel Zak c15899c1cb cfdisk: (man) add info when cfdisk writes to the device
This is difference between (c)fdisk and GNU Parted, fdisks keep all
changes in memory until user explicitly ask for write operation.

Addresses: https://github.com/karelzak/util-linux/pull/1227
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-05 14:43:01 +01:00
Karel Zak 0257109c33 Merge branch 'disk-utils-document-resize' of https://github.com/vdmz/util-linux 2021-01-05 14:32:22 +01:00
Chris Hofstaedtler 45be288c8f cfdisk: show Q option when choosing label type
The new message is quite terse, but fits into 78 characters.

Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=894555
Signed-off-by: Chris Hofstaedtler <zeha@debian.org>
2021-01-05 12:53:51 +01:00
Karel Zak 1b39cd7f63 Merge branch 'spelling' of https://github.com/scop/util-linux
* 'spelling' of https://github.com/scop/util-linux:
  *: spelling and grammar fixes
2021-01-04 13:42:08 +01:00
Dmitriy Chestnykh 0d182490e3 cfdisk: Implemented cfdisk's opening in read-only mode
[kzak@redhat.com: - clean up the patch
                  - add note "Changes will remain in memory only."]

Addresses: https://github.com/karelzak/util-linux/issues/1209
Addresses: https://github.com/karelzak/util-linux/pull/1213
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-04 12:17:57 +01:00
Vincent McIntyre c186e148ea Show the 'r' option in the help menu 2021-01-02 11:02:35 +11:00
Vincent McIntyre 3e01d4a24d Manual pages: document the 'resize' command
Reported in https://bugs.debian.org/906918, https://bugs.debian.org/915971.

Signed-off-by: Vincent McIntyre <vincent.mcintyre@csiro.au>
2021-01-01 13:37:52 +11:00
Sami Kerola 8d6877239c
mkswap: tell how to fix insecure permissions and owner in warning
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-12-28 09:53:13 +00:00
Ville Skyttä 3c56068609 *: spelling and grammar fixes 2020-12-17 23:39:05 +02:00
Karel Zak ca6fcc1a89 mkswap: don't use deprecated security_context_t
libselinux >= 3.1 makes security_context_t type deprecated. Let's
ifdef it to avoid unwanted warnings.

Signed-off-by: Karel Zak <kzak@redhat.com>
2020-12-14 15:54:08 +01:00
Sami Kerola 3ea54b843c
man: make tilde and caret characters to render correctly
As mentioned in 'Generating optimal glyphs' title in the manual page
mentioned in reference:

    Where a proper caret (^) that renders well in both a terminal and PDF is
    required, use "\(ha".

    Using a naked "~" character results in a poor rendering in PDF.  Instead
    use "\(ti".

Reference: https://man7.org/linux/man-pages/man7/man-pages.7.html#STYLE_GUIDE
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-11-14 15:22:34 +00:00
Karel Zak ee7f4bee9b sfdisk: fix backward --move-data
* fix final message where number of moved sectors overflow number of
  all moved sectors

* align last step size before we use it for backward mode source and
  destination offsets calculation

Addresses: https://github.com/karelzak/util-linux/issues/1176
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-11-06 11:38:51 +01:00
Karel Zak 028043c2d5 Merge branch 'sfdisk-json-dump' of https://github.com/xnox/util-linux 2020-11-05 11:37:51 +01:00
Dimitri John Ledkov d7101e5911
sfdisk: correct --json --dump false exclusive
`--json` implies `--dump`, thus `--json --dump` must be
allowed. `--list-free` is incompatible with `--dump`, and thus also
with `--json`. Currently `--json --dump` is prohibited, even though
`--list-free` is not specified at all.

Regression introduced in 03154d2cf2.

Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
2020-11-04 12:47:55 +00:00
Samanta Navarro cb77628876 misc: fix typos [codespell]
Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
2020-11-04 11:42:25 +00:00
Karel Zak ebb5ca72f4 sfdisk: (docs) add more information about GPT attribute bits
Addresses: https://github.com/karelzak/util-linux/issues/1171
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-11-04 10:29:30 +01:00
Sami Kerola 43ce3e7311 sfdisk: do not free device name too soon [coverity scan]
Fixes use after free error.

CID: 360798
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-10-16 12:00:53 +02:00
Sami Kerola 7f9e76b4df fsck, libblkid: fix printf format string issue [coverity scan]
According to coverirty a printf format string contains an unrecognized
format specifier (CWE-628).  Lets avoid glibc extension "%m" that is same
as "%s", strerror(errno).

CID: 360699
CID: 360718
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-10-16 11:35:16 +02:00
Karel Zak 29decc7b37 sfdisk: disable bootbits protection on '--wipe always'
Addresses: https://github.com/karelzak/util-linux/issues/1156
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-10-15 12:04:15 +02:00
Karel Zak e57cbfe0aa mkfs.minix: add --lock and LOCK_BLOCK_DEVICE
Addresses: https://github.com/karelzak/util-linux/issues/921
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-10-14 11:33:13 +02:00
Karel Zak eee886ba1d build-sys: exclude GPL from libcommon
The library is not distributed and almost all code in this ar(1)
archive is Public Domain or LGPL ... but let's avoid any doubts and do
not mix non-GPL and GPL code there.

Addresses: https://github.com/karelzak/util-linux/issues/1157
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-10-06 13:26:36 +02:00
Karel Zak 134b6296e3 fdisk: always report fdisk_create_disklabel() errors
This is fdisk, cfdisk and sfdisk change to inform user about fdisk_create_disklabel()
issues.

Addresses: https://github.com/karelzak/util-linux/issues/1147
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-09-30 11:49:05 +02:00
Jakub Wilk 1973affe18 blockdev: fix man page formatting
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
2020-09-26 18:15:42 +02:00
Karel Zak 701f0385a0 mkswap: add --verbose, reduce extents check output
We do not need to provide details in the default output. It seems
better to hide it behind --verbose to be user-friendly.

Signed-off-by: Karel Zak <kzak@redhat.com>
2020-09-10 12:54:14 +02:00
Karel Zak e270d980ca mkswap: cleanup usage()
- don't use one string for all --help output
- use USAGE_* macros

Signed-off-by: Karel Zak <kzak@redhat.com>
2020-09-10 11:26:18 +02:00
Karel Zak 199cd674ad mkswap: remove unnecessary on FS_IOC_FIEMAP
This is something user cannot fix and extents check is nothing critical.

Signed-off-by: Karel Zak <kzak@redhat.com>
2020-09-09 15:50:39 +02:00
Karel Zak 29b68b9c7b mkswap: improve extents check
- remove unknown extent type (kernel does not care about it too)
- fix last_logical use in messages
- improve warning for DELALLOC extents
- check for hole at the end of the file

Reported-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-09-09 15:41:56 +02:00
Karel Zak 195025c29e mkswap: check for holes and unwanted extentd in file
Let's make mkswap(8) more user-friend and report possible swapon
issues already when user initialize a swap file. The extents check
produces warnings, no exit with error.

  # dd if=/dev/zero of=img count=100 bs=1MiB
  # chmod 0600 img

  # fallocate --dig-hole --offset 64520192 --length 1MiB img
  # fallocate --dig-hole --offset 84520960 --length 1MiB img

  # ./mkswap img
  mkswap: extents check failed:
    - hole detected at offset 64520192 (size 1048576 bytes)
    - hole detected at offset 84520960 (size 1048576 bytes)
  file img can be rejected by kernel on swap activation.

  Setting up swapspace version 1, size = 100 MiB (104853504 bytes)
  no label, UUID=92091112-26b5-47aa-a02a-592e52528319

It checks for holes in the file, and for unknown, inline, shared and
deallocated extents.

Addresses: https://github.com/karelzak/util-linux/issues/1120
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-09-09 11:10:51 +02:00
Michael Kerrisk (man-pages) 76054e1527 Manual pages: blockdev.8, sfdisk.8: typo fixes
Fix a couple of typos that I introduced.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-08-28 09:15:25 +02:00
Michael Kerrisk (man-pages) 89fdd6d439 Manual pages: sfdisk.8: Use less aggressive indenting
The page currently uses rather aggressive indenting, which doesn't
really improve readability, but does have cause ugly line filling.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-07-24 14:41:49 +02:00
Michael Kerrisk (man-pages) b382d543ed Manual pages: sfdisk.8: Minor wording and formatting fixes
Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-07-24 14:41:49 +02:00
Michael Kerrisk (man-pages) 8be2cc8171 Manual pages: raw.8: Minor formatting and wording fixes
Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-07-24 14:41:49 +02:00
Michael Kerrisk (man-pages) 342af74630 Manual pages: blockdev.8: Minor wording and formatting fixes
Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-07-24 14:41:49 +02:00
Chris Hofstaedtler 7259f318b9 manpages: fix "The example command" in AVAILABILITY section
Signed-off-by: Chris Hofstaedtler <zeha@debian.org>
2020-07-24 09:09:43 +02:00
Michael Kerrisk (man-pages) 4f68c8b179 Manual pages: various: reword "allow(s) to"
The wording "allow(s) to" is not grammatical English. Reword various
pages to use a more correct form such "can be use to" or "allows
the [noun] of".

Aklong the way, fix a few nearby wording errors in some pages.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-07-14 14:08:54 +02:00
Bjarni Ingi Gislason 39063fbe89 Subject: docs: disk-utils: change "allows to <verb>" to "allows <verb>ing"
The web site "lintian.debian.org" shows some examples of "allows to",
which are changed to "allows one to".

  I chose here to use gerund.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2020-07-14 10:37:52 +02:00
Wojtek Kaniewski 98aa9c815a disk-utils: Add reference to ufiformat(8)
fdformat(8) doesn't handle USB floppy disk drives. As legacy floppy
disk drives have become a scarce resource it would be nice to point
those poor souls trying to format their floppy disks to a utility that
doesn't throw "Invalid argument" at them.

Signed-off-by: Wojtek Kaniewski <wojtekka@toxygen.net>
2020-06-27 21:15:10 +02:00
Bjarni Ingi Gislason d7649cf0ec doc: disk-utils/*: Fix some warnings from "mandoc -T lint"
mandoc: ./disk-utils/fsck.minix.8:123:2: WARNING: skipping paragraph macro: PP empty

mandoc: ./disk-utils/isosize.8:8:2: WARNING: skipping paragraph macro: PP after SH

mandoc: ./disk-utils/sfdisk.8:262:4: STYLE: unterminated quoted argument

mandoc: ./disk-utils/swaplabel.8:57:2: WARNING: skipping paragraph macro: PP empty

####

  No change in the output from "nroff" or "groff".

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>

####
2020-06-15 11:28:01 +02:00
Karel Zak 99297d68b3 Merge branch 'fix_typo' of https://github.com/s-morishima/util-linux 2020-06-10 10:26:39 +02:00
Bjarni Ingi Gislason a0859be5c7 doc: Fix some warnings from "test-groff" for manuals
Source is current git content.

Output is from: test-groff -b -e -mandoc -T utf8 -rF0 -t -w w -z

  [ "test-groff" is a developmental version of "groff" ]

Input file is ././disk-utils/sfdisk.8

troff: backtrace: file '<./disk-utils/sfdisk.8>':67
troff: <./disk-utils/sfdisk.8>:67: warning: trailing space

Input file is ././misc-utils/kill.1

troff: backtrace: '/home/bg/git/groff/build/s-tmac/an-ext.tmac':133: macro 'EE'
troff: backtrace: file '<./misc-utils/kill.1>':167
troff: <./misc-utils/kill.1>:167: warning: macro 'mF' not defined
troff: backtrace: '/home/bg/git/groff/build/s-tmac/an-ext.tmac':134: macro 'EE'
troff: backtrace: file '<./misc-utils/kill.1>':167
troff: <./misc-utils/kill.1>:167: warning: number register 'mE' not defined
troff: backtrace: '/home/bg/git/groff/build/s-tmac/an-ext.tmac':134: macro 'EE'
troff: backtrace: file '<./misc-utils/kill.1>':167
troff: <./misc-utils/kill.1>:167: warning: bad font number
troff: backtrace: '/home/bg/git/groff/build/s-tmac/an-ext.tmac':135: macro 'EE'
troff: backtrace: file '<./misc-utils/kill.1>':167
troff: <./misc-utils/kill.1>:167: warning: number register 'sP' not defined
troff: backtrace: '/home/bg/git/groff/build/s-tmac/an-ext.tmac':134: macro 'EE'
troff: backtrace: file '<./misc-utils/kill.1>':170
troff: <./misc-utils/kill.1>:170: warning: bad font number

Input file is ././sys-utils/ipcs.1

<./sys-utils/ipcs.1>:103 (macro BR): only 1 argument, but more are expected

Input file is ././sys-utils/mount.8

<./sys-utils/mount.8>:68 (macro RB): only 1 argument, but more are expected
troff: backtrace: '/home/bg/git/groff/build/s-tmac/an-old.tmac':467: macro 'RB'
troff: backtrace: file '<./sys-utils/mount.8>':68
troff: <./sys-utils/mount.8>:68: warning [p 1, 3.5i]: can't break line
an-old.tmac: <./sys-utils/mount.8>:201 (.RE): warning: extra .RE or .RS is missing before it; "an-RS-open" is 0.
<./sys-utils/mount.8>:453 (macro BR): only 1 argument, but more are expected
<./sys-utils/mount.8>:500 (macro BR): only 1 argument, but more are expected
<./sys-utils/mount.8>:1050 (macro BR): only 1 argument, but more are expected

Input file is ././sys-utils/setpriv.1

<./sys-utils/setpriv.1>:17 (macro BR): only 1 argument, but more are expected
<./sys-utils/setpriv.1>:154 (macro BR): only 1 argument, but more are expected
<./sys-utils/setpriv.1>:166 (macro BR): only 1 argument, but more are expected

Input file is ././sys-utils/umount.8

<./sys-utils/umount.8>:145 (macro IR): only 1 argument, but more are expected

Input file is ././sys-utils/unshare.1

<./sys-utils/unshare.1>:266 (macro BR): only 1 argument, but more are expected

[kzak@redhat.com: - add .RS to fix extra .RE in mount.8]

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-06-10 10:22:58 +02:00
Shigeki Morishima aaa9df2d91 Manual page: fdisk.8: fix typo
It seems that "--wipe-partitions" is correct, not "--wipe-partition".

Signed-off-by: Shigeki Morishima <s.morishima@jp.fujitsu.com>
2020-06-10 02:12:30 +09:00
Stanislav Brabec 9147d2ad8a blockdev: Don't fail on missing start sector
It causes
 # blockdev --report" error:
 blockdev: /dev/dm-9: failed to read partition start from sysfs: No such file or directory

There is no reliable way to detect a geometry in this case. Report N/A
instead.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
Cc: Martin Wilck <martin.wilck@suse.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-06-05 10:04:21 +02:00
Michael Kerrisk (man-pages) 1538f6f636 Manual pages: wording fix: "another" ==> "other"
In several pages, there is a consistent wording problem: "another"
where "other" should be used. This wording problem can be
surprisingly confusing for native speakers, especially those
unaware that in some other languages, "another" and "other" can be
expressed with the same word.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-05-29 14:31:47 +02:00