From 1d589b2e2d6e9e0af719b481c7ef333bc73e2a7a Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Tue, 29 Nov 2005 23:47:10 +0000 Subject: Fix losetup so that it A) actually works again, B) has much better error messages, C) can show the current association (if any) when called with only one argument. Update the documentation a lot too. Remind me to add a test suite for this thing. I think I've figured out how to handle root-only testsuites... --- include/usage.h | 84 ++++++++++++--------------------------------------------- 1 file changed, 17 insertions(+), 67 deletions(-) (limited to 'include/usage.h') diff --git a/include/usage.h b/include/usage.h index 912a88f4e..53832b987 100644 --- a/include/usage.h +++ b/include/usage.h @@ -1657,13 +1657,18 @@ "\t-f\t\toutput data as the log grows" #define losetup_trivial_usage \ - "[OPTION]... LOOPDEVICE FILE\n" \ - "or: losetup [OPTION]... -d LOOPDEVICE" + "[-od] LOOPDEVICE [FILE]\n" #define losetup_full_usage \ - "Associate LOOPDEVICE with FILE.\n\n" \ + "Associate LOOPDEVICE with FILE, or display current association.\n\n" \ "Options:\n" \ "\t-d\t\tDisassociate LOOPDEVICE\n" \ "\t-o OFFSET\tStart OFFSET bytes into FILE" +#define losetup_notes_usage \ + "One argument (losetup /dev/loop1) will display the current association\n" \ + "(if any), or disassociate it (with -d). The display shows the offset\n" \ + "and filename of the file the loop device is currently bound to.\n\n" \ + "Two arguments (losetup /dev/loop1 file.img) create a new association,\n" \ + "with an optional offset (-o 12345). Encryption is not yet supported.\n\n" #ifdef CONFIG_FEATURE_LS_TIMESTAMPS # define USAGE_LS_TIMESTAMPS(a) a @@ -1946,74 +1951,18 @@ "-rw------- 1 andersen andersen 0 Apr 25 17:10 /tmp/temp.mWiLjM\n" #define modprobe_trivial_usage \ - "[-knqrsv] MODULE [symbol=value ...]" + "[-knqrsv] [MODULE ...]" #define modprobe_full_usage \ + "Used for high level module loading and unloading.\n\n" \ "Options:\n" \ "\t-k\tMake module autoclean-able\n" \ "\t-n\tJust show what would be done\n" \ "\t-q\tQuiet output\n" \ "\t-r\tRemove module (stacks) or do autoclean\n" \ "\t-s\tReport via syslog instead of stderr\n" \ - "\t-v\tVerbose output\n\n" -#define modprobe_notes_usage \ -"modprobe can (un)load a stack of modules, passing each module options (when\n" \ -"loading). modprobe uses a configuration file to determine what option(s) to\n" \ -"pass each module it loads.\n" \ -"\n" \ -"The configuration file is searched (in order) amongst:\n" \ -"\n" \ -" /etc/modprobe.conf (2.6 only)\n" \ -" /etc/modules.conf\n" \ -" /etc/conf.modules (deprecated)\n" \ -"\n" \ -"They all have the same syntax (see below). If none is present, it is\n" \ -"_not_ an error; each loaded module is then expected to load without\n" \ -"options. Once a file is found, the others are tested for.\n" \ -"\n" \ -"/etc/modules.conf entry format:\n" \ -"\n" \ -" alias \n" \ -" Makes it possible to modprobe alias_name, when there is no such module.\n" \ -" It makes sense if your mod_name is long, or you want a more reprenstative\n" \ -" name for that module (eg. 'scsi' in place of 'aha7xxx').\n" \ -" This makes it also possible to use a different set of options (below) for\n" \ -" the module and the alias.\n" \ -" A module can be aliased more than once.\n" \ -"\n" \ -" options \n" \ -" When loading module mod_name (or the module aliased by alias_name), pass\n" \ -" the \"symbol=value\" pairs as option to that module.\n" \ -"\n" \ -"Sample /etc/modules.conf file:\n" \ -"\n" \ -" options tulip irq=3\n" \ -" alias tulip tulip2\n" \ -" options tulip2 irq=4 io=0x308\n" \ -"\n" \ -"Other functionality offered by 'classic' modprobe is not available in\n" \ -"this implementation.\n" \ -"\n" \ -"If module options are present both in the config file, and on the command line,\n" \ -"then the options from the command line will be passed to the module _after_\n" \ -"the options from the config file. That way, you can have defaults in the config\n" \ -"file, and override them for a specific usage from the command line.\n" + "\t-v\tVerbose output" #define modprobe_example_usage \ - "(with the above /etc/modules.conf):\n\n" \ - "$ modprobe tulip\n" \ - " will load the module 'tulip' with default option 'irq=3'\n\n" \ - "$ modprobe tulip irq=5\n" \ - " will load the module 'tulip' with option 'irq=5', thus overriding the default\n\n" \ - "$ modprobe tulip2\n" \ - " will load the module 'tulip' with default options 'irq=4 io=0x308',\n" \ - " which are the default for alias 'tulip2'\n\n" \ - "$ modprobe tulip2 irq=8\n" \ - " will load the module 'tulip' with default options 'irq=4 io=0x308 irq=8',\n" \ - " which are the default for alias 'tulip2' overriden by the option 'irq=8'\n\n" \ - " from the command line\n\n" \ - "$ modprobe tulip2 irq=2 io=0x210\n" \ - " will load the module 'tulip' with default options 'irq=4 io=0x308 irq=4 io=0x210',\n" \ - " which are the default for alias 'tulip2' overriden by the options 'irq=2 io=0x210'\n\n" \ - " from the command line\n" + "$ modprobe cdrom\n" #define more_trivial_usage \ "[FILE ...]" @@ -2054,12 +2003,13 @@ "\tdev/nodev:\tAllow use of special device files / disallow them\n" \ "\texec/noexec:\tAllow use of executable files / disallow them\n" \ USAGE_MOUNT_LOOP( \ - "\tloop:\t\tMounts a file via loop device\n" \ + "\tloop:\t\t Ignored (loop devices are autodetected)\n" \ ) \ "\tsuid/nosuid:\tAllow set-user-id-root programs / disallow them\n" \ "\tremount:\tRe-mount a mounted filesystem, changing its flags\n" \ "\tro/rw:\t\tMount for read-only / read-write\n" \ - "\tbind:\t\tUse the linux 2.4.x \"bind\" feature\n" \ + "\tbind:\t\tBind a directory to an additional location\n" \ + "\tmove:\t\tRelocate an existing mount point.\n" \ "\nThere are EVEN MORE flags that are specific to each filesystem\n" \ "You'll have to see the written documentation for those filesystems" #define mount_example_usage \ @@ -2068,7 +2018,8 @@ "proc on /proc type proc (rw)\n" \ "devpts on /dev/pts type devpts (rw)\n" \ "$ mount /dev/fd0 /mnt -t msdos -o ro\n" \ - "$ mount /tmp/diskimage /opt -t ext2 -o loop\n" + "$ mount /tmp/diskimage /opt -t ext2 -o loop\n" \ + "$ mount cd_image.iso mydir\n" #define mountpoint_trivial_usage \ "[-q] <[-d] DIR | -x DEVICE>" @@ -3008,7 +2959,6 @@ "Telnetd listens for incoming TELNET connections on PORT.\n" \ "Options:\n" \ "\t-p PORT\tlisten for connections on PORT (default 23)\n" \ - "\t-b ADDR\tlisten for connections on ADDR (default 0.0.0.0)\n"\ "\t-l LOGIN\texec LOGIN on connect (default /bin/sh)\n" \ "\t-f issue_file\tDisplay issue_file instead of /etc/issue" #endif -- cgit v1.2.3