aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-09-24 05:55:03 +0000
committerMike Frysinger <vapier@gentoo.org>2005-09-24 05:55:03 +0000
commita1c6a57fea0aeb08cc23d68684252fc7e1508f59 (patch)
treec328fde6f401c5e16979ca68dbd17e76302e352f
parent9ac178ab408354bcf61ee19a071fdc1e4f163737 (diff)
downloadbusybox-w32-a1c6a57fea0aeb08cc23d68684252fc7e1508f59.tar.gz
busybox-w32-a1c6a57fea0aeb08cc23d68684252fc7e1508f59.tar.bz2
busybox-w32-a1c6a57fea0aeb08cc23d68684252fc7e1508f59.zip
make e2label and findfs optional
-rw-r--r--e2fsprogs/Config.in12
-rw-r--r--e2fsprogs/tune2fs.c16
-rw-r--r--include/applets.h4
3 files changed, 26 insertions, 6 deletions
diff --git a/e2fsprogs/Config.in b/e2fsprogs/Config.in
index c4022bb89..4a564df60 100644
--- a/e2fsprogs/Config.in
+++ b/e2fsprogs/Config.in
@@ -25,15 +25,25 @@ config CONFIG_MKE2FS
25 symlinks 'mkfs.ext2' and 'mkfs.ext3' are also provided. 25 symlinks 'mkfs.ext2' and 'mkfs.ext3' are also provided.
26 26
27config CONFIG_TUNE2FS 27config CONFIG_TUNE2FS
28 bool "tune2fs (and e2label/findfs)" 28 bool "tune2fs"
29 default n 29 default n
30 help 30 help
31 tune2fs allows the system administrator to adjust various tunable 31 tune2fs allows the system administrator to adjust various tunable
32 filesystem parameters on Linux ext2/ext3 filesystems. 32 filesystem parameters on Linux ext2/ext3 filesystems.
33 33
34config CONFIG_E2LABEL
35 bool "e2label"
36 default n
37 depends on CONFIG_TUNE2FS
38 help
34 e2label will display or change the filesystem label on the ext2 39 e2label will display or change the filesystem label on the ext2
35 filesystem located on device. 40 filesystem located on device.
36 41
42config CONFIG_FINDFS
43 bool "findfs"
44 default n
45 depends on CONFIG_TUNE2FS
46 help
37 findfs will search the disks in the system looking for a filesystem 47 findfs will search the disks in the system looking for a filesystem
38 which has a label matching label or a UUID equal to uuid. 48 which has a label matching label or a UUID equal to uuid.
39 49
diff --git a/e2fsprogs/tune2fs.c b/e2fsprogs/tune2fs.c
index e4f904ea0..24c4db3c2 100644
--- a/e2fsprogs/tune2fs.c
+++ b/e2fsprogs/tune2fs.c
@@ -375,7 +375,7 @@ err:
375 exit(1); 375 exit(1);
376} 376}
377 377
378 378#ifdef CONFIG_E2LABEL
379static void parse_e2label_options(int argc, char ** argv) 379static void parse_e2label_options(int argc, char ** argv)
380{ 380{
381 if ((argc < 2) || (argc > 3)) 381 if ((argc < 2) || (argc > 3))
@@ -393,6 +393,7 @@ static void parse_e2label_options(int argc, char ** argv)
393 } else 393 } else
394 print_label++; 394 print_label++;
395} 395}
396#endif
396 397
397static time_t parse_time(char *str) 398static time_t parse_time(char *str)
398{ 399{
@@ -613,6 +614,7 @@ static void parse_tune2fs_options(int argc, char **argv)
613 bb_error_msg_and_die("Unable to resolve '%s'", argv[optind]); 614 bb_error_msg_and_die("Unable to resolve '%s'", argv[optind]);
614} 615}
615 616
617#ifdef CONFIG_FINDFS
616static void do_findfs(int argc, char **argv) 618static void do_findfs(int argc, char **argv)
617{ 619{
618 char *dev; 620 char *dev;
@@ -624,8 +626,9 @@ static void do_findfs(int argc, char **argv)
624 if (!dev) 626 if (!dev)
625 bb_error_msg_and_die("Unable to resolve '%s'", argv[1]); 627 bb_error_msg_and_die("Unable to resolve '%s'", argv[1]);
626 puts(dev); 628 puts(dev);
627 exit(0); 629 return 0;
628} 630}
631#endif
629 632
630int tune2fs_main(int argc, char **argv) 633int tune2fs_main(int argc, char **argv)
631{ 634{
@@ -633,13 +636,20 @@ int tune2fs_main(int argc, char **argv)
633 ext2_filsys fs; 636 ext2_filsys fs;
634 struct ext2_super_block *sb; 637 struct ext2_super_block *sb;
635 io_manager io_ptr; 638 io_manager io_ptr;
639#if defined(CONFIG_FINDFS) || defined(CONFIG_E2LABEL)
636 char *program_name = basename(argv[0]); 640 char *program_name = basename(argv[0]);
641#endif
637 642
643#ifdef CONFIG_FINDFS
638 if (strcmp(program_name, "findfs") == 0) 644 if (strcmp(program_name, "findfs") == 0)
639 do_findfs(argc, argv); 645 return do_findfs(argc, argv);
646#endif
647
648#ifdef CONFIG_E2LABEL
640 if (strcmp(program_name, "e2label") == 0) 649 if (strcmp(program_name, "e2label") == 0)
641 parse_e2label_options(argc, argv); 650 parse_e2label_options(argc, argv);
642 else 651 else
652#endif
643 parse_tune2fs_options(argc, argv); 653 parse_tune2fs_options(argc, argv);
644 654
645 io_ptr = unix_io_manager; 655 io_ptr = unix_io_manager;
diff --git a/include/applets.h b/include/applets.h
index 56ec0a6de..0b4faacaa 100644
--- a/include/applets.h
+++ b/include/applets.h
@@ -182,7 +182,7 @@
182#ifdef CONFIG_DUMPLEASES 182#ifdef CONFIG_DUMPLEASES
183 APPLET(dumpleases, dumpleases_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER) 183 APPLET(dumpleases, dumpleases_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER)
184#endif 184#endif
185#ifdef CONFIG_TUNE2FS 185#ifdef CONFIG_E2LABEL
186 APPLET_NOUSAGE("e2label", tune2fs_main, _BB_DIR_SBIN, _BB_SUID_NEVER) 186 APPLET_NOUSAGE("e2label", tune2fs_main, _BB_DIR_SBIN, _BB_SUID_NEVER)
187#endif 187#endif
188#ifdef CONFIG_ECHO 188#ifdef CONFIG_ECHO
@@ -227,7 +227,7 @@
227#ifdef CONFIG_FIND 227#ifdef CONFIG_FIND
228 APPLET(find, find_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER) 228 APPLET(find, find_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER)
229#endif 229#endif
230#ifdef CONFIG_TUNE2FS 230#ifdef CONFIG_FINDFS
231 APPLET_NOUSAGE("findfs", tune2fs_main, _BB_DIR_SBIN, _BB_SUID_NEVER) 231 APPLET_NOUSAGE("findfs", tune2fs_main, _BB_DIR_SBIN, _BB_SUID_NEVER)
232#endif 232#endif
233#ifdef CONFIG_FOLD 233#ifdef CONFIG_FOLD