Commit Graph

9837 Commits

Author SHA1 Message Date
Karel Zak de8d3863c8 lib/strv: add strv_extendv()
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-10-01 14:43:05 +02:00
Karel Zak d5358bbb6b libuuid: fix buffer overflow with long paths
Based on patch from Justin Akers, he wrote:
> When building Openembedded inside a Jenkins matrix job the paths can
> get quite long. This ensures libuuid won't crash when attempting to
> connect to uuidd in such a scenario.

Reported-by: Justin Akers <dafugg@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-30 12:42:16 +02:00
Karel Zak 1ceb4077af zramctl: fix lists of the all devices
The command zramctl lists the same stat info for all devices (DATA COMPR TOTAL).

Reported-by: Oliver Freyermuth <o.freyermuth@googlemail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-24 12:46:21 +02:00
Karel Zak 2355dd6a49 libblkid: add read() based fallback for char (UBI) devs
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-24 11:10:09 +02:00
Karel Zak a674a0ab03 libblkid: use mmap() rather than read()
diff between
	perf stat -e 'syscalls:sys_enter_*'
for old and new version:

-                35      syscalls:sys_enter_lseek
-                38      syscalls:sys_enter_read
+                 3      syscalls:sys_enter_read
...
-                19      syscalls:sys_enter_mmap
+                17      syscalls:sys_enter_mmap

-       0.001083084 seconds time elapsed
+       0.000751722 seconds time elapsed

The patch dramatically reduces malloc()+seek()+read() operations in
libblkid. The code mmaps ~2MiB of the begin and the end of the device
and it moves buffers management to kernel.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-24 11:10:09 +02:00
Karel Zak 9325a8be9e libblkid: (zfs) keep bufferes read-only
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-24 11:10:09 +02:00
Karel Zak 6b86ef4a6a libblkid: (promise raid) cleanup code
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-24 11:10:09 +02:00
Karel Zak 7020de0be8 lib/crc32: don't require to modify GPT header
This patch introduces smart crc32 function that is able to exclude
specified. The advantage is that we does not have to modify GPT header
(set the current in-header crc field to zero) when we count crc32.

This allows to keep GPT header in read-only buffers and simplify code.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-24 09:26:42 +02:00
Karel Zak aab9be66c4 sfdisk: add --delete
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-17 13:57:44 +02:00
Karel Zak 83677b99cb libfdisk: fix partition move/resize code
- verify that the new partition fits to the area if the size of the
  has not been modified
- fix remaining space calculation (yes, brown-paper-bag bug..)
- offer also space before first partition as free space

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-17 13:22:11 +02:00
Karel Zak f2be8b3dfc libfdisk: add more debug message to resize code
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-17 12:04:23 +02:00
Karel Zak 31c79e1823 sfdisk: fix -N return code detection, add debug messages
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-17 11:45:02 +02:00
Karel Zak c949fa98d8 libfdisk: (gpt) control ranges in set_partition
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-17 11:44:08 +02:00
Karel Zak 53650755e0 ipcs: fix ipc_sem_get_limits()
Reported-by: https://github.com/AndrewIrcha
Addresses: e5995acda2 (commitcomment-13200369)
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-15 09:50:08 +02:00
Karel Zak 1d15c4b273 libmount: (monitor) remove unnecessary epoll EPOLLPRI
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-11 11:37:49 +02:00
Karel Zak 0250174654 libmount: (monitor) don't check for regular mtab
The monitor supports utab only (as documented). It's application
responsibility to use libmount in the right way. It's overkill to
check for valid environment during monitor initialization.

For example systemd checks for regular mtab during boot, it's better
than try to be smart later in libmount monitor when system is already
running.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-11 11:19:30 +02:00
Karel Zak d85a7fa744 sfdisk: cleanup and optimize --move-data
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-09 14:48:33 +02:00
Karel Zak 161f399f13 tests: add sfdisk --move-data test
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-09 14:43:31 +02:00
Karel Zak f42205d89a sfdisk: add --move-data
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-08 16:37:08 +02:00
Karel Zak 9a17d9460a sfdisk: add --reorder
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1232707
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-07 10:18:46 +02:00
Karel Zak cd150a429d build-sys: release++ (v2.27)
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-07 09:55:19 +02:00
Karel Zak dbf5898fca docs: update v2.27-ReleaseNotes
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-07 09:53:37 +02:00
Karel Zak 8cc98eab8c docs: update AUTHORS file
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-07 09:50:08 +02:00
Karel Zak ac31e6f823 po: merge changes
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-07 09:47:51 +02:00
Yuri Chornoivan 242d1044d2 po: update uk.po (from translationproject.org) 2015-09-07 09:42:15 +02:00
Jakub Bogusz 7a9dfc96a4 po: update pl.po (from translationproject.org) 2015-09-07 09:42:15 +02:00
Takeshi Hamasaki 00a96dbb4e po: update ja.po (from translationproject.org) 2015-09-07 09:42:15 +02:00
Antonio Ceballos Roa 8e4f54d00e po: update es.po (from translationproject.org) 2015-09-07 09:42:14 +02:00
Michal Schmidt b632f55c29 logger: improve logger --journald man page example
The example use of logger --journald in the man page has a couple of flaws:
 - It's missing a "MESSAGE=" field. This is supposed to be the primary
   human readable text. Without it the log entry is invisible in a
   plain "journalctl" output.
 - The MESSAGE_ID is supposed to be a 128-bit hexadecimal string that
   globally uniquely identifies the message type.
   One can generate such an id with "journalctl --new-id".

This patches fixes the above and also changes the example to use a
here-document instead of printf. In my opinion it makes the expected
multi-line data format more obvious.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
2015-09-07 08:54:15 +02:00
Andreas Henriksson e8c0003481 hwclock: fix format warning in alpha code
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
2015-09-07 08:50:39 +02:00
Karel Zak 9d0655fe2d Merge branch 'build-sys' of https://github.com/kolyshkin/util-linux
* 'build-sys' of https://github.com/kolyshkin/util-linux:
  build-sys: allow gettext 0.17 to be used
  build-sys: allow autoconf < 2.64 to be used
2015-09-04 10:07:28 +02:00
Kir Kolyshkin 58dda170fb libmount: typo fixes
I was reading the code and found these mountinfo typos.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
2015-09-02 18:45:06 -07:00
Kir Kolyshkin e46a7f8efe build-sys: allow gettext 0.17 to be used
The requirement for gettext 0.18 was introduced by commit e3e16717
to pass --no-wrap option to msgmerge tool, which I guess improves
the process of updating po files for translators. At the same time,
unfortunately, it makes building from git fail on a RHEL/CentOS 6
system, as it comes with gettext 0.17.

Use the existing hack in autogen.sh to allow building with gettext 0.17,
with an appropriate warning so that the user is aware:

 warning: forcing autopoint to use old gettext 0.17

The only negative side effect of this patch I am aware of is
if gettext-0.17 is used, then --no-wrap is not being passed
to msgmerge (although msgmerge 1.17 already supports it), because
Makefile.in.in that comes with gettext 0.17 doesn't have MSGMERGE_OPTIONS.
From my POV, this is way better than to not being able to build.

NOTE if gettext 0.18.3 is installed, it is used and this patch
doesn't change anything; it only allows gettext 1.17 to be used
if this is all we have.

Cc: Benno Schulenberg <bensberg@justemail.net>
Cc: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
2015-09-02 18:42:24 -07:00
Kir Kolyshkin a8afc8c666 build-sys: allow autoconf < 2.64 to be used
Since commit 50d096a macro m4_ifblank is used, but as it is only
available in autoconf-2.64, on CentOS 6 system we end up with:

> $ ./autogen.sh
> configure:25396: error: possibly undefined macro: m4_ifblank
>       If this token and others are legitimate, please use
> m4_pattern_allow.
>       See the Autoconf documentation.
> [root@kir-ovz2 util-linux]# autoconf --version
> autoconf (GNU Autoconf) 2.63

So, the obvious thing to do would be to raise AC_PREREQ to 2.64
in configure.ac. But, given the facts that
 - autoconf 2.64 is not available for RHEL/CentOS 6,
 - the only need is one small macro,
it's better to just add the missing macro.

While at it, add the m4_ifnblank, too.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
2015-09-02 18:41:52 -07:00
Karel Zak dd49c7d6d6 libfdisk: (gpt) reorder only when necessary
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-02 14:51:00 +02:00
Karel Zak 2eca78be47 mount: remove XFS from man page, xfsprogs provides xfs(5)
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-02 10:56:24 +02:00
Karel Zak e03b613e8d lscpu: fix read_hypervisor_powerpc() logic
We care about /proc/device-tree/compatible content...

The patch also removes unnecessary path_exist(), it seems good enough
to call open() rather than access() + open().

Addresses: https://github.com/karelzak/util-linux/issues/218
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-01 12:37:18 +02:00
Karel Zak bc8ec36f62 tests: (blkid) update drbdmanage
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-31 14:10:24 +02:00
Karel Zak 5cea5be05f libfdisk: (bsd) add note about non-written parental MBR
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-31 13:24:33 +02:00
Karel Zak 7caa6b37be libblkid: use 'VERSION' rather than 'PERSISTENCE_VERSION'
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-31 13:23:55 +02:00
Karel Zak 7430affdd9 libblkid: (drbdmanage) improve version setting code
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-31 11:49:45 +02:00
Karel Zak 928f209cea libmount: fix compiler warning [-Wdiscarded-qualifiers]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-31 11:38:58 +02:00
Chen Qi 1b76608ef8 login: replace siginterrupt with sigaction
[kzak@redhat.com: - POSIX.1-2008 marks siginterrupt() as obsolete]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
2015-08-31 11:34:36 +02:00
Chen Qi 37edac9a0c build-sys: include errno.h instead of argp.h
configure should include errno.h instead of argp.h when
checking for presence of program_invocation_short_name
uclibc defines this to be const char* unlike util-linux-ng
which defines this to be char* so this error goes unnoticed
on glibc/eglibc systems.

here is the error it fixes

in file included from mountP.h:14:0,
                 from cache.c:29:
/home/kraj/work/slugos/build/tmp-slugos-uclibc/sysroots/nslu2le/usr/include/errno.h:55:46: error: conflicting types for '__progname'
../../../include/c.h:118:14: note: previous declaration of '__progname' was here
make[3]: *** [cache.lo] Error 1

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Jonathan Liu <net147@gmail.com>
2015-08-31 11:27:45 +02:00
Karel Zak 9ad7c4c8ed tests: (cal) update US week numbers
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-31 10:46:56 +02:00
Sami Kerola 03f8bc1f32 cal: check biggest week number correctly when highlighting
This allows Sunday based week 54 be highlighted, and deny week 54 for
Monday based weeks when year has only 52 weeks.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-08-31 10:15:12 +02:00
Sami Kerola e1abe57e18 cal: replace magic constants with symbolical values
This makes it easier to know what the values in guestion represent.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-08-31 10:15:11 +02:00
Sami Kerola efafeaf684 cal: correct gregorian week numbering
Jan 1 is always First week, and year always has 53 weeks.  The week 53
may be cut short, e.g., it may and often has fewer than 7 days.  Every
year 28 year intervals US week numbering continues all the way to 54th
week, such as 1972, 2000, and 2028.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1249486
Reported-by: Michal Toth
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-08-31 10:15:09 +02:00
Karel Zak 32c9ce4baf lib/sysfs: make sysfs_next_subsystem() more robust
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-31 10:11:01 +02:00
Andreas Henriksson 56e78cb532 lsblk: fix resource leak [coverity scan]
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
2015-08-31 10:09:45 +02:00