summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYura80 <[email protected]>2020-12-12 01:45:42 -0500
committerGitHub <[email protected]>2020-12-12 09:45:42 +0300
commit273f90ee03d919e1960e9aa749716da75a4b78f3 (patch)
treef1c6182cbd76e23cc6804df80b45d780129b2557
parent0a75d8876e18ba0880dbb7e1f74c2f9cc3a5ceb7 (diff)
Support of alternative boards/SBCs (#19)
* adding rock64 board * fix file permissions * disable atx gpio for rock64 (breaks ethernet); restore package url; fix install * added gpio pin definitions to config * renamed rock64 board to generic * udev rule for generic board, improved device detection * this udev fix should work for most boards: it skips video0 if it's not on USB, and doesn't select video2 * cleanup * improved usb video device selection
-rw-r--r--PKGBUILD1
-rwxr-xr-xconfigs/kvmd/main/v2-hdmiusb-generic.yaml70
-rw-r--r--configs/os/udev/v2-hdmiusb-generic.rules5
-rw-r--r--kvmd.install4
4 files changed, 78 insertions, 2 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 475a1375..d6fc4bda 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -16,6 +16,7 @@ _variants=(
v2-hdmi:rpi4
v2-hdmiusb:rpi4
+ v2-hdmiusb:generic
)
diff --git a/configs/kvmd/main/v2-hdmiusb-generic.yaml b/configs/kvmd/main/v2-hdmiusb-generic.yaml
new file mode 100755
index 00000000..1f96865b
--- /dev/null
+++ b/configs/kvmd/main/v2-hdmiusb-generic.yaml
@@ -0,0 +1,70 @@
+# Don't touch this file otherwise your device may stop working.
+# Use override.yaml to modify required settings.
+# You can find a working configuration in /usr/share/kvmd/configs.default/kvmd.
+
+override: !include override.yaml
+
+logging: !include logging.yaml
+
+kvmd:
+ server:
+ unix: /run/kvmd/kvmd.sock
+
+ auth: !include auth.yaml
+
+ hid:
+ type: otg
+ keyboard:
+ device: /dev/kvmd-hid-keyboard
+ mouse:
+ device: /dev/kvmd-hid-mouse
+
+ atx:
+ type: disabled
+
+ msd:
+ type: otg
+
+ streamer:
+ quality: 0
+ resolution: 1920x1080
+ available_resolutions:
+ - 1920x1080
+ - 1600x1200
+ - 1360x768
+ - 1280x1024
+ - 1280x960
+ - 1280x720
+ - 1024x768
+ - 800x600
+ - 720x576
+ - 720x480
+ - 640x480
+ unix: /run/kvmd/ustreamer.sock
+ cmd:
+ - "/usr/bin/ustreamer"
+ - "--device=/dev/kvmd-video"
+ - "--persistent"
+ - "--format=jpeg"
+ - "--resolution={resolution}"
+ - "--desired-fps={desired_fps}"
+ - "--drop-same-frames=30"
+ - "--last-as-blank=0"
+ - "--unix={unix}"
+ - "--unix-rm"
+ - "--unix-mode=0660"
+ - "--exit-on-parent-death"
+ - "--process-name-prefix={process_name_prefix}"
+ - "--notify-parent"
+ - "--no-log-colors"
+
+ipmi:
+ kvmd:
+ unix: /run/kvmd/kvmd.sock
+
+vnc:
+ kvmd:
+ unix: /run/kvmd/kvmd.sock
+
+ streamer:
+ unix: /run/kvmd/ustreamer.sock
diff --git a/configs/os/udev/v2-hdmiusb-generic.rules b/configs/os/udev/v2-hdmiusb-generic.rules
new file mode 100644
index 00000000..85c22237
--- /dev/null
+++ b/configs/os/udev/v2-hdmiusb-generic.rules
@@ -0,0 +1,5 @@
+# https://unix.stackexchange.com/questions/66901/how-to-bind-usb-device-under-a-static-name
+# https://wiki.archlinux.org/index.php/Udev#Setting_static_device_names
+KERNEL=="video[0-9]*", SUBSYSTEM=="video4linux", SUBSYSTEMS=="usb", ATTR{index}=="0", GROUP="kvmd", SYMLINK+="kvmd-video"
+KERNEL=="hidg0", GROUP="kvmd", SYMLINK+="kvmd-hid-keyboard"
+KERNEL=="hidg1", GROUP="kvmd", SYMLINK+="kvmd-hid-mouse"
diff --git a/kvmd.install b/kvmd.install
index 678a38a3..5e00512b 100644
--- a/kvmd.install
+++ b/kvmd.install
@@ -20,6 +20,6 @@ post_upgrade() {
chown kvmd /var/lib/kvmd/msd || true
echo "==> Patching configs ..."
- sed -i -e 's/^dtoverlay=pi3-disable-bt$/dtoverlay=disable-bt/g' /boot/config.txt
- sed -i -e 's/^dtoverlay=dwc2$/dtoverlay=dwc2,dr_mode=peripheral/g' /boot/config.txt
+ [ ! -f /boot/config.txt ] || sed -i -e 's/^dtoverlay=pi3-disable-bt$/dtoverlay=disable-bt/g' /boot/config.txt
+ [ ! -f /boot/config.txt ] || sed -i -e 's/^dtoverlay=dwc2$/dtoverlay=dwc2,dr_mode=peripheral/g' /boot/config.txt
}