From patchwork Wed Feb 23 09:45:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Huang X-Patchwork-Id: 199 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:40:49 -0000 Delivered-To: patches@linaro.org Received: by 10.224.19.208 with SMTP id c16cs279223qab; Wed, 23 Feb 2011 01:45:08 -0800 (PST) Received: by 10.151.63.24 with SMTP id q24mr4731678ybk.385.1298454307786; Wed, 23 Feb 2011 01:45:07 -0800 (PST) Received: from mail-gx0-f178.google.com (mail-gx0-f178.google.com [209.85.161.178]) by mx.google.com with ESMTPS id v10si16906758yba.36.2011.02.23.01.45.06 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 23 Feb 2011 01:45:06 -0800 (PST) Received-SPF: neutral (google.com: 209.85.161.178 is neither permitted nor denied by best guess record for domain of jim.huang@linaro.org) client-ip=209.85.161.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.161.178 is neither permitted nor denied by best guess record for domain of jim.huang@linaro.org) smtp.mail=jim.huang@linaro.org Received: by gxk25 with SMTP id 25so14739gxk.37 for ; Wed, 23 Feb 2011 01:45:06 -0800 (PST) MIME-Version: 1.0 Received: by 10.236.95.180 with SMTP id p40mr840542yhf.73.1298454306316; Wed, 23 Feb 2011 01:45:06 -0800 (PST) Received: by 10.147.172.11 with HTTP; Wed, 23 Feb 2011 01:45:06 -0800 (PST) Date: Wed, 23 Feb 2011 17:45:06 +0800 Message-ID: Subject: [PATCH android/system/core] init: support mmc device mount (by partition) From: Jim Huang To: linaro-dev@lists.linaro.org Cc: patches@linaro.org init.rc usage example: mount vfat mmc@blk1p3 /mnt/sdcard2 --- init/builtins.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/init/builtins.c b/init/builtins.c index e0ccf9f..32d9d7f 100644 --- a/init/builtins.c +++ b/init/builtins.c @@ -356,6 +356,16 @@ int do_mount(int nargs, char **args) close(fd); ERROR("out of loopback devices"); return -1; + } else if (!strncmp(source, "mmc@blk", 7)) { + sprintf(tmp, "/dev/block/mmcblk%s", source + 7); + + if (wait) + wait_for_file(tmp, COMMAND_RETRY_TIMEOUT); + if (mount(tmp, target, system, flags, options) < 0) { + return -1; + } + + return 0; } else { if (wait) wait_for_file(source, COMMAND_RETRY_TIMEOUT);