mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-08-03 16:07:51 +00:00
busybox-initramfs: init: add support for CIFS mounts
Example usage: disk=CIFS=//192.168.1.1/share,user=name,password=secret disk=SMB=//192.168.1.1/public,user=guest Note: comma's ',' are not allowed in CIFS options (for example in usernames or passwords) because they are used to separate options. Note: SMB is an alias for CIFS, for people who are more used to that name. Signed-off-by: Alain Kalker <a.c.kalker@gmail.com>
This commit is contained in:
parent
b68c832489
commit
4f0052a875
@ -128,6 +128,15 @@ NBD_DEVS="0"
|
||||
[ "$ERR_ENV" -ne "0" ] && error "mount_common" "Could not mount $1"
|
||||
}
|
||||
|
||||
mount_cifs() {
|
||||
# Mount CIFS (Samba) share
|
||||
CIFS_SHARE="${1%%,*}"
|
||||
CIFS_OPTIONS="${1#*,}"
|
||||
[ "$CIFS_OPTIONS" = "$1" ] && CIFS_OPTIONS=
|
||||
|
||||
mount_common "$CIFS_SHARE" "$2" "$3,$CIFS_OPTIONS" "cifs"
|
||||
}
|
||||
|
||||
mount_nbd() {
|
||||
# Mount NBD device
|
||||
NBD_SERVER="${1%%:*}"
|
||||
@ -160,6 +169,9 @@ NBD_DEVS="0"
|
||||
MOUNT_CMD="mount_common"
|
||||
MOUNT_TARGET="$1"
|
||||
;;
|
||||
CIFS=*|SMB=*)
|
||||
MOUNT_CMD="mount_cifs"
|
||||
;;
|
||||
NBD=*)
|
||||
MOUNT_CMD="mount_nbd"
|
||||
;;
|
||||
|
Loading…
x
Reference in New Issue
Block a user