Commit Graph

12945 Commits

Author SHA1 Message Date
Karel Zak ed02256387 build-sys: release++ (v2.33-rc1)
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-25 11:26:58 +02:00
Karel Zak 99c92a4820 tests: add choom to build-sys test
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-24 11:37:13 +02:00
Karel Zak 71c7d37bc4 docs: fix gtkdoc warning
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-24 11:21:09 +02:00
Karel Zak 78686983e0 docs: update v2.33-ReleaseNotes
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-20 14:27:55 +02:00
Karel Zak 027ee85a1b docs: update AUTHORS file
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-20 12:19:06 +02:00
Karel Zak 251e171e51 po: merge changes
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-19 12:54:05 +02:00
Sebastian Rasmussen f0afad3164 po: update sv.po (from translationproject.org) 2018-09-19 12:49:46 +02:00
Rafael Fontenelle 395557fa04 po: update pt_BR.po (from translationproject.org) 2018-09-19 12:49:46 +02:00
Takeshi Hamasaki 91730da15b po: update ja.po (from translationproject.org) 2018-09-19 12:49:46 +02:00
Karel Zak ab295603e9 libfdisk: (docs) add missing function
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-19 12:00:59 +02:00
Karel Zak ccafadb7c5 lsblk: move udev and blkid stuff to lsblk-properties.c
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-19 11:40:17 +02:00
Karel Zak baad6dcc6e lsblk: cleanup udev/blkid properties code
* split properties to separate struct which is allocated only when
  udev or blkid provides some information

* use separate function for udev and blkid and hide details in generic
  get_device_properties()

* make sure we do not overwrite stuff udev and blkid (but this is only
  theoretic issue as we do not call get_properties_by_blkid() directly
  from code)

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-19 11:40:17 +02:00
Karel Zak a1b463d94a tests: update sfdisk resize
due to 2f35c1ead6

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-17 16:22:14 +02:00
Karel Zak 2f35c1ead6 libfdisk: count gaps to possible size when resize
The current code counts only partition sizes when it counts possible
space, but we have gaps between the partitions. It seems better to
count all based on offsets rather than sizes.

Addresses: https://github.com/karelzak/util-linux/issues/693
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-17 11:58:50 +02:00
Karel Zak 652cb1cd26 lsblk: encapsulate stat() usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-14 16:27:26 +02:00
Karel Zak 5b82289b60 lib/strutils: return from xstrmode()
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-14 16:26:38 +02:00
Karel Zak 82dae67d1a lsblk: differentiate between swap and mount
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-14 15:57:45 +02:00
Karel Zak 04be258d65 lsblk: use lsblk_ prefix mountpoint getter
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-14 15:49:00 +02:00
Karel Zak e0c016f11b lsblk: init/deinit libmount stuff
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-14 15:45:53 +02:00
Karel Zak cfb715ed1d lsblk: move mount stuff to lsblk-mnt.c
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-14 15:41:39 +02:00
Karel Zak 14560b7f54 lsblk: add lsblk.h
* move core struct to the header file
* move debug stuff to the header file

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-14 15:36:59 +02:00
Karel Zak bc405d641e lsblk: add columns FSAVAIL,FSSIZE,FSUSED,FSUSE%
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-13 12:11:06 +02:00
Karel Zak e4386c8cc0 libfdisk: accept grain script header
The "grain" variable is used to calculate partitions alignment. The
default is 1MiB (or minimal I/O size). The libfdisk provides API to overwrite
this default, but this feature has been nowhere accessible for
end-user.

This patch support for "grain: <size>" in libfdisk scripts.

Addresses: https://github.com/karelzak/util-linux/issues/688
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-12 13:26:18 +02:00
Karel Zak aef79c1f8e sfdisk: document script GPT headers
Add first-lba, last-lba and table-length to the sfdisk man page.

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-12 12:26:06 +02:00
Karel Zak 1a6f970363 Merge branch 'more' of https://github.com/kerolasa/util-linux
* 'more' of https://github.com/kerolasa/util-linux:
  more: rename functions
  more: rename variable names
  more: remove unnecessary ifdef preprosessor directives
  more: do not call fileno() for std{in,out,err} streams
  more: remove 'register' keywords
  more: remove pointless functions
  more: return is statement not a function
  more: remove dead code and useless comments
2018-09-11 13:42:52 +02:00
Karel Zak da6392177d unshare: remove -s from --help output
The code and man page do not assume -s to be short alias to
--setgroups.

This commit also a little bit change --help output formatting to make
it more readable and structured.

Addresses: https://github.com/karelzak/util-linux/pull/692
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-11 12:47:39 +02:00
Karel Zak 137599ebe1 lsblk: don't ask udev when --sysroot specified
We use --sysroot to get information about block devices from /proc and
/sys dumps. In this case does not make sense to read anything from
udev as udevd is about the current system devices.

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-11 09:53:18 +02:00
Matti Niemenmaa f1a7cfcb1d fallocate: add missing semicolon
This broke compilation when HAVE_POSIX_FALLOCATE was undefined. The typo
dates to the original posix_fallocate support added in commit
833f9a7aae.

Signed-off-by: Matti Niemenmaa <matti.niemenmaa+git@iki.fi>
2018-09-10 15:25:16 +03:00
Karel Zak 4698ffdfa1 Merge branch 'motd' of https://github.com/lnussel/util-linux 2018-09-10 10:35:32 +02:00
Karel Zak 13cbc6f21c lsblk: prefer MODEL from udev DB
sysfs device model is truncated to 16 characters:

> cat /sys/block/sda/device/model
Crucial_CT128MX1
> udevadm info --query=property /dev/sda | grep MODEL=
ID_MODEL=Crucial_CT128MX100SSD1

sysfs uses INQUARY response which has the 16 characters limitation and
udev uses something else.

Addresses: https://github.com/karelzak/util-linux/issues/690
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-10 10:31:17 +02:00
Ludwig Nussel 4866b71786 Add built in fallbacks for motd file
Use several locations for built in default for motd to allow for
e.g. run time generated motd without having to modify config files.
login.c already splits by colon.

/usr/share/misc/motd
  - chould be shipped by distributions
/run/motd
  - potentially run time created file with dynamic information
/etc/motd
  - for the admin fill with local information

Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de>
2018-09-07 09:47:25 +02:00
Karel Zak 27afe50168 script: be sensitive to another SIGCHLD ssi_codes
The current signalfd handler cares on CLD_EXITED only. It's pretty
insufficient as there is more situations (and codes) when child no
more running.

Addresses: https://github.com/karelzak/util-linux/issues/686
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-05 11:55:21 +02:00
Karel Zak 350f5c8df2 lscpu: use the first VM from /proc/sysinfo
Addresses: https://github.com/karelzak/util-linux/issues/685
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-04 14:30:37 +02:00
Karel Zak d0b75b03bc lscpu: make xasprintf call more robust
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-04 13:12:34 +02:00
Karel Zak f40e316f5e build-sys: default to /lib64 for ${exec_prefix}/lib64
We already default to /lib for the default $exec_prefix, but the current
configure does not care about /lib64 although the use-case is exactly
same as for /lib.

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-04 11:42:19 +02:00
Karel Zak 66620e411b docs: remove obsolete entry from TODO
Already implemented by commit cf654e1c3e.

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-03 15:53:41 +02:00
Sami Kerola 275d47c9b7
more: rename functions
This clarifies what various function calls are doing.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2018-09-02 18:30:12 +01:00
Sami Kerola d910f31110
more: rename variable names
Try to make variable names to tell what they do.  Earlier names have been in
more(1) since the command was first wrote, and it looks like coding
practices has changed since late 70's.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2018-09-02 18:28:09 +01:00
Sami Kerola 1e2cd595eb
more: remove unnecessary ifdef preprosessor directives
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2018-09-02 18:28:09 +01:00
Sami Kerola d2b540022b
more: do not call fileno() for std{in,out,err} streams
These file descriptor numbers are well known, use them from unistd.h

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2018-09-02 18:28:08 +01:00
Sami Kerola 0b735ea49e
more: remove 'register' keywords
One can only assume someone tried to make more(1) to run quicker.  More up
to date assumption is that compilers are fully capable optimizing binaries
without these sort of hints.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2018-09-02 18:28:08 +01:00
Sami Kerola 70824899b0
more: remove pointless functions
The curs_terminfo(3X) defines putp() as tputs(str, 1, putchar), so all of
these five functions can be replaced with putp().

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2018-09-02 18:28:08 +01:00
Sami Kerola f728d8baae
more: return is statement not a function
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2018-09-02 18:28:08 +01:00
Sami Kerola c8b1fa6046
more: remove dead code and useless comments
Removal of STOP requires explanation.  Looking unix-history-repo getline()
function in first BSD-3 version could return STOP.  By next tag BSD-4 the
return STOP had disappeared.  If I read this correctly that was a partial
removal, and second part has waited to be completed since 1980-11-16 when
BSD-4 was released.

Reference: https://github.com/dspinellis/unix-history-repo/blob/BSD-3-Snapshot-Development/usr/src/cmd/more.c#L501
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2018-09-02 18:28:08 +01:00
Karel Zak 7edaf221d6 test: update UUID v5 tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-08-31 12:48:46 +02:00
Karel Zak d6ddf07d31 libuuid: fix name-based UUIDs
The current version is not fully compatible with RFC4122. It
incorrectly encodes UUID variant

	xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx

where M is UUID version and N is UUID variant.

 $ python -c "import uuid ; print(uuid.uuid5(uuid.UUID(int=0), 'foo'))"
 aa752cea-8222-5bc8-acd9-555b090c0ccb
                    ^^

Old version:

 $ uuidgen --namespace 00000000-0000-0000-0000-000000000000 --name 'foo' --sha1
 aa752cea-8222-5bc8-8cd9-555b090c0ccb
                    ^^

Fixed version:
 ./uuidgen --namespace 00000000-0000-0000-0000-000000000000 --name 'foo' --sha1;
 aa752cea-8222-5bc8-acd9-555b090c0ccb
                    ^^

The patch uses uuid_unpack and uuid_pack. It makes code more readable
and allow to access proper octens. The same way we already use for
time and random based UUIDs.

Addresses: https://github.com/karelzak/util-linux/issues/683
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-08-31 12:43:17 +02:00
Karel Zak 9a312758ee libuuid: add note about RFC4122 UUID layout
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-08-31 10:08:46 +02:00
Karel Zak 1e3bc261d0 tests: update fdisk output
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-08-30 15:24:41 +02:00
Karel Zak 6ec4760967 fdisk: add "Disk model:" to the print output
Addresses: https://github.com/karelzak/util-linux/issues/682
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-08-30 14:01:54 +02:00
Karel Zak 745801e44a libfdisk: add fdisk_get_devmodel() and fdisk_get_devno()
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-08-30 14:01:46 +02:00