e2fsprogs/*: convert to new-style "one file" applets

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2015-10-18 22:40:23 +02:00
parent d34f300db6
commit 000eda41c0
7 changed files with 55 additions and 69 deletions

View File

@ -7,12 +7,6 @@ menu "Linux Ext2 FS Progs"
INSERT INSERT
config CHATTR
bool "chattr"
default y
help
chattr changes the file attributes on a second extended file system.
### config E2FSCK ### config E2FSCK
### bool "e2fsck" ### bool "e2fsck"
### default y ### default y
@ -22,21 +16,6 @@ config CHATTR
### The normal compat symlinks 'fsck.ext2' and 'fsck.ext3' are also ### The normal compat symlinks 'fsck.ext2' and 'fsck.ext3' are also
### provided. ### provided.
config FSCK
bool "fsck"
default y
help
fsck is used to check and optionally repair one or more filesystems.
In actuality, fsck is simply a front-end for the various file system
checkers (fsck.fstype) available under Linux.
config LSATTR
bool "lsattr"
default y
select PLATFORM_LINUX
help
lsattr lists the file attributes on a second extended file system.
### config MKE2FS ### config MKE2FS
### bool "mke2fs" ### bool "mke2fs"
### default y ### default y
@ -44,13 +23,6 @@ config LSATTR
### mke2fs is used to create an ext2/ext3 filesystem. The normal compat ### mke2fs is used to create an ext2/ext3 filesystem. The normal compat
### symlinks 'mkfs.ext2' and 'mkfs.ext3' are also provided. ### symlinks 'mkfs.ext2' and 'mkfs.ext3' are also provided.
config TUNE2FS
bool "tune2fs"
default n # off: it is too limited compared to upstream version
help
tune2fs allows the system administrator to adjust various tunable
filesystem parameters on Linux ext2/ext3 filesystems.
### config E2LABEL ### config E2LABEL
### bool "e2label" ### bool "e2label"
### default y ### default y

View File

@ -7,9 +7,3 @@
lib-y:= lib-y:=
INSERT INSERT
lib-$(CONFIG_CHATTR) += chattr.o e2fs_lib.o
lib-$(CONFIG_LSATTR) += lsattr.o e2fs_lib.o
lib-$(CONFIG_FSCK) += fsck.o
lib-$(CONFIG_TUNE2FS) += tune2fs.o

View File

@ -9,15 +9,15 @@
* This file can be redistributed under the terms of the GNU General * This file can be redistributed under the terms of the GNU General
* Public License * Public License
*/ */
//config:config CHATTR
//config: bool "chattr"
//config: default y
//config: help
//config: chattr changes the file attributes on a second extended file system.
/* //applet:IF_CHATTR(APPLET(chattr, BB_DIR_BIN, BB_SUID_DROP))
* History:
* 93/10/30 - Creation //kbuild:lib-$(CONFIG_CHATTR) += chattr.o e2fs_lib.o
* 93/11/13 - Replace stat() calls by lstat() to avoid loops
* 94/02/27 - Integrated in Ted's distribution
* 98/12/29 - Ignore symlinks when working recursively (G M Sipe)
* 98/12/29 - Display version info only when -V specified (G M Sipe)
*/
//usage:#define chattr_trivial_usage //usage:#define chattr_trivial_usage
//usage: "[-R] [-+=AacDdijsStTu] [-v VERSION] [FILE]..." //usage: "[-R] [-+=AacDdijsStTu] [-v VERSION] [FILE]..."

View File

@ -33,6 +33,17 @@
* spawns actual fsck.something for each filesystem to check. * spawns actual fsck.something for each filesystem to check.
* It doesn't guess filesystem types from on-disk format. * It doesn't guess filesystem types from on-disk format.
*/ */
//config:config FSCK
//config: bool "fsck"
//config: default y
//config: help
//config: fsck is used to check and optionally repair one or more filesystems.
//config: In actuality, fsck is simply a front-end for the various file system
//config: checkers (fsck.fstype) available under Linux.
//applet:IF_FSCK(APPLET(fsck, BB_DIR_SBIN, BB_SUID_DROP))
//kbuild:lib-$(CONFIG_FSCK) += fsck.o
//usage:#define fsck_trivial_usage //usage:#define fsck_trivial_usage
//usage: "[-ANPRTV] [-C FD] [-t FSTYPE] [FS_OPTS] [BLOCKDEV]..." //usage: "[-ANPRTV] [-C FD] [-t FSTYPE] [FS_OPTS] [BLOCKDEV]..."

View File

@ -9,14 +9,16 @@
* This file can be redistributed under the terms of the GNU General * This file can be redistributed under the terms of the GNU General
* Public License * Public License
*/ */
//config:config LSATTR
//config: bool "lsattr"
//config: default y
//config: select PLATFORM_LINUX
//config: help
//config: lsattr lists the file attributes on a second extended file system.
/* //applet:IF_LSATTR(APPLET(lsattr, BB_DIR_BIN, BB_SUID_DROP))
* History:
* 93/10/30 - Creation //kbuild:lib-$(CONFIG_LSATTR) += lsattr.o e2fs_lib.o
* 93/11/13 - Replace stat() calls by lstat() to avoid loops
* 94/02/27 - Integrated in Ted's distribution
* 98/12/29 - Display version info only when -V specified (G M Sipe)
*/
//usage:#define lsattr_trivial_usage //usage:#define lsattr_trivial_usage
//usage: "[-Radlv] [FILE]..." //usage: "[-Radlv] [FILE]..."

View File

@ -6,6 +6,33 @@
* *
* Licensed under GPLv2, see file LICENSE in this source tree. * Licensed under GPLv2, see file LICENSE in this source tree.
*/ */
//config:config TUNE2FS
//config: bool "tune2fs"
//config: default n # off: it is too limited compared to upstream version
//config: help
//config: tune2fs allows the system administrator to adjust various tunable
//config: filesystem parameters on Linux ext2/ext3 filesystems.
//applet:IF_TUNE2FS(APPLET(tune2fs, BB_DIR_SBIN, BB_SUID_DROP))
//kbuild:lib-$(CONFIG_TUNE2FS) += tune2fs.o
//usage:#define tune2fs_trivial_usage
//usage: "[-c MAX_MOUNT_COUNT] "
////usage: "[-e errors-behavior] [-g group] "
//usage: "[-i DAYS] "
////usage: "[-j] [-J journal-options] [-l] [-s sparse-flag] "
////usage: "[-m reserved-blocks-percent] [-o [^]mount-options[,...]] "
////usage: "[-r reserved-blocks-count] [-u user] "
//usage: "[-C MOUNT_COUNT] "
//usage: "[-L LABEL] "
////usage: "[-M last-mounted-dir] [-O [^]feature[,...]] "
////usage: "[-T last-check-time] [-U UUID] "
//usage: "BLOCKDEV"
//usage:
//usage:#define tune2fs_full_usage "\n\n"
//usage: "Adjust filesystem options on ext[23] filesystems"
#include "libbb.h" #include "libbb.h"
#include <linux/fs.h> #include <linux/fs.h>
#include "bb_e2fs_defs.h" #include "bb_e2fs_defs.h"
@ -27,22 +54,6 @@ do { \
#define FETCH_LE32(field) \ #define FETCH_LE32(field) \
(sizeof(field) == 4 ? SWAP_LE32(field) : BUG_wrong_field_size()) (sizeof(field) == 4 ? SWAP_LE32(field) : BUG_wrong_field_size())
//usage:#define tune2fs_trivial_usage
//usage: "[-c MAX_MOUNT_COUNT] "
////usage: "[-e errors-behavior] [-g group] "
//usage: "[-i DAYS] "
////usage: "[-j] [-J journal-options] [-l] [-s sparse-flag] "
////usage: "[-m reserved-blocks-percent] [-o [^]mount-options[,...]] "
////usage: "[-r reserved-blocks-count] [-u user] "
//usage: "[-C MOUNT_COUNT] "
//usage: "[-L LABEL] "
////usage: "[-M last-mounted-dir] [-O [^]feature[,...]] "
////usage: "[-T last-check-time] [-U UUID] "
//usage: "BLOCKDEV"
//usage:
//usage:#define tune2fs_full_usage "\n\n"
//usage: "Adjust filesystem options on ext[23] filesystems"
enum { enum {
OPT_L = 1 << 0, // label OPT_L = 1 << 0, // label
OPT_c = 1 << 1, // max mount count OPT_c = 1 << 1, // max mount count

View File

@ -90,7 +90,6 @@ 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_CAT(APPLET_NOFORK(cat, cat, BB_DIR_BIN, BB_SUID_DROP, cat))
IF_CATV(APPLET(catv, BB_DIR_BIN, BB_SUID_DROP)) IF_CATV(APPLET(catv, BB_DIR_BIN, BB_SUID_DROP))
IF_CHAT(APPLET(chat, BB_DIR_USR_SBIN, BB_SUID_DROP)) IF_CHAT(APPLET(chat, BB_DIR_USR_SBIN, BB_SUID_DROP))
IF_CHATTR(APPLET(chattr, BB_DIR_BIN, BB_SUID_DROP))
IF_CHCON(APPLET(chcon, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_CHCON(APPLET(chcon, BB_DIR_USR_BIN, BB_SUID_DROP))
IF_CHGRP(APPLET_NOEXEC(chgrp, chgrp, BB_DIR_BIN, BB_SUID_DROP, chgrp)) IF_CHGRP(APPLET_NOEXEC(chgrp, chgrp, BB_DIR_BIN, BB_SUID_DROP, chgrp))
IF_CHMOD(APPLET_NOEXEC(chmod, chmod, BB_DIR_BIN, BB_SUID_DROP, chmod)) 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))
IF_FOLD(APPLET_NOEXEC(fold, fold, BB_DIR_USR_BIN, BB_SUID_DROP, fold)) IF_FOLD(APPLET_NOEXEC(fold, fold, BB_DIR_USR_BIN, BB_SUID_DROP, fold))
IF_FREE(APPLET(free, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_FREE(APPLET(free, BB_DIR_USR_BIN, BB_SUID_DROP))
IF_FREERAMDISK(APPLET(freeramdisk, BB_DIR_SBIN, BB_SUID_DROP)) IF_FREERAMDISK(APPLET(freeramdisk, BB_DIR_SBIN, BB_SUID_DROP))
IF_FSCK(APPLET(fsck, 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.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_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_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))
IF_LPQ(APPLET_ODDNAME(lpq, lpqr, BB_DIR_USR_BIN, BB_SUID_DROP, lpq)) IF_LPQ(APPLET_ODDNAME(lpq, lpqr, BB_DIR_USR_BIN, BB_SUID_DROP, lpq))
IF_LPR(APPLET_ODDNAME(lpr, lpqr, BB_DIR_USR_BIN, BB_SUID_DROP, lpr)) IF_LPR(APPLET_ODDNAME(lpr, lpqr, BB_DIR_USR_BIN, BB_SUID_DROP, lpr))
IF_LS(APPLET_NOEXEC(ls, ls, BB_DIR_BIN, BB_SUID_DROP, ls)) IF_LS(APPLET_NOEXEC(ls, ls, BB_DIR_BIN, BB_SUID_DROP, ls))
IF_LSATTR(APPLET(lsattr, BB_DIR_BIN, BB_SUID_DROP))
IF_LSPCI(APPLET(lspci, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_LSPCI(APPLET(lspci, BB_DIR_USR_BIN, BB_SUID_DROP))
IF_LSUSB(APPLET(lsusb, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_LSUSB(APPLET(lsusb, BB_DIR_USR_BIN, BB_SUID_DROP))
IF_MAKEDEVS(APPLET(makedevs, BB_DIR_SBIN, BB_SUID_DROP)) 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))
IF_TTY(APPLET(tty, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_TTY(APPLET(tty, BB_DIR_USR_BIN, BB_SUID_DROP))
IF_TTYSIZE(APPLET(ttysize, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_TTYSIZE(APPLET(ttysize, BB_DIR_USR_BIN, BB_SUID_DROP))
IF_TUNCTL(APPLET(tunctl, BB_DIR_SBIN, BB_SUID_DROP)) IF_TUNCTL(APPLET(tunctl, BB_DIR_SBIN, BB_SUID_DROP))
IF_TUNE2FS(APPLET(tune2fs, BB_DIR_SBIN, BB_SUID_DROP))
IF_UDHCPC(APPLET(udhcpc, BB_DIR_SBIN, 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_UDHCPD(APPLET(udhcpd, BB_DIR_USR_SBIN, BB_SUID_DROP))
IF_UDPSVD(APPLET_ODDNAME(udpsvd, tcpudpsvd, BB_DIR_USR_BIN, BB_SUID_DROP, udpsvd)) IF_UDPSVD(APPLET_ODDNAME(udpsvd, tcpudpsvd, BB_DIR_USR_BIN, BB_SUID_DROP, udpsvd))