From d94eba0ab1284f854fd7ccb20bf2ca00d012b48f Mon Sep 17 00:00:00 2001 From: BuGu <62454025+Z2Z-GuGu@users.noreply.github.com> Date: Tue, 4 Mar 2025 16:31:15 +0800 Subject: [PATCH] Add compilation scripts and guidelines to simplify the compilation process --- support/README.md | 5 + support/README_ZH.md | 5 + support/sg2002/README.md | 28 +++++- support/sg2002/README_ZH.md | 24 ++++- support/sg2002/build | 181 ++++++++++++++++++++++++++++-------- 5 files changed, 197 insertions(+), 46 deletions(-) create mode 100644 support/README.md create mode 100644 support/README_ZH.md diff --git a/support/README.md b/support/README.md new file mode 100644 index 0000000..2ec9912 --- /dev/null +++ b/support/README.md @@ -0,0 +1,5 @@ +# NanoKVM Support Instructions + +`/support` contains auxiliary functions for NanoKVM, such as image subsystem, system status monitoring, system updates, screen key drivers, and a few system functions. + +Currently, NanoKVM is divided into two versions based on the main control chip: SG2002 (which includes NanoKVM-Lite/Full/PCIe) and H618 (including NanoKVM-Pro). Different chips have significantly different projects and compilation environments. To distinguish between them, they are stored separately in `/support/sg2002` and `/support/h618`. diff --git a/support/README_ZH.md b/support/README_ZH.md new file mode 100644 index 0000000..93faaee --- /dev/null +++ b/support/README_ZH.md @@ -0,0 +1,5 @@ +# NanoKVM support 说明 + +`/support`包含NanoKVM辅助性的功能,如图像子系统、系统状态监控、系统更新、屏幕按键驱动和少部分的系统功能 + +当前 NanoKVM 根据主控芯片的不同分为两个版本:SG2002(包含NanoKVM-Lite/Full/PCIe)和H618(包括NanoKVM-Pro),不同的芯片有差异较大的工程和编译环境,为做区分,将它们分别存放在`/support/sg2002`和`/support/h618` diff --git a/support/sg2002/README.md b/support/sg2002/README.md index 0a5d6e9..2950be9 100644 --- a/support/sg2002/README.md +++ b/support/sg2002/README.md @@ -1,8 +1,26 @@ -## If you need to compile `kvm_system` yourself, please follow the steps below: +# NanoKVM Support Instructions -1. The `kvm_system` project is compiled under the [MaixCDK](https://github.com/sipeed/MaixCDK) framework. Before compiling, please ensure that the `MaixCDK` environment is correctly configured. For the configuration tutorial, click [here](https://github.com/sipeed/MaixCDK/blob/main/docs/doc_zh/README.md). +## Environment Preparation +1. NanoKVM-Lite/Full/PCIe is based on the SG2002 as the main control chip. The projects in the support section are compiled under the [MaixCDK](https://github.com/sipeed/MaixCDK) framework. Before compiling, please ensure that the `MaixCDK` environment is correctly configured. For configuration instructions, click [here](https://github.com/sipeed/MaixCDK/blob/main/docs/doc_zh/README.md). + +## kvm_system Compilation Instructions + +> The `kvm_system` is responsible for monitoring the NanoKVM system status, system updates, screen key drivers, and a few system functions, compiled with MaixCDK. + +1. Before compiling, please ensure that the above-mentioned `MaixCDK` environment is correctly configured. 2. Modify the paths of `MAIXCDK_PATH` and `NanoKVM_PATH` in `./build`. 3. Execute `./build kvm_system` to compile `kvm_system`. -4. Use `scp ./kvm_system/dist/kvm_system_release/kvm_system root@192.168.x.x:/kvmapp/kvm_system` to copy it into NanoKVM for testing. -5. Use `./build add_to_kvmapp` to place the executable files into the `/kvmapp` installation package. -6. Use `./build clean` to clean up the compilation of `kvm_system`. +4. Use `scp ./kvm_system/dist/kvm_system_release/kvm_system root@192.168.x.x:/kvmapp/kvm_system` to copy it to NanoKVM for testing. +5. Use `./build add_to_kvmapp` to place the executable file into the `/kvmapp` installation package. +6. Use `./build kvm_system clean` to clean the compilation of `kvm_system`. + +## kvm_vision Compilation Instructions + +> `kvm_vision` refers to the image acquisition and encoding subsystem of NanoKVM, compiled with MaixCDK to produce dynamic libraries for Go calls. Use `kvm_vision_test` to compile and test the dynamic library. + +1. Before compiling, please ensure that the above-mentioned `MaixCDK` environment is correctly configured. +2. Modify the paths of `MAIXCDK_PATH` and `NanoKVM_PATH` in `./build`. +3. Execute `./build kvm_vision` to compile `kvm_vision_test`. +4. You can test the dynamic libraries in `kvm_vision_test/dist/kvm_vision_test_release/dl_lib/`. +5. Use `./build add_to_kvmapp` to place the dynamic libraries into the `/kvmapp` installation package. +6. Use `./build kvm_vision clean` to clean the compilation of `kvm_vision`. \ No newline at end of file diff --git a/support/sg2002/README_ZH.md b/support/sg2002/README_ZH.md index 44e77a6..bf5c75d 100644 --- a/support/sg2002/README_ZH.md +++ b/support/sg2002/README_ZH.md @@ -1,8 +1,26 @@ -## 如果需要自己编译 kvm_system 请按以下步骤完成编译 +# NanoKVM support 说明 -1. `kvm_system`工程在[MaixCDK](https://github.com/sipeed/MaixCDK) 框架下编译。编译前,请保证`MaixCDK`环境已正确配置,配置教程点击[这里](https://github.com/sipeed/MaixCDK/blob/main/docs/doc_zh/README.md) +## 环境准备 +1. NanoKVM-Lite/Full/PCIe 以SG2002为主控芯片,support 部分的工程在[MaixCDK](https://github.com/sipeed/MaixCDK) 框架下编译。编译前,请保证`MaixCDK`环境已正确配置,配置教程点击[这里](https://github.com/sipeed/MaixCDK/blob/main/docs/doc_zh/README.md) + +## kvm_system 编译说明 + +> `kvm_system` 负责 NanoKVM 系统状态监控、系统更新、屏幕按键驱动和少部分的系统功能,借助 MaixCDK 编译 + +1. 编译前,请保证上述 1.`MaixCDK`环境已正确配置 2. 修改 `./build` 中 `MAIXCDK_PATH` 和 `NanoKVM_PATH`的路径 3. 执行 `./build kvm_system` 编译 kvm_system 4. 使用 `scp ./kvm_system/dist/kvm_system_release/kvm_system root@192.168.x.x:/kvmapp/kvm_system` 拷贝入 NanoKVM 测试 5. 使用 `./build add_to_kvmapp` 可以将可执行文件放入 `/kvmapp` 安装包内 -6. 使用 `./build clean` 可以清除 kvm_system 的编译 +6. 使用 `./build kvm_system clean` 可以清除 kvm_system 的编译 + +## kvm_vision 编译说明 + +> `kvm_vision` 是 NanoKVM 图像获取编码子系统的统称,使用MaixCDK编译出动态库供Go调用,使用 `kvm_vision_test` 编译和测试动态库 + +1. 编译前,请保证上述 1.`MaixCDK`环境已正确配置 +2. 修改 `./build` 中 `MAIXCDK_PATH` 和 `NanoKVM_PATH`的路径 +3. 执行 `./build kvm_vision` 编译 kvm_vision_test +4. 可使用 `kvm_vision_test/dist/kvm_vision_test_release/dl_lib/` 中的动态库测试 +5. 使用 `./build add_to_kvmapp` 可以将动态库放入 `/kvmapp` 安装包内 +6. 使用 `./build kvm_vision clean` 可以清除 kvm_system 的编译 diff --git a/support/sg2002/build b/support/sg2002/build index 751329f..cfc0680 100755 --- a/support/sg2002/build +++ b/support/sg2002/build @@ -1,18 +1,37 @@ #!/bin/bash -export MAIXCDK_PATH=~/Git_Project/MaixCDK +export MAIXCDK_PATH=~/MaixCDK export NanoKVM_PATH=~/NanoKVM -kvm_system_PATH="$NanoKVM_PATH/support/sg2002/kvm_system" +Project_Name="None" +Project_PATH="None" +Project_Action="None" +KVMAPP_PATH="$NanoKVM_PATH/kvmapp" -maixcdk_build_from_zero(){ - maixcdk build <