forked from negativo17/nvidia-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnvidia-generate-tarballs.sh
executable file
·67 lines (47 loc) · 1.62 KB
/
nvidia-generate-tarballs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/sh
set -e
VERSION=${VERSION:-435.21}
DL_SITE=${DL_SITE:-http://us.download.nvidia.com/XFree86}
TEMP_UNPACK=${TEMP_UNPACK:-temp}
PLATFORM=Linux-x86_64
RUN_FILE=NVIDIA-${PLATFORM}-${VERSION}.run
printf "Downloading installer ${RUN_FILE}... "
[[ -f $RUN_FILE ]] || wget -c -q ${DL_SITE}/${PLATFORM}/${VERSION}/$RUN_FILE
printf "OK\n"
sh ${RUN_FILE} --extract-only --target ${TEMP_UNPACK}
printf "Cleaning up binaries... "
cd ${TEMP_UNPACK}
# Compiled from source
rm -f \
nvidia-xconfig* \
nvidia-persistenced* \
nvidia-modprobe* \
libnvidia-gtk* nvidia-settings* \
libGLESv1_CM.so.* libGLESv2.so.* libGL.la libGLdispatch.so.* libOpenGL.so.* libGLX.so.* libGL.so.1* libEGL.so.1* \
libnvidia-egl-wayland.so.* \
libOpenCL.so.1* \
32/libGLESv1_CM.so.* 32/libGLESv2.so.* 32/libGL.la 32/libGLdispatch.so.* 32/libOpenGL.so.* 32/libGLX.so.* 32/libGL.so.1* 32/libEGL.so.1* \
32/libOpenCL.so.1*
# Non GLVND libraries
rm -f \
libGL.so.${VERSION} libEGL.so.${VERSION} \
32/libGL.so.${VERSION} 32/libEGL.so.${VERSION}
# Useless with packages
rm -f nvidia-installer* .manifest make* mk* tls_test*
# Add json files in both architectures
cp -f *.json* 32/
cd ..
KMOD=nvidia-kmod-${VERSION}-x86_64
USR_64=nvidia-driver-${VERSION}-x86_64
USR_32=nvidia-driver-${VERSION}-i386
mkdir ${KMOD} ${USR_64} ${USR_32}
mv ${TEMP_UNPACK}/kernel ${KMOD}/
mv ${TEMP_UNPACK}/32/* ${USR_32}/
mv ${TEMP_UNPACK}/* ${USR_64}/
rm -fr ${TEMP_UNPACK}
printf "OK\n"
for tarball in ${KMOD} ${USR_32} ${USR_64}; do
printf "Creating tarball $tarball... "
tar --remove-files -cJf $tarball.tar.xz $tarball
printf "OK\n"
done