aboutsummaryrefslogtreecommitdiff
path: root/sutils
Commit message (Collapse)AuthorAgeFilesLines
* Add getting swap information from swapon and procfsSamuel Thibault2016-03-161-31/+76
| | | | | | | | | | | | | | | | | | | | | | | | * hurd/default_pager.defs (default_pager_storage_info): New RPC. * hurd/default_pager_reply.defs: Skip default_pager_storage_info RPC. * hurd/default_pager_types.h: Include <mach/machine/vm_types.h>. (vm_size_array_t): New type. * mach-defpager/priv.h (part): Add `name' field. * mach-defpager/default_pager.c (new_partition): Allocate and fill `part->name' field. Free it on error. (destroy_paging_partition): Free `part->name' field. (S_default_pager_storage_info): New function. * procfs/Makefile (SRCS): Add default_pagerUser.c. * procfs/rootdir.c: Include "default_pager_U.h". (rootdir_gc_swaps): New function. (rootdir_entries): Add "swaps" entry. * sutils/swapon.c: Include <argz.h> (show): New variable. (options): Add --show/-S option. (def_pager, dev_master): New variables (swaponoff): Move getting `def_pager' to... (get_def_pager): ... new function. (main): Support 'S' option. * trans/proxy-defpager.c (S_default_pager_storage_info): New function.
* Fix parallel buildSamuel Thibault2016-02-291-1/+1
| | | | | | | * console-client/Makefile (parser.tab.h): Redefine the standard yacc rule to make it build the header too, to avoid concurrency between the standard yacc rule and the rule that builds the header. * sutils/Makefile (OBJS): Append .o suffix to $(progs) instead of .c.
* Fix parallel installSamuel Thibault2016-02-271-2/+2
| | | | | * sutils/Makefile (install): Do not depend on $(prefix)/dev. ($(prefix)/dev/MAKEDEV): Depend on $(prefix)/dev²
* Also do not realpath "proc" pseudo-deviceSamuel Thibault2015-09-081-1/+1
| | | | * sutils/fstab.c (fstab_find_device): Do not realpath "proc" pseudo-device.
* Replace `bzero' with `memset'Justus Winter2014-12-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For reference, this patch was created using the following semantic patch, and then manually applying the change in all functions containing nested functions, as those are not supported by Coccinelle. @@ expression A, B; @@ - bzero (A, B) + memset (A, 0, B) * auth/auth.c: Replace `bzero' with `memset'. * boot/boot.c: Likewise. * defpager/defpager.c: Likewise. * exec/exec.c: Likewise. Also, drop `safe_bzero' and just use `hurd_safe_memset' directly. * ext2fs/ext2fs.c: Likewise. * ext2fs/getblk.c: Likewise. * ext2fs/pager.c: Likewise. * fatfs/pager.c: Likewise. * ftpfs/dir.c: Likewise. * ftpfs/netfs.c: Likewise. * isofs/inode.c: Likewise. * isofs/pager.c: Likewise. * libdiskfs/file-getfh.c: Likewise. * libdiskfs/file-statfs.c: Likewise. * libfshelp/fetch-root.c: Likewise. * libfshelp/start-translator.c: Likewise. * libftpconn/create.c: Likewise. * libftpconn/open.c: Likewise. * libftpconn/unix.c: Likewise. * libpipe/pipe.c: Likewise. * libps/procstat.c: Likewise. * libps/spec.c: Likewise. * libshouldbeinlibc/cacheq.c: Likewise. * libshouldbeinlibc/idvec.c: Likewise. * libshouldbeinlibc/ugids.c: Likewise. * libstore/argp.c: Likewise. * libstore/enc.c: Likewise. * libstore/kids.c: Likewise. * libthreads/alpha/thread.c: Likewise. * libtreefs/fsys.c: Likewise. * libtrivfs/file-statfs.c: Likewise. * mach-defpager/default_pager.c: Likewise. * pfinet/glue-include/asm/uaccess.h: Likewise. * pfinet/io-ops.c: Likewise. * pfinet/options.c: Likewise. * pfinet/socket.c: Likewise. * pfinet/timer-emul.c: Likewise. * pflocal/io.c: Likewise. * startup/startup.c: Likewise. * storeio/storeio.c: Likewise. * sutils/fstab.c: Likewise. * usermux/usermux.c: Likewise. * utils/fakeauth.c: Likewise. * utils/frobauth.c: Likewise. * utils/login.c: Likewise. * utils/x.c: Likewise.
* Always canonicalize fstab entries with realpathSamuel Thibault2014-11-211-41/+62
| | | | | | | | | | | | To avoid spurious ./, /, symlinks, etc. * sutils/fstab.c (fs_set_mntent): Try to call realpath on mnt_fsname and mnt_dir field of `mntent'. (fstab_find_mount): Try to call realpath on `name' parameter. (fstab_find): Do not try to call realpath. (fstab_read): Reset errno to zero before calling getmntent. * utils/umount.c (main): Do not warn about missing fstab entries for active translators.
* sutils: add urandom device target to MAKEDEVDavid Michael2014-08-251-1/+3
| | | | | * sutils/MAKEDEV.sh (urandom): New target. (std): Add urandom to the standard devices list.
* sutils: set up /dev/null using /bin/nullpriv in MAKEDEV.shJustus Winter2013-09-191-1/+1
| | | | | | | | This patch makes MAKEDEV.sh use the /bin/nullpriv wrapper so that the storeio translator serving /dev/zero is started without any unix privileges. * sutils/MAKEDEV.sh (mkdev): Use /bin/nullpriv for /dev/zero.
* sutils: fix the semantic of -t, --types in fstab.cJustus Winter2013-08-281-76/+27
| | | | | | | | | | | | | | | | | | | | | | | The mount utility on both Linux and FreeBSD allows one to either specify a whitelist or a blacklist of filesystem types to consider for --all. Prefixing the list with "no" indicates that the list is a blacklist. Furthermore, Linux' mount utility ignores a "no" prefix on any entry in the given list. Previously the Hurd variant first applied whitelist containing all positive values given and then filtered the resulting list using all negative values. But this makes little sense because each entry only has one value for the filesystem type (mnt_type) and all values are mutually exclusive. This patch adjusts the fstab handling code so that our mount utility behaves like the Linux mount utility. This code is used by both mount and fsck. The same argumentation applies to fsck as well. Like implemented in Linux mount, any "no" prefix is ignored to retain compatibility with the old behavior. * sutils/fstab.c (fstab_argp_create): Fix semantic of --types.
* sutils: allow multiple entries for the device "none"Justus Winter2013-08-281-2/+10
| | | | | | | | | Previously it was not possible to add two mount entries with the same device information to an fstab structure. This is easily fixed by breaking the assumption, that there is only one possible mount entry for the "none" device as used by many purely virtual file systems. * utils/fstab.c (fstab_find_device): Return NULL if name is "none".
* swapon: add -v, --verbose argumentJustus Winter2013-07-061-0/+5
| | | | | | | | | This patch adds a --verbose argument to swapon and swapoff to make it more compatible with the corresponding Linux' utilities. Note that our swapon is verbose by default and has a --quiet argument to make it quiet, so a --verbose argument on it's own does nothing at all. * sutils/swapon.c (main): Handle -v argument.
* Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/hurdSamuel Thibault2013-07-021-4/+14
|\
| * swapon: add -e/--ifexists optionPino Toscano2013-07-011-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the same command line option as in util-linux' swapon to not consider an error if the device/file of a swap entry in fstab does not exist (and not when activating a device specified as argument to `swapon'). * sutils/swapon.c (ifexists): New variable. (options): Add the 'e' option. (parse_opt) <'e'>: Handle case. (swaponoff): New argument skipnotexisting. Return 0 if open_store fails with ENOENT and SKIPNOTEXISTING is on. (main): Adapt swaponoff calls with 0 as parameter for command line arguments, and IFEXISTS for swap entries from fstab.
* | sutils: fix a compiler warningJustus Winter2013-07-021-1/+1
|/ | | | | | | | Fix a compiler warning by dropping the const qualifier. It is not appropriate to qualify pointers to dynamically allocated memory as const. * sutils/fstab.c (real_name): Drop const qualifier.
* sutils: fix file_name_lookup_carefullyJustus Winter2013-06-291-32/+18
| | | | | | | | | | | | | | | | | | | file_name_lookup_carefully is like file_name_lookup but tries hard to avoid starting any passive translators while doing the lookup. The callback contains code to get a new handle to the root if it encounters a translator, but this code was not being executed if the node had no record of an passive translator, just an active one. Fix the callback by dropping the test for a passive translator. AIUI the current check for a passive translator makes no sense, as the code is supposed to fail on encountering a passive translator. This fixes lookups inside translators that have no passive translator. For example if /run is a tmpfs started only as active translator, touch /run/lock && mount tmpfs -t tmpfs /run/lock -o size=5M would fail. * sutils/clookup.c (lookup): Drop the test for an passive translator.
* Add options for user-space parted storesJeremie Koenig2012-09-231-3/+15
| | | | | | | Add option -p to MAKEDEV to use user-space parted stores for partition devices. * sutils/MAKEDEV.sh: Add -p option to use "part" store type.
* Add options -k and -K to MAKEDEV.shJeremie Koenig2012-09-231-3/+13
| | | | | | | to chose not to overwrite existing entries. * MAKEDEV.sh: Handle -k by passing it to settrans. Handle -K by checking for existing translator.
* Add /dev/netdde and /dev/eth* targetsSamuel Thibault2012-05-191-0/+5
| | | | * sutils/MAKEDEV.sh (netdde, eth*): Add targets.
* Replace fragile manual »make dist« system with one based on »git archive«.Thomas Schwinge2012-04-081-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Makeconf (lndist): Remove target. (dist-hook, dist.tar): New targets. * Makefile (dist): Rewrite this target's as well as accompanying rules. (%-lndist, cp-linked-files, $(lf-inst)): Remove targets. (%.bz2, %.gz, %/dist-hook): New targets. (DISTFILES): Set. * doc/Makefile (DISTFILES): Set. * doc/Makefile (lndist, lndist-info-targets): Remove targets. * include/Makefile (lndist): Remove target. * libthreads/Makefile (lndist, lndist-i386-files, lndist-map-file): Remove targets. * pfinet/Makefile (lndist, lndist-linux-src-net-core-files) (lndist-linux-src-net-ethernet-files, lndist-linux-src-net-ipv4-files) (lndist-linux-src-net-ipv6-files, lndist-linux-src-asm-files) (lndist-linux-src-include-linux-files, lndist-linux-src-include-net-files) (lndist-linux-src-include-asm-files, lndist-glue-include-linux-files) (lndist-glue-include-asm-files): Remove targets. * auth/Makefile (LCLHDRS): Don't set. * boot/Makefile (LCLHDRS, DIST_FILES): Likewise. * bsdfsck/Makefile (LCLHDRS): Likewise. * config/Makefile (DIST_FILES): Likewise. * console-client/Makefile (LCLHDRS): Likewise. * console/Makefile (LCLHDRS, DIST_FILES): Likewise. * doc/Makefile (DIST_FILES): Likewise. * exec/Makefile (LCLHDRS, DIST_FILES): Likewise. * ext2fs/Makefile (LCLHDRS): Likewise. * fatfs/Makefile (LCLHDRS): Likewise. * ftpfs/Makefile (LCLHDRS): Likewise. * hostmux/Makefile (LCLHDRS): Likewise. * hurd/Makefile (DIST_FILES): Likewise. * include/Makefile (LCLHDRS): Likewise. * isofs/Makefile (LCLHDRS, DIST_FILES): Likewise. * libcons/Makefile (LCLHDRS): Likewise. * libdirmgt/Makefile (LCLHDRS): Likewise. * libdiskfs/Makefile (LCLHDRS): Likewise. * libfshelp/Makefile (LCLHDRS): Likewise. * libftpconn/Makefile (LCLHDRS): Likewise. * libihash/Makefile (LCLHDRS): Likewise. * libiohelp/Makefile (LCLHDRS): Likewise. * libnetfs/Makefile (LCLHDRS): Likewise. * libpager/Makefile (LCLHDRS): Likewise. * libpipe/Makefile (LCLHDRS): Likewise. * libports/Makefile (LCLHDRS): Likewise. * libps/Makefile (LCLHDRS): Likewise. * libshouldbeinlibc/Makefile (LCLHDRS): Likewise. * libstore/Makefile (LCLHDRS, DIST_FILES): Likewise. * libthreads/Makefile (LCLHDRS): Likewise. * libtreefs/Makefile (LCLHDRS): Likewise. * libtrivfs/Makefile (LCLHDRS): Likewise. * mach-defpager/Makefile (LCLHDRS): Likewise. * nfs/Makefile (LCLHDRS): Likewise. * nfsd/Makefile (LCLHDRS): Likewise. * pfinet/Makefile (LCLHDRS): Likewise. * pflocal/Makefile (LCLHDRS): Likewise. * proc/Makefile (LCLHDRS, DIST_FILES): Likewise. * release/Makefile (DIST_FILES): Likewise. * storeio/Makefile (LCLHDRS): Likewise. * sutils/Makefile (LCLHDRS): Likewise. * term/Makefile (LCLHDRS, DIST_FILES): Likewise. * tmpfs/Makefile (LCLHDRS): Likewise. * ufs-fsck/Makefile (LCLHDRS): Likewise. * ufs/Makefile (LCLHDRS): Likewise. * usermux/Makefile (LCLHDRS): Likewise. * utils/Makefile (LCLHDRS): Likewise.
* Fix e2os script posixnessSamuel Thibault2011-12-201-2/+2
| | | | * sutils/e2os.sh (sbget, sbset): Use POSIX syntax for functions.
* fix common misspellingsJonathan Neuschäfer2011-08-202-2/+2
| | | | | | * Fix spelling with codespell[1] and manually review it. [1] http://git.profusion.mobi/cgit.cgi/lucas/codespell/
* Fix crash on fstab-existing mountSamuel Thibault2011-05-161-1/+1
| | | | | | | | Fix crash when invoking mount with a pair of parameters which already exists in fstab * sutils/fstab.c (fstab_add_mntent): Do not free `mounted_fs' when it is the same as `fs'.
* fstab_find: also try to call realpath()Samuel Thibault2011-05-161-1/+23
| | | | | | | For symlinks and non-absolute paths. * sutils/fstab.c (fstab_find): Also call `fstab_find_device' and `fstab_find_mount' on path returned by `realpath'.
* Fix "make dist" in `sutils'.Ludovic Courtès2010-08-011-2/+2
| | | | * sutils/Makefile (SRCS): Add `clookup.c', `fstab.c', and `update.c'.
* Make MAKEDEV bash-freeSamuel Thibault2010-01-111-6/+6
| | | | | | * sutils/MAKEDEV.sh (cmd, st, lose, mkdev): Remove function, add (). (mkdev): Use ${I#???} instead of ${I:3}.
* Use #!/bin/bash instead of #!/bin/shSamuel Thibault2009-09-271-1/+1
| | | | The script makes big use of bashisms.
* Switch to the new ChangeLog style.Thomas Schwinge2009-07-111-460/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ChangeLog: Wipe out content, and add instructions about how to get it back. * auth/ChangeLog: Remove file. * benchmarks/ChangeLog: Likewise. * boot/ChangeLog: Likewise. * bsdfsck/ChangeLog: Likewise. * config/ChangeLog: Likewise. * console-client/ChangeLog: Likewise. * console/ChangeLog: Likewise. * daemons/ChangeLog: Likewise. * defpager/ChangeLog: Likewise. * doc/ChangeLog: Likewise. * exec/ChangeLog: Likewise. * ext2fs/ChangeLog: Likewise. * fatfs/ChangeLog: Likewise. * fstests/ChangeLog: Likewise. * ftpfs/ChangeLog: Likewise. * hostmux/ChangeLog: Likewise. * hurd/ChangeLog: Likewise. * include/ChangeLog: Likewise. * init/ChangeLog: Likewise. * isofs/ChangeLog: Likewise. * libcons/ChangeLog: Likewise. * libdirmgt/ChangeLog: Likewise. * libdiskfs/ChangeLog: Likewise. * libfshelp/ChangeLog: Likewise. * libftpconn/ChangeLog: Likewise. * libhurdbugaddr/ChangeLog: Likewise. * libihash/ChangeLog: Likewise. * libiohelp/ChangeLog: Likewise. * libnetfs/ChangeLog: Likewise. * libpager/ChangeLog: Likewise. * libpipe/ChangeLog: Likewise. * libports/ChangeLog: Likewise. * libps/ChangeLog: Likewise. * libshouldbeinlibc/ChangeLog: Likewise. * libstore/ChangeLog: Likewise. * libthreads/ChangeLog: Likewise. * libtrivfs/ChangeLog: Likewise. * login/ChangeLog: Likewise. * mach-defpager/ChangeLog: Likewise. * nfs/ChangeLog: Likewise. * nfsd/ChangeLog: Likewise. * pfinet/ChangeLog: Likewise. * pflocal/ChangeLog: Likewise. * proc/ChangeLog: Likewise. * release/ChangeLog: Likewise. * serverboot/ChangeLog: Likewise. * storeio/ChangeLog: Likewise. * sutils/ChangeLog: Likewise. * term/ChangeLog: Likewise. * tmpfs/ChangeLog: Likewise. * trans/ChangeLog: Likewise. * ufs-fsck/ChangeLog: Likewise. * ufs-utils/ChangeLog: Likewise. * ufs/ChangeLog: Likewise. * usermux/ChangeLog: Likewise. * utils/ChangeLog: Likewise.
* 2007-04-07 Thomas Schwinge <tschwinge@gnu.org>Thomas Schwinge2007-04-072-4/+25
| | | | | * swapon.c (main, doc) [!SWAPOFF]: Unless overridden, consider a swap signature when deciding whether to add a paging device or not.
* 2007-04-07 Thomas Schwinge <tschwinge@gnu.org>Thomas Schwinge2007-04-072-1/+7
| | | | * MAKEDEV.sh (mkdev): Specify the creation of `lpr[0-9]' devices.
* 2002-09-17 Marcus Brinkmann <marcus@gnu.org>Marcus Brinkmann2002-09-172-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Makefile (prog-subdirs): Add console-client. sutils/ 2002-09-17 Marcus Brinkmann <marcus@gnu.org> * MAKEDEV.sh (mkdev: vcs): New console device. (mkdev: tty[0-9a-f]|tty[0-9][0-9a-f]): Replaced with new rules for tty[1-9][0-9]. utils/ 2002-09-17 Marcus Brinkmann <marcus@gnu.org> * console-ncurses.c: File removed (the ncursesw console client is now a driver in the console-client). * Makefile: Revert 2002-08-22 change: Do not include`../config.make'. (targets) [LIBNCURSES]: Removed. (SRCS) [LIBNCURSES]: Likewise. (HURDLIBS) [LIBNCURSES]: Likewise. (console-ncurses): Target removed. (console-ncurses-CPPFLAGS): Removed. (console-ncurses-LDLIBS): Likewise. console-client/ 2002-09-17 Marcus Brinkmann <marcus@gnu.org> * Makefile, bdf.c, bdf.h, bell.h, console.c, display.h, driver.c, driver.h, generic-speaker.c, input.h, pc-kbd.c, timer.c, timer.h, unicode.h, vga.c, vga-dynacolor.c, vga-dynacolor.h, vga-dynafont.c, vga-dynafont.h, vga-hw.h, vga-support.c, vga-support.h: New file.
* .Roland McGrath2002-06-261-0/+4
|
* 2002-06-26 Roland McGrath <roland@frob.com>Roland McGrath2002-06-261-9/+12
| | | | * swapon.c (swaponoff): Fix last change.
* .Roland McGrath2002-06-251-0/+5
|
* 2002-06-14 Roland McGrath <roland@frob.com>Roland McGrath2002-06-251-1/+12
| | | | | * swapon.c (swaponoff): If get_privileged_ports fails with EPERM, try to open /servers/default-pager instead.
* .Roland McGrath2002-05-081-0/+4
|
* 2002-05-07 Roland McGrath <roland@frob.com>Roland McGrath2002-05-081-10/+10
| | | | * swapon.c (check_signature): Use %zu for size_t arg.
* .Roland McGrath2002-05-031-0/+5
|
* 2002-05-03 Roland McGrath <roland@frob.com>Roland McGrath2002-05-032-0/+2
| | | | | * reboot.c: Include <error.h>. * halt.c: Likewise.
* *** empty log message ***Neal H. Walfield2002-03-261-0/+6
|
* 2002-03-23 James A. Morrison <ja2morri@uwaterloo.ca>Neal H. Walfield2002-03-263-9/+6
| | | | | | * halt.c (main): Use error, not perror. * reboot.c (main): Likewise. * update.c (main): Use error, not perror and exit.
* .Roland McGrath2002-03-241-0/+2
|
* 2002-03-23 Roland McGrath <roland@frob.com>Roland McGrath2002-03-241-4/+4
| | | | * MAKEDEV.sh (mkdev: shm): Change tmpfs size argument to 50%.
* .Roland McGrath2002-03-241-0/+3
|
* 2002-03-23 Roland McGrath <roland@frob.com>Roland McGrath2002-03-241-1/+7
| | | | | * MAKEDEV.sh (mkdev: shm): Give the file mode 644 and pass options to tmpfs: -m 1777 512M.
* .Roland McGrath2002-03-241-0/+5
|
* 2002-03-23 Roland McGrath <roland@frob.com>Roland McGrath2002-03-241-1/+7
| | | | | * MAKEDEV.sh (mkdev: shm): New, uses /hurd/tmpfs filesystem. (mkdev: std): Add shm to the standard list.
* .Roland McGrath2001-09-071-0/+4
|
* 2001-09-06 Roland McGrath <roland@frob.com>Roland McGrath2001-09-071-4/+7
| | | | * MAKEDEV.sh (pty cases): Remove ptyT? from the set. Add pty?[g-v].
* .Roland McGrath2001-02-281-0/+19
|
* 2001-02-27 Roland McGrath <roland@frob.com>Roland McGrath2001-02-282-19/+358
| | | | | | | | | | | | | | | | | | | Use a new, more flexible RPC interface to the default pager. This allows swapon to do its own interpretation of Linux swap signature pages, and to support partial-device stores such as store_open will return for regular files on disk filesystems. * swapon.c: Include <hurd/default_pager.h>, not <mach/default_pager.h>. (ignore_signature, require_signature, quiet): New variables. (options): Add --silent, --no-signature, --require-signature. (main: parse_opt): Parse them. (check_signature): New function. (swaponoff): Use it unless --no-signature set, to get a remapped store using the pages indicated by the Linux signature page. Try new default_pager_paging_storage RPC first, using a possibly-remapped device store. If the default pager does not support that, fall back to the old protocol that only supports whole devices (and wherein the default pager itself interprets a Linux signature page). * Makefile (swapon, swapoff): Depend on default_pagerUser.o.