public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arun Ramamurthy <arun.ramamurthy@broadcom.com>
To: Florian Fainelli <f.fainelli@gmail.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>
Cc: Russell King <linux@arm.linux.org.uk>,
	Arnd Bergmann <arnd@arndb.de>,
	Scott Branden <sbranden@broadcom.com>,
	Ray Jui <rjui@broadcom.com>,
	Jonathan Richardson <jonathar@broadcom.com>,
	"bcm-kernel-feedback-list@broadcom.com" 
	<bcm-kernel-feedback-list@broadcom.com>,
	Olof Johansson <olof@lixom.net>,
	Anatol Pomazau <anatol@google.com>,
	Dmitry Torokhov <dtor@google.com>
Subject: Re: Setting reboot type at run time for ARM
Date: Wed, 18 Mar 2015 13:58:54 -0700	[thread overview]
Message-ID: <5509E70E.7060907@broadcom.com> (raw)
In-Reply-To: <5508CBD0.5060508@gmail.com>


On 15-03-17 05:50 PM, Florian Fainelli wrote:
> On 17/03/15 14:44, Arun Ramamurthy wrote:
>> Hello
>>
>> I would like to specify a reset type just before issuing the reboot
>> command in the kernel. I know the kernel command line parameter can be
>> set as "reboot=w" to indicate warm reset but I want to be able to decide
>> this at run time before issuing a reboot command. What would be the best
>> way to implement this? Modify the reboot command
>> to accept a parameter or is there a standard hook I can use?
>
> If you use the reboot(2) system call you can already specify a large
> number of options, for options that are currently not supported by
> coreutils' reboot or busybox's reboot, you could probably provide a
> shell script wrapper which calls into either your own reboot
> implementation or the regular one, would that work?
>
Thanks Florian. After looking at the sys call documentation, i can see 
that it passes an argument to the kernel_restart function if I use 
LINUX_REBOOT_CMD_RESTART2 as the cmd. However as you mentioned the 
coreutils reboot or busybox's reboot do not support these options so I 
will write a shell script to wrap the system call.


      reply	other threads:[~2015-03-18 20:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-17 21:44 Setting reboot type at run time for ARM Arun Ramamurthy
2015-03-18  0:50 ` Florian Fainelli
2015-03-18 20:58   ` Arun Ramamurthy [this message]

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=5509E70E.7060907@broadcom.com \
    --to=arun.ramamurthy@broadcom.com \
    --cc=anatol@google.com \
    --cc=arnd@arndb.de \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=dtor@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=jonathar@broadcom.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=olof@lixom.net \
    --cc=rjui@broadcom.com \
    --cc=sbranden@broadcom.com \
    /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