cifs-utils/mkinitrd_scripts_boot-cifs.sh
OBS User autobuild cf7839212c Accepting request 35349 from network:samba:STABLE
Copy from network:samba:STABLE/cifs-utils based on submit request 35349 from user lmuelle

OBS-URL: https://build.opensuse.org/request/show/35349
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/cifs-utils?expand=0&rev=1
2010-03-19 10:57:31 +00:00

51 lines
1.2 KiB
Bash

#!/bin/bash
#%stage: block
#%modules: cifs
#%programs: /sbin/mount.cifs
#%if: "$rootfstype" = "cifs"
#
##### CIFS support
##
## This is where CIFS gets mounted.
##
## Command line parameters
## -----------------------
##
## root=cifs://[user:pass@]<server>/<folder> the cifs root path
## cifsuser=<username> (only used if not defined in root=)
## cifspass=<password> (only used if not defined in root=)
##
if [ "$rootfstype" = "cifs" ]; then
# load the cifs module before using it
load_modules
if [ "${rootdev%%://*}" = "cifs" ]; then # URL parsing
rootdev=${rootdev##cifs://}
username=${rootdev%@*}
password=${username#*:}
if [ "$password" ]; then
cifspass=$password
username=${username%:*}
fi
cifsuser=$username
if [ "$username" ]; then
rootdev="${rootdev#*@}"
fi
rootdev="//$rootdev"
fi
rootfsmod=
if [ ! "$cifsuser" -o ! "$cifspass" ]; then
echo "For CIFS support you need to specify a username and password either in the cifsuser and cifspass commandline parameters or in the root= CIFS URL."
fi
if [ "$rootflags" ] ; then
rootflags="${rootflags},user=$cifsuser"
else
rootflags="user=$cifsuser"
fi
rootflags="$rootflags,pass=$cifspass"
else
dont_load_modules
fi