From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932388AbbCRAvM (ORCPT ); Tue, 17 Mar 2015 20:51:12 -0400 Received: from mail-pd0-f172.google.com ([209.85.192.172]:33069 "EHLO mail-pd0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932116AbbCRAvG (ORCPT ); Tue, 17 Mar 2015 20:51:06 -0400 Message-ID: <5508CBD0.5060508@gmail.com> Date: Tue, 17 Mar 2015 17:50:24 -0700 From: Florian Fainelli User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Arun Ramamurthy , Linux Kernel Mailing List , linux-arm-kernel@lists.infradead.org CC: Russell King , Arnd Bergmann , Scott Branden , Ray Jui , Jonathan Richardson , "bcm-kernel-feedback-list@broadcom.com" , Olof Johansson , Anatol Pomazau , Dmitry Torokhov Subject: Re: Setting reboot type at run time for ARM References: <5508A047.7060308@broadcom.com> In-Reply-To: <5508A047.7060308@broadcom.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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