Add install_station service and related configuration updates
This commit is contained in:
@@ -156,5 +156,11 @@ class Configuration:
|
|||||||
f.write("runCommand=pw userdel -n ghostbsd -r\n")
|
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/gettytab\n")
|
||||||
f.write("runCommand=sed -i '' 's/ghostbsd/root/g' /etc/ttys\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:
|
except IOError as e:
|
||||||
raise IOError(f"Failed to write configuration file: {e}") from e
|
raise IOError(f"Failed to write configuration file: {e}") from e
|
||||||
|
|||||||
@@ -157,7 +157,8 @@ lib_install_station_backend_query = [
|
|||||||
data_files = [
|
data_files = [
|
||||||
(f'{prefix}/lib/install-station', ['src/ghostbsd-style.css']),
|
(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/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'))
|
data_files.extend(data_file_list(f'{prefix}/share/locale', 'build/mo'))
|
||||||
|
|||||||
Executable
+36
@@ -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"
|
||||||
Reference in New Issue
Block a user