Skip to content

Commit

Permalink
nvidiactl: Straighten indent
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas committed Feb 22, 2018
1 parent 9c4b957 commit f60aab1
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions nvidiactl/nvidiactl
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ set_generic_mxgfx_link () {


if [ -d /sys/module/nouveau ] ; then
echo >&2 "NOTE: nouveau driver loaded already, using 'mxgfx-generic'."
set_generic_mxgfx_link
exit 0
echo >&2 "NOTE: nouveau driver loaded already, using 'mxgfx-generic'."
set_generic_mxgfx_link
exit 0
fi

PCIIDHINT_DIR=/usr/share/nvidia/pciidhints
Expand All @@ -21,31 +21,31 @@ nvidiacards=( $(lspci -n | grep " 0300: 10de:" | cut -d ' ' -f 3) )
nvver=${nvidiacards[0]}

if [ -z ${nvver} ] ; then
echo >&2 "WARNING: no nvidia card found.."
set_generic_mxgfx_link
exit 0
echo >&2 "WARNING: no nvidia card found.."
set_generic_mxgfx_link
exit 0
fi

pciids="${PCIIDHINT_DIR}/${kver}-${nvver} ${PCIIDHINT_DIR}/${nvver}"

for leglvlhint in ${pciids} ; do
if [ -h "${leglvlhint}" ] ; then
set_generic_mxgfx_link
test -e /lib/modules/${kver}/kernel/drivers/gpu/drm/nouveau/nouveau.ko && \
echo >&2 "NOTE: legacy nvidia card found, loading nouveau .." && \
modprobe nouveau && \
exit 0

echo >&2 "ERROR: nouveau module not available, choose a newer kernel!"
exit 1
fi
if [ -h "${leglvlhint}" ] ; then
set_generic_mxgfx_link
test -e /lib/modules/${kver}/kernel/drivers/gpu/drm/nouveau/nouveau.ko && \
echo >&2 "NOTE: legacy nvidia card found, loading nouveau .." && \
modprobe nouveau && \
exit 0

echo >&2 "ERROR: nouveau module not available, choose a newer kernel!"
exit 1
fi
done

nvlink=/usr/share/nvidia/kernel/${kver}/current

if [ ! -h ${nvlink} ] ; then
echo >&2 "WARNING: ${nvlink} is not a link (to nvversion) .."
exit 1
echo >&2 "WARNING: ${nvlink} is not a link (to nvversion) .."
exit 1
fi

nvver=$(readlink ${nvlink})
Expand Down Expand Up @@ -85,4 +85,5 @@ if [ ! -z $N ]; then
test -e ${nvlink}/nvidia-modeset.ko && insmod ${nvlink}/nvidia-modeset.ko
test -e ${nvlink}/nvidia-drm.ko && insmod ${nvlink}/nvidia-drm.ko
fi

exit 0

0 comments on commit f60aab1

Please sign in to comment.