Merge pull request #2451 from Emzy/ops/unfurler-gpu

Install nvidia-driver, xorg and chromium if GPU is pressent on prod install
This commit is contained in:
wiz 2022-08-30 15:35:01 +02:00 committed by GitHub
commit 2f42dc9898
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -400,6 +400,10 @@ FREEBSD_PKG+=(boost-libs autoconf automake gmake gcc libevent libtool pkgconf)
FREEBSD_PKG+=(nginx rsync py39-certbot-nginx mariadb105-server keybase)
FREEBSD_PKG+=(geoipupdate)
FREEBSD_UNFURL_PKG=()
FREEBSD_UNFURL_PKG+=(nvidia-driver-470-470.129.06 chromium xinit xterm twm ja-sourcehansans-otf)
FREEBSD_UNFURL_PKG+=(zh-sourcehansans-sc-otf ko-aleefonts-ttf lohit tlwg-ttf)
#############################
##### utility functions #####
#############################
@ -1431,7 +1435,42 @@ if [ "${UNFURL_INSTALL}" = ON ];then
case $OS in
FreeBSD)
echo "[*] FIXME: Unfurl must be installed manually on FreeBSD"
if pciconf -lv|grep -i nvidia >/dev/null 2>&1;then
echo "[*] GPU detected: Installing packages for Unfurl"
osPackageInstall ${FREEBSD_UNFURL_PKG[@]}
echo 'allowed_users = anybody' >> /usr/local/etc/X11/Xwrapper.config
echo 'kld_list="nvidia"' >> /etc/rc.conf
echo 'nvidia_xorg_enable="YES"' >> /etc/rc.conf
echo "[*] Installing color emoji"
osSudo "${ROOT_USER}" curl "https://github.com/samuelngs/apple-emoji-linux/releases/download/ios-15.4/AppleColorEmoji.ttf" -o /usr/local/share/fonts/TTF/AppleColorEmoji.ttf
cat >> /usr/local/etc/fonts/conf.d/01-emoji.conf <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match>
<test name="family"><string>sans-serif</string></test>
<edit name="family" mode="prepend" binding="strong">
<string>Apple Color Emoji</string>
</edit>
</match>
<match>
<test name="family"><string>serif</string></test>
<edit name="family" mode="prepend" binding="strong">
<string>Apple Color Emoji</string>
</edit>
</match>
<match>
<test name="family"><string>Apple Color Emoji</string></test>
<edit name="family" mode="prepend" binding="strong">
<string>Apple Color Emoji</string>
</edit>
</match>
</fontconfig>
EOF
fi
;;
Debian)