Compare commits

..

2 Commits

3 changed files with 35 additions and 8 deletions

View File

@ -388,6 +388,12 @@ echo -n "Reconfiguring all installed packages... "
run_in_target xbps-reconfigure -fa >> $LOGFILE 2>&1
echo "done"
echo -n "Configuring runit to start some services... "
run_in_target ln -s /etc/sv/acpid /etc/runit/runsvdir/default/
run_in_target ln -s /etc/sv/dbus /etc/runit/runsvdir/default/
run_in_target ln -s /etc/sv/NetworkManager /etc/runit/runsvdir/default/
echo "done"
echo -n "Adding stage 2 installer... "
STAGE2_DIR="/mnt/target/opt/void-usb/installer"
@ -411,19 +417,35 @@ for I in ${!SECTIONS[@]}; do
done
done
#TODO: auto-login root and run install stage 2
mv /mnt/target/etc/sv/agetty-tty1/conf /mnt/target/etc/sv/agetty-tty1/conf.bak >> $LOGFILE 2>&1
echo 'if [ -x /sbin/agetty -o -x /bin/agetty ]; then
if [ "${tty}" = "tty1" ]; then
GETTY_ARGS="--noclear --autologin root"
fi
fi' > /mnt/target/etc/sv/agetty-tty1/conf
[ -f /mnt/target/root/.profile ] && mv /mnt/target/root/.profile /mnt/target/root/.profile.bak >> $LOGFILE 2>&1
echo "if ps aux | grep 'installer-stage2.sh' > /dev/null 2>&1; then
true
else
/opt/void-usb/installer/install-stage2.sh
exit
fi" > /mnt/target/root/.profile
echo "done"
echo "Creating system image..."
#TODO: make this work without user interaction
run_in_target /opt/void-usb/backup-fs
# This is not technically necessary, but it should help to save some memory.
# TODO: Be smart about this, run install stage 2 in chroot if there is enough free RAM
clear
echo "Stage 1 installation is now complete.
The freshly installed system needs to be booted to continue with stage 2 of the installation process.
The installer will now reboot the computer.
The installer will now create a system image and reboot the computer.
"
press_any_key
echo "Creating system image..."
#TODO: make this work without user interaction
run_in_target /opt/void-usb/backup-fs
reboot
#

View File

@ -1,2 +1,4 @@
#!/usr/bin/env bash
exec bash
#debugging
exec bash --norc --noprofile

View File

@ -64,5 +64,8 @@ Stage 2:
-> run passwd (interactively)
-> add to groups
-> including sudo group
-> build new squashfs image and reboot
-> clean up
-> mv /mnt/target/etc/sv/agetty-tty1/conf.bak /mnt/target/etc/sv/agetty-tty1/conf
-> if [ -f /mnt/target/root/.profile.bak ]; then mv /mnt/target/root/.profile.bak /mnt/target/root/.profile; else rm /mnt/target/root/.profile; fi
-> rm -r /opt/void-usb/installer
-> build new squashfs image and reboot