From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Wm2JH-0006hr-N7 for mharc-grub-devel@gnu.org; Sun, 18 May 2014 10:43:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38968) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wm2J9-0006hi-1u for grub-devel@gnu.org; Sun, 18 May 2014 10:43:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wm2J1-0008Ft-Hl for grub-devel@gnu.org; Sun, 18 May 2014 10:43:22 -0400 Received: from mail.csclub.uwaterloo.ca ([129.97.134.52]:33851) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wm2J1-0008Fm-7j for grub-devel@gnu.org; Sun, 18 May 2014 10:43:15 -0400 Received: from caffeine.csclub.uwaterloo.ca (caffeine.csclub.uwaterloo.ca [129.97.134.17]) by mail.csclub.uwaterloo.ca (Postfix) with SMTP id 9D0C3337B3 for ; Sun, 18 May 2014 10:43:12 -0400 (EDT) Received: by caffeine.csclub.uwaterloo.ca (sSMTP sendmail emulation); Sun, 18 May 2014 10:43:12 -0400 From: "Lennart Sorensen" Date: Sun, 18 May 2014 10:43:12 -0400 To: The development of GNU GRUB Subject: Re: How to exit from linux kernel and return to then grub? Message-ID: <20140518144312.GJ17765@csclub.uwaterloo.ca> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 129.97.134.52 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 14:43:30 -0000 On Sun, May 18, 2014 at 01:33:15PM +0800, Z C wrote: > If I boot into a linux kernel using a grub command like "linux /vmlinuz; > inirtd /initrd; boot", how do I shutdown linux itself (but do not power off > or reboot the computer hardware) and return back to the grub directly? > > What I meant is something equivalent to the "exit" command in most shells: > If you are within one shell and you enter another shell, then if you want > to quit the second shell and return back to the first shell, just simply > type exit. All env variables and commands you previous typed in the first > shell are completely intact. > > Suppose I am now in the grub shell, and then I boot into a tiny linux > kernel, say, a busybox shell, then what can I do to exit the second shell > (i.e. busybox shell) and return to the first shell (i.e. grub shell)? Of > course I can enter the grub shell again by simply rebooting the hardware, > but this is not what I want. Once linux boots, it does not preserve the boot loader in memory (whyever would it do that?) If you want to invent a way to load grub using kexec so you can switch back to grub fropm a running linux system, well have fun, but why bother? Where is the use? It is so hard to deal with what the state of all the hardware is without doing a reset. -- Len Sorensen