-
Notifications
You must be signed in to change notification settings - Fork 4
/
runshrink
executable file
·37 lines (37 loc) · 1.63 KB
/
runshrink
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
#!/usr/bin/env bash
shopt -s extglob
if [ -d RunDir ]
then
rm -rvf RunDir/rootfs/usr/share/locale/!(locale.alias|uk|ru|en|en_US)
rm -rvf RunDir/rootfs/usr/share/gtk-doc/*
rm -rvf RunDir/rootfs/usr/share/man/*
rm -rvf RunDir/rootfs/usr/share/help/*
rm -rvf RunDir/rootfs/usr/share/info/*
rm -rvf RunDir/rootfs/usr/share/doc/*
find RunDir/rootfs/ -type d -name '__pycache__' -exec rm -rvf {} \;
find RunDir/rootfs/ -type f -name '*.pacnew' -exec rm -rvf {} \;
find RunDir/rootfs/ -type f -name '*.pacsave' -exec rm -rvf {} \;
find RunDir/rootfs/var/log/ -type f -name '*.log' -exec rm -rvf {} \;
rm -rvf RunDir/rootfs/var/tmp/*
rm -rvf RunDir/rootfs/var/lib/pacman/sync/*
rm -rvf RunDir/rootfs/var/cache/pacman/pkg/*
rm -rvf RunDir/rootfs/var/lib/pacman/db.lck
rm -rvf RunDir/rootfs/etc/pacman.d/gnupg/pubring.gpg~
rm -rf RunDir/rootfs/var/cache/apt/archives/*.deb
rm -rf RunDir/rootfs/var/cache/apt/*.bin
rm -rf RunDir/rootfs/var/lib/apt/lists/deb.*
rm -rf RunDir/rootfs/var/log/apt/*
nv_version="$(cat /sys/module/nvidia/version 2>/dev/null)"
[ -n "$nv_version" ] && \
find RunDir/rootfs/ -name "*so.$nv_version" -exec rm -rvf {} \;
if [ -f RunDir/rootfs/etc/ld.so.version ]
then
echo "Found ld.so.version!"
rm -rvf RunDir/rootfs/etc/ld.so.version
NO_NVIDIA_CHECK=1 QUIET_MODE=1 ALLOW_BG=0 SANDBOX_NET=0 \
RunDir/Run ldconfig
fi
else
echo "RunDir not found!"
exit 1
fi