https://redmine.graphics-muse.org/https://redmine.graphics-muse.org/favicon.ico?16278048512019-11-29T17:34:57ZGraphics Muse Issue TrackerPiBox - Bug #724: reboot takes too longhttps://redmine.graphics-muse.org/issues/724?journal_id=26122019-11-29T17:34:57ZHammelmjhammel@graphics-muse.org
<ul></ul><p>There are a couple of things to deal with here.</p>
<a name="Hard-reset-vs-soft-reset"></a>
<h1 >Hard reset vs soft reset<a href="#Hard-reset-vs-soft-reset" class="wiki-anchor">¶</a></h1>
<p>A hard reset is a power cycle. This requires sync'ing writes to disk and then power cycling the system. The Busybox reboot command already does this. It's not clear why this takes so long, however.</p>
<p>A soft reset is a kexec of the kernel/initramfs pair. System sync'ing must be done first. Unmounting of filesystems (other than the overlay) should also be done. Then the kexec is done. Setup for the kexec can happen before any sync'ing or unmounting is done.</p>
Soft resets should use the following sequence:
<ol>
<li>Setup <a href="https://wiki.archlinux.org/index.php/Kexec" class="external">kexec</a></li>
<li>Enable <a href="https://www.kernel.org/doc/html/latest/admin-guide/sysrq.html" class="external">sysrq actions</a> for sync'ing and read-only remounts using sysrq-trigger</li>
<li>Send a SIGTERM to all processes, except for init, using sysrq-trigger</li>
<li>kexec</li>
</ol>
<a name="Reboot-of-Dev-Platform"></a>
<h1 >Reboot of Dev Platform<a href="#Reboot-of-Dev-Platform" class="wiki-anchor">¶</a></h1>
<p>The dev platform only has the reboot command. There is no graphical reboot because we aren't running an app-based system. One option is to move reboot to reset and implement a kexec-based reboot. So reset becomes the hard reset and reboot becomes the soft reset.</p>
<a name="Reboot-of-Media-or-other-app-based-platform"></a>
<h1 >Reboot of Media (or other app-based) platform<a href="#Reboot-of-Media-or-other-app-based-platform" class="wiki-anchor">¶</a></h1>
<p>These can utilize their own wrappers for the hard and soft resets implemented in the dev platform. The default app for the Media system could use the soft reset while the launcher might support a custom key sequence to force a hard reset.</p> PiBox - Bug #724: reboot takes too longhttps://redmine.graphics-muse.org/issues/724?journal_id=26162019-11-30T20:19:38ZHammelmjhammel@graphics-muse.org
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>In Progress</i></li><li><strong>Priority</strong> changed from <i>Immediate</i> to <i>Low</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>20</i></li><li><strong>Severity</strong> changed from <i>04 - Low</i> to <i>05 - Very Low</i></li></ul><p>Uh, well, this appears to be something to put on the back burner for now: <a href="https://www.raspberrypi.org/forums/viewtopic.php?t=233659#p1429863" class="external">kexec appears broken</a>. The real reason is that kexec needs one core running to switch kernels. RPis (2B and later) have 4 cores and can't <em>hotplug</em> them, that is, stop cores at will. <a href="http://lig-membres.imag.fr/duble/software/raspberry-pi-netboot/" class="external">RPi's can't stop the other cores so kexec won't work</a> (scan down to the kexec section for details).</p>
<p>I wrote a script to do the kexec but ran into trouble trying to run it, apparently because kexec isn't supported by RPIs.</p>
<p>There is no need to continue down this path because this is a hardware limitation that can't be overcome by kexec, at least not currently. So I'm moving this to the very bottom of the stack until, perhaps in the future, there is a workaround.</p> PiBox - Bug #724: reboot takes too longhttps://redmine.graphics-muse.org/issues/724?journal_id=27422020-03-23T04:03:27ZHammelmjhammel@graphics-muse.org
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>20</i> to <i>100</i></li></ul><p>This was addressed by RM <a class="issue tracker-1 status-5 priority-6 priority-high2 closed" title="Bug: launcher is missing -f option to reboot (Closed)" href="https://redmine.graphics-muse.org/issues/746">#746</a> - by adding -f to the reboot command. This is kinda hacky but it's a quick hardware reset and we don't worry too much about sync'ing or flushing with current PiBox use cases. If we did, we could wrap this in a small script that did that for us.</p>
<p>Closing issue.</p>