OSDN Git Service

Merge tag 'android-8.1.0_r48' into oreo-x86
[android-x86/system-extras.git] / ext4_utils / make_ext4fs_main.c
index 323a445..77930cd 100644 (file)
@@ -30,7 +30,7 @@
 #include <private/canned_fs_config.h>
 #endif
 
-#ifndef USE_MINGW
+#ifndef _WIN32
 #include <selinux/selinux.h>
 #include <selinux/label.h>
 #if !defined(HOST)
 struct selabel_handle;
 #endif
 
-#include "make_ext4fs.h"
-#include "ext4_utils.h"
+#include "ext4_utils/ext4_utils.h"
+#include "ext4_utils/make_ext4fs.h"
 
-#ifndef USE_MINGW /* O_BINARY is windows-specific flag */
+#ifndef _WIN32 /* O_BINARY is windows-specific flag */
 #define O_BINARY 0
 #endif
 
@@ -54,6 +54,7 @@ static void usage(char *path)
 {
        fprintf(stderr, "%s [ -l <len> ] [ -j <journal size> ] [ -b <block_size> ]\n", basename(path));
        fprintf(stderr, "    [ -g <blocks per group> ] [ -i <inodes> ] [ -I <inode size> ]\n");
+       fprintf(stderr, "    [ -e <flash erase block size> ] [ -o <flash logical block size> ]\n");
        fprintf(stderr, "    [ -L <label> ] [ -f ] [ -a <android mountpoint> ] [ -u ]\n");
        fprintf(stderr, "    [ -S file_contexts ] [ -C fs_config ] [ -T timestamp ]\n");
        fprintf(stderr, "    [ -z | -s ] [ -w ] [ -c ] [ -J ] [ -v ] [ -B <block_list_file> ]\n");
@@ -83,11 +84,11 @@ int main(int argc, char **argv)
        FILE* block_list_file = NULL;
        FILE* base_alloc_file_in = NULL;
        FILE* base_alloc_file_out = NULL;
-#ifndef USE_MINGW
+#ifndef _WIN32
        struct selinux_opt seopts[] = { { SELABEL_OPT_PATH, "" } };
 #endif
 
-       while ((opt = getopt(argc, argv, "l:j:b:g:i:I:L:a:S:T:C:B:d:D:fwzJsctvu")) != -1) {
+       while ((opt = getopt(argc, argv, "l:j:b:g:i:I:e:o:L:a:S:T:C:B:d:D:fwzJsctvu")) != -1) {
                switch (opt) {
                case 'l':
                        info.len = parse_num(optarg);
@@ -107,6 +108,12 @@ int main(int argc, char **argv)
                case 'I':
                        info.inode_size = parse_num(optarg);
                        break;
+               case 'e':
+                       info.flash_erase_block_size = parse_num(optarg);
+                       break;
+               case 'o':
+                       info.flash_logical_block_size = parse_num(optarg);
+                       break;
                case 'L':
                        info.label = optarg;
                        break;
@@ -144,7 +151,7 @@ int main(int argc, char **argv)
                        fprintf(stderr, "Warning: -t (initialize inode tables) is deprecated\n");
                        break;
                case 'S':
-#ifndef USE_MINGW
+#ifndef _WIN32
                        seopts[0].value = optarg;
                        sehnd = selabel_open(SELABEL_CTX_FILE, seopts, 1);
                        if (!sehnd) {