Add rustdesk support

parent 1331ec71
...@@ -1144,6 +1144,20 @@ class InstallerWorker(QThread): ...@@ -1144,6 +1144,20 @@ class InstallerWorker(QThread):
except Exception as e: except Exception as e:
self.log(f"Warning: Unexpected error unmounting {mount_point}: {str(e)}") self.log(f"Warning: Unexpected error unmounting {mount_point}: {str(e)}")
# Unmount the target disk
self.log("Unmounting target disk...")
try:
clean_env = self._clean_env()
result = subprocess.run(['umount', target_mount], capture_output=True, text=True, check=True, env=clean_env)
self.log("Successfully unmounted target disk")
except subprocess.CalledProcessError as e:
if 'not mounted' in e.stderr or e.returncode == 32:
self.log("Target disk not mounted, skipping unmount")
else:
self.log(f"Warning: Failed to unmount target disk: {e.stderr}")
except Exception as e:
self.log(f"Warning: Unexpected error unmounting target disk: {str(e)}")
self.log("Target system configuration completed") self.log("Target system configuration completed")
def _apply_network_config_to_target(self, target_mount): def _apply_network_config_to_target(self, target_mount):
...@@ -1161,7 +1175,7 @@ class InstallerWorker(QThread): ...@@ -1161,7 +1175,7 @@ class InstallerWorker(QThread):
self.log(f"Applying network configuration for {selected_interface} ({interface_type})") self.log(f"Applying network configuration for {selected_interface} ({interface_type})")
# Create interfaces configuration - same format as auto-installer.sh # Create interfaces configuration - same format as auto-installer.sh
interfaces_content = "# Network configuration applied during installation\nauto lo\niface lo inet loopback\n\nauto {selected_interface}\n" interfaces_content = f"# Network configuration applied during installation\nauto lo\niface lo inet loopback\n\nauto {selected_interface}\n"
if ip_method == "DHCP (automatic)": if ip_method == "DHCP (automatic)":
interfaces_content += f"iface {selected_interface} inet dhcp\n" interfaces_content += f"iface {selected_interface} inet dhcp\n"
...@@ -1590,6 +1604,18 @@ z6:6:respawn:/sbin/sulogin ...@@ -1590,6 +1604,18 @@ z6:6:respawn:/sbin/sulogin
# GRUB installation with enhanced error handling and clean environment # GRUB installation with enhanced error handling and clean environment
self.log(f"Installing GRUB bootloader on {target_disk}...") self.log(f"Installing GRUB bootloader on {target_disk}...")
# Ensure dhcpcd.conf has IPv6 disabled if it exists
dhcpcd_conf_path = f"{target_mount}/etc/dhcpcd.conf"
if os.path.exists(dhcpcd_conf_path):
with open(dhcpcd_conf_path, 'r') as f:
content = f.read()
if 'noipv6rs' not in content:
with open(dhcpcd_conf_path, 'a') as f:
f.write('noipv6rs\n')
if 'noipv6' not in content:
with open(dhcpcd_conf_path, 'a') as f:
f.write('noipv6\n')
try: try:
# First, try to install GRUB # First, try to install GRUB
cmd = ['chroot', target_mount, 'grub-install', target_disk] cmd = ['chroot', target_mount, 'grub-install', target_disk]
...@@ -1778,7 +1804,7 @@ class AutoInstallerGUI(QMainWindow): ...@@ -1778,7 +1804,7 @@ class AutoInstallerGUI(QMainWindow):
copy_layout.setContentsMargins(5, 5, 5, 5) # Reduce margins copy_layout.setContentsMargins(5, 5, 5, 5) # Reduce margins
self.copy_progress_text = QTextEdit() self.copy_progress_text = QTextEdit()
self.copy_progress_text.setReadOnly(True) self.copy_progress_text.setReadOnly(True)
self.copy_progress_text.setMaximumHeight(50) # Reduced from 60 self.copy_progress_text.setMaximumHeight(150)
self.copy_progress_text.setFont(QFont("Monospace", 7)) # Smaller font self.copy_progress_text.setFont(QFont("Monospace", 7)) # Smaller font
copy_layout.addWidget(self.copy_progress_text) copy_layout.addWidget(self.copy_progress_text)
layout.addWidget(copy_group) layout.addWidget(copy_group)
......
...@@ -31,40 +31,40 @@ LB_ARCHIVE_AREAS="main contrib non-free non-free-firmware" ...@@ -31,40 +31,40 @@ LB_ARCHIVE_AREAS="main contrib non-free non-free-firmware"
LB_PARENT_ARCHIVE_AREAS="main contrib non-free non-free-firmware" LB_PARENT_ARCHIVE_AREAS="main contrib non-free non-free-firmware"
# Set parent mirror to bootstrap from # Set parent mirror to bootstrap from
LB_PARENT_MIRROR_BOOTSTRAP="http://packages.devuan.org/merged/" LB_PARENT_MIRROR_BOOTSTRAP="http://deb.devuan.org/merged/"
# Set parent mirror to fetch packages from # Set parent mirror to fetch packages from
LB_PARENT_MIRROR_CHROOT="http://packages.devuan.org/merged/" LB_PARENT_MIRROR_CHROOT="http://deb.devuan.org/merged/"
# Set security parent mirror to fetch packages from # Set security parent mirror to fetch packages from
LB_PARENT_MIRROR_CHROOT_SECURITY="http://security.debian.org/" LB_PARENT_MIRROR_CHROOT_SECURITY="http://security.debian.org/"
# Set parent mirror which ends up in the image # Set parent mirror which ends up in the image
LB_PARENT_MIRROR_BINARY="http://packages.devuan.org/merged/" LB_PARENT_MIRROR_BINARY="http://deb.devuan.org/merged/"
# Set security parent mirror which ends up in the image # Set security parent mirror which ends up in the image
LB_PARENT_MIRROR_BINARY_SECURITY="http://security.debian.org/" LB_PARENT_MIRROR_BINARY_SECURITY="http://security.debian.org/"
# Set debian-installer parent mirror # Set debian-installer parent mirror
LB_PARENT_MIRROR_DEBIAN_INSTALLER="http://packages.devuan.org/merged/" LB_PARENT_MIRROR_DEBIAN_INSTALLER="http://deb.devuan.org/merged/"
# Set mirror to bootstrap from # Set mirror to bootstrap from
LB_MIRROR_BOOTSTRAP="http://packages.devuan.org/merged/" LB_MIRROR_BOOTSTRAP="http://deb.devuan.org/merged/"
# Set mirror to fetch packages from # Set mirror to fetch packages from
LB_MIRROR_CHROOT="http://packages.devuan.org/merged/" LB_MIRROR_CHROOT="http://deb.devuan.org/merged/"
# Set security mirror to fetch packages from # Set security mirror to fetch packages from
LB_MIRROR_CHROOT_SECURITY="http://security.debian.org/" LB_MIRROR_CHROOT_SECURITY="http://security.debian.org/"
# Set mirror which ends up in the image # Set mirror which ends up in the image
LB_MIRROR_BINARY="http://packages.devuan.org/merged/" LB_MIRROR_BINARY="http://deb.devuan.org/merged/"
# Set security mirror which ends up in the image # Set security mirror which ends up in the image
LB_MIRROR_BINARY_SECURITY="http://security.debian.org/" LB_MIRROR_BINARY_SECURITY="http://security.debian.org/"
# Set debian-installer mirror # Set debian-installer mirror
LB_MIRROR_DEBIAN_INSTALLER="http://packages.devuan.org/merged/" LB_MIRROR_DEBIAN_INSTALLER="http://deb.devuan.org/merged/"
# Set architectures to use foreign bootstrap # Set architectures to use foreign bootstrap
LB_BOOTSTRAP_QEMU_ARCHITECTURE="" LB_BOOTSTRAP_QEMU_ARCHITECTURE=""
......
...@@ -10,7 +10,7 @@ d-i keyboard-configuration/xkb-keymap select us ...@@ -10,7 +10,7 @@ d-i keyboard-configuration/xkb-keymap select us
d-i netcfg/choose_interface select auto d-i netcfg/choose_interface select auto
# User accounts - predefined (root password set by set_root_password.sh) # User accounts - predefined (root password set by set_root_password.sh)
d-i passwd/root-password-crypted password $1$T6o3t4tQ$imuJB2Kmg.vBLvCBxyJgM0 d-i passwd/root-password password changeme
d-i passwd/make-user boolean false d-i passwd/make-user boolean false
# Time configuration - predefined # Time configuration - predefined
......
# Devuan merged repository with main, contrib, non-free, and non-free-firmware # Devuan merged repository with main, contrib, non-free, and non-free-firmware
deb http://packages.devuan.org/merged testing main contrib non-free non-free-firmware deb http://deb.devuan.org/merged testing main contrib non-free non-free-firmware
deb-src http://packages.devuan.org/merged testing main contrib non-free non-free-firmware deb-src http://deb.devuan.org/merged testing main contrib non-free non-free-firmware
# Additional Debian repository for firmware packages not available in Devuan # Additional Debian repository for firmware packages not available in Devuan
deb http://deb.debian.org/debian testing main contrib non-free non-free-firmware deb http://deb.debian.org/debian testing main contrib non-free non-free-firmware
...@@ -8,4 +8,4 @@ deb-src http://deb.debian.org/debian testing main contrib non-free non-free-firm ...@@ -8,4 +8,4 @@ deb-src http://deb.debian.org/debian testing main contrib non-free non-free-firm
# Debian security updates # Debian security updates
deb http://deb.debian.org/debian-security testing-security main contrib non-free non-free-firmware deb http://deb.debian.org/debian-security testing-security main contrib non-free non-free-firmware
deb-src http://deb.debian.org/debian-security testing-security main contrib non-free non-free-firmware deb-src http://deb.debian.org/debian-security testing-security main contrib non-free non-free-firmware
\ No newline at end of file
...@@ -11,10 +11,5 @@ if grep -q "boot=live" /proc/cmdline || [ -f /lib/live/mount/medium/.disk/info ] ...@@ -11,10 +11,5 @@ if grep -q "boot=live" /proc/cmdline || [ -f /lib/live/mount/medium/.disk/info ]
else else
# We're on an installed system, run normal startup # We're on an installed system, run normal startup
echo "$(date): Installed system detected, running normal startup" >> /var/log/autoinstall.log echo "$(date): Installed system detected, running normal startup" >> /var/log/autoinstall.log
echo "$(date): MBetterClient wrapper launched by .xinitrc to avoid duplicates" >> /var/log/autoinstall.log
# Start the MbetterClient
if [ -x /usr/local/bin/MbetterClient ]; then
/usr/local/bin/MbetterClient --web-host 0.0.0.0 &
echo "$(date): MbetterClient started" >> /var/log/autoinstall.log
fi
fi fi
\ No newline at end of file
...@@ -7,26 +7,49 @@ openbox-session & ...@@ -7,26 +7,49 @@ openbox-session &
# Wait for window manager to be ready # Wait for window manager to be ready
sleep 2 sleep 2
# Start auto-installer GUI if available, fallback to script # Check if we're running from live environment (CD/DVD or USB)
if [ -x /usr/local/bin/autoinstallergui ]; then if grep -q "boot=live" /proc/cmdline || [ -f /lib/live/mount/medium/.disk/info ] || [ -f /run/live/medium/.disk/info ] || [ -d /lib/live ]; then
# Launch GUI in a visible terminal window # We're on the live CD - launch autoinstaller
if command -v xterm >/dev/null 2>&1; then echo "$(date): Live CD detected - launching autoinstaller" >> /var/log/autoinstall.log
xterm -e '/usr/local/bin/autoinstallergui' &
elif command -v lxterminal >/dev/null 2>&1; then # Start auto-installer GUI if available, fallback to script
lxterminal -e '/usr/local/bin/autoinstallergui' & if [ -x /usr/local/bin/autoinstallergui ]; then
else # Launch GUI in a visible terminal window
# Fallback: run directly if command -v xterm >/dev/null 2>&1; then
/usr/local/bin/autoinstallergui & xterm -e '/usr/local/bin/autoinstallergui' &
elif command -v lxterminal >/dev/null 2>&1; then
lxterminal -e '/usr/local/bin/autoinstallergui' &
else
# Fallback: run directly
/usr/local/bin/autoinstallergui &
fi
elif [ -x /usr/local/bin/auto-installer.sh ]; then
# Launch script in a visible terminal window
if command -v xterm >/dev/null 2>&1; then
xterm -e '/usr/local/bin/auto-installer.sh' &
elif command -v lxterminal >/dev/null 2>&1; then
lxterminal -e '/usr/local/bin/auto-installer.sh' &
else
# Fallback: run directly (zenity dialogs will still work)
/usr/local/bin/auto-installer.sh &
fi
fi fi
elif [ -x /usr/local/bin/auto-installer.sh ]; then else
# Launch script in a visible terminal window # We're on an installed system - launch MBetterClient
if command -v xterm >/dev/null 2>&1; then echo "$(date): Installed system detected - launching MBetterClient" >> /var/log/autoinstall.log
xterm -e '/usr/local/bin/auto-installer.sh' &
elif command -v lxterminal >/dev/null 2>&1; then # Start the MbetterClient wrapper in a terminal
lxterminal -e '/usr/local/bin/auto-installer.sh' & if [ -x /usr/local/bin/MbetterClient_wrapper.sh ]; then
else # Launch in xterm so errors are visible if it crashes
# Fallback: run directly (zenity dialogs will still work) if command -v xterm >/dev/null 2>&1; then
/usr/local/bin/auto-installer.sh & xterm -e '/usr/local/bin/MbetterClient_wrapper.sh --ssl --web-host 0.0.0.0' &
elif command -v lxterminal >/dev/null 2>&1; then
lxterminal -e '/usr/local/bin/MbetterClient_wrapper.sh --ssl --web-host 0.0.0.0' &
else
# Fallback: run directly (errors won't be visible)
/usr/local/bin/MbetterClient_wrapper.sh --ssl --web-host 0.0.0.0 &
fi
echo "$(date): MbetterClient wrapper started in terminal" >> /var/log/autoinstall.log
fi fi
fi fi
......
...@@ -7,195 +7,6 @@ echo "=== MbetterClient Comprehensive Compatibility Wrapper ===" ...@@ -7,195 +7,6 @@ echo "=== MbetterClient Comprehensive Compatibility Wrapper ==="
echo "Detecting environment and applying optimal settings..." echo "Detecting environment and applying optimal settings..."
echo "" echo ""
# Function to detect virtualization
detect_virtualization() {
local VIRT_TYPE=""
# VMware detection
if [ -f "/proc/driver/vmwgfx/version" ] || \
grep -q "VMware" /proc/scsi/scsi 2>/dev/null || \
lspci 2>/dev/null | grep -i vmware >/dev/null 2>&1; then
VIRT_TYPE="VMware"
fi
# VirtualBox detection
if [ -z "$VIRT_TYPE" ]; then
if [ -f "/proc/driver/vboxdrv" ] || \
lsmod 2>/dev/null | grep -q vbox || \
lspci 2>/dev/null | grep -i virtualbox >/dev/null 2>&1; then
VIRT_TYPE="VirtualBox"
fi
fi
# Other virtualization detection
if [ -z "$VIRT_TYPE" ]; then
if grep -q "QEMU" /proc/cpuinfo 2>/dev/null || \
[ -f "/dev/kvm" ] || \
systemd-detect-virt 2>/dev/null | grep -v "none" >/dev/null 2>&1; then
VIRT_TYPE="Other"
fi
fi
echo "$VIRT_TYPE"
}
# Function to test hardware acceleration
test_hw_acceleration() {
echo "Testing hardware acceleration availability..."
# Test 1: Check for NVIDIA GPU
if command -v nvidia-smi >/dev/null 2>&1; then
if nvidia-smi --query-gpu=name --format=csv,noheader >/dev/null 2>&1; then
echo "✓ NVIDIA GPU detected"
return 0
fi
fi
# Test 2: Check for AMD GPU
if lspci 2>/dev/null | grep -i "vga\|3d\|display" | grep -i "amd\|ati\|radeon" >/dev/null 2>&1; then
echo "✓ AMD GPU detected"
return 0
fi
# Test 3: Check for Intel integrated graphics
if lspci 2>/dev/null | grep -i "vga\|3d\|display" | grep -i "intel" >/dev/null 2>&1; then
echo "✓ Intel integrated graphics detected"
return 0
fi
# Test 4: Try to initialize OpenGL context
if command -v glxinfo >/dev/null 2>&1; then
if glxinfo 2>/dev/null | grep -q "OpenGL version"; then
echo "✓ OpenGL context available"
return 0
fi
fi
# Test 5: Check Vulkan availability
if command -v vulkaninfo >/dev/null 2>&1; then
if vulkaninfo --summary >/dev/null 2>&1; then
echo "✓ Vulkan available"
return 0
fi
fi
echo "✗ No hardware acceleration detected"
return 1
}
# Function to setup Mesa software rendering with optimizations
setup_mesa_software() {
echo "Setting up Mesa software rendering with transparency optimizations..."
# Create optimized temp directory
USER_TEMP="$HOME/.cache/MbetterClient"
mkdir -p "$USER_TEMP"
# Redirect all temp directories
export TMPDIR="$USER_TEMP"
export TEMP="$USER_TEMP"
export TMP="$USER_TEMP"
export XDG_RUNTIME_DIR="$USER_TEMP"
# Mesa software rendering optimizations
export LIBGL_ALWAYS_SOFTWARE=1
export MESA_GL_VERSION_OVERRIDE=3.3
export MESA_GLSL_VERSION_OVERRIDE=330
export LP_NUM_THREADS=$(nproc) # Use all CPU cores
export MESA_GLSL_CACHE_DISABLE=0 # Enable GLSL caching
export MESA_SHADER_CACHE_DISABLE=0 # Enable shader caching
export MESA_NO_VULKAN=1 # Disable Vulkan in Mesa
# MESA TRANSPARENCY FIXES - Critical for overlay transparency
export MESA_GLX_FORCE_ALPHA=1 # Force alpha channel support
export MESA_GLX_FORCE_TRANSPARENT=1 # Force transparency support
export QT_XCB_GL_INTEGRATION=xcb_egl # Better transparency with Mesa
export QT_QPA_PLATFORM=xcb # Ensure XCB platform for transparency
# Qt WebEngine configuration for software rendering
export QTWEBENGINE_CHROMIUM_FLAGS="--no-sandbox --disable-gpu --disable-gpu-sandbox --disable-dev-shm-usage --disable-software-rasterizer --disable-accelerated-video-decode --disable-accelerated-video-encode --disable-gpu-compositing --disable-gpu-rasterization --disable-vulkan --disable-vulkan-surface --disable-features=Vulkan --user-data-dir=$USER_TEMP --enable-transparent-visuals --disable-background-timer-throttling --disable-renderer-backgrounding --disable-vulkan-fallback"
# Qt configuration
export QT_OPENGL=software
export QTWEBENGINE_DISABLE_SANDBOX=1
export QT_QPA_PLATFORM=xcb
export QT_XCB_GL_INTEGRATION=xcb # Better transparency support
export QT_ENABLE_HIGHDPI_SCALING=0 # Better performance
# Vulkan disables
export VK_ICD_FILENAMES=""
export DISABLE_VULKAN=1
export MESA_VK_DISABLE=1
echo "✓ Mesa software rendering configured"
echo "✓ Transparency optimizations enabled"
echo "✓ Multi-threaded rendering: $LP_NUM_THREADS cores"
}
# Function to setup hardware acceleration
setup_hw_acceleration() {
echo "Setting up hardware acceleration..."
# Create temp directory
USER_TEMP="$HOME/.cache/MbetterClient"
mkdir -p "$USER_TEMP"
# Minimal Chromium flags for hardware acceleration
export QTWEBENGINE_CHROMIUM_FLAGS="--user-data-dir=$USER_TEMP"
# Qt configuration for hardware
export QT_QPA_PLATFORM=xcb
export QT_ENABLE_HIGHDPI_SCALING=1
echo "✓ Hardware acceleration enabled"
}
# Main detection and configuration logic
VIRT_TYPE=$(detect_virtualization)
HW_ACCEL=0
if [ -n "$VIRT_TYPE" ]; then
echo "✓ Virtualization detected: $VIRT_TYPE"
NEEDS_SOFTWARE=1
else
echo "✓ Physical hardware detected"
if test_hw_acceleration; then
HW_ACCEL=1
NEEDS_SOFTWARE=0
else
echo "⚠ Hardware acceleration not available or not working"
NEEDS_SOFTWARE=1
fi
fi
# Apply appropriate configuration
if [ $NEEDS_SOFTWARE -eq 1 ]; then
echo ""
echo "=== Applying Software Rendering Configuration ==="
setup_mesa_software
CONFIG_TYPE="Mesa Software Rendering (Optimized)"
else
echo ""
echo "=== Applying Hardware Acceleration Configuration ==="
setup_hw_acceleration
CONFIG_TYPE="Hardware Acceleration"
fi
# Final setup
echo ""
echo "=== Configuration Summary ==="
echo "Environment: $(if [ -n "$VIRT_TYPE" ]; then echo "$VIRT_TYPE VM"; else echo "Physical Hardware"; fi)"
echo "Acceleration: $(if [ $HW_ACCEL -eq 1 ]; then echo "Hardware"; else echo "Software"; fi)"
echo "Rendering: $CONFIG_TYPE"
echo "Temp Directory: $USER_TEMP"
echo ""
# Verify binary exists
if [ ! -f "/usr/local/bin/MbetterClient" ]; then
echo "ERROR: MbetterClient binary not found in current directory"
echo "Please run this script from the directory containing MbetterClient"
exit 1
fi
echo "Starting MbetterClient..." echo "Starting MbetterClient..."
echo "==========================================" echo "=========================================="
......
...@@ -869,7 +869,17 @@ EOF ...@@ -869,7 +869,17 @@ EOF
# Install bootloader # Install bootloader
install_bootloader() { install_bootloader() {
print_header "Installing Bootloader" print_header "Installing Bootloader"
# Ensure dhcpcd.conf has IPv6 disabled if it exists
if [ -f "$TARGET_MOUNT/etc/dhcpcd.conf" ]; then
if ! grep -q "noipv6rs" "$TARGET_MOUNT/etc/dhcpcd.conf"; then
echo "noipv6rs" >> "$TARGET_MOUNT/etc/dhcpcd.conf"
fi
if ! grep -q "noipv6" "$TARGET_MOUNT/etc/dhcpcd.conf"; then
echo "noipv6" >> "$TARGET_MOUNT/etc/dhcpcd.conf"
fi
fi
print_status "Installing GRUB to $TARGET_DISK..." print_status "Installing GRUB to $TARGET_DISK..."
chroot "$TARGET_MOUNT" grub-install "$TARGET_DISK" chroot "$TARGET_MOUNT" grub-install "$TARGET_DISK"
chroot "$TARGET_MOUNT" update-grub chroot "$TARGET_MOUNT" update-grub
......
#!/bin/bash
# Configuration
RUSTDESK_SERVER="mbetter.nexlab.net:21116"
CUSTOM_SERVER="mbetter.nexlab.net"
FIXED_PASSWORD="antametro34rt"
RUSTDESK_KEY="MIeh1eaKVfEgjoGFCR4y6j28EVxJNpng7JjBMPk1asM="
CONFIG_DIR=""
RUSTDESK_CMD=""
TEMP_CONFIG="/tmp/RustDesk_mbetter.toml"
CLIENT_ID="r00000000" # Fallback ID
# Check for uuidgen command
if ! command -v uuidgen >/dev/null 2>&1; then
echo "$CLIENT_ID"
exit 1
fi
# Detect installation type, preferring .deb
if command -v rustdesk >/dev/null 2>&1; then
INSTALL_TYPE="deb"
CONFIG_DIR="$HOME/.config/rustdesk"
RUSTDESK_CMD="rustdesk"
elif flatpak list | grep -q "com.rustdesk.RustDesk"; then
INSTALL_TYPE="flatpak"
CONFIG_DIR="$HOME/.var/app/com.rustdesk.RustDesk/config/rustdesk"
RUSTDESK_CMD="flatpak run com.rustdesk.RustDesk"
else
echo "$CLIENT_ID"
exit 1
fi
# Check for start/stop argument
if [ $# -ne 1 ] || [ "$1" != "start" ] && [ "$1" != "stop" ]; then
echo "$CLIENT_ID"
exit 1
fi
ACTION="$1"
CONFIG_FILE="$CONFIG_DIR/RustDesk_mbetter.toml"
DEST_CONFIG="$CONFIG_DIR/RustDesk2.toml"
RUSTDESK_TOML="$CONFIG_DIR/RustDesk.toml"
case "$ACTION" in
start)
# Ensure config directory exists and is writable
mkdir -p "$CONFIG_DIR" >/dev/null 2>&1 || { echo "$CLIENT_ID"; exit 1; }
touch "$CONFIG_DIR/.test_write" >/dev/null 2>&1 || { echo "$CLIENT_ID"; exit 1; }
rm -f "$CONFIG_DIR/.test_write" >/dev/null 2>&1
# Check if config file exists
if [ ! -f "$CONFIG_FILE" ]; then
# Generate a new ID using uuidgen
UUID=$(uuidgen) || { echo "$CLIENT_ID"; exit 1; }
CLIENT_ID="r$UUID"
# Create initial config file in /tmp
cat > "$TEMP_CONFIG" << EOF
rendezvous_server = '$RUSTDESK_SERVER'
nat_type = 1
serial = 0
id = '$CLIENT_ID'
unlock_pin = ''
trusted_devices = ''
[options]
allow-linux-headless = 'Y'
key = '$RUSTDESK_KEY'
custom-rendezvous-server = '$CUSTOM_SERVER'
av1-test = 'Y'
password = '$FIXED_PASSWORD'
EOF
# Copy to RustDesk2.toml, RustDesk.toml, and RustDesk_mbetter.toml
cp "$TEMP_CONFIG" "$DEST_CONFIG" >/dev/null 2>&1 || { echo "$CLIENT_ID"; exit 1; }
cp "$TEMP_CONFIG" "$RUSTDESK_TOML" >/dev/null 2>&1 || { echo "$CLIENT_ID"; exit 1; }
cp "$TEMP_CONFIG" "$CONFIG_FILE" >/dev/null 2>&1 || { echo "$CLIENT_ID"; exit 1; }
else
# Read existing client ID
CLIENT_ID=$(grep "^id = " "$CONFIG_FILE" | cut -d "'" -f 2)
if [ -z "$CLIENT_ID" ]; then
UUID=$(uuidgen) || { echo "r00000000"; exit 1; }
CLIENT_ID="r$UUID"
sed -i "s/^id = .*/id = '$CLIENT_ID'/" "$CONFIG_FILE" >/dev/null 2>&1 || { echo "r00000000"; exit 1; }
fi
fi
# Output the ID
echo "$CLIENT_ID"
# Launch RustDesk if command is valid
if command -v "$RUSTDESK_CMD" >/dev/null 2>&1 || [ "$INSTALL_TYPE" = "flatpak" ]; then
$RUSTDESK_CMD >/dev/null 2>&1 &
sleep 2
# Reapply config to RustDesk_mbetter.toml
cat > "$CONFIG_FILE" << EOF
rendezvous_server = '$RUSTDESK_SERVER'
nat_type = 1
serial = 0
id = '$CLIENT_ID'
unlock_pin = ''
trusted_devices = ''
[options]
allow-linux-headless = 'Y'
key = '$RUSTDESK_KEY'
custom-rendezvous-server = '$CUSTOM_SERVER'
av1-test = 'Y'
password = '$FIXED_PASSWORD'
EOF
fi
;;
stop)
# Suppress all output
exec > /dev/null 2>&1
# Stop RustDesk based on installation type
if [ "$INSTALL_TYPE" = "deb" ]; then
pgrep -x "rustdesk" >/dev/null && pkill -x rustdesk
elif [ "$INSTALL_TYPE" = "flatpak" ]; then
flatpak ps | grep -q "com.rustdesk.RustDesk" && flatpak kill com.rustdesk.RustDesk
fi
;;
esac
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Prefer Devuan packages over Debian when available # Prefer Devuan packages over Debian when available
Package: * Package: *
Pin: origin packages.devuan.org Pin: origin deb.devuan.org
Pin-Priority: 900 Pin-Priority: 900
Package: * Package: *
...@@ -22,4 +22,4 @@ Pin-Priority: 800 ...@@ -22,4 +22,4 @@ Pin-Priority: 800
# Backports for newer packages # Backports for newer packages
Package: * Package: *
Pin: release a=testing-backports Pin: release a=testing-backports
Pin-Priority: 200 Pin-Priority: 200
\ No newline at end of file
# Devuan merged repository with main, contrib, non-free, and non-free-firmware # Devuan merged repository with main, contrib, non-free, and non-free-firmware
deb http://packages.devuan.org/merged testing main contrib non-free non-free-firmware deb http://deb.devuan.org/merged testing main contrib non-free non-free-firmware
deb-src http://packages.devuan.org/merged testing main contrib non-free non-free-firmware deb-src http://deb.devuan.org/merged testing main contrib non-free non-free-firmware
# Debian repository for additional packages and firmware # Debian repository for additional packages and firmware
deb http://deb.debian.org/debian testing main contrib non-free non-free-firmware deb http://deb.debian.org/debian testing main contrib non-free non-free-firmware
...@@ -16,4 +16,4 @@ deb-src http://deb.debian.org/debian testing-updates main contrib non-free non-f ...@@ -16,4 +16,4 @@ deb-src http://deb.debian.org/debian testing-updates main contrib non-free non-f
# Debian backports for additional packages # Debian backports for additional packages
deb http://deb.debian.org/debian testing-backports main contrib non-free non-free-firmware deb http://deb.debian.org/debian testing-backports main contrib non-free non-free-firmware
deb-src http://deb.debian.org/debian testing-backports main contrib non-free non-free-firmware deb-src http://deb.debian.org/debian testing-backports main contrib non-free non-free-firmware
\ No newline at end of file
...@@ -31,34 +31,34 @@ LB_ARCHIVE_AREAS="main contrib non-free non-free-firmware" ...@@ -31,34 +31,34 @@ LB_ARCHIVE_AREAS="main contrib non-free non-free-firmware"
LB_PARENT_ARCHIVE_AREAS="main contrib non-free non-free-firmware" LB_PARENT_ARCHIVE_AREAS="main contrib non-free non-free-firmware"
# Set parent mirror to bootstrap from # Set parent mirror to bootstrap from
LB_PARENT_MIRROR_BOOTSTRAP="http://packages.devuan.org/merged/" LB_PARENT_MIRROR_BOOTSTRAP="http://deb.devuan.org/merged/"
# Set parent mirror to fetch packages from # Set parent mirror to fetch packages from
LB_PARENT_MIRROR_CHROOT="http://packages.devuan.org/merged/" LB_PARENT_MIRROR_CHROOT="http://deb.devuan.org/merged/"
# Set parent mirror which ends up in the image # Set parent mirror which ends up in the image
LB_PARENT_MIRROR_BINARY="http://packages.devuan.org/merged/" LB_PARENT_MIRROR_BINARY="http://deb.devuan.org/merged/"
# Set debian-installer parent mirror # Set debian-installer parent mirror
LB_PARENT_MIRROR_DEBIAN_INSTALLER="http://packages.devuan.org/merged/" LB_PARENT_MIRROR_DEBIAN_INSTALLER="http://deb.devuan.org/merged/"
# Set mirror to bootstrap from # Set mirror to bootstrap from
LB_MIRROR_BOOTSTRAP="http://packages.devuan.org/merged/" LB_MIRROR_BOOTSTRAP="http://deb.devuan.org/merged/"
# Set mirror to fetch packages from # Set mirror to fetch packages from
LB_MIRROR_CHROOT="http://packages.devuan.org/merged/ http://deb.debian.org/debian/" LB_MIRROR_CHROOT="http://deb.devuan.org/merged/ http://deb.debian.org/debian/"
# Set security mirror to fetch packages from # Set security mirror to fetch packages from
LB_MIRROR_CHROOT_SECURITY="http://packages.devuan.org/merged/ http://deb.debian.org/debian-security/" LB_MIRROR_CHROOT_SECURITY="http://deb.devuan.org/merged/ http://deb.debian.org/debian-security/"
# Set mirror which ends up in the image # Set mirror which ends up in the image
LB_MIRROR_BINARY="http://packages.devuan.org/merged/" LB_MIRROR_BINARY="http://deb.devuan.org/merged/"
# Set security mirror which ends up in the image # Set security mirror which ends up in the image
LB_MIRROR_BINARY_SECURITY="http://packages.devuan.org/merged/" LB_MIRROR_BINARY_SECURITY="http://deb.devuan.org/merged/"
# Set debian-installer mirror # Set debian-installer mirror
LB_MIRROR_DEBIAN_INSTALLER="http://packages.devuan.org/merged/" LB_MIRROR_DEBIAN_INSTALLER="http://deb.devuan.org/merged/"
# Set options to use with debootstrap # Set options to use with debootstrap
DEBOOTSTRAP_OPTIONS="--keyring=/usr/share/keyrings/devuan-archive-keyring.gpg" DEBOOTSTRAP_OPTIONS="--keyring=/usr/share/keyrings/devuan-archive-keyring.gpg"
...@@ -70,4 +70,4 @@ LB_BOOTSTRAP_QEMU_ARCHITECTURE="" ...@@ -70,4 +70,4 @@ LB_BOOTSTRAP_QEMU_ARCHITECTURE=""
LB_BOOTSTRAP_QEMU_EXCLUDE="" LB_BOOTSTRAP_QEMU_EXCLUDE=""
# Set static qemu binary for foreign bootstrap # Set static qemu binary for foreign bootstrap
LB_BOOTSTRAP_QEMU_STATIC="" LB_BOOTSTRAP_QEMU_STATIC=""
\ No newline at end of file
...@@ -102,6 +102,9 @@ ffmpeg ...@@ -102,6 +102,9 @@ ffmpeg
# Text editors # Text editors
vim vim
# Core utilities (essential command-line tools)
coreutils
# Graphics and hardware utilities # Graphics and hardware utilities
mesa-utils mesa-utils
vulkan-tools vulkan-tools
......
...@@ -17,7 +17,7 @@ d-i netcfg/choose_interface select auto ...@@ -17,7 +17,7 @@ d-i netcfg/choose_interface select auto
# d-i netcfg/wireless_key string # d-i netcfg/wireless_key string
# User accounts - predefined (root password set by set_root_password.sh) # User accounts - predefined (root password set by set_root_password.sh)
d-i passwd/root-password-crypted password $1$T6o3t4tQ$imuJB2Kmg.vBLvCBxyJgM0 d-i passwd/root-password password changeme
d-i passwd/make-user boolean false d-i passwd/make-user boolean false
# Time configuration - predefined # Time configuration - predefined
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment