From c3e79c12d08dcde3cbc132c31ec593a3f14ba8b5 Mon Sep 17 00:00:00 2001 From: Shibby Date: Tue, 26 Mar 2013 23:13:21 +0700 Subject: [PATCH] Busybox 1.20.2 update cd .. - revert mkfs.ext2/ext3 aplets --- release/src/router/busybox/e2fsprogs/mke2fs.c | 95 ++++++++++++++------------- 1 file changed, 50 insertions(+), 45 deletions(-) diff --git a/release/src/router/busybox/e2fsprogs/mke2fs.c b/release/src/router/busybox/e2fsprogs/mke2fs.c index 1a927c87fe..6d726d8fa4 100644 --- a/release/src/router/busybox/e2fsprogs/mke2fs.c +++ b/release/src/router/busybox/e2fsprogs/mke2fs.c @@ -8,43 +8,48 @@ * Licensed under GPLv2, see file LICENSE in this source tree. */ -//usage:#define mkfs_ext2_trivial_usage -//usage: "[-Fn] " -//usage: "[-c|-l filename] " -//usage: "[-b BLK_SIZE] " -//usage: "[-f fragment-size] [-g blocks-per-group] " -//usage: "[-i INODE_RATIO] [-I INODE_SIZE] " -//usage: "[-j] [-J journal-options] [-N number-of-inodes] " -//usage: "[-m RESERVED_PERCENT] " -//usage: "[-o creator-os] [-O feature[,...]] [-q] " -//usage: "[r fs-revision-level] [-E extended-options] [-v] [-F] " -//usage: "[-L LABEL] " +/* Usage: mke2fs [options] device + * + * 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 :-). + */ + +//usage:#define mke2fs_trivial_usage +//usage: "[-c|-l filename] [-b block-size] [-f fragment-size] [-g blocks-per-group] " +//usage: "[-i bytes-per-inode] [-j] [-J journal-options] [-N number-of-inodes] [-n] " +//usage: "[-m reserved-blocks-percentage] [-o creator-os] [-O feature[,...]] [-q] " +//usage: "[r fs-revision-level] [-E extended-options] [-v] [-F] [-L volume-label] " //usage: "[-M last-mounted-directory] [-S] [-T filesystem-type] " -//usage: "BLOCKDEV [KBYTES]" -//usage:#define mkfs_ext2_full_usage "\n\n" -//usage: " -b BLK_SIZE Block size, bytes" -//usage: "\n -c Check device for bad blocks" -//usage: "\n -E opts Set extended options" -//usage: "\n -f size Fragment size in bytes" -//usage: "\n -F Force" -//usage: "\n -g N Number of blocks in a block group" -//usage: "\n -i RATIO Max number of files is filesystem_size / RATIO" -//usage: "\n -I BYTES Inode size (min 128)" -//usage: "\n -j Create a journal (ext3)" -//usage: "\n -J opts Set journal options (size/device)" -//usage: "\n -l file Read bad blocks list from file" -//usage: "\n -L LBL Volume label" -//usage: "\n -m PERCENT Percent of blocks to reserve for admin" -//usage: "\n -M dir Set last mounted directory" -//usage: "\n -n Dry run" -//usage: "\n -N N Number of inodes to create" -//usage: "\n -o os Set the 'creator os' field" -//usage: "\n -O features Dir_index/filetype/has_journal/journal_dev/sparse_super" -//usage: "\n -q Quiet" -//usage: "\n -r rev Set filesystem revision" -//usage: "\n -S Write superblock and group descriptors only" -//usage: "\n -T fs-type Set usage type (news/largefile/largefile4)" -//usage: "\n -v Verbose" +//usage: "device [blocks-count]" +//usage: +//usage:#define mke2fs_full_usage "\n\n" +//usage: " -b size Block size in bytes" +//usage: "\n -c Check for bad blocks before creating" +//usage: "\n -E opts Set extended options" +//usage: "\n -f size Fragment size in bytes" +//usage: "\n -F Force (ignore sanity checks)" +//usage: "\n -g num Number of blocks in a block group" +//usage: "\n -i ratio The bytes/inode ratio" +//usage: "\n -j Create a journal (ext3)" +//usage: "\n -J opts Set journal options (size/device)" +//usage: "\n -l file Read bad blocks list from file" +//usage: "\n -L lbl Set the volume label" +//usage: "\n -m percent Percent of fs blocks to reserve for admin" +//usage: "\n -M dir Set last mounted directory" +//usage: "\n -n Do not actually create anything" +//usage: "\n -N num Number of inodes to create" +//usage: "\n -o os Set the 'creator os' field" +//usage: "\n -O features Dir_index/filetype/has_journal/journal_dev/sparse_super" +//usage: "\n -q Quiet" +//usage: "\n -r rev Set filesystem revision" +//usage: "\n -S Write superblock and group descriptors only" +//usage: "\n -T fs-type Set usage type (news/largefile/largefile4)" +//usage: "\n -v Verbose" +//usage: +//applet:IF_MKE2FS(APPLET(mke2fs, BB_DIR_SBIN, BB_SUID_DROP)) +//applet:IF_MKE2FS(APPLET_ODDNAME(mkfs.ext2, mke2fs, BB_DIR_SBIN, BB_SUID_DROP, mke2fs)) +//applet:IF_MKE2FS(APPLET_ODDNAME(mkfs.ext3, mke2fs, BB_DIR_SBIN, BB_SUID_DROP, mke2fs)) +//applet:IF_MKE2FS(APPLET(tune2fs, BB_DIR_SBIN, BB_SUID_DROP)) #include #include @@ -61,7 +66,7 @@ #include "e2fsbb.h" #include "ext2fs/ext2_fs.h" -#include "e2fs_lib.h" +#include "uuid/uuid.h" #include "e2p/e2p.h" #include "ext2fs/ext2fs.h" #include "util.h" @@ -233,8 +238,8 @@ static void mke2fs_verbose_done(void) mke2fs_verbose("done\n"); } -static void mke2fs_warning_msg(int retval, const char *fmt, ... ) __attribute__ ((format (printf, 2, 3))); -static void mke2fs_warning_msg(int retval, const char *fmt, ... ) +static void mke2fs_warning_msg(int retval, char *fmt, ... ) __attribute__ ((format (printf, 2, 3))); +static void mke2fs_warning_msg(int retval, char *fmt, ... ) { va_list ap; @@ -517,7 +522,7 @@ static void create_lost_and_found(ext2_filsys fs) ext2_ino_t ino; const char *name = "lost+found"; int i = 1; - const char *msg = "create"; + char *msg = "create"; int lpf_size = 0; fs->umask = 077; @@ -574,7 +579,7 @@ static void reserve_inodes(ext2_filsys fs) static void zap_sector(ext2_filsys fs, int sect, int nsect) { char *buf; - const char *fmt = "could not %s %d"; + char *fmt = "could not %s %d"; int retval; unsigned int *magic; @@ -606,7 +611,7 @@ static void create_journal_dev(ext2_filsys fs) struct progress_struct progress; errcode_t retval; char *buf; - const char *fmt = "%s journal superblock"; + char *fmt = "%s journal superblock"; blk_t blk; int count; @@ -1206,8 +1211,8 @@ static void mke2fs_clean_up(void) if (ENABLE_FEATURE_CLEAN_UP && journal_device) free(journal_device); } -int mkfs_ext2_main (int argc, char **argv); -int mkfs_ext2_main (int argc, char **argv) +int mke2fs_main (int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; +int mke2fs_main (int argc, char **argv) { errcode_t retval; ext2_filsys fs; @@ -1250,7 +1255,7 @@ int mkfs_ext2_main (int argc, char **argv) * Initialize the directory index variables */ fs->super->s_def_hash_version = EXT2_HASH_TEA; - generate_uuid((uint8_t *) fs->super->s_hash_seed); + generate_uuid((unsigned char *) fs->super->s_hash_seed); /* * Add "jitter" to the superblock's check interval so that we -- 2.11.4.GIT