fix: make the dmidecode creation a single line runner

This commit is contained in:
ATAlgaba
2026-01-18 20:16:17 +01:00
committed by IhToN
parent 750bb97242
commit fa48a4c6f4

View File

@@ -50,31 +50,8 @@ COPY --chmod=755 ./lib /egg-hytale/lib
RUN sed -i 's/\r$//' /egg-hytale/lib/*.sh
# Create dmidecode shim for Docker usage
RUN echo "Creating local dmidecode for Docker usage." && \
cat > /usr/local/bin/dmidecode << 'EOF'
#!/bin/sh
if [ "$1" = "-s" ] && [ "$2" = "system-uuid" ]; then
UUID_FILE="$HOME/.hytale_system_uuid"
RUN echo "Creating local dmidecode for Docker usage." && printf '#!/bin/sh\nif [ "$1" = "-s" ] && [ "$2" = "system-uuid" ]; then\n UUID_FILE="$HOME/.hytale_system_uuid"\n\n if [ -f "$UUID_FILE" ]; then\n cat "$UUID_FILE"\n else\n if command -v uuidgen >/dev/null 2>&1; then\n uuidgen | tr "A-Z" "a-z" | tee "$UUID_FILE" >/dev/null\n else\n cat /proc/sys/kernel/random/uuid | tee "$UUID_FILE" >/dev/null\n fi\n cat "$UUID_FILE"\n fi\n\n printf "\\n"\n exit 0\nfi\n\necho "dmidecode shim: unsupported args: $*" >&2\nexit 1\n' > /usr/local/bin/dmidecode && chmod +x /usr/local/bin/dmidecode
if [ -f "$UUID_FILE" ]; then
cat "$UUID_FILE"
else
if command -v uuidgen >/dev/null 2>&1; then
uuidgen | tr "A-Z" "a-z" | tee "$UUID_FILE" >/dev/null
else
cat /proc/sys/kernel/random/uuid | tee "$UUID_FILE" >/dev/null
fi
cat "$UUID_FILE"
fi
printf "\n"
exit 0
fi
echo "dmidecode shim: unsupported args: $*" >&2
exit 1
EOF
RUN chmod +x /usr/local/bin/dmidecode
RUN sed -i 's/\r$//' /entrypoint.sh
# Create the container user