Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from DistUtilsExtra.command.clean_i18n import clean_i18n

prefix = sys.prefix
__VERSION__ = '0.1'
__VERSION__ = '0.3'
PROGRAM_VERSION = __VERSION__


Expand Down Expand Up @@ -142,7 +142,8 @@ def run(self):
data_files = [
(f'{prefix}/lib/setup-station', ['src/ghostbsd-style.css']),
(f'{prefix}/lib/setup-station/image', lib_setup_station_image),
(f'{prefix}/share/applications', ['src/setup-station.desktop'])
(f'{prefix}/share/applications', ['src/setup-station.desktop']),
(f'{prefix}/etc/rc.d', ['src/initial_setup'])
Comment thread
ericbsd marked this conversation as resolved.
]

# Add locale files if they exist
Expand Down
12 changes: 4 additions & 8 deletions setup_station/setup_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ def setup_system(progress_bar: Gtk.ProgressBar) -> None:
from setup_station.add_admin import AddAdminUser
from setup_station.system_calls import (
enable_lightdm,
remove_ghostbsd_autologin,
start_lightdm
remove_ghostbsd_autologin
)

# Step 0/6: Setting system language
Expand Down Expand Up @@ -77,7 +76,7 @@ def setup_system(progress_bar: Gtk.ProgressBar) -> None:
GLib.idle_add(update_progress, progress_bar, 1, get_text("Setup complete!"))
sleep(1)

# Update label text before starting lightdm
# Update label text before exiting
def update_label():
SetupWindow.slide_text.set_markup(
get_text("Configuration complete.") +
Expand All @@ -88,11 +87,8 @@ def update_label():
GLib.idle_add(update_label)
sleep(2)

# Start lightdm and exit
start_lightdm()

import sys
sys.exit(0)
# Quit GTK main loop - X will exit and rc.d service will continue boot to lightdm
GLib.idle_add(Gtk.main_quit)


class SetupWindow:
Expand Down
36 changes: 36 additions & 0 deletions src/initial_setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/sh
#
# PROVIDE: initial_setup
# REQUIRE: LOGIN FILESYSTEMS
# BEFORE: lightdm
# KEYWORD: shutdown

. /etc/rc.subr

name="initial_setup"
rcvar="${name}_enable"
start_cmd="${name}_start"
stop_cmd=":"

initial_setup_start()
{
# Create .xinitrc for root to run setup
cat > /root/.xinitrc <<'EOF'
exec marco &
exec feh --bg-fill /usr/local/share/backgrounds/ghostbsd/blue-layered-stripes.jpg &
exec setup-station-init
EOF
chmod 755 /root/.xinitrc

# Start X as root - this will block until setup-station-init exits
su -l root -c "startx -- :0 vt09"

# Cleanup
rm -f /root/.xinitrc

# Disable this service for future boots
sysrc initial_setup_enable=NO
}

load_rc_config $name
run_rc_command "$1"