linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* Setting reboot type at run time for ARM
@ 2015-03-17 21:44 Arun Ramamurthy
  2015-03-18  0:50 ` Florian Fainelli
  0 siblings, 1 reply; 3+ messages in thread
From: Arun Ramamurthy @ 2015-03-17 21:44 UTC (permalink / raw)
  To: linux-arm-kernel

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?

Arun Ramamurthy

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Setting reboot type at run time for ARM
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Fainelli @ 2015-03-18  0:50 UTC (permalink / raw)
  To: linux-arm-kernel

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?
-- 
Florian

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Setting reboot type at run time for ARM
  2015-03-18  0:50 ` Florian Fainelli
@ 2015-03-18 20:58   ` Arun Ramamurthy
  0 siblings, 0 replies; 3+ messages in thread
From: Arun Ramamurthy @ 2015-03-18 20:58 UTC (permalink / raw)
  To: linux-arm-kernel


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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-03-18 20:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).