From: "Walter Dnes" <waltdnes@waltdnes.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] Switchup-mode and boottime selector? Was: eselect init
Date: Mon, 27 May 2013 18:40:21 -0400 [thread overview]
Message-ID: <20130527224021.GA18963@waltdnes.org> (raw)
In-Reply-To: <pan$2aa45$493ce161$b9651310$2d048d7b@cox.net>
On Mon, May 27, 2013 at 10:36:41AM +0000, Duncan wrote
> Here's an idea I've not seen proposed yet.
>
> Make the wrapper function something like a cross between a simple
> bootloader and traditional single-user-mode.
>
> Normal mode, like the bootloader for many users, would be a default
> choice with (configurable) either a timeout of a couple seconds, or (say
> shift) key-held-down detection, thus no boot delay as if the key isn't
> down at the moment of detection, boot proceeds using the existing config.
>
> In the event of an init switchup, the user either sets an option before
> shutdown (much like the run-once defaults of grub, etc, set pre-
> shutdown), or selects switchup mode with the appropriate boot-time
> trigger (using the above mentioned timeout or key-down sensing).
That is still adding unnecessary complexity to the systems, and an
additional possible point of failure.
> The special switchup mode would then operate much like single-user in
> terms of available functionality and the fact that it's a special mode
> used for system maintenance, but would (normally, with a drop-to-shell
> option as well) be rather more guided, presumably using a menu, again
> much like a bootloader, except that it's PID-1 instead of pre-kernel.
What does this accomplish that could not be accomplished by...
* placing a switcher script in /sbin
* booting to single-user mode, and running the switcher script
> Critical point #1 is that much like single-user mode, switchup mode
> would NOT run normally, but would be specifically selected, with
> either a reboot or simply starting the new init system at switchup
> mode exit.
It waddles like single-user mode
It quacks like single-user mode
It flies like single-user mode
It *IS* single-user mode
Why bother re-inventing the wheel. Use single-user mode, already.
> Critical point #2 is that the actual normal-mode wrapper would be very
> small both in terms of boot-time and code, thus both easy to debug, and
> not increasing boot time by much at all, particularly in key-down-
> detection mode where there'd be no timeout delay to tick down. A small
> binary that simply either runs the timout or detects key-down, before
> execing the normal init, is all that would run in a normal bootup. The
> complex functionality would only be invoked if switchup mode is chosen,
> as entirely separate functionality execed place of the normal init it
> would have otherwise execed.
>
> Meanwhile, switchup mode (again, a separate binary execed only if chosen
> from the tiny one designed to run inline at each boot) would have a menu
> with options to invoke scripts for each of the init-system choices
> offered, and a further fall-back to shell option.
>
> Each init-system package would then depend (perhaps conditionally based
> on an init-switcher USE flag) on the init-switcher package, and would
> ship one gentoo specific file, the switcher script, thus putting each
> switcher script under the control of the gentoo maintainers for that init-
> system package, who could set it up to be as simple or as complex as
> necessary for their init system. Those who needed a rw root to switch
> out various files could arrange for their switcher script to handle that,
> while those who could do without, possibly handling things later with
> their own native init-service, could do without the rw root bit.
> Similarly, switchup mode exit-time behavior, presumably either simply
> triggering a reboot, or starting the selected init-system directly, would
> be entirely under the control of the individual init-system package
> maintainers, via the switch-script they maintain.
I repeat, all this can be handled in single-user mode right now.
> As a first bonus, even people who aren't interested in more than one init-
> system might find setting the init-switcher USE flag useful, especially
> on EFI systems, since it would give them the advantages of switchup mode,
> namely a drop to shell option as yet another alternative to single user
> mode,
Oh boy... a second single-user mode.
> AND perhaps even MORE importantly, access to a more or less automated
> init-system restore option, triggered via selection of the same
> switcher script that would otherwise be run to switch between init-
> systems. Again, the contents of that init-system-specific switcher-
> script would be entirely under the control of the gentoo maintainers
> for that package, so they could do whatever fancy working-condition
> checks and restores from backup that they wanted.
What you're talking about is rescue-CD functionality. I don't know if
it's possible, but it would be very nice as a standalone rescue CD
(actually USB stick nowadays). If so, I would much rather prefer it on
as rescue CD/USB-stick than as a boot option. If a system is really
screwed up, you can't even assume that it'll boot to single-mode from
the hard drive.
> As a second bonus, switchup mode would be extremely flexible and
> extensible via these scripts, and I'd envision people writing extension
> scripts for all sorts of additional functionality. Backups while the
> system is quiesced? Hook for boot-chart and similar modes? A fast-boot
> special media-player mode? Something else exotic in mind? No problem!
> Hack up a special purpose switchup-mode script for it, and "the world's
> your oyster!"
I think you've just re-invented the bootloader (lilo/grub). It can
boot Gentoo, Fedora, BSD, any special-purpose kernel you wish, and even
Windows 7 for that matter.
--
Walter Dnes <waltdnes@waltdnes.org>
I don't run "desktop environments"; I run useful applications
next prev parent reply other threads:[~2013-05-27 22:40 UTC|newest]
Thread overview: 139+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-25 9:54 [gentoo-dev] eselect init Luca Barbato
2013-05-25 10:25 ` Peter Stuge
2013-05-25 11:57 ` Tom Wijsman
2013-05-26 1:52 ` Walter Dnes
2013-05-26 8:50 ` Tom Wijsman
2013-05-26 2:02 ` Peter Stuge
2013-05-26 8:56 ` Tom Wijsman
2013-05-25 19:08 ` Matthew Thode
2013-05-26 14:13 ` Ian Stakenvicius
2013-05-26 23:54 ` Luca Barbato
2013-05-25 11:13 ` Pacho Ramos
2013-05-25 12:03 ` Tom Wijsman
2013-05-25 12:25 ` Pacho Ramos
2013-05-25 15:42 ` Luca Barbato
2013-05-25 11:29 ` Sergei Trofimovich
2013-05-25 12:12 ` Tom Wijsman
2013-05-25 13:15 ` Luca Barbato
2013-05-25 17:35 ` Sergei Trofimovich
2013-05-25 19:49 ` Chí-Thanh Christopher Nguyễn
2013-05-25 12:13 ` hasufell
2013-05-25 15:51 ` Luca Barbato
2013-05-25 13:38 ` Tom Wijsman
2013-05-25 19:09 ` J. Roeleveld
2013-05-25 19:55 ` Tom Wijsman
2013-05-25 20:07 ` Alex Xu
2013-05-25 20:59 ` Tom Wijsman
2013-05-26 12:59 ` J. Roeleveld
2013-05-26 13:58 ` Tom Wijsman
2013-05-26 14:54 ` Ian Stakenvicius
2013-05-26 13:15 ` Michał Górny
2013-05-26 14:07 ` Tom Wijsman
2013-05-26 14:44 ` Rich Freeman
2013-05-26 6:43 ` Michał Górny
2013-05-26 8:58 ` Robert David
2013-05-26 9:20 ` Michał Górny
2013-05-26 9:32 ` Robert David
2013-05-26 9:45 ` Tom Wijsman
2013-05-26 10:09 ` Michał Górny
2013-05-26 11:45 ` Tom Wijsman
2013-05-26 12:01 ` Michał Górny
2013-05-26 9:21 ` Tom Wijsman
2013-05-26 10:01 ` Robert David
2013-05-26 10:11 ` Rich Freeman
2013-05-26 10:18 ` Chí-Thanh Christopher Nguyễn
2013-05-26 11:28 ` hasufell
2013-05-26 12:10 ` Tom Wijsman
2013-05-26 9:55 ` Luca Barbato
2013-05-26 10:39 ` Tom Wijsman
2013-05-26 10:57 ` Michał Górny
2013-05-26 11:40 ` Luca Barbato
2013-05-26 12:08 ` Michał Górny
2013-05-26 12:24 ` Luca Barbato
2013-05-26 14:58 ` Ian Stakenvicius
2013-05-27 10:36 ` [gentoo-dev] Switchup-mode and boottime selector? Was: " Duncan
2013-05-27 20:26 ` Alex Xu
2013-05-27 22:40 ` Walter Dnes [this message]
2013-05-28 9:56 ` [gentoo-dev] " Duncan
2013-05-28 11:56 ` Tom Wijsman
2013-05-29 0:36 ` Duncan
2013-05-29 8:52 ` Tom Wijsman
2013-05-29 18:15 ` Walter Dnes
2013-05-29 19:56 ` Tom Wijsman
2013-05-29 20:55 ` William Hubbs
2013-05-30 0:06 ` Tom Wijsman
2013-05-30 0:22 ` William Hubbs
2013-05-30 1:36 ` Duncan
2013-05-30 6:35 ` Tom Wijsman
2013-05-30 20:41 ` William Hubbs
2013-05-30 6:46 ` Ciaran McCreesh
2013-05-30 13:54 ` Ian Stakenvicius
2013-05-31 6:21 ` Ciaran McCreesh
2013-05-30 6:30 ` Luca Barbato
2013-06-22 19:35 ` Markos Chandras
2013-05-30 2:52 ` Walter Dnes
2013-05-30 6:19 ` Tom Wijsman
2013-05-30 6:36 ` Dale
2013-05-30 6:31 ` Ciaran McCreesh
2013-05-28 3:55 ` [gentoo-dev] " Luca Barbato
2013-05-28 4:19 ` Michał Górny
2013-05-28 4:43 ` Luca Barbato
2013-05-28 12:15 ` Ian Stakenvicius
2013-05-28 12:15 ` Ian Stakenvicius
2013-05-26 11:58 ` Tom Wijsman
2013-05-26 14:52 ` Luca Barbato
2013-05-26 15:39 ` Tom Wijsman
2013-05-26 16:41 ` William Hubbs
2013-05-26 16:48 ` William Hubbs
2013-05-26 16:55 ` Michał Górny
2013-05-26 22:58 ` William Hubbs
2013-05-26 23:47 ` Luca Barbato
2013-05-27 23:45 ` [gentoo-dev] Separate boot/root already [WAS: eselect init] Walter Dnes
2013-05-28 15:07 ` Luca Barbato
2013-06-01 9:23 ` [gentoo-dev] Re: eselect init Steven J. Long
2013-06-01 11:43 ` Steven J. Long
2013-06-02 9:15 ` Luca Barbato
2013-06-02 18:20 ` [gentoo-dev] " Steven J. Long
2013-06-02 18:48 ` Fabio Erculiani
2013-06-08 13:37 ` [gentoo-dev] " Steven J. Long
2013-06-02 22:35 ` [gentoo-dev] " Luca Barbato
2013-06-03 0:37 ` Walter Dnes
2013-06-03 0:57 ` Rich Freeman
2013-06-03 7:03 ` Tom Wijsman
2013-06-03 9:42 ` Luca Barbato
2013-06-03 6:19 ` [gentoo-dev] " Duncan
2013-06-03 6:26 ` [gentoo-dev] " Pacho Ramos
2013-06-04 18:55 ` William Hubbs
2013-06-04 19:09 ` Rich Freeman
2013-06-08 13:28 ` [gentoo-dev] " Steven J. Long
2013-06-20 10:16 ` [gentoo-dev] " Fabio Erculiani
2013-06-20 17:10 ` [gentoo-dev] " Steven J. Long
2013-06-20 20:48 ` William Hubbs
2013-06-25 4:53 ` [gentoo-dev] " Steven J. Long
2013-06-20 20:56 ` [gentoo-dev] " William Hubbs
2013-06-21 2:39 ` Michał Górny
2013-06-21 4:16 ` William Hubbs
2013-06-21 10:23 ` Michał Górny
2013-06-21 15:16 ` William Hubbs
2013-06-21 15:23 ` Fabio Erculiani
2013-06-21 16:42 ` William Hubbs
2013-06-22 11:23 ` Jason A. Donenfeld
2013-06-22 11:57 ` hasufell
2013-06-21 19:34 ` Luca Barbato
2013-06-22 1:27 ` Ulrich Mueller
2013-06-22 1:48 ` Michael Weber
2013-06-21 15:29 ` Michał Górny
2013-06-21 16:13 ` Markos Chandras
2013-06-21 16:50 ` William Hubbs
2013-06-21 19:36 ` Luca Barbato
2013-06-21 10:30 ` Michael Weber
2013-06-21 11:19 ` Fabio Erculiani
2013-06-21 11:26 ` Pacho Ramos
2013-06-21 11:50 ` Luca Barbato
2013-06-21 14:36 ` William Hubbs
2013-06-21 15:48 ` Pacho Ramos
2013-06-22 6:59 ` [gentoo-dev] " Duncan
2013-06-22 10:07 ` Pacho Ramos
2013-06-22 11:13 ` Michael Weber
2013-06-22 11:26 ` Rich Freeman
2013-06-22 17:05 ` Luca Barbato
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130527224021.GA18963@waltdnes.org \
--to=waltdnes@waltdnes.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox