From 5209e5a01310d629b934694a9768aa6da367a245 Mon Sep 17 00:00:00 2001 From: Jacquin Antoine Date: Sun, 7 Jun 2026 15:35:58 +0200 Subject: [PATCH] Add Flatpak packaging for iDRAC6 console - Manifest, desktop entry, metainfo, icon - Direct Java launch (no javaws/IcedTea-Web) - Bundles avctKVM.jar and native .so libs - Parses JNLP for connection parameters - sign-idrac.sh helper script --- .gitignore | 5 ++ com.idrac6.console.desktop | 10 ++++ com.idrac6.console.metainfo.xml | 16 ++++++ com.idrac6.console.svg | 4 ++ com.idrac6.console.yaml | 81 +++++++++++++++++++++++++++ icons/scalable/com.idrac6.console.svg | 4 ++ sign-idrac.sh | 47 ++++++++++++++++ 7 files changed, 167 insertions(+) create mode 100644 .gitignore create mode 100644 com.idrac6.console.desktop create mode 100644 com.idrac6.console.metainfo.xml create mode 100644 com.idrac6.console.svg create mode 100644 com.idrac6.console.yaml create mode 100644 icons/scalable/com.idrac6.console.svg create mode 100644 sign-idrac.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f0b417b --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +*.tar.gz +*.zip +build-dir/ +.flatpak-builder/ +idrac-libs/ \ No newline at end of file diff --git a/com.idrac6.console.desktop b/com.idrac6.console.desktop new file mode 100644 index 0000000..f8c984d --- /dev/null +++ b/com.idrac6.console.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=iDRAC6 Console +Comment=Dell iDRAC6 Virtual Console +Exec=idrac-console %f +Icon=com.idrac6.console +Terminal=false +Type=Application +Categories=Network;RemoteAccess; +MimeType=application/x-java-jnlp-file; +StartupNotify=true \ No newline at end of file diff --git a/com.idrac6.console.metainfo.xml b/com.idrac6.console.metainfo.xml new file mode 100644 index 0000000..c78c250 --- /dev/null +++ b/com.idrac6.console.metainfo.xml @@ -0,0 +1,16 @@ + + + com.idrac6.console + iDRAC6 Console + Dell iDRAC6 Virtual Console + MIT + +

Console video pour Dell PowerEdge via iDRAC6. + Lance les fichiers .jnlp de l'iDRAC avec Java 8 et javaws.

+
+ com.idrac6.console.desktop + + application/x-java-jnlp-file + + +
\ No newline at end of file diff --git a/com.idrac6.console.svg b/com.idrac6.console.svg new file mode 100644 index 0000000..057bc63 --- /dev/null +++ b/com.idrac6.console.svg @@ -0,0 +1,4 @@ + + +i6 + \ No newline at end of file diff --git a/com.idrac6.console.yaml b/com.idrac6.console.yaml new file mode 100644 index 0000000..fb5eb7a --- /dev/null +++ b/com.idrac6.console.yaml @@ -0,0 +1,81 @@ +app-id: com.idrac6.console +runtime: org.freedesktop.Platform +runtime-version: '23.08' +sdk: org.freedesktop.Sdk +command: idrac-console +finish-args: + - --share=network + - --socket=x11 + - --socket=pulseaudio + - --device=dri + - --filesystem=home:ro + +modules: + - name: java8 + buildsystem: simple + build-commands: + - mkdir -p /app/java8 /app/bin + - tar xzf java8.tar.gz -C /app/java8 --strip-components=1 + - ln -s /app/java8/bin/java /app/bin/java + - sed -i 's/^jdk.tls.disabledAlgorithms=.*/jdk.tls.disabledAlgorithms=SSLv3/' /app/java8/lib/security/java.security + - sed -i 's/^jdk.certpath.disabledAlgorithms=.*/jdk.certpath.disabledAlgorithms=MD2/' /app/java8/lib/security/java.security + sources: + - type: file + dest-filename: java8.tar.gz + path: java8.tar.gz + sha256: 0ac516cc1eadffb4cd3cfc9736a33d58ea6a396bf85729036c973482f7c063d9 + + - name: idrac-libs + buildsystem: simple + build-commands: + - mkdir -p /app/idrac/lib + - install -Dm644 avctKVM.jar /app/idrac/avctKVM.jar + - install -Dm755 libavctKVMIO.so /app/idrac/lib/libavctKVMIO.so + - install -Dm755 libavmlinux.so /app/idrac/lib/libavmlinux.so + sources: + - type: file + path: idrac-libs/avctKVM.jar + sha256: 913321bc2aa33daba0b4033a57298a9f9181a034a5945a335b963e7badbe558c + - type: file + path: idrac-libs/lib/libavctKVMIO.so + dest-filename: libavctKVMIO.so + sha256: 70dce29ddcf9ffddfa5c47443a6dad52097d0e7630a6820ed34075a47efcf64d + - type: file + path: idrac-libs/lib/libavmlinux.so + dest-filename: libavmlinux.so + sha256: 379fbff2e3dc4e4661b62eeca9fd6520990b7dcf8f2ca8e9fd7068973b451f2a + + - name: idrac-console + buildsystem: simple + build-commands: + - install -Dm755 idrac-console /app/bin/idrac-console + - install -Dm644 com.idrac6.console.desktop /app/share/applications/com.idrac6.console.desktop + - install -Dm644 com.idrac6.console.metainfo.xml /app/share/metainfo/com.idrac6.console.metainfo.xml + - install -Dm644 com.idrac6.console.svg /app/share/icons/hicolor/scalable/apps/com.idrac6.console.svg + sources: + - type: script + dest-filename: idrac-console + commands: + - | + JNLP="$1" + if [ -z "$JNLP" ]; then + echo "Usage: flatpak run com.idrac6.console " + exit 1 + fi + - | + IP=$(grep -oP 'argument>ip=\K[^<]+' "$JNLP" | head -1) + USER=$(grep -oP 'argument>user=\K[^<]+' "$JNLP" | head -1) + PASSWD=$(grep -oP 'argument>passwd=\K[^<]+' "$JNLP" | head -1) + KMPORT=$(grep -oP 'argument>kmport=\K[^<]+' "$JNLP" | head -1) + VPORT=$(grep -oP 'argument>vport=\K[^<]+' "$JNLP" | head -1) + KMPORT=${KMPORT:-5900} + VPORT=${VPORT:-5900} + - | + export JAVA_HOME=/app/java8 + exec /app/java8/bin/java -cp /app/idrac/avctKVM.jar -Djava.library.path=/app/idrac/lib com.avocent.idrac.kvm.Main ip="$IP" kmport="$KMPORT" vport="$VPORT" user="$USER" passwd="$PASSWD" apcp=1 version=2 vmprivilege=true + - type: file + path: com.idrac6.console.desktop + - type: file + path: com.idrac6.console.metainfo.xml + - type: file + path: com.idrac6.console.svg \ No newline at end of file diff --git a/icons/scalable/com.idrac6.console.svg b/icons/scalable/com.idrac6.console.svg new file mode 100644 index 0000000..057bc63 --- /dev/null +++ b/icons/scalable/com.idrac6.console.svg @@ -0,0 +1,4 @@ + + +i6 + \ No newline at end of file diff --git a/sign-idrac.sh b/sign-idrac.sh new file mode 100644 index 0000000..0e697ba --- /dev/null +++ b/sign-idrac.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# Signe les JARs iDRAC avec un certificat auto-signe +# et patch le JNLP pour utiliser les JARs locaux signes + +JNLP_FILE="$1" + +if [ -z "$JNLP_FILE" ]; then + echo "Usage: sign-idrac.sh " + exit 1 +fi + +CODEBASE=$(grep -oP 'codebase="[^"]*"' "$JNLP_FILE" | head -1 | sed 's/codebase="//;s/"//') +KEYSTORE="/tmp/idrac-keystore" +LIBS_DIR="/tmp/idrac-libs" +SIGNED_DIR="/tmp/idrac-signed" +STOREPASS="idrac123" + +# Generer un certificat auto-signe +keytool -genkeypair -alias idrac -keystore "$KEYSTORE" -storepass "$STOREPASS" \ + -keypass "$STOREPASS" -keyalg RSA -keysize 2048 \ + -dname "CN=iDRAC6, OU=Dell, O=Dell, L=Austin, ST=TX, C=US" 2>/dev/null + +mkdir -p "$LIBS_DIR" "$SIGNED_DIR" + +export OPENSSL_CONF=/opt/idrac/openssl_legacy.cnf + +# Telecharger les JARs si pas deja presents +for JAR in avctKVM.jar avctKVMIOLinux64.jar avctVMLinux64.jar; do + if [ ! -f "$LIBS_DIR/$JAR" ]; then + curl -k --ciphers 'DEFAULT:@SECLEVEL=0' -o "$LIBS_DIR/$JAR" "${CODEBASE}/software/${JAR}" --connect-timeout 10 --max-time 60 2>/dev/null + fi + # Signer le JAR + jarsigner -keystore "$KEYSTORE" -storepass "$STOREPASS" -keypass "$STOREPASS" \ + "$LIBS_DIR/$JAR" idrac 2>/dev/null + cp "$LIBS_DIR/$JAR" "$SIGNED_DIR/" +done + +# Creer le JNLP patche avec les JARs locaux signes +PATCHED="/tmp/viewer-signed.jnlp" +sed '//,/<\/security>/d' "$JNLP_FILE" > "$PATCHED" + +echo "" +echo "JARs signes dans $SIGNED_DIR/" +echo "JNLP patche dans $PATCHED" +echo "" +echo "Lancez avec :" +echo " javaws -nosecurity $PATCHED" \ No newline at end of file