44 |
#include "util.h" |
#include "util.h" |
45 |
#include "blkid/blkid.h" |
#include "blkid/blkid.h" |
46 |
|
|
47 |
#include "busybox.h" |
#include "libbb.h" |
48 |
|
|
49 |
static char * device_name = NULL; |
static char * device_name = NULL; |
50 |
static char * new_label, *new_last_mounted, *new_UUID; |
static char * new_label, *new_last_mounted, *new_UUID; |
340 |
fs->flags &= ~EXT2_FLAG_SUPER_ONLY; |
fs->flags &= ~EXT2_FLAG_SUPER_ONLY; |
341 |
} |
} |
342 |
print_check_message(fs); |
print_check_message(fs); |
|
return; |
|
343 |
} |
} |
344 |
|
|
345 |
/* |
/* |
557 |
device_name = x_blkid_get_devname(argv[optind]); |
device_name = x_blkid_get_devname(argv[optind]); |
558 |
} |
} |
559 |
|
|
|
#ifdef CONFIG_FINDFS |
|
|
static ATTRIBUTE_NORETURN void do_findfs(int argc, char **argv) |
|
|
{ |
|
|
if ((argc != 2) || |
|
|
(strncmp(argv[1], "LABEL=", 6) && strncmp(argv[1], "UUID=", 5))) |
|
|
bb_show_usage(); |
|
|
device_name = x_blkid_get_devname(argv[1]); |
|
|
puts(device_name); |
|
|
exit(0); |
|
|
} |
|
|
#else |
|
|
#define do_findfs(x, y) |
|
|
#endif |
|
|
|
|
560 |
static void tune2fs_clean_up(void) |
static void tune2fs_clean_up(void) |
561 |
{ |
{ |
562 |
if (ENABLE_FEATURE_CLEAN_UP && device_name) free(device_name); |
if (ENABLE_FEATURE_CLEAN_UP && device_name) free(device_name); |
563 |
if (ENABLE_FEATURE_CLEAN_UP && journal_device) free(journal_device); |
if (ENABLE_FEATURE_CLEAN_UP && journal_device) free(journal_device); |
564 |
} |
} |
565 |
|
|
566 |
|
int tune2fs_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
567 |
int tune2fs_main(int argc, char **argv) |
int tune2fs_main(int argc, char **argv) |
568 |
{ |
{ |
569 |
errcode_t retval; |
errcode_t retval; |
574 |
if (ENABLE_FEATURE_CLEAN_UP) |
if (ENABLE_FEATURE_CLEAN_UP) |
575 |
atexit(tune2fs_clean_up); |
atexit(tune2fs_clean_up); |
576 |
|
|
577 |
if (ENABLE_FINDFS && (applet_name[0] == 'f')) /* findfs */ |
if (ENABLE_E2LABEL && (applet_name[0] == 'e')) /* e2label */ |
|
do_findfs(argc, argv); /* no return */ |
|
|
else if (ENABLE_E2LABEL && (applet_name[0] == 'e')) /* e2label */ |
|
578 |
parse_e2label_options(argc, argv); |
parse_e2label_options(argc, argv); |
579 |
else |
else |
580 |
parse_tune2fs_options(argc, argv); /* tune2fs */ |
parse_tune2fs_options(argc, argv); /* tune2fs */ |