redpill-tool-chain/README.md

121 lines
5.1 KiB
Markdown
Raw Normal View History

2021-08-09 13:09:48 +00:00
# RedPill Tool Chain
2021-08-09 13:56:07 +00:00
这是一个测试项目,可能会有不可预测的事情发生(比如:毁损数据、烧毁硬件等等),请**谨慎使用**。
2021-08-09 13:09:48 +00:00
2022-02-21 08:19:57 +00:00
[English](README_en.md "English")
2021-08-09 13:09:48 +00:00
2021-08-09 13:56:07 +00:00
感谢 @haydibe 提供 RedPill Tool Chain
2021-08-09 13:09:48 +00:00
2021-10-11 16:29:44 +00:00
## 关于项目?
2021-08-09 13:09:48 +00:00
2021-10-11 16:29:44 +00:00
- 基于[RedPill-TTG](https://github.com/RedPill-TTG)源码制作
2021-10-13 16:11:31 +00:00
- 为apollolake提供适当的DSM7支持 ( 感谢 [@jumkey](https://github.com/jumkey) )
- 整理社区扩展驱动 ( 感谢 [@pocopico](https://github.com/pocopico) )
2021-10-04 18:03:38 +00:00
- `redpill_lkm_make_target`字段的可选值有 `dev-v6`, `dev-v7`, `test-v6`, `test-v7`, `prod-v6` 或者 `prod-v7`
需要注意后缀为`-v6`的值用于 DSM6 版本构建, 需要注意后缀为`-v7`的值用于 DSM7 版本构建. 默认使用的是 `dev-v6``dev-v7`
2021-08-09 13:09:48 +00:00
2021-08-09 13:56:07 +00:00
> PS: 由于toolkit dev缺少fs/proc所需的源代码因此它们取自提取的DSM6.2.4内核源代码。
2021-10-11 16:29:44 +00:00
构建需要此单个文件夹的源代码但不使用内核源代码构建redpill.ko模块。
2021-08-09 13:09:48 +00:00
2021-10-04 17:49:40 +00:00
如果您发现工具链的构建方式有问题或者有改进的想法,请让我知道。
2021-08-09 13:09:48 +00:00
2021-08-09 13:56:07 +00:00
对于所有其他问题:请向社区提出——我知道的并不比其他人多。
2021-08-09 13:09:48 +00:00
2021-10-11 16:29:44 +00:00
## 如何使用?
2021-08-09 13:09:48 +00:00
2021-10-13 18:52:31 +00:00
1. 复制`sample_user_config.json`为`bromolow_user_config.json`或者`apollolake_user_config.json`
2021-09-22 19:24:19 +00:00
1. 编辑`<platform>_user_config.json`比如 918+ 就编辑 `apollolake_user_config.json` 文件
2021-10-08 14:19:11 +00:00
1. 添加扩展驱动:
2021-10-13 16:11:31 +00:00
比如 `redpill_tool_chain.sh add https://raw.githubusercontent.com/pocopico/rp-ext/master/mpt3sas/rpext-index.json`
2021-10-11 16:29:44 +00:00
1. 为你想要的平台和版本构建编译镜像:
2021-08-13 14:36:17 +00:00
比如 `redpill_tool_chain.sh build apollolake-7.0-41890`
2021-10-11 16:29:44 +00:00
1. 为你想要的平台和版本构建引导:
2021-09-22 19:24:19 +00:00
比如 `redpill_tool_chain.sh auto apollolake-7.0-41890`
2021-08-09 13:09:48 +00:00
2021-09-22 19:24:19 +00:00
`redpill_tool_chain.sh auto`运行结束之后,将会在宿主机的`./image`文件夹中生成 RedPill引导镜像。
2021-08-09 13:09:48 +00:00
2021-10-08 14:19:11 +00:00
`<platform>_user_config.json`文件中的`extensions`字段保持为空,会自动打包所有已安装的自定义驱动。
自定义驱动请按需添加,尽量不要加载无关驱动,否则会因为扩展驱动太大导致打包失败。
2021-08-13 14:36:17 +00:00
依赖: `docker`
2021-08-09 13:09:48 +00:00
2021-10-13 16:11:31 +00:00
## 快捷说明
2021-10-11 16:29:44 +00:00
2021-08-09 13:56:07 +00:00
- `docker/Dockerfile` 中补入了阿里云镜像
2021-10-08 14:19:11 +00:00
- `redpill_tool_chain.sh add <URL>`添加扩展驱动
- `redpill_tool_chain.sh del <ID>`删除扩展驱动
2021-08-13 14:36:17 +00:00
- `redpill_tool_chain.sh run <platform_version>`自定义引导构建过程
2021-10-11 19:23:41 +00:00
- 使用`synoboot.sh`写入引导
2021-10-13 16:11:31 +00:00
### 自定义扩展驱动管理
- 安装 thethorgroup.virtio : `./redpill_tool_chain.sh add https://github.com/jumkey/redpill-load/raw/develop/redpill-virtio/rpext-index.json`
- 安装 thethorgroup.boot-wait : `./redpill_tool_chain.sh add https://github.com/jumkey/redpill-load/raw/develop/redpill-boot-wait/rpext-index.json`
- 安装 pocopico.mpt3sas : `./redpill_tool_chain.sh add https://raw.githubusercontent.com/pocopico/rp-ext/master/mpt3sas/rpext-index.json`
- 移除 pocopico.mpt3sas : `./redpill_tool_chain.sh del pocopico.mpt3sas`
[获取更多扩展驱动...](https://github.com/pocopico/rp-ext)
### 构建工具链镜像
- `./redpill_tool_chain.sh build bromolow-6.2.4-25556`
- `./redpill_tool_chain.sh build bromolow-7.0-41222`
- `./redpill_tool_chain.sh build apollolake-6.2.4-25556`
- `./redpill_tool_chain.sh build apollolake-7.0-41890`
### 制作 redpill 引导镜像
- `./redpill_tool_chain.sh auto bromolow-6.2.4-25556`
- `./redpill_tool_chain.sh auto bromolow-7.0-41222`
- `./redpill_tool_chain.sh auto apollolake-6.2.4-25556`
- `./redpill_tool_chain.sh auto apollolake-7.0-41890`
### Clean old redpill bootloader images and build cache
- `./redpill_tool_chain.sh clean bromolow-6.2.4-25556`
- `./redpill_tool_chain.sh clean bromolow-7.0-41222`
- `./redpill_tool_chain.sh clean apollolake-6.2.4-25556`
- `./redpill_tool_chain.sh clean apollolake-7.0-41890`
- `./redpill_tool_chain.sh clean all`
### 查看帮助文本
2021-10-13 19:27:26 +00:00
```txt
2021-10-13 16:11:31 +00:00
./redpill_tool_chain.sh
Usage: ./redpill_tool_chain.sh <action> <platform version>
Actions: build, auto, run, clean
- build: Build the toolchain image for the specified platform version.
- auto: Starts the toolchain container using the previosuly build toolchain image for the specified platform.
Updates redpill sources and builds the bootloader image automaticaly. Will end the container once done.
- run: Starts the toolchain container using the previously built toolchain image for the specified platform.
Interactive Bash terminal.
- clean: Removes old (=dangling) images and the build cache for a platform version.
Use all as platform version to remove images and build caches for all platform versions.
- add: To install extension you need to know its index file location and nothing more.
eg: add 'https://example.com/some-extension/rpext-index.json'
- del: To remove an already installed extension you need to know its ID.
eg: del 'example_dev.some_extension'
Available platform versions:
---------------------
bromolow-6.2.4-25556
bromolow-7.0-41222
bromolow-7.0.1-42218
apollolake-6.2.4-25556
apollolake-7.0-41890
apollolake-7.0.1-42218
Custom Extensions:
---------------------
pocopico.mpt3sas
thethorgroup.boot-wait
thethorgroup.virtio
```