Skip to content

Commit

Permalink
添加 DVA3221 支持
Browse files Browse the repository at this point in the history
  • Loading branch information
tossp committed Mar 11, 2022
1 parent e252f88 commit eb7df3c
Show file tree
Hide file tree
Showing 7 changed files with 234 additions and 22 deletions.
23 changes: 19 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:
version: 7.0.1-42218
- platform: ds1621p
version: 7.0.1-42218
- platform: dva3221
version: 7.0.1-42218

steps:
- name: 检出项目文件
Expand All @@ -58,20 +60,33 @@ jobs:
sed -i -e 's\0x0001\0x0002\g' -e 's\0x46f4\0x0002\g' ${{matrix.platform}}_user_config.json
# 调整SN和MAC 最好使用 actions secrets 引入
sed -i -e 's\1234XXX123\0123456789\g' -e 's\XXYYXXYYXXYY\00AAAAAAAAAA\g' ${{matrix.platform}}_user_config.json
sntext=`./redpill_tool_chain.sh sn ${{matrix.platform}}`
use_sn=`echo ${sntext} | grep 'Serial Number' | awk '{print $3}'`
use_mac=`echo ${sntext} | grep 'Mac Address' | awk '{print $3}' | sed 's\:\\g'`
echo ${sntext}
sed -i -e "s\1234XXX123\${use_sn}\g" -e 's\XXYYXXYYXXYY\0011323D47F7\g' ${{matrix.platform}}_user_config.json
# 添加第二张网卡mac并设置网卡数量
sed -i -e 's/00AAAAAAAAAA"/&,\n\t"mac2": "00BBBBBBBBBB",\n\t"netif_num": 2/' ${{matrix.platform}}_user_config.json
sed -i -e 's/0011323D47F7"/&,\n\t"mac2": "0011323D47F8",\n\t"netif_num": 2/' ${{matrix.platform}}_user_config.json
# 调整synoinfo
sed -i -e 's/"synoinfo": {},/"synoinfo": {\n\t"maxlanport": "2"\n },/' ${{matrix.platform}}_user_config.json
# 添加扩展驱动
- name: 添加扩展驱动[非dva3221]
if: matrix.platform != 'dva3221'
run: |
./redpill_tool_chain.sh add https://github.com/jumkey/redpill-load/raw/develop/redpill-acpid/rpext-index.json
./redpill_tool_chain.sh add https://github.com/jumkey/redpill-load/raw/develop/redpill-virtio/rpext-index.json
- name: 添加扩展驱动[dva3221]
if: matrix.platform = 'dva3221'
run: |
# ./redpill_tool_chain.sh add https://github.com/pocopico/rp-ext/raw/main/redpill/rpext-index.json
./redpill_tool_chain.sh add https://github.com/pocopico/rp-ext/raw/main/redpill/rpext-index.json
./redpill_tool_chain.sh add https://github.com/orpheegt/redpill-load/raw/develop/redpill-virtio/rpext-index.json
- name: 添加 jumkey.misc
if: endsWith(matrix.version,'42218')
if: endsWith(matrix.version,'42218') && matrix.platform != 'dva3221'
run: |
./redpill_tool_chain.sh add https://github.com/jumkey/redpill-load/raw/develop/redpill-misc/rpext-index.json
Expand Down
42 changes: 29 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
## 关于项目?

- 基于[RedPill-TTG](https://github.com/RedPill-TTG)源码制作
-`DS918+`提供适当的支持 ( 感谢 [@jumkey](https://github.com/jumkey) )
-`DS3617xs`提供适当的支持 ( 感谢 [@jimmyGALLAND](https://github.com/jimmyGALLAND) )
-`DS918+`提供DSM7适配支持 ( 感谢 [@jumkey](https://github.com/jumkey) )
-`DS3617xs`提供DSM7适配支持 ( 感谢 [@jimmyGALLAND](https://github.com/jimmyGALLAND) )
-`DVA3221`提供DSM7适配支持 ( 感谢 [@dogodefi](https://github.com/dogodefi) )
- 整理社区扩展驱动 ( 感谢 [@pocopico](https://github.com/pocopico) )
- `redpill_lkm_make_target`字段的可选值有 `dev-v6`, `dev-v7`, `test-v6`, `test-v7`, `prod-v6` 或者 `prod-v7`
需要注意后缀为`-v6`的值用于 DSM6 版本构建, 需要注意后缀为`-v7`的值用于 DSM7 版本构建. 默认使用的是 `dev-v6``dev-v7`
Expand All @@ -22,20 +23,20 @@

如果您发现工具链的构建方式有问题或者有改进的想法,请让我知道。

对于所有其他问题:请向社区提出——我知道的并不比其他人多。
对于所有其他问题:请向[社区ddr](https://xpenology.com/forum/forum/35-developer-discussion-room/)提出——我知道的并不比其他人多。

## 如何使用?

1. 复制`sample_user_config.json``ds3615xs_user_config.json`或者`ds918p_user_config.json`
1. 编辑`<platform>_user_config.json`比如 918+ 就编辑 `ds918p_user_config.json` 文件
1. 添加扩展驱动:
比如 `redpill_tool_chain.sh add https://raw.githubusercontent.com/pocopico/rp-ext/master/mpt3sas/rpext-index.json`
比如 `./redpill_tool_chain.sh add https://raw.githubusercontent.com/pocopico/rp-ext/master/mpt3sas/rpext-index.json`
1. 为你想要的平台和版本构建编译镜像:
比如 `redpill_tool_chain.sh build ds918p-7.0-41890`
比如 `./redpill_tool_chain.sh build ds918p-7.0-41890`
1. 为你想要的平台和版本构建引导:
比如 `redpill_tool_chain.sh auto ds918p-7.0-41890`
比如 `./redpill_tool_chain.sh auto ds918p-7.0-41890`

`redpill_tool_chain.sh auto`运行结束之后,将会在宿主机的`./image`文件夹中生成 RedPill引导镜像。
`./redpill_tool_chain.sh auto`运行结束之后,将会在宿主机的`./image`文件夹中生成 RedPill引导镜像。

`<platform>_user_config.json`文件中的`extensions`字段保持为空,会自动打包所有已安装的自定义驱动。
自定义驱动请按需添加,尽量不要加载无关驱动,否则会因为扩展驱动太大导致打包失败。
Expand All @@ -45,9 +46,9 @@
## 快捷说明

- `docker/Dockerfile` 中补入了阿里云镜像
- `redpill_tool_chain.sh add <URL>`添加扩展驱动
- `redpill_tool_chain.sh del <ID>`删除扩展驱动
- `redpill_tool_chain.sh run <platform_version>`自定义引导构建过程
- `./redpill_tool_chain.sh add <URL>`添加扩展驱动
- `./redpill_tool_chain.sh del <ID>`删除扩展驱动
- `./redpill_tool_chain.sh run <platform_version>`自定义引导构建过程
- 使用`synoboot.sh`写入引导

### 自定义扩展驱动管理
Expand All @@ -70,19 +71,25 @@
- `./redpill_tool_chain.sh auto ds3615xs-6.2.4-25556`
- `./redpill_tool_chain.sh auto ds918p-7.0.1-42218`

### Clean old redpill bootloader images and build cache
### 清除旧的引导镜像和缓存

- `./redpill_tool_chain.sh clean ds3615xs-6.2.4-25556`
- `./redpill_tool_chain.sh clean ds918p-7.0.1-42218`
- `./redpill_tool_chain.sh clean all`

### 生成指定平台的序列号和MAC地址

- `./redpill_tool_chain.sh sn ds918p`
- `./redpill_tool_chain.sh sn dva3221`

### 查看帮助文本

`./redpill_tool_chain.sh`

```txt
./redpill_tool_chain.sh
Usage: ./redpill_tool_chain.sh <action> <platform version>
Actions: build, auto, run, clean
Actions: build, auto, run, clean, add, del, sn
- build: Build the toolchain image for the specified platform version.
Expand All @@ -101,6 +108,10 @@ Actions: build, auto, run, clean
- del: To remove an already installed extension you need to know its ID.
eg: del 'example_dev.some_extension'
- sn: Generates a serial number and mac address for the following platforms
DS3615xs DS3617xs DS916+ DS918+ DS920+ DS3622xs+ FS6400 DVA3219 DVA3221 DS1621+
eg: sn ds920p
Available platform versions:
---------------------
ds3615xs-6.2.4-25556
Expand All @@ -113,12 +124,17 @@ ds3617xs-7.0.1-42218
ds3622xsp-7.0.1-42218
ds920p-7.0.1-42218
ds1621p-7.0.1-42218
dva3221-7.0.1-42218
Custom Extensions:
---------------------
jumkey.acpid2
pocopico.mpt3sas
pocopico.vmxnet3
thethorgroup.boot-wait
thethorgroup.virtio
Check global_settings.json for settings.
```

## 更多细节
Expand Down
11 changes: 10 additions & 1 deletion README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Examples:
./redpill_tool_chain.sh
Usage: ./redpill_tool_chain.sh <action> <platform version>
Actions: build, auto, run, clean
Actions: build, auto, run, clean, add, del, sn
- build: Build the toolchain image for the specified platform version.
Expand All @@ -77,6 +77,10 @@ Actions: build, auto, run, clean
- del: To remove an already installed extension you need to know its ID.
eg: del 'example_dev.some_extension'
- sn: Generates a serial number and mac address for the following platforms
DS3615xs DS3617xs DS916+ DS918+ DS920+ DS3622xs+ FS6400 DVA3219 DVA3221 DS1621+
eg: sn ds920p
Available platform versions:
---------------------
ds3615xs-6.2.4-25556
Expand All @@ -89,12 +93,17 @@ ds3617xs-7.0.1-42218
ds3622xsp-7.0.1-42218
ds920p-7.0.1-42218
ds1621p-7.0.1-42218
dva3221-7.0.1-42218
Custom Extensions:
---------------------
jumkey.acpid2
pocopico.mpt3sas
pocopico.vmxnet3
thethorgroup.boot-wait
thethorgroup.virtio
Check global_settings.json for settings.
```

### Custom extended driver management
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ ENV ARCH=x86_64 \
ARG EXTRACTED_KSRC
COPY --from=extract ${EXTRACTED_KSRC} ${LINUX_SRC}

RUN if [ "apollolake" = "$TARGET_PLATFORM" ] || [ "broadwellnk" = "$TARGET_PLATFORM" ] || [ "geminilake" = "$TARGET_PLATFORM" ] || [ "v1000" = "$TARGET_PLATFORM" ]; then echo '+' > ${LINUX_SRC}/.scmversion; fi && \
RUN if [ "apollolake" = "$TARGET_PLATFORM" ] || [ "broadwellnk" = "$TARGET_PLATFORM" ] || [ "geminilake" = "$TARGET_PLATFORM" ] || [ "v1000" = "$TARGET_PLATFORM" ] || [ "denverton" = "$TARGET_PLATFORM" ]; then echo '+' > ${LINUX_SRC}/.scmversion; fi && \
if [ "$COMPILE_WITH" = "kernel" ]; then \
cp ${LINUX_SRC}/synoconfigs/${TARGET_PLATFORM} ${LINUX_SRC}/.config && \
make -C ${LINUX_SRC} oldconfig && \
Expand Down
27 changes: 27 additions & 0 deletions global_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,33 @@
"source_url": "https://github.com/jumkey/redpill-load.git",
"branch": "develop"
}
},
{
"id": "dva3221-7.0.1-42218",
"platform_name": "DVA3221",
"platform_version": "denverton-7.0.1-42218",
"user_config_json": "dva3221_user_config.json",
"docker_base_image": "debian:10-slim",
"compile_with": "toolkit_dev",
"redpill_lkm_make_target": "dev-v7",
"downloads": {
"kernel": {
"url": "https://sourceforge.net/projects/dsgpl/files/Synology%20NAS%20GPL%20Source/25426branch/denverton-source/linux-4.4.x.txz/download",
"sha256": "ac532ebb221d9c55f78236d57288ac31d410dde01f1453f60b0c502333fdf107"
},
"toolkit_dev": {
"url": "https://sourceforge.net/projects/dsgpl/files/toolkit/DSM7.0/ds.denverton-7.0.dev.txz/download",
"sha256": "6108f9f7b7f0a13ee985314aef9419303375ab7ded4112be991590339b66ecd1"
}
},
"redpill_lkm": {
"source_url": "https://github.com/dogodefi/redpill-lkm.git",
"branch": "develop"
},
"redpill_load": {
"source_url": "https://github.com/dogodefi/redpill-load.git",
"branch": "develop"
}
}
]
}
12 changes: 9 additions & 3 deletions redpill_tool_chain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ function showHelp(){
cat << EOF
Usage: ${0} <action> <platform version>
Actions: build, auto, run, clean
Actions: build, auto, run, clean, add, del, sn
- build: Build the toolchain image for the specified platform version.
Expand All @@ -210,6 +210,10 @@ Actions: build, auto, run, clean
- del: To remove an already installed extension you need to know its ID.
eg: del 'example_dev.some_extension'
- sn: Generates a serial number and mac address for the following platforms
DS3615xs DS3617xs DS916+ DS918+ DS920+ DS3622xs+ FS6400 DVA3219 DVA3221 DS1621+
eg: sn ds920p
Available platform versions:
---------------------
${AVAILABLE_IDS}
Expand Down Expand Up @@ -272,7 +276,7 @@ fi
ACTION=${1}
ID=${2}

if [[ "${ACTION}" != "del" && "${ACTION}" != "add" && "${ID}" != "all" ]]; then
if [[ "${ACTION}" != "del" && "${ACTION}" != "add" && "${ACTION}" != "sn" && "${ID}" != "all" ]]; then
BUILD_CONFIG=$(getValueByJsonPath ".build_configs[] | select(.id==\"${ID}\")" "${CONFIG}")
if [ -z "${BUILD_CONFIG}" ];then
echo "Error: Platform version ${ID} not specified in global_config.json"
Expand Down Expand Up @@ -312,7 +316,7 @@ if [[ "${ACTION}" != "del" && "${ACTION}" != "add" && "${ID}" != "all" ]]; then
EXTRACTED_KSRC="/usr/local/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/sys-root/usr/lib/modules/DSM-${DSM_VERSION}/build/"
fi
else
if [[ "${ACTION}" != "del" && "${ACTION}" != "add" && "${ACTION}" != "clean" ]]; then
if [[ "${ACTION}" != "del" && "${ACTION}" != "add" && "${ACTION}" != "sn" && "${ACTION}" != "clean" ]]; then
echo "All is not supported for action \"${ACTION}\""
exit 1
fi
Expand Down Expand Up @@ -341,6 +345,8 @@ case "${ACTION}" in
;;
clean) clean
;;
sn) ./serialnumbergen.sh `echo "${2}" | tr 'a-z' 'A-Z' | tr 'P' '+'`
;;
*) if [ ! -z ${ACTION} ];then
echo "Error: action ${ACTION} does not exist"
echo ""
Expand Down
Loading

0 comments on commit eb7df3c

Please sign in to comment.