Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Sep 2016 11:22:23 -0400
From:      Anthony Jenkins <Scoobi_doo@yahoo.com>
To:        "freebsd-x11@freebsd.org" <freebsd-x11@freebsd.org>
Subject:   Console only boot option
Message-ID:  <e48d3b7a-f2ac-3d12-56a4-b907a36ac099@yahoo.com>

next in thread | raw e-mail | index | archive | help
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/2376fc13627db10a65bcab9d9=
091cbd8ff049e87
https://github.com/ScoobiFreeBSD/freebsd/commit/2376fc13627db10a65bcab9d9=
091cbd8ff049e87.patch

--=20
Anthony Jenkins





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?e48d3b7a-f2ac-3d12-56a4-b907a36ac099>