Thanks for looking into this Andrew, Andrew Donnellan <andrew.donnel...@au1.ibm.com> writes:
> Oh good, someone else has finally picked this up and sent a kernel > patch, I did the skiboot half and then neglected to make it useful (I > sent an RFC at https://patchwork.ozlabs.org/patch/697604/ but never > followed up on it... this approach seems more usable, I think). Thanks for pointing that out. I wasnt aware of this patch. > When you say "the reboot command" - is this behaviour of passing the > argument common to all the important init systems/reboot utils? What's > the correct systemd way to do it? Mostly Yes, On systemd the reboot command is just a symlink to systemctl binary that checks argv[0] and maintains the a backward compatible behaviour. The more systemd specific command 'systemctl reboot full' will also do the same thing. So this patch should work on systemd. Looking at 'upstart' I see support for adding an arg to the reboot command since revision https://bazaar.launchpad.net/~upstart-devel/upstart/trunk/revision/1432.3.1 . So upstart should also be supported. I dont see support for sending an arg in 'SysVinit' halt command yet. However this patch wont break the halt command. Just that SysVinit systems will continue to use fast-reboot like today. Though theorectially with this patch a SysVinit user can write a tool to issue reboot syscall with cmd == LINUX_REBOOT_CMD_RESTART2 and arg == "full". >> while (rc == OPAL_BUSY || rc == OPAL_BUSY_EVENT) { >> - rc = opal_cec_reboot(); >> + >> + /* See if we need to do a full IPL reboot */ >> + if (cmd && strcmp(cmd, "full") == 0) >> + rc = opal_cec_reboot2(OPAL_REBOOT_FULL_IPL, NULL); > > You might want to check for OPAL_UNSUPPORTED here just in case we're > running on ancient firmware. Good idea, will fix this in v2. -- Vaibhav Jain <vaib...@linux.vnet.ibm.com> Linux Technology Center, IBM India Pvt. Ltd.