Commit Graph

12431 Commits

Author SHA1 Message Date
Karel Zak 63bf2439eb zramctl: use xstrdup()
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-30 12:21:03 +01:00
Libor Bukata a3612b81fe Added the support for lz4hc, deflate, and 842
compression algorithms in zramctl utility.

Signed-off-by: Libor Bukata <lbukata@gmail.com>
2018-01-24 17:10:09 +01:00
Vaclav Dolezal 568419b1aa libblkid: atari - don't add duplicate entries
This should protect against looped XGMs.

Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
2018-01-24 14:40:21 +01:00
Vaclav Dolezal 98d87b95de libblkid: atari - test if any partition fits disk size
Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
2018-01-24 14:40:21 +01:00
J William Piggott d7db28c6d6 cal: do not set months_in_row with -3 option
Having the -3 option set months_in_row causes ordinal days
to wrap; it overrides the automatic handling of months_in_row
that falls back to 2 month columns for ordinal days.

Before:
cal -3j 2020
                           2020

            July                         August                      September
Sun Mon Tue Wed Thu Fri Sat   Sun Mon Tue Wed Thu Fri Sat   Sun Mon Tue Wed Thu Fri Sat
    182 183 184 185 186 187                   213 214 215   244 245 246 247 248 249 250
188 189 190 191 192 193 194   216 217 218 219 220 221 222   251 252 253 254 255 256 257
195 196 197 198 199 200 201   223 224 225 226 227 228 229   258 259 260 261 262 263 264
202 203 204 205 206 207 208   230 231 232 233 234 235 236   265 266 267 268 269 270 271
209 210 211 212               237 238 239 240 241 242 243   272 273

Patched:
cal -3j 2020
                           2020

          December                      January
Sun Mon Tue Wed Thu Fri Sat   Sun Mon Tue Wed Thu Fri Sat
335 336 337 338 339 340 341                 1   2   3   4
342 343 344 345 346 347 348     5   6   7   8   9  10  11
349 350 351 352 353 354 355    12  13  14  15  16  17  18
356 357 358 359 360 361 362    19  20  21  22  23  24  25
363 364 365                    26  27  28  29  30  31

          February
Sun Mon Tue Wed Thu Fri Sat
                         32
 33  34  35  36  37  38  39
 40  41  42  43  44  45  46
 47  48  49  50  51  52  53
 54  55  56  57  58  59  60

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2018-01-24 13:24:33 +01:00
J William Piggott 2bcf8f7934 cal: honor num_months when only a year argument
I don't know if this was an oversight or an overzealous
interpretation of POSIX. Just in case, I'll address the
POSIX possibility. POSIX description for cal(1) says:

  If only the year operand is given, cal shall produce a
  calendar for all twelve months in the given calendar year.

It also says that cal(1) has no options, so in that context
if an option is given then it should be expected to override
POSIX behavior.

Before patched all of these command displayed a full year:
cal -1 2020
cal -3 2020
cal -n6 2020

Patched the number of months options are honored.

This patch also fixes the -1 option which was a no-op.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2018-01-24 13:24:33 +01:00
Mike Frysinger 0aade1d319 mount(8): drop redundant filesystem-specific sections
Add a new section to the top of the filesystem-specific chapter to point
people generally to the filesystem-specific man pages.  This way we can
delete all the redundant subsections that say the same thing.

These subsections are deleted because they offer no options.  Which is
the same as all the filesystems the kernel supports but this man page
doesn't explicitly list (of which there are a few).
  coherent minix ramfs romfs squashfs sysv xenix

These subsections are deleted because they simply point to the respective
<fs>(5) or mount.<fs>(8) page which we now document at the top.  Some also
discuss the syscall ABI, but that doesn't seem appropriate for this page.
  btrfs cifs ext2 ext3 ext4 nfs nfs4 proc smbfs tmpfs xfs

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2018-01-24 13:24:33 +01:00
Ruediger Meier 40defd0c4d rfkill: provide RFKILL_TYPE_FM if undefined
As discussed last year it's nice to be compatible to 2.6.32
https://www.spinics.net/lists/util-linux-ng/msg13963.html

BTW also re-define NUM_RFKILL_TYPES if needed, although we are
not really using it.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2018-01-24 12:53:36 +01:00
Ruediger Meier 839203c00e tests: fix fincore/count KNOWN_FAIL
It has to be set after calling ts_init.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2018-01-24 12:53:35 +01:00
root 20432749c1 tests: suppress warning for old sync(1)
Old sync(1) prints a warning which looks ugly among our
test output: "sync: ignoring all arguments"

Seen on travis, Ubuntu <= 14.04 (Trusty).

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2018-01-24 12:53:35 +01:00
Ruediger Meier 68ac426949 fsck.cramfs: fix error message
errno is invalid in case that we just read(3) too short.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2018-01-24 12:53:34 +01:00
Ruediger Meier c990f94cbc tests: rewrite fsck-bad-header
Fix test for systems with pagesize != 4096
Loop over many combinations of sizes, endianness and blocksizes.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2018-01-24 12:53:33 +01:00
Ruediger Meier 2374b1ab75 fsck.cramfs: fix crash when superblock size is too small
This hopefully fixes the original problem addressed by the reverted
patch 7cb962c7.

The bug was introduced by myself in
    f991dbd3 "fsck.cramfs: allow smaller superblock sizes"

CC: Tobias Stoeckmann <tobias@stoeckmann.org>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2018-01-24 12:53:31 +01:00
Ruediger Meier 919e372da8 Revert "fsck.cramfs: Fix bus error on broken file system."
This reverts commit 7cb962c770.

It can't be right that we mmap (start + super.size) bytes from a file
which is usually only super.size bytes large. The patch "fixed" a
problem when super.size is bad but now it fails for the correct case:

$ mkdir -p root/subdir
$ ./mkfs.cramfs -p root cramfs
$ ./fsck.cramfs cramfs
Bus error (core dumped)

We will fix the original problem later.

CC: Tobias Stoeckmann <tobias@stoeckmann.org>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2018-01-24 12:53:28 +01:00
Vaclav Dolezal 8273ef25fa tests: added missing expected outputs for partx (atari)
Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
2018-01-24 12:20:11 +01:00
Vaclav Dolezal 1ca8fba830 libblkid: atari - fix bad variable name
Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
2018-01-24 12:18:23 +01:00
Vaclav Dolezal 8326045ace tests: added test for libblkid atari pt
Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
2018-01-23 17:02:41 +01:00
Vaclav Dolezal 50c71f25ff libblkid: Support for Atari partitioning scheme
Addresses: https://github.com/karelzak/util-linux/issues/517
Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
2018-01-23 17:02:41 +01:00
Karel Zak c0b340bc99 tests: use subtests for weeknum cal(1) tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-22 17:09:25 +01:00
Karel Zak 940b55ac4b tests: use subtests for weekarg cal(1) tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-22 16:55:07 +01:00
Karel Zak 1b1f6f2511 test: use subtests for jan1753 cal(1) test
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-22 16:54:06 +01:00
Karel Zak 5b9138d952 tests: merge year cal(1) tests
* merge tests
* use subtests for cal(1) calls

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-22 16:01:14 +01:00
Karel Zak b0636cc11a tests: merge 1m and 3m cal(1) tests
* merge tests
* use subtests for cal(1) calls

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-22 16:01:06 +01:00
Karel Zak a88564a061 tests: merge sep1752 cal(1) tests
* merge tests
* use subtests for cal(1) calls

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-22 16:00:39 +01:00
Karel Zak 5c8324fb88 tests: use subtests for sep1752w test
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-22 15:01:05 +01:00
Karel Zak c24a4de605 tests: simplify cal(1) sep1752w test
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-22 14:44:40 +01:00
Karel Zak fbb94f5790 tests: add cal(1) --week=40 1752
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-22 14:26:39 +01:00
J William Piggott 6304358cb7 cal: fix first week calculation
Commit efafeaf set 1 Jan as week 1, but the change
was missed in week_to_day() and in the man page.

Before
cal --week=40 --iso 1752
      October 1752
   Su Mo Tu We Th Fr Sa
41  1  2  3  4  5  6  7
42  8  9 10 11 12 13 14
43 15 16 17 18 19 20 21
44 22 23 24 25 26 27 28
45 29 30 31

Patched
cal --week=40 --iso 1752
     September 1752
   Su Mo Tu We Th Fr Sa
36                 1  2
37  3  4  5  6  7  8  9
38 10 11 12 13 14 15 16
39 17 18 19 20 21 22 23
40 24 25 26 27 28 29 30

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2018-01-22 14:16:57 +01:00
J William Piggott e572a765f9 cal: fix week calculations for 1752
Before:
cal --week=39 1752
     September 1752
   Su Mo Tu We Th Fr Sa
36        1  2 14 15 16
37 17 18 19 20 21 22 23
38 24 25 26 27 28 29 30

Patched:
cal --week=39 1752
      October 1752
   Su Mo Tu We Th Fr Sa
39  1  2  3  4  5  6  7
40  8  9 10 11 12 13 14
41 15 16 17 18 19 20 21
42 22 23 24 25 26 27 28
43 29 30 31

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2018-01-22 14:16:57 +01:00
Karel Zak 6776ab6f60 Merge branch 'patch-2' of https://github.com/sourcejedi/util-linux
* 'patch-2' of https://github.com/sourcejedi/util-linux:
  mount(8): umount does not (anymore?) say `none busy'
2018-01-22 14:01:42 +01:00
Karel Zak 267b44e6ee mount: be more accurate in man page about propagation flags
Addresses: https://github.com/karelzak/util-linux/issues/565
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-22 13:54:49 +01:00
Karel Zak d4e89fc11f Merge branch 'master' of https://github.com/rluzynski/util-linux
* 'master' of https://github.com/rluzynski/util-linux:
  cal: Use ALTMON_* correctly
2018-01-22 13:31:22 +01:00
Karel Zak af808dfa6d lscpu: (arm) cleanup code
* check for strtol() errors
* fix indention
* fix coding style

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-22 13:20:51 +01:00
Karel Zak 8229df2093 lscpu: move ARM decoding to lscpu-arm.c
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-22 13:08:11 +01:00
Karel Zak 7106169441 lscpu: move struct lscpu_desc header file
The lscpu code is growing and it seems better to allow to make code
more structured.

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-22 13:04:12 +01:00
Karel Zak 7b0926acb0 Merge branch 'arm-cpus' of https://github.com/suihkulokki/util-linux
* 'arm-cpus' of https://github.com/suihkulokki/util-linux:
  lscpu: Decode ARM CPUs
2018-01-22 12:47:47 +01:00
Rafal Luzynski 4e12a62e88 cal: Use ALTMON_* correctly
cal: use ALTMON_* and _NL_ABALTMON_* constants to display
months in a standalone form correctly.  These constants have just
been newly added to glibc.  ALTMON_x has been used in BSD family
since 1990s and has been accepted as the future POSIX extension.
_NL_ABALTMON_* is exclusively a GNU extension but it is expected
to be added to POSIX in future.

More info: https://sourceware.org/bugzilla/show_bug.cgi?id=10871
2018-01-22 11:50:50 +01:00
J William Piggott 1dca3edc36 cal: fix julian calendars for large years
Before:
cal --r julian 31 12 2147483646
 December 2147483646
Su Mo Tu We Th Fr Sa
 1  2  3  4  5  6  7
 8  9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31

Patched:
cal --r julian 31 12 2147483646
 December 2147483646
Su Mo Tu We Th Fr Sa
                   1
 2  3  4  5  6  7  8
 9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31

Signed-off-by: J William Piggott <elseifthen@gmx.com>
2018-01-22 11:33:20 +01:00
Ruediger Meier af1bc027db build-sys: remove redundant EXTRA_DIST files
The sources of AC_CONFIG_FILES (*.in) are automatically
distributed.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2018-01-22 11:16:49 +01:00
Ruediger Meier 4beacf105e build-sys: avoid using prog_DEPENDENCIES
Use EXTRA_prog_DEPENDENCIES to have the benefit
of automake's automatic prog_DEPENDENCIES.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2018-01-22 11:16:49 +01:00
Ruediger Meier 0da03d4490 build-sys: remove unneeded dependencies on bla.h.in
We have already automakes's automatic dependencies like
  bla.h.in -> bla.h -> foo.o -> bar.la

An explicit direct dependency bla.h.in -> bar.la
is redundant and useless anyways.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2018-01-22 11:16:49 +01:00
Ruediger Meier a459f2ec33 build-sys: automake is able to find headers in builddir ...
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2018-01-22 11:16:49 +01:00
Ruediger Meier 1d667d8849 build-sys: remove generated headers from dist tar ball
Headers should only be listed in either *_HEADERS or
*_SOURCES, especially when we want nodist_*_HEADERS.

Since all the generated headers are made by configure we
don't even need to use BUILT_SOURCES or other tricks.

Also see automake docs 9.4.1 Built Sources Example:
  case "Build bindir.h from configure"

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2018-01-22 11:16:49 +01:00
J William Piggott ff4e18bd2d hwclock: add --ul-debug implementing debug.h
Undocumented at this time, because it is a skeleton
implementation.  More debugging points are to be added after
refactoring is complete, or ad hoc in the mean time.

When fully implemented, enough time may have passed that the
deprecated --debug could be used to replace --ul-debug.

[kzak@redhat.com: - use __UL_INIT_DEBUG_FROM_STRING() to initialize the mask
                  - add hwclock_init_debug()]

Coauthored-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: J William Piggott <elseifthen@gmx.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-22 11:10:22 +01:00
Alan Jenkins c72fa620b0
mount(8): umount does not (anymore?) say `none busy'
The closest I can get is with `mount`, so refer to that instead.

    # mount none -t proc /proc 
    mount: /proc: none already mounted or mount point busy.
    # umount /proc
    umount: /proc: target is busy.
    # (cd /root; umount proc)
    umount: /proc: target is busy.

Signed-off-by: Alan Jenkins <alan.christopher.jenkins@gmail.com>
2018-01-21 16:41:17 +00:00
Riku Voipio 744d62ee0c lscpu: Decode ARM CPUs
Since the kernel developers have refused to make /proc/cpuinfo user
understandable, implement mapping in userspace. lscpu is available for
most users via util-linux, so store the information here.

Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
2018-01-19 17:14:19 +02:00
Mike Frysinger 8fb096b2a7 mount(8): point people to the proc(5) page for mount options
This page is out of date wrt proc mount options, so point it to the
proc(5) page which is kept up to date.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2018-01-19 11:14:00 +01:00
Karel Zak aefa920a79 sfdisk: add hint about udev and flock to the man page
Addresses: https://github.com/karelzak/util-linux/issues/563
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-17 16:30:06 +01:00
Karel Zak 88e5d289d5 tests: mark fincore/count as KNOWN_FAIL
The test (or our expectations about Direct-IO) seems not robust
enough. I guess this is not fincore problem.

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-17 14:52:17 +01:00
Carlos Santos a9e4662d26 docs: add ISC licence
Save the top 21 lines of sys-utils/rfkill.c as COPYING.ISC. This is
useful for Linux distributions an integration tools like Buildroot,
to collect detailed legal information for each package.

[kzak@redhat.com: - remove C-comments and rfkill header]

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-01-17 14:38:49 +01:00