From 476018aeb82398afbf53d7a91e3b8e30ff0b2851 Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Sat, 7 Jul 2018 23:37:38 +0000 Subject: udev instead own bycicles --- os/platforms/v1/99-pikvm.conf | 3 --- os/platforms/v1/Dockerfile.part | 3 ++- os/platforms/v1/kvmd.yaml | 5 ++--- os/platforms/v1/sysctl.conf | 3 +++ os/platforms/v1/udev.rules | 4 ++++ 5 files changed, 11 insertions(+), 7 deletions(-) delete mode 100644 os/platforms/v1/99-pikvm.conf create mode 100644 os/platforms/v1/sysctl.conf create mode 100644 os/platforms/v1/udev.rules (limited to 'os') diff --git a/os/platforms/v1/99-pikvm.conf b/os/platforms/v1/99-pikvm.conf deleted file mode 100644 index 71db0efc..00000000 --- a/os/platforms/v1/99-pikvm.conf +++ /dev/null @@ -1,3 +0,0 @@ -# https://github.com/raspberrypi/linux/issues/1753 -vm.dirty_background_bytes = 5 -vm.dirty_writeback_centisecs = 25 diff --git a/os/platforms/v1/Dockerfile.part b/os/platforms/v1/Dockerfile.part index c525b8e7..566f229c 100644 --- a/os/platforms/v1/Dockerfile.part +++ b/os/platforms/v1/Dockerfile.part @@ -4,7 +4,8 @@ RUN pkg-install \ nginx COPY stages/pikvm/config.txt /boot/ -COPY stages/pikvm/99-pikvm.conf /etc/sysctl.d/ +COPY stages/pikvm/sysctl.conf /etc/sysctl.d/99-pikvm.conf +COPY stages/pikvm/udev.rules /etc/udev/rules.d/pikvm.rules COPY stages/pikvm/index.html /srv/http/ COPY stages/pikvm/kvmd.yaml /etc/ COPY stages/pikvm/nginx.conf /etc/nginx/ diff --git a/os/platforms/v1/kvmd.yaml b/os/platforms/v1/kvmd.yaml index 3f2e8751..52890551 100644 --- a/os/platforms/v1/kvmd.yaml +++ b/os/platforms/v1/kvmd.yaml @@ -24,8 +24,7 @@ kvmd: state_poll: 0.1 msd: - # FIXME: It's for laptop lol - bind: "1-2:1.0" + device: "/dev/kvmd-msd" init_delay: 2.0 write_meta: true chunk_size: 8192 @@ -46,7 +45,7 @@ kvmd: cmd: - "/usr/bin/mjpg_streamer" - "-i" - - "input_uvc.so -d /dev/video0 -e 2 -y -n -r {width}x{height}" + - "input_uvc.so -d /dev/kvmd-streamer -e 2 -y -n -r {width}x{height}" - "-o" - "output_http.so -l localhost -p 8082" diff --git a/os/platforms/v1/sysctl.conf b/os/platforms/v1/sysctl.conf new file mode 100644 index 00000000..71db0efc --- /dev/null +++ b/os/platforms/v1/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/os/platforms/v1/udev.rules b/os/platforms/v1/udev.rules new file mode 100644 index 00000000..99cb0e45 --- /dev/null +++ b/os/platforms/v1/udev.rules @@ -0,0 +1,4 @@ +# 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", SYMLINK+="kvmd-streamer" +KERNEL=="sd[a-z]", SUBSYSTEM=="block", KERNELS=="1-1.4:1.0", SYMLINK+="kvmd-msd" -- cgit v1.2.3