Commit Graph

849 Commits

Author SHA1 Message Date
Guan Xin feec8bd17e mount: fix typo
Signed-off-by: Guan Xin <guanx.bac@gmail.com>
2008-09-29 11:43:45 +02:00
Guan Xin 992283e8e4 umount: check for overlaid mounts
Linux cannot umount a device whose mount point is hidden by subsequent
mount(s). i.e. We must umount the devices associated to a mount point
in the reverse order of when they were mounted.  If umount was called
violating this rule, report error and exit.

Signed-off-by: Guan Xin <guanx.bac@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-29 11:38:06 +02:00
Karel Zak 6a0fbe2216 mount: add info about /proc/mounts to mount.1
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-29 11:04:59 +02:00
Karel Zak aa24a176ec mount: fix typo
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-25 22:25:38 +02:00
Karel Zak bd9d9f05e6 chrt: add NLS support, clean error messages and return codes
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-23 23:33:10 +02:00
Martin Steigerwald c779d6e94f chrt: support CFS SCHED_IDLE priority and document it
Signed-off-by: Martin Steigerwald <ms@teamix.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-23 23:28:00 +02:00
Karel Zak af53f0f1ca build-sys: add -luuid to BLKID_LIBS
The libblkid is always linked with libuuild, so this indirect
dependence in BLKID_LIBS is not a problem. This change helps to people
who compile util-linux-ng with non-standard prefix, ..etc.

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-17 13:49:45 +02:00
maximilian attems 3342f88dec partx: don't redeclare daddr_t
klibc porting fix, use proper include, nuke redefinition.
solaris.c:8: error: redefinition of typedef ‘daddr_t’
/usr/lib/klibc/include/sys/types.h:29: error: previous declaration of ‘daddr_t’ was here

Signed-off-by: maximilian attems <max@stro.at>
2008-09-16 11:29:42 +02:00
Karel Zak f635c336c4 ipcmk: add NLS support
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-10 16:03:43 +02:00
Karel Zak cc41c0a33e ipcmk: fix error codes and error messages
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-10 16:00:17 +02:00
Hayden James 1b3f133043 ipcmk: new command
Small patch to create an application that can easily create ad-hoc ipc
resources, along with man page.

[kzak@redhat.com: - rename from ipccreat to ipcmk
                  - minor coding style changes]

Signed-off-by: Hayden James <hayden.james@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-10 15:36:50 +02:00
Karel Zak 030d18fd2a ionice: add strtol() checks, cleanup usage text and man page
* cleanup usage() output

 * check strtol(); don't ignore wrong command line options

The original ionice design was a little broken, because it was
possible to specify a PID and also a COMMAND:

	ionice -c2 -p 123 /bin/foo

but the command /bin/foo was executed without requested scheduling
class. That's stupid behaviour.

Now you have to use "-p PID" **or** COMMAND, but not both. Nothing is
ignored and all options are checked.

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-06 14:54:01 +02:00
Stephan Maka ef0fe2e8aa ionice: let -p handle multiple PIDs
Makes ionice -p usable like renice, this time backwards compatible

[kzak@redhat.com: - fix coding style
                  - add ioprio_setpid()]

Signed-off-by: Stephan Maka <stephan@spaceboyz.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-05 16:18:14 +02:00
Karel Zak 53e9eda352 login: fix warning "dereferencing type-punned pointer will break strict-aliasing rules"
This patch fix problems with odd pam_get_iten( ..., void **) API.
(tested by gcc-4.1.2-42.el5.i386)

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-01 12:41:57 +02:00
Karel Zak 65158b1081 losetup: remove dependence on minor numbers
The latest kernel supports partitioned loop devices (kernel commit
476a4813cfddf7cf159956cc0e2d3c830c1507e3). Unfortunately, this change
makes minor numbers useless, because mirror number does not match with
loop device name (loop<N>).

We have to follow loop device names only.

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-21 12:06:25 +02:00
Karel Zak 32b40fec8f fdisk: round reported sizes rather than truncate
Exmaples (-old, +new):

- Disk /dev/mapper/bar: 266.6 GB, 266666666496 bytes
+ Disk /dev/mapper/bar: 266.7 GB, 266666666496 bytes

- WARNING: The size of this disk is 2.1 TB (2199023255552 bytes).
+ WARNING: The size of this disk is 2.2 TB (2199023255552 bytes).

Reported-by: Stepan Kasal <skasal@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-20 23:27:50 +02:00
Benno Schulenberg 455824187a ipcs: adjust some field positions and widths for correct alignment
[kzak@redhat.com:
	- note that "ipcs -m -t" did not work correctly on
          terminal with 80 columns
	- the change of output alignment should be mentioned
          in the Release Notes]

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2008-08-20 22:37:10 +02:00
Benno Schulenberg 11658135af ipcs: ungettextize the spacing of the table headers
It makes no sense to allow translators to adjust the spacing when
they cannot adjust the spacing of the actual data too.  Adjusting
such spacing is not really a translator's task.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2008-08-20 15:16:02 +02:00
Karel Zak 3174598ae3 fdisk: don't check for GPT when asked for disk size only
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-19 13:54:38 +02:00
Karel Zak ee5355e005 fdisk: warn users about 2.2TB dos partition limit
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-19 13:53:28 +02:00
Karel Zak 1b414d8935 swapon: -a has to complain, fix leaks
The "swapon -a" command (without "-e" option) has to complain always
when LABEL or UUID does not exist.

Test:

	# grep foo /etc/fstab
	LABEL=foo swap swap defaults 0 0

   Old version:

	# swapon -a; echo $?
	0

   Fixed version:

	# swapon -a; echo $?
	swapon: cannot find the device for LABEL=foo
	255

	# swapon -a -e; echo $?
	0

This version also fix two memory leaks.

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-19 01:22:02 +02:00
Karel Zak 27f9db17bd hwclock: don't open /dev/rtc repeatedly
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-18 14:08:57 +02:00
Karel Zak d92026e4c2 fdisk: remove obsolete information from man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-18 13:15:10 +02:00
Cai Qian c2abd9a0a5 lscpu: regression tests
This patch added regression tests for lscpu. It tests lscpu for 3
architecutres, i386, x86_64 and ia64, with data from 3 different
machines each.

Signed-off-by: Cai Qian <qcai@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-14 13:15:43 +02:00
Karel Zak 928e9f327f tests: detect libvolume_id when mount(8) is compiled
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-14 13:01:04 +02:00
Cai Qian 47b6e8b684 lscpu: --sysroot option and stable cache output
This patch added a --sysroot command-line option for testing purpose. It
also sorted cache names, and displayed cache information in a sorted
manner instead of randomly before. In addition, it had some other minor
fixes.

Signed-off-by: Cai Qian <qcai@redhat.com>
2008-08-14 12:22:29 +02:00
Karel Zak f4a94b4b2e docs: TODO update
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-14 11:48:26 +02:00
Karel Zak 5bd11d0d11 ionice: cleanup error messages, add NLS support
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-14 11:40:08 +02:00
Karel Zak 8eec9db243 ionice: cleanup man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-14 11:19:07 +02:00
Karel Zak 0c723f3490 scriptreplay: new implementation is out-of-sync
Reproduction steps:

1. Run "script -t 2>timing".
2. When the prompt comes up, hit return.
3. New prompt. Wait several seconds, then type "true" and hit return.
4. Repeat (3) as desired, then exit scripted shell.
5. Run "scriptreplay timing".

You'll find on the replay that, rather than waiting several seconds
between the prompt and true, the wait will actually occur after the
first "t" of true.

Reported-by: Micah Cowan <micah@cowan.name>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-13 11:54:13 +02:00
Karel Zak 55a4a75ca0 hwclock: read_hardware_clock_rtc() need to return error codes
We shouldn't ignore RTC_RD_TIME/RTCGET error codes.

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-13 11:47:10 +02:00
Kalev Soikonen ac1bb1ef93 hwclock: delay loop in set_hardware_clock_exact
- Avoid delaying 1.5 seconds when 0.5 will do.
- Guard for forward time resets as well.

[kzak@redhat.com: - fix the "Delaying.." debug message
                  - add comments]

Signed-off-by: Kalev Soikonen <ksop@hot.ee>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-13 11:43:59 +02:00
Karel Zak 982a4a5d98 hwclock: use time limit for synchronization busy wait
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-13 11:43:59 +02:00
Karel Zak 3b96a7acbc hwclock: use carefully synchronize_to_clock_tick() return codes
* It seems that

	rtc-isl1208 0-006f: chip found, driver version 0.3
	rtc-isl1208 0-006f: rtc core: registered rtc-isl1208 as rtc0
	rtc-isl1208 0-006f: rtc power failure detected, please set clock.

  causes that hardware clock returns persistent time and synchronization
  is impossible. The hwclock(8) has to ignore this problem and allows to
  set clock anyway.

* synchronize_to_clock_tick() shouldn't to print the "...got clock tick"
  debug message in case of failure.

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-13 11:40:23 +02:00
Karel Zak e8abdb3150 mount: add docs about utf8=0 for vfat
Addresses-Red-Hat-Bugzilla: #454354
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-12 14:58:50 +02:00
David Brownell 442d61c6e9 hwclock: remove x86_64-specific bogon
I was puzzled why "hwclock" wrongly reported my x86_64 sytem didn't
support RTC update interrupts.  Bogus #ifdef, that's why ... added
by the 2.11y patch (from 2.11t).  Probably this whole #ifdef should
just vanish ... if the kernel rejects UIE_ON, the program ought to
just cope with it.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2008-08-12 12:50:11 +02:00
Arkadiusz Miskiewicz 9ea8ac3775 build-sys: tgets is not in ncurses but in tinfo
ncurses library can be build with terminal related functions
landing in separate libtinfo library. Check for ncurses function
when testing ncurses library existence.

Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
2008-08-08 11:09:11 +02:00
Denis ChengRq b9ae48db4a sfdisk: print version should end with a newline
Signed-off-by: Denis ChengRq <crquan@gmail.com>
2008-08-08 11:08:18 +02:00
Karel Zak 28e984a419 hwclock: cleanup help output and man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-06 13:19:40 +02:00
Kalev Soikonen d458f94a7c hwclock: unshadow a diagnostic printf
- Bogus if test means one message is never produced.

- Avoid needless passing of a global variable (debug).

The --test option flag ought to be a global as well (and perhaps -n/--dry-run).

Signed-off-by: Kalev Soikonen <ksop@hot.ee>
2008-08-06 12:47:55 +02:00
Karel Zak f8d87ab139 rtcwake: cleanup return codes
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-06 12:36:10 +02:00
Gabriel Burt fc18118430 rtcwake: prefer RTC_WKALM_SET over RTC_ALM_SET
rtcwake: Prefer RTC_WKALM_SET over RTC_ALM_SET, fixing bug with not
waking up with new RTCs.  Also, return error if unable to set the alarm.

Signed-off-by: Gabriel Burt <gburt@novell.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-06 12:19:46 +02:00
Andrew McGill e8c7a57b4f script: don't flush input when starting script
script currently flushed the input buffer when starting up.  This undocumented
behaviour prevents typeahead when starting up (e.g. as part of .profile).
Rather retain queued input. Don't discard queued output either.

Signed-off-by: Andrew McGill <andrew@lunch.za.net>
2008-08-05 12:39:01 +02:00
Alexey Gladkov 8e678e2124 Fix dmesg.1 installation
Signed-off-by: Alexey Gladkov <legion@altlinux.org>
2008-08-05 12:25:59 +02:00
Karel Zak edb68d0ca3 losetup: looplist_* refactoring, remove scandir()
This patch replaces scandir-based implementation with readdir(). The
readdir(3) is less expensive and more portable (to non-glibc environment).

The patch also replaces sysfs-based solution with simpler /proc/partitions
parsing. The /proc/partitions includes all used loop devices on all systems
(include 2.4). This solution seems faster than scandir(/sys/block/) too.

Summary, the losetup (with this patch) uses three methods to found a
loop device:

  a) parse /proc/partitions to found already used loop devices (for
     loserup -a)

  b) stat(2) for all loop[0-7] devices (default number of loop devices).
     This is classic method from util-linux <= 2.13. This method is good
     enough for standard Linux machines with default number of loop
     devices.

  c) scan all /dev or /dev/loop/ for loop devices. This is useful for
     crazy people who need more than 8 loop devices.

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-04 13:54:27 +02:00
maximilian attems d144727bc3 use getpagesize()
getpagesize() is said to be more portable than sysconf(_SC_PAGESIZE)
to anything Linux.

this patch helps klibc porting effort as the sysconf
multiplex API is not supported there.

also remove comment of the switch to sysconf in mkswap.c.

Signed-off-by: maximilian attems <max@stro.at>
2008-07-30 13:26:58 +02:00
Matthias Koenig d50c5917f0 mount: retry on ENOMEDIUM
Due to a change in kernel behaviour when opening CDROM devices,
we need to retry the open/mount call when ENOMEDIUM is returned.

Explanation from Tejun Heo:
Okay, the difference is from the addition of cdrom_get_media_event()
call to both sr_drive_status() and ide_cdrom_drive_status().
Previously, the cdrom driver can't differentiate between tray closed
w/ no media and tray open and always returned tray open, which
triggers close and retry in the open logic which probably have delayed
things enough to get the media recognized.

Now the cdrom driver can discern between tray closed w/o media and
device not ready for other reasons and returns -ENOMEDIUM on the
former.  This is all good and dandy but the problem seems that some
drives report no media right after the tray is closed but it hasn't
properly detected the media yet.

It seems the only way to work around the problem is via sensible
retries (e.g.  try three times 5 secs apart) and I don't think we can
add that type of retry logic into cdrom open path.  Please note that
the previous logic wasn't water proof.  Some drives can take longer to
recognize the media is there and could have failed the in-kernel retry
too.  Also, reading the media can take quite some time and during that
period the drive reports media present but device not ready.  The
driver will retry the command (e.g. READ TOC for open) five times but
all of them can fail w/ EMEDIUMTYPE.

[kzak@redhat.com: - add CRDOM_NOMEDIUM_RETRIES to blkdev.h
                  - add verbose message to mount.c]

Signed-off-by: Matthias Koenig <mkoenig@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-07-30 13:21:14 +02:00
maximilian attems 6a99c0b286 mount: add shortoptions for bind, move and rbind
Reserving uppercase letters for mount operations:

    --move  | -M
    --bind  | -B
    --rbind | -R

Add lowercase for the most needed mount operation that happen
in initramfs: mount -M /sys /root/sys

Note, we still have shared-subtree operations (--make-{slave,private,...})
without short options.

[kzak@redhat.com: minor change in mount.8]

Signed-off-by: maximilian attems <max@stro.at>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-07-29 13:20:03 +02:00
Karel Zak 9615cd1d2f mount: add info about tz=UTC option for FAT to mount.8
CC: Joe Peterson <joe@skyrush.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-07-28 11:18:27 +02:00
maximilian attems d3e8f6598b remove CVS keywords
this patch removes old CVS keywords from comments.

mount(8) works for newer Linux then 0.99 ;)

Signed-off-by: maximilian attems <max@stro.at>
2008-07-28 11:10:08 +02:00