Add install_station service and related configuration updates

This commit is contained in:
ericbsd
2025-12-21 20:40:28 -04:00
parent 917823091e
commit 6035e6355f
3 changed files with 44 additions and 1 deletions
+6
View File
@@ -156,5 +156,11 @@ class Configuration:
f.write("runCommand=pw userdel -n ghostbsd -r\n")
f.write("runCommand=sed -i '' 's/ghostbsd/root/g' /etc/gettytab\n")
f.write("runCommand=sed -i '' 's/ghostbsd/root/g' /etc/ttys\n")
f.write("runCommand=echo '# WARNING: Do NOT set initial_setup_enable=YES manually!' >> /etc/rc.conf\n")
f.write("runCommand=echo '# This service is ONLY for first boot after installation.' >> /etc/rc.conf\n")
f.write("runCommand=echo '# It will automatically disable itself after running.' >> /etc/rc.conf\n")
f.write("runCommand=sysrc initial_setup_enable=YES\n")
f.write("runCommand=sed -i '' '/^autologin-user=/d' /usr/local/etc/lightdm/lightdm.conf\n")
f.write("runCommand=sed -i '' '/^autologin-session=/d' /usr/local/etc/lightdm/lightdm.conf\n")
except IOError as e:
raise IOError(f"Failed to write configuration file: {e}") from e
+2 -1
View File
@@ -157,7 +157,8 @@ lib_install_station_backend_query = [
data_files = [
(f'{prefix}/lib/install-station', ['src/ghostbsd-style.css']),
(f'{prefix}/lib/install-station/backend-query', lib_install_station_backend_query),
(f'{prefix}/lib/install-station/image', lib_install_station_image)
(f'{prefix}/lib/install-station/image', lib_install_station_image),
(f'{prefix}/etc/rc.d', ['src/install_station'])
]
data_files.extend(data_file_list(f'{prefix}/share/locale', 'build/mo'))
+36
View File
@@ -0,0 +1,36 @@
#!/bin/sh
#
# PROVIDE: install_station
# REQUIRE: LOGIN FILESYSTEMS
# BEFORE: lightdm
# KEYWORD: shutdown
. /etc/rc.subr
name="install_station"
rcvar="${name}_enable"
start_cmd="${name}_start"
stop_cmd=":"
install_station_start()
{
# Create .xinitrc for root to run installer
cat > /root/.xinitrc <<'EOF'
exec marco &
exec feh --bg-fill /usr/local/share/backgrounds/ghostbsd/blue-layered-stripes.jpg &
exec install-station
EOF
chmod 755 /root/.xinitrc
# Start X as root - this will block until install-station exits
su -l root -c "startx -- :0 vt09"
# Cleanup
rm -f /root/.xinitrc
# Disable this service for future boots
sysrc install_station_enable=NO
}
load_rc_config $name
run_rc_command "$1"