public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Sandeep Patil <sspatil@google.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 6/6] lib: mkfs: use 'mke2fs' on android systems for formatting filesystems
Date: Wed,  8 Nov 2017 16:34:38 -0800	[thread overview]
Message-ID: <20171109003438.130802-7-sspatil@google.com> (raw)
In-Reply-To: <20171109003438.130802-1-sspatil@google.com>

Android does not have mkfs.extN symlinks and only extN filesystems
images can be created on the device. So, make sure we use 'mke2fs -t
<fs_type>' when being built for Android and filter out any non-ext
filesystem type requests from tst_mkfs_() when built for Android.

syscalls/mmap16, syscalls/rename11 are the tests the tests currently
known to start working after this change on Android systems

Signed-off-by: Sandeep Patil <sspatil@google.com>
---
 lib/tst_mkfs.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/lib/tst_mkfs.c b/lib/tst_mkfs.c
index 7385a939f..c46d07044 100644
--- a/lib/tst_mkfs.c
+++ b/lib/tst_mkfs.c
@@ -43,7 +43,23 @@ void tst_mkfs_(const char *file, const int lineno, void (cleanup_fn)(void),
 		return;
 	}
 
+#ifdef __ANDROID__
+	if (strncmp(fs_type, "ext", 3)) {
+		tst_brkm(TBROK, cleanup_fn,
+			 "%s:%d: \'%s\' fs_type not supported", file, lineno, fs_type);
+		return;
+	}
+	strcpy(mkfs, "mke2fs");
+
+	/* insert '-t <fs_type> in arguments here */
+	argv[pos++] = "-t";
+	strcat(fs_opts_str, "-t ");
+	argv[pos++] = fs_type;
+	strcat(fs_opts_str, fs_type);
+	strcat(fs_opts_str, " ");
+#else
 	snprintf(mkfs, sizeof(mkfs), "mkfs.%s", fs_type);
+#endif
 
 	if (fs_opts) {
 		for (i = 0; fs_opts[i]; i++) {
-- 
2.15.0.448.gf294e3d99a-goog


  parent reply	other threads:[~2017-11-09  0:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-09  0:34 [LTP] [PATCH 0/6] Miscellaneous fixes for Android systems Sandeep Patil
2017-11-09  0:34 ` [LTP] [PATCH v2 1/6] syscalls/cma: Make process_vm_{readv, writev} tests bionic friendly Sandeep Patil
2017-11-10  9:14   ` Jan Stancek
2017-11-09  0:34 ` [LTP] [PATCH 2/6] mm: mallocstress: use safe macros wherever possible Sandeep Patil
2017-11-10  9:41   ` Jan Stancek
2017-11-09  0:34 ` [LTP] [PATCH 3/6] mm: mallocstress: use futexes instead of SysV semaphores Sandeep Patil
2017-11-09  0:34 ` [LTP] [PATCH v2 4/6] direct_io: diotest4: use getpagesize() for mmap if shm header is absent Sandeep Patil
2017-11-10  9:54   ` Jan Stancek
2017-11-09  0:34 ` [LTP] [PATCH 5/6] syscalls/mkdir03: convert to new API and use .needsrofs for EROFS check Sandeep Patil
2017-11-10 11:21   ` Jan Stancek
2017-11-09  0:34 ` Sandeep Patil [this message]
2017-11-10 14:48   ` [LTP] [PATCH 6/6] lib: mkfs: use 'mke2fs' on android systems for formatting filesystems Jan Stancek
2017-11-10 19:23     ` Sandeep Patil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171109003438.130802-7-sspatil@google.com \
    --to=sspatil@google.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox