summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* docs: fix TODO typosKarel Zak2015-04-281-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: update TODOKarel Zak2015-04-281-11/+1Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fsck: print errors on invalid -r argumentKarel Zak2015-04-281-14/+10Star
| | | | | | The patch also add support for -r 0. Signed-off-by: Karel Zak <kzak@redhat.com>
* fsck: implement fsck -r {fd}Stanislav Brabec2015-04-282-14/+63
| | | | | | | | | | | | | | | | | | | | Make possible sending of statistics to a dedicated file descriptor. Rationale: When UI is calling fsck from a remote terminal, fsck progress needs to be sent to stdout. It is mixed there with output of statistics, and it is impossible to parse the output to get the statistics. Now it will be possible e. g. with "fsck -C -r 3 /dev/sda1" Note: Code in if and else is intentionally partially duplicated. Current human readable output of floats does not conform to locale conventions, and may be changed in future. But we want to keep machine readable output exactly same as it is now. [kzak@redhat.com: - don't use report_stats_fd globally] Signed-off-by: Stanislav Brabec <sbrabec@suse.cz> Signed-off-by: Karel Zak <kzak@redhat.com>
* hwclock: fix spelling, punctuation and formatting mistakes in the man pageBenno Schulenberg2015-04-281-40/+38Star
| | | | | | Also improve some wordings. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* hwclock: clean up man page headerKarel Zak2015-04-281-17/+3Star
| | | | | | | | | | We already use .TQ in another man pages for years and nobody complains, so I guess the fallback is unnecessary. The patch also minimize in-header change-log. We have git for this purpose. Signed-off-by: Karel Zak <kzak@redhat.com>
* hwclock: remove an untrue phrase from the man pageBenno Schulenberg2015-04-281-5/+0Star
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* fsck: use PATH or fallback to /sbinKarel Zak2015-04-272-31/+10Star
| | | | | | | | | | | It's overkill to support all the obscure paths like /sbin/fs.d. We have PATH for customization, that's enough. It still seems like a good idea to keep fsck robust, because it's used by boot scripts/systemd. For this reason fsck fallbacks to "/sbin" if PATH is undefined or empty. Signed-off-by: Karel Zak <kzak@redhat.com>
* swapon: search for mkswap via PATHMike Frysinger2015-04-272-5/+3Star
| | | | | | | | Rather than hardcode /sbin/mkswap all the time, use a normal PATH search. This matches the normal behavior of other tools, and makes local testing easier. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* mkfs: drop hardcoded search pathMike Frysinger2015-04-272-30/+3Star
| | | | | | | | | | | Rather than maintain a hardcoded search path for looking up tools and override the user's PATH env setting, respect whatever the user has. This matches the convention of just about every other tool out there. It might break on systems that don't have /sbin in their PATH and they try to run /sbin/mkfs directly, but so be it. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* hwclock: flush stdout in hwclock -cAlexey Galakhov2015-04-271-0/+1
| | | | | | | | This allows using hwclock -c in automated test scripts that parse its output line-by-line. The standard output is flushed before each 10 second delay. Signed-off-by: Alexey Galakhov <agalakhov@gmail.com>
* hwclock: Remove TZUTCJ William Piggott2015-04-271-9/+2Star
| | | | | | | | | | | | | | | | | | | | | commit d53f8ecfbf036eddb2aef737dc0973a613d80ced introduced the TZUTC environment variable to facilitate use of the zoneinfo 'right' database. This was incorrect. Either the TZDIR environment variable should be used or a system-wide configuration for the 'right' database should be used. See hwclock(8) POSIX vs 'RIGHT' for more details. TZUTC was undocumented and should be safe to remove. The commit also caused a regression when using musl libc, because when TZUTC is unset getenv() returns a NULL pointer. Reported-by: Isaac Dunham <ibid.ag@gmail.com> Signed-off-by: J William Piggott <elseifthen@gmx.com>
* test_uuidd: add commentKarel Zak2015-04-241-0/+17
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* test_uuidd: add pid, tid and idx back to objectKarel Zak2015-04-241-5/+10
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* test_uuidd: make objdump more robustKarel Zak2015-04-241-4/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* test_uuidd: fix includeKarel Zak2015-04-241-2/+1Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* test_uuidd: don't exit on failed pthread_create()Karel Zak2015-04-241-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* test_uuidd: don't exit on failed pthread_create()Karel Zak2015-04-241-8/+22
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* test_uuidd: improve readabilityKarel Zak2015-04-241-64/+82
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* test_uuidd: cleanup counters namesKarel Zak2015-04-241-35/+35
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* test_uuidd: cleanup pid usageKarel Zak2015-04-241-25/+23Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* test_uuidd: cleanup used typesKarel Zak2015-04-241-74/+71Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* test_uuidd: err messages, argv[] parsing and another cleanupsKarel Zak2015-04-242-198/+132Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: add uuidd test programHuschaam Hussain2015-04-242-0/+362
| | | | | References: https://bugzilla.redhat.com/show_bug.cgi?id=678306 Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: fix sfdisk GPT testKarel Zak2015-04-233-4/+4
| | | | | | | The test uses too large last partition, libfdisk checks this problem now. Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (gpt) add extra check for First/Last LBAKarel Zak2015-04-232-2/+18
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: add sfdisk resize tests for GPTKarel Zak2015-04-2315-1/+359
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (gpt) fix end sector calculation on resizeKarel Zak2015-04-231-2/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: add sfdisk resize regression tests for MBRKarel Zak2015-04-2216-0/+482
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: fix scriptk parser to support alone signsKarel Zak2015-04-221-6/+8
| | | | | | for example echo "- - - *" | sfdisk /dev/sda1 -N1 Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: allow to move start to first usable LBAKarel Zak2015-04-221-4/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: add warning to resize functionKarel Zak2015-04-221-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: support resize operation in fdisk_set_partition()Karel Zak2015-04-221-14/+227
| | | | | | | Note that the resize is not exported by API yet, the only way to use it is sfdisk-like scripts. Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: add fdisk_table_get_partition_by_partno()Karel Zak2015-04-224-1/+40
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: fix script parser to support resize operationsKarel Zak2015-04-222-4/+41
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: don't resize in label driversKarel Zak2015-04-222-36/+0Star
| | | | | | The resize operation has to be implemented on upper layer. Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (gpt) fix LE usageKarel Zak2015-04-221-10/+10
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/strutils: fix string_add_to_idarray() int vs. size_tKarel Zak2015-04-228-25/+33
| | | | | | | | | | | | | | | | | | | | The function uses "int" as argument, but for array size (and index) is better to use unsigned type (size_t). If we mix "size_t" in util (e.g. fdisk) and "int" in lib/strutils.c then result is unexpected behavior on ppc64. # sfdisk --list -o DEVICE,START,SIZE /dev/sdb Disk /dev/sdb: 50 MiB, 52428800 bytes, 102400 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 32768 bytes Disklabel type: gpt Disk identifier: 3B8559DB-33AF-43E9-BEFC-C331D829B539 lt-sfdisk: libfdisk/src/label.c:178: fdisk_label_get_field: Assertion `id > 0' failed. The patch cleanup all code to use size_t everywhere. Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk, sfdisk: fix -o <list> backendKarel Zak2015-04-221-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'tests-refactor-loop-cleanup' of ↵Karel Zak2015-04-2256-315/+211Star
|\ | | | | | | | | | | | | | | | | | | | | https://github.com/rudimeier/util-linux * 'tests-refactor-loop-cleanup' of https://github.com/rudimeier/util-linux: tests: never use -o pipefail tests: loop tests, don't call ts_die() with DEVICE parameter tests: scsi_debug tests, don't call ts_die() with DEVICE parameter tests: introduce TS_LOOP_DEVS for cleanup tests: introduce ts_cleanup_on_exit()
| * tests: never use -o pipefailRuediger Meier2015-04-2148-85/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was hard to find out that pipefail was the reason why our test-suite could have random failures for aribtrary tests, for example the ones which are using ts_device_has_uuid() or ts_mount(). Bash's pipefall option is evil! It may return error for such a simple line like this one $ echo -e "xxx\nyyy" | grep -q "xxx" because the left echo command will get SIGPIPE when grep exits after the first match. So the command line above could return an error eventhough it does exactly what we want. This patch removes any pipefail from our tests. The funny thing is that I couldn't find any case where we relied on this feature anyway. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * tests: loop tests, don't call ts_die() with DEVICE parameterRuediger Meier2015-04-1425-114/+114
| | | | | | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * tests: scsi_debug tests, don't call ts_die() with DEVICE parameterRuediger Meier2015-04-144-6/+6
| | | | | | | | | | | | This was almost useless anyway. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * tests: introduce TS_LOOP_DEVS for cleanupRuediger Meier2015-04-1431-105/+80Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We are maintaining an array TS_LOOP_DEVS to de-initialize devices always on exit. Until now there was no cleanup in ts_skip(). The downside is that we can't execute ts_device_init() in a subshell anymore. The device is returned via global variable TS_LODEV, similar like we do already in ts_scsi_debug_init(). Tests which don't use ts_device_init() to create loop devices may use ts_register_loop_device() to get them cleaned up later. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * tests: introduce ts_cleanup_on_exit()Ruediger Meier2015-04-141-5/+11
| | | | | | | | | | | | | | | | | | | | ts_cleanup_on_exit() is always called on exit, e.g. after ts_skip, ts_die, ts_finalize ... A first usage example is the cleanup of TS_SUID_PROGS which is now also done on ts_skip. Later we want to fix some left loop devices. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | Merge branch 'test-fix' of https://github.com/rudimeier/util-linuxKarel Zak2015-04-222-2/+2
|\ \
| * | tests: config.h lives in build directoryRuediger Meier2015-04-222-2/+2
| | | | | | | | | | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | | hwclock: remove dead codeJ William Piggott2015-04-211-14/+0Star
| | | | | | | | | | | | | | | | | | | | | Removes never used #ifdef dead code. Reported-by: Karel Zak <kzak@redhat.com> Signed-off-by: J William Piggott <elseifthen@gmx.com>
* | | hwclock: regression fixJ William Piggott2015-04-211-4/+5
|/ / | | | | | | | | | | | | | | | | | | Commit ab8f402952301106ad0bd5c5a51dc8646d1bff64 regression where synchronize_to_clock_tick_rtc() only returns the correct value for a select() time out if using debug mode. This caused hwclock to have invalid output when select() timed out in normal mode. Signed-off-by: J William Piggott <elseifthen@gmx.com>
* | sfdisk: don't use BLKRRPART to check loopdev usageKarel Zak2015-04-171-1/+3
| | | | | | | | | | | | | | It seesm that kernel always returns EINVAL for BLKRRPART on loop devices, we call the ioctl to check if nobody else uses the device. Signed-off-by: Karel Zak <kzak@redhat.com>