diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2015-10-18 22:40:23 +0200 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2015-10-18 22:40:23 +0200 |
| commit | 000eda41c084bae95d9e40a570cbdaa5ffd3d22e (patch) | |
| tree | 848b2b10ddd0277664e27c777ea36a7f5b317929 | |
| parent | d34f300db6d7a726759f4d820a61f19eacf11288 (diff) | |
| download | busybox-w32-000eda41c084bae95d9e40a570cbdaa5ffd3d22e.tar.gz busybox-w32-000eda41c084bae95d9e40a570cbdaa5ffd3d22e.tar.bz2 busybox-w32-000eda41c084bae95d9e40a570cbdaa5ffd3d22e.zip | |
e2fsprogs/*: convert to new-style "one file" applets
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| -rw-r--r-- | e2fsprogs/Config.src | 28 | ||||
| -rw-r--r-- | e2fsprogs/Kbuild.src | 6 | ||||
| -rw-r--r-- | e2fsprogs/chattr.c | 16 | ||||
| -rw-r--r-- | e2fsprogs/fsck.c | 11 | ||||
| -rw-r--r-- | e2fsprogs/lsattr.c | 16 | ||||
| -rw-r--r-- | e2fsprogs/tune2fs.c | 43 | ||||
| -rw-r--r-- | include/applets.src.h | 4 |
7 files changed, 55 insertions, 69 deletions
diff --git a/e2fsprogs/Config.src b/e2fsprogs/Config.src index 743e1e11f..a20d849e6 100644 --- a/e2fsprogs/Config.src +++ b/e2fsprogs/Config.src | |||
| @@ -7,12 +7,6 @@ menu "Linux Ext2 FS Progs" | |||
| 7 | 7 | ||
| 8 | INSERT | 8 | INSERT |
| 9 | 9 | ||
| 10 | config CHATTR | ||
| 11 | bool "chattr" | ||
| 12 | default y | ||
| 13 | help | ||
| 14 | chattr changes the file attributes on a second extended file system. | ||
| 15 | |||
| 16 | ### config E2FSCK | 10 | ### config E2FSCK |
| 17 | ### bool "e2fsck" | 11 | ### bool "e2fsck" |
| 18 | ### default y | 12 | ### default y |
| @@ -22,21 +16,6 @@ config CHATTR | |||
| 22 | ### The normal compat symlinks 'fsck.ext2' and 'fsck.ext3' are also | 16 | ### The normal compat symlinks 'fsck.ext2' and 'fsck.ext3' are also |
| 23 | ### provided. | 17 | ### provided. |
| 24 | 18 | ||
| 25 | config FSCK | ||
| 26 | bool "fsck" | ||
| 27 | default y | ||
| 28 | help | ||
| 29 | fsck is used to check and optionally repair one or more filesystems. | ||
| 30 | In actuality, fsck is simply a front-end for the various file system | ||
| 31 | checkers (fsck.fstype) available under Linux. | ||
| 32 | |||
| 33 | config LSATTR | ||
| 34 | bool "lsattr" | ||
| 35 | default y | ||
| 36 | select PLATFORM_LINUX | ||
| 37 | help | ||
| 38 | lsattr lists the file attributes on a second extended file system. | ||
| 39 | |||
| 40 | ### config MKE2FS | 19 | ### config MKE2FS |
| 41 | ### bool "mke2fs" | 20 | ### bool "mke2fs" |
| 42 | ### default y | 21 | ### default y |
| @@ -44,13 +23,6 @@ config LSATTR | |||
| 44 | ### mke2fs is used to create an ext2/ext3 filesystem. The normal compat | 23 | ### mke2fs is used to create an ext2/ext3 filesystem. The normal compat |
| 45 | ### symlinks 'mkfs.ext2' and 'mkfs.ext3' are also provided. | 24 | ### symlinks 'mkfs.ext2' and 'mkfs.ext3' are also provided. |
| 46 | 25 | ||
| 47 | config TUNE2FS | ||
| 48 | bool "tune2fs" | ||
| 49 | default n # off: it is too limited compared to upstream version | ||
| 50 | help | ||
| 51 | tune2fs allows the system administrator to adjust various tunable | ||
| 52 | filesystem parameters on Linux ext2/ext3 filesystems. | ||
| 53 | |||
| 54 | ### config E2LABEL | 26 | ### config E2LABEL |
| 55 | ### bool "e2label" | 27 | ### bool "e2label" |
| 56 | ### default y | 28 | ### default y |
diff --git a/e2fsprogs/Kbuild.src b/e2fsprogs/Kbuild.src index b7a14c381..6b4fb7470 100644 --- a/e2fsprogs/Kbuild.src +++ b/e2fsprogs/Kbuild.src | |||
| @@ -7,9 +7,3 @@ | |||
| 7 | lib-y:= | 7 | lib-y:= |
| 8 | 8 | ||
| 9 | INSERT | 9 | INSERT |
| 10 | |||
| 11 | lib-$(CONFIG_CHATTR) += chattr.o e2fs_lib.o | ||
| 12 | lib-$(CONFIG_LSATTR) += lsattr.o e2fs_lib.o | ||
| 13 | |||
| 14 | lib-$(CONFIG_FSCK) += fsck.o | ||
| 15 | lib-$(CONFIG_TUNE2FS) += tune2fs.o | ||
diff --git a/e2fsprogs/chattr.c b/e2fsprogs/chattr.c index f1cc8389f..c4e2415f8 100644 --- a/e2fsprogs/chattr.c +++ b/e2fsprogs/chattr.c | |||
| @@ -9,15 +9,15 @@ | |||
| 9 | * This file can be redistributed under the terms of the GNU General | 9 | * This file can be redistributed under the terms of the GNU General |
| 10 | * Public License | 10 | * Public License |
| 11 | */ | 11 | */ |
| 12 | //config:config CHATTR | ||
| 13 | //config: bool "chattr" | ||
| 14 | //config: default y | ||
| 15 | //config: help | ||
| 16 | //config: chattr changes the file attributes on a second extended file system. | ||
| 12 | 17 | ||
| 13 | /* | 18 | //applet:IF_CHATTR(APPLET(chattr, BB_DIR_BIN, BB_SUID_DROP)) |
| 14 | * History: | 19 | |
| 15 | * 93/10/30 - Creation | 20 | //kbuild:lib-$(CONFIG_CHATTR) += chattr.o e2fs_lib.o |
| 16 | * 93/11/13 - Replace stat() calls by lstat() to avoid loops | ||
| 17 | * 94/02/27 - Integrated in Ted's distribution | ||
| 18 | * 98/12/29 - Ignore symlinks when working recursively (G M Sipe) | ||
| 19 | * 98/12/29 - Display version info only when -V specified (G M Sipe) | ||
| 20 | */ | ||
| 21 | 21 | ||
| 22 | //usage:#define chattr_trivial_usage | 22 | //usage:#define chattr_trivial_usage |
| 23 | //usage: "[-R] [-+=AacDdijsStTu] [-v VERSION] [FILE]..." | 23 | //usage: "[-R] [-+=AacDdijsStTu] [-v VERSION] [FILE]..." |
diff --git a/e2fsprogs/fsck.c b/e2fsprogs/fsck.c index d2d312e5c..adaf0c538 100644 --- a/e2fsprogs/fsck.c +++ b/e2fsprogs/fsck.c | |||
| @@ -33,6 +33,17 @@ | |||
| 33 | * spawns actual fsck.something for each filesystem to check. | 33 | * spawns actual fsck.something for each filesystem to check. |
| 34 | * It doesn't guess filesystem types from on-disk format. | 34 | * It doesn't guess filesystem types from on-disk format. |
| 35 | */ | 35 | */ |
| 36 | //config:config FSCK | ||
| 37 | //config: bool "fsck" | ||
| 38 | //config: default y | ||
| 39 | //config: help | ||
| 40 | //config: fsck is used to check and optionally repair one or more filesystems. | ||
| 41 | //config: In actuality, fsck is simply a front-end for the various file system | ||
| 42 | //config: checkers (fsck.fstype) available under Linux. | ||
| 43 | |||
| 44 | //applet:IF_FSCK(APPLET(fsck, BB_DIR_SBIN, BB_SUID_DROP)) | ||
| 45 | |||
| 46 | //kbuild:lib-$(CONFIG_FSCK) += fsck.o | ||
| 36 | 47 | ||
| 37 | //usage:#define fsck_trivial_usage | 48 | //usage:#define fsck_trivial_usage |
| 38 | //usage: "[-ANPRTV] [-C FD] [-t FSTYPE] [FS_OPTS] [BLOCKDEV]..." | 49 | //usage: "[-ANPRTV] [-C FD] [-t FSTYPE] [FS_OPTS] [BLOCKDEV]..." |
diff --git a/e2fsprogs/lsattr.c b/e2fsprogs/lsattr.c index 1312fe754..3a7dd6b56 100644 --- a/e2fsprogs/lsattr.c +++ b/e2fsprogs/lsattr.c | |||
| @@ -9,14 +9,16 @@ | |||
| 9 | * This file can be redistributed under the terms of the GNU General | 9 | * This file can be redistributed under the terms of the GNU General |
| 10 | * Public License | 10 | * Public License |
| 11 | */ | 11 | */ |
| 12 | //config:config LSATTR | ||
| 13 | //config: bool "lsattr" | ||
| 14 | //config: default y | ||
| 15 | //config: select PLATFORM_LINUX | ||
| 16 | //config: help | ||
| 17 | //config: lsattr lists the file attributes on a second extended file system. | ||
| 12 | 18 | ||
| 13 | /* | 19 | //applet:IF_LSATTR(APPLET(lsattr, BB_DIR_BIN, BB_SUID_DROP)) |
| 14 | * History: | 20 | |
| 15 | * 93/10/30 - Creation | 21 | //kbuild:lib-$(CONFIG_LSATTR) += lsattr.o e2fs_lib.o |
| 16 | * 93/11/13 - Replace stat() calls by lstat() to avoid loops | ||
| 17 | * 94/02/27 - Integrated in Ted's distribution | ||
| 18 | * 98/12/29 - Display version info only when -V specified (G M Sipe) | ||
| 19 | */ | ||
| 20 | 22 | ||
| 21 | //usage:#define lsattr_trivial_usage | 23 | //usage:#define lsattr_trivial_usage |
| 22 | //usage: "[-Radlv] [FILE]..." | 24 | //usage: "[-Radlv] [FILE]..." |
diff --git a/e2fsprogs/tune2fs.c b/e2fsprogs/tune2fs.c index 46a745ee4..c9f88b39d 100644 --- a/e2fsprogs/tune2fs.c +++ b/e2fsprogs/tune2fs.c | |||
| @@ -6,6 +6,33 @@ | |||
| 6 | * | 6 | * |
| 7 | * Licensed under GPLv2, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2, see file LICENSE in this source tree. |
| 8 | */ | 8 | */ |
| 9 | //config:config TUNE2FS | ||
| 10 | //config: bool "tune2fs" | ||
| 11 | //config: default n # off: it is too limited compared to upstream version | ||
| 12 | //config: help | ||
| 13 | //config: tune2fs allows the system administrator to adjust various tunable | ||
| 14 | //config: filesystem parameters on Linux ext2/ext3 filesystems. | ||
| 15 | |||
| 16 | //applet:IF_TUNE2FS(APPLET(tune2fs, BB_DIR_SBIN, BB_SUID_DROP)) | ||
| 17 | |||
| 18 | //kbuild:lib-$(CONFIG_TUNE2FS) += tune2fs.o | ||
| 19 | |||
| 20 | //usage:#define tune2fs_trivial_usage | ||
| 21 | //usage: "[-c MAX_MOUNT_COUNT] " | ||
| 22 | ////usage: "[-e errors-behavior] [-g group] " | ||
| 23 | //usage: "[-i DAYS] " | ||
| 24 | ////usage: "[-j] [-J journal-options] [-l] [-s sparse-flag] " | ||
| 25 | ////usage: "[-m reserved-blocks-percent] [-o [^]mount-options[,...]] " | ||
| 26 | ////usage: "[-r reserved-blocks-count] [-u user] " | ||
| 27 | //usage: "[-C MOUNT_COUNT] " | ||
| 28 | //usage: "[-L LABEL] " | ||
| 29 | ////usage: "[-M last-mounted-dir] [-O [^]feature[,...]] " | ||
| 30 | ////usage: "[-T last-check-time] [-U UUID] " | ||
| 31 | //usage: "BLOCKDEV" | ||
| 32 | //usage: | ||
| 33 | //usage:#define tune2fs_full_usage "\n\n" | ||
| 34 | //usage: "Adjust filesystem options on ext[23] filesystems" | ||
| 35 | |||
| 9 | #include "libbb.h" | 36 | #include "libbb.h" |
| 10 | #include <linux/fs.h> | 37 | #include <linux/fs.h> |
| 11 | #include "bb_e2fs_defs.h" | 38 | #include "bb_e2fs_defs.h" |
| @@ -27,22 +54,6 @@ do { \ | |||
| 27 | #define FETCH_LE32(field) \ | 54 | #define FETCH_LE32(field) \ |
| 28 | (sizeof(field) == 4 ? SWAP_LE32(field) : BUG_wrong_field_size()) | 55 | (sizeof(field) == 4 ? SWAP_LE32(field) : BUG_wrong_field_size()) |
| 29 | 56 | ||
| 30 | //usage:#define tune2fs_trivial_usage | ||
| 31 | //usage: "[-c MAX_MOUNT_COUNT] " | ||
| 32 | ////usage: "[-e errors-behavior] [-g group] " | ||
| 33 | //usage: "[-i DAYS] " | ||
| 34 | ////usage: "[-j] [-J journal-options] [-l] [-s sparse-flag] " | ||
| 35 | ////usage: "[-m reserved-blocks-percent] [-o [^]mount-options[,...]] " | ||
| 36 | ////usage: "[-r reserved-blocks-count] [-u user] " | ||
| 37 | //usage: "[-C MOUNT_COUNT] " | ||
| 38 | //usage: "[-L LABEL] " | ||
| 39 | ////usage: "[-M last-mounted-dir] [-O [^]feature[,...]] " | ||
| 40 | ////usage: "[-T last-check-time] [-U UUID] " | ||
| 41 | //usage: "BLOCKDEV" | ||
| 42 | //usage: | ||
| 43 | //usage:#define tune2fs_full_usage "\n\n" | ||
| 44 | //usage: "Adjust filesystem options on ext[23] filesystems" | ||
| 45 | |||
| 46 | enum { | 57 | enum { |
| 47 | OPT_L = 1 << 0, // label | 58 | OPT_L = 1 << 0, // label |
| 48 | OPT_c = 1 << 1, // max mount count | 59 | OPT_c = 1 << 1, // max mount count |
diff --git a/include/applets.src.h b/include/applets.src.h index c1b8017d4..c1ed0e82f 100644 --- a/include/applets.src.h +++ b/include/applets.src.h | |||
| @@ -90,7 +90,6 @@ IF_CAL(APPLET(cal, BB_DIR_USR_BIN, BB_SUID_DROP)) | |||
| 90 | IF_CAT(APPLET_NOFORK(cat, cat, BB_DIR_BIN, BB_SUID_DROP, cat)) | 90 | IF_CAT(APPLET_NOFORK(cat, cat, BB_DIR_BIN, BB_SUID_DROP, cat)) |
| 91 | IF_CATV(APPLET(catv, BB_DIR_BIN, BB_SUID_DROP)) | 91 | IF_CATV(APPLET(catv, BB_DIR_BIN, BB_SUID_DROP)) |
| 92 | IF_CHAT(APPLET(chat, BB_DIR_USR_SBIN, BB_SUID_DROP)) | 92 | IF_CHAT(APPLET(chat, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
| 93 | IF_CHATTR(APPLET(chattr, BB_DIR_BIN, BB_SUID_DROP)) | ||
| 94 | IF_CHCON(APPLET(chcon, BB_DIR_USR_BIN, BB_SUID_DROP)) | 93 | IF_CHCON(APPLET(chcon, BB_DIR_USR_BIN, BB_SUID_DROP)) |
| 95 | IF_CHGRP(APPLET_NOEXEC(chgrp, chgrp, BB_DIR_BIN, BB_SUID_DROP, chgrp)) | 94 | IF_CHGRP(APPLET_NOEXEC(chgrp, chgrp, BB_DIR_BIN, BB_SUID_DROP, chgrp)) |
| 96 | IF_CHMOD(APPLET_NOEXEC(chmod, chmod, BB_DIR_BIN, BB_SUID_DROP, chmod)) | 95 | IF_CHMOD(APPLET_NOEXEC(chmod, chmod, BB_DIR_BIN, BB_SUID_DROP, chmod)) |
| @@ -153,7 +152,6 @@ IF_FLOCK(APPLET(flock, BB_DIR_USR_BIN, BB_SUID_DROP)) | |||
| 153 | IF_FOLD(APPLET_NOEXEC(fold, fold, BB_DIR_USR_BIN, BB_SUID_DROP, fold)) | 152 | IF_FOLD(APPLET_NOEXEC(fold, fold, BB_DIR_USR_BIN, BB_SUID_DROP, fold)) |
| 154 | IF_FREE(APPLET(free, BB_DIR_USR_BIN, BB_SUID_DROP)) | 153 | IF_FREE(APPLET(free, BB_DIR_USR_BIN, BB_SUID_DROP)) |
| 155 | IF_FREERAMDISK(APPLET(freeramdisk, BB_DIR_SBIN, BB_SUID_DROP)) | 154 | IF_FREERAMDISK(APPLET(freeramdisk, BB_DIR_SBIN, BB_SUID_DROP)) |
| 156 | IF_FSCK(APPLET(fsck, BB_DIR_SBIN, BB_SUID_DROP)) | ||
| 157 | //IF_E2FSCK(APPLET_ODDNAME(fsck.ext2, e2fsck, BB_DIR_SBIN, BB_SUID_DROP, fsck_ext2)) | 155 | //IF_E2FSCK(APPLET_ODDNAME(fsck.ext2, e2fsck, BB_DIR_SBIN, BB_SUID_DROP, fsck_ext2)) |
| 158 | //IF_E2FSCK(APPLET_ODDNAME(fsck.ext3, e2fsck, BB_DIR_SBIN, BB_SUID_DROP, fsck_ext3)) | 156 | //IF_E2FSCK(APPLET_ODDNAME(fsck.ext3, e2fsck, BB_DIR_SBIN, BB_SUID_DROP, fsck_ext3)) |
| 159 | IF_FSCK_MINIX(APPLET_ODDNAME(fsck.minix, fsck_minix, BB_DIR_SBIN, BB_SUID_DROP, fsck_minix)) | 157 | IF_FSCK_MINIX(APPLET_ODDNAME(fsck.minix, fsck_minix, BB_DIR_SBIN, BB_SUID_DROP, fsck_minix)) |
| @@ -218,7 +216,6 @@ IF_LPD(APPLET(lpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) | |||
| 218 | IF_LPQ(APPLET_ODDNAME(lpq, lpqr, BB_DIR_USR_BIN, BB_SUID_DROP, lpq)) | 216 | IF_LPQ(APPLET_ODDNAME(lpq, lpqr, BB_DIR_USR_BIN, BB_SUID_DROP, lpq)) |
| 219 | IF_LPR(APPLET_ODDNAME(lpr, lpqr, BB_DIR_USR_BIN, BB_SUID_DROP, lpr)) | 217 | IF_LPR(APPLET_ODDNAME(lpr, lpqr, BB_DIR_USR_BIN, BB_SUID_DROP, lpr)) |
| 220 | IF_LS(APPLET_NOEXEC(ls, ls, BB_DIR_BIN, BB_SUID_DROP, ls)) | 218 | IF_LS(APPLET_NOEXEC(ls, ls, BB_DIR_BIN, BB_SUID_DROP, ls)) |
| 221 | IF_LSATTR(APPLET(lsattr, BB_DIR_BIN, BB_SUID_DROP)) | ||
| 222 | IF_LSPCI(APPLET(lspci, BB_DIR_USR_BIN, BB_SUID_DROP)) | 219 | IF_LSPCI(APPLET(lspci, BB_DIR_USR_BIN, BB_SUID_DROP)) |
| 223 | IF_LSUSB(APPLET(lsusb, BB_DIR_USR_BIN, BB_SUID_DROP)) | 220 | IF_LSUSB(APPLET(lsusb, BB_DIR_USR_BIN, BB_SUID_DROP)) |
| 224 | IF_MAKEDEVS(APPLET(makedevs, BB_DIR_SBIN, BB_SUID_DROP)) | 221 | IF_MAKEDEVS(APPLET(makedevs, BB_DIR_SBIN, BB_SUID_DROP)) |
| @@ -358,7 +355,6 @@ IF_TRUE(APPLET_NOFORK(true, true, BB_DIR_BIN, BB_SUID_DROP, true)) | |||
| 358 | IF_TTY(APPLET(tty, BB_DIR_USR_BIN, BB_SUID_DROP)) | 355 | IF_TTY(APPLET(tty, BB_DIR_USR_BIN, BB_SUID_DROP)) |
| 359 | IF_TTYSIZE(APPLET(ttysize, BB_DIR_USR_BIN, BB_SUID_DROP)) | 356 | IF_TTYSIZE(APPLET(ttysize, BB_DIR_USR_BIN, BB_SUID_DROP)) |
| 360 | IF_TUNCTL(APPLET(tunctl, BB_DIR_SBIN, BB_SUID_DROP)) | 357 | IF_TUNCTL(APPLET(tunctl, BB_DIR_SBIN, BB_SUID_DROP)) |
| 361 | IF_TUNE2FS(APPLET(tune2fs, BB_DIR_SBIN, BB_SUID_DROP)) | ||
| 362 | IF_UDHCPC(APPLET(udhcpc, BB_DIR_SBIN, BB_SUID_DROP)) | 358 | IF_UDHCPC(APPLET(udhcpc, BB_DIR_SBIN, BB_SUID_DROP)) |
| 363 | IF_UDHCPD(APPLET(udhcpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) | 359 | IF_UDHCPD(APPLET(udhcpd, BB_DIR_USR_SBIN, BB_SUID_DROP)) |
| 364 | IF_UDPSVD(APPLET_ODDNAME(udpsvd, tcpudpsvd, BB_DIR_USR_BIN, BB_SUID_DROP, udpsvd)) | 360 | IF_UDPSVD(APPLET_ODDNAME(udpsvd, tcpudpsvd, BB_DIR_USR_BIN, BB_SUID_DROP, udpsvd)) |
