Make keycode hack optional

This commit is contained in:
Dominik 2019-04-02 13:17:32 +02:00
parent 356ea9990d
commit 97c1208581
2 changed files with 12 additions and 3 deletions

View File

@ -6,12 +6,15 @@ ENV APP_NAME="iDRAC 6" \
COPY keycode-hack.c /keycode-hack.c COPY keycode-hack.c /keycode-hack.c
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y software-properties-common wget && \ apt-get install -y wget software-properties-common && \
add-apt-repository ppa:openjdk-r/ppa && \ add-apt-repository ppa:openjdk-r/ppa && \
apt-get update && \ apt-get update && \
apt-get install -y openjdk-7-jdk gcc && \ apt-get install -y openjdk-7-jdk gcc && \
gcc -o /keycode-hack.so /keycode-hack.c -shared -s -ldl -fPIC && \ gcc -o /keycode-hack.so /keycode-hack.c -shared -s -ldl -fPIC && \
rm -rf /var/lib/apt/lists/* apt-get remove -y gcc wget software-properties-common && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/* && \
rm /keycode-hack.c
RUN mkdir /app && \ RUN mkdir /app && \
chown ${USER_ID}:${GROUP_ID} /app chown ${USER_ID}:${GROUP_ID} /app

View File

@ -93,4 +93,10 @@ cd /app
echo "${GREEN}Initialization complete, starting virtual console${NC}" echo "${GREEN}Initialization complete, starting virtual console${NC}"
LD_PRELOAD=/keycode-hack.so exec java -cp avctKVM.jar -Djava.library.path="./lib" com.avocent.idrac.kvm.Main ip=${IDRAC_HOST} kmport=5900 vport=5900 user=${IDRAC_USER} passwd=${IDRAC_PASSWORD} apcp=1 version=2 vmprivilege=true "helpurl=https://${IDRAC_HOST}:443/help/contents.html" if [ -n "$ENABLE_KEYCODE_HACK" ]; then
echo "Enabling keycode hack"
export LD_PRELOAD=/keycode-hack.so
fi
exec java -cp avctKVM.jar -Djava.library.path="./lib" com.avocent.idrac.kvm.Main ip=${IDRAC_HOST} kmport=5900 vport=5900 user=${IDRAC_USER} passwd=${IDRAC_PASSWORD} apcp=1 version=2 vmprivilege=true "helpurl=https://${IDRAC_HOST}:443/help/contents.html"