From 6017db96c3af32888dd7f13ffdca389bc5b47bc1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Mon, 23 Dec 2019 09:00:21 +0100 Subject: [PATCH] autostart emulationstation --- retropie.mk | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/retropie.mk b/retropie.mk index c23e85c..a822b0d 100644 --- a/retropie.mk +++ b/retropie.mk @@ -66,28 +66,39 @@ nodm_user=rpi CFGROOT := img_mount/ -_target: ${CFGROOT}/opt/RetroPie-Setup/ ${CFGROOT}/etc/sudoers.d/nopassword _vc4driver _groups _autologin +_target: ${CFGROOT}/etc/sudoers.d/nopassword _retropie _vc4driver _groups _autologin | _config + +_retropie: ${CFGROOT}/opt/RetroPie-Setup/ # ${CFGROOT}/opt/retropie/ RetroPie-Setup/: [ ! -d "$@" ] && git clone --depth=1 https://github.com/RetroPie/RetroPie-Setup.git -${CFGROOT}/opt/RetroPie-Setup/: RetroPie-Setup/ ${CFGROOT} | _config +${CFGROOT}/opt/RetroPie-Setup/: RetroPie-Setup/ | _config cp -au "$<" "$@" -_vc4driver: ${CFGROOT} | _config +# ${CFGROOT}/opt/retropie/: retropie/ | _config +# -cp -au "$<" "$@" + +_vc4driver: | _config sed -Ei 's;^ *dtoverlay=vc4-fkms-v3d;# &;' ${CFGROOT}/boot/config.txt -${CFGROOT}/etc/sudoers.d/nopassword: ${CFGROOT} +${CFGROOT}/etc/sudoers.d/nopassword: | _config printf '%%sudo ALL=NOPASSWD: ALL\n' >"$@" chmod 440 "$@" -_groups: _users +_groups: _users | _config chroot "$${CFGROOT}" adduser rpi sudo chroot "$${CFGROOT}" adduser rpi input chroot "$${CFGROOT}" adduser rpi video -_autologin: ${CFGROOT}/etc/systemd/system/getty@tty1.service.d/override.conf ${CFGROOT} -${CFGROOT}/etc/systemd/system/getty@tty1.service.d/override.conf: +_autologin: ${CFGROOT}/etc/systemd/system/getty@tty1.service.d/override.conf ${CFGROOT}/etc/profile.d/retropie_autostart.sh +${CFGROOT}/etc/systemd/system/getty@tty1.service.d/override.conf: | _config mkdir -p ${CFGROOT}/etc/systemd/system/getty@tty1.service.d/ printf '[Service]\nExecStart=\nExecStart=-/sbin/agetty --autologin %s --noclear %%I $$TERM' \ rpi >$@ + +${CFGROOT}/etc/profile.d/retropie_autostart.sh: | _config + printf '%s\n' '[ "$$USER" = rpi ] && \\' \ + 'if which emulationstation; then' ' emulationstation' \ + 'else' ' sudo /opt/RetroPie-Setup/retropie_setup.sh' 'fi' \ + >"$@" -- 2.39.2