]> git.plutz.net Git - blast/blobdiff - retropie.mk
fixed approx config for raspi
[blast] / retropie.mk
index c23e85c334f15955c40e741f680302640e8d8f34..100bde8982f5097331ae5249e797141e8e17ed0b 100644 (file)
@@ -5,7 +5,7 @@ raspi=retropie.img
 
 ## Image size in MB. Needs to be able to hold all software.
 # imagesize=3072
-imagesize=2048
+imagesize=4096
 
 ## Additional packages
 # packages:=chromium-browser,ssh,lsb-release
@@ -16,8 +16,8 @@ packages=ssh lsb-release bison bluetooth build-essential cmake dialog fbi fbset
 release=stretch
 
 ## Comma separated list of config modules from modules/ directory
-modules=approx,autoresize,display_ws5inch # nodm,xfce
-# approxhost := localhost:9999
+modules=approx,autoresize #,display_ws5inch # nodm,xfce
+approxhost:=localhost:9000
 
 ## Hostname for the generated machine
 hostname=retropie
@@ -66,28 +66,47 @@ 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' \
+               >"$@"
+
+define RPICONFIG :=
+dtparam=audio=on
+gpu_mem_256=128
+gpu_mem_512=256
+gpu_mem_1024=256
+overscan_scale=1
+endef