From 303715ee613fca518644df63c10be3c06d4bfa72 Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Sat, 16 Feb 2019 21:16:53 +0300 Subject: os configs --- configs/kvmd/main/v1-hdmi.yaml | 41 +++++++++++++++++++++++++++++ configs/kvmd/main/v1-vga.yaml | 45 ++++++++++++++++++++++++++++++++ configs/kvmd/platforms/kvmd.v1-hdmi.yaml | 41 ----------------------------- configs/kvmd/platforms/kvmd.v1-vga.yaml | 45 -------------------------------- configs/os/boot-config/v1-hdmi-rpi2.txt | 9 +++++++ configs/os/boot-config/v1-hdmi-rpi3.txt | 10 +++++++ configs/os/boot-config/v1-vga-rpi2.txt | 7 +++++ configs/os/boot-config/v1-vga-rpi3.txt | 8 ++++++ configs/os/cmdline/v1-hdmi.sed | 3 +++ configs/os/cmdline/v1-vga.sed | 2 ++ configs/os/modules-load/v1-hdmi.conf | 1 + configs/os/sysctl.conf | 3 +++ configs/os/systemd/kvmd-tc358743.service | 13 +++++++++ configs/os/systemd/kvmd.service | 16 ++++++++++++ configs/os/udev/v1-hdmi-rpi2.rules | 5 ++++ configs/os/udev/v1-hdmi-rpi3.rules | 5 ++++ configs/os/udev/v1-vga-rpi2.rules | 5 ++++ configs/os/udev/v1-vga-rpi3.rules | 5 ++++ configs/systemd/kvmd-tc358743.service | 13 --------- configs/systemd/kvmd.service | 16 ------------ 20 files changed, 178 insertions(+), 115 deletions(-) create mode 100644 configs/kvmd/main/v1-hdmi.yaml create mode 100644 configs/kvmd/main/v1-vga.yaml delete mode 100644 configs/kvmd/platforms/kvmd.v1-hdmi.yaml delete mode 100644 configs/kvmd/platforms/kvmd.v1-vga.yaml create mode 100644 configs/os/boot-config/v1-hdmi-rpi2.txt create mode 100644 configs/os/boot-config/v1-hdmi-rpi3.txt create mode 100644 configs/os/boot-config/v1-vga-rpi2.txt create mode 100644 configs/os/boot-config/v1-vga-rpi3.txt create mode 100644 configs/os/cmdline/v1-hdmi.sed create mode 100644 configs/os/cmdline/v1-vga.sed create mode 100644 configs/os/modules-load/v1-hdmi.conf create mode 100644 configs/os/sysctl.conf create mode 100644 configs/os/systemd/kvmd-tc358743.service create mode 100644 configs/os/systemd/kvmd.service create mode 100644 configs/os/udev/v1-hdmi-rpi2.rules create mode 100644 configs/os/udev/v1-hdmi-rpi3.rules create mode 100644 configs/os/udev/v1-vga-rpi2.rules create mode 100644 configs/os/udev/v1-vga-rpi3.rules delete mode 100644 configs/systemd/kvmd-tc358743.service delete mode 100644 configs/systemd/kvmd.service (limited to 'configs') diff --git a/configs/kvmd/main/v1-hdmi.yaml b/configs/kvmd/main/v1-hdmi.yaml new file mode 100644 index 00000000..ed5edb7d --- /dev/null +++ b/configs/kvmd/main/v1-hdmi.yaml @@ -0,0 +1,41 @@ +# Don't touch this file otherwise your device may stop working. +# You can find a working configuration in /usr/share/kvmd/configs.default/kvmd. + +kvmd: + server: + host: 127.0.0.1 + port: 8081 + + hid: + reset_pin: 4 + device: /dev/kvmd-hid + + atx: + power_led_pin: 24 + hdd_led_pin: 22 + power_switch_pin: 23 + reset_switch_pin: 27 + + msd: + target_pin: 12 + reset_pin: 13 + device: /dev/kvmd-msd + + streamer: + host: 127.0.0.1 + port: 8082 + cmd: + - "/usr/bin/ustreamer" + - "--device=/dev/kvmd-video" + - "--device-persistent" + - "--format=uyvy" + - "--encoder=omx" + - "--workers=3" + - "--quality={quality}" + - "--desired-fps={desired_fps}" + - "--dv-timings" + - "--host={host}" + - "--port={port}" + - "--drop-same-frames=30" + +logging: !include logging.yaml diff --git a/configs/kvmd/main/v1-vga.yaml b/configs/kvmd/main/v1-vga.yaml new file mode 100644 index 00000000..8cb931b5 --- /dev/null +++ b/configs/kvmd/main/v1-vga.yaml @@ -0,0 +1,45 @@ +# Don't touch this file otherwise your device may stop working. +# You can find a working configuration in /usr/share/kvmd/configs.default/kvmd. + +kvmd: + server: + host: 127.0.0.1 + port: 8081 + + hid: + reset_pin: 4 + device: /dev/kvmd-hid + + atx: + power_led_pin: 24 + hdd_led_pin: 22 + power_switch_pin: 23 + reset_switch_pin: 27 + + msd: + target_pin: 12 + reset_pin: 13 + device: /dev/kvmd-msd + + streamer: + cap_pin: 17 + conv_pin: 18 + init_restart_after: 1 + host: 127.0.0.1 + port: 8082 + cmd: + - "/usr/bin/ustreamer" + - "--device=/dev/kvmd-video" + - "--tv-standard=pal" + - "--format=yuyv" + - "--encoder=cpu" + - "--quality={quality}" + - "--desired-fps={desired_fps}" + - "--width=720" + - "--height=576" + - "--fake-width=800" + - "--fake-height=600" + - "--host={host}" + - "--port={port}" + +logging: !include logging.yaml diff --git a/configs/kvmd/platforms/kvmd.v1-hdmi.yaml b/configs/kvmd/platforms/kvmd.v1-hdmi.yaml deleted file mode 100644 index ed5edb7d..00000000 --- a/configs/kvmd/platforms/kvmd.v1-hdmi.yaml +++ /dev/null @@ -1,41 +0,0 @@ -# Don't touch this file otherwise your device may stop working. -# You can find a working configuration in /usr/share/kvmd/configs.default/kvmd. - -kvmd: - server: - host: 127.0.0.1 - port: 8081 - - hid: - reset_pin: 4 - device: /dev/kvmd-hid - - atx: - power_led_pin: 24 - hdd_led_pin: 22 - power_switch_pin: 23 - reset_switch_pin: 27 - - msd: - target_pin: 12 - reset_pin: 13 - device: /dev/kvmd-msd - - streamer: - host: 127.0.0.1 - port: 8082 - cmd: - - "/usr/bin/ustreamer" - - "--device=/dev/kvmd-video" - - "--device-persistent" - - "--format=uyvy" - - "--encoder=omx" - - "--workers=3" - - "--quality={quality}" - - "--desired-fps={desired_fps}" - - "--dv-timings" - - "--host={host}" - - "--port={port}" - - "--drop-same-frames=30" - -logging: !include logging.yaml diff --git a/configs/kvmd/platforms/kvmd.v1-vga.yaml b/configs/kvmd/platforms/kvmd.v1-vga.yaml deleted file mode 100644 index 8cb931b5..00000000 --- a/configs/kvmd/platforms/kvmd.v1-vga.yaml +++ /dev/null @@ -1,45 +0,0 @@ -# Don't touch this file otherwise your device may stop working. -# You can find a working configuration in /usr/share/kvmd/configs.default/kvmd. - -kvmd: - server: - host: 127.0.0.1 - port: 8081 - - hid: - reset_pin: 4 - device: /dev/kvmd-hid - - atx: - power_led_pin: 24 - hdd_led_pin: 22 - power_switch_pin: 23 - reset_switch_pin: 27 - - msd: - target_pin: 12 - reset_pin: 13 - device: /dev/kvmd-msd - - streamer: - cap_pin: 17 - conv_pin: 18 - init_restart_after: 1 - host: 127.0.0.1 - port: 8082 - cmd: - - "/usr/bin/ustreamer" - - "--device=/dev/kvmd-video" - - "--tv-standard=pal" - - "--format=yuyv" - - "--encoder=cpu" - - "--quality={quality}" - - "--desired-fps={desired_fps}" - - "--width=720" - - "--height=576" - - "--fake-width=800" - - "--fake-height=600" - - "--host={host}" - - "--port={port}" - -logging: !include logging.yaml diff --git a/configs/os/boot-config/v1-hdmi-rpi2.txt b/configs/os/boot-config/v1-hdmi-rpi2.txt new file mode 100644 index 00000000..6bf6cf12 --- /dev/null +++ b/configs/os/boot-config/v1-hdmi-rpi2.txt @@ -0,0 +1,9 @@ +# 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,i2c_pins_28_29=1 +dtparam=act_led_gpio=26 diff --git a/configs/os/boot-config/v1-hdmi-rpi3.txt b/configs/os/boot-config/v1-hdmi-rpi3.txt new file mode 100644 index 00000000..fa86f60b --- /dev/null +++ b/configs/os/boot-config/v1-hdmi-rpi3.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 +dtparam=act_led_gpio=26 +dtoverlay=pi3-disable-bt diff --git a/configs/os/boot-config/v1-vga-rpi2.txt b/configs/os/boot-config/v1-vga-rpi2.txt new file mode 100644 index 00000000..84053d2c --- /dev/null +++ b/configs/os/boot-config/v1-vga-rpi2.txt @@ -0,0 +1,7 @@ +# See /boot/overlays/README for all available options +initramfs initramfs-linux.img followkernel + +hdmi_force_hotplug=1 +gpu_mem=16 +dtparam=act_led_gpio=26 +enable_uart=1 diff --git a/configs/os/boot-config/v1-vga-rpi3.txt b/configs/os/boot-config/v1-vga-rpi3.txt new file mode 100644 index 00000000..f444aba9 --- /dev/null +++ b/configs/os/boot-config/v1-vga-rpi3.txt @@ -0,0 +1,8 @@ +# See /boot/overlays/README for all available options +initramfs initramfs-linux.img followkernel + +hdmi_force_hotplug=1 +gpu_mem=16 +dtparam=act_led_gpio=26 +enable_uart=1 +dtoverlay=pi3-disable-bt diff --git a/configs/os/cmdline/v1-hdmi.sed b/configs/os/cmdline/v1-hdmi.sed new file mode 100644 index 00000000..b3614eb0 --- /dev/null +++ b/configs/os/cmdline/v1-hdmi.sed @@ -0,0 +1,3 @@ +s/console=ttyAMA0\,115200//g +s/kgdboc=ttyAMA0\,115200//g +s/rootwait/cma=128M rootwait/g diff --git a/configs/os/cmdline/v1-vga.sed b/configs/os/cmdline/v1-vga.sed new file mode 100644 index 00000000..57f42700 --- /dev/null +++ b/configs/os/cmdline/v1-vga.sed @@ -0,0 +1,2 @@ +s/console=ttyAMA0\,115200//g +s/kgdboc=ttyAMA0\,115200//g diff --git a/configs/os/modules-load/v1-hdmi.conf b/configs/os/modules-load/v1-hdmi.conf new file mode 100644 index 00000000..5be25408 --- /dev/null +++ b/configs/os/modules-load/v1-hdmi.conf @@ -0,0 +1 @@ +tc358743 diff --git a/configs/os/sysctl.conf b/configs/os/sysctl.conf new file mode 100644 index 00000000..71db0efc --- /dev/null +++ b/configs/os/sysctl.conf @@ -0,0 +1,3 @@ +# https://github.com/raspberrypi/linux/issues/1753 +vm.dirty_background_bytes = 5 +vm.dirty_writeback_centisecs = 25 diff --git a/configs/os/systemd/kvmd-tc358743.service b/configs/os/systemd/kvmd-tc358743.service new file mode 100644 index 00000000..44d26d1a --- /dev/null +++ b/configs/os/systemd/kvmd-tc358743.service @@ -0,0 +1,13 @@ +[Unit] +Description=Loads EDID data to TC358743 +After=systemd-modules-load.service +Before=kvmd.service + +[Service] +Type=oneshot +ExecStart=/usr/bin/v4l2-ctl --device=/dev/kvmd-video --set-edid=file=/etc/kvmd/tc358743-edid.hex --fix-edid-checksums +ExecStop=/bin/true +RemainAfterExit=true + +[Install] +WantedBy=multi-user.target diff --git a/configs/os/systemd/kvmd.service b/configs/os/systemd/kvmd.service new file mode 100644 index 00000000..eaab01aa --- /dev/null +++ b/configs/os/systemd/kvmd.service @@ -0,0 +1,16 @@ +[Unit] +Description=The main Pi-KVM daemon +After=network.target network-online.target nss-lookup.target + +[Service] +User=kvmd +Group=kvmd +Type=simple +Restart=always +RestartSec=3 + +ExecStart=/usr/bin/kvmd +ExecStopPost=/usr/bin/kvmd-cleanup + +[Install] +WantedBy=multi-user.target diff --git a/configs/os/udev/v1-hdmi-rpi2.rules b/configs/os/udev/v1-hdmi-rpi2.rules new file mode 100644 index 00000000..77e5aafd --- /dev/null +++ b/configs/os/udev/v1-hdmi-rpi2.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", KERNELS=="3f801000.csi1", GROUP="kvmd", SYMLINK+="kvmd-video" +KERNEL=="sd[a-z]", SUBSYSTEM=="block", KERNELS=="1-1.4:1.0", GROUP="kvmd", SYMLINK+="kvmd-msd" +KERNEL=="ttyAMA0", SYMLINK+="kvmd-hid" diff --git a/configs/os/udev/v1-hdmi-rpi3.rules b/configs/os/udev/v1-hdmi-rpi3.rules new file mode 100644 index 00000000..dedbf164 --- /dev/null +++ b/configs/os/udev/v1-hdmi-rpi3.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", KERNELS=="3f801000.csi1", GROUP="kvmd", SYMLINK+="kvmd-video" +KERNEL=="sd[a-z]", SUBSYSTEM=="block", KERNELS=="1-1.1.2:1.0", GROUP="kvmd", SYMLINK+="kvmd-msd" +KERNEL=="ttyAMA0", SYMLINK+="kvmd-hid" diff --git a/configs/os/udev/v1-vga-rpi2.rules b/configs/os/udev/v1-vga-rpi2.rules new file mode 100644 index 00000000..a3c67123 --- /dev/null +++ b/configs/os/udev/v1-vga-rpi2.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", KERNELS=="1-1.3:1.0", GROUP="kvmd", SYMLINK+="kvmd-video" +KERNEL=="sd[a-z]", SUBSYSTEM=="block", KERNELS=="1-1.4:1.0", GROUP="kvmd", SYMLINK+="kvmd-msd" +KERNEL=="ttyAMA0", SYMLINK+="kvmd-hid" diff --git a/configs/os/udev/v1-vga-rpi3.rules b/configs/os/udev/v1-vga-rpi3.rules new file mode 100644 index 00000000..c8e8f950 --- /dev/null +++ b/configs/os/udev/v1-vga-rpi3.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", KERNELS=="1-1.1.3:1.0", GROUP="kvmd", SYMLINK+="kvmd-video" +KERNEL=="sd[a-z]", SUBSYSTEM=="block", KERNELS=="1-1.1.2:1.0", GROUP="kvmd", SYMLINK+="kvmd-msd" +KERNEL=="ttyAMA0", SYMLINK+="kvmd-hid" diff --git a/configs/systemd/kvmd-tc358743.service b/configs/systemd/kvmd-tc358743.service deleted file mode 100644 index 44d26d1a..00000000 --- a/configs/systemd/kvmd-tc358743.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=Loads EDID data to TC358743 -After=systemd-modules-load.service -Before=kvmd.service - -[Service] -Type=oneshot -ExecStart=/usr/bin/v4l2-ctl --device=/dev/kvmd-video --set-edid=file=/etc/kvmd/tc358743-edid.hex --fix-edid-checksums -ExecStop=/bin/true -RemainAfterExit=true - -[Install] -WantedBy=multi-user.target diff --git a/configs/systemd/kvmd.service b/configs/systemd/kvmd.service deleted file mode 100644 index 5427d4c9..00000000 --- a/configs/systemd/kvmd.service +++ /dev/null @@ -1,16 +0,0 @@ -[Unit] -Description=The main Pi-KVM daemon -After=network.target network-online.target nss-lookup.target - -[Service] -User=kvmd -Group=kvmd -Type=simple -Restart=always -RestartSec=3 - -ExecStart=/usr/bin/kvmd --config /etc/kvmd/kvmd.yaml -ExecStopPost=/usr/bin/kvmd-cleanup --config /etc/kvmd/kvmd.yaml - -[Install] -WantedBy=multi-user.target -- cgit v1.2.3