Console only boot option

Anthony Jenkins Scoobi_doo at yahoo.com
Thu Sep 1 15:25:25 UTC 2016


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

-- 
Anthony Jenkins




More information about the freebsd-x11 mailing list