1. OCAU Merchandise is available! Check out our 20th Anniversary Mugs, Classic Logo Shirts and much more! Discussion in this thread.
    Dismiss Notice

RetroNAS

Discussion in 'Retro & Arcade' started by elvis, Nov 27, 2021.

  1. MUTMAN

    MUTMAN Member

    Joined:
    Jun 27, 2001
    Messages:
    11,377
    Location:
    4109
    Does it, or can it, produce a log so that if everything falls apart at least it can be reconstructed ??

    00001 filesevensix2.five - filesev2.003
    00002 file ......

    Or a script to "undo" by pulling the log and re-renaming from it


    Edit - I din't say thanks for the work. Very rude of me.
     
    Last edited: Feb 3, 2022
    Pierre32 likes this.
  2. Pierre32

    Pierre32 Member

    Joined:
    Oct 13, 2019
    Messages:
    1,910
    Location:
    Sydney
    It can, and it probably should. Good call.
     
    MUTMAN likes this.
  3. OP
    OP
    elvis

    elvis OCAU's most famous and arrogant know-it-all

    Joined:
    Jun 27, 2001
    Messages:
    46,810
    Location:
    Brisbane
    I'm mid way through writing a ROM import tool that copies from a "romimport" folder into the "roms" folder (and the correct game location).

    Similar things could be done with the above, changing the "mv" to a "cp" so that there's no damage done to the source files.

    User can then delete the contents of the import folder at a later date if it suits them.
     
    Last edited: Feb 3, 2022
    Pierre32 and MUTMAN like this.
  4. MUTMAN

    MUTMAN Member

    Joined:
    Jun 27, 2001
    Messages:
    11,377
    Location:
    4109
    Pierre32 likes this.
  5. Pierre32

    Pierre32 Member

    Joined:
    Oct 13, 2019
    Messages:
    1,910
    Location:
    Sydney
    The scenario I envision for this is where the user has already got their ROMS distributed in the RetroNAS master structure, and can run a function to make the appropriate systems available to their EtherDFS share too. Files would first be copied over with their original names, then renamed in the new location. The script would handle all the paths, keeping things pretty safe.

    Certainly wouldn't want users randomly calling the script from the wrong location in the terminal, like I did.
     
    MUTMAN likes this.
  6. greencamel65

    greencamel65 Member

    Joined:
    Jan 17, 2003
    Messages:
    756
    Location:
    Asgard
    I think i had a little too much spare time.... All this talk about retronas running on any old bit of hardware seems to be true to my great amusement.. Grabbed the oldest thing setup that would boot from a cd, installed debian, and retronas with smb, etherdfs, ps3netsrv, ssh, telnet and NFS, and it works! (very slowly). Contemplating replacing whatever coppermine cpu is in it with a p2-266 to see how much slower it would run, as it's not like i have a million other projects i could be spending time on :Paranoid:

    upload_2022-2-3_15-41-55.png
     
    adz, daehenoc, elvis and 4 others like this.
  7. Pierre32

    Pierre32 Member

    Joined:
    Oct 13, 2019
    Messages:
    1,910
    Location:
    Sydney
    ^ As it happens I dusted off an original Pi B last night and set up a fresh card... but I might save that for the intended project.

    This afternoon I've taken a look at what people might emulate in DOS. This looks like a pretty good summary. Based on that I decided on these folders under /<dos share>/roms:

    2600
    gb
    gba
    gbc
    nes
    snes
    odyssey
    vectrex
    arcadia
    pc88
    pcfx
    mac
    mame
    msx
    c64
    zx81
    zxspec
    cpc

    So I held my beer, and dumped this into the terminal:

    mkdir /media/pi/FAT32/roms
    mkdir /media/pi/FAT32/roms/2600
    mkdir /media/pi/FAT32/roms/gb
    mkdir /media/pi/FAT32/roms/gba
    mkdir /media/pi/FAT32/roms/gbc
    mkdir /media/pi/FAT32/roms/mame
    mkdir /media/pi/FAT32/roms/nes
    mkdir /media/pi/FAT32/roms/snes
    mkdir /media/pi/FAT32/roms/odyssey
    mkdir /media/pi/FAT32/roms/vectrex
    mkdir /media/pi/FAT32/roms/arcadia
    mkdir /media/pi/FAT32/roms/pc88
    mkdir /media/pi/FAT32/roms/pcfx
    mkdir /media/pi/FAT32/roms/mac
    mkdir /media/pi/FAT32/roms/msx
    mkdir /media/pi/FAT32/roms/c64
    mkdir /media/pi/FAT32/roms/zx81
    mkdir /media/pi/FAT32/roms/zxspec
    mkdir /media/pi/FAT32/roms/cpc

    cp /media/pi/ntfs/roms/atari/2600/*.* /media/pi/FAT32/roms/2600
    cp /media/pi/ntfs/roms/nintendo/gameboy/*.* /media/pi/FAT32/roms/gb
    cp /media/pi/ntfs/roms/nintendo/gameboyadvance/*.* /media/pi/FAT32/roms/gba
    cp /media/pi/ntfs/roms/nintendo/gameboycolor/*.* /media/pi/FAT32/roms/gbc
    cp /media/pi/ntfs/roms/nintendo/nes/*.* /media/pi/FAT32/roms/nes
    cp /media/pi/ntfs/roms/nintendo/snes/*.* /media/pi/FAT32/roms/snes
    cp /media/pi/ntfs/roms/other/magnavox_odyssey/*.* /media/pi/FAT32/roms/odyssey
    cp /media/pi/ntfs/roms/other/vectrex/*.* /media/pi/FAT32/roms/vectrex
    cp /media/pi/ntfs/roms/other/emerson_arcadia2001/*.* /media/pi/FAT32/roms/arcadia
    cp /media/pi/ntfs/roms/nec/pc88/*.* /media/pi/FAT32/roms/pc88
    cp /media/pi/ntfs/roms/nec/pcfx/*.* /media/pi/FAT32/roms/pcfx
    cp /media/pi/ntfs/roms/apple/macintosh/*.* /media/pi/FAT32/roms/mac
    cp /media/pi/ntfs/roms/microsoft/msx/*.* /media/pi/FAT32/roms/msx
    cp /media/pi/ntfs/roms/commodore/commodore64/*.* /media/pi/FAT32/roms/c64
    cp /media/pi/ntfs/roms/sinclair/zx81/*.* /media/pi/FAT32/roms/zx81
    cp /media/pi/ntfs/roms/sinclair/zxspectrum/*.* /media/pi/FAT32/roms/zxspec
    cp /media/pi/ntfs/roms/amstrad/cpc/*.* /media/pi/FAT32/roms/cpc

    cd /media/pi/FAT32/roms/2600
    /opt/dosrom/rename.sh
    cd /media/pi/FAT32/roms/gb
    /opt/dosrom/rename.sh
    cd /media/pi/FAT32/roms/gba
    /opt/dosrom/rename.sh
    cd /media/pi/FAT32/roms/gbc
    /opt/dosrom/rename.sh
    cd /media/pi/FAT32/roms/nes
    /opt/dosrom/rename.sh
    cd /media/pi/FAT32/roms/snes
    /opt/dosrom/rename.sh
    cd /media/pi/FAT32/roms/odyssey
    /opt/dosrom/rename.sh
    cd /media/pi/FAT32/roms/vectrex
    /opt/dosrom/rename.sh
    cd /media/pi/FAT32/roms/arcadia
    /opt/dosrom/rename.sh
    cd /media/pi/FAT32/roms/pc88
    /opt/dosrom/rename.sh
    cd /media/pi/FAT32/roms/pcfx
    /opt/dosrom/rename.sh
    cd /media/pi/FAT32/roms/mac
    /opt/dosrom/rename.sh
    cd /media/pi/FAT32/roms/msx
    /opt/dosrom/rename.sh
    cd /media/pi/FAT32/roms/c64
    /opt/dosrom/rename.sh
    cd /media/pi/FAT32/roms/zx81
    /opt/dosrom/rename.sh
    cd /media/pi/FAT32/roms/zxspec
    /opt/dosrom/rename.sh
    cd /media/pi/FAT32/roms/cpc
    /opt/dosrom/rename.sh
    cd /home/pi/

    No problems. Many of my source folders are empty, in which case the process just throws an error and moves on. Note that I haven't included MAME in the transfer, as you want to source a separate set for DOS, not copy the later ones.

    There are zero smarts for checking content in the destination folders. If you run it a second time for some reason, you'll end up with duplicates of anything existing. Mildly interesting is that it continues the number sequence, but the latest additions aren't the higher numbers. Check the timestamps. (That killed my idea of just culling the ones with the later timestamp. But it's quicker just to delete the lot and run the script again anyway).

    upload_2022-2-3_17-4-54.png
     
    Last edited: Feb 4, 2022
    Daft_Munt, elvis and MUTMAN like this.
  8. OP
    OP
    elvis

    elvis OCAU's most famous and arrogant know-it-all

    Joined:
    Jun 27, 2001
    Messages:
    46,810
    Location:
    Brisbane
    This is my whole career in a single line of text. :lol:

    Well done!

    This is cool. Mind if I share it around?
     
    adz, Daft_Munt and Pierre32 like this.
  9. greencamel65

    greencamel65 Member

    Joined:
    Jan 17, 2003
    Messages:
    756
    Location:
    Asgard
    Ha go for it , i'm fairly sure i got the idea from one of your posts somewhere.
     
    adz, MUTMAN and elvis like this.
  10. OP
    OP
    elvis

    elvis OCAU's most famous and arrogant know-it-all

    Joined:
    Jun 27, 2001
    Messages:
    46,810
    Location:
    Brisbane
    What's the current CPU spec?

    (Love the hostname too)
     
    adz and Daft_Munt like this.
  11. greencamel65

    greencamel65 Member

    Joined:
    Jan 17, 2003
    Messages:
    756
    Location:
    Asgard
    600mhz p3, 256mb ram, 16gb sd2ide drive.

    Warning at the start of the debian installer about low memory, i had to select which installer modules to load, but apart from that it was no different to any other setup
     
    adz, MUTMAN and elvis like this.
  12. Grant

    Grant Member

    Joined:
    Jan 23, 2002
    Messages:
    1,907
    Location:
    Wollongong
    Running off an old SD card is truly painful, the CPU is fine and the memory is enough to run a few things (though if you load too much stuff up it'll fall over in terms of performance or hang if you're not using swap). This tutorial seems reasonable for doing an initial install onto SD card, then moving it to a USB drive and having the boot process start from SD and continue from USB, but I haven't tried it.

    Nifty! Another idea: you can mount a VFAT partition in Linux as "msdos" rather than "vfat", where the former only supports 8.3 filenames:

    Code:
    root@retronas:~# mount -t vfat -o uid=1000,gid=1000,fmask=0022,dmask=0022 /dev/vdb /data/retronas/dos
    root@retronas:~# cd /data/retronas/dos/
    root@retronas:/data/retronas/dos# echo "asdf" > asdfasdfa
    root@retronas:/data/retronas/dos# echo "fdsafdsa" > asdfasdfb
    root@retronas:/data/retronas/dos# ls -ltr
    [...]
    -rwxr-xr-x 1 pi pi         5 Feb  3 18:48 asdfasdfa
    -rwxr-xr-x 1 pi pi         9 Feb  3 18:48 asdfasdfb
    root@retronas:/data/retronas/dos# cd
    root@retronas:~# umount /data/retronas/dos/
    root@retronas:~# mount -t msdos -o uid=1000,gid=1000,fmask=0022,dmask=0022 /dev/vdb /data/retronas/dos
    root@retronas:~# cd /data/retronas/dos
    root@retronas:/data/retronas/dos# ls -ltr
    [...]
    -rwxr-xr-x 1 pi pi         5 Feb  3 18:48 asdfas~1
    -rwxr-xr-x 1 pi pi         9 Feb  3 18:48 asdfas~2
    root@retronas:/data/retronas/dos# echo "asdf" > asdfasdfa
    root@retronas:/data/retronas/dos# echo "fdsafdsa" > asdfasdfb
    root@retronas:/data/retronas/dos# ls -ltr
    -rwxr-xr-x 1 pi pi         5 Feb  3 18:48 asdfas~1
    -rwxr-xr-x 1 pi pi         9 Feb  3 18:48 asdfas~2
    -rwxr-xr-x 1 pi pi         9 Feb  3 18:55 asdfasdf    # <- overwritten by second command while FS is mounted as "msdos"
    
     
    Pierre32, MUTMAN and elvis like this.
  13. OP
    OP
    elvis

    elvis OCAU's most famous and arrogant know-it-all

    Joined:
    Jun 27, 2001
    Messages:
    46,810
    Location:
    Brisbane
    Today I learned. That's going in the wiki.
     
    daehenoc and MUTMAN like this.
  14. Pierre32

    Pierre32 Member

    Joined:
    Oct 13, 2019
    Messages:
    1,910
    Location:
    Sydney
    So if I copied long filenames to an msdos-vfat partition, they would automatically truncate?
     
  15. Grant

    Grant Member

    Joined:
    Jan 23, 2002
    Messages:
    1,907
    Location:
    Wollongong
    The annoying bit compared to the rename script would be remounting the filesystem: you need to copy the long file names onto the partition mounted as "vfat" to preserve their long name, otherwise names that collide will overwrite each other. But once you've done that, you can remount as "msdos" and it will intelligently generate short file names.
     
    MUTMAN likes this.
  16. Jumpingmanjim

    Jumpingmanjim Member

    Joined:
    Sep 20, 2008
    Messages:
    655
    Any chance this would ever run on OSX?
     
  17. Pierre32

    Pierre32 Member

    Joined:
    Oct 13, 2019
    Messages:
    1,910
    Location:
    Sydney
    Gotcha :thumbup: Good info. Speaking generally, running a mount like that would take a lot of the nasty surprises out of EtherDFS transfers. Love having a large transfer fail because you accidentally left one of GOG's Windows files in a folder. Those files would be welcome to eat each other on the initial transfer to the VFAT volume. I'll try it out in the future.
     
    MUTMAN and greencamel65 like this.
  18. Grant

    Grant Member

    Joined:
    Jan 23, 2002
    Messages:
    1,907
    Location:
    Wollongong
    A Linux VM would be your best bet on a modern Mac.
     
    greencamel65 likes this.
  19. Pierre32

    Pierre32 Member

    Joined:
    Oct 13, 2019
    Messages:
    1,910
    Location:
    Sydney
  20. OP
    OP
    elvis

    elvis OCAU's most famous and arrogant know-it-all

    Joined:
    Jun 27, 2001
    Messages:
    46,810
    Location:
    Brisbane
    Right now, as is, no.

    All the internal parts are open source, however. They're all available in something like Homebrew, and you can steal all my configuration from my GitHub.

    But otherwise, as mentioned, a Debian 11 VM is the answer. On Mac M1 you can run the native Debian 11 ARM64 port in a VM.
     

Share This Page

Advertisement: