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
This commit is contained in:
Jacquin Antoine
2026-06-07 15:35:58 +02:00
parent 967498aee0
commit 5209e5a013
7 changed files with 167 additions and 0 deletions

5
.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
*.tar.gz
*.zip
build-dir/
.flatpak-builder/
idrac-libs/

View File

@ -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

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>com.idrac6.console</id>
<name>iDRAC6 Console</name>
<summary>Dell iDRAC6 Virtual Console</summary>
<metadata_license>MIT</metadata_license>
<description>
<p>Console video pour Dell PowerEdge via iDRAC6.
Lance les fichiers .jnlp de l'iDRAC avec Java 8 et javaws.</p>
</description>
<launchable type="desktop-id">com.idrac6.console.desktop</launchable>
<provides>
<mediatype>application/x-java-jnlp-file</mediatype>
</provides>
<content_rating type="oars-1.1"/>
</component>

4
com.idrac6.console.svg Normal file
View File

@ -0,0 +1,4 @@
<svg xmlns='http://www.w3.org/2000/svg' width='128' height='128' viewBox='0 0 128 128'>
<rect width='128' height='128' rx='16' fill='#0076ce'/>
<text x='64' y='80' text-anchor='middle' font-family='sans-serif' font-size='48' font-weight='bold' fill='white'>i6</text>
</svg>

After

Width:  |  Height:  |  Size: 273 B

81
com.idrac6.console.yaml Normal file
View File

@ -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 <fichier.jnlp>"
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

View File

@ -0,0 +1,4 @@
<svg xmlns='http://www.w3.org/2000/svg' width='128' height='128' viewBox='0 0 128 128'>
<rect width='128' height='128' rx='16' fill='#0076ce'/>
<text x='64' y='80' text-anchor='middle' font-family='sans-serif' font-size='48' font-weight='bold' fill='white'>i6</text>
</svg>

After

Width:  |  Height:  |  Size: 273 B

47
sign-idrac.sh Normal file
View File

@ -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 <fichier.jnlp>"
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>/,/<\/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"