Here is my technique for having the Recalbox roms folder mounted on the network.
This allows for all yours roms to be on the network and every Recalbox can access them.
There were a few obstacles
1) Emulation station is booted before the network is up to increase boot times
2) If we change any of the existing init.d files - our changes will be overwritten on updates
3) fstab won't work either
Our solution is to create two new init.d scripts. As they are our own - they won't be overwritten. We will have one which brings up the network and mounts our network share and then the other will undo our changes on shutdown / reboot.
Let's get started.
First boot the Raspberry Pi into Recalbox.
Now we need to SSH into Recalbox.
We do this using a program called Putty on a Windows computer that is on the same network as the Pi.
Download putty.exe from here
Save it somewhere you can easily find it.
It's portable - which means it doesn't need to be installed.
Open the downloaded putty.exe to start Putty.
Enter the Pi's IP address in the host name field and make sure the port is 22.
(Often you can find the IP by looking at the DHCP client list in your router settings page.)
Then click Open.
You should see "login as:" appear.
Type root and hit enter. Now type in the password recalboxrootand hit enter.
You should now be logged into the Pi remotely.
Now, you can copy the below commands into the terminal window.
First, we need to change the filesystem from RO (read only) to RW (read / write).
Now we need to mount our network folder and copy over all the files.
192.168.20.3 is the IP address of my SMB networked drive and 'roms' is name of the folder I have created on this share that will store all my roms. You will need to change USERNAME and PASSWORD to what is required on your share to have read & write permissions.
Basically, if the next step works then you'll be fine.
We now need to copy over all the files from the existing share folder to the new share folder
Now unmount the share
Let's create our first init.d script
Copy the below text into the editor
Save the file (CTRL-X, Y, ENTER)
Remember to change the IP, Username and Password in the mount line to match your setup :)
This script is set to start before emulation station. It also starts before the network start script but that is fine. Trying to start the network the 2nd time won't cause any issues.
Now, we need a script to unmount our cifs mount else shutdown / reboot hangs for quite a while.
Copy the below text into the editor
Save the file (CTRL-X, Y, ENTER)
Now make both init scripts executable
Now make the file system read only again
And that's it :)
Reboot and your roms should be loaded from the network folder.
This allows for all yours roms to be on the network and every Recalbox can access them.
There were a few obstacles
1) Emulation station is booted before the network is up to increase boot times
2) If we change any of the existing init.d files - our changes will be overwritten on updates
3) fstab won't work either
Our solution is to create two new init.d scripts. As they are our own - they won't be overwritten. We will have one which brings up the network and mounts our network share and then the other will undo our changes on shutdown / reboot.
Let's get started.
First boot the Raspberry Pi into Recalbox.
Now we need to SSH into Recalbox.
We do this using a program called Putty on a Windows computer that is on the same network as the Pi.
Download putty.exe from here
Save it somewhere you can easily find it.
It's portable - which means it doesn't need to be installed.
Open the downloaded putty.exe to start Putty.
Enter the Pi's IP address in the host name field and make sure the port is 22.
(Often you can find the IP by looking at the DHCP client list in your router settings page.)
Then click Open.
You should see "login as:" appear.
Type root and hit enter. Now type in the password recalboxrootand hit enter.
You should now be logged into the Pi remotely.
Now, you can copy the below commands into the terminal window.
First, we need to change the filesystem from RO (read only) to RW (read / write).
mount -o remount,rw /
Now we need to mount our network folder and copy over all the files.
mkdir /mnt/share mount -t cifs //192.168.20.3/roms -o user=USERNAME,password=PASSWORD /mnt/share
192.168.20.3 is the IP address of my SMB networked drive and 'roms' is name of the folder I have created on this share that will store all my roms. You will need to change USERNAME and PASSWORD to what is required on your share to have read & write permissions.
Basically, if the next step works then you'll be fine.
We now need to copy over all the files from the existing share folder to the new share folder
cp -r /recalbox/share/roms/. /mnt/share/
Now unmount the share
umount /mnt/share/ rmdir /mnt/share
Let's create our first init.d script
nano /etc/init.d/S20mountcifs
Copy the below text into the editor
#!/bin/sh
case "$1" in
start)
/etc/init.d/S*network start
mount -t cifs //192.168.20.3/roms -o user=USER,password=PASS /recalbox/share/roms
;;
esac
exit $?
Save the file (CTRL-X, Y, ENTER)
Remember to change the IP, Username and Password in the mount line to match your setup :)
This script is set to start before emulation station. It also starts before the network start script but that is fine. Trying to start the network the 2nd time won't cause any issues.
Now, we need a script to unmount our cifs mount else shutdown / reboot hangs for quite a while.
nano /etc/init.d/S43umountcifs
Copy the below text into the editor
#!/bin/sh
case "$1" in
stop)
umount -l /recalbox/share/roms
;;
esac
exit $?
Save the file (CTRL-X, Y, ENTER)
Now make both init scripts executable
chmod +x /etc/init.d/S20mountcifs chmod +x /etc/init.d/S43umountcifs
Now make the file system read only again
mount -o remount,ro /
And that's it :)
Reboot and your roms should be loaded from the network folder.