From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-x243.google.com (mail-lf0-x243.google.com [IPv6:2a00:1450:4010:c07::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C1F491A1E8B for ; Wed, 12 Oct 2016 23:20:07 -0700 (PDT) Received: by mail-lf0-x243.google.com with SMTP id x79so10859803lff.2 for ; Wed, 12 Oct 2016 23:20:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=L0CZ9l8bofQA0zH/f/+kYKqmhJ//A5qxZuZaE/6g8OA=; b=exXHKUf+C4AlU7h4QMp1aaw/64BQVKK7hn58MjqpsnHt6wOoF5OsDzyS0m69ZSeUgP TVTuXXNSKdu59hCoK7vwn0+SEU7vEajwlnvLUZ4dphTpM8ziijFengTbjb4Fw9Rm293h LjgmvIx62u6jP/157MJFVPb6a2xMJHBfgdw87UUSjTl7lLeVf/cQ6Rj9tCnKNdeLVGpT uzcUwW+h/2GkHRH9y+SrAuzuS3SSKEZyBIveepmzbi0vHcbi+9BMJdAOoD60PPdWeEfU qhDUIq3aogtUzza2brSBkJ5eX3fqxeSG9PHxBikRWHNfTYXpcH0VrJ/lFPSecumF1ml8 5YOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=L0CZ9l8bofQA0zH/f/+kYKqmhJ//A5qxZuZaE/6g8OA=; b=GbTwumlsy/0uCUjxMLtRq5CKrKs5Qk++7NyQGR8YEv91cFJl6tkRKEhcK+aEJl1a1C bbutP2/VK+QHnF6tS8YBSym0q66NoRTEomqZaRYSh5cS7rjUPQBS9I+PyU+wLf7RZeza 0Q3HdnnCQU/ZFy4lHlbvNh6UW7eeSaKpZrtrYWOpd+Dj6mSx9+dOmDrz/2IL8IQl0CYB 0byw0rMXiHLsyrzwqIcLMpxzGUpMpLJ4lGdJZWwiYhMks4L/TwidnGegSazsRqwedGs+ Tu7+GKksIPH0tMz2HBl/sphP9UOrfONIqp56ktLydLhXglCXXWmaaWyEW6HQEAsie/wq wOoA== X-Gm-Message-State: AA6/9RnJNAZJNlXgX0yJPUcAOVfG7H8wXwZRHXiEC14WuCbW0H8NYtoeSic1YRpSSGap+96osGvyWeb20b6CFQ== X-Received: by 10.194.44.226 with SMTP id h2mr5791627wjm.113.1476339605834; Wed, 12 Oct 2016 23:20:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.65.135 with HTTP; Wed, 12 Oct 2016 23:20:05 -0700 (PDT) In-Reply-To: References: From: Michael Zimmermann Date: Thu, 13 Oct 2016 08:20:05 +0200 Message-ID: To: GN Keshava Cc: Laszlo Ersek , edk2-devel-01 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 Subject: Re: Format a volume in UEFI (or delete all files) X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 06:20:08 -0000 Content-Type: text/plain; charset=UTF-8 > Is it possible to run RM (or any shell command) from my C application code? > Something like "System()" in Linux? Whether we can use LoadImage for this > purpose? If you application was started from the Shell you can do that using ShellExecute from 'Library/ShellLib.h'. Example: EFI_STATUS Status; EFI_STATUS CommandStatus; Status = ShellExecute (&gImageHandle, L"memmap", FALSE, NULL, &CommandStatus); If you were not started by the Shell you can run a new Shell and tell it to run your command and exit afterwards using these LoadImage arguments: -nomap -nostartup -noversion -_exit [CMD OR FILE] Thanks Michael On Thu, Oct 13, 2016 at 3:29 AM, GN Keshava wrote: > Thanks Laszlo. > > Is it possible to run RM (or any shell command) from my C application code? > Something like "System()" in Linux? Whether we can use LoadImage for this > purpose? > > Thanks again. > Regards, > Keshava > > On Wed 12 Oct, 2016 11:10 pm Laszlo Ersek, wrote: > > > On 10/12/16 19:34, GN Keshava wrote: > > > Thanks Laszlo, I'll check it out. > > > > > > I think I need to combine the LS implementation and RM implementation, > > > isn't it? So there is no "format this volume" function or command > > > exists, right? > > > > I'm unaware of any "format" command. And, I think it's enough if you > > look at RM (LS should be unnecessary); RM already contains the recursion. > > > > Laszlo > > > > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel >