From aa8f2f65a030f71506277e2a8d64d83a099e9feb Mon Sep 17 00:00:00 2001 From: Gaelle Nassiet Date: Fri, 24 Jun 2016 11:18:53 +0200 Subject: [PATCH] Fix root_filesystem_config.txt generation The first line returned by awk is empty. In consequence, when fs_config computes its mode it will consider this line as a file (no trailing slash) and affect the default android_files mode which is 0644. The mode for the root directory should be the default android_dirs mode 0755. Add a special case in fs_config to consider empty line as a directory. Change-Id: I9f33f6fcf4be05c31914db898e65c92b0a611518 Signed-off-by: Gaelle Nassiet --- tools/fs_config/fs_config.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/fs_config/fs_config.c b/tools/fs_config/fs_config.c index e79795752..48f300bd8 100644 --- a/tools/fs_config/fs_config.c +++ b/tools/fs_config/fs_config.c @@ -105,6 +105,9 @@ int main(int argc, char** argv) { switch (buffer[i]) { case '\n': buffer[i-is_dir] = '\0'; + if (i == 0) { + is_dir = 1; // empty line is considered as root directory + } i = 1025; break; case '/':