summaryrefslogtreecommitdiffstats
path: root/fastboot/engine.c
diff options
context:
space:
mode:
Diffstat (limited to 'fastboot/engine.c')
-rw-r--r--fastboot/engine.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fastboot/engine.c b/fastboot/engine.c
index 8d46991..7a55260 100644
--- a/fastboot/engine.c
+++ b/fastboot/engine.c
@@ -29,7 +29,6 @@
#include "fastboot.h"
#include "make_ext4fs.h"
-#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
@@ -46,6 +45,8 @@
#include <sys/mman.h>
#endif
+extern struct fs_info info;
+
#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
double now()
@@ -301,7 +302,10 @@ void generate_ext4_image(struct image_data *image)
#else
fd = fileno(tmpfile());
#endif
- make_ext4fs_sparse_fd(fd, image->partition_size, NULL, NULL);
+ /* reset ext4fs info so we can be called multiple times */
+ reset_ext4fs_info();
+ info.len = image->partition_size;
+ make_ext4fs_internal(fd, NULL, NULL, NULL, 0, 1, 0, 0, 0, NULL);
fstat(fd, &st);
image->image_size = st.st_size;