Skip to content
Open
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
1 change: 1 addition & 0 deletions catalyst/targets/livecd_stage2.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class livecd_stage2(StageBase):
"livecd/readme",
"livecd/rm",
"livecd/root_overlay",
"livecd/systemd",
"livecd/type",
"livecd/unmerge",
"livecd/users",
Expand Down
11 changes: 8 additions & 3 deletions targets/livecd-stage2/controller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,14 @@ case $1 in
;;

rc-update)
exec_in_chroot ${clst_shdir}/support/rc-update.sh
;;

# Check for systemd enabled livecd
if [[ ${clst_livecd_systemd} == "yes" ]]; then
exec_in_chroot ${clst_shdir}/support/systemctl.sh
else
# Run as OpenRC
exec_in_chroot ${clst_shdir}/support/rc-update.sh
fi
;;
fsscript)
exec_in_chroot ${clst_fsscript}
;;
Expand Down
34 changes: 34 additions & 0 deletions targets/support/systemctl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

# This script only runs when livecd/systemd: yes is set in the spec

# Configure autologin on tty1 for systemd live media
mkdir -p /etc/systemd/system/getty@tty1.service.d
cat > /etc/systemd/system/getty@tty1.service.d/autologin.conf <<EOF
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin root --noclear %I \$TERM
EOF
systemctl enable getty@tty1.service

# This section is controlled by the user in the specfile via:
# livecd/rcadd: NetworkManager
# livecd/rcdel: gpm

if [ -n "${clst_rcadd}" ]
then
for svc in ${clst_rcadd}
do
echo "Enabling service: ${svc}"
systemctl enable "${svc}"
done
fi

if [ -n "${clst_rcdel}" ]
then
for svc in ${clst_rcdel}
do
echo "Disabling service: ${svc}"
systemctl disable "${svc}"
done
fi