From c314ca9016530aae61b4e50242ba6a6e09b2914a Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 13 Nov 2016 22:56:04 +0100 Subject: Make setarch/linux32/linux64 independently selectable Signed-off-by: Denys Vlasenko --- util-linux/setarch.c | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'util-linux') diff --git a/util-linux/setarch.c b/util-linux/setarch.c index 2e989ec2a..ec473e9cb 100644 --- a/util-linux/setarch.c +++ b/util-linux/setarch.c @@ -15,12 +15,28 @@ //config: specified program (usually a shell). It only makes sense to have //config: this util on a system that supports both 64bit and 32bit userland //config: (like amd64/x86, ppc64/ppc, sparc64/sparc, etc...). +//config: +//config:config LINUX32 +//config: bool "linux32" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: Alias to "setarch linux32". +//config: +//config:config LINUX64 +//config: bool "linux64" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: Alias to "setarch linux64". //applet:IF_SETARCH(APPLET(setarch, BB_DIR_BIN, BB_SUID_DROP)) -//applet:IF_SETARCH(APPLET_ODDNAME(linux32, setarch, BB_DIR_BIN, BB_SUID_DROP, linux32)) -//applet:IF_SETARCH(APPLET_ODDNAME(linux64, setarch, BB_DIR_BIN, BB_SUID_DROP, linux64)) +//applet:IF_LINUX32(APPLET_ODDNAME(linux32, setarch, BB_DIR_BIN, BB_SUID_DROP, linux32)) +//applet:IF_LINUX64(APPLET_ODDNAME(linux64, setarch, BB_DIR_BIN, BB_SUID_DROP, linux64)) //kbuild:lib-$(CONFIG_SETARCH) += setarch.o +//kbuild:lib-$(CONFIG_LINUX32) += setarch.o +//kbuild:lib-$(CONFIG_LINUX64) += setarch.o //usage:#define setarch_trivial_usage //usage: "PERSONALITY [-R] PROG ARGS" @@ -58,12 +74,15 @@ int setarch_main(int argc UNUSED_PARAM, char **argv) if (ENABLE_SETARCH && applet_name[0] == 's' && argv[1] && is_prefixed_with(argv[1], "linux") ) { - applet_name = argv[1]; argv++; + applet_name = argv[0]; } - if (applet_name[5] == '6') /* linux64 */ + if ((!ENABLE_SETARCH && !ENABLE_LINUX32) || applet_name[5] == '6') + /* linux64 */ pers = PER_LINUX; - else if (applet_name[5] == '3') /* linux32 */ + else + if ((!ENABLE_SETARCH && !ENABLE_LINUX64) || applet_name[5] == '3') + /* linux32 */ pers = PER_LINUX32; else bb_show_usage(); -- cgit v1.2.3-55-g6feb From f417ffd88f194bbfd18605882ee242190c1bab34 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 14 Nov 2016 17:30:50 +0100 Subject: Make swapon and swapoff individually selectable. For example, without swapoff, code shrinks by 277 bytes. Signed-off-by: Denys Vlasenko --- include/applets.src.h | 2 -- util-linux/Config.src | 28 --------------------------- util-linux/Kbuild.src | 1 - util-linux/swaponoff.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 50 insertions(+), 32 deletions(-) (limited to 'util-linux') diff --git a/include/applets.src.h b/include/applets.src.h index dbc45953c..f2c754b74 100644 --- a/include/applets.src.h +++ b/include/applets.src.h @@ -287,8 +287,6 @@ IF_STAT(APPLET(stat, BB_DIR_BIN, BB_SUID_DROP)) IF_STRINGS(APPLET(strings, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_STTY(APPLET(stty, BB_DIR_BIN, BB_SUID_DROP)) IF_SUM(APPLET(sum, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_SWAPONOFF(APPLET_ODDNAME(swapoff, swap_on_off, BB_DIR_SBIN, BB_SUID_DROP, swapoff)) -IF_SWAPONOFF(APPLET_ODDNAME(swapon, swap_on_off, BB_DIR_SBIN, BB_SUID_DROP, swapon)) IF_SWITCH_ROOT(APPLET(switch_root, BB_DIR_SBIN, BB_SUID_DROP)) IF_BB_SYSCTL(APPLET(sysctl, BB_DIR_SBIN, BB_SUID_DROP)) IF_TAC(APPLET_NOEXEC(tac, tac, BB_DIR_USR_BIN, BB_SUID_DROP, tac)) diff --git a/util-linux/Config.src b/util-linux/Config.src index 922cabdb8..ee0d8a632 100644 --- a/util-linux/Config.src +++ b/util-linux/Config.src @@ -489,34 +489,6 @@ config SCRIPTREPLAY This program replays a typescript, using timing information given by script -t. -config SWAPONOFF - bool "swaponoff" - default y - select PLATFORM_LINUX - help - This option enables both the 'swapon' and the 'swapoff' utilities. - Once you have created some swap space using 'mkswap', you also need - to enable your swap space with the 'swapon' utility. The 'swapoff' - utility is used, typically at system shutdown, to disable any swap - space. If you are not using any swap space, you can leave this - option disabled. - -config FEATURE_SWAPON_DISCARD - bool "Support discard option -d" - default y - depends on SWAPONOFF - help - Enable support for discarding swap area blocks at swapon and/or as - the kernel frees them. This option enables both the -d option on - 'swapon' and the 'discard' option for swap entries in /etc/fstab. - -config FEATURE_SWAPON_PRI - bool "Support priority option -p" - default y - depends on SWAPONOFF - help - Enable support for setting swap device priority in swapon. - config SWITCH_ROOT bool "switch_root" default y diff --git a/util-linux/Kbuild.src b/util-linux/Kbuild.src index 0b87c52ac..5ee5cf7ff 100644 --- a/util-linux/Kbuild.src +++ b/util-linux/Kbuild.src @@ -40,6 +40,5 @@ lib-$(CONFIG_READPROFILE) += readprofile.o lib-$(CONFIG_RTCWAKE) += rtcwake.o lib-$(CONFIG_SCRIPT) += script.o lib-$(CONFIG_SCRIPTREPLAY) += scriptreplay.o -lib-$(CONFIG_SWAPONOFF) += swaponoff.o lib-$(CONFIG_SWITCH_ROOT) += switch_root.o lib-$(CONFIG_UMOUNT) += umount.o diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c index 6713852e5..0a2d23f50 100644 --- a/util-linux/swaponoff.c +++ b/util-linux/swaponoff.c @@ -7,6 +7,47 @@ * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config SWAPON +//config: bool "swapon" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: This option enables the 'swapon' utility. +//config: Once you have created some swap space using 'mkswap', you also need +//config: to enable your swap space with the 'swapon' utility. The 'swapoff' +//config: utility is used, typically at system shutdown, to disable any swap +//config: space. If you are not using any swap space, you can leave this +//config: option disabled. +//config: +//config:config FEATURE_SWAPON_DISCARD +//config: bool "Support discard option -d" +//config: default y +//config: depends on SWAPON +//config: help +//config: Enable support for discarding swap area blocks at swapon and/or as +//config: the kernel frees them. This option enables both the -d option on +//config: 'swapon' and the 'discard' option for swap entries in /etc/fstab. +//config: +//config:config FEATURE_SWAPON_PRI +//config: bool "Support priority option -p" +//config: default y +//config: depends on SWAPON +//config: help +//config: Enable support for setting swap device priority in swapon. +//config: +//config:config SWAPOFF +//config: bool "swapoff" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: This option enables the 'swapoff' utility. + +//applet:IF_SWAPON(APPLET_ODDNAME(swapon, swap_on_off, BB_DIR_SBIN, BB_SUID_DROP, swapon)) +//applet:IF_SWAPOFF(APPLET_ODDNAME(swapoff, swap_on_off, BB_DIR_SBIN, BB_SUID_DROP, swapoff)) + +//kbuild:lib-$(CONFIG_SWAPON) += swaponoff.o +//kbuild:lib-$(CONFIG_SWAPOFF) += swaponoff.o + //usage:#define swapon_trivial_usage //usage: "[-a] [-e]" IF_FEATURE_SWAPON_DISCARD(" [-d[POL]]") IF_FEATURE_SWAPON_PRI(" [-p PRI]") " [DEVICE]" //usage:#define swapon_full_usage "\n\n" @@ -74,7 +115,15 @@ struct globals { #endif #define INIT_G() do { setup_common_bufsiz(); } while (0) -#define do_swapoff (applet_name[5] == 'f') +#if ENABLE_SWAPOFF +# if ENABLE_SWAPON +# define do_swapoff (applet_name[5] == 'f') +# else +# define do_swapoff 1 +# endif +#else +# define do_swapoff 0 +#endif /* Command line options */ enum { -- cgit v1.2.3-55-g6feb From 0581a2f3041184db1af997305908e211d3e4e34f Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 16 Nov 2016 16:12:11 +0100 Subject: Make mke2fs and mkfs.ext2 individually selectable Signed-off-by: Denys Vlasenko --- include/applets.src.h | 3 --- util-linux/Config.src | 7 ------- util-linux/Kbuild.src | 1 - util-linux/mkfs_ext2.c | 20 ++++++++++++++++++++ 4 files changed, 20 insertions(+), 11 deletions(-) (limited to 'util-linux') diff --git a/include/applets.src.h b/include/applets.src.h index 36e1f0266..0293952ef 100644 --- a/include/applets.src.h +++ b/include/applets.src.h @@ -204,10 +204,7 @@ IF_MATCHPATHCON(APPLET(matchpathcon, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_MICROCOM(APPLET(microcom, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_MKDIR(APPLET_NOFORK(mkdir, mkdir, BB_DIR_BIN, BB_SUID_DROP, mkdir)) IF_MKFS_VFAT(APPLET_ODDNAME(mkdosfs, mkfs_vfat, BB_DIR_SBIN, BB_SUID_DROP, mkfs_vfat)) -IF_MKFS_EXT2(APPLET_ODDNAME(mke2fs, mkfs_ext2, BB_DIR_SBIN, BB_SUID_DROP, mkfs_ext2)) IF_MKFIFO(APPLET_NOEXEC(mkfifo, mkfifo, BB_DIR_USR_BIN, BB_SUID_DROP, mkfifo)) -IF_MKFS_EXT2(APPLET_ODDNAME(mkfs.ext2, mkfs_ext2, BB_DIR_SBIN, BB_SUID_DROP, mkfs_ext2)) -//IF_MKE2FS(APPLET_ODDNAME(mkfs.ext3, mke2fs, BB_DIR_SBIN, BB_SUID_DROP, mkfs_ext3)) IF_MKFS_MINIX(APPLET_ODDNAME(mkfs.minix, mkfs_minix, BB_DIR_SBIN, BB_SUID_DROP, mkfs_minix)) IF_MKFS_REISER(APPLET_ODDNAME(mkfs.reiser, mkfs_reiser, BB_DIR_SBIN, BB_SUID_DROP, mkfs_reiser)) IF_MKFS_VFAT(APPLET_ODDNAME(mkfs.vfat, mkfs_vfat, BB_DIR_SBIN, BB_SUID_DROP, mkfs_vfat)) diff --git a/util-linux/Config.src b/util-linux/Config.src index ee0d8a632..72d3be1f8 100644 --- a/util-linux/Config.src +++ b/util-linux/Config.src @@ -246,13 +246,6 @@ config FSCK_MINIX check for and attempt to repair any corruption that occurs to a minix filesystem. -config MKFS_EXT2 - bool "mkfs_ext2" - default y - select PLATFORM_LINUX - help - Utility to create EXT2 filesystems. - config MKFS_MINIX bool "mkfs_minix" default y diff --git a/util-linux/Kbuild.src b/util-linux/Kbuild.src index 5ee5cf7ff..41cf77809 100644 --- a/util-linux/Kbuild.src +++ b/util-linux/Kbuild.src @@ -26,7 +26,6 @@ lib-$(CONFIG_IPCS) += ipcs.o lib-$(CONFIG_LOSETUP) += losetup.o lib-$(CONFIG_LSPCI) += lspci.o lib-$(CONFIG_LSUSB) += lsusb.o -lib-$(CONFIG_MKFS_EXT2) += mkfs_ext2.o lib-$(CONFIG_MKFS_MINIX) += mkfs_minix.o lib-$(CONFIG_MKFS_REISER) += mkfs_reiser.o lib-$(CONFIG_MKFS_VFAT) += mkfs_vfat.o diff --git a/util-linux/mkfs_ext2.c b/util-linux/mkfs_ext2.c index 413e7aa15..5816a208e 100644 --- a/util-linux/mkfs_ext2.c +++ b/util-linux/mkfs_ext2.c @@ -7,6 +7,26 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config MKE2FS +//config: bool "mke2fs" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: Utility to create EXT2 filesystems. +//config: +//config:config MKFS_EXT2 +//config: bool "mkfs.ext2" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: Alias to "mke2fs". + +//applet:IF_MKE2FS(APPLET_ODDNAME(mke2fs, mkfs_ext2, BB_DIR_SBIN, BB_SUID_DROP, mkfs_ext2)) +//applet:IF_MKFS_EXT2(APPLET_ODDNAME(mkfs.ext2, mkfs_ext2, BB_DIR_SBIN, BB_SUID_DROP, mkfs_ext2)) +////////:IF_MKFS_EXT3(APPLET_ODDNAME(mkfs.ext3, mkfs_ext2, BB_DIR_SBIN, BB_SUID_DROP, mkfs_ext2)) + +//kbuild:lib-$(CONFIG_MKE2FS) += mkfs_ext2.o +//kbuild:lib-$(CONFIG_MKFS_EXT2) += mkfs_ext2.o //usage:#define mkfs_ext2_trivial_usage //usage: "[-Fn] " -- cgit v1.2.3-55-g6feb From 10880cc20ff424c5443a8fc6b6afa5c59c5ef602 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 16 Nov 2016 16:18:50 +0100 Subject: Make mkfs.vfat and mkdosfs individually selectable Signed-off-by: Denys Vlasenko --- include/applets.src.h | 2 -- util-linux/Config.src | 7 ------- util-linux/Kbuild.src | 1 - util-linux/mkfs_vfat.c | 19 +++++++++++++++++++ 4 files changed, 19 insertions(+), 10 deletions(-) (limited to 'util-linux') diff --git a/include/applets.src.h b/include/applets.src.h index 0293952ef..f834d9040 100644 --- a/include/applets.src.h +++ b/include/applets.src.h @@ -203,11 +203,9 @@ IF_MAN(APPLET(man, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_MATCHPATHCON(APPLET(matchpathcon, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_MICROCOM(APPLET(microcom, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_MKDIR(APPLET_NOFORK(mkdir, mkdir, BB_DIR_BIN, BB_SUID_DROP, mkdir)) -IF_MKFS_VFAT(APPLET_ODDNAME(mkdosfs, mkfs_vfat, BB_DIR_SBIN, BB_SUID_DROP, mkfs_vfat)) IF_MKFIFO(APPLET_NOEXEC(mkfifo, mkfifo, BB_DIR_USR_BIN, BB_SUID_DROP, mkfifo)) IF_MKFS_MINIX(APPLET_ODDNAME(mkfs.minix, mkfs_minix, BB_DIR_SBIN, BB_SUID_DROP, mkfs_minix)) IF_MKFS_REISER(APPLET_ODDNAME(mkfs.reiser, mkfs_reiser, BB_DIR_SBIN, BB_SUID_DROP, mkfs_reiser)) -IF_MKFS_VFAT(APPLET_ODDNAME(mkfs.vfat, mkfs_vfat, BB_DIR_SBIN, BB_SUID_DROP, mkfs_vfat)) IF_MKNOD(APPLET_NOEXEC(mknod, mknod, BB_DIR_BIN, BB_SUID_DROP, mknod)) IF_MKSWAP(APPLET(mkswap, BB_DIR_SBIN, BB_SUID_DROP)) IF_MORE(APPLET(more, BB_DIR_BIN, BB_SUID_DROP)) diff --git a/util-linux/Config.src b/util-linux/Config.src index 72d3be1f8..9bef0d532 100644 --- a/util-linux/Config.src +++ b/util-linux/Config.src @@ -272,13 +272,6 @@ config MKFS_REISER Utility to create ReiserFS filesystems. Note: this applet needs a lot of testing and polishing. -config MKFS_VFAT - bool "mkfs_vfat" - default y - select PLATFORM_LINUX - help - Utility to create FAT32 filesystems. - config GETOPT bool "getopt" default y diff --git a/util-linux/Kbuild.src b/util-linux/Kbuild.src index 41cf77809..dfd50afa2 100644 --- a/util-linux/Kbuild.src +++ b/util-linux/Kbuild.src @@ -28,7 +28,6 @@ lib-$(CONFIG_LSPCI) += lspci.o lib-$(CONFIG_LSUSB) += lsusb.o lib-$(CONFIG_MKFS_MINIX) += mkfs_minix.o lib-$(CONFIG_MKFS_REISER) += mkfs_reiser.o -lib-$(CONFIG_MKFS_VFAT) += mkfs_vfat.o lib-$(CONFIG_MKSWAP) += mkswap.o lib-$(CONFIG_MORE) += more.o lib-$(CONFIG_MOUNT) += mount.o diff --git a/util-linux/mkfs_vfat.c b/util-linux/mkfs_vfat.c index d53c751eb..ab70853a1 100644 --- a/util-linux/mkfs_vfat.c +++ b/util-linux/mkfs_vfat.c @@ -7,6 +7,25 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config MKDOSFS +//config: bool "mkdosfs" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: Utility to create FAT32 filesystems. +//config: +//config:config MKFS_VFAT +//config: bool "mkfs.vfat" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: Alias to "mkdosfs". + +//applet:IF_MKDOSFS(APPLET_ODDNAME(mkdosfs, mkfs_vfat, BB_DIR_SBIN, BB_SUID_DROP, mkfs_vfat)) +//applet:IF_MKFS_VFAT(APPLET_ODDNAME(mkfs.vfat, mkfs_vfat, BB_DIR_SBIN, BB_SUID_DROP, mkfs_vfat)) + +//kbuild:lib-$(CONFIG_MKDOSFS) += mkfs_vfat.o +//kbuild:lib-$(CONFIG_MKFS_VFAT) += mkfs_vfat.o //usage:#define mkfs_vfat_trivial_usage //usage: "[-v] [-n LABEL] BLOCKDEV [KBYTES]" -- cgit v1.2.3-55-g6feb From dd898c9f3388fca1d7339a45150fbb7406de0971 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 23 Nov 2016 11:46:32 +0100 Subject: Convert all util-linux/* applets to "new style" applet definitions Signed-off-by: Denys Vlasenko --- include/applets.src.h | 39 ---- util-linux/Config.src | 505 ---------------------------------------------- util-linux/Kbuild.src | 33 --- util-linux/acpid.c | 26 +++ util-linux/blkdiscard.c | 1 - util-linux/blkid.c | 20 ++ util-linux/blockdev.c | 9 +- util-linux/dmesg.c | 37 ++++ util-linux/fatattr.c | 1 + util-linux/fbset.c | 32 +++ util-linux/fdformat.c | 10 + util-linux/fdisk.c | 80 ++++++++ util-linux/findfs.c | 14 ++ util-linux/flock.c | 9 + util-linux/freeramdisk.c | 30 +++ util-linux/fsck_minix.c | 14 ++ util-linux/getopt.c | 22 +- util-linux/hexdump.c | 29 +++ util-linux/hwclock.c | 36 +++- util-linux/ipcrm.c | 11 + util-linux/ipcs.c | 11 + util-linux/losetup.c | 12 ++ util-linux/lspci.c | 13 ++ util-linux/lsusb.c | 13 ++ util-linux/mkfs_minix.c | 21 ++ util-linux/mkfs_reiser.c | 11 + util-linux/mkswap.c | 23 +++ util-linux/more.c | 13 ++ util-linux/mount.c | 8 + util-linux/pivot_root.c | 16 ++ util-linux/rdate.c | 14 +- util-linux/rdev.c | 9 + util-linux/readprofile.c | 10 + util-linux/rev.c | 9 +- util-linux/rtcwake.c | 10 + util-linux/script.c | 9 + util-linux/scriptreplay.c | 10 + util-linux/swaponoff.c | 1 - util-linux/switch_root.c | 23 +++ util-linux/uevent.c | 1 - util-linux/umount.c | 20 ++ util-linux/unshare.c | 1 - 42 files changed, 622 insertions(+), 594 deletions(-) (limited to 'util-linux') diff --git a/include/applets.src.h b/include/applets.src.h index adce804e5..23453b0ef 100644 --- a/include/applets.src.h +++ b/include/applets.src.h @@ -75,9 +75,7 @@ s - suid type: INSERT IF_TEST(APPLET_NOFORK([, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) IF_TEST(APPLET_NOFORK([[, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) -IF_ACPID(APPLET(acpid, BB_DIR_SBIN, BB_SUID_DROP)) IF_BASENAME(APPLET_NOFORK(basename, basename, BB_DIR_USR_BIN, BB_SUID_DROP, basename)) -IF_BLKID(APPLET(blkid, BB_DIR_SBIN, BB_SUID_DROP)) IF_CAL(APPLET(cal, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_CAT(APPLET_NOFORK(cat, cat, BB_DIR_BIN, BB_SUID_DROP, cat)) IF_CATV(APPLET(catv, BB_DIR_BIN, BB_SUID_DROP)) @@ -94,7 +92,6 @@ IF_DD(APPLET_NOEXEC(dd, dd, BB_DIR_BIN, BB_SUID_DROP, dd)) IF_DF(APPLET(df, BB_DIR_BIN, BB_SUID_DROP)) IF_DHCPRELAY(APPLET(dhcprelay, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_DIRNAME(APPLET_NOFORK(dirname, dirname, BB_DIR_USR_BIN, BB_SUID_DROP, dirname)) -IF_DMESG(APPLET(dmesg, BB_DIR_BIN, BB_SUID_DROP)) IF_DOS2UNIX(APPLET_NOEXEC(dos2unix, dos2unix, BB_DIR_USR_BIN, BB_SUID_DROP, dos2unix)) IF_DU(APPLET(du, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_DUMPLEASES(APPLET(dumpleases, BB_DIR_USR_BIN, BB_SUID_DROP)) @@ -105,71 +102,37 @@ IF_ENV(APPLET_NOEXEC(env, env, BB_DIR_USR_BIN, BB_SUID_DROP, env)) IF_EXPAND(APPLET(expand, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_EXPR(APPLET(expr, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_FALSE(APPLET_NOFORK(false, false, BB_DIR_BIN, BB_SUID_DROP, false)) -IF_FBSET(APPLET(fbset, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_FDFLUSH(APPLET_ODDNAME(fdflush, freeramdisk, BB_DIR_BIN, BB_SUID_DROP, fdflush)) -IF_FDFORMAT(APPLET(fdformat, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_FDISK(APPLET(fdisk, BB_DIR_SBIN, BB_SUID_DROP)) -/* Benefits from suid root: better access to /dev/BLOCKDEVs: */ -IF_FINDFS(APPLET(findfs, BB_DIR_SBIN, BB_SUID_MAYBE)) -IF_FLOCK(APPLET(flock, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_FOLD(APPLET_NOEXEC(fold, fold, BB_DIR_USR_BIN, BB_SUID_DROP, fold)) -IF_FREERAMDISK(APPLET(freeramdisk, BB_DIR_SBIN, BB_SUID_DROP)) //IF_E2FSCK(APPLET_ODDNAME(fsck.ext2, e2fsck, BB_DIR_SBIN, BB_SUID_DROP, fsck_ext2)) //IF_E2FSCK(APPLET_ODDNAME(fsck.ext3, e2fsck, BB_DIR_SBIN, BB_SUID_DROP, fsck_ext3)) -IF_FSCK_MINIX(APPLET_ODDNAME(fsck.minix, fsck_minix, BB_DIR_SBIN, BB_SUID_DROP, fsck_minix)) IF_FSYNC(APPLET_NOFORK(fsync, fsync, BB_DIR_BIN, BB_SUID_DROP, fsync)) IF_GETENFORCE(APPLET(getenforce, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_GETOPT(APPLET(getopt, BB_DIR_BIN, BB_SUID_DROP)) IF_GETSEBOOL(APPLET(getsebool, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_HD(APPLET_NOEXEC(hd, hexdump, BB_DIR_USR_BIN, BB_SUID_DROP, hd)) IF_HEAD(APPLET_NOEXEC(head, head, BB_DIR_USR_BIN, BB_SUID_DROP, head)) -IF_HEXDUMP(APPLET_NOEXEC(hexdump, hexdump, BB_DIR_USR_BIN, BB_SUID_DROP, hexdump)) -IF_HWCLOCK(APPLET(hwclock, BB_DIR_SBIN, BB_SUID_DROP)) IF_INSTALL(APPLET(install, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_IPCRM(APPLET(ipcrm, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_IPCS(APPLET(ipcs, BB_DIR_USR_BIN, BB_SUID_DROP)) //IF_LENGTH(APPLET_NOFORK(length, length, BB_DIR_USR_BIN, BB_SUID_DROP, length)) IF_LN(APPLET_NOEXEC(ln, ln, BB_DIR_BIN, BB_SUID_DROP, ln)) IF_LOAD_POLICY(APPLET(load_policy, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_LOGNAME(APPLET_NOFORK(logname, logname, BB_DIR_USR_BIN, BB_SUID_DROP, logname)) -IF_LOSETUP(APPLET(losetup, BB_DIR_SBIN, BB_SUID_DROP)) IF_LS(APPLET_NOEXEC(ls, ls, BB_DIR_BIN, BB_SUID_DROP, ls)) -IF_LSPCI(APPLET(lspci, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_LSUSB(APPLET(lsusb, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_MATCHPATHCON(APPLET(matchpathcon, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_MKDIR(APPLET_NOFORK(mkdir, mkdir, BB_DIR_BIN, BB_SUID_DROP, mkdir)) IF_MKFIFO(APPLET_NOEXEC(mkfifo, mkfifo, BB_DIR_USR_BIN, BB_SUID_DROP, mkfifo)) -IF_MKFS_MINIX(APPLET_ODDNAME(mkfs.minix, mkfs_minix, BB_DIR_SBIN, BB_SUID_DROP, mkfs_minix)) -IF_MKFS_REISER(APPLET_ODDNAME(mkfs.reiser, mkfs_reiser, BB_DIR_SBIN, BB_SUID_DROP, mkfs_reiser)) IF_MKNOD(APPLET_NOEXEC(mknod, mknod, BB_DIR_BIN, BB_SUID_DROP, mknod)) -IF_MKSWAP(APPLET(mkswap, BB_DIR_SBIN, BB_SUID_DROP)) -IF_MORE(APPLET(more, BB_DIR_BIN, BB_SUID_DROP)) -/* On full-blown systems, requires suid for user mounts. - * But it's not unthinkable to have it available in non-suid flavor on some systems, - * for viewing mount table. - * Therefore we use BB_SUID_MAYBE instead of BB_SUID_REQUIRE: */ -IF_MOUNT(APPLET(mount, BB_DIR_BIN, IF_DESKTOP(BB_SUID_MAYBE) IF_NOT_DESKTOP(BB_SUID_DROP))) IF_MV(APPLET(mv, BB_DIR_BIN, BB_SUID_DROP)) IF_NICE(APPLET(nice, BB_DIR_BIN, BB_SUID_DROP)) IF_NOHUP(APPLET(nohup, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_OD(APPLET(od, BB_DIR_USR_BIN, BB_SUID_DROP)) //IF_PARSE(APPLET(parse, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_PIVOT_ROOT(APPLET(pivot_root, BB_DIR_SBIN, BB_SUID_DROP)) IF_PRINTENV(APPLET_NOFORK(printenv, printenv, BB_DIR_BIN, BB_SUID_DROP, printenv)) IF_PRINTF(APPLET_NOFORK(printf, printf, BB_DIR_USR_BIN, BB_SUID_DROP, printf)) IF_PWD(APPLET_NOFORK(pwd, pwd, BB_DIR_BIN, BB_SUID_DROP, pwd)) -IF_RDATE(APPLET(rdate, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_RDEV(APPLET(rdev, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_READLINK(APPLET(readlink, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_READPROFILE(APPLET(readprofile, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_REALPATH(APPLET(realpath, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_RESTORECON(APPLET_ODDNAME(restorecon, setfiles, BB_DIR_SBIN, BB_SUID_DROP, restorecon)) IF_RM(APPLET_NOFORK(rm, rm, BB_DIR_BIN, BB_SUID_DROP, rm)) IF_RMDIR(APPLET_NOFORK(rmdir, rmdir, BB_DIR_BIN, BB_SUID_DROP, rmdir)) -IF_RTCWAKE(APPLET(rtcwake, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_RUNCON(APPLET(runcon, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_SCRIPT(APPLET(script, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_SCRIPTREPLAY(APPLET(scriptreplay, BB_DIR_BIN, BB_SUID_DROP)) IF_SELINUXENABLED(APPLET(selinuxenabled, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_SEQ(APPLET_NOFORK(seq, seq, BB_DIR_USR_BIN, BB_SUID_DROP, seq)) IF_SESTATUS(APPLET(sestatus, BB_DIR_USR_SBIN, BB_SUID_DROP)) @@ -183,7 +146,6 @@ IF_SPLIT(APPLET(split, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_STAT(APPLET(stat, BB_DIR_BIN, BB_SUID_DROP)) IF_STTY(APPLET(stty, BB_DIR_BIN, BB_SUID_DROP)) IF_SUM(APPLET(sum, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_SWITCH_ROOT(APPLET(switch_root, BB_DIR_SBIN, BB_SUID_DROP)) IF_TAC(APPLET_NOEXEC(tac, tac, BB_DIR_USR_BIN, BB_SUID_DROP, tac)) IF_TAIL(APPLET(tail, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_TEE(APPLET(tee, BB_DIR_USR_BIN, BB_SUID_DROP)) @@ -193,7 +155,6 @@ IF_TRUE(APPLET_NOFORK(true, true, BB_DIR_BIN, BB_SUID_DROP, true)) IF_TTY(APPLET(tty, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_UDHCPC(APPLET(udhcpc, BB_DIR_SBIN, BB_SUID_DROP)) IF_UDHCPD(APPLET(udhcpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) -IF_UMOUNT(APPLET(umount, BB_DIR_BIN, BB_SUID_DROP)) IF_UNAME(APPLET(uname, BB_DIR_BIN, BB_SUID_DROP)) IF_UNEXPAND(APPLET_ODDNAME(unexpand, expand, BB_DIR_USR_BIN, BB_SUID_DROP, unexpand)) IF_UNIQ(APPLET(uniq, BB_DIR_USR_BIN, BB_SUID_DROP)) diff --git a/util-linux/Config.src b/util-linux/Config.src index 9bef0d532..3c522f948 100644 --- a/util-linux/Config.src +++ b/util-linux/Config.src @@ -7,511 +7,6 @@ menu "Linux System Utilities" INSERT -config ACPID - bool "acpid" - default y - select PLATFORM_LINUX - help - acpid listens to ACPI events coming either in textual form from - /proc/acpi/event (though it is marked deprecated it is still widely - used and _is_ a standard) or in binary form from specified evdevs - (just use /dev/input/event*). - - It parses the event to retrieve ACTION and a possible PARAMETER. - It then spawns /etc/acpi/[/] either via run-parts - (if the resulting path is a directory) or directly as an executable. - - N.B. acpid relies on run-parts so have the latter installed. - -config FEATURE_ACPID_COMPAT - bool "Accept and ignore redundant options" - default y - depends on ACPID - help - Accept and ignore compatibility options -g -m -s -S -v. - -config BLKID - bool "blkid" - default y - select PLATFORM_LINUX - select VOLUMEID - help - Lists labels and UUIDs of all filesystems. - WARNING: - With all submodules selected, it will add ~8k to busybox. - -config FEATURE_BLKID_TYPE - bool "Print filesystem type" - default n - depends on BLKID - help - Show TYPE="filesystem type" - -config DMESG - bool "dmesg" - default y - select PLATFORM_LINUX - help - dmesg is used to examine or control the kernel ring buffer. When the - Linux kernel prints messages to the system log, they are stored in - the kernel ring buffer. You can use dmesg to print the kernel's ring - buffer, clear the kernel ring buffer, change the size of the kernel - ring buffer, and change the priority level at which kernel messages - are also logged to the system console. Enable this option if you - wish to enable the 'dmesg' utility. - -config FEATURE_DMESG_PRETTY - bool "Pretty dmesg output" - default y - depends on DMESG - help - If you wish to scrub the syslog level from the output, say 'Y' here. - The syslog level is a string prefixed to every line with the form - "<#>". - - With this option you will see: - # dmesg - Linux version 2.6.17.4 ..... - BIOS-provided physical RAM map: - BIOS-e820: 0000000000000000 - 000000000009f000 (usable) - - Without this option you will see: - # dmesg - <5>Linux version 2.6.17.4 ..... - <6>BIOS-provided physical RAM map: - <6> BIOS-e820: 0000000000000000 - 000000000009f000 (usable) - -config FBSET - bool "fbset" - default y - select PLATFORM_LINUX - help - fbset is used to show or change the settings of a Linux frame buffer - device. The frame buffer device provides a simple and unique - interface to access a graphics display. Enable this option - if you wish to enable the 'fbset' utility. - -config FEATURE_FBSET_FANCY - bool "Turn on extra fbset options" - default y - depends on FBSET - help - This option enables extended fbset options, allowing one to set the - framebuffer size, color depth, etc. interface to access a graphics - display. Enable this option if you wish to enable extended fbset - options. - -config FEATURE_FBSET_READMODE - bool "Turn on fbset readmode support" - default y - depends on FBSET - help - This option allows fbset to read the video mode database stored by - default as /etc/fb.modes, which can be used to set frame buffer - device to pre-defined video modes. - -config FDFLUSH - bool "fdflush" - default y - select PLATFORM_LINUX - help - fdflush is only needed when changing media on slightly-broken - removable media drives. It is used to make Linux believe that a - hardware disk-change switch has been actuated, which causes Linux to - forget anything it has cached from the previous media. If you have - such a slightly-broken drive, you will need to run fdflush every time - you change a disk. Most people have working hardware and can safely - leave this disabled. - -config FDFORMAT - bool "fdformat" - default y - select PLATFORM_LINUX - help - fdformat is used to low-level format a floppy disk. - -config FDISK - bool "fdisk" - default y - select PLATFORM_LINUX - help - The fdisk utility is used to divide hard disks into one or more - logical disks, which are generally called partitions. This utility - can be used to list and edit the set of partitions or BSD style - 'disk slices' that are defined on a hard drive. - -config FDISK_SUPPORT_LARGE_DISKS - bool "Support over 4GB disks" - default y - depends on FDISK - depends on !LFS # with LFS no special code is needed - help - Enable this option to support large disks > 4GB. - -config FEATURE_FDISK_WRITABLE - bool "Write support" - default y - depends on FDISK - help - Enabling this option allows you to create or change a partition table - and write those changes out to disk. If you leave this option - disabled, you will only be able to view the partition table. - -config FEATURE_AIX_LABEL - bool "Support AIX disklabels" - default n - depends on FDISK && FEATURE_FDISK_WRITABLE - help - Enabling this option allows you to create or change AIX disklabels. - Most people can safely leave this option disabled. - -config FEATURE_SGI_LABEL - bool "Support SGI disklabels" - default n - depends on FDISK && FEATURE_FDISK_WRITABLE - help - Enabling this option allows you to create or change SGI disklabels. - Most people can safely leave this option disabled. - -config FEATURE_SUN_LABEL - bool "Support SUN disklabels" - default n - depends on FDISK && FEATURE_FDISK_WRITABLE - help - Enabling this option allows you to create or change SUN disklabels. - Most people can safely leave this option disabled. - -config FEATURE_OSF_LABEL - bool "Support BSD disklabels" - default n - depends on FDISK && FEATURE_FDISK_WRITABLE - help - Enabling this option allows you to create or change BSD disklabels - and define and edit BSD disk slices. - -config FEATURE_GPT_LABEL - bool "Support GPT disklabels" - default n - depends on FDISK && FEATURE_FDISK_WRITABLE - help - Enabling this option allows you to view GUID Partition Table - disklabels. - -config FEATURE_FDISK_ADVANCED - bool "Support expert mode" - default y - depends on FDISK && FEATURE_FDISK_WRITABLE - help - Enabling this option allows you to do terribly unsafe things like - define arbitrary drive geometry, move the beginning of data in a - partition, and similarly evil things. Unless you have a very good - reason you would be wise to leave this disabled. - -config FINDFS - bool "findfs" - default y - select PLATFORM_LINUX - select VOLUMEID - help - Prints the name of a filesystem with given label or UUID. - WARNING: - With all submodules selected, it will add ~8k to busybox. - -config FLOCK - bool "flock" - default y - help - Manage locks from shell scripts - -config FREERAMDISK - bool "freeramdisk" - default y - select PLATFORM_LINUX - help - Linux allows you to create ramdisks. This utility allows you to - delete them and completely free all memory that was used for the - ramdisk. For example, if you boot Linux into a ramdisk and later - pivot_root, you may want to free the memory that is allocated to the - ramdisk. If you have no use for freeing memory from a ramdisk, leave - this disabled. - -config FSCK_MINIX - bool "fsck_minix" - default y - help - The minix filesystem is a nice, small, compact, read-write filesystem - with little overhead. It is not a journaling filesystem however and - can experience corruption if it is not properly unmounted or if the - power goes off in the middle of a write. This utility allows you to - check for and attempt to repair any corruption that occurs to a minix - filesystem. - -config MKFS_MINIX - bool "mkfs_minix" - default y - select PLATFORM_LINUX - help - The minix filesystem is a nice, small, compact, read-write filesystem - with little overhead. If you wish to be able to create minix - filesystems this utility will do the job for you. - -config FEATURE_MINIX2 - bool "Support Minix fs v2 (fsck_minix/mkfs_minix)" - default y - depends on FSCK_MINIX || MKFS_MINIX - help - If you wish to be able to create version 2 minix filesystems, enable - this. If you enabled 'mkfs_minix' then you almost certainly want to - be using the version 2 filesystem support. - -config MKFS_REISER - bool "mkfs_reiser" - default n - select PLATFORM_LINUX - help - Utility to create ReiserFS filesystems. - Note: this applet needs a lot of testing and polishing. - -config GETOPT - bool "getopt" - default y - help - The getopt utility is used to break up (parse) options in command - lines to make it easy to write complex shell scripts that also check - for legal (and illegal) options. If you want to write horribly - complex shell scripts, or use some horribly complex shell script - written by others, this utility may be for you. Most people will - wisely leave this disabled. - -config FEATURE_GETOPT_LONG - bool "Support option -l" - default y if LONG_OPTS - depends on GETOPT - help - Enable support for long options (option -l). - -config HEXDUMP - bool "hexdump" - default y - help - The hexdump utility is used to display binary data in a readable - way that is comparable to the output from most hex editors. - -config FEATURE_HEXDUMP_REVERSE - bool "Support -R, reverse of 'hexdump -Cv'" - default y - depends on HEXDUMP - help - The hexdump utility is used to display binary data in an ascii - readable way. This option creates binary data from an ascii input. - NB: this option is non-standard. It's unwise to use it in scripts - aimed to be portable. - -config HD - bool "hd" - default y - depends on HEXDUMP - help - hd is an alias to hexdump -C. - -config HWCLOCK - bool "hwclock" - default y - select PLATFORM_LINUX - help - The hwclock utility is used to read and set the hardware clock - on a system. This is primarily used to set the current time on - shutdown in the hardware clock, so the hardware will keep the - correct time when Linux is _not_ running. - -config FEATURE_HWCLOCK_LONG_OPTIONS - bool "Support long options (--hctosys,...)" - default y - depends on HWCLOCK && LONG_OPTS - help - By default, the hwclock utility only uses short options. If you - are overly fond of its long options, such as --hctosys, --utc, etc) - then enable this option. - -config FEATURE_HWCLOCK_ADJTIME_FHS - bool "Use FHS /var/lib/hwclock/adjtime" - default n # util-linux-ng in Fedora 13 still uses /etc/adjtime - depends on HWCLOCK - help - Starting with FHS 2.3, the adjtime state file is supposed to exist - at /var/lib/hwclock/adjtime instead of /etc/adjtime. If you wish - to use the FHS behavior, answer Y here, otherwise answer N for the - classic /etc/adjtime path. - - pathname.com/fhs/pub/fhs-2.3.html#VARLIBHWCLOCKSTATEDIRECTORYFORHWCLO - -config IPCRM - bool "ipcrm" - default y - help - The ipcrm utility allows the removal of System V interprocess - communication (IPC) objects and the associated data structures - from the system. - -config IPCS - bool "ipcs" - default y - select PLATFORM_LINUX - help - The ipcs utility is used to provide information on the currently - allocated System V interprocess (IPC) objects in the system. - -config LOSETUP - bool "losetup" - default y - select PLATFORM_LINUX - help - losetup is used to associate or detach a loop device with a regular - file or block device, and to query the status of a loop device. This - version does not currently support enabling data encryption. - -config LSPCI - bool "lspci" - default y - #select PLATFORM_LINUX - help - lspci is a utility for displaying information about PCI buses in the - system and devices connected to them. - - This version uses sysfs (/sys/bus/pci/devices) only. - -config LSUSB - bool "lsusb" - default y - #select PLATFORM_LINUX - help - lsusb is a utility for displaying information about USB buses in the - system and devices connected to them. - - This version uses sysfs (/sys/bus/usb/devices) only. - -config MKSWAP - bool "mkswap" - default y - help - The mkswap utility is used to configure a file or disk partition as - Linux swap space. This allows Linux to use the entire file or - partition as if it were additional RAM, which can greatly increase - the capability of low-memory machines. This additional memory is - much slower than real RAM, but can be very helpful at preventing your - applications being killed by the Linux out of memory (OOM) killer. - Once you have created swap space using 'mkswap' you need to enable - the swap space using the 'swapon' utility. - -config FEATURE_MKSWAP_UUID - bool "UUID support" - default y - depends on MKSWAP - help - Generate swap spaces with universally unique identifiers. - -config MORE - bool "more" - default y - help - more is a simple utility which allows you to read text one screen - sized page at a time. If you want to read text that is larger than - the screen, and you are using anything faster than a 300 baud modem, - you will probably find this utility very helpful. If you don't have - any need to reading text files, you can leave this disabled. - -config PIVOT_ROOT - bool "pivot_root" - default y - select PLATFORM_LINUX - help - The pivot_root utility swaps the mount points for the root filesystem - with some other mounted filesystem. This allows you to do all sorts - of wild and crazy things with your Linux system and is far more - powerful than 'chroot'. - - Note: This is for initrd in linux 2.4. Under initramfs (introduced - in linux 2.6) use switch_root instead. - -config RDATE - bool "rdate" - default y - help - The rdate utility allows you to synchronize the date and time of your - system clock with the date and time of a remote networked system using - the RFC868 protocol, which is built into the inetd daemon on most - systems. - -config RDEV - bool "rdev" - default y - help - Print the device node associated with the filesystem mounted at '/'. - -config READPROFILE - bool "readprofile" - default y - #select PLATFORM_LINUX - help - This allows you to parse /proc/profile for basic profiling. - -config RTCWAKE - bool "rtcwake" - default y - select PLATFORM_LINUX - help - Enter a system sleep state until specified wakeup time. - -config SCRIPT - bool "script" - default y - help - The script makes typescript of terminal session. - -config SCRIPTREPLAY - bool "scriptreplay" - default y - help - This program replays a typescript, using timing information - given by script -t. - -config SWITCH_ROOT - bool "switch_root" - default y - select PLATFORM_LINUX - help - The switch_root utility is used from initramfs to select a new - root device. Under initramfs, you have to use this instead of - pivot_root. (Stop reading here if you don't care why.) - - Booting with initramfs extracts a gzipped cpio archive into rootfs - (which is a variant of ramfs/tmpfs). Because rootfs can't be moved - or unmounted*, pivot_root will not work from initramfs. Instead, - switch_root deletes everything out of rootfs (including itself), - does a mount --move that overmounts rootfs with the new root, and - then execs the specified init program. - - * Because the Linux kernel uses rootfs internally as the starting - and ending point for searching through the kernel's doubly linked - list of active mount points. That's why. - -config UMOUNT - bool "umount" - default y - select PLATFORM_LINUX - help - When you want to remove a mounted filesystem from its current mount - point, for example when you are shutting down the system, the - 'umount' utility is the tool to use. If you enabled the 'mount' - utility, you almost certainly also want to enable 'umount'. - -config FEATURE_UMOUNT_ALL - bool "Support option -a" - default y - depends on UMOUNT - help - Support -a option to unmount all currently mounted filesystems. - comment "Common options for mount/umount" depends on MOUNT || UMOUNT diff --git a/util-linux/Kbuild.src b/util-linux/Kbuild.src index dfd50afa2..6b4fb7470 100644 --- a/util-linux/Kbuild.src +++ b/util-linux/Kbuild.src @@ -7,36 +7,3 @@ lib-y:= INSERT -lib-$(CONFIG_ACPID) += acpid.o -lib-$(CONFIG_BLKID) += blkid.o -lib-$(CONFIG_DMESG) += dmesg.o -lib-$(CONFIG_FBSET) += fbset.o -lib-$(CONFIG_FDFLUSH) += freeramdisk.o -lib-$(CONFIG_FDFORMAT) += fdformat.o -lib-$(CONFIG_FDISK) += fdisk.o -lib-$(CONFIG_FINDFS) += findfs.o -lib-$(CONFIG_FLOCK) += flock.o -lib-$(CONFIG_FREERAMDISK) += freeramdisk.o -lib-$(CONFIG_FSCK_MINIX) += fsck_minix.o -lib-$(CONFIG_GETOPT) += getopt.o -lib-$(CONFIG_HEXDUMP) += hexdump.o -lib-$(CONFIG_HWCLOCK) += hwclock.o -lib-$(CONFIG_IPCRM) += ipcrm.o -lib-$(CONFIG_IPCS) += ipcs.o -lib-$(CONFIG_LOSETUP) += losetup.o -lib-$(CONFIG_LSPCI) += lspci.o -lib-$(CONFIG_LSUSB) += lsusb.o -lib-$(CONFIG_MKFS_MINIX) += mkfs_minix.o -lib-$(CONFIG_MKFS_REISER) += mkfs_reiser.o -lib-$(CONFIG_MKSWAP) += mkswap.o -lib-$(CONFIG_MORE) += more.o -lib-$(CONFIG_MOUNT) += mount.o -lib-$(CONFIG_PIVOT_ROOT) += pivot_root.o -lib-$(CONFIG_RDATE) += rdate.o -lib-$(CONFIG_RDEV) += rdev.o -lib-$(CONFIG_READPROFILE) += readprofile.o -lib-$(CONFIG_RTCWAKE) += rtcwake.o -lib-$(CONFIG_SCRIPT) += script.o -lib-$(CONFIG_SCRIPTREPLAY) += scriptreplay.o -lib-$(CONFIG_SWITCH_ROOT) += switch_root.o -lib-$(CONFIG_UMOUNT) += umount.o diff --git a/util-linux/acpid.c b/util-linux/acpid.c index 0f2cb6bdc..3e68b61ab 100644 --- a/util-linux/acpid.c +++ b/util-linux/acpid.c @@ -6,6 +6,32 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config ACPID +//config: bool "acpid" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: acpid listens to ACPI events coming either in textual form from +//config: /proc/acpi/event (though it is marked deprecated it is still widely +//config: used and _is_ a standard) or in binary form from specified evdevs +//config: (just use /dev/input/event*). +//config: +//config: It parses the event to retrieve ACTION and a possible PARAMETER. +//config: It then spawns /etc/acpi/[/] either via run-parts +//config: (if the resulting path is a directory) or directly as an executable. +//config: +//config: N.B. acpid relies on run-parts so have the latter installed. +//config: +//config:config FEATURE_ACPID_COMPAT +//config: bool "Accept and ignore redundant options" +//config: default y +//config: depends on ACPID +//config: help +//config: Accept and ignore compatibility options -g -m -s -S -v. + +//applet:IF_ACPID(APPLET(acpid, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_ACPID) += acpid.o //usage:#define acpid_trivial_usage //usage: "[-df] [-c CONFDIR] [-l LOGFILE] [-a ACTIONFILE] [-M MAPFILE] [-e PROC_EVENT_FILE] [-p PIDFILE]" diff --git a/util-linux/blkdiscard.c b/util-linux/blkdiscard.c index ace88a1f0..af0bc946d 100644 --- a/util-linux/blkdiscard.c +++ b/util-linux/blkdiscard.c @@ -5,7 +5,6 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - //config:config BLKDISCARD //config: bool "blkdiscard" //config: default y diff --git a/util-linux/blkid.c b/util-linux/blkid.c index 1bbc80311..b6f33b513 100644 --- a/util-linux/blkid.c +++ b/util-linux/blkid.c @@ -6,6 +6,26 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config BLKID +//config: bool "blkid" +//config: default y +//config: select PLATFORM_LINUX +//config: select VOLUMEID +//config: help +//config: Lists labels and UUIDs of all filesystems. +//config: WARNING: +//config: With all submodules selected, it will add ~8k to busybox. +//config: +//config:config FEATURE_BLKID_TYPE +//config: bool "Print filesystem type" +//config: default n +//config: depends on BLKID +//config: help +//config: Show TYPE="filesystem type" + +//applet:IF_BLKID(APPLET(blkid, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_BLKID) += blkid.o //usage:#define blkid_trivial_usage //usage: "[BLOCKDEV]..." diff --git a/util-linux/blockdev.c b/util-linux/blockdev.c index e25e529db..bf4d49792 100644 --- a/util-linux/blockdev.c +++ b/util-linux/blockdev.c @@ -5,17 +5,16 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ - -//applet:IF_BLOCKDEV(APPLET(blockdev, BB_DIR_SBIN, BB_SUID_DROP)) - -//kbuild:lib-$(CONFIG_BLOCKDEV) += blockdev.o - //config:config BLOCKDEV //config: bool "blockdev" //config: default y //config: help //config: Performs some ioctls with block devices. +//applet:IF_BLOCKDEV(APPLET(blockdev, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_BLOCKDEV) += blockdev.o + //usage:#define blockdev_trivial_usage //usage: "OPTION BLOCKDEV" //usage:#define blockdev_full_usage "\n\n" diff --git a/util-linux/dmesg.c b/util-linux/dmesg.c index 50e8a0fce..b7b2c6924 100644 --- a/util-linux/dmesg.c +++ b/util-linux/dmesg.c @@ -8,6 +8,43 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config DMESG +//config: bool "dmesg" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: dmesg is used to examine or control the kernel ring buffer. When the +//config: Linux kernel prints messages to the system log, they are stored in +//config: the kernel ring buffer. You can use dmesg to print the kernel's ring +//config: buffer, clear the kernel ring buffer, change the size of the kernel +//config: ring buffer, and change the priority level at which kernel messages +//config: are also logged to the system console. Enable this option if you +//config: wish to enable the 'dmesg' utility. +//config: +//config:config FEATURE_DMESG_PRETTY +//config: bool "Pretty dmesg output" +//config: default y +//config: depends on DMESG +//config: help +//config: If you wish to scrub the syslog level from the output, say 'Y' here. +//config: The syslog level is a string prefixed to every line with the form +//config: "<#>". +//config: +//config: With this option you will see: +//config: # dmesg +//config: Linux version 2.6.17.4 ..... +//config: BIOS-provided physical RAM map: +//config: BIOS-e820: 0000000000000000 - 000000000009f000 (usable) +//config: +//config: Without this option you will see: +//config: # dmesg +//config: <5>Linux version 2.6.17.4 ..... +//config: <6>BIOS-provided physical RAM map: +//config: <6> BIOS-e820: 0000000000000000 - 000000000009f000 (usable) + +//applet:IF_DMESG(APPLET(dmesg, BB_DIR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_DMESG) += dmesg.o //usage:#define dmesg_trivial_usage //usage: "[-c] [-n LEVEL] [-s SIZE]" diff --git a/util-linux/fatattr.c b/util-linux/fatattr.c index 6dca24a73..030978f64 100644 --- a/util-linux/fatattr.c +++ b/util-linux/fatattr.c @@ -16,6 +16,7 @@ //config: fatattr lists or changes the file attributes on a fat file system. //applet:IF_FATATTR(APPLET(fatattr, BB_DIR_BIN, BB_SUID_DROP)) + //kbuild:lib-$(CONFIG_FATATTR) += fatattr.o //usage:#define fatattr_trivial_usage diff --git a/util-linux/fbset.c b/util-linux/fbset.c index b75ec1921..8a78c1ef9 100644 --- a/util-linux/fbset.c +++ b/util-linux/fbset.c @@ -11,6 +11,38 @@ * the GPL, and is (c) 1995-1999 by: * Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be) */ +//config:config FBSET +//config: bool "fbset" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: fbset is used to show or change the settings of a Linux frame buffer +//config: device. The frame buffer device provides a simple and unique +//config: interface to access a graphics display. Enable this option +//config: if you wish to enable the 'fbset' utility. +//config: +//config:config FEATURE_FBSET_FANCY +//config: bool "Turn on extra fbset options" +//config: default y +//config: depends on FBSET +//config: help +//config: This option enables extended fbset options, allowing one to set the +//config: framebuffer size, color depth, etc. interface to access a graphics +//config: display. Enable this option if you wish to enable extended fbset +//config: options. +//config: +//config:config FEATURE_FBSET_READMODE +//config: bool "Turn on fbset readmode support" +//config: default y +//config: depends on FBSET +//config: help +//config: This option allows fbset to read the video mode database stored by +//config: default as /etc/fb.modes, which can be used to set frame buffer +//config: device to pre-defined video modes. + +//applet:IF_FBSET(APPLET(fbset, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_FBSET) += fbset.o //usage:#define fbset_trivial_usage //usage: "[OPTIONS] [MODE]" diff --git a/util-linux/fdformat.c b/util-linux/fdformat.c index 6ef6445e6..67c6e1504 100644 --- a/util-linux/fdformat.c +++ b/util-linux/fdformat.c @@ -4,6 +4,16 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config FDFORMAT +//config: bool "fdformat" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: fdformat is used to low-level format a floppy disk. + +//applet:IF_FDFORMAT(APPLET(fdformat, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_FDFORMAT) += fdformat.o //usage:#define fdformat_trivial_usage //usage: "[-n] DEVICE" diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c index 32a66d03d..af8073532 100644 --- a/util-linux/fdisk.c +++ b/util-linux/fdisk.c @@ -6,6 +6,86 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config FDISK +//config: bool "fdisk" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: The fdisk utility is used to divide hard disks into one or more +//config: logical disks, which are generally called partitions. This utility +//config: can be used to list and edit the set of partitions or BSD style +//config: 'disk slices' that are defined on a hard drive. +//config: +//config:config FDISK_SUPPORT_LARGE_DISKS +//config: bool "Support over 4GB disks" +//config: default y +//config: depends on FDISK +//config: depends on !LFS # with LFS no special code is needed +//config: help +//config: Enable this option to support large disks > 4GB. +//config: +//config:config FEATURE_FDISK_WRITABLE +//config: bool "Write support" +//config: default y +//config: depends on FDISK +//config: help +//config: Enabling this option allows you to create or change a partition table +//config: and write those changes out to disk. If you leave this option +//config: disabled, you will only be able to view the partition table. +//config: +//config:config FEATURE_AIX_LABEL +//config: bool "Support AIX disklabels" +//config: default n +//config: depends on FDISK && FEATURE_FDISK_WRITABLE +//config: help +//config: Enabling this option allows you to create or change AIX disklabels. +//config: Most people can safely leave this option disabled. +//config: +//config:config FEATURE_SGI_LABEL +//config: bool "Support SGI disklabels" +//config: default n +//config: depends on FDISK && FEATURE_FDISK_WRITABLE +//config: help +//config: Enabling this option allows you to create or change SGI disklabels. +//config: Most people can safely leave this option disabled. +//config: +//config:config FEATURE_SUN_LABEL +//config: bool "Support SUN disklabels" +//config: default n +//config: depends on FDISK && FEATURE_FDISK_WRITABLE +//config: help +//config: Enabling this option allows you to create or change SUN disklabels. +//config: Most people can safely leave this option disabled. +//config: +//config:config FEATURE_OSF_LABEL +//config: bool "Support BSD disklabels" +//config: default n +//config: depends on FDISK && FEATURE_FDISK_WRITABLE +//config: help +//config: Enabling this option allows you to create or change BSD disklabels +//config: and define and edit BSD disk slices. +//config: +//config:config FEATURE_GPT_LABEL +//config: bool "Support GPT disklabels" +//config: default n +//config: depends on FDISK && FEATURE_FDISK_WRITABLE +//config: help +//config: Enabling this option allows you to view GUID Partition Table +//config: disklabels. +//config: +//config:config FEATURE_FDISK_ADVANCED +//config: bool "Support expert mode" +//config: default y +//config: depends on FDISK && FEATURE_FDISK_WRITABLE +//config: help +//config: Enabling this option allows you to do terribly unsafe things like +//config: define arbitrary drive geometry, move the beginning of data in a +//config: partition, and similarly evil things. Unless you have a very good +//config: reason you would be wise to leave this disabled. + +//applet:IF_FDISK(APPLET(fdisk, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_FDISK) += fdisk.o /* Looks like someone forgot to add this to config system */ //usage:#ifndef ENABLE_FEATURE_FDISK_BLKSIZE diff --git a/util-linux/findfs.c b/util-linux/findfs.c index 07734f359..daa46b039 100644 --- a/util-linux/findfs.c +++ b/util-linux/findfs.c @@ -7,6 +7,20 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config FINDFS +//config: bool "findfs" +//config: default y +//config: select PLATFORM_LINUX +//config: select VOLUMEID +//config: help +//config: Prints the name of a filesystem with given label or UUID. +//config: WARNING: +//config: With all submodules selected, it will add ~8k to busybox. + +/* Benefits from suid root: better access to /dev/BLOCKDEVs: */ +//applet:IF_FINDFS(APPLET(findfs, BB_DIR_SBIN, BB_SUID_MAYBE)) + +//kbuild:lib-$(CONFIG_FINDFS) += findfs.o //usage:#define findfs_trivial_usage //usage: "LABEL=label or UUID=uuid" diff --git a/util-linux/flock.c b/util-linux/flock.c index 1f7ade7c4..f34c0ad8f 100644 --- a/util-linux/flock.c +++ b/util-linux/flock.c @@ -3,6 +3,15 @@ * * This is free software, licensed under the GNU General Public License v2. */ +//config:config FLOCK +//config: bool "flock" +//config: default y +//config: help +//config: Manage locks from shell scripts + +//applet:IF_FLOCK(APPLET(flock, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_FLOCK) += flock.o //usage:#define flock_trivial_usage //usage: "[-sxun] FD|{FILE [-c] PROG ARGS}" diff --git a/util-linux/freeramdisk.c b/util-linux/freeramdisk.c index a89ae1a39..8bc2c443b 100644 --- a/util-linux/freeramdisk.c +++ b/util-linux/freeramdisk.c @@ -8,6 +8,36 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config FDFLUSH +//config: bool "fdflush" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: fdflush is only needed when changing media on slightly-broken +//config: removable media drives. It is used to make Linux believe that a +//config: hardware disk-change switch has been actuated, which causes Linux to +//config: forget anything it has cached from the previous media. If you have +//config: such a slightly-broken drive, you will need to run fdflush every time +//config: you change a disk. Most people have working hardware and can safely +//config: leave this disabled. +//config: +//config:config FREERAMDISK +//config: bool "freeramdisk" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: Linux allows you to create ramdisks. This utility allows you to +//config: delete them and completely free all memory that was used for the +//config: ramdisk. For example, if you boot Linux into a ramdisk and later +//config: pivot_root, you may want to free the memory that is allocated to the +//config: ramdisk. If you have no use for freeing memory from a ramdisk, leave +//config: this disabled. + +//applet:IF_FDFLUSH(APPLET_ODDNAME(fdflush, freeramdisk, BB_DIR_BIN, BB_SUID_DROP, fdflush)) +//applet:IF_FREERAMDISK(APPLET(freeramdisk, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_FDFLUSH) += freeramdisk.o +//kbuild:lib-$(CONFIG_FREERAMDISK) += freeramdisk.o //usage:#define freeramdisk_trivial_usage //usage: "DEVICE" diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c index d2f3524b4..0eaac17c0 100644 --- a/util-linux/fsck_minix.c +++ b/util-linux/fsck_minix.c @@ -85,6 +85,20 @@ * The device may be a block device or a image of one, but this isn't * enforced (but it's not much fun on a character device :-). */ +//config:config FSCK_MINIX +//config: bool "fsck_minix" +//config: default y +//config: help +//config: The minix filesystem is a nice, small, compact, read-write filesystem +//config: with little overhead. It is not a journaling filesystem however and +//config: can experience corruption if it is not properly unmounted or if the +//config: power goes off in the middle of a write. This utility allows you to +//config: check for and attempt to repair any corruption that occurs to a minix +//config: filesystem. + +//applet:IF_FSCK_MINIX(APPLET_ODDNAME(fsck.minix, fsck_minix, BB_DIR_SBIN, BB_SUID_DROP, fsck_minix)) + +//kbuild:lib-$(CONFIG_FSCK_MINIX) += fsck_minix.o //usage:#define fsck_minix_trivial_usage //usage: "[-larvsmf] BLOCKDEV" diff --git a/util-linux/getopt.c b/util-linux/getopt.c index 18d490987..83cc1efea 100644 --- a/util-linux/getopt.c +++ b/util-linux/getopt.c @@ -28,8 +28,28 @@ * Removed --version/-V and --help/-h * Removed parse_error(), using bb_error_msg() from Busybox instead * Replaced our_malloc with xmalloc and our_realloc with xrealloc - * */ +//config:config GETOPT +//config: bool "getopt" +//config: default y +//config: help +//config: The getopt utility is used to break up (parse) options in command +//config: lines to make it easy to write complex shell scripts that also check +//config: for legal (and illegal) options. If you want to write horribly +//config: complex shell scripts, or use some horribly complex shell script +//config: written by others, this utility may be for you. Most people will +//config: wisely leave this disabled. +//config: +//config:config FEATURE_GETOPT_LONG +//config: bool "Support option -l" +//config: default y if LONG_OPTS +//config: depends on GETOPT +//config: help +//config: Enable support for long options (option -l). + +//applet:IF_GETOPT(APPLET(getopt, BB_DIR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_GETOPT) += getopt.o //usage:#define getopt_trivial_usage //usage: "[OPTIONS] [--] OPTSTRING PARAMS" diff --git a/util-linux/hexdump.c b/util-linux/hexdump.c index ac7e24ff8..5e1ef6938 100644 --- a/util-linux/hexdump.c +++ b/util-linux/hexdump.c @@ -8,6 +8,35 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config HEXDUMP +//config: bool "hexdump" +//config: default y +//config: help +//config: The hexdump utility is used to display binary data in a readable +//config: way that is comparable to the output from most hex editors. +//config: +//config:config FEATURE_HEXDUMP_REVERSE +//config: bool "Support -R, reverse of 'hexdump -Cv'" +//config: default y +//config: depends on HEXDUMP +//config: help +//config: The hexdump utility is used to display binary data in an ascii +//config: readable way. This option creates binary data from an ascii input. +//config: NB: this option is non-standard. It's unwise to use it in scripts +//config: aimed to be portable. +//config: +//config:config HD +//config: bool "hd" +//config: default y +//config: depends on HEXDUMP +//config: help +//config: hd is an alias to hexdump -C. + +//applet:IF_HEXDUMP(APPLET_NOEXEC(hexdump, hexdump, BB_DIR_USR_BIN, BB_SUID_DROP, hexdump)) +//applet:IF_HD(APPLET_NOEXEC(hd, hexdump, BB_DIR_USR_BIN, BB_SUID_DROP, hd)) + +//kbuild:lib-$(CONFIG_HEXDUMP) += hexdump.o +//kbuild:lib-$(CONFIG_HD) += hexdump.o //usage:#define hexdump_trivial_usage //usage: "[-bcCdefnosvx" IF_FEATURE_HEXDUMP_REVERSE("R") "] [FILE]..." diff --git a/util-linux/hwclock.c b/util-linux/hwclock.c index 6c99977cf..084a7f1e9 100644 --- a/util-linux/hwclock.c +++ b/util-linux/hwclock.c @@ -5,7 +5,41 @@ * Copyright (C) 2002 Robert Griebl * * Licensed under GPLv2 or later, see file LICENSE in this source tree. -*/ + */ +//config:config HWCLOCK +//config: bool "hwclock" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: The hwclock utility is used to read and set the hardware clock +//config: on a system. This is primarily used to set the current time on +//config: shutdown in the hardware clock, so the hardware will keep the +//config: correct time when Linux is _not_ running. +//config: +//config:config FEATURE_HWCLOCK_LONG_OPTIONS +//config: bool "Support long options (--hctosys,...)" +//config: default y +//config: depends on HWCLOCK && LONG_OPTS +//config: help +//config: By default, the hwclock utility only uses short options. If you +//config: are overly fond of its long options, such as --hctosys, --utc, etc) +//config: then enable this option. +//config: +//config:config FEATURE_HWCLOCK_ADJTIME_FHS +//config: bool "Use FHS /var/lib/hwclock/adjtime" +//config: default n # util-linux-ng in Fedora 13 still uses /etc/adjtime +//config: depends on HWCLOCK +//config: help +//config: Starting with FHS 2.3, the adjtime state file is supposed to exist +//config: at /var/lib/hwclock/adjtime instead of /etc/adjtime. If you wish +//config: to use the FHS behavior, answer Y here, otherwise answer N for the +//config: classic /etc/adjtime path. +//config: +//config: pathname.com/fhs/pub/fhs-2.3.html#VARLIBHWCLOCKSTATEDIRECTORYFORHWCLO + +//applet:IF_HWCLOCK(APPLET(hwclock, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_HWCLOCK) += hwclock.o #include "libbb.h" /* After libbb.h, since it needs sys/types.h on some systems */ diff --git a/util-linux/ipcrm.c b/util-linux/ipcrm.c index 38d81af50..76ea3ca4f 100644 --- a/util-linux/ipcrm.c +++ b/util-linux/ipcrm.c @@ -7,6 +7,17 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config IPCRM +//config: bool "ipcrm" +//config: default y +//config: help +//config: The ipcrm utility allows the removal of System V interprocess +//config: communication (IPC) objects and the associated data structures +//config: from the system. + +//applet:IF_IPCRM(APPLET(ipcrm, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_IPCRM) += ipcrm.o //usage:#define ipcrm_trivial_usage //usage: "[-MQS key] [-mqs id]" diff --git a/util-linux/ipcs.c b/util-linux/ipcs.c index 67a25a8ef..88ae9225d 100644 --- a/util-linux/ipcs.c +++ b/util-linux/ipcs.c @@ -7,6 +7,17 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config IPCS +//config: bool "ipcs" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: The ipcs utility is used to provide information on the currently +//config: allocated System V interprocess (IPC) objects in the system. + +//applet:IF_IPCS(APPLET(ipcs, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_IPCS) += ipcs.o //usage:#define ipcs_trivial_usage //usage: "[[-smq] -i shmid] | [[-asmq] [-tcplu]]" diff --git a/util-linux/losetup.c b/util-linux/losetup.c index d450b5a78..4424d9cbb 100644 --- a/util-linux/losetup.c +++ b/util-linux/losetup.c @@ -6,6 +6,18 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config LOSETUP +//config: bool "losetup" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: losetup is used to associate or detach a loop device with a regular +//config: file or block device, and to query the status of a loop device. This +//config: version does not currently support enabling data encryption. + +//kbuild:lib-$(CONFIG_LOSETUP) += losetup.o + +//applet:IF_LOSETUP(APPLET(losetup, BB_DIR_SBIN, BB_SUID_DROP)) //usage:#define losetup_trivial_usage //usage: "[-r] [-o OFS] {-f|LOOPDEV} FILE - associate loop devices\n" diff --git a/util-linux/lspci.c b/util-linux/lspci.c index 514678afd..8b38a2366 100644 --- a/util-linux/lspci.c +++ b/util-linux/lspci.c @@ -6,6 +6,19 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config LSPCI +//config: bool "lspci" +//config: default y +//config: #select PLATFORM_LINUX +//config: help +//config: lspci is a utility for displaying information about PCI buses in the +//config: system and devices connected to them. +//config: +//config: This version uses sysfs (/sys/bus/pci/devices) only. + +//applet:IF_LSPCI(APPLET(lspci, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_LSPCI) += lspci.o //usage:#define lspci_trivial_usage //usage: "[-mk]" diff --git a/util-linux/lsusb.c b/util-linux/lsusb.c index 540f21ec6..7d36d6f5a 100644 --- a/util-linux/lsusb.c +++ b/util-linux/lsusb.c @@ -6,6 +6,19 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config LSUSB +//config: bool "lsusb" +//config: default y +//config: #select PLATFORM_LINUX +//config: help +//config: lsusb is a utility for displaying information about USB buses in the +//config: system and devices connected to them. +//config: +//config: This version uses sysfs (/sys/bus/usb/devices) only. + +//applet:IF_LSUSB(APPLET(lsusb, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_LSUSB) += lsusb.o //usage:#define lsusb_trivial_usage NOUSAGE_STR //usage:#define lsusb_full_usage "" diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c index aaabf8453..912246b93 100644 --- a/util-linux/mkfs_minix.c +++ b/util-linux/mkfs_minix.c @@ -62,6 +62,27 @@ * Modified for BusyBox by Erik Andersen -- * removed getopt based parser and added a hand rolled one. */ +//config:config MKFS_MINIX +//config: bool "mkfs_minix" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: The minix filesystem is a nice, small, compact, read-write filesystem +//config: with little overhead. If you wish to be able to create minix +//config: filesystems this utility will do the job for you. +//config: +//config:config FEATURE_MINIX2 +//config: bool "Support Minix fs v2 (fsck_minix/mkfs_minix)" +//config: default y +//config: depends on FSCK_MINIX || MKFS_MINIX +//config: help +//config: If you wish to be able to create version 2 minix filesystems, enable +//config: this. If you enabled 'mkfs_minix' then you almost certainly want to +//config: be using the version 2 filesystem support. + +//applet:IF_MKFS_MINIX(APPLET_ODDNAME(mkfs.minix, mkfs_minix, BB_DIR_SBIN, BB_SUID_DROP, mkfs_minix)) + +//kbuild:lib-$(CONFIG_MKFS_MINIX) += mkfs_minix.o //usage:#define mkfs_minix_trivial_usage //usage: "[-c | -l FILE] [-nXX] [-iXX] BLOCKDEV [KBYTES]" diff --git a/util-linux/mkfs_reiser.c b/util-linux/mkfs_reiser.c index 0a31ee44f..d01119f7f 100644 --- a/util-linux/mkfs_reiser.c +++ b/util-linux/mkfs_reiser.c @@ -6,6 +6,17 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config MKFS_REISER +//config: bool "mkfs_reiser" +//config: default n +//config: select PLATFORM_LINUX +//config: help +//config: Utility to create ReiserFS filesystems. +//config: Note: this applet needs a lot of testing and polishing. + +//applet:IF_MKFS_REISER(APPLET_ODDNAME(mkfs.reiser, mkfs_reiser, BB_DIR_SBIN, BB_SUID_DROP, mkfs_reiser)) + +//kbuild:lib-$(CONFIG_MKFS_REISER) += mkfs_reiser.o //usage:#define mkfs_reiser_trivial_usage //usage: "[-f] [-l LABEL] BLOCKDEV [4K-BLOCKS]" diff --git a/util-linux/mkswap.c b/util-linux/mkswap.c index dcb53f008..954a1948d 100644 --- a/util-linux/mkswap.c +++ b/util-linux/mkswap.c @@ -5,6 +5,29 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config MKSWAP +//config: bool "mkswap" +//config: default y +//config: help +//config: The mkswap utility is used to configure a file or disk partition as +//config: Linux swap space. This allows Linux to use the entire file or +//config: partition as if it were additional RAM, which can greatly increase +//config: the capability of low-memory machines. This additional memory is +//config: much slower than real RAM, but can be very helpful at preventing your +//config: applications being killed by the Linux out of memory (OOM) killer. +//config: Once you have created swap space using 'mkswap' you need to enable +//config: the swap space using the 'swapon' utility. +//config: +//config:config FEATURE_MKSWAP_UUID +//config: bool "UUID support" +//config: default y +//config: depends on MKSWAP +//config: help +//config: Generate swap spaces with universally unique identifiers. + +//applet:IF_MKSWAP(APPLET(mkswap, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_MKSWAP) += mkswap.o //usage:#define mkswap_trivial_usage //usage: "[-L LBL] BLOCKDEV [KBYTES]" diff --git a/util-linux/more.c b/util-linux/more.c index 07836e29d..934b30f8a 100644 --- a/util-linux/more.c +++ b/util-linux/more.c @@ -13,6 +13,19 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config MORE +//config: bool "more" +//config: default y +//config: help +//config: more is a simple utility which allows you to read text one screen +//config: sized page at a time. If you want to read text that is larger than +//config: the screen, and you are using anything faster than a 300 baud modem, +//config: you will probably find this utility very helpful. If you don't have +//config: any need to reading text files, you can leave this disabled. + +//applet:IF_MORE(APPLET(more, BB_DIR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_MORE) += more.o //usage:#define more_trivial_usage //usage: "[FILE]..." diff --git a/util-linux/mount.c b/util-linux/mount.c index eb8b7ba7b..42962b859 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c @@ -112,6 +112,14 @@ //config: help //config: Support mount -T (specifying an alternate fstab) +/* On full-blown systems, requires suid for user mounts. + * But it's not unthinkable to have it available in non-suid flavor on some systems, + * for viewing mount table. + * Therefore we use BB_SUID_MAYBE instead of BB_SUID_REQUIRE: */ +//applet:IF_MOUNT(APPLET(mount, BB_DIR_BIN, IF_DESKTOP(BB_SUID_MAYBE) IF_NOT_DESKTOP(BB_SUID_DROP))) + +//kbuild:lib-$(CONFIG_MOUNT) += mount.o + //usage:#define mount_trivial_usage //usage: "[OPTIONS] [-o OPT] DEVICE NODE" //usage:#define mount_full_usage "\n\n" diff --git a/util-linux/pivot_root.c b/util-linux/pivot_root.c index 83f01fabd..9bdae506c 100644 --- a/util-linux/pivot_root.c +++ b/util-linux/pivot_root.c @@ -8,6 +8,22 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config PIVOT_ROOT +//config: bool "pivot_root" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: The pivot_root utility swaps the mount points for the root filesystem +//config: with some other mounted filesystem. This allows you to do all sorts +//config: of wild and crazy things with your Linux system and is far more +//config: powerful than 'chroot'. +//config: +//config: Note: This is for initrd in linux 2.4. Under initramfs (introduced +//config: in linux 2.6) use switch_root instead. + +//applet:IF_PIVOT_ROOT(APPLET(pivot_root, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_PIVOT_ROOT) += pivot_root.o //usage:#define pivot_root_trivial_usage //usage: "NEW_ROOT PUT_OLD" diff --git a/util-linux/rdate.c b/util-linux/rdate.c index 8075ef6af..8dd784d3d 100644 --- a/util-linux/rdate.c +++ b/util-linux/rdate.c @@ -6,7 +6,19 @@ * by Sterling Huxley * * Licensed under GPLv2 or later, see file LICENSE in this source tree. -*/ + */ +//config:config RDATE +//config: bool "rdate" +//config: default y +//config: help +//config: The rdate utility allows you to synchronize the date and time of your +//config: system clock with the date and time of a remote networked system using +//config: the RFC868 protocol, which is built into the inetd daemon on most +//config: systems. + +//applet:IF_RDATE(APPLET(rdate, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_RDATE) += rdate.o //usage:#define rdate_trivial_usage //usage: "[-sp] HOST" diff --git a/util-linux/rdev.c b/util-linux/rdev.c index 465281756..0e1578e33 100644 --- a/util-linux/rdev.c +++ b/util-linux/rdev.c @@ -8,6 +8,15 @@ * Licensed under GPLv2, see file LICENSE in this source tree. * */ +//config:config RDEV +//config: bool "rdev" +//config: default y +//config: help +//config: Print the device node associated with the filesystem mounted at '/'. + +//applet:IF_RDEV(APPLET(rdev, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_RDEV) += rdev.o //usage:#define rdev_trivial_usage //usage: "" diff --git a/util-linux/readprofile.c b/util-linux/readprofile.c index 345b676ba..d5230387c 100644 --- a/util-linux/readprofile.c +++ b/util-linux/readprofile.c @@ -31,6 +31,16 @@ * Taken from util-linux and adapted for busybox by * Paul Mundt . */ +//config:config READPROFILE +//config: bool "readprofile" +//config: default y +//config: #select PLATFORM_LINUX +//config: help +//config: This allows you to parse /proc/profile for basic profiling. + +//applet:IF_READPROFILE(APPLET(readprofile, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_READPROFILE) += readprofile.o //usage:#define readprofile_trivial_usage //usage: "[OPTIONS]" diff --git a/util-linux/rev.c b/util-linux/rev.c index 3c1b22f09..c22505314 100644 --- a/util-linux/rev.c +++ b/util-linux/rev.c @@ -5,17 +5,16 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ - -//applet:IF_REV(APPLET(rev, BB_DIR_BIN, BB_SUID_DROP)) - -//kbuild:lib-$(CONFIG_REV) += rev.o - //config:config REV //config: bool "rev" //config: default y //config: help //config: Reverse lines of a file or files. +//applet:IF_REV(APPLET(rev, BB_DIR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_REV) += rev.o + //usage:#define rev_trivial_usage //usage: "[FILE]..." //usage:#define rev_full_usage "\n\n" diff --git a/util-linux/rtcwake.c b/util-linux/rtcwake.c index 8aee0cfcb..54fc70583 100644 --- a/util-linux/rtcwake.c +++ b/util-linux/rtcwake.c @@ -22,6 +22,16 @@ * RTC uses a local timezone instead (maybe you dual-boot MS-Windows). * That flag should not be needed on systems with adjtime support. */ +//config:config RTCWAKE +//config: bool "rtcwake" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: Enter a system sleep state until specified wakeup time. + +//applet:IF_RTCWAKE(APPLET(rtcwake, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_RTCWAKE) += rtcwake.o //usage:#define rtcwake_trivial_usage //usage: "[-a | -l | -u] [-d DEV] [-m MODE] [-s SEC | -t TIME]" diff --git a/util-linux/script.c b/util-linux/script.c index 86475c1f1..c5063e8a1 100644 --- a/util-linux/script.c +++ b/util-linux/script.c @@ -10,6 +10,15 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config SCRIPT +//config: bool "script" +//config: default y +//config: help +//config: The script makes typescript of terminal session. + +//applet:IF_SCRIPT(APPLET(script, BB_DIR_USR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_SCRIPT) += script.o //usage:#define script_trivial_usage //usage: "[-afq" IF_SCRIPTREPLAY("t") "] [-c PROG] [OUTFILE]" diff --git a/util-linux/scriptreplay.c b/util-linux/scriptreplay.c index 382f56d9a..8a0c7489d 100644 --- a/util-linux/scriptreplay.c +++ b/util-linux/scriptreplay.c @@ -7,6 +7,16 @@ * Licensed under GPLv2 or later, see file LICENSE in this source tree. * */ +//config:config SCRIPTREPLAY +//config: bool "scriptreplay" +//config: default y +//config: help +//config: This program replays a typescript, using timing information +//config: given by script -t. + +//applet:IF_SCRIPTREPLAY(APPLET(scriptreplay, BB_DIR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_SCRIPTREPLAY) += scriptreplay.o //usage:#define scriptreplay_trivial_usage //usage: "timingfile [typescript [divisor]]" diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c index 0a2d23f50..b8f4e9447 100644 --- a/util-linux/swaponoff.c +++ b/util-linux/swaponoff.c @@ -6,7 +6,6 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ - //config:config SWAPON //config: bool "swapon" //config: default y diff --git a/util-linux/switch_root.c b/util-linux/switch_root.c index 7960b672c..6034485d7 100644 --- a/util-linux/switch_root.c +++ b/util-linux/switch_root.c @@ -5,6 +5,29 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config SWITCH_ROOT +//config: bool "switch_root" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: The switch_root utility is used from initramfs to select a new +//config: root device. Under initramfs, you have to use this instead of +//config: pivot_root. (Stop reading here if you don't care why.) +//config: +//config: Booting with initramfs extracts a gzipped cpio archive into rootfs +//config: (which is a variant of ramfs/tmpfs). Because rootfs can't be moved +//config: or unmounted*, pivot_root will not work from initramfs. Instead, +//config: switch_root deletes everything out of rootfs (including itself), +//config: does a mount --move that overmounts rootfs with the new root, and +//config: then execs the specified init program. +//config: +//config: * Because the Linux kernel uses rootfs internally as the starting +//config: and ending point for searching through the kernel's doubly linked +//config: list of active mount points. That's why. + +//applet:IF_SWITCH_ROOT(APPLET(switch_root, BB_DIR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_SWITCH_ROOT) += switch_root.o //usage:#define switch_root_trivial_usage //usage: "[-c /dev/console] NEW_ROOT NEW_INIT [ARGS]" diff --git a/util-linux/uevent.c b/util-linux/uevent.c index b98fe6160..c22216a8a 100644 --- a/util-linux/uevent.c +++ b/util-linux/uevent.c @@ -3,7 +3,6 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ - //config:config UEVENT //config: bool "uevent" //config: default y diff --git a/util-linux/umount.c b/util-linux/umount.c index 91da69674..78eef57a5 100644 --- a/util-linux/umount.c +++ b/util-linux/umount.c @@ -7,6 +7,26 @@ * * Licensed under GPLv2, see file LICENSE in this source tree. */ +//config:config UMOUNT +//config: bool "umount" +//config: default y +//config: select PLATFORM_LINUX +//config: help +//config: When you want to remove a mounted filesystem from its current mount +//config: point, for example when you are shutting down the system, the +//config: 'umount' utility is the tool to use. If you enabled the 'mount' +//config: utility, you almost certainly also want to enable 'umount'. +//config: +//config:config FEATURE_UMOUNT_ALL +//config: bool "Support option -a" +//config: default y +//config: depends on UMOUNT +//config: help +//config: Support -a option to unmount all currently mounted filesystems. + +//applet:IF_UMOUNT(APPLET(umount, BB_DIR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_UMOUNT) += umount.o //usage:#define umount_trivial_usage //usage: "[OPTIONS] FILESYSTEM|DIRECTORY" diff --git a/util-linux/unshare.c b/util-linux/unshare.c index dcc59559a..bbabeef55 100644 --- a/util-linux/unshare.c +++ b/util-linux/unshare.c @@ -6,7 +6,6 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ - //config:config UNSHARE //config: bool "unshare" //config: default y -- cgit v1.2.3-55-g6feb From 5b966c6180c139fba6846d632fd9bc0c34a8e1bc Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 23 Nov 2016 11:53:12 +0100 Subject: Make "hd" independently selectable Signed-off-by: Denys Vlasenko --- util-linux/hexdump.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'util-linux') diff --git a/util-linux/hexdump.c b/util-linux/hexdump.c index 5e1ef6938..4a7f641db 100644 --- a/util-linux/hexdump.c +++ b/util-linux/hexdump.c @@ -28,7 +28,6 @@ //config:config HD //config: bool "hd" //config: default y -//config: depends on HEXDUMP //config: help //config: hd is an alias to hexdump -C. @@ -106,7 +105,9 @@ int hexdump_main(int argc, char **argv) smallint rdump = 0; #endif - if (ENABLE_HD && !applet_name[2]) { /* we are "hd" */ + if (ENABLE_HD + && (!ENABLE_HEXDUMP || !applet_name[2]) + ) { /* we are "hd" */ ch = 'C'; goto hd_applet; } -- cgit v1.2.3-55-g6feb From 29516ac0e41fc41dd15b7d0c67bd160f03d21bbb Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 27 Nov 2016 06:13:43 +0100 Subject: fdisk: sanitize partition name printing; drop "Code" column; get rid of one static var function old new delta list_table 2335 2373 +38 fill_bounds 131 128 -3 part_array_len 4 - -4 get_boot 1584 1574 -10 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 1/2 up/down: 38/-17) Total: 21 bytes Signed-off-by: Denys Vlasenko --- util-linux/fdisk.c | 1 + util-linux/fdisk_gpt.c | 56 ++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 42 insertions(+), 15 deletions(-) (limited to 'util-linux') diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c index af8073532..b988e65a9 100644 --- a/util-linux/fdisk.c +++ b/util-linux/fdisk.c @@ -121,6 +121,7 @@ # define BLKGETSIZE64 _IOR(0x12,114,size_t) #endif #include "libbb.h" +#include "unicode.h" #if BB_LITTLE_ENDIAN # define inline_if_little_endian ALWAYS_INLINE diff --git a/util-linux/fdisk_gpt.c b/util-linux/fdisk_gpt.c index 715e227ca..9b17b4a57 100644 --- a/util-linux/fdisk_gpt.c +++ b/util-linux/fdisk_gpt.c @@ -36,14 +36,13 @@ typedef struct { uint64_t lba_start; uint64_t lba_end; uint64_t flags; - uint16_t name[36]; + uint16_t name36[36]; } gpt_partition; static gpt_header *gpt_hdr; static char *part_array; static unsigned int n_parts; -static unsigned int part_array_len; static unsigned int part_entry_len; static inline gpt_partition * @@ -73,18 +72,34 @@ gpt_print_guid(uint8_t *buf) buf[10], buf[11], buf[12], buf[13], buf[14], buf[15]); } -/* TODO: real unicode support */ static void -gpt_print_wide(uint16_t *s, int max_len) +gpt_print_wide36(uint16_t *s) { +#if ENABLE_UNICODE_SUPPORT + char buf[37 * 4]; + wchar_t wc[37]; int i = 0; - - while (i < max_len) { - if (*s == 0) - return; - fputc(*s, stdout); - s++; + while (i < ARRAY_SIZE(wc)-1) { + if (s[i] == 0) + break; + wc[i] = s[i]; + i++; + } + wc[i] = 0; + if (wcstombs(buf, wc, sizeof(buf)) <= sizeof(buf)-1) + fputs(printable_string(NULL, buf), stdout); +#else + char buf[37]; + int i = 0; + while (i < ARRAY_SIZE(buf)-1) { + if (s[i] == 0) + break; + buf[i] = (s[i] < 0x7f) ? s[i] : '?'; + i++; } + buf[i] = '\0'; + fputs(printable_string(NULL, buf), stdout); +#endif } static void @@ -106,19 +121,28 @@ gpt_list_table(int xtra UNUSED_PARAM) (unsigned long long)SWAP_LE64(gpt_hdr->first_usable_lba), (unsigned long long)SWAP_LE64(gpt_hdr->last_usable_lba)); - puts("Number Start (sector) End (sector) Size Code Name"); +/* "GPT fdisk" has a concept of 16-bit extension of the original MBR 8-bit type codes, + * which it displays here: its output columns are ... Size Code Name + * They are their own invention and are not stored on disk. + * Looks like they use them to support "hybrid" GPT: for example, they have + * AddType(0x8307, "69DAD710-2CE4-4E3C-B16C-21A1D49ABED3", "Linux ARM32 root (/)"); + * and then (code>>8) matches what you need to put into MBR's type field for such a partition. + * To print those codes, we'd need a GUID lookup table. Lets just drop the "Code" column instead: + */ + puts("Number Start (sector) End (sector) Size Name"); + // 123456 123456789012345 123456789012345 12345 abc for (i = 0; i < n_parts; i++) { gpt_partition *p = gpt_part(i); if (p->lba_start) { smart_ulltoa5((1 + SWAP_LE64(p->lba_end) - SWAP_LE64(p->lba_start)) * sector_size, numstr6, " KMGTPEZY")[0] = '\0'; - printf("%4u %15llu %15llu %11s %04x ", + printf("%6u %15llu %15llu %s ", i + 1, (unsigned long long)SWAP_LE64(p->lba_start), (unsigned long long)SWAP_LE64(p->lba_end), - numstr6, - 0x0700 /* FIXME */); - gpt_print_wide(p->name, 18); + numstr6 + ); + gpt_print_wide36(p->name36); bb_putchar('\n'); } } @@ -127,6 +151,7 @@ gpt_list_table(int xtra UNUSED_PARAM) static int check_gpt_label(void) { + unsigned part_array_len; struct partition *first = pt_offset(MBRbuffer, 0); struct pte pe; uint32_t crc; @@ -150,6 +175,7 @@ check_gpt_label(void) return 0; } + init_unicode(); if (!global_crc32_table) { global_crc32_table = crc32_filltable(NULL, 0); } -- cgit v1.2.3-55-g6feb From 710b6ce9b0dba1b13028e7205bade70eefc2543f Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 27 Nov 2016 20:47:01 +0100 Subject: fdisk_gpt: simplify GPT partition name printing Signed-off-by: Denys Vlasenko --- util-linux/fdisk_gpt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'util-linux') diff --git a/util-linux/fdisk_gpt.c b/util-linux/fdisk_gpt.c index 9b17b4a57..45d2aa6e7 100644 --- a/util-linux/fdisk_gpt.c +++ b/util-linux/fdisk_gpt.c @@ -94,11 +94,11 @@ gpt_print_wide36(uint16_t *s) while (i < ARRAY_SIZE(buf)-1) { if (s[i] == 0) break; - buf[i] = (s[i] < 0x7f) ? s[i] : '?'; + buf[i] = (0x20 <= s[i] && s[i] < 0x7f) ? s[i] : '?'; i++; } buf[i] = '\0'; - fputs(printable_string(NULL, buf), stdout); + fputs(buf, stdout); #endif } -- cgit v1.2.3-55-g6feb From 1d3a04a3a4be8682d4317251fc14e81ad655d58a Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 28 Nov 2016 01:22:57 +0100 Subject: Code style fixes, no code changes Signed-off-by: Denys Vlasenko --- e2fsprogs/fsck.c | 2 +- editors/patch.c | 11 ++++++----- editors/patch_toybox.c | 7 +++---- editors/sed.c | 5 ++++- loginutils/addgroup.c | 2 +- miscutils/makedevs.c | 2 +- miscutils/rx.c | 2 +- networking/interface.c | 8 ++++---- networking/tc.c | 6 +++--- procps/pgrep.c | 2 +- runit/sv.c | 2 +- util-linux/getopt.c | 4 ++-- util-linux/readprofile.c | 7 ++++--- 13 files changed, 32 insertions(+), 28 deletions(-) (limited to 'util-linux') diff --git a/e2fsprogs/fsck.c b/e2fsprogs/fsck.c index 59514a1a6..6414988b4 100644 --- a/e2fsprogs/fsck.c +++ b/e2fsprogs/fsck.c @@ -658,7 +658,7 @@ static int device_already_active(char *device) return (G.instance_list != NULL); for (inst = G.instance_list; inst; inst = inst->next) { - if (!inst->base_device || !strcmp(base, inst->base_device)) { + if (!inst->base_device || strcmp(base, inst->base_device) == 0) { free(base); return 1; } diff --git a/editors/patch.c b/editors/patch.c index ea1fc0974..731a8c58a 100644 --- a/editors/patch.c +++ b/editors/patch.c @@ -247,7 +247,7 @@ static int apply_one_hunk(void) // Figure out which line of hunk to compare with next. (Skip lines // of the hunk we'd be adding.) while (plist && *plist->data == "+-"[reverse]) { - if (data && !strcmp(data, plist->data+1)) { + if (data && strcmp(data, plist->data+1) == 0) { if (!backwarn) { backwarn = TT.linenum; if (option_mask32 & FLAG_IGNORE) { @@ -291,8 +291,9 @@ static int apply_one_hunk(void) for (;;) { while (plist && *plist->data == "+-"[reverse]) { - if (!strcmp(check->data, plist->data+1) && - !backwarn) { + if (strcmp(check->data, plist->data+1) == 0 + && !backwarn + ) { backwarn = TT.linenum; if (option_mask32 & FLAG_IGNORE) { dummy_revert = 1; @@ -491,7 +492,7 @@ int patch_main(int argc UNUSED_PARAM, char **argv) // We're deleting oldname if new file is /dev/null (before -p) // or if new hunk is empty (zero context) after patching - if (!strcmp(name, "/dev/null") || !(reverse ? oldsum : newsum)) { + if (strcmp(name, "/dev/null") == 0 || !(reverse ? oldsum : newsum)) { name = reverse ? newname : oldname; empty = 1; } @@ -527,7 +528,7 @@ int patch_main(int argc UNUSED_PARAM, char **argv) struct stat statbuf; // If the old file was null, we're creating a new one. - if (!strcmp(oldname, "/dev/null") || !oldsum) { + if (strcmp(oldname, "/dev/null") == 0 || !oldsum) { printf("creating %s\n", name); s = strrchr(name, '/'); if (s) { diff --git a/editors/patch_toybox.c b/editors/patch_toybox.c index a60bf070f..5174acd6a 100644 --- a/editors/patch_toybox.c +++ b/editors/patch_toybox.c @@ -335,7 +335,7 @@ static int apply_one_hunk(void) // Figure out which line of hunk to compare with next. (Skip lines // of the hunk we'd be adding.) while (plist && *plist->data == "+-"[reverse]) { - if (data && !strcmp(data, plist->data+1)) { + if (data && strcmp(data, plist->data+1) == 0) { if (!backwarn) { fdprintf(2,"Possibly reversed hunk %d at %ld\n", TT.hunknum, TT.linenum); @@ -529,8 +529,7 @@ int patch_main(int argc UNUSED_PARAM, char **argv) // We're deleting oldname if new file is /dev/null (before -p) // or if new hunk is empty (zero context) after patching - if (!strcmp(name, "/dev/null") || !(reverse ? oldsum : newsum)) - { + if (strcmp(name, "/dev/null") == 0 || !(reverse ? oldsum : newsum)) { name = reverse ? newname : oldname; del++; } @@ -551,7 +550,7 @@ int patch_main(int argc UNUSED_PARAM, char **argv) // If we've got a file to open, do so. } else if (!(option_mask32 & FLAG_PATHLEN) || i <= TT.prefix) { // If the old file was null, we're creating a new one. - if (!strcmp(oldname, "/dev/null") || !oldsum) { + if (strcmp(oldname, "/dev/null") == 0 || !oldsum) { printf("creating %s\n", name); s = strrchr(name, '/'); if (s) { diff --git a/editors/sed.c b/editors/sed.c index b7add1fb1..637a6851b 100644 --- a/editors/sed.c +++ b/editors/sed.c @@ -892,7 +892,10 @@ static sed_cmd_t *branch_to(char *label) sed_cmd_t *sed_cmd; for (sed_cmd = G.sed_cmd_head; sed_cmd; sed_cmd = sed_cmd->next) { - if (sed_cmd->cmd == ':' && sed_cmd->string && !strcmp(sed_cmd->string, label)) { + if (sed_cmd->cmd == ':' + && sed_cmd->string + && strcmp(sed_cmd->string, label) == 0 + ) { return sed_cmd; } } diff --git a/loginutils/addgroup.c b/loginutils/addgroup.c index 4d4fc3f28..6b2fd7ba9 100644 --- a/loginutils/addgroup.c +++ b/loginutils/addgroup.c @@ -186,7 +186,7 @@ int addgroup_main(int argc UNUSED_PARAM, char **argv) gr = xgetgrnam(argv[1]); /* unknown group: exit */ /* check if user is already in this group */ for (; *(gr->gr_mem) != NULL; (gr->gr_mem)++) { - if (!strcmp(argv[0], *(gr->gr_mem))) { + if (strcmp(argv[0], *(gr->gr_mem)) == 0) { /* user is already in group: do nothing */ return EXIT_SUCCESS; } diff --git a/miscutils/makedevs.c b/miscutils/makedevs.c index c5eeed0e0..9e7ca340f 100644 --- a/miscutils/makedevs.c +++ b/miscutils/makedevs.c @@ -283,7 +283,7 @@ int makedevs_main(int argc UNUSED_PARAM, char **argv) sprintf(full_name_inc, count ? "%s%u" : "%s", full_name, i); rdev = makedev(major, minor + (i - start) * increment); if (mknod(full_name_inc, mode, rdev) != 0 - && errno != EEXIST + && errno != EEXIST ) { bb_perror_msg("line %d: can't create node %s", linenum, full_name_inc); ret = EXIT_FAILURE; diff --git a/miscutils/rx.c b/miscutils/rx.c index 7fca8e36b..660f66a89 100644 --- a/miscutils/rx.c +++ b/miscutils/rx.c @@ -111,7 +111,7 @@ static int receive(/*int read_fd, */int file_fd) && blockBuf[blockLength - 3] == PAD ) { while (blockLength - && blockBuf[blockLength - 1] == PAD + && blockBuf[blockLength - 1] == PAD ) { blockLength--; } diff --git a/networking/interface.c b/networking/interface.c index e5723b428..c5c8f2cdd 100644 --- a/networking/interface.c +++ b/networking/interface.c @@ -264,7 +264,7 @@ const struct aftype* FAST_FUNC get_aftype(const char *name) afp = aftypes; while (*afp != NULL) { - if (!strcmp((*afp)->name, name)) + if (strcmp((*afp)->name, name) == 0) return (*afp); afp++; } @@ -572,7 +572,7 @@ static int if_readlist_proc(char *target) ife = add_interface(name); get_dev_fields(s, ife, procnetdev_vsn); ife->statistics_valid = 1; - if (target && !strcmp(target, name)) + if (target && strcmp(target, name) == 0) break; } if (ferror(fh)) { @@ -781,7 +781,7 @@ const struct hwtype* FAST_FUNC get_hwtype(const char *name) hwp = hwtypes; while (*hwp != NULL) { - if (!strcmp((*hwp)->name, name)) + if (strcmp((*hwp)->name, name) == 0) return (*hwp); hwp++; } @@ -877,7 +877,7 @@ static void ife_print6(struct interface *ptr) addr6p[5], addr6p[6], addr6p[7], &if_idx, &plen, &scope, &dad_status, devname) != EOF ) { - if (!strcmp(devname, ptr->name)) { + if (strcmp(devname, ptr->name) == 0) { sprintf(addr6, "%s:%s:%s:%s:%s:%s:%s:%s", addr6p[0], addr6p[1], addr6p[2], addr6p[3], addr6p[4], addr6p[5], addr6p[6], addr6p[7]); diff --git a/networking/tc.c b/networking/tc.c index 271d569e4..25875aa3e 100644 --- a/networking/tc.c +++ b/networking/tc.c @@ -116,7 +116,7 @@ static int get_qdisc_handle(uint32_t *h, const char *str) { char *p; maj = TC_H_UNSPEC; - if (!strcmp(str, "none")) + if (strcmp(str, "none") == 0) goto ok; maj = strtoul(str, &p, 16); if (p == str) @@ -135,10 +135,10 @@ static int get_tc_classid(uint32_t *h, const char *str) { char *p; maj = TC_H_ROOT; - if (!strcmp(str, "root")) + if (strcmp(str, "root") == 0) goto ok; maj = TC_H_UNSPEC; - if (!strcmp(str, "none")) + if (strcmp(str, "none") == 0) goto ok; maj = strtoul(str, &p, 16); if (p == str) { diff --git a/procps/pgrep.c b/procps/pgrep.c index 974d007f3..ac82b5156 100644 --- a/procps/pgrep.c +++ b/procps/pgrep.c @@ -168,7 +168,7 @@ int pgrep_main(int argc UNUSED_PARAM, char **argv) if (ppid2match >= 0 && ppid2match != proc->ppid) continue; - if (sid2match >= 0 && sid2match != proc->sid) + if (sid2match >= 0 && sid2match != proc->sid) continue; /* NB: OPT_INVERT is always 0 or 1 */ diff --git a/runit/sv.c b/runit/sv.c index 37df9a929..42abbbbb5 100644 --- a/runit/sv.c +++ b/runit/sv.c @@ -210,7 +210,7 @@ struct globals { #define INIT_G() do { setup_common_bufsiz(); } while (0) -#define str_equal(s,t) (!strcmp((s), (t))) +#define str_equal(s,t) (strcmp((s), (t)) == 0) static void fatal_cannot(const char *m1) NORETURN; diff --git a/util-linux/getopt.c b/util-linux/getopt.c index 83cc1efea..f6ecc3dde 100644 --- a/util-linux/getopt.c +++ b/util-linux/getopt.c @@ -347,9 +347,9 @@ static struct option *add_long_options(struct option *long_options, char *option static void set_shell(const char *new_shell) { - if (!strcmp(new_shell, "bash") || !strcmp(new_shell, "sh")) + if (strcmp(new_shell, "bash") == 0 || strcmp(new_shell, "sh") == 0) return; - if (!strcmp(new_shell, "tcsh") || !strcmp(new_shell, "csh")) + if (strcmp(new_shell, "tcsh") == 0 || strcmp(new_shell, "csh") == 0) option_mask32 |= SHELL_IS_TCSH; else bb_error_msg("unknown shell '%s', assuming bash", new_shell); diff --git a/util-linux/readprofile.c b/util-linux/readprofile.c index d5230387c..31abb6bb2 100644 --- a/util-linux/readprofile.c +++ b/util-linux/readprofile.c @@ -174,7 +174,7 @@ int readprofile_main(int argc UNUSED_PARAM, char **argv) bb_error_msg_and_die("%s(%i): wrong map line", mapFile, maplineno); - if (!strcmp(fn_name, "_stext")) /* only elf works like this */ { + if (strcmp(fn_name, "_stext") == 0) /* only elf works like this */ { add0 = fn_add; break; } @@ -224,8 +224,9 @@ int readprofile_main(int argc UNUSED_PARAM, char **argv) if (optBins) { if (optVerbose || this > 0) printf(" total\t\t\t\t%u\n", this); - } else if ((this || optAll) - && (fn_len = next_add-fn_add) != 0 + } else + if ((this || optAll) + && (fn_len = next_add-fn_add) != 0 ) { if (optVerbose) printf("%016llx %-40s %6u %8.4f\n", fn_add, -- cgit v1.2.3-55-g6feb