diff options
-rw-r--r-- | PKGBUILD | 63 | ||||
-rw-r--r-- | configs/kvmd/main/v2-hdmi.conf | 52 | ||||
-rw-r--r-- | configs/os/boot-config/v2-hdmi-rpi4.txt | 10 | ||||
-rw-r--r-- | configs/os/cmdline/v2-hdmi.sed | 1 | ||||
-rw-r--r-- | configs/os/modules-load/v2-hdmi.conf | 3 | ||||
-rw-r--r-- | configs/os/udev/v2-hdmi-rpi4.rules | 6 |
6 files changed, 105 insertions, 30 deletions
@@ -2,15 +2,19 @@ # Author: Maxim Devaev <[email protected]> -[ -n "$PIKVM_PLATFORM" ] || PIKVM_PLATFORM="v0-vga v0-hdmi v1-vga v1-hdmi" -[ -n "$PIKVM_BOARD" ] || PIKVM_BOARD="rpi2 rpi3" +_variants=(v2-hdmi-rpi4) +for _platform in v0-vga v0-hdmi v1-vga v1-hdmi; do + for _board in rpi2 rpi3; do + _variants+=($_platform:$_board) + done +done pkgname=(kvmd) -for _platform in $PIKVM_PLATFORM; do - for _board in $PIKVM_BOARD; do - pkgname+=(kvmd-platform-$_platform-$_board) - done +for _variant in "${_variants[@]}"; do + _platform=${_variant%:*} + _board=${_variant#*:} + pkgname+=(kvmd-platform-$_platform-$_board) done pkgbase=kvmd pkgver=1.11 @@ -97,28 +101,27 @@ package_kvmd() { done } - -for _platform in $PIKVM_PLATFORM; do - for _board in $PIKVM_BOARD; do - eval "package_kvmd-platform-$_platform-$_board() { - pkgdesc=\"Pi-KVM platform configs - $_platform for $_board\" - depends=(kvmd) - if [[ $_platform =~ ^.*-hdmi$ ]]; then - depends=(\"\${depends[@]}\" \"tc358743-dkms>=0.3\") - fi - - mkdir -p \"\$pkgdir/etc\"/{kvmd,sysctl.d,udev/rules.d,modules-load.d} - - local _cfg_default=\"/usr/share/kvmd/configs.default\" - - ln -sf \"\$_cfg_default/os/sysctl.conf\" \"\$pkgdir/etc/sysctl.d/99-kvmd.conf\" - ln -sf \"\$_cfg_default/os/udev/$_platform-$_board.rules\" \"\$pkgdir/etc/udev/rules.d/99-kvmd.rules\" - ln -sf \"\$_cfg_default/os/modules-load/$_platform.conf\" \"\$pkgdir/etc/modules-load.d/kvmd.conf\" - - ln -sf \"\$_cfg_default/kvmd/main/$_platform.yaml\" \"\$pkgdir/etc/kvmd/main.yaml\" - if [[ $_platform =~ ^.*-hdmi$ ]]; then - ln -sf \"\$_cfg_default/kvmd/tc358743-edid.hex\" \"\$pkgdir/etc/kvmd/tc358743-edid.hex\" - fi - }" - done +for _variant in "${_variants[@]}"; do + _platform=${_variant%:*} + _board=${_variant#*:} + eval "package_kvmd-platform-$_platform-$_board() { + pkgdesc=\"Pi-KVM platform configs - $_platform for $_board\" + depends=(kvmd) + if [[ $_platform =~ ^.*-hdmi$ ]]; then + depends=(\"\${depends[@]}\" \"tc358743-dkms>=0.3\") + fi + + mkdir -p \"\$pkgdir/etc\"/{kvmd,sysctl.d,udev/rules.d,modules-load.d} + + local _cfg_default=\"/usr/share/kvmd/configs.default\" + + ln -sf \"\$_cfg_default/os/sysctl.conf\" \"\$pkgdir/etc/sysctl.d/99-kvmd.conf\" + ln -sf \"\$_cfg_default/os/udev/$_platform-$_board.rules\" \"\$pkgdir/etc/udev/rules.d/99-kvmd.rules\" + ln -sf \"\$_cfg_default/os/modules-load/$_platform.conf\" \"\$pkgdir/etc/modules-load.d/kvmd.conf\" + + ln -sf \"\$_cfg_default/kvmd/main/$_platform.yaml\" \"\$pkgdir/etc/kvmd/main.yaml\" + if [[ $_platform =~ ^.*-hdmi$ ]]; then + ln -sf \"\$_cfg_default/kvmd/tc358743-edid.hex\" \"\$pkgdir/etc/kvmd/tc358743-edid.hex\" + fi + }" done diff --git a/configs/kvmd/main/v2-hdmi.conf b/configs/kvmd/main/v2-hdmi.conf new file mode 100644 index 00000000..b5568ba6 --- /dev/null +++ b/configs/kvmd/main/v2-hdmi.conf @@ -0,0 +1,52 @@ +# 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 + unix_rm: true + unix_mode: 0660 + + auth: !include auth.yaml + + hid: + type: otg + keyboard: + device: /dev/kvmd/kvmd-hid-keyboard + + atx: + type: disabled + + msd: + type: disabled + + streamer: + desired_fps: 30 + max_fps: 60 + unix: /run/kvmd/ustreamer.sock + cmd: + - "/usr/bin/ustreamer" + - "--device=/dev/kvmd-video" + - "--persistent" + - "--dv-timings" + - "--format=uyvy" + - "--encoder=omx" + - "--glitched-resolutions=720x480,720x576" + - "--workers=3" + - "--quality={quality}" + - "--desired-fps={desired_fps}" + - "--drop-same-frames=30" + - "--last-as-blank=0" + - "--unix={unix}" + - "--unix-rm" + - "--unix-mode=0660" + - "--no-log-colors" + +ipmi: + kvmd: + unix: /run/kvmd/kvmd.sock diff --git a/configs/os/boot-config/v2-hdmi-rpi4.txt b/configs/os/boot-config/v2-hdmi-rpi4.txt new file mode 100644 index 00000000..621868b9 --- /dev/null +++ b/configs/os/boot-config/v2-hdmi-rpi4.txt @@ -0,0 +1,10 @@ +# See /boot/overlays/README for all available options +initramfs initramfs-linux.img followkernel + +hdmi_force_hotplug=1 +gpu_mem=256 +start_x=1 +enable_uart=1 +dtoverlay=tc358743 +dtoverlay=pi3-disable-bt +dtoverlay=dwc2 diff --git a/configs/os/cmdline/v2-hdmi.sed b/configs/os/cmdline/v2-hdmi.sed new file mode 100644 index 00000000..803b9b03 --- /dev/null +++ b/configs/os/cmdline/v2-hdmi.sed @@ -0,0 +1 @@ +s/rootwait/cma=128M rootwait/g diff --git a/configs/os/modules-load/v2-hdmi.conf b/configs/os/modules-load/v2-hdmi.conf new file mode 100644 index 00000000..af538dba --- /dev/null +++ b/configs/os/modules-load/v2-hdmi.conf @@ -0,0 +1,3 @@ +dwc2 +libcomposite +tc358743 diff --git a/configs/os/udev/v2-hdmi-rpi4.rules b/configs/os/udev/v2-hdmi-rpi4.rules new file mode 100644 index 00000000..9d12ab4c --- /dev/null +++ b/configs/os/udev/v2-hdmi-rpi4.rules @@ -0,0 +1,6 @@ +# 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", KERNELS=="fe801000.csi|fe801000.csi1", GROUP="kvmd", SYMLINK+="kvmd-video" +KERNEL=="sd[a-z]", SUBSYSTEM=="block", KERNELS=="1-1.4:1.0", GROUP="kvmd", SYMLINK+="kvmd-msd" +KERNEL=="hidg0", GROUP="kvmd", SYMLINK+="kvmd-hid-keyboard" +KERNEL=="hidg1", GROUP="kvmd", SYMLINK+="kvmd-hid-mouse" |