]> git.plutz.net Git - blast/commitdiff
autostart emulationstation
authorPaul Hänsch <paul@plutz.net>
Mon, 23 Dec 2019 08:00:21 +0000 (09:00 +0100)
committerPaul Hänsch <paul@plutz.net>
Mon, 23 Dec 2019 08:00:21 +0000 (09:00 +0100)
retropie.mk

index c23e85c334f15955c40e741f680302640e8d8f34..a822b0d4235d552f1d6f0ab093672ea8b1e8e476 100644 (file)
@@ -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' \
+               >"$@"