Skip to content

Commit

Permalink
feat: Install GPU drivers
Browse files Browse the repository at this point in the history
feat: Install GPU drivers
  • Loading branch information
kroese committed Oct 9, 2023
2 parents da2123a + e394ddd commit b3cf39e
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 32 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ on:
- '.dockerignore'
- '.github/**'
- '.github/workflows/**'
- 'Dockerfile'

jobs:
shellcheck:
Expand Down
39 changes: 18 additions & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,26 @@ FROM debian:bookworm-slim
ARG DEBCONF_NOWARNINGS="yes"
ARG DEBIAN_FRONTEND noninteractive

RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
ADD_PKG="xserver-xorg-video-intel"; fi && \
apt-get update && apt-get -y upgrade && \
RUN apt-get update && apt-get -y upgrade && \
apt-get --no-install-recommends -y install \
curl \
cpio \
wget \
fdisk \
unzip \
socat \
procps \
xz-utils \
iptables \
iproute2 \
dnsmasq \
net-tools \
ca-certificates \
netcat-openbsd \
qemu-system-x86 \
${ADD_PKG} \
curl \
cpio \
wget \
fdisk \
unzip \
socat \
procps \
xz-utils \
iptables \
iproute2 \
dnsmasq \
net-tools \
ca-certificates \
netcat-openbsd \
qemu-system-x86 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

COPY run/*.sh /run/
COPY agent/*.sh /agent/

Expand All @@ -46,7 +43,7 @@ VOLUME /storage

EXPOSE 22
EXPOSE 80
EXPOSE 139
EXPOSE 139
EXPOSE 445
EXPOSE 5000

Expand Down
26 changes: 17 additions & 9 deletions run/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ if [ -f "${RDC}" ]; then
cp "$TMP/usr/lib/libc.so.6" /lib64/
cp "$TMP/usr/lib/libpthread.so.0" /lib64/
cp "$TMP/usr/lib/ld-linux-x86-64.so.2" /lib64/
fi
fi

mv /run/extract/scemd /run/extract/syno_extract_system_patch
chmod +x /run/extract/syno_extract_system_patch
Expand All @@ -127,28 +127,36 @@ if ((SIZE<250000000)); then
error "The specified PAT file is probably an update pack as it's too small." && exit 62
fi

info "Install: Extracting downloaded image..."

if { tar tf "$PAT"; } >/dev/null 2>&1; then

info "Install: Extracting downloaded image..."
tar xpf "$PAT" -C "$TMP/."

else

export DEBCONF_NOWARNINGS="yes"
export DEBIAN_FRONTEND="noninteractive"

if [ "$ARCH" != "amd64" ]; then

export DEBCONF_NOWARNINGS="yes"
export DEBIAN_FRONTEND="noninteractive"
info "Install: Installing QEMU..."

apt-get -qq update
apt-get -qq -y upgrade
apt-get -qq update && apt-get -qq -y upgrade
apt-get -qq --no-install-recommends -y install qemu-user > /dev/null

export DEBIAN_FRONTEND=""
export DEBCONF_NOWARNINGS=""
fi

if [[ "${GPU}" == [Yy1]* ]] && [[ "$ARCH" == "amd64" ]]; then

info "Install: Installing GPU drivers..."

apt-get -qq update && apt-get -qq -y upgrade
apt-get -qq --no-install-recommends -y install xserver-xorg-video-intel > /dev/null

fi

info "Install: Extracting downloaded image..."

export LD_LIBRARY_PATH="/run/extract"

if [ "$ARCH" == "amd64" ]; then
Expand Down
1 change: 0 additions & 1 deletion run/network.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ configureNAT () {

ip link set dev "${VM_NET_TAP}" master dockerbridge


# Add internet connection to the VM
IP=$(ip address show dev "${VM_NET_DEV}" | grep inet | awk '/inet / { print $2 }' | cut -f1 -d/)

Expand Down

0 comments on commit b3cf39e

Please sign in to comment.