diff --git a/build.gradle b/build.gradle index ff71413..9ccd272 100644 --- a/build.gradle +++ b/build.gradle @@ -23,6 +23,7 @@ model { components { mkbootfs(NativeExecutableSpec) { binaries.all { + // cCompiler.define 'CFIG_NO_FIX_STAT' } } } diff --git a/src/mkbootfs/c/fs_config.c b/src/mkbootfs/c/fs_config.c index 547e873..2163bf6 100644 --- a/src/mkbootfs/c/fs_config.c +++ b/src/mkbootfs/c/fs_config.c @@ -33,6 +33,8 @@ #include #include +#ifndef CFIG_NO_FIX_STAT + #include #include @@ -293,3 +295,4 @@ ssize_t fs_config_generate(char *buffer, size_t length, const struct fs_path_con strcpy(p->prefix, pc->prefix); return len; } +#endif diff --git a/src/mkbootfs/c/mkbootfs.c b/src/mkbootfs/c/mkbootfs.c index 0e35323..7e56de8 100644 --- a/src/mkbootfs/c/mkbootfs.c +++ b/src/mkbootfs/c/mkbootfs.c @@ -12,7 +12,9 @@ #include #include +#ifndef CFIG_NO_FIX_STAT #include +#endif /* NOTES ** @@ -54,6 +56,7 @@ static char *target_out_path = NULL; static int verbose = 0; static int total_size = 0; +#ifndef CFIG_NO_FIX_STAT static void fix_stat(const char *path, struct stat *s) { uint64_t capabilities; @@ -85,6 +88,7 @@ static void fix_stat(const char *path, struct stat *s) s->st_mode = (typeof(s->st_mode)) st_mode; } } +#endif static void _eject(struct stat *s, char *out, int olen, char *data, unsigned datasize) { @@ -98,7 +102,9 @@ static void _eject(struct stat *s, char *out, int olen, char *data, unsigned dat putchar(0); } +#ifndef CFIG_NO_FIX_STAT fix_stat(out, s); +#endif // fprintf(stderr, "_eject %s: mode=0%o\n", out, s->st_mode); printf("%06x%08x%08x%08x%08x%08x%08x"