summaryrefslogtreecommitdiffstats
path: root/sys-utils
Commit message (Collapse)AuthorAgeFilesLines
* dmesg: fix typo in man pageKen Kopin2009-10-191-1/+1
| | | | Signed-off-by: LaMont Jones <lamont@debian.org>
* ldattach: use c.hKarel Zak2009-10-161-4/+1Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* switch_root: remove TIOCSCTTY and setsid()Karel Zak2009-10-091-7/+0Star
| | | | | | | | | requested by dracut developers because: bash: cannot set terminal process group (-1): Inappropriate ioctl for device Addresses-Red-Hat-Bug: #519237 Signed-off-by: Karel Zak <kzak@redhat.com>
* ipcs: use __GLIBC__ instead of obsolete __GNU_LIBRARY__Guillem Jover2009-10-091-3/+1Star
| | | | | | | | The latter is obsolete and it's currently defined to 6 for historical reasons (as per comment in <features.h>) instead of 2 as what would be expected. Signed-off-by: Guillem Jover <guillem@hadrons.org>
* build-sys: check for union semun instead of using _SEM_SEMUN_UNDEFINEDGuillem Jover2009-10-092-6/+2Star
| | | | | | | | | | | | | | Older versions of glibc used to declare ‘union semun’ in <sys/sem.h>, but POSIX.1-2001 requires the caller to declare it instead. Later versions of glibc started defining _SEM_SEMUN_UNDEFINED to note that the union was not being declared, but conforming systems are not required to define that macro (e.g. FreeBSD). As a side effect we get rid of some obsolete __GNU_LIBRARY__ macro usage. [kzak@redhat.com: - use #ifndef] Signed-off-by: Guillem Jover <guillem@hadrons.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* fallocate: check for ERANGE errorsKarel Zak2009-10-061-0/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: cleanup --disable-{fallocate,pivot_root,unshare}Karel Zak2009-10-061-2/+2
| | | | | | | | * add --disable-fallocate * add --disable-pivot_root * cleanup --disable-unshare Signed-off-by: Karel Zak <kzak@redhat.com>
* unshare: new commandMikhail Gusarov2009-10-064-0/+183
| | | | | | | | | | | | New utility allows to run process with separate mount, UTC, IPC or network namespaces. [kzak@redhat.com: - some cosmetic changes in usage() and err() usage - move "if BUILD_UNSHARE" to separate place in Makefile.am - add unshare to .gitignore] Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* fallocate: new commandKarel Zak2009-09-224-0/+230
| | | | | | | | | | | | | | | | | | | | | | | | The fallocate(1) utility is used to preallocate blocks to a file. This can be useful for virtual images, database files, testing, etc. Normally we'd hope that various tools will start using preallocation internally, but until then such a utility may be useful, and could be scripted as well. The original Eric's version is available at: http://thread.gmane.org/gmane.linux.utilities.util-linux-ng/2490 This version: - checks for fallocate glibc function and kernel syscall - does not provide a fallback and does not call posix_fallocate() - adds long options - uses err.h for errro messages - adds NLS support - cleanups man page Co-Author: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* rtcwake: ignore the tm_isdst field returned from the RTCPaul Fox2009-09-071-1/+1
| | | | Signed-off-by: Paul Fox <pgf@laptop.org>
* rtcwake: add S5 supportKarel Zak2009-09-072-1/+27
| | | | | | | | | | | | | | | | | | | | | Based on patch from Piergiorgio Sartor <piergiorgio.sartor@nexgo.de> at https://bugzilla.redhat.com/show_bug.cgi?id=449115 Piergiorgio's note about S5: > According to the ACPI specifications, chapter 4.7.2.4 "Real Time > Clock Alarm", the wakeup from RTC, when supported, should work from > *sleep* state S1-S3 and, optionally, from S4. > > Note 3 (same chapter) says that S5 is *not* a sleep state and should > not be supported. Actually it also says that: "The OS will disable > the RTC_EN bit prior to entering the G2/S5 or G3 states regardless." > > Nevertheless, on all PC supporting the RTC wakeup I tested, all were > able to wake from S5. Signed-off-by: Karel Zak <kzak@redhat.com>
* replace usleep() for systems that don't have themDaniel Mierswa2009-08-211-0/+1
| | | | | | | | | This function is marked obsolete in POSIX.1-2001 and removed in POSIX.1-2008. Conditionally replaced with nanosleep(). Signed-off-by: Daniel Mierswa <impulze@impulze.org>
* Revert "mount: clean up mount.8"Karel Zak2009-08-181-7/+0Star
| | | | | | | | | This reverts commit 98c7944b52c54c86fb5b9d73fbead9442bfa0e30. Unfortunately, the patch has been committed by "git commit -a" and includes unwanted changes in configure.ac and sys-utils/Makefile.am... Sorry.
* mount: clean up mount.8Karel Zak2009-08-171-0/+7
| | | | | | | | | * use "filesystem" everywhere (currently, the mount.8 man page is inconsistent and uses "file system" and "filesystem") * fix "The extN" to "The extN filesystem" (reported by Theodore Tso) Signed-off-by: Karel Zak <kzak@redhat.com>
* tunelp.8: formattingPeter Breitenlohner2009-08-171-16/+43
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* switch_root.8: formattingPeter Breitenlohner2009-08-171-3/+2Star
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* setsid.1: formattingPeter Breitenlohner2009-08-171-1/+3
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* setarch.8: formattingPeter Breitenlohner2009-08-171-4/+10
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* rtcwake.8: formattingPeter Breitenlohner2009-08-171-4/+12
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* renice.1: formattingPeter Breitenlohner2009-08-171-4/+4
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* readprofile.1: formattingPeter Breitenlohner2009-08-171-20/+18Star
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* rdev.8: formattingPeter Breitenlohner2009-08-171-11/+39
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* pivot_root.8: formattingPeter Breitenlohner2009-08-171-7/+6Star
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* lscpu.1: formattingPeter Breitenlohner2009-08-171-3/+6
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* ldattach.8: formattingPeter Breitenlohner2009-08-171-5/+7
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* ipcs.1: formattingPeter Breitenlohner2009-08-171-4/+12
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* ipcrm.1: formattingPeter Breitenlohner2009-08-171-8/+2Star
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* ipcmk.1: formattingPeter Breitenlohner2009-08-171-6/+18
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* dmesg.1: formattingPeter Breitenlohner2009-08-171-3/+9
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* ctrlaltdel.8: formattingPeter Breitenlohner2009-08-171-4/+4
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* cytune.8: missing description of `-S', formattingPeter Breitenlohner2009-08-171-24/+40
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* dmesg: add -r to help outputKarel Zak2009-08-171-2/+2
| | | | | | | | | On Tue, Aug 04, 2009 at 05:52:38PM +0200, Dalibor Straka wrote: > while I was reading the source, I've noticed missing option in the > help message for "-r". So I'm sending one-line patch for dmesg. Reported-by: Dalibor Straka <dast@panelnet.cz> Signed-off-by: Karel Zak <kzak@redhat.com>
* switch_root: add subroot supportDaniel Drake2009-07-141-5/+76
| | | | | | | | | | | | | | | | | | | | | | The current switch_root can only switch to a new root that is the root of a mount point. This patch adds support for "subroots", where the new root is somewhere below a mount point. It does this by adding in a few extra steps to chroot into the subroot after the enclosing partition has been moved and entered. This will be used by OLPC, who sort-of have 2 copies of Fedora stored on a single partition under different directory trees, where the initramfs decides which one to boot into [kzak@redhat.com: - port to the current u-l-ng switch_root code - don't use static buffer for "dir" in get_parent_mount()] CC: Peter Jones <pjones@redhat.com> Signed-off-by: Daniel Drake <dsd@laptop.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: rename to _execdirKarel Zak2009-07-041-9/+9
| | | | | | | | | | | | The variable name "usrlibexecdir" is very confusing (because we have /usr/libexec). The "exec" prefix is required for user-defined directories, see http://www.gnu.org/software/hello/manual/automake/The-Two-Parts-of-Install.html#The-Two-Parts-of-Install This patch renames all usr*execdir variables to usr*_execdir. Signed-off-by: Karel Zak <kzak@redhat.com>
* ldattach: add N_PPS supportTilman Schmidt2009-06-292-2/+10
| | | | | | | | | Add support for a line discipline name "PPS" selecting the Pulse Per Second line discipline N_PPS (18). The number has been reserved since kernel release 2.6.28, and the implementation is finally going to be submitted for kernel release 2.6.31. Signed-off-by: Tilman Schmidt <tilman@imap.cc>
* switch_root: do recursiveRemove after our root is moved to avoid races.Peter Jones2009-06-221-9/+10
| | | | | | | This way there's no race between unlinking the /newroot directory and the MS_MOVE/chroot() to get away from it. Signed-off-by: Peter Jones <pjones@redhat.com>
* switch_root: fork before cleaning up the filesystem.Peter Jones2009-06-221-1/+7
| | | | | | | Fork before cleaning up the old filesystem, so it becomes asyncronous, which results in a faster boot time. Signed-off-by: Peter Jones <pjones@redhat.com>
* switch_root: use file descriptor instead of path for recursiveRemove()Peter Jones2009-06-221-12/+20
| | | | | | | | This makes recursiveRemove() use fdopendir() instead of taking a path, so we're always sure about which namespace we're starting from. Signed-off-by: Peter Jones <pjones@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* switch_root: add man pageKarel Zak2009-06-222-0/+50
| | | | | Acked-by: Peter Jones <pjones@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* switch_root: use snprintf() rather tan str{cpy,cat}()Karel Zak2009-06-221-3/+4
| | | | | Signed-off-by: Peter Jones <pjones@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* switch_root: clean up argv[] usage, add -h and -VKarel Zak2009-06-221-20/+27
| | | | | Signed-off-by: Peter Jones <pjones@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* switch_root: use err.h, clean up return codesKarel Zak2009-06-221-28/+25Star
| | | | | Signed-off-by: Peter Jones <pjones@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* switch_root: rewrite to use fstatat() and unlinkat()Karel Zak2009-06-221-43/+44
| | | | | Signed-off-by: Peter Jones <pjones@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* switch_root: fix coding styleKarel Zak2009-06-221-80/+70Star
| | | | | | Signed-off-by: Peter Jones <pjones@redhat.com> Acked-by: Peter Jones <pjones@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: add --disable-switch_rootKarel Zak2009-06-221-1/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* switch_root: new commandKarel Zak2009-06-223-1/+200
| | | | | | | | | | | | | | | | | | | | | | Copied from Dracut project: git://dracut.git.sourceforge.net/gitroot/dracut switch_root history in dracut.git repository: $ git shortlog switch_root.c Harald Hoyer (5): replace switch_root shell script with binary add \n to switch_root use switch_root code from http://pjones.fedorapeople.org/mkstart/usr/lib/mkstart/switchroot.c mount move instead of umount and fix the search for fallback inits setsid() and set controlling terminal for real /sbin/init Victor Lowther (2): Simplify switch_root.c a bit Remove all files on the initramfs before switching root Signed-off-by: Peter Jones <pjones@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* lscpu: fix cpuid code on x86/PICMike Frysinger2009-05-111-3/+13
| | | | | | | | | | | | If we build lscpu as PIE, we currently get a build failure: lscpu.c: In function 'main': lscpu.c:333: error: can't find a register in class 'BREG' while reloading 'asm' lscpu.c:333: error: 'asm' operand has impossible constraints make[2]: *** [lscpu.o] Error 1 So we need a little bit of register shuffling to keep gcc happy. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* flock: add NLS support, remove tailing white-spacesKarel Zak2009-03-111-18/+24
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* flock: fix printf format error in usage()Karel Zak2009-03-111-5/+5
| | | | | | | flock.c: In function ‘usage’: flock.c:75: warning: too few arguments for format Signed-off-by: Karel Zak <kzak@redhat.com>
* flockc: segfaults when file name is not givenKarel Zak2009-03-111-1/+8
| | | | | | | | | | | | | | | | $ flock -s Segmentation fault ltrace: __libc_start_main(0x8048870, 2, 0xbfe9f404, 0x8049070, 0x8049060 <unfinished ...> getopt_long(2, 0xbfe9f404, "+sexnouw:hV?", 0x80494e0, 0xbfe9f354) = 115 getopt_long(2, 0xbfe9f404, "+sexnouw:hV?", 0x80494e0, 0xbfe9f354) = -1 strtol(0, 0xbfe9f34c, 10, 0x80494e0, 0xbfe9f354 <unfinished ...> --- SIGSEGV (Segmentation fault) --- +++ killed by SIGSEGV +++ Addresses-Red-Had-Bugzilla: #489672 Signed-off-by: Karel Zak <kzak@redhat.com>