Okay, I dug some more and found the script. It's been moved to this repository:
https://github.com/MiSTer-devel/Scripts_MiSTer
What you want is "cifs_mount.sh" and "cifs_umount.sh".
edit: you can download the files directly on the Mister by entering, on the command line:
Code: Select all
cd /media/fat/Scripts
wget https://raw.githubusercontent.com/MiSTer-devel/Scripts_MiSTer/master/cifs_mount.sh
wget https://raw.githubusercontent.com/MiSTer-devel/Scripts_MiSTer/master/cifs_umount.sh
That's a lot easier if you have SSH running, because you can just copy and paste those commands. You can, of course, pull the SD card and load them from Windows as well. Just remember to save them directly from your browser, don't copy and paste into a text editor to save them.
The cifs_mount.sh can accept all your settings for servers, usernames, passwords, and where you want the directory attached in the tree. (the default is /media/fat/cifs). However, I've had that file blown away at least once by a system update, forcing me to redo everything.
That might not happen anymore, but one way to prevent a script update from erasing your settings is to copy cifs_mount.sh to cifs_mount.ini. In the ini file, go through the script, put in all your variables, and delete all the code blocks. What you want to end up with is just variables being set.
When cifs_mount.sh detects cifs_mount.ini, it will source that script so that those variables are set correctly.
I wouldn't copy mine verbatim, but this is a redacted version of my cifs_mount.ini:
Code: Select all
#Your CIFS Server, i.e. your NAS name or its IP address.
SERVER="A.B.C.D"
#The share name on the Server.
SHARE="sharename"
#The user name, leave blank for guest access.
USERNAME="username"
#The user password, irrelevant (leave blank) for guest access.
PASSWORD="plaintext_password"
#Optional user domain, when in doubt leave blank.
DOMAIN=""
#Local directory/directories where the share will be mounted.
#- It can ba a single directory, i.e. "cifs", so the remote share, i.e. \\NAS\MiSTer
# will be directly mounted on /media/fat/cifs (/media/fat is the root of the SD card).
# NOTE: /media/fat/cifs is a special location that the mister binary will try before looking in
# the standard games location of /media/fat/games, so "cifs" is the suggested setting.
#- It can be a pipe "|" separated list of directories, i.e. "Amiga|C64|NES|SNES",
# so the share subdirectiories with those names,
# i.e. \\NAS\MiSTer\Amiga, \\NAS\MiSTer\C64, \\NAS\MiSTer\NES and \\NAS\MiSTer\SNES
# will be mounted on local /media/fat/Amiga, /media/fat/C64, /media/fat/NES and /media/fat/SNES.
#- It can be an asterisk "*": when SINGLE_CIFS_CONNECTION="true",
# all the directories in the remote share will be listed and mounted locally,
# except the special ones (i.e. linux and config);
# when SINGLE_CIFS_CONNECTION="false" all the directories in the SD root,
# except the special ones (i.e. linux and config), will be mounted when one
# with a matching name is found on the remote share.
LOCAL_DIR="cifs"
#Optional additional mount options, when in doubt leave blank.
#If you have problems not related to username/password, you can try "vers=2.0" or "vers=3.0".
ADDITIONAL_MOUNT_OPTIONS="vers=3.11"
#"true" in order to wait for the CIFS server to be reachable;
#useful when using this script at boot time.
WAIT_FOR_SERVER="true"
#"true" for automounting CIFS shares at boot time;
#it will create start/kill scripts in /etc/network/if-up.d and /etc/network/if-down.d.
MOUNT_AT_BOOT="true"
#========= ADVANCED OPTIONS =========
BASE_PATH="/media/fat"
#MISTER_CIFS_URL="https://github.com/MiSTer-devel/CIFS_MiSTer"
KERNEL_MODULES="md4.ko|md5.ko|des_generic.ko|fscache.ko|cifs.ko"
IFS="|"
SINGLE_CIFS_CONNECTION="true"
#Pipe "|" separated list of directories which will never be mounted when LOCAL_DIR="*"
SPECIAL_DIRECTORIES="config|linux|System Volume Information"
The "vers=311" argument might give you trouble if you're hosting on an older version of Linux. The comment above that line has some other options you can try. IIRC, all the stuff under ADVANCED OPTIONS is just what the original script had. I don't think I've changed any of these.
These settings will end up mounting the share at /media/fat/cifs, which is the default target directory for NAS shares. Most of the Mister utilities know to look there first, before checking the regular /media/fat. If you have trouble, you can set up symlinks in /media/fat aimed at /media/fat/cifs, but multiple people claim they're not needed anymore.
It's safest to generate your own cifs_mount.ini by editing the original script, in case there are new settings since I created mine. Think of my version as a template for your version. It should look roughly similar. You can save and edit mine if you want, but there may be missing options if you do.
If you're editing from Windows, make sure to save the files from the browser *first*. This will save them with the Unix text encoding. If you then edit the files with a Windows editor, it should normally recognize that it's Unix text, and save in the correct format. Unix uses only linefeed at the end of lines, where Windows uses carriage return/linefeed. Many Unix programs are badly confused by the Windows convention.