Fwd: Console only boot option

Allan Jude allanjude at freebsd.org
Thu Sep 1 18:50:46 UTC 2016


On 2016-09-01 14:46, Colin Percival wrote:
> 
> 
> 
> -------- Forwarded Message --------
> Subject: Console only boot option
> Date: Thu, 1 Sep 2016 11:22:23 -0400
> From: Anthony Jenkins via freebsd-x11 <freebsd-x11 at freebsd.org>
> Reply-To: Anthony Jenkins <Scoobi_doo at yahoo.com>
> To: freebsd-x11 at freebsd.org <freebsd-x11 at freebsd.org>
> 
> I have a patch against base that adds an option "Console" to the Boot
> Options sub-menu to prevent a GUI desktop port from being started:
> 
>     1. Back to Main Menu [Backspace]
>     2. Load System Defaults
> 
>     Boot Options:
>     3. Safe Mode... Off
>     4. Single User. Off
>     5. Verbose..... off
>     6. Console..... off
> 
> 
> When set to "On", a kernel environment variable "boot_console" is set to
> "YES"; else "boot_console" is unset.  A GUI desktop startup script in
> ${LOCALBASE}/etc/rc.d/ should read this variable and, if set, should
> 
>   * Ignore a command to start the GUI
>   * Unset "boot_console" (this allows one to manually start the GUI
>     after initial boot).
> 
> I'm open to suggestions about semantics to make this functionality
> clearer (e.g. "Console..... On" is not intuitive).
> 
> The problem I have is in the GUI startup scripts, which must be modified
> to make this work.  What I *want* is to make a *simple* modification to
> all GUI startup scripts (e.g. ${LOCALBASE}/etc/rc.d/kdm4) such that
> /etc/rc knows what scripts are "GUI startup scripts" and, if
> $boot_console is set, performs the above 2 actions.  Right now, for me
> to make this patch work, I have to add code to my kdm4 startup script to
> do this, which would be ugly to add to every GUI startup script in ports.
> 
> Maybe one of the following would be simple/general enough to work:
> 
>   * Have each GUI startup script declare a variable, e.g. "gui_startup",
>     which /etc/rc reads to determine whether to disable its startup if
>     $boot_console is set.
>   * Have an rc.conf(5) variable "gui_startup_scripts" which holds a list
>     of startup scripts to not execute if $boot_console is set.
>   * Have each GUI startup script REQUIRE (i.e. rcorder(8))
>     "gui_start_check" which fails if $boot_console is set.
> 
> GUI desktop port maintainers would have to modify their respective ports
> to implement option 1 & 3; the user would have to add her desktop to
> /etc/rc.conf for option 2.  I'd implement the guts.
> 
> Other suggestions welcome.
> 
> https://github.com/ScoobiFreeBSD/freebsd/commit/2376fc13627db10a65bcab9d9091cbd8ff049e87
> https://github.com/ScoobiFreeBSD/freebsd/commit/2376fc13627db10a65bcab9d9091cbd8ff049e87.patch
> 

I think I prefer the 3rd option, having a dependant service that is
controlled by the variable from the boot loader. This minimizes the
changes to each port to just a single word added to the metadata.

If the ports people want to decide which method they prefer, I would be
happy to shepherd the changes to the boot loader / menu itself.

-- 
Allan Jude

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 834 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-x11/attachments/20160901/77cdc42b/attachment.sig>


More information about the freebsd-x11 mailing list