Switch to USB vs Symlinks

For topics which do not fit in other specific forums.
jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Switch to USB vs Symlinks

Unread post by jca »

As per Sorge "Actually switch to USB is kind of obsolete option, you may use symlinks from specific folder to USB and use both locations without hard switch." without any further explaination.
My MISTer is switched to USB and this is what I have:
1. On the SD Card /media/fat
Files: menu.rbf
MISTer
MISTer.ini
Directories: config which contains only device.bin.
linux
Scripts which contains only things related to update script and the wifi script.

2. On the USB drive /media/usb0
Files: KICK.ROM because when using USB (even when not switched to USB) the Amiga requires to have this ROM on /media/usb0,
no other name or location can be used.

spectrum.rom and spectrum.rom_rc196 because the Spectrum core is inconsistent with all other cores (except the Amigha)
and requires the ROM to be in /media/usb0 (or /media/fat when running from the SD card), it cannot be in games/Spectrum.
Directories: _Arcade
_Computer
_Console
_Other
_Unofficial
_Utility
Amiga because the Amiga core refuses to work if it is in games/Amiga.
cheats
config which contains all the configuration file related to games controllers, arcade dip settings and the various core configuration
files.
Filters
Filters_Audio
games
Gamma
inputs
saves
savestates
screenshots
Scripts which contains all the scripts.

What would I have to do to revert running from the SD card and having symlinks to the USB drive?
Of particular concern is the config directory which is on both the SD card and the USB drive but each containing different things.
jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: Switch to USB vs Symlinks

Unread post by jca »

Here are the answers to my questions;
I first copied the ROMs from /media/usb0 to /media/fat, no need to make symlinks to them.
Next I copied the device.bin from /media/fat/config to /media/usb0/config and deleted /media/fat/config.
Next I copied the contents of /media/fat/Scripts to /media/usb0/Scripts (I have some of my own scripts there) and deleted /media/fat/Scripts.
Now, in /media/fat, I made symlinks to each of the directories on /media/usb0.
Time to reboot and I get No Files!
Pressing F12 twice and now the core directories show properly in the OSD. On the first press of F12 I noticed that Storage was SD card so I did not have to "Switch to SD card".
No problem to start a core but trying to start another core gives No Files! and this time nothing can help.
Deleted the symlink to /media/usb0/config and brought back /media/usb0/config to /media/fat.
Reboot, the usual No Files!, 2 presses on F12 and I can start a core. From that core I can now start other cores.
To keep my USB drive spinning I have a script in /etc/init.d which starts a script in the Scripts directory but this script was not running.
Deleted the symlink to /media/usb0/Scripts and brought back /media/usb0/Scripts to /media/fat.
Reboot, the usual No Files!, 2 presses on F12 and now my script is running.
Time to bring back /media/usb0/Amiga to /media/usb0/games and delete /media/fat/KICK.ROM, now the Amiga works as it should and I can select different ROMs from the symlink to /media/usb0/games/Amiga.

Time to think of the update scripts:
I deleted update.ini as it changed the BASEPATH to the USB drive. If I did not change it it would have worked but created a /media/fat/Scripts directory instead of updating /media/fat/Scripts. For the update all script I had the USB version so I deleted both update_all.sh and update_all.ini as I had the USB version of the script and downloaded the standard version.
My MISTer was up to date so running update.sh should not update anything. It updated the 2 mras of VBall and the wifi script (at the beginning I copied the contents of /media/fat/Scripts to /media/usb0/Scripts before bringing back to /media/fat and it contained an old version of the script). So far so good.
Next update_all script, it did not update anything as expected. I got these errors:
rm: cannot remove '/tmp/mame.getter.zip.file': No such file or directory
rm: cannot remove '/tmp/mame.getter.mra.file': No such file or directory

rm: cannot remove '/tmp/hbmame.getter.zip.file': No such file or directory
rm: cannot remove '/tmp/hbmame.getter.mra.file': No such file or directory
I guess they will go away on the next run.
Post Reply