aboutsummaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/acpid.c24
-rw-r--r--util-linux/blkid.c5
-rw-r--r--util-linux/dmesg.c10
-rw-r--r--util-linux/fbset.c15
-rw-r--r--util-linux/fdformat.c7
-rw-r--r--util-linux/fdisk.c22
-rw-r--r--util-linux/findfs.c8
-rw-r--r--util-linux/flock.c11
-rw-r--r--util-linux/freeramdisk.c14
-rw-r--r--util-linux/fsck_minix.c13
-rw-r--r--util-linux/getopt.c48
-rw-r--r--util-linux/hexdump.c24
-rw-r--r--util-linux/ipcrm.c10
-rw-r--r--util-linux/ipcs.c16
-rw-r--r--util-linux/losetup.c18
-rw-r--r--util-linux/lspci.c9
-rw-r--r--util-linux/lsusb.c4
-rw-r--r--util-linux/mdev.c35
-rw-r--r--util-linux/mkfs_ext2.c39
-rw-r--r--util-linux/mkfs_minix.c11
-rw-r--r--util-linux/mkfs_reiser.c9
-rw-r--r--util-linux/mkfs_vfat.c17
-rw-r--r--util-linux/mkswap.c8
-rw-r--r--util-linux/more.c8
-rw-r--r--util-linux/mount.c60
-rw-r--r--util-linux/pivot_root.c7
-rw-r--r--util-linux/rdate.c8
-rw-r--r--util-linux/rdev.c9
-rw-r--r--util-linux/readprofile.c15
-rw-r--r--util-linux/rtcwake.c23
-rw-r--r--util-linux/script.c13
-rw-r--r--util-linux/scriptreplay.c6
-rw-r--r--util-linux/setarch.c15
-rw-r--r--util-linux/swaponoff.c17
-rw-r--r--util-linux/switch_root.c10
-rw-r--r--util-linux/umount.c22
36 files changed, 589 insertions, 1 deletions
diff --git a/util-linux/acpid.c b/util-linux/acpid.c
index ce4c98ebe..c9eed2a7f 100644
--- a/util-linux/acpid.c
+++ b/util-linux/acpid.c
@@ -6,6 +6,30 @@
6 * 6 *
7 * Licensed under GPLv2, see file LICENSE in this source tree. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9
10//usage:#define acpid_trivial_usage
11//usage: "[-d] [-c CONFDIR] [-l LOGFILE] [-a ACTIONFILE] [-M MAPFILE] [-e PROC_EVENT_FILE] [-p PIDFILE]"
12//usage:#define acpid_full_usage "\n\n"
13//usage: "Listen to ACPI events and spawn specific helpers on event arrival\n"
14//usage: "\nOptions:"
15//usage: "\n -c DIR Config directory [/etc/acpi]"
16//usage: "\n -d Don't daemonize, (implies -f)"
17//usage: "\n -e FILE /proc event file [/proc/acpi/event]"
18//usage: "\n -f Run in foreground"
19//usage: "\n -l FILE Log file [/var/log/acpid.log]"
20//usage: "\n -p FILE Pid file [/var/run/acpid.pid]"
21//usage: "\n -a FILE Action file [/etc/acpid.conf]"
22//usage: "\n -M FILE Map file [/etc/acpi.map]"
23//usage: IF_FEATURE_ACPID_COMPAT(
24//usage: "\n\nAccept and ignore compatibility options -g -m -s -S -v"
25//usage: )
26//usage:
27//usage:#define acpid_example_usage
28//usage: "Without -e option, acpid uses all /dev/input/event* files\n"
29//usage: "# acpid\n"
30//usage: "# acpid -l /var/log/my-acpi-log\n"
31//usage: "# acpid -e /proc/acpi/event\n"
32
9#include "libbb.h" 33#include "libbb.h"
10#include <syslog.h> 34#include <syslog.h>
11#include <linux/input.h> 35#include <linux/input.h>
diff --git a/util-linux/blkid.c b/util-linux/blkid.c
index fe88fb31d..c30360c65 100644
--- a/util-linux/blkid.c
+++ b/util-linux/blkid.c
@@ -7,6 +7,11 @@
7 * Licensed under GPLv2, see file LICENSE in this source tree. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9 9
10//usage:#define blkid_trivial_usage
11//usage: ""
12//usage:#define blkid_full_usage "\n\n"
13//usage: "Print UUIDs of all filesystems"
14
10#include "libbb.h" 15#include "libbb.h"
11#include "volume_id.h" 16#include "volume_id.h"
12 17
diff --git a/util-linux/dmesg.c b/util-linux/dmesg.c
index 6e43a22f5..412bf024b 100644
--- a/util-linux/dmesg.c
+++ b/util-linux/dmesg.c
@@ -8,6 +8,16 @@
8 * 8 *
9 * Licensed under GPLv2, see file LICENSE in this source tree. 9 * Licensed under GPLv2, see file LICENSE in this source tree.
10 */ 10 */
11
12//usage:#define dmesg_trivial_usage
13//usage: "[-c] [-n LEVEL] [-s SIZE]"
14//usage:#define dmesg_full_usage "\n\n"
15//usage: "Print or control the kernel ring buffer\n"
16//usage: "\nOptions:"
17//usage: "\n -c Clear ring buffer after printing"
18//usage: "\n -n LEVEL Set console logging level"
19//usage: "\n -s SIZE Buffer size"
20
11#include <sys/klog.h> 21#include <sys/klog.h>
12#include "libbb.h" 22#include "libbb.h"
13 23
diff --git a/util-linux/fbset.c b/util-linux/fbset.c
index 77cc1fc12..75d41b882 100644
--- a/util-linux/fbset.c
+++ b/util-linux/fbset.c
@@ -12,6 +12,21 @@
12 * Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be) 12 * Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
13 */ 13 */
14 14
15//usage:#define fbset_trivial_usage
16//usage: "[OPTIONS] [MODE]"
17//usage:#define fbset_full_usage "\n\n"
18//usage: "Show and modify frame buffer settings"
19//usage:
20//usage:#define fbset_example_usage
21//usage: "$ fbset\n"
22//usage: "mode \"1024x768-76\"\n"
23//usage: " # D: 78.653 MHz, H: 59.949 kHz, V: 75.694 Hz\n"
24//usage: " geometry 1024 768 1024 768 16\n"
25//usage: " timings 12714 128 32 16 4 128 4\n"
26//usage: " accel false\n"
27//usage: " rgba 5/11,6/5,5/0,0/0\n"
28//usage: "endmode\n"
29
15#include "libbb.h" 30#include "libbb.h"
16 31
17#define DEFAULTFBDEV FB_0 32#define DEFAULTFBDEV FB_0
diff --git a/util-linux/fdformat.c b/util-linux/fdformat.c
index 57e9c26f8..bf7098e71 100644
--- a/util-linux/fdformat.c
+++ b/util-linux/fdformat.c
@@ -5,6 +5,13 @@
5 * Licensed under GPLv2, see file LICENSE in this source tree. 5 * Licensed under GPLv2, see file LICENSE in this source tree.
6 */ 6 */
7 7
8//usage:#define fdformat_trivial_usage
9//usage: "[-n] DEVICE"
10//usage:#define fdformat_full_usage "\n\n"
11//usage: "Format floppy disk\n"
12//usage: "\nOptions:"
13//usage: "\n -n Don't verify after format"
14
8#include "libbb.h" 15#include "libbb.h"
9 16
10 17
diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c
index 0b93c22cc..da03e683e 100644
--- a/util-linux/fdisk.c
+++ b/util-linux/fdisk.c
@@ -7,6 +7,28 @@
7 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10/* Looks like someone forgot to add this to config system */
11//usage:#ifndef ENABLE_FEATURE_FDISK_BLKSIZE
12//usage:# define ENABLE_FEATURE_FDISK_BLKSIZE 0
13//usage:# define IF_FEATURE_FDISK_BLKSIZE(a)
14//usage:#endif
15//usage:
16//usage:#define fdisk_trivial_usage
17//usage: "[-ul" IF_FEATURE_FDISK_BLKSIZE("s") "] "
18//usage: "[-C CYLINDERS] [-H HEADS] [-S SECTORS] [-b SSZ] DISK"
19//usage:#define fdisk_full_usage "\n\n"
20//usage: "Change partition table\n"
21//usage: "\nOptions:"
22//usage: "\n -u Start and End are in sectors (instead of cylinders)"
23//usage: "\n -l Show partition table for each DISK, then exit"
24//usage: IF_FEATURE_FDISK_BLKSIZE(
25//usage: "\n -s Show partition sizes in kb for each DISK, then exit"
26//usage: )
27//usage: "\n -b 2048 (for certain MO disks) use 2048-byte sectors"
28//usage: "\n -C CYLINDERS Set number of cylinders/heads/sectors"
29//usage: "\n -H HEADS"
30//usage: "\n -S SECTORS"
31
10#ifndef _LARGEFILE64_SOURCE 32#ifndef _LARGEFILE64_SOURCE
11/* For lseek64 */ 33/* For lseek64 */
12# define _LARGEFILE64_SOURCE 34# define _LARGEFILE64_SOURCE
diff --git a/util-linux/findfs.c b/util-linux/findfs.c
index e1ec41f1b..49e8979ac 100644
--- a/util-linux/findfs.c
+++ b/util-linux/findfs.c
@@ -8,6 +8,14 @@
8 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 8 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
9 */ 9 */
10 10
11//usage:#define findfs_trivial_usage
12//usage: "LABEL=label or UUID=uuid"
13//usage:#define findfs_full_usage "\n\n"
14//usage: "Find a filesystem device based on a label or UUID"
15//usage:
16//usage:#define findfs_example_usage
17//usage: "$ findfs LABEL=MyDevice"
18
11#include "libbb.h" 19#include "libbb.h"
12#include "volume_id.h" 20#include "volume_id.h"
13 21
diff --git a/util-linux/flock.c b/util-linux/flock.c
index 77fe1f809..8fecb54d4 100644
--- a/util-linux/flock.c
+++ b/util-linux/flock.c
@@ -3,6 +3,17 @@
3 * 3 *
4 * This is free software, licensed under the GNU General Public License v2. 4 * This is free software, licensed under the GNU General Public License v2.
5 */ 5 */
6
7//usage:#define flock_trivial_usage
8//usage: "[-sxun] FD|{FILE [-c] PROG ARGS}"
9//usage:#define flock_full_usage "\n\n"
10//usage: "[Un]lock file descriptor, or lock FILE, run PROG\n"
11//usage: "\nOptions:"
12//usage: "\n -s Shared lock"
13//usage: "\n -x Exclusive lock (default)"
14//usage: "\n -u Unlock FD"
15//usage: "\n -n Fail rather than wait"
16
6#include <sys/file.h> 17#include <sys/file.h>
7#include "libbb.h" 18#include "libbb.h"
8 19
diff --git a/util-linux/freeramdisk.c b/util-linux/freeramdisk.c
index 7ad443086..a89ae1a39 100644
--- a/util-linux/freeramdisk.c
+++ b/util-linux/freeramdisk.c
@@ -8,6 +8,20 @@
8 * 8 *
9 * Licensed under GPLv2, see file LICENSE in this source tree. 9 * Licensed under GPLv2, see file LICENSE in this source tree.
10 */ 10 */
11
12//usage:#define freeramdisk_trivial_usage
13//usage: "DEVICE"
14//usage:#define freeramdisk_full_usage "\n\n"
15//usage: "Free all memory used by the specified ramdisk"
16//usage:
17//usage:#define freeramdisk_example_usage
18//usage: "$ freeramdisk /dev/ram2\n"
19//usage:
20//usage:#define fdflush_trivial_usage
21//usage: "DEVICE"
22//usage:#define fdflush_full_usage "\n\n"
23//usage: "Force floppy disk drive to detect disk change"
24
11#include <sys/mount.h> 25#include <sys/mount.h>
12#include "libbb.h" 26#include "libbb.h"
13 27
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c
index e02e05fa4..b53c97248 100644
--- a/util-linux/fsck_minix.c
+++ b/util-linux/fsck_minix.c
@@ -87,6 +87,19 @@
87 * enforced (but it's not much fun on a character device :-). 87 * enforced (but it's not much fun on a character device :-).
88 */ 88 */
89 89
90//usage:#define fsck_minix_trivial_usage
91//usage: "[-larvsmf] BLOCKDEV"
92//usage:#define fsck_minix_full_usage "\n\n"
93//usage: "Check MINIX filesystem\n"
94//usage: "\nOptions:"
95//usage: "\n -l List all filenames"
96//usage: "\n -r Perform interactive repairs"
97//usage: "\n -a Perform automatic repairs"
98//usage: "\n -v Verbose"
99//usage: "\n -s Output superblock information"
100//usage: "\n -m Show \"mode not cleared\" warnings"
101//usage: "\n -f Force file system check"
102
90#include <mntent.h> 103#include <mntent.h>
91#include "libbb.h" 104#include "libbb.h"
92#include "minix.h" 105#include "minix.h"
diff --git a/util-linux/getopt.c b/util-linux/getopt.c
index 7c498538f..10e1dc49b 100644
--- a/util-linux/getopt.c
+++ b/util-linux/getopt.c
@@ -31,6 +31,54 @@
31 * 31 *
32 */ 32 */
33 33
34//usage:#define getopt_trivial_usage
35//usage: "[OPTIONS]"
36//usage:#define getopt_full_usage "\n\n"
37//usage: "Options:"
38//usage: IF_LONG_OPTS(
39//usage: "\n -a,--alternative Allow long options starting with single -"
40//usage: "\n -l,--longoptions=longopts Long options to be recognized"
41//usage: "\n -n,--name=progname The name under which errors are reported"
42//usage: "\n -o,--options=optstring Short options to be recognized"
43//usage: "\n -q,--quiet Disable error reporting by getopt(3)"
44//usage: "\n -Q,--quiet-output No normal output"
45//usage: "\n -s,--shell=shell Set shell quoting conventions"
46//usage: "\n -T,--test Test for getopt(1) version"
47//usage: "\n -u,--unquoted Don't quote the output"
48//usage: )
49//usage: IF_NOT_LONG_OPTS(
50//usage: "\n -a Allow long options starting with single -"
51//usage: "\n -l longopts Long options to be recognized"
52//usage: "\n -n progname The name under which errors are reported"
53//usage: "\n -o optstring Short options to be recognized"
54//usage: "\n -q Disable error reporting by getopt(3)"
55//usage: "\n -Q No normal output"
56//usage: "\n -s shell Set shell quoting conventions"
57//usage: "\n -T Test for getopt(1) version"
58//usage: "\n -u Don't quote the output"
59//usage: )
60//usage:
61//usage:#define getopt_example_usage
62//usage: "$ cat getopt.test\n"
63//usage: "#!/bin/sh\n"
64//usage: "GETOPT=`getopt -o ab:c:: --long a-long,b-long:,c-long:: \\\n"
65//usage: " -n 'example.busybox' -- \"$@\"`\n"
66//usage: "if [ $? != 0 ]; then exit 1; fi\n"
67//usage: "eval set -- \"$GETOPT\"\n"
68//usage: "while true; do\n"
69//usage: " case $1 in\n"
70//usage: " -a|--a-long) echo \"Option a\"; shift;;\n"
71//usage: " -b|--b-long) echo \"Option b, argument '$2'\"; shift 2;;\n"
72//usage: " -c|--c-long)\n"
73//usage: " case \"$2\" in\n"
74//usage: " \"\") echo \"Option c, no argument\"; shift 2;;\n"
75//usage: " *) echo \"Option c, argument '$2'\"; shift 2;;\n"
76//usage: " esac;;\n"
77//usage: " --) shift; break;;\n"
78//usage: " *) echo \"Internal error!\"; exit 1;;\n"
79//usage: " esac\n"
80//usage: "done\n"
81
34#include <getopt.h> 82#include <getopt.h>
35#include "libbb.h" 83#include "libbb.h"
36 84
diff --git a/util-linux/hexdump.c b/util-linux/hexdump.c
index a38fe05e7..1f5d57d74 100644
--- a/util-linux/hexdump.c
+++ b/util-linux/hexdump.c
@@ -9,6 +9,30 @@
9 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 9 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
10 */ 10 */
11 11
12//usage:#define hexdump_trivial_usage
13//usage: "[-bcCdefnosvx" IF_FEATURE_HEXDUMP_REVERSE("R") "] [FILE]..."
14//usage:#define hexdump_full_usage "\n\n"
15//usage: "Display FILEs (or stdin) in a user specified format\n"
16//usage: "\nOptions:"
17//usage: "\n -b One-byte octal display"
18//usage: "\n -c One-byte character display"
19//usage: "\n -C Canonical hex+ASCII, 16 bytes per line"
20//usage: "\n -d Two-byte decimal display"
21//usage: "\n -e FORMAT_STRING"
22//usage: "\n -f FORMAT_FILE"
23//usage: "\n -n LENGTH Interpret only LENGTH bytes of input"
24//usage: "\n -o Two-byte octal display"
25//usage: "\n -s OFFSET Skip OFFSET bytes"
26//usage: "\n -v Display all input data"
27//usage: "\n -x Two-byte hexadecimal display"
28//usage: IF_FEATURE_HEXDUMP_REVERSE(
29//usage: "\n -R Reverse of 'hexdump -Cv'")
30//usage:
31//usage:#define hd_trivial_usage
32//usage: "FILE..."
33//usage:#define hd_full_usage "\n\n"
34//usage: "hd is an alias for hexdump -C"
35
12#include "libbb.h" 36#include "libbb.h"
13#include "dump.h" 37#include "dump.h"
14 38
diff --git a/util-linux/ipcrm.c b/util-linux/ipcrm.c
index e597ed637..bdd019f6f 100644
--- a/util-linux/ipcrm.c
+++ b/util-linux/ipcrm.c
@@ -8,6 +8,16 @@
8 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 8 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
9 */ 9 */
10 10
11//usage:#define ipcrm_trivial_usage
12//usage: "[-MQS key] [-mqs id]"
13//usage:#define ipcrm_full_usage "\n\n"
14//usage: "Upper-case options MQS remove an object by shmkey value.\n"
15//usage: "Lower-case options remove an object by shmid value.\n"
16//usage: "\nOptions:"
17//usage: "\n -mM Remove memory segment after last detach"
18//usage: "\n -qQ Remove message queue"
19//usage: "\n -sS Remove semaphore"
20
11#include "libbb.h" 21#include "libbb.h"
12 22
13/* X/OPEN tells us to use <sys/{types,ipc,sem}.h> for semctl() */ 23/* X/OPEN tells us to use <sys/{types,ipc,sem}.h> for semctl() */
diff --git a/util-linux/ipcs.c b/util-linux/ipcs.c
index 14df65280..33035c62e 100644
--- a/util-linux/ipcs.c
+++ b/util-linux/ipcs.c
@@ -8,6 +8,22 @@
8 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 8 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
9 */ 9 */
10 10
11//usage:#define ipcs_trivial_usage
12//usage: "[[-smq] -i shmid] | [[-asmq] [-tcplu]]"
13//usage:#define ipcs_full_usage "\n\n"
14//usage: " -i Show specific resource"
15//usage: "\nResource specification:"
16//usage: "\n -m Shared memory segments"
17//usage: "\n -q Message queues"
18//usage: "\n -s Semaphore arrays"
19//usage: "\n -a All (default)"
20//usage: "\nOutput format:"
21//usage: "\n -t Time"
22//usage: "\n -c Creator"
23//usage: "\n -p Pid"
24//usage: "\n -l Limits"
25//usage: "\n -u Summary"
26
11/* X/OPEN tells us to use <sys/{types,ipc,sem}.h> for semctl() */ 27/* X/OPEN tells us to use <sys/{types,ipc,sem}.h> for semctl() */
12/* X/OPEN tells us to use <sys/{types,ipc,msg}.h> for msgctl() */ 28/* X/OPEN tells us to use <sys/{types,ipc,msg}.h> for msgctl() */
13/* X/OPEN tells us to use <sys/{types,ipc,shm}.h> for shmctl() */ 29/* X/OPEN tells us to use <sys/{types,ipc,shm}.h> for shmctl() */
diff --git a/util-linux/losetup.c b/util-linux/losetup.c
index 776f784f5..7e11e292d 100644
--- a/util-linux/losetup.c
+++ b/util-linux/losetup.c
@@ -7,6 +7,24 @@
7 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9 9
10//usage:#define losetup_trivial_usage
11//usage: "[-o OFS] LOOPDEV FILE - associate loop devices\n"
12//usage: " losetup -d LOOPDEV - disassociate\n"
13//usage: " losetup [-f] - show"
14//usage:#define losetup_full_usage "\n\n"
15//usage: "Options:"
16//usage: "\n -o OFS Start OFS bytes into FILE"
17//usage: "\n -f Show first free loop device"
18//usage:
19//usage:#define losetup_notes_usage
20//usage: "No arguments will display all current associations.\n"
21//usage: "One argument (losetup /dev/loop1) will display the current association\n"
22//usage: "(if any), or disassociate it (with -d). The display shows the offset\n"
23//usage: "and filename of the file the loop device is currently bound to.\n\n"
24//usage: "Two arguments (losetup /dev/loop1 file.img) create a new association,\n"
25//usage: "with an optional offset (-o 12345). Encryption is not yet supported.\n"
26//usage: "losetup -f will show the first loop free loop device\n\n"
27
10#include "libbb.h" 28#include "libbb.h"
11 29
12int losetup_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 30int losetup_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/util-linux/lspci.c b/util-linux/lspci.c
index 46e93b04d..f59aec8a5 100644
--- a/util-linux/lspci.c
+++ b/util-linux/lspci.c
@@ -6,6 +6,15 @@
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9
10//usage:#define lspci_trivial_usage
11//usage: "[-mk]"
12//usage:#define lspci_full_usage "\n\n"
13//usage: "List all PCI devices"
14//usage: "\n"
15//usage: "\n -m Parseable output"
16//usage: "\n -k Show driver"
17
9#include "libbb.h" 18#include "libbb.h"
10 19
11enum { 20enum {
diff --git a/util-linux/lsusb.c b/util-linux/lsusb.c
index 6f9b54daa..540f21ec6 100644
--- a/util-linux/lsusb.c
+++ b/util-linux/lsusb.c
@@ -6,6 +6,10 @@
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 */ 8 */
9
10//usage:#define lsusb_trivial_usage NOUSAGE_STR
11//usage:#define lsusb_full_usage ""
12
9#include "libbb.h" 13#include "libbb.h"
10 14
11static int FAST_FUNC fileAction( 15static int FAST_FUNC fileAction(
diff --git a/util-linux/mdev.c b/util-linux/mdev.c
index a970f91f2..2f225ac0b 100644
--- a/util-linux/mdev.c
+++ b/util-linux/mdev.c
@@ -7,6 +7,41 @@
7 * 7 *
8 * Licensed under GPLv2, see file LICENSE in this source tree. 8 * Licensed under GPLv2, see file LICENSE in this source tree.
9 */ 9 */
10
11//usage:#define mdev_trivial_usage
12//usage: "[-s]"
13//usage:#define mdev_full_usage "\n\n"
14//usage: " -s Scan /sys and populate /dev during system boot\n"
15//usage: "\n"
16//usage: "It can be run by kernel as a hotplug helper. To activate it:\n"
17//usage: " echo /sbin/mdev > /proc/sys/kernel/hotplug\n"
18//usage: IF_FEATURE_MDEV_CONF(
19//usage: "It uses /etc/mdev.conf with lines\n"
20//usage: "[-]DEVNAME UID:GID PERM"
21//usage: IF_FEATURE_MDEV_RENAME(" [>|=PATH]")
22//usage: IF_FEATURE_MDEV_EXEC(" [@|$|*PROG]")
23//usage: )
24//usage:
25//usage:#define mdev_notes_usage ""
26//usage: IF_FEATURE_MDEV_CONFIG(
27//usage: "The mdev config file contains lines that look like:\n"
28//usage: " hd[a-z][0-9]* 0:3 660\n\n"
29//usage: "That's device name (with regex match), uid:gid, and permissions.\n\n"
30//usage: IF_FEATURE_MDEV_EXEC(
31//usage: "Optionally, that can be followed (on the same line) by a special character\n"
32//usage: "and a command line to run after creating/before deleting the corresponding\n"
33//usage: "device(s). The environment variable $MDEV indicates the active device node\n"
34//usage: "(which is useful if it's a regex match). For example:\n\n"
35//usage: " hdc root:cdrom 660 *ln -s $MDEV cdrom\n\n"
36//usage: "The special characters are @ (run after creating), $ (run before deleting),\n"
37//usage: "and * (run both after creating and before deleting). The commands run in\n"
38//usage: "the /dev directory, and use system() which calls /bin/sh.\n\n"
39//usage: )
40//usage: "Config file parsing stops on the first matching line. If no config\n"
41//usage: "entry is matched, devices are created with default 0:0 660. (Make\n"
42//usage: "the last line match .* to override this.)\n\n"
43//usage: )
44
10#include "libbb.h" 45#include "libbb.h"
11#include "xregex.h" 46#include "xregex.h"
12 47
diff --git a/util-linux/mkfs_ext2.c b/util-linux/mkfs_ext2.c
index 871ec835e..f6ccc9c9e 100644
--- a/util-linux/mkfs_ext2.c
+++ b/util-linux/mkfs_ext2.c
@@ -7,6 +7,45 @@
7 * 7 *
8 * Licensed under GPLv2, see file LICENSE in this source tree. 8 * Licensed under GPLv2, see file LICENSE in this source tree.
9 */ 9 */
10
11//usage:#define mkfs_ext2_trivial_usage
12//usage: "[-Fn] "
13/* //usage: "[-c|-l filename] " */
14//usage: "[-b BLK_SIZE] "
15/* //usage: "[-f fragment-size] [-g blocks-per-group] " */
16//usage: "[-i INODE_RATIO] [-I INODE_SIZE] "
17/* //usage: "[-j] [-J journal-options] [-N number-of-inodes] " */
18//usage: "[-m RESERVED_PERCENT] "
19/* //usage: "[-o creator-os] [-O feature[,...]] [-q] " */
20/* //usage: "[r fs-revision-level] [-E extended-options] [-v] [-F] " */
21//usage: "[-L LABEL] "
22/* //usage: "[-M last-mounted-directory] [-S] [-T filesystem-type] " */
23//usage: "BLOCKDEV [KBYTES]"
24//usage:#define mkfs_ext2_full_usage "\n\n"
25//usage: " -b BLK_SIZE Block size, bytes"
26/* //usage: "\n -c Check device for bad blocks" */
27/* //usage: "\n -E opts Set extended options" */
28/* //usage: "\n -f size Fragment size in bytes" */
29//usage: "\n -F Force"
30/* //usage: "\n -g N Number of blocks in a block group" */
31//usage: "\n -i RATIO Max number of files is filesystem_size / RATIO"
32//usage: "\n -I BYTES Inode size (min 128)"
33/* //usage: "\n -j Create a journal (ext3)" */
34/* //usage: "\n -J opts Set journal options (size/device)" */
35/* //usage: "\n -l file Read bad blocks list from file" */
36//usage: "\n -L LBL Volume label"
37//usage: "\n -m PERCENT Percent of blocks to reserve for admin"
38/* //usage: "\n -M dir Set last mounted directory" */
39//usage: "\n -n Dry run"
40/* //usage: "\n -N N Number of inodes to create" */
41/* //usage: "\n -o os Set the 'creator os' field" */
42/* //usage: "\n -O features Dir_index/filetype/has_journal/journal_dev/sparse_super" */
43/* //usage: "\n -q Quiet" */
44/* //usage: "\n -r rev Set filesystem revision" */
45/* //usage: "\n -S Write superblock and group descriptors only" */
46/* //usage: "\n -T fs-type Set usage type (news/largefile/largefile4)" */
47/* //usage: "\n -v Verbose" */
48
10#include "libbb.h" 49#include "libbb.h"
11#include <linux/fs.h> 50#include <linux/fs.h>
12#include <linux/ext2_fs.h> 51#include <linux/ext2_fs.h>
diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c
index 95499ba17..a8bc4b80d 100644
--- a/util-linux/mkfs_minix.c
+++ b/util-linux/mkfs_minix.c
@@ -63,6 +63,17 @@
63 * removed getopt based parser and added a hand rolled one. 63 * removed getopt based parser and added a hand rolled one.
64 */ 64 */
65 65
66//usage:#define mkfs_minix_trivial_usage
67//usage: "[-c | -l FILE] [-nXX] [-iXX] BLOCKDEV [KBYTES]"
68//usage:#define mkfs_minix_full_usage "\n\n"
69//usage: "Make a MINIX filesystem\n"
70//usage: "\nOptions:"
71//usage: "\n -c Check device for bad blocks"
72//usage: "\n -n [14|30] Maximum length of filenames"
73//usage: "\n -i INODES Number of inodes for the filesystem"
74//usage: "\n -l FILE Read bad blocks list from FILE"
75//usage: "\n -v Make version 2 filesystem"
76
66#include "libbb.h" 77#include "libbb.h"
67#include <mntent.h> 78#include <mntent.h>
68 79
diff --git a/util-linux/mkfs_reiser.c b/util-linux/mkfs_reiser.c
index 00ce8f1d1..463ae1e2a 100644
--- a/util-linux/mkfs_reiser.c
+++ b/util-linux/mkfs_reiser.c
@@ -6,6 +6,15 @@
6 * 6 *
7 * Licensed under GPLv2, see file LICENSE in this source tree. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9
10//usage:#define mkfs_reiser_trivial_usage
11//usage: "[-f] [-l LABEL] BLOCKDEV [4K-BLOCKS]"
12//usage:#define mkfs_reiser_full_usage "\n\n"
13//usage: "Make a ReiserFS V3 filesystem\n"
14//usage: "\nOptions:"
15//usage: "\n -f Force"
16//usage: "\n -l LBL Volume label"
17
9#include "libbb.h" 18#include "libbb.h"
10#include <linux/fs.h> 19#include <linux/fs.h>
11 20
diff --git a/util-linux/mkfs_vfat.c b/util-linux/mkfs_vfat.c
index bb5b59c66..e83ae7510 100644
--- a/util-linux/mkfs_vfat.c
+++ b/util-linux/mkfs_vfat.c
@@ -7,6 +7,23 @@
7 * 7 *
8 * Licensed under GPLv2, see file LICENSE in this source tree. 8 * Licensed under GPLv2, see file LICENSE in this source tree.
9 */ 9 */
10
11//usage:#define mkfs_vfat_trivial_usage
12//usage: "[-v] [-n LABEL] BLOCKDEV [KBYTES]"
13/* Accepted but ignored:
14 "[-c] [-C] [-I] [-l bad-block-file] [-b backup-boot-sector] "
15 "[-m boot-msg-file] [-i volume-id] "
16 "[-s sectors-per-cluster] [-S logical-sector-size] [-f number-of-FATs] "
17 "[-h hidden-sectors] [-F fat-size] [-r root-dir-entries] [-R reserved-sectors] "
18*/
19//usage:#define mkfs_vfat_full_usage "\n\n"
20//usage: "Make a FAT32 filesystem\n"
21//usage: "\nOptions:"
22/* //usage: "\n -c Check device for bad blocks" */
23//usage: "\n -v Verbose"
24/* //usage: "\n -I Allow to use entire disk device (e.g. /dev/hda)" */
25//usage: "\n -n LBL Volume label"
26
10#include "libbb.h" 27#include "libbb.h"
11 28
12#include <linux/hdreg.h> /* HDIO_GETGEO */ 29#include <linux/hdreg.h> /* HDIO_GETGEO */
diff --git a/util-linux/mkswap.c b/util-linux/mkswap.c
index 2e9662b2b..ef6932c6c 100644
--- a/util-linux/mkswap.c
+++ b/util-linux/mkswap.c
@@ -5,6 +5,14 @@
5 * 5 *
6 * Licensed under GPLv2, see file LICENSE in this source tree. 6 * Licensed under GPLv2, see file LICENSE in this source tree.
7 */ 7 */
8
9//usage:#define mkswap_trivial_usage
10//usage: "[-L LBL] BLOCKDEV [KBYTES]"
11//usage:#define mkswap_full_usage "\n\n"
12//usage: "Prepare BLOCKDEV to be used as swap partition\n"
13//usage: "\nOptions:"
14//usage: "\n -L LBL Label"
15
8#include "libbb.h" 16#include "libbb.h"
9 17
10#if ENABLE_SELINUX 18#if ENABLE_SELINUX
diff --git a/util-linux/more.c b/util-linux/more.c
index 7160b8b00..efceb71ec 100644
--- a/util-linux/more.c
+++ b/util-linux/more.c
@@ -14,6 +14,14 @@
14 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 14 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
15 */ 15 */
16 16
17//usage:#define more_trivial_usage
18//usage: "[FILE]..."
19//usage:#define more_full_usage "\n\n"
20//usage: "View FILE (or stdin) one screenful at a time"
21//usage:
22//usage:#define more_example_usage
23//usage: "$ dmesg | more\n"
24
17#include "libbb.h" 25#include "libbb.h"
18 26
19/* Support for FEATURE_USE_TERMIOS */ 27/* Support for FEATURE_USE_TERMIOS */
diff --git a/util-linux/mount.c b/util-linux/mount.c
index 722d0be92..3e2ba1fab 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -16,6 +16,66 @@
16// singlemount() can loop through /etc/filesystems for fstype detection. 16// singlemount() can loop through /etc/filesystems for fstype detection.
17// mount_it_now() does the actual mount. 17// mount_it_now() does the actual mount.
18// 18//
19
20//usage:#define mount_trivial_usage
21//usage: "[OPTIONS] [-o OPTS] DEVICE NODE"
22//usage:#define mount_full_usage "\n\n"
23//usage: "Mount a filesystem. Filesystem autodetection requires /proc.\n"
24//usage: "\nOptions:"
25//usage: "\n -a Mount all filesystems in fstab"
26//usage: IF_FEATURE_MOUNT_FAKE(
27//usage: IF_FEATURE_MTAB_SUPPORT(
28//usage: "\n -f Update /etc/mtab, but don't mount"
29//usage: )
30//usage: IF_NOT_FEATURE_MTAB_SUPPORT(
31//usage: "\n -f Dry run"
32//usage: )
33//usage: )
34//usage: IF_FEATURE_MOUNT_HELPERS(
35//usage: "\n -i Don't run mount helper"
36//usage: )
37//usage: IF_FEATURE_MTAB_SUPPORT(
38//usage: "\n -n Don't update /etc/mtab"
39//usage: )
40//usage: "\n -r Read-only mount"
41//usage: "\n -w Read-write mount (default)"
42//usage: "\n -t FSTYPE Filesystem type"
43//usage: "\n -O OPT Mount only filesystems with option OPT (-a only)"
44//usage: "\n-o OPT:"
45//usage: IF_FEATURE_MOUNT_LOOP(
46//usage: "\n loop Ignored (loop devices are autodetected)"
47//usage: )
48//usage: IF_FEATURE_MOUNT_FLAGS(
49//usage: "\n [a]sync Writes are [a]synchronous"
50//usage: "\n [no]atime Disable/enable updates to inode access times"
51//usage: "\n [no]diratime Disable/enable atime updates to directories"
52//usage: "\n [no]relatime Disable/enable atime updates relative to modification time"
53//usage: "\n [no]dev (Dis)allow use of special device files"
54//usage: "\n [no]exec (Dis)allow use of executable files"
55//usage: "\n [no]suid (Dis)allow set-user-id-root programs"
56//usage: "\n [r]shared Convert [recursively] to a shared subtree"
57//usage: "\n [r]slave Convert [recursively] to a slave subtree"
58//usage: "\n [r]private Convert [recursively] to a private subtree"
59//usage: "\n [un]bindable Make mount point [un]able to be bind mounted"
60//usage: "\n [r]bind Bind a file or directory [recursively] to another location"
61//usage: "\n move Relocate an existing mount point"
62//usage: )
63//usage: "\n remount Remount a mounted filesystem, changing flags"
64//usage: "\n ro/rw Same as -r/-w"
65//usage: "\n"
66//usage: "\nThere are filesystem-specific -o flags."
67//usage:
68//usage:#define mount_example_usage
69//usage: "$ mount\n"
70//usage: "/dev/hda3 on / type minix (rw)\n"
71//usage: "proc on /proc type proc (rw)\n"
72//usage: "devpts on /dev/pts type devpts (rw)\n"
73//usage: "$ mount /dev/fd0 /mnt -t msdos -o ro\n"
74//usage: "$ mount /tmp/diskimage /opt -t ext2 -o loop\n"
75//usage: "$ mount cd_image.iso mydir\n"
76//usage:#define mount_notes_usage
77//usage: "Returns 0 for success, number of failed mounts for -a, or errno for one mount."
78
19#include <mntent.h> 79#include <mntent.h>
20#include <syslog.h> 80#include <syslog.h>
21#include <sys/mount.h> 81#include <sys/mount.h>
diff --git a/util-linux/pivot_root.c b/util-linux/pivot_root.c
index ac52a7aed..83f01fabd 100644
--- a/util-linux/pivot_root.c
+++ b/util-linux/pivot_root.c
@@ -8,6 +8,13 @@
8 * 8 *
9 * Licensed under GPLv2, see file LICENSE in this source tree. 9 * Licensed under GPLv2, see file LICENSE in this source tree.
10 */ 10 */
11
12//usage:#define pivot_root_trivial_usage
13//usage: "NEW_ROOT PUT_OLD"
14//usage:#define pivot_root_full_usage "\n\n"
15//usage: "Move the current root file system to PUT_OLD and make NEW_ROOT\n"
16//usage: "the new root file system"
17
11#include "libbb.h" 18#include "libbb.h"
12 19
13extern int pivot_root(const char * new_root,const char * put_old); 20extern int pivot_root(const char * new_root,const char * put_old);
diff --git a/util-linux/rdate.c b/util-linux/rdate.c
index 2c3de74bc..628df0da7 100644
--- a/util-linux/rdate.c
+++ b/util-linux/rdate.c
@@ -8,6 +8,14 @@
8 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 8 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
9*/ 9*/
10 10
11//usage:#define rdate_trivial_usage
12//usage: "[-sp] HOST"
13//usage:#define rdate_full_usage "\n\n"
14//usage: "Get and possibly set the system date and time from a remote HOST\n"
15//usage: "\nOptions:"
16//usage: "\n -s Set the system date and time (default)"
17//usage: "\n -p Print the date and time"
18
11#include "libbb.h" 19#include "libbb.h"
12 20
13enum { RFC_868_BIAS = 2208988800UL }; 21enum { RFC_868_BIAS = 2208988800UL };
diff --git a/util-linux/rdev.c b/util-linux/rdev.c
index 2fbb4d377..1212f841e 100644
--- a/util-linux/rdev.c
+++ b/util-linux/rdev.c
@@ -9,6 +9,15 @@
9 * 9 *
10 */ 10 */
11 11
12//usage:#define rdev_trivial_usage
13//usage: ""
14//usage:#define rdev_full_usage "\n\n"
15//usage: "Print the device node associated with the filesystem mounted at '/'"
16//usage:
17//usage:#define rdev_example_usage
18//usage: "$ rdev\n"
19//usage: "/dev/mtdblock9 /\n"
20
12#include "libbb.h" 21#include "libbb.h"
13 22
14int rdev_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 23int rdev_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/util-linux/readprofile.c b/util-linux/readprofile.c
index f8a6e0cd0..7b7aa7c9f 100644
--- a/util-linux/readprofile.c
+++ b/util-linux/readprofile.c
@@ -32,6 +32,21 @@
32 * Paul Mundt <lethal@linux-sh.org>. 32 * Paul Mundt <lethal@linux-sh.org>.
33 */ 33 */
34 34
35//usage:#define readprofile_trivial_usage
36//usage: "[OPTIONS]"
37//usage:#define readprofile_full_usage "\n\n"
38//usage: "Options:"
39//usage: "\n -m mapfile (Default: /boot/System.map)"
40//usage: "\n -p profile (Default: /proc/profile)"
41//usage: "\n -M NUM Set the profiling multiplier to NUM"
42//usage: "\n -i Print only info about the sampling step"
43//usage: "\n -v Verbose"
44//usage: "\n -a Print all symbols, even if count is 0"
45//usage: "\n -b Print individual histogram-bin counts"
46//usage: "\n -s Print individual counters within functions"
47//usage: "\n -r Reset all the counters (root only)"
48//usage: "\n -n Disable byte order auto-detection"
49
35#include "libbb.h" 50#include "libbb.h"
36#include <sys/utsname.h> 51#include <sys/utsname.h>
37 52
diff --git a/util-linux/rtcwake.c b/util-linux/rtcwake.c
index 06ed7eafc..735a29822 100644
--- a/util-linux/rtcwake.c
+++ b/util-linux/rtcwake.c
@@ -23,6 +23,29 @@
23 * That flag should not be needed on systems with adjtime support. 23 * That flag should not be needed on systems with adjtime support.
24 */ 24 */
25 25
26//usage:#define rtcwake_trivial_usage
27//usage: "[-a | -l | -u] [-d DEV] [-m MODE] [-s SEC | -t TIME]"
28//usage:#define rtcwake_full_usage "\n\n"
29//usage: "Enter a system sleep state until specified wakeup time\n"
30//usage: IF_LONG_OPTS(
31//usage: "\n -a,--auto Read clock mode from adjtime"
32//usage: "\n -l,--local Clock is set to local time"
33//usage: "\n -u,--utc Clock is set to UTC time"
34//usage: "\n -d,--device=DEV Specify the RTC device"
35//usage: "\n -m,--mode=MODE Set the sleep state (default: standby)"
36//usage: "\n -s,--seconds=SEC Set the timeout in SEC seconds from now"
37//usage: "\n -t,--time=TIME Set the timeout to TIME seconds from epoch"
38//usage: )
39//usage: IF_NOT_LONG_OPTS(
40//usage: "\n -a Read clock mode from adjtime"
41//usage: "\n -l Clock is set to local time"
42//usage: "\n -u Clock is set to UTC time"
43//usage: "\n -d DEV Specify the RTC device"
44//usage: "\n -m MODE Set the sleep state (default: standby)"
45//usage: "\n -s SEC Set the timeout in SEC seconds from now"
46//usage: "\n -t TIME Set the timeout to TIME seconds from epoch"
47//usage: )
48
26#include "libbb.h" 49#include "libbb.h"
27#include "rtc_.h" 50#include "rtc_.h"
28 51
diff --git a/util-linux/script.c b/util-linux/script.c
index 47efc4526..26f16ebf5 100644
--- a/util-linux/script.c
+++ b/util-linux/script.c
@@ -10,6 +10,19 @@
10 * 10 *
11 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 11 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
12 */ 12 */
13
14//usage:#define script_trivial_usage
15//usage: "[-afq" IF_SCRIPTREPLAY("t") "] [-c PROG] [OUTFILE]"
16//usage:#define script_full_usage "\n\n"
17//usage: "Options:"
18//usage: "\n -a Append output"
19//usage: "\n -c PROG Run PROG, not shell"
20//usage: "\n -f Flush output after each write"
21//usage: "\n -q Quiet"
22//usage: IF_SCRIPTREPLAY(
23//usage: "\n -t Send timing to stderr"
24//usage: )
25
13#include "libbb.h" 26#include "libbb.h"
14 27
15int script_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 28int script_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/util-linux/scriptreplay.c b/util-linux/scriptreplay.c
index 6eaba43fa..382f56d9a 100644
--- a/util-linux/scriptreplay.c
+++ b/util-linux/scriptreplay.c
@@ -7,6 +7,12 @@
7 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8 * 8 *
9 */ 9 */
10
11//usage:#define scriptreplay_trivial_usage
12//usage: "timingfile [typescript [divisor]]"
13//usage:#define scriptreplay_full_usage "\n\n"
14//usage: "Play back typescripts, using timing information"
15
10#include "libbb.h" 16#include "libbb.h"
11 17
12int scriptreplay_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 18int scriptreplay_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/util-linux/setarch.c b/util-linux/setarch.c
index 7d5dc247c..7b9421af1 100644
--- a/util-linux/setarch.c
+++ b/util-linux/setarch.c
@@ -5,7 +5,20 @@
5 * Copyright 2002 Andi Kleen, SuSE Labs. 5 * Copyright 2002 Andi Kleen, SuSE Labs.
6 * 6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
8*/ 8 */
9
10//usage:#define setarch_trivial_usage
11//usage: "personality PROG ARGS"
12//usage:#define setarch_full_usage "\n\n"
13//usage: "Personality may be:\n"
14//usage: " linux32 Set 32bit uname emulation\n"
15//usage: " linux64 Set 64bit uname emulation"
16//usage:
17//usage:#define linux32_trivial_usage NOUSAGE_STR
18//usage:#define linux32_full_usage ""
19//usage:
20//usage:#define linux64_trivial_usage NOUSAGE_STR
21//usage:#define linux64_full_usage ""
9 22
10#include <sys/personality.h> 23#include <sys/personality.h>
11 24
diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c
index e2c060f30..b7cf69833 100644
--- a/util-linux/swaponoff.c
+++ b/util-linux/swaponoff.c
@@ -7,6 +7,23 @@
7 * Licensed under GPLv2, see file LICENSE in this source tree. 7 * Licensed under GPLv2, see file LICENSE in this source tree.
8 */ 8 */
9 9
10//usage:#define swapon_trivial_usage
11//usage: "[-a]" IF_FEATURE_SWAPON_PRI(" [-p PRI]") " [DEVICE]"
12//usage:#define swapon_full_usage "\n\n"
13//usage: "Start swapping on DEVICE\n"
14//usage: "\nOptions:"
15//usage: "\n -a Start swapping on all swap devices"
16//usage: IF_FEATURE_SWAPON_PRI(
17//usage: "\n -p PRI Set swap device priority"
18//usage: )
19//usage:
20//usage:#define swapoff_trivial_usage
21//usage: "[-a] [DEVICE]"
22//usage:#define swapoff_full_usage "\n\n"
23//usage: "Stop swapping on DEVICE\n"
24//usage: "\nOptions:"
25//usage: "\n -a Stop swapping on all swap devices"
26
10#include "libbb.h" 27#include "libbb.h"
11#include <mntent.h> 28#include <mntent.h>
12#include <sys/swap.h> 29#include <sys/swap.h>
diff --git a/util-linux/switch_root.c b/util-linux/switch_root.c
index d471437fd..7794de18d 100644
--- a/util-linux/switch_root.c
+++ b/util-linux/switch_root.c
@@ -5,6 +5,16 @@
5 * 5 *
6 * Licensed under GPLv2, see file LICENSE in this source tree. 6 * Licensed under GPLv2, see file LICENSE in this source tree.
7 */ 7 */
8
9//usage:#define switch_root_trivial_usage
10//usage: "[-c /dev/console] NEW_ROOT NEW_INIT [ARGS]"
11//usage:#define switch_root_full_usage "\n\n"
12//usage: "Free initramfs and switch to another root fs:\n"
13//usage: "chroot to NEW_ROOT, delete all in /, move NEW_ROOT to /,\n"
14//usage: "execute NEW_INIT. PID must be 1. NEW_ROOT must be a mountpoint.\n"
15//usage: "\nOptions:"
16//usage: "\n -c DEV Reopen stdio to DEV after switch"
17
8#include <sys/vfs.h> 18#include <sys/vfs.h>
9#include <sys/mount.h> 19#include <sys/mount.h>
10#include "libbb.h" 20#include "libbb.h"
diff --git a/util-linux/umount.c b/util-linux/umount.c
index 5597d9eba..1e576ca4e 100644
--- a/util-linux/umount.c
+++ b/util-linux/umount.c
@@ -7,6 +7,28 @@
7 * 7 *
8 * Licensed under GPLv2, see file LICENSE in this source tree. 8 * Licensed under GPLv2, see file LICENSE in this source tree.
9 */ 9 */
10
11//usage:#define umount_trivial_usage
12//usage: "[OPTIONS] FILESYSTEM|DIRECTORY"
13//usage:#define umount_full_usage "\n\n"
14//usage: "Unmount file systems\n"
15//usage: "\nOptions:"
16//usage: IF_FEATURE_UMOUNT_ALL(
17//usage: "\n -a Unmount all file systems" IF_FEATURE_MTAB_SUPPORT(" in /etc/mtab")
18//usage: )
19//usage: IF_FEATURE_MTAB_SUPPORT(
20//usage: "\n -n Don't erase /etc/mtab entries"
21//usage: )
22//usage: "\n -r Try to remount devices as read-only if mount is busy"
23//usage: "\n -l Lazy umount (detach filesystem)"
24//usage: "\n -f Force umount (i.e., unreachable NFS server)"
25//usage: IF_FEATURE_MOUNT_LOOP(
26//usage: "\n -d Free loop device if it has been used"
27//usage: )
28//usage:
29//usage:#define umount_example_usage
30//usage: "$ umount /dev/hdc1\n"
31
10#include <mntent.h> 32#include <mntent.h>
11#include <sys/mount.h> 33#include <sys/mount.h>
12#include "libbb.h" 34#include "libbb.h"