summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2018-09-26 02:36:56 +0300
committerDevaev Maxim <[email protected]>2018-09-26 02:36:56 +0300
commitf3946f102fc167efdc53c73412b2c0d6ac6c72c5 (patch)
tree4810aa29f48f5a13d0204c6a7ea8791b094a4d1e
parent680f14b1f982e55bc0da034a9e52c8cbe4f4d756 (diff)
moved os to pi-kvm/os
-rw-r--r--os/.gitignore1
-rw-r--r--os/Makefile75
-rw-r--r--os/platforms/common/Dockerfile.part51
-rw-r--r--os/platforms/common/customizepkg.nginx1
-rw-r--r--os/platforms/common/motd17
-rw-r--r--os/platforms/common/sysctl.conf3
-rw-r--r--os/platforms/v1/Dockerfile.part4
-rw-r--r--os/platforms/v1/config.txt3
-rw-r--r--os/platforms/v1/udev.rules4
-rw-r--r--os/platforms/v2/Dockerfile.part11
-rw-r--r--os/platforms/v2/config.txt5
-rw-r--r--os/platforms/v2/modules.load1
-rw-r--r--os/platforms/v2/udev.rules4
13 files changed, 0 insertions, 180 deletions
diff --git a/os/.gitignore b/os/.gitignore
deleted file mode 100644
index 0e03e15f..00000000
--- a/os/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/.build/
diff --git a/os/Makefile b/os/Makefile
deleted file mode 100644
index 68bbb935..00000000
--- a/os/Makefile
+++ /dev/null
@@ -1,75 +0,0 @@
-BUILD_OPTS ?=
-
-HOSTNAME ?= pikvm
-LOCALE ?= en_US.UTF-8
-TIMEZONE ?= Europe/Moscow
-
-WEBUI_ADMIN_PASSWD ?= admin
-
-
-# =====
-_BUILD_DIR = ./.build
-
-define fetch_version
- curl --silent "https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=$(1)" \
- | grep "^pkgver=" \
- | grep -Po "\d+\.\d+[^\"']*"
-endef
-
-
-# =====
-all:
- @ cat Makefile
-
-
-v1:
- make _pikvm PIKVM_PLATFORM=v1 PI_BOARD=rpi-2
-
-
-v2:
- make _pikvm PIKVM_PLATFORM=v2 PI_BOARD=rpi-2
-
-
-shell:
- cd $(_BUILD_DIR) && make shell
-
-
-_pikvm: $(_BUILD_DIR)
- rm -rf $(_BUILD_DIR)/stages/pikvm-*
- rm -rf $(_BUILD_DIR)/builder/scripts/pikvm
- cp -a platforms/common $(_BUILD_DIR)/stages/pikvm-common
- cp -a platforms/$(PIKVM_PLATFORM) $(_BUILD_DIR)/stages/pikvm-$(PIKVM_PLATFORM)
- cd $(_BUILD_DIR) && make binfmt && make _rpi \
- BUILD_OPTS=" $(BUILD_OPTS) \
- --build-arg USTREAMER_VERSION=$(call fetch_version, ustreamer) \
- --build-arg KVMD_VERSION=$(call fetch_version, kvmd) \
- --build-arg NEW_SSH_KEYGEN=$(shell uuidgen) \
- --build-arg WEBUI_ADMIN_PASSWD='$(WEBUI_ADMIN_PASSWD)' \
- --build-arg NEW_HTTPS_CERT=$(shell uuidgen) \
- " \
- PROJECT=pikvm \
- BOARD=$(PI_BOARD) \
- STAGES="__init__ os watchdog ro pikvm-common pikvm-$(PIKVM_PLATFORM) rootssh __cleanup__" \
- LOCALE=$(LOCALE) \
- TIMEZONE=$(TIMEZONE)
-
-
-$(_BUILD_DIR):
- git clone --depth=1 https://github.com/mdevaev/pi-builder $(_BUILD_DIR)
-
-
-install: $(_BUILD_DIR)
- cd $(_BUILD_DIR) && make install HOSTNAME=$(HOSTNAME)
-
-
-scan: $(_BUILD_DIR)
- cd $(_BUILD_DIR) && make scan
-
-
-clean: $(_BUILD_DIR)
- cd $(_BUILD_DIR) && make clean
-
-
-clean-all:
- - cd $(_BUILD_DIR) && make clean-all
- rm -rf $(_BUILD_DIR)
diff --git a/os/platforms/common/Dockerfile.part b/os/platforms/common/Dockerfile.part
deleted file mode 100644
index e4308647..00000000
--- a/os/platforms/common/Dockerfile.part
+++ /dev/null
@@ -1,51 +0,0 @@
-RUN pkg-install \
- nginx-mainline \
- apache-tools \
- raspberrypi-firmware \
- v4l-utils \
- python \
- python-raspberry-gpio \
- customizepkg
-RUN systemctl enable nginx
-
-COPY stages/pikvm-common/customizepkg.nginx /etc/customizepkg.d/nginx-mainline-mod-ndk
-COPY stages/pikvm-common/customizepkg.nginx /etc/customizepkg.d/nginx-mainline-mod-lua
-RUN env MAKEPKGOPTS="--skipchecksums --skippgpcheck" pkg-install nginx-mainline-mod-lua
-
-ARG USTREAMER_VERSION
-ENV USTREAMER_VERSION $USTREAMER_VERSION
-RUN echo $USTREAMER_VERSION
-RUN pkg-install ustreamer
-
-ARG KVMD_VERSION
-ENV KVMD_VERSION $KVMD_VERSION
-RUN echo $KVMD_VERSION
-RUN pkg-install kvmd
-RUN systemctl enable kvmd
-
-COPY stages/pikvm-common/sysctl.conf /etc/sysctl.d/99-pikvm.conf
-COPY stages/pikvm-common/motd /etc/
-
-RUN sed -i -e "s/console=ttyAMA0\,115200//g" /boot/cmdline.txt \
- && sed -i -e "s/kgdboc=ttyAMA0\,115200//g" /boot/cmdline.txt
-RUN systemctl mask [email protected]
-
-RUN rm -rf /etc/nginx/* \
- && cp /usr/share/kvmd/configs/nginx/* /etc/nginx/ \
- && sed -i -e "s/^#PROD//g" /etc/nginx/nginx.conf
-
-ARG WEBUI_ADMIN_PASSWD
-ENV WEBUI_ADMIN_PASSWD $WEBUI_ADMIN_PASSWD
-RUN echo "$WEBUI_ADMIN_PASSWD" | htpasswd -ci /etc/nginx/htpasswd admin
-
-ARG NEW_HTTPS_CERT
-ENV NEW_HTTPS_CERT $NEW_HTTPS_CERT
-RUN echo $NEW_HTTPS_CERT
-RUN mkdir /etc/nginx/ssl \
- && cd /etc/nginx/ssl \
- && openssl req -new -x509 -nodes -newkey rsa:4096 -keyout server.key -out server.crt -days 3650 \
- -subj "/C=RU/ST=Moscow/L=Moscow/O=Pi-KVM/OU=Pi-KVM/CN=localhost" \
- && chmod 400 server.key \
- && chmod 444 server.crt \
- && chmod 750 /etc/nginx/ssl \
- && chown -R root:http /etc/nginx/ssl
diff --git a/os/platforms/common/customizepkg.nginx b/os/platforms/common/customizepkg.nginx
deleted file mode 100644
index 5e7db5a4..00000000
--- a/os/platforms/common/customizepkg.nginx
+++ /dev/null
@@ -1 +0,0 @@
-replace#global#_nginxver=.*#_nginxver=`pacman -Q nginx-mainline | grep -Po "\\d+\\.\\d+\\.\\d+"`
diff --git a/os/platforms/common/motd b/os/platforms/common/motd
deleted file mode 100644
index 5b157c58..00000000
--- a/os/platforms/common/motd
+++ /dev/null
@@ -1,17 +0,0 @@
- _____ _ _ ____ ____ __
- | __ (_) | |/ /\ \ / / \/ |
- | |__) | __ | ' / \ \ / /| \ / |
- | ___/ | (__) | < \ \/ / | |\/| |
- | | | | | . \ \ / | | | |
- |_| |_| |_|\_\ \/ |_| |_|
-
- Welcome to Pi-KVM - Open Source IP-KVM based on Raspberry Pi
-
- Website: https://github.com/pi-kvm
- ____________________________________________________________________________
-
- The root filesystem of Pi-KVM is mounted in read-only mode by default.
- Use command "rw" to remount it in the RW-mode and "ro" to switch it back.
-
- To change Web UI password use command "htpasswd /etc/nginx/htpasswd admin".
-
diff --git a/os/platforms/common/sysctl.conf b/os/platforms/common/sysctl.conf
deleted file mode 100644
index 71db0efc..00000000
--- a/os/platforms/common/sysctl.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
deleted file mode 100644
index 77be104f..00000000
--- a/os/platforms/v1/Dockerfile.part
+++ /dev/null
@@ -1,4 +0,0 @@
-COPY stages/pikvm-v1/config.txt /boot/
-COPY stages/pikvm-v1/udev.rules /etc/udev/rules.d/pikvm.rules
-
-RUN cp /usr/share/kvmd/configs/kvmd/v1.yaml /etc/kvmd.yaml
diff --git a/os/platforms/v1/config.txt b/os/platforms/v1/config.txt
deleted file mode 100644
index 76d1debb..00000000
--- a/os/platforms/v1/config.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-gpu_mem=16
-dtparam=act_led_gpio=27
-enable_uart=1
diff --git a/os/platforms/v1/udev.rules b/os/platforms/v1/udev.rules
deleted file mode 100644
index 99cb0e45..00000000
--- a/os/platforms/v1/udev.rules
+++ /dev/null
@@ -1,4 +0,0 @@
-# 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"
diff --git a/os/platforms/v2/Dockerfile.part b/os/platforms/v2/Dockerfile.part
deleted file mode 100644
index 2e689418..00000000
--- a/os/platforms/v2/Dockerfile.part
+++ /dev/null
@@ -1,11 +0,0 @@
-RUN pkg-install \
- dkms \
- tc358743-dkms
-
-RUN sed -i -e "s/rootwait/cma=128M rootwait/g" /boot/cmdline.txt
-
-COPY stages/pikvm-v2/config.txt /boot/
-COPY stages/pikvm-v2/udev.rules /etc/udev/rules.d/pikvm.rules
-COPY stages/pikvm-v2/modules.load /etc/modules-load.d/pikvm.conf
-
-RUN cp /usr/share/kvmd/configs/kvmd/v2.yaml /etc/kvmd.yaml
diff --git a/os/platforms/v2/config.txt b/os/platforms/v2/config.txt
deleted file mode 100644
index f99b10b4..00000000
--- a/os/platforms/v2/config.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-gpu_mem=16
-start_x=1
-enable_uart=1
-dtoverlay=tc358743,i2c_pins_28_29=1
-dtparam=act_led_gpio=27
diff --git a/os/platforms/v2/modules.load b/os/platforms/v2/modules.load
deleted file mode 100644
index 5be25408..00000000
--- a/os/platforms/v2/modules.load
+++ /dev/null
@@ -1 +0,0 @@
-tc358743
diff --git a/os/platforms/v2/udev.rules b/os/platforms/v2/udev.rules
deleted file mode 100644
index b26a0ff8..00000000
--- a/os/platforms/v2/udev.rules
+++ /dev/null
@@ -1,4 +0,0 @@
-# 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=="soc", SYMLINK+="kvmd-streamer"
-KERNEL=="sd[a-z]", SUBSYSTEM=="block", KERNELS=="1-1.4:1.0", SYMLINK+="kvmd-msd"