├── .editorconfig ├── .github └── workflows │ └── test.yml ├── .gitignore ├── README.md ├── README_EN.md ├── cache └── .gitignore ├── custom └── .gitignore ├── docker ├── Dockerfile ├── Makefile ├── downloads │ └── .gitignore ├── entrypoint.sh └── helper.sh ├── extensions ├── pocopico-r8125.json ├── redpill-acpid.json ├── redpill-boot-wait.json ├── redpill-dtb.json ├── redpill-misc.json └── redpill-virtio.json ├── global_config.json ├── images └── .gitignore ├── redpill_tool_chain.sh ├── sample_user_config.json ├── serialnumbergen.sh └── synoboot.sh /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | end_of_line = lf 7 | indent_style = space 8 | indent_size = 2 9 | insert_final_newline = true 10 | trim_trailing_whitespace = true 11 | 12 | [*.md] 13 | indent_style = tab 14 | trim_trailing_whitespace = false 15 | 16 | [{Makefile,**.mk}] 17 | indent_style = tab 18 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: 构建 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | clean_cache: 7 | description: 'Clear caches' 8 | required: false 9 | type: boolean 10 | push: 11 | branches: 12 | - master 13 | paths: 14 | - "docker/**" 15 | - "**.sh" 16 | - "**.json" 17 | 18 | jobs: 19 | build: 20 | runs-on: ubuntu-latest 21 | name: 编译 "${{matrix.platform}} ${{matrix.version}}" 22 | strategy: 23 | fail-fast: false 24 | matrix: 25 | include: 26 | # 两行一组,删除不需要的版本 27 | - platform: ds1621p 28 | version: 7.0.1-42218 29 | - platform: ds1621p 30 | version: 7.1.0-42661 31 | 32 | - platform: ds2422p 33 | version: 7.0.1-42218 34 | 35 | - platform: ds3615xs 36 | version: 6.2.4-25556 37 | - platform: ds3615xs 38 | version: 7.0.1-42218 39 | - platform: ds3615xs 40 | version: 7.1.0-42661 41 | 42 | # - platform: ds3617xs 43 | # version: 7.0.1-42218 44 | - platform: ds3617xs 45 | version: 7.1.0-42661 46 | 47 | - platform: ds3622xsp 48 | version: 7.0.1-42218 49 | - platform: ds3622xsp 50 | version: 7.1.0-42661 51 | 52 | - platform: ds918p 53 | version: 6.2.4-25556 54 | - platform: ds918p 55 | version: 7.0.1-42218 56 | - platform: ds918p 57 | version: 7.1.0-42661 58 | 59 | - platform: ds920p 60 | version: 7.0.1-42218 61 | - platform: ds920p 62 | version: 7.1.0-42661 63 | 64 | # - platform: dva3221 65 | # version: 7.0.1-42218 66 | - platform: dva3221 67 | version: 7.1.0-42661 68 | 69 | steps: 70 | - name: 检出项目文件 71 | uses: actions/checkout@v3 72 | 73 | - name: 缓存加速 74 | uses: actions/cache@v3 75 | with: 76 | path: | 77 | cache/*.pat 78 | cache/*.org 79 | docker/downloads/*.txz 80 | key: ${{matrix.platform}}-${{matrix.version}}-${{ hashFiles('global_config.json') }} 81 | restore-keys: ${{matrix.platform}}-${{matrix.version}}- 82 | 83 | - name: 清理缓存 84 | if: "${{ github.event.inputs.clean_cache == 'true' }}" 85 | run: | 86 | rm -rf cache/*.pat 87 | rm -rf cache/*.org 88 | rm -rf docker/downloads/*.txz 89 | 90 | - name: 准备构建环境 91 | run: | 92 | ./redpill_tool_chain.sh build ${{matrix.platform}}-${{matrix.version}} 93 | 94 | - name: 配置引导镜像 95 | run: | 96 | cp sample_user_config.json ${{matrix.platform}}_user_config.json 97 | 98 | # 调整VID和PID 99 | sed -i -e 's/0x0001/0x88AA/g' -e 's/0x46f4/0x88AA/g' ${{matrix.platform}}_user_config.json 100 | 101 | # 调整SN和MAC,最好使用 actions secrets 引入,SN应该是固定值不应该每次生成 102 | sn=`./redpill_tool_chain.sh sn ${{matrix.platform}} | grep 'Serial Number' | awk '{print $3}'` 103 | sed -i -e "s/1234XXX123/${sn:="1130LWN123456"}/g" -e 's/XXYYXXYYXXYY/0011323D47F7/g' ${{matrix.platform}}_user_config.json 104 | 105 | # 添加第二张网卡mac并设置网卡数量 106 | sed -i -e 's/0011323D47F7"/&,\n\t"mac2": "0011323D47F8",\n\t"netif_num": 2/' ${{matrix.platform}}_user_config.json 107 | 108 | # 调整synoinfo 109 | sed -i -e 's/"synoinfo": {},/"synoinfo": {\n\t"maxlanport": "2"\n },/' ${{matrix.platform}}_user_config.json 110 | 111 | cat ${{matrix.platform}}_user_config.json 112 | 113 | - name: 添加扩展驱动 114 | if: matrix.platform != 'dva3221' 115 | run: | 116 | ./redpill_tool_chain.sh add https://github.com/tossp/redpill-tool-chain/raw/master/extensions/redpill-boot-wait.json 117 | ./redpill_tool_chain.sh add https://github.com/tossp/redpill-tool-chain/raw/master/extensions/redpill-acpid.json 118 | ./redpill_tool_chain.sh add https://github.com/tossp/redpill-tool-chain/raw/master/extensions/redpill-virtio.json 119 | 120 | - name: 添加扩展驱动[dva3221] 121 | if: matrix.platform == 'dva3221' 122 | run: | 123 | echo '等待整理兼容性扩展~😀' 124 | ./redpill_tool_chain.sh add https://github.com/tossp/redpill-tool-chain/raw/master/extensions/redpill-boot-wait.json 125 | 126 | - name: 添加 Misc shell 127 | run: | 128 | ./redpill_tool_chain.sh add https://github.com/tossp/redpill-tool-chain/raw/master/extensions/redpill-misc.json 129 | 130 | - name: 添加 jumkey.dtb !!!Create your own device tree binary!!! 131 | if: matrix.platform == 'ds920p' || matrix.platform == 'ds1621p' || matrix.platform == 'ds2422p' 132 | run: | 133 | ./redpill_tool_chain.sh add https://github.com/tossp/redpill-tool-chain/raw/master/extensions/redpill-dtb.json 134 | echo '!!!Create your own device tree binary!!!' 135 | echo 'see https://github.com/jumkey/redpill-load/blob/develop/redpill-dtb/README.md' 136 | 137 | - name: 预处理PAT 138 | if: endsWith(matrix.version, '42661') && startsWith(matrix.platform, 'ds361') 139 | run: | 140 | sed -i 's/debian:8-slim/debian:10-slim/g' global_config.json 141 | ./redpill_tool_chain.sh build ${{matrix.platform}}-${{matrix.version}} 142 | ./redpill_tool_chain.sh pat ${{matrix.platform}}-${{matrix.version}} 143 | sed -i 's/debian:10-slim/debian:8-slim/g' global_config.json 144 | ./redpill_tool_chain.sh build ${{matrix.platform}}-${{matrix.version}} 145 | 146 | - name: 编译引导镜像 147 | run: | 148 | ./redpill_tool_chain.sh auto ${{matrix.platform}}-${{matrix.version}} 149 | 150 | - name: 上传引导镜像到 github actions 151 | uses: actions/upload-artifact@v3 152 | with: 153 | name: dsm-${{matrix.platform}}-${{matrix.version}} 154 | path: images/redpill-*.img 155 | if-no-files-found: error 156 | 157 | - name: 删除旧的工作流 158 | uses: Mattraks/delete-workflow-runs@v2 159 | with: 160 | retain_days: 1 161 | keep_minimum_runs: 3 162 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.txz 2 | *.json 3 | !extensions/*.json 4 | !sample_user_config.json 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # RedPill Tool Chain 2 | 3 | [![构建](https://github.com/tossp/redpill-tool-chain/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/tossp/redpill-tool-chain/actions/workflows/test.yml) 4 | 5 | 这是一个测试项目,可能会有不可预测的事情发生(比如:毁损数据、烧毁硬件等等),请**谨慎使用**。 6 | 7 | [English](README_EN.md "English") 8 | 9 | 感谢 @haydibe 提供 RedPill Tool Chain 10 | 11 | ## 关于项目? 12 | 13 | - 基于[RedPill-TTG](https://github.com/RedPill-TTG)源码制作 14 | - 为`DS918+`提供DSM7适配支持 ( 感谢 [@jumkey](https://github.com/jumkey) ) 15 | - 为`DS3617xs`提供DSM7适配支持 ( 感谢 [@jimmyGALLAND](https://github.com/jimmyGALLAND) ) 16 | - 为`DVA3221`提供DSM7适配支持 ( 感谢 [@dogodefi](https://github.com/dogodefi) ) 17 | - 整理社区扩展驱动 ( 感谢 [@pocopico](https://github.com/pocopico) ) 18 | - 部分引导提取自 [@tinycore-redpill](https://github.com/pocopico/tinycore-redpill) 项目 19 | - `redpill_lkm_make_target`字段的可选值有 `dev-v6`, `dev-v7`, `test-v6`, `test-v7`, `prod-v6` 或者 `prod-v7`, 20 | 需要注意后缀为`-v6`的值用于 DSM6 版本构建, 需要注意后缀为`-v7`的值用于 DSM7 版本构建. 默认使用的是 `dev-v6` 和 `dev-v7`。 21 | 22 | > PS: 由于toolkit dev缺少fs/proc所需的源代码,因此它们取自提取的DSM6.2.4内核源代码。 23 | 构建需要此单个文件夹的源代码,但不使用内核源代码构建redpill.ko模块。 24 | 25 | 如果您发现工具链的构建方式有问题或者有改进的想法,请让我知道。 26 | 27 | 对于所有其他问题:请向[社区ddr](https://xpenology.com/forum/forum/35-developer-discussion-room/)提出——我知道的并不比其他人多。 28 | 29 | ## 如何使用? 30 | 31 | 1. 复制`sample_user_config.json`为`ds3615xs_user_config.json`或者`ds918p_user_config.json` 32 | 1. 编辑`_user_config.json`比如 918+ 就编辑 `ds918p_user_config.json` 文件 33 | 1. 添加扩展驱动: 34 | 比如 `./redpill_tool_chain.sh add https://raw.githubusercontent.com/pocopico/rp-ext/master/mpt3sas/rpext-index.json` 35 | 1. 为你想要的平台和版本构建编译镜像: 36 | 比如 `./redpill_tool_chain.sh build ds918p-7.0-41890` 37 | 1. 为你想要的平台和版本构建引导: 38 | 比如 `./redpill_tool_chain.sh auto ds918p-7.0-41890` 39 | 40 | `./redpill_tool_chain.sh auto`运行结束之后,将会在宿主机的`./image`文件夹中生成 RedPill引导镜像。 41 | 42 | `_user_config.json`文件中的`extensions`字段保持为空,会自动打包所有已安装的自定义驱动。 43 | 自定义驱动请按需添加,尽量不要加载无关驱动,否则会因为扩展驱动太大导致打包失败。 44 | 45 | 依赖: `docker` 46 | 47 | --- 48 | ⚠️⚠️⚠️ 49 | 由于各版本环境不完全一致,制作策略会有细节变化,具体可以参考 [工作流配置文件](https://github.com/tossp/redpill-tool-chain/blob/master/.github/workflows/test.yml) 50 | 51 | 在 [Gtihub Actions](https://github.com/tossp/redpill-tool-chain/actions) 中查看执行结果,并下载生成的镜像 52 | 53 | ❗❗❗ 54 | [工作流配置文件](https://github.com/tossp/redpill-tool-chain/blob/master/.github/workflows/test.yml) 中引入的扩展都是推荐必装扩展 55 | 56 | --- 57 | 58 | ## 快捷说明 59 | 60 | - `docker/Dockerfile` 中补入了阿里云镜像 61 | - `./redpill_tool_chain.sh add `添加扩展驱动 62 | - `./redpill_tool_chain.sh del `删除扩展驱动 63 | - `./redpill_tool_chain.sh run `自定义引导构建过程 64 | - 使用`synoboot.sh`写入引导 65 | 66 | ### 自定义扩展驱动管理 67 | 68 | - 安装 thethorgroup.virtio : `./redpill_tool_chain.sh add https://github.com/jumkey/redpill-load/raw/develop/redpill-virtio/rpext-index.json` 69 | - 安装 thethorgroup.boot-wait : `./redpill_tool_chain.sh add https://github.com/jumkey/redpill-load/raw/develop/redpill-boot-wait/rpext-index.json` 70 | - 安装 pocopico.mpt3sas : `./redpill_tool_chain.sh add https://raw.githubusercontent.com/pocopico/rp-ext/master/mpt3sas/rpext-index.json` 71 | - 移除 pocopico.mpt3sas : `./redpill_tool_chain.sh del pocopico.mpt3sas` 72 | - 安装 jumkey.dtb : `./redpill_tool_chain.sh add https://github.com/jumkey/redpill-load/raw/develop/redpill-dtb/rpext-index.json` 73 | 74 | [获取更多扩展驱动...](https://github.com/pocopico/rp-ext) 75 | 76 | ### 构建工具链镜像 77 | 78 | - `./redpill_tool_chain.sh build ds3615xs-6.2.4-25556` 79 | - `./redpill_tool_chain.sh build ds918p-7.0.1-42218` 80 | 81 | ### 制作 redpill 引导镜像 82 | 83 | - `./redpill_tool_chain.sh auto ds3615xs-6.2.4-25556` 84 | - `./redpill_tool_chain.sh auto ds918p-7.0.1-42218` 85 | 86 | ### 清除旧的引导镜像和缓存 87 | 88 | - `./redpill_tool_chain.sh clean ds3615xs-6.2.4-25556` 89 | - `./redpill_tool_chain.sh clean ds918p-7.0.1-42218` 90 | - `./redpill_tool_chain.sh clean all` 91 | 92 | ### 生成指定平台的序列号和MAC地址 93 | 94 | - `./redpill_tool_chain.sh sn ds918p` 95 | - `./redpill_tool_chain.sh sn dva3221` 96 | 97 | ### 查看帮助文本 98 | 99 | `./redpill_tool_chain.sh` 100 | 101 | ```txt 102 | Usage: ./redpill_tool_chain.sh 103 | 104 | Actions: build, auto, run, clean, add, del, sn, pat 105 | 106 | - build: Build the toolchain image for the specified platform version. 107 | 108 | - auto: Starts the toolchain container using the previosuly build toolchain image for the specified platform. 109 | Updates redpill sources and builds the bootloader image automaticaly. Will end the container once done. 110 | 111 | - run: Starts the toolchain container using the previously built toolchain image for the specified platform. 112 | Interactive Bash terminal. 113 | 114 | - clean: Removes old (=dangling) images and the build cache for a platform version. 115 | Use ‘all’ as platform version to remove images and build caches for all platform versions. 116 | 117 | - add: To install extension you need to know its index file location and nothing more. 118 | eg: add 'https://example.com/some-extension/rpext-index.json' 119 | 120 | - del: To remove an already installed extension you need to know its ID. 121 | eg: del 'example_dev.some_extension' 122 | 123 | - sn: Generates a serial number and mac address for the following platforms 124 | DS3615xs DS3617xs DS916+ DS918+ DS920+ DS3622xs+ FS6400 DVA3219 DVA3221 DS1621+ 125 | eg: sn ds920p 126 | 127 | - pat: For decoding PAT file. 128 | 129 | Available platform versions: 130 | --------------------- 131 | ds1621p-7.0.1-42218 132 | ds1621p-7.1.0-42661 133 | ds2422p-7.0.1-42218 134 | ds3615xs-6.2.4-25556 135 | ds3615xs-7.0.1-42218 136 | ds3615xs-7.1.0-42661 137 | ds3617xs-7.0.1-42218 138 | ds3617xs-7.1.0-42661 139 | ds3622xsp-7.0.1-42218 140 | ds3622xsp-7.1.0-42661 141 | ds918p-6.2.4-25556 142 | ds918p-7.0.1-42218 143 | ds918p-7.1.0-42661 144 | ds920p-7.0.1-42218 145 | ds920p-7.1.0-42661 146 | dva3221-7.0.1-42218 147 | dva3221-7.1.0-42661 148 | 149 | Custom Extensions: 150 | --------------------- 151 | jumkey.acpid2 152 | thethorgroup.boot-wait 153 | thethorgroup.virtio 154 | 155 | Check global_settings.json for settings. 156 | ``` 157 | 158 | ## 更多细节 159 | 160 | 编译`DS920+`和`DS1621+`需要加入`jumkey.dtb`扩展并参考[这里](https://github.com/jumkey/redpill-load/blob/develop/redpill-dtb/README.md)创建设备的二进制设备树 161 | 162 | 查看基于[test.yml](https://github.com/tossp/redpill-tool-chain/blob/master/.github/workflows/test.yml)的使用[示例](https://github.com/tossp/redpill-tool-chain/actions/workflows/test.yml) 163 | -------------------------------------------------------------------------------- /README_EN.md: -------------------------------------------------------------------------------- 1 | # RedPill Tool Chain 2 | 3 | [![构建](https://github.com/tossp/redpill-tool-chain/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/tossp/redpill-tool-chain/actions/workflows/test.yml) 4 | 5 | [中文说明](README.md "English") 6 | THX @haydibe 7 | 8 | ## Inofficial redpill toolchain image builder 9 | 10 | - Creates a OCI Container (~= Docker) image based tool chain. 11 | - Takes care of downloading (and caching) the required sources to compile redpill.ko and the required os packages that the build process depends on. 12 | - Caches .pat downloads inside the container on the host. 13 | - Configuration is done in the JSON file `global_config.json`; custom entries can be added underneath the `building_configs` block. Make sure the id is unique per block! 14 | - Supports a `user_config.json` per 15 | - Supports to bind a local redpill-lkm folder into the container (set `"docker.local_rp_lkm_use": "true"` and set `"docker.local_rp_lkm_path": "path/to/rp-lkm"`) 16 | - Supports to bind a local redpill-load folder into the container (set `"docker.local_rp_load_use": "true"` and set `"docker.local_rp_load_path": "path/to/rp-load"`) 17 | - Supports to clean old image versions and the build cache per or for `all` of them at once. 18 | - Supports to auto clean old image versions and the build cache for the current build image, set `"docker.auto_clean":`to `"true"`. 19 | - Allows to configure if the build cache is used or not ("docker.use_build_cache") 20 | - Allows to specify if "clean all" should delete all or only orphaned images. 21 | - The default `global_config.json` contains platform versions provided by the official redpill-load image. Please create new and point them to custom repositories if wanted. 22 | - Supports to add custom mounts (set`"docker.use_custom_bind_mounts":` to `"true"` and add your custom bind-mounts in `"docker.custom_bind_mounts"`). 23 | - Performs integrity check of required kernel/toolkit-dev required for the image build 24 | - Supports the make target to specify the redpill.ko build configuration. Set `.redpill_lkm_make_target` to `dev-v6`, `dev-v7`, `test-v6`, `test-v7`, `prod-v6` or `prod-v7`. 25 | Make sure to use the -v6 ones on DSM6 build and -v7 on DSM7 build. By default the targets `dev-v6` and `dev-v7` are used. 26 | 27 | - dev: all symbols included, debug messages included 28 | - test: fully stripped with only warning & above (no debugs or info) 29 | - prod: fully stripped with no debug messages 30 | 31 | ## Changes 32 | 33 | - added the additionaly required make target when building redpill.ko 34 | - added a new configuration item in `.redpill_lkm_make_target` to set the build target 35 | 36 | ## Usage 37 | 38 | 1. Edit `_user_config.json` that matches your according [redpill-load](https://github.com/RedPill-TTG/redpill-load) and place it in the same folder as redpill_tool_chain.sh 39 | 2. Build the image for the platform and version you want: 40 | `./redpill_tool_chain.sh build ` 41 | 3. Run the image for the platform and version you want: 42 | `./redpill_tool_chain.sh auto ` 43 | 44 | You can always use `./redpill_tool_chain.sh run ` to get a bash prompt, modify whatever you want and finaly execute `make -C /opt/build_all` to build the boot loader image. 45 | After step 3. the redpill load image should be build and can be found in the host folder "images". 46 | 47 | Note1: run `./redpill_tool_chain.sh` to get the list of supported ids for the parameter. 48 | Note2: if `docker.use_local_rp_load` is set to `true`, the auto action will not pull latest redpill-load sources. 49 | Note3: Please do not ask to add with configurations for other redpill-load repositories. 50 | 51 | Feel free to modify any values in `global_config.json` that suite your needs! 52 | 53 | --- 54 | ⚠️⚠️⚠️ 55 | Due to the complex environment of each version, the packaging strategy will change in detail. For details, please refer to the [workflow configuration file](https://github.com/tossp/redpill-tool-chain/blob/master/.github/workflows/test.yml) 56 | 57 | View the execution results in [Gtihub Actions](https://github.com/tossp/redpill-tool-chain/actions) and download the generated image. 58 | 59 | ❗❗❗ 60 | All extensions introduced in the [workflow configuration file](https://github.com/tossp/redpill-tool-chain/blob/master/.github/workflows/test.yml) are recommended and required 61 | 62 | --- 63 | 64 | Examples: 65 | 66 | ### See Help text 67 | 68 | ```txt 69 | ./redpill_tool_chain.sh 70 | Usage: ./redpill_tool_chain.sh 71 | 72 | Actions: build, auto, run, clean, add, del, sn, pat 73 | 74 | - build: Build the toolchain image for the specified platform version. 75 | 76 | - auto: Starts the toolchain container using the previosuly build toolchain image for the specified platform. 77 | Updates redpill sources and builds the bootloader image automaticaly. Will end the container once done. 78 | 79 | - run: Starts the toolchain container using the previously built toolchain image for the specified platform. 80 | Interactive Bash terminal. 81 | 82 | - clean: Removes old (=dangling) images and the build cache for a platform version. 83 | Use ‘all’ as platform version to remove images and build caches for all platform versions. 84 | 85 | - add: To install extension you need to know its index file location and nothing more. 86 | eg: add 'https://example.com/some-extension/rpext-index.json' 87 | 88 | - del: To remove an already installed extension you need to know its ID. 89 | eg: del 'example_dev.some_extension' 90 | 91 | - sn: Generates a serial number and mac address for the following platforms 92 | DS3615xs DS3617xs DS916+ DS918+ DS920+ DS3622xs+ FS6400 DVA3219 DVA3221 DS1621+ 93 | eg: sn ds920p 94 | 95 | - pat: For decoding PAT file. 96 | 97 | Available platform versions: 98 | --------------------- 99 | ds1621p-7.0.1-42218 100 | ds1621p-7.1.0-42661 101 | ds2422p-7.0.1-42218 102 | ds3615xs-6.2.4-25556 103 | ds3615xs-7.0.1-42218 104 | ds3615xs-7.1.0-42661 105 | ds3617xs-7.0.1-42218 106 | ds3617xs-7.1.0-42661 107 | ds3622xsp-7.0.1-42218 108 | ds3622xsp-7.1.0-42661 109 | ds918p-6.2.4-25556 110 | ds918p-7.0.1-42218 111 | ds918p-7.1.0-42661 112 | ds920p-7.0.1-42218 113 | ds920p-7.1.0-42661 114 | dva3221-7.0.1-42218 115 | dva3221-7.1.0-42661 116 | 117 | Custom Extensions: 118 | --------------------- 119 | jumkey.acpid2 120 | thethorgroup.boot-wait 121 | thethorgroup.virtio 122 | 123 | Check global_settings.json for settings. 124 | ``` 125 | 126 | ### Custom extended driver management 127 | 128 | - Install thethorgroup.virtio : `./redpill_tool_chain.sh add https://github.com/jumkey/redpill-load/raw/develop/redpill-virtio/rpext-index.json` 129 | - Install thethorgroup.boot-wait : `./redpill_tool_chain.sh add https://github.com/jumkey/redpill-load/raw/develop/redpill-boot-wait/rpext-index.json` 130 | - Install pocopico.mpt3sas : `./redpill_tool_chain.sh add https://raw.githubusercontent.com/pocopico/rp-ext/master/mpt3sas/rpext-index.json` 131 | - Remove pocopico.mpt3sas : `./redpill_tool_chain.sh del pocopico.mpt3sas` 132 | 133 | [Get more extended drivers....](https://github.com/pocopico/rp-ext) 134 | 135 | ### Build toolchain image 136 | 137 | - For Bromolow 6.2.4 : `./redpill_tool_chain.sh build ds3615xs-6.2.4-25556` 138 | - For Apollolake 7.0 : `./redpill_tool_chain.sh build ds918p-7.0-41890` 139 | 140 | ### Create redpill bootloader image 141 | 142 | - For Bromolow 6.2.4 : `./redpill_tool_chain.sh auto ds3615xs-6.2.4-25556` 143 | - For Apollolake 7.0 : `./redpill_tool_chain.sh auto ds918p-7.0-41890` 144 | 145 | ### Clean old redpill bootloader images and build cache 146 | 147 | - For Bromolow 6.2.4 : `./redpill_tool_chain.sh clean ds3615xs-6.2.4-25556` 148 | - For Apollolake 7.0 : `./redpill_tool_chain.sh clean ds918p-7.0-41890` 149 | - For all : `./redpill_tool_chain.sh clean all` 150 | -------------------------------------------------------------------------------- /cache/.gitignore: -------------------------------------------------------------------------------- 1 | *.img 2 | *.pat 3 | -------------------------------------------------------------------------------- /custom/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG DOCKER_BASE_IMAGE=debian:8 2 | # extract kernel and toolkit dev 3 | FROM ${DOCKER_BASE_IMAGE} AS extract 4 | 5 | ARG KERNEL_SRC_FILENAME 6 | ADD downloads/${KERNEL_SRC_FILENAME} / 7 | 8 | # tool chain image 9 | FROM ${DOCKER_BASE_IMAGE} 10 | 11 | ARG DEBIAN_FRONTEND=noninteractive 12 | 13 | # RUN cp /etc/apt/sources.list /etc/apt/sources.list.bak && \ 14 | # sed -i "s/archive.ubuntu.com/mirrors.aliyun.com/g" /etc/apt/sources.list && \ 15 | # sed -i "s/security.ubuntu.com/mirrors.aliyun.com/g" /etc/apt/sources.list && \ 16 | # sed -i "s/deb.debian.org/mirrors.aliyun.com/g" /etc/apt/sources.list && \ 17 | # sed -i "s/security.debian.org/mirrors.aliyun.com/g" /etc/apt/sources.list 18 | 19 | RUN cat /etc/os-release | grep -q 'jessie' && echo 'APT::Get::AllowUnauthenticated "true";' | tee /etc/apt/apt.conf.d/99disable-gpg-auth || true 20 | RUN apt-get update && \ 21 | apt-get install --yes --no-install-recommends ca-certificates build-essential git libssl-dev curl cpio bspatch vim gettext bc bison flex dosfstools kmod && \ 22 | rm -rf /var/lib/apt/lists/* /tmp/* && \ 23 | curl --progress-bar --output /usr/bin/jq --location https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 && chmod +x /usr/bin/jq 24 | 25 | ARG REDPILL_LKM_REPO=https://github.com/RedPill-TTG/redpill-lkm.git 26 | ARG REDPILL_LKM_BRANCH=master 27 | ARG REDPILL_LKM_SRC=/opt/redpill-lkm 28 | 29 | ARG REDPILL_LOAD_REPO=https://github.com/RedPill-TTG/redpill-load.git 30 | ARG REDPILL_LOAD_BRANCH=master 31 | ARG REDPILL_LOAD_SRC=/opt/redpill-load 32 | 33 | RUN git clone ${REDPILL_LKM_REPO} -b ${REDPILL_LKM_BRANCH} ${REDPILL_LKM_SRC} && \ 34 | git clone ${REDPILL_LOAD_REPO} -b ${REDPILL_LOAD_BRANCH} ${REDPILL_LOAD_SRC} 35 | 36 | ARG TARGET_NAME 37 | ARG TARGET_PLATFORM 38 | ARG TARGET_VERSION 39 | ARG DSM_VERSION 40 | ARG COMPILE_WITH 41 | ARG TARGET_REVISION 42 | ARG REDPILL_LKM_MAKE_TARGET 43 | 44 | LABEL redpill-tool-chain=${TARGET_PLATFORM}-${TARGET_VERSION}-${TARGET_REVISION} 45 | 46 | ENV ARCH=x86_64 \ 47 | LINUX_SRC=/opt/${COMPILE_WITH}-${TARGET_PLATFORM}-${TARGET_VERSION}-${TARGET_REVISION} \ 48 | REDPILL_LKM_SRC=${REDPILL_LKM_SRC} \ 49 | REDPILL_LOAD_SRC=${REDPILL_LOAD_SRC} \ 50 | TARGET_NAME=${TARGET_NAME} \ 51 | TARGET_PLATFORM=${TARGET_PLATFORM} \ 52 | TARGET_VERSION=${TARGET_VERSION} \ 53 | TARGET_REVISION=${TARGET_REVISION} \ 54 | REDPILL_LKM_MAKE_TARGET=${REDPILL_LKM_MAKE_TARGET} 55 | 56 | ARG EXTRACTED_KSRC 57 | COPY --from=extract ${EXTRACTED_KSRC} ${LINUX_SRC} 58 | 59 | RUN if [ "apollolake" = "$TARGET_PLATFORM" ] || [ "broadwellnk" = "$TARGET_PLATFORM" ] || [ "geminilake" = "$TARGET_PLATFORM" ] || [ "v1000" = "$TARGET_PLATFORM" ] || [ "denverton" = "$TARGET_PLATFORM" ]; then echo '+' > ${LINUX_SRC}/.scmversion; fi && \ 60 | if [ "$COMPILE_WITH" = "kernel" ]; then \ 61 | cp ${LINUX_SRC}/synoconfigs/${TARGET_PLATFORM} ${LINUX_SRC}/.config && \ 62 | make -C ${LINUX_SRC} oldconfig && \ 63 | make -C ${LINUX_SRC} modules_prepare ;\ 64 | fi 65 | 66 | WORKDIR "/opt" 67 | 68 | COPY Makefile /opt/ 69 | 70 | COPY entrypoint.sh /entrypoint.sh 71 | COPY helper.sh ./ 72 | RUN chmod +x /entrypoint.sh && chmod +x ./helper.sh 73 | 74 | ENTRYPOINT [ "/entrypoint.sh" ] 75 | -------------------------------------------------------------------------------- /docker/Makefile: -------------------------------------------------------------------------------- 1 | AKEFLAGS += --warn-undefined-variables 2 | SHELL := bash 3 | .SHELLFLAGS := -e -o pipefail -c 4 | .DEFAULT_GOAL := all 5 | .DELETE_ON_ERROR: 6 | .SUFFIXES: 7 | 8 | export REDPILL_LKM_SRC := ${REDPILL_LKM_SRC} 9 | export REDPILL_LOAD_SRC := ${REDPILL_LOAD_SRC} 10 | export REDPILL_LKM_MAKE_TARGET := ${REDPILL_LKM_MAKE_TARGET} 11 | export TARGET_PLATFORM := ${TARGET_PLATFORM} 12 | export TARGET_VERSION := ${TARGET_VERSION} 13 | export TARGET_REVISION := ${TARGET_REVISION} 14 | export TARGET_NAME := ${TARGET_NAME} 15 | export LINUX_SRC := ${LINUX_SRC} 16 | 17 | .PHONY: all 18 | all: 19 | @echo "Possible Targets:" 20 | @cat Makefile |grep .PHONY[:] |cut -f2 -d ' ' |xargs -n1 echo " - " |grep -v " - all" 21 | 22 | .PHONY: build_redpill_lkm 23 | build_redpill_lkm: 24 | @$(MAKE) -C $(REDPILL_LKM_SRC) LINUX_SRC=$(LINUX_SRC) $(REDPILL_LKM_MAKE_TARGET) && \ 25 | echo "#############################################" && \ 26 | modinfo $(REDPILL_LKM_SRC)/redpill.ko 27 | 28 | .PHONY: build_redpill_load 29 | build_redpill_load: 30 | @mkdir -p $(REDPILL_LOAD_SRC)/ext/rp-lkm/ 31 | @echo "#############################################" && \ 32 | echo "Using user_config.json:" && cat $(REDPILL_LOAD_SRC)/user_config.json && \ 33 | echo "#############################################" 34 | @read -a KVERS <<< "$$(modinfo --field=vermagic redpill-lkm/redpill.ko)" && \ 35 | cp -f $(REDPILL_LKM_SRC)/redpill.ko $(REDPILL_LOAD_SRC)/ext/rp-lkm/redpill-linux-v$${KVERS[0]}.ko 36 | ./helper.sh 37 | pushd $(REDPILL_LOAD_SRC) && ./build-loader.sh '$(TARGET_NAME)' '$(TARGET_VERSION)-$(TARGET_REVISION)'; 38 | 39 | 40 | .PHONY: build_all 41 | build_all: build_redpill_lkm build_redpill_load 42 | 43 | .PHONY: clean_redpill_lkm 44 | clean_redpill_lkm: 45 | @$(MAKE) -C $(REDPILL_LKM_SRC) clean 46 | -------------------------------------------------------------------------------- /docker/downloads/.gitignore: -------------------------------------------------------------------------------- 1 | *.txz 2 | -------------------------------------------------------------------------------- /docker/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -eu 3 | 4 | BRP_DEBUG=${BRP_DEBUG:-0} 5 | if [ "${BRP_DEBUG}" -eq 1 ]; then 6 | env 7 | fi 8 | 9 | if [ $# -eq 0 ];then 10 | git -C ${REDPILL_LKM_SRC} fetch 11 | git -C ${REDPILL_LOAD_SRC} fetch 12 | 13 | if [ "${LOCAL_RP_LKM_USE}" == "false" ]; then 14 | REDPILL_LKM_BRANCH=$(git -C ${REDPILL_LKM_SRC} name-rev --name-only HEAD) 15 | echo "Checking if redpill-lkm sources require pull." 16 | if [ $(git -C ${REDPILL_LKM_SRC} rev-list HEAD...origin/${REDPILL_LKM_BRANCH} --count ) -eq 0 ];then 17 | echo " Nothing to do." 18 | else 19 | git -C ${REDPILL_LKM_SRC} pull 20 | echo "Pulled latest commits." 21 | fi 22 | else 23 | echo "Redpill-lkm sources are mapped into the build container, skipping pull of latest sources." 24 | fi 25 | 26 | 27 | if [ "${LOCAL_RP_LOAD_USE}" == "false" ]; then 28 | REDPILL_LOAD_BRANCH=$(git -C ${REDPILL_LOAD_SRC} name-rev --name-only HEAD) 29 | echo "Check if redpill-load sources require pull." 30 | if [ $(git -C ${REDPILL_LOAD_SRC} rev-list HEAD...origin/${REDPILL_LOAD_BRANCH} --count ) -eq 0 ];then 31 | echo " Nothing to do." 32 | else 33 | git -C ${REDPILL_LOAD_SRC} pull 34 | echo "Pulled latest commits." 35 | fi 36 | else 37 | echo "Redpill-load sources are mapped into the build container, skipping pull of latest sources." 38 | fi 39 | 40 | echo "Lay back and enjoy the show: Magic is about to happen!" 41 | make build_all 42 | echo "The redpill bootloader is created, the container will be ended now." 43 | exit 0 44 | fi 45 | exec "$@" 46 | 47 | -------------------------------------------------------------------------------- /docker/helper.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -u 4 | 5 | if [ ${TARGET_REVISION} -lt 42661 ];then 6 | exit 0 7 | fi 8 | 9 | cat ./redpill-load/build-loader.sh | head -n `expr -1 + $(sed -n '/Printing config variables/=' ./redpill-load/build-loader.sh)` > ./redpill-load/_helper.sh 10 | . ./redpill-load/_helper.sh "${TARGET_NAME}" "${TARGET_VERSION}-${TARGET_REVISION}" 11 | rm ./_helper.sh 12 | 13 | # Repacks tar-like file 14 | # 15 | # Args: $1 directory to unpack (must exist) | $2 file path | $3 should hard fail on error? [default=1] 16 | brp_repack_tar() 17 | { 18 | pr_process "Repacking %s file form %s" "${2}" "${1}" 19 | 20 | local output; 21 | output=$("${TAR_PATH}" -czf "${2}" -C "${1}" . 2>&1) 22 | if [ $? -ne 0 ]; then 23 | pr_process_err 24 | 25 | if [[ "${3:-1}" -ne 1 ]]; then 26 | pr_err "Failed to unpack tar\n\n%s" "${output}" 27 | return 1 28 | else 29 | pr_crit "Failed to unpack tar\n\n%s" "${output}" 30 | fi 31 | fi 32 | 33 | pr_process_ok 34 | } 35 | 36 | readonly extract_bin='/usr/local/bin/syno_extract_system_patch' 37 | make_extract(){ 38 | archive="$1" 39 | if [ ! -f "${extract_bin}" ]; then 40 | pr_dbg "%s not found - preparing" "${extract_bin}" 41 | if [ ! -f "${EXTRACT_PAT_FILE}" ]; then 42 | rpt_download_remote "${EXTRACT_PAT_URL}" "${EXTRACT_PAT_FILE}" 43 | else 44 | pr_dbg "Found existing PAT at %s - skipping download" "${EXTRACT_PAT_FILE}" 45 | fi 46 | pr_dbg "Found syno_extract_system_patch File not found - preparing" "${extract_bin}" 47 | brp_mkdir /tmp/synoesp && brp_unpack_tar "${EXTRACT_PAT_FILE}" "/tmp/synoesp" 48 | brp_mkdir /tmp/extract && brp_unpack_zrd "/tmp/synoesp/rd.gz" "/tmp/extract" 49 | cp /tmp/extract/usr/lib/{libcurl.so.4,libmbedcrypto.so.5,libmbedtls.so.13,libmbedx509.so.1,libmsgpackc.so.2,libsodium.so,libsynocodesign-ng-virtual-junior-wins.so.7} /usr/local/lib 50 | cp /tmp/extract/usr/syno/bin/scemd ${extract_bin} 51 | rm -rf /tmp/synoesp /tmp/extract 52 | else 53 | pr_dbg "Found syno_extract_system_patch File at %s - skipping nake" "${extract_bin}" 54 | fi 55 | 56 | pr_process "Use syno_extract_system_patch extract PAT" 57 | LD_LIBRARY_PATH=/usr/local/lib ${extract_bin} "${BRP_PAT_FILE}" /tmp/pat && pr_process_ok || pr_process_err 58 | 59 | brp_repack_tar "/tmp/pat/" /tmp/repack.tar.gz 60 | 61 | pr_process "New checksum of PAT %s - Patch the PAT checksum" ${BRP_PAT_FILE} 62 | mv ${BRP_PAT_FILE} ${BRP_PAT_FILE}.org && mv /tmp/repack.tar.gz ${BRP_PAT_FILE} && rm -rf "/tmp/pat" 63 | sum=`sha256sum ${BRP_PAT_FILE} | awk '{print $1}'` 64 | old_sum="$(brp_json_get_field "${BRP_REL_CONFIG_JSON}" "os.sha256")" 65 | sed -i "s/${old_sum}/${sum}/" "${BRP_REL_CONFIG_JSON}" 66 | rm -rf /tmp/pat 67 | pr_process_ok 68 | } 69 | 70 | check_pat() { 71 | archive="$1" 72 | archiveheader="$(od -bc ${archive} | head -1 | awk '{print $3}')" 73 | return_value=0 74 | case ${archiveheader} in 75 | 105) 76 | pr_dbg "${archive}, is a Tar file" 77 | ;; 78 | 255) 79 | pr_info "File ${archive}, Decryption required" 80 | return_value=1 81 | ;; 82 | 213) 83 | pr_dbg "File ${archive}, is a compressed tar" 84 | ;; 85 | *) 86 | pr_process_err 87 | 88 | pr_err "Could not determine if file ${archive} is encrypted or not, maybe corrupted" 89 | ls -ltr ${archive} 90 | pr_crit "${archiveheader}" 91 | return_value=99 92 | ;; 93 | esac 94 | return $return_value 95 | } 96 | 97 | ########################################################## 98 | # fix redo 99 | readonly BRP_PAT_FILE="${BRP_CACHE_DIR}/${BRP_REL_OS_ID}.pat" 100 | readonly EXTRACT_PAT_FILE="${BRP_CACHE_DIR}/extract.tar.gz" 101 | readonly EXTRACT_PAT_URL='https://global.download.synology.com/download/DSM/release/7.0.1/42218/DSM_DS3615xs_42218.pat' 102 | 103 | if [ -f "${BRP_PAT_FILE}.org" ] && [ -f "${BRP_PAT_FILE}" ]; then 104 | pr_info "Found patched PAT file - Patch the PAT checksum" 105 | file_sum="$(brp_json_get_field "${BRP_REL_CONFIG_JSON}" "os.sha256")" 106 | new_sum=`sha256sum "${BRP_PAT_FILE}" | awk '{print $1}'` 107 | org_sum=`sha256sum "${BRP_PAT_FILE}.org" | awk '{print $1}'` 108 | if [ "$new_sum" != "$file_sum" ] && [ "$org_sum" == "$file_sum" ]; then 109 | sed -i "s/${org_sum}/${new_sum}/" "${BRP_REL_CONFIG_JSON}" 110 | fi 111 | fi 112 | 113 | 114 | if [ ! -d "${BRP_UPAT_DIR}" ]; then 115 | pr_dbg "Unpacked PAT %s not found - preparing" "${BRP_UPAT_DIR}" 116 | 117 | brp_mkdir "${BRP_UPAT_DIR}" 118 | 119 | if [ ! -f "${BRP_PAT_FILE}" ]; then 120 | rpt_download_remote "$(brp_json_get_field "${BRP_REL_CONFIG_JSON}" "os.pat_url")" "${BRP_PAT_FILE}" 121 | else 122 | pr_dbg "Found existing PAT at %s - skipping download" "${BRP_PAT_FILE}" 123 | fi 124 | 125 | brp_verify_file_sha256 "${BRP_PAT_FILE}" "$(brp_json_get_field "${BRP_REL_CONFIG_JSON}" "os.sha256")" 126 | 127 | check_pat "${BRP_PAT_FILE}" 128 | exec_status=$? 129 | pr_info "Test encryption pat results %s" "${exec_status}" 130 | if [ "$exec_status" -eq 1 ]; then 131 | pr_empty_nl 132 | make_extract "${BRP_PAT_FILE}" 133 | fi 134 | else 135 | pr_info "Found unpacked PAT at \"%s\" - skipping unpacking" "${BRP_UPAT_DIR}" 136 | fi 137 | 138 | -------------------------------------------------------------------------------- /extensions/pocopico-r8125.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "pocopico.r8125", 3 | "url": "https://github.com/tossp/redpill-tool-chain/raw/master/extensions/pocopico-r8125.json", 4 | "info": { 5 | "name": "r8125", 6 | "description": "Adds Realtek RTL8125 2.5Gigabit Ethernet driver Support", 7 | "author_url": "https://github.com/pocopico", 8 | "packer_url": "https://github.com/pocopico/rp-ext/tree/main/r8125", 9 | "help_url": "" 10 | }, 11 | "releases": { 12 | "ds3615xs_25556": "https://github.com/pocopico/rp-ext/raw/main/r8125/releases/ds3615xs_25556.json", 13 | "ds3615xs_41222": "https://github.com/pocopico/rp-ext/raw/main/r8125/releases/ds3615xs_41222.json", 14 | "ds3615xs_42218": "https://github.com/pocopico/rp-ext/raw/main/r8125/releases/ds3615xs_42218.json", 15 | "ds3615xs_42621": "https://github.com/pocopico/rp-ext/raw/main/r8125/releases/ds3615xs_42218.json", 16 | "ds3615xs_42661": "https://github.com/pocopico/rp-ext/raw/main/r8125/releases/ds3615xs_42218.json", 17 | "ds3617xs_42218": "https://github.com/pocopico/rp-ext/raw/main/r8125/releases/ds3617xs_42218.json", 18 | "ds3617xs_42621": "https://github.com/pocopico/rp-ext/raw/main/r8125/releases/ds3617xs_42218.json", 19 | "ds3617xs_42661": "https://github.com/pocopico/rp-ext/raw/main/r8125/releases/ds3617xs_42218.json", 20 | "ds3622xsp_42218": "https://github.com/pocopico/rp-ext/raw/main/r8125/releases/ds3622xsp_42218.json", 21 | "ds3622xsp_42621": "https://github.com/pocopico/rp-ext/raw/main/r8125/releases/ds3622xsp_42218.json", 22 | "ds3622xsp_42661": "https://github.com/pocopico/rp-ext/raw/main/r8125/releases/ds3622xsp_42218.json", 23 | "ds1621p_42218": "https://github.com/pocopico/rp-ext/raw/main/r8125/releases/ds1621p_42218.json", 24 | "ds1621p_42621": "https://github.com/pocopico/rp-ext/raw/main/r8125/releases/ds1621p_42218.json", 25 | "ds1621p_42661": "https://github.com/pocopico/rp-ext/raw/main/r8125/releases/ds1621p_42218.json", 26 | "dva3221_42218": "https://github.com/pocopico/rp-ext/raw/main/r8125/releases/dva3221_42218.json", 27 | "dva3221_42621": "https://github.com/pocopico/rp-ext/raw/main/r8125/releases/dva3221_42218.json", 28 | "dva3221_42661": "https://github.com/pocopico/rp-ext/raw/main/r8125/releases/dva3221_42218.json", 29 | "ds918p_25556": "https://github.com/pocopico/rp-ext/raw/main/r8125/releases/ds918p_25556.json", 30 | "ds918p_41890": "https://github.com/pocopico/rp-ext/raw/main/r8125/releases/ds918p_41890.json", 31 | "ds918p_42218": "https://github.com/pocopico/rp-ext/raw/main/r8125/releases/ds918p_42218.json", 32 | "ds918p_42621": "https://github.com/pocopico/rp-ext/raw/main/r8125/releases/ds918p_42218.json", 33 | "ds918p_42661": "https://github.com/pocopico/rp-ext/raw/main/r8125/releases/ds918p_42218.json", 34 | "ds920p_42621": "https://github.com/pocopico/rp-ext/raw/main/r8125/releases/ds920p_42218.json", 35 | "ds920p_42218": "https://github.com/pocopico/rp-ext/raw/main/r8125/releases/ds920p_42218.json", 36 | "ds920p_42661": "https://github.com/pocopico/rp-ext/raw/main/r8125/releases/ds920p_42218.json" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /extensions/redpill-acpid.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "jumkey.acpid2", 3 | "url": "https://github.com/tossp/redpill-tool-chain/raw/master/extensions/redpill-acpid.json", 4 | "info": { 5 | "name": "ACPI Daemon v2", 6 | "description": "ACPI Daemon v2 that handles power button events", 7 | "author_url": "https://sourceforge.net/projects/acpid2/", 8 | "packer_url": "https://github.com/jumkey/redpill-load/raw/develop/redpill-acpid", 9 | "help_url": "https://github.com/jumkey/redpill-load/raw/develop/redpill-acpid" 10 | }, 11 | "releases": { 12 | "ds3615xs_25556": "https://github.com/jumkey/redpill-load/raw/develop/redpill-acpid/recipes/universal_v6.json", 13 | "ds3615xs_41222": "https://github.com/jumkey/redpill-load/raw/develop/redpill-acpid/recipes/universal.json", 14 | "ds3615xs_42218": "https://github.com/jumkey/redpill-load/raw/develop/redpill-acpid/recipes/universal.json", 15 | "ds3615xs_42621": "https://github.com/jumkey/redpill-load/raw/develop/redpill-acpid/recipes/universal.json", 16 | "ds3615xs_42661": "https://github.com/jumkey/redpill-load/raw/develop/redpill-acpid/recipes/universal.json", 17 | "ds3617xs_42218": "https://github.com/jumkey/redpill-load/raw/develop/redpill-acpid/recipes/universal.json", 18 | "ds3617xs_42621": "https://github.com/jumkey/redpill-load/raw/develop/redpill-acpid/recipes/universal.json", 19 | "ds3617xs_42661": "https://github.com/jumkey/redpill-load/raw/develop/redpill-acpid/recipes/universal.json", 20 | "ds918p_25556": "https://github.com/jumkey/redpill-load/raw/develop/redpill-acpid/recipes/universal_v6.json", 21 | "ds918p_41890": "https://github.com/jumkey/redpill-load/raw/develop/redpill-acpid/recipes/universal.json", 22 | "ds918p_42218": "https://github.com/jumkey/redpill-load/raw/develop/redpill-acpid/recipes/universal.json", 23 | "ds918p_42621": "https://github.com/jumkey/redpill-load/raw/develop/redpill-acpid/recipes/universal.json", 24 | "ds918p_42661": "https://github.com/jumkey/redpill-load/raw/develop/redpill-acpid/recipes/universal.json", 25 | "ds920p_42218": "https://github.com/jumkey/redpill-load/raw/develop/redpill-acpid/recipes/universal.json", 26 | "ds920p_42550": "https://github.com/jumkey/redpill-load/raw/develop/redpill-acpid/recipes/universal.json", 27 | "ds920p_42621": "https://github.com/jumkey/redpill-load/raw/develop/redpill-acpid/recipes/universal.json", 28 | "ds920p_42661": "https://github.com/jumkey/redpill-load/raw/develop/redpill-acpid/recipes/universal.json", 29 | "ds1621p_42218": "https://github.com/jumkey/redpill-load/raw/develop/redpill-acpid/recipes/universal.json", 30 | "ds1621p_42621": "https://github.com/jumkey/redpill-load/raw/develop/redpill-acpid/recipes/universal.json", 31 | "ds1621p_42661": "https://github.com/jumkey/redpill-load/raw/develop/redpill-acpid/recipes/universal.json", 32 | "ds2422p_42218": "https://github.com/jumkey/redpill-load/raw/develop/redpill-acpid/recipes/universal.json", 33 | "ds2422p_42621": "https://github.com/jumkey/redpill-load/raw/develop/redpill-acpid/recipes/universal.json", 34 | "ds2422p_42661": "https://github.com/jumkey/redpill-load/raw/develop/redpill-acpid/recipes/universal.json", 35 | "ds3622xsp_42218": "https://github.com/jumkey/redpill-load/raw/develop/redpill-acpid/recipes/universal.json", 36 | "ds3622xsp_42621": "https://github.com/jumkey/redpill-load/raw/develop/redpill-acpid/recipes/universal.json", 37 | "ds3622xsp_42661": "https://github.com/jumkey/redpill-load/raw/develop/redpill-acpid/recipes/universal.json" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /extensions/redpill-boot-wait.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "thethorgroup.boot-wait", 3 | "url": "https://github.com/tossp/redpill-tool-chain/raw/master/extensions/redpill-boot-wait.json", 4 | "info": { 5 | "name": "RedPill Bootwait", 6 | "description": "Simple extension which stops the execution early waiting for the boot device to appear", 7 | "packer_url": "https://github.com/RedPill-TTG/redpill-boot-wait", 8 | "help_url": "https://github.com/RedPill-TTG/redpill-boot-wait" 9 | }, 10 | "releases": { 11 | "ds920p_42218": "https://github.com/RedPill-TTG/redpill-boot-wait/raw/master/recipes/universal.json", 12 | "ds920p_42550": "https://github.com/RedPill-TTG/redpill-boot-wait/raw/master/recipes/universal.json", 13 | "ds920p_42621": "https://github.com/RedPill-TTG/redpill-boot-wait/raw/master/recipes/universal.json", 14 | "ds920p_42661": "https://github.com/RedPill-TTG/redpill-boot-wait/raw/master/recipes/universal.json", 15 | "ds1621p_42218": "https://github.com/RedPill-TTG/redpill-boot-wait/raw/master/recipes/universal.json", 16 | "ds1621p_42621": "https://github.com/RedPill-TTG/redpill-boot-wait/raw/master/recipes/universal.json", 17 | "ds1621p_42661": "https://github.com/RedPill-TTG/redpill-boot-wait/raw/master/recipes/universal.json", 18 | "ds2422p_42218": "https://github.com/RedPill-TTG/redpill-boot-wait/raw/master/recipes/universal.json", 19 | "ds2422p_42621": "https://github.com/RedPill-TTG/redpill-boot-wait/raw/master/recipes/universal.json", 20 | "ds2422p_42661": "https://github.com/RedPill-TTG/redpill-boot-wait/raw/master/recipes/universal.json", 21 | "ds3622xsp_42218": "https://github.com/RedPill-TTG/redpill-boot-wait/raw/master/recipes/universal.json", 22 | "ds3622xsp_42621": "https://github.com/RedPill-TTG/redpill-boot-wait/raw/master/recipes/universal.json", 23 | "ds3622xsp_42661": "https://github.com/RedPill-TTG/redpill-boot-wait/raw/master/recipes/universal.json", 24 | "ds3615xs_25556": "https://github.com/RedPill-TTG/redpill-boot-wait/raw/master/recipes/universal.json", 25 | "ds3615xs_41222": "https://github.com/RedPill-TTG/redpill-boot-wait/raw/master/recipes/universal.json", 26 | "ds3615xs_42218": "https://github.com/RedPill-TTG/redpill-boot-wait/raw/master/recipes/universal.json", 27 | "ds3615xs_42621": "https://github.com/RedPill-TTG/redpill-boot-wait/raw/master/recipes/universal.json", 28 | "ds3615xs_42661": "https://github.com/RedPill-TTG/redpill-boot-wait/raw/master/recipes/universal.json", 29 | "ds3617xs_42218": "https://github.com/RedPill-TTG/redpill-boot-wait/raw/master/recipes/universal.json", 30 | "ds3617xs_42621": "https://github.com/RedPill-TTG/redpill-boot-wait/raw/master/recipes/universal.json", 31 | "ds3617xs_42661": "https://github.com/RedPill-TTG/redpill-boot-wait/raw/master/recipes/universal.json", 32 | "dva3221_42218": "https://github.com/RedPill-TTG/redpill-boot-wait/raw/master/recipes/universal.json", 33 | "dva3221_42621": "https://github.com/RedPill-TTG/redpill-boot-wait/raw/master/recipes/universal.json", 34 | "dva3221_42661": "https://github.com/RedPill-TTG/redpill-boot-wait/raw/master/recipes/universal.json", 35 | "ds918p_25556": "https://github.com/RedPill-TTG/redpill-boot-wait/raw/master/recipes/universal.json", 36 | "ds918p_41890": "https://github.com/RedPill-TTG/redpill-boot-wait/raw/master/recipes/universal.json", 37 | "ds918p_42218": "https://github.com/RedPill-TTG/redpill-boot-wait/raw/master/recipes/universal.json", 38 | "ds918p_42621": "https://github.com/RedPill-TTG/redpill-boot-wait/raw/master/recipes/universal.json", 39 | "ds918p_42661": "https://github.com/RedPill-TTG/redpill-boot-wait/raw/master/recipes/universal.json" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /extensions/redpill-dtb.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "redpill-dtb", 3 | "url": "https://github.com/tossp/redpill-tool-chain/raw/master/extensions/redpill-dtb.json", 4 | "info": { 5 | "name": "Device tree binary", 6 | "description": "Create your own device tree binary", 7 | "author_url": "https://github.com/jumkey/redpill-load/raw/develop/redpill-dtb", 8 | "packer_url": "https://github.com/jumkey/redpill-load/raw/develop/redpill-dtb", 9 | "help_url": "https://github.com/jumkey/redpill-load/raw/develop/redpill-dtb" 10 | }, 11 | "releases": { 12 | "ds920p_42218": "https://github.com/pocopico/redpill-load/raw/develop/redpill-dtb/recipes/universal.json", 13 | "ds920p_42550": "https://github.com/pocopico/redpill-load/raw/develop/redpill-dtb/recipes/universal.json", 14 | "ds920p_42621": "https://github.com/pocopico/redpill-load/raw/develop/redpill-dtb/recipes/universal.json", 15 | "ds920p_42661": "https://github.com/pocopico/redpill-load/raw/develop/redpill-dtb/recipes/universal.json", 16 | "ds1621p_42218": "https://github.com/pocopico/redpill-load/raw/develop/redpill-dtb/recipes/universal.json", 17 | "ds1621p_42621": "https://github.com/pocopico/redpill-load/raw/develop/redpill-dtb/recipes/universal.json", 18 | "ds1621p_42661": "https://github.com/pocopico/redpill-load/raw/develop/redpill-dtb/recipes/universal.json", 19 | "ds2422p_42218": "https://github.com/pocopico/redpill-load/raw/develop/redpill-dtb/recipes/universal.json", 20 | "ds2422p_42621": "https://github.com/pocopico/redpill-load/raw/develop/redpill-dtb/recipes/universal.json", 21 | "ds2422p_42661": "https://github.com/pocopico/redpill-load/raw/develop/redpill-dtb/recipes/universal.json" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /extensions/redpill-misc.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "redpill-misc", 3 | "url": "https://github.com/tossp/redpill-tool-chain/raw/master/extensions/redpill-misc.json", 4 | "info": { 5 | "name": "Misc shell", 6 | "description": "Misc shell", 7 | "author_url": "https://github.com/pocopico/redpill-load/raw/develop/redpill-misc", 8 | "packer_url": "https://github.com/pocopico/redpill-load/raw/develop/redpill-misc", 9 | "help_url": "https://github.com/pocopico/redpill-load/raw/develop/redpill-misc" 10 | }, 11 | "releases": { 12 | "ds1621p_42218": "https://github.com/jumkey/redpill-load/raw/develop/redpill-misc/recipes/universal.json", 13 | "ds1621p_42621": "https://github.com/jumkey/redpill-load/raw/develop/redpill-misc/recipes/universal.json", 14 | "ds1621p_42661": "https://github.com/jumkey/redpill-load/raw/develop/redpill-misc/recipes/universal.json", 15 | "ds2422p_42218": "https://github.com/jumkey/redpill-load/raw/develop/redpill-misc/recipes/universal.json", 16 | "ds3615xs_25556": "https://github.com/jumkey/redpill-load/raw/develop/redpill-misc/recipes/universal.json", 17 | "ds3615xs_41222": "https://github.com/jumkey/redpill-load/raw/develop/redpill-misc/recipes/universal.json", 18 | "ds3615xs_42218": "https://github.com/jumkey/redpill-load/raw/develop/redpill-misc/recipes/universal.json", 19 | "ds3615xs_42550": "https://github.com/jumkey/redpill-load/raw/develop/redpill-misc/recipes/universal.json", 20 | "ds3615xs_42621": "https://github.com/jumkey/redpill-load/raw/develop/redpill-misc/recipes/universal.json", 21 | "ds3615xs_42661": "https://github.com/jumkey/redpill-load/raw/develop/redpill-misc/recipes/universal.json", 22 | "ds3617xs_42218": "https://github.com/jumkey/redpill-load/raw/develop/redpill-misc/recipes/universal.json", 23 | "ds3617xs_42550": "https://github.com/jumkey/redpill-load/raw/develop/redpill-misc/recipes/universal.json", 24 | "ds3617xs_42621": "https://github.com/jumkey/redpill-load/raw/develop/redpill-misc/recipes/universal.json", 25 | "ds3617xs_42661": "https://github.com/jumkey/redpill-load/raw/develop/redpill-misc/recipes/universal.json", 26 | "ds3622xsp_42218": "https://github.com/jumkey/redpill-load/raw/develop/redpill-misc/recipes/universal.json", 27 | "ds3622xsp_42621": "https://github.com/jumkey/redpill-load/raw/develop/redpill-misc/recipes/universal.json", 28 | "ds3622xsp_42661": "https://github.com/jumkey/redpill-load/raw/develop/redpill-misc/recipes/universal.json", 29 | "ds918p_25556": "https://github.com/jumkey/redpill-load/raw/develop/redpill-misc/recipes/universal.json", 30 | "ds918p_41890": "https://github.com/jumkey/redpill-load/raw/develop/redpill-misc/recipes/universal.json", 31 | "ds918p_42218": "https://github.com/jumkey/redpill-load/raw/develop/redpill-misc/recipes/universal.json", 32 | "ds918p_42550": "https://github.com/jumkey/redpill-load/raw/develop/redpill-misc/recipes/universal.json", 33 | "ds918p_42621": "https://github.com/jumkey/redpill-load/raw/develop/redpill-misc/recipes/universal.json", 34 | "ds918p_42661": "https://github.com/jumkey/redpill-load/raw/develop/redpill-misc/recipes/universal.json", 35 | "ds920p_42621": "https://github.com/jumkey/redpill-load/raw/develop/redpill-misc/recipes/universal.json", 36 | "ds920p_42550": "https://github.com/jumkey/redpill-load/raw/develop/redpill-misc/recipes/universal.json", 37 | "ds920p_42661": "https://github.com/jumkey/redpill-load/raw/develop/redpill-misc/recipes/universal.json", 38 | "ds920p_42218": "https://github.com/jumkey/redpill-load/raw/develop/redpill-misc/recipes/universal.json", 39 | "dva3221_42218": "https://github.com/jumkey/redpill-load/raw/develop/redpill-misc/recipes/universal.json", 40 | "dva3221_42621": "https://github.com/jumkey/redpill-load/raw/develop/redpill-misc/recipes/universal.json", 41 | "dva3221_42661": "https://github.com/jumkey/redpill-load/raw/develop/redpill-misc/recipes/universal.json" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /extensions/redpill-virtio.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "thethorgroup.virtio", 3 | "url": "https://github.com/tossp/redpill-tool-chain/raw/master/extensions/redpill-virtio.json", 4 | "info": { 5 | "name": "VirtIO", 6 | "description": "Adds VirtIO support for fast network/PCI/SCSI/network/console paravirtualization under QEmu (Proxmox, VirtualBox, virsh, and similar)", 7 | "author_url": "https://www.linux-kvm.org/page/Virtio", 8 | "packer_url": "https://github.com/RedPill-TTG/redpill-virtio", 9 | "help_url": "" 10 | }, 11 | "releases": { 12 | "ds3615xs_25556": "https://github.com/RedPill-TTG/redpill-virtio/raw/master/recipes/ds3615xs_25556.json", 13 | "ds3615xs_41222": "https://github.com/RedPill-TTG/redpill-virtio/raw/master/recipes/ds3615xs_41222.json", 14 | "ds3615xs_42218": "https://github.com/RedPill-TTG/redpill-virtio/raw/master/recipes/ds3615xs_41222.json", 15 | "ds3615xs_42621": "https://github.com/RedPill-TTG/redpill-virtio/raw/master/recipes/ds3615xs_41222.json", 16 | "ds3615xs_42661": "https://github.com/RedPill-TTG/redpill-virtio/raw/master/recipes/ds3615xs_41222.json", 17 | "ds918p_25556": "https://github.com/RedPill-TTG/redpill-virtio/raw/master/recipes/ds918p_25556.json", 18 | "ds918p_41890": "https://github.com/RedPill-TTG/redpill-virtio/raw/master/recipes/ds918p_41890.json", 19 | "ds918p_42218": "https://github.com/RedPill-TTG/redpill-virtio/raw/master/recipes/ds918p_41890.json", 20 | "ds918p_42621": "https://github.com/RedPill-TTG/redpill-virtio/raw/master/recipes/ds918p_41890.json", 21 | "ds918p_42661": "https://github.com/RedPill-TTG/redpill-virtio/raw/master/recipes/ds918p_41890.json", 22 | "ds920p_42550": "https://github.com/jumkey/redpill-load/raw/develop/redpill-virtio/recipes/ds920p_41890.json", 23 | "ds920p_42218": "https://github.com/jumkey/redpill-load/raw/develop/redpill-virtio/recipes/ds920p_41890.json", 24 | "ds920p_42621": "https://github.com/jumkey/redpill-load/raw/develop/redpill-virtio/recipes/ds920p_41890.json", 25 | "ds920p_42661": "https://github.com/jumkey/redpill-load/raw/develop/redpill-virtio/recipes/ds920p_41890.json", 26 | "ds1621p_42218": "https://github.com/jumkey/redpill-load/raw/develop/redpill-virtio/recipes/ds1621p_41890.json", 27 | "ds1621p_42621": "https://github.com/jumkey/redpill-load/raw/develop/redpill-virtio/recipes/ds1621p_41890.json", 28 | "ds1621p_42661": "https://github.com/jumkey/redpill-load/raw/develop/redpill-virtio/recipes/ds1621p_41890.json", 29 | "ds2422p_42218": "https://github.com/jumkey/redpill-load/raw/develop/redpill-virtio/recipes/ds1621p_41890.json", 30 | "ds2422p_42621": "https://github.com/jumkey/redpill-load/raw/develop/redpill-virtio/recipes/ds1621p_41890.json", 31 | "ds2422p_42661": "https://github.com/jumkey/redpill-load/raw/develop/redpill-virtio/recipes/ds1621p_41890.json", 32 | "ds3617xs_42218": "https://github.com/jumkey/redpill-load/raw/develop/redpill-virtio/recipes/ds3617xs_41890.json", 33 | "ds3617xs_42621": "https://github.com/jumkey/redpill-load/raw/develop/redpill-virtio/recipes/ds3617xs_41890.json", 34 | "ds3617xs_42661": "https://github.com/jumkey/redpill-load/raw/develop/redpill-virtio/recipes/ds3617xs_41890.json", 35 | "ds3622xsp_42218": "https://github.com/jumkey/redpill-load/raw/develop/redpill-virtio/recipes/ds3622xsp_41890.json", 36 | "ds3622xsp_42550": "https://github.com/jumkey/redpill-load/raw/develop/redpill-virtio/recipes/ds3622xsp_41890.json", 37 | "ds3622xsp_42621": "https://github.com/jumkey/redpill-load/raw/develop/redpill-virtio/recipes/ds3622xsp_41890.json", 38 | "ds3622xsp_42661": "https://github.com/jumkey/redpill-load/raw/develop/redpill-virtio/recipes/ds3622xsp_41890.json" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /global_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "docker": { 3 | "use_buildkit": "true", 4 | "image_name": "redpill-tool-chain", 5 | "download_folder": "docker/downloads", 6 | "local_rp_lkm_use": "false", 7 | "local_rp_lkm_path": "./redpill-lkm", 8 | "local_rp_load_use": "false", 9 | "local_rp_load_path": "./redpill-load", 10 | "auto_clean": "false", 11 | "use_build_cache": "true", 12 | "clean_images": "all", 13 | "use_custom_bind_mounts": "true", 14 | "custom_bind_mounts": [ 15 | { 16 | "host_path": "./custom", 17 | "container_path": "/opt/redpill-load/custom" 18 | } 19 | ] 20 | }, 21 | "build_configs": [ 22 | { 23 | "id": "ds1621p-7.0.1-42218", 24 | "platform_name": "DS1621+", 25 | "platform_version": "v1000-7.0.1-42218", 26 | "user_config_json": "ds1621p_user_config.json", 27 | "docker_base_image": "debian:10-slim", 28 | "compile_with": "toolkit_dev", 29 | "redpill_lkm_make_target": "dev-v7", 30 | "downloads": { 31 | "kernel": { 32 | "url": "https://sourceforge.net/projects/dsgpl/files/Synology%20NAS%20GPL%20Source/25426branch/v1000-source/linux-4.4.x.txz/download", 33 | "sha256": "ac532ebb221d9c55f78236d57288ac31d410dde01f1453f60b0c502333fdf107" 34 | }, 35 | "toolkit_dev": { 36 | "url": "https://sourceforge.net/projects/dsgpl/files/toolkit/DSM7.0/ds.v1000-7.0.dev.txz/download", 37 | "sha256": "6108f9f7b7f0a13ee985314aef9419303375ab7ded4112be991590339b66ecd1" 38 | } 39 | }, 40 | "redpill_lkm": { 41 | "source_url": "https://github.com/jumkey/redpill-lkm.git", 42 | "branch": "develop" 43 | }, 44 | "redpill_load": { 45 | "source_url": "https://github.com/jumkey/redpill-load.git", 46 | "branch": "develop" 47 | }, 48 | "build_env": { 49 | "jun_mod": 1, 50 | "debug": 0 51 | } 52 | }, 53 | { 54 | "id": "ds1621p-7.1.0-42661", 55 | "platform_name": "DS1621+", 56 | "platform_version": "v1000-7.1.0-42661", 57 | "user_config_json": "ds1621p_user_config.json", 58 | "docker_base_image": "debian:10-slim", 59 | "compile_with": "toolkit_dev", 60 | "redpill_lkm_make_target": "dev-v7", 61 | "downloads": { 62 | "kernel": { 63 | "url": "https://sourceforge.net/projects/dsgpl/files/Synology%20NAS%20GPL%20Source/25426branch/v1000-source/linux-4.4.x.txz/download", 64 | "sha256": "d3e85eb80f16a83244fcae6016ab6783cd8ac55e3af2b4240455261396e1e1be" 65 | }, 66 | "toolkit_dev": { 67 | "url": "https://sourceforge.net/projects/dsgpl/files/toolkit/DSM7.0/ds.v1000-7.0.dev.txz/download", 68 | "sha256": "6108f9f7b7f0a13ee985314aef9419303375ab7ded4112be991590339b66ecd1" 69 | } 70 | }, 71 | "redpill_lkm": { 72 | "source_url": "https://github.com/jumkey/redpill-lkm.git", 73 | "branch": "develop" 74 | }, 75 | "redpill_load": { 76 | "source_url": "https://github.com/pocopico/redpill-load.git", 77 | "branch": "develop" 78 | } 79 | }, 80 | { 81 | "id": "ds2422p-7.0.1-42218", 82 | "platform_name": "DS2422+", 83 | "platform_version": "v1000-7.0.1-42218", 84 | "user_config_json": "ds2422p_user_config.json", 85 | "docker_base_image": "debian:10-slim", 86 | "compile_with": "toolkit_dev", 87 | "redpill_lkm_make_target": "dev-v7", 88 | "downloads": { 89 | "kernel": { 90 | "url": "https://sourceforge.net/projects/dsgpl/files/Synology%20NAS%20GPL%20Source/25426branch/v1000-source/linux-4.4.x.txz/download", 91 | "sha256": "ac532ebb221d9c55f78236d57288ac31d410dde01f1453f60b0c502333fdf107" 92 | }, 93 | "toolkit_dev": { 94 | "url": "https://sourceforge.net/projects/dsgpl/files/toolkit/DSM7.0/ds.v1000-7.0.dev.txz/download", 95 | "sha256": "6108f9f7b7f0a13ee985314aef9419303375ab7ded4112be991590339b66ecd1" 96 | } 97 | }, 98 | "redpill_lkm": { 99 | "source_url": "https://github.com/jumkey/redpill-lkm.git", 100 | "branch": "develop" 101 | }, 102 | "redpill_load": { 103 | "source_url": "https://github.com/jumkey/redpill-load.git", 104 | "branch": "develop" 105 | }, 106 | "build_env": { 107 | "jun_mod": 1, 108 | "debug": 0 109 | } 110 | }, 111 | { 112 | "id": "ds3615xs-6.2.4-25556", 113 | "platform_name": "DS3615xs", 114 | "platform_version": "bromolow-6.2.4-25556", 115 | "user_config_json": "ds3615xs_user_config.json", 116 | "docker_base_image": "debian:8-slim", 117 | "compile_with": "kernel", 118 | "redpill_lkm_make_target": "dev-v6", 119 | "downloads": { 120 | "kernel": { 121 | "url": "https://sourceforge.net/projects/dsgpl/files/Synology%20NAS%20GPL%20Source/25426branch/bromolow-source/linux-3.10.x.txz/download", 122 | "sha256": "18aecead760526d652a731121d5b8eae5d6e45087efede0da057413af0b489ed" 123 | }, 124 | "toolkit_dev": { 125 | "url": "https://sourceforge.net/projects/dsgpl/files/toolkit/DSM6.2/ds.bromolow-6.2.dev.txz/download", 126 | "sha256": "7a0f0ec5919cd67b9972a21f234603c0e608d647baff067029bd46d8a5d660de" 127 | } 128 | }, 129 | "redpill_lkm": { 130 | "source_url": "https://github.com/RedPill-TTG/redpill-lkm.git", 131 | "branch": "master" 132 | }, 133 | "redpill_load": { 134 | "source_url": "https://github.com/RedPill-TTG/redpill-load.git", 135 | "branch": "master" 136 | } 137 | }, 138 | { 139 | "id": "ds3615xs-7.0.1-42218", 140 | "platform_name": "DS3615xs", 141 | "platform_version": "bromolow-7.0.1-42218", 142 | "user_config_json": "ds3615xs_user_config.json", 143 | "docker_base_image": "debian:8-slim", 144 | "compile_with": "toolkit_dev", 145 | "redpill_lkm_make_target": "dev-v7", 146 | "downloads": { 147 | "kernel": { 148 | "url": "https://sourceforge.net/projects/dsgpl/files/Synology%20NAS%20GPL%20Source/25426branch/bromolow-source/linux-3.10.x.txz/download", 149 | "sha256": "18aecead760526d652a731121d5b8eae5d6e45087efede0da057413af0b489ed" 150 | }, 151 | "toolkit_dev": { 152 | "url": "https://sourceforge.net/projects/dsgpl/files/toolkit/DSM7.0/ds.bromolow-7.0.dev.txz/download", 153 | "sha256": "a5fbc3019ae8787988c2e64191549bfc665a5a9a4cdddb5ee44c10a48ff96cdd" 154 | } 155 | }, 156 | "redpill_lkm": { 157 | "source_url": "https://github.com/RedPill-TTG/redpill-lkm.git", 158 | "branch": "master" 159 | }, 160 | "redpill_load": { 161 | "source_url": "https://github.com/tossp/redpill-load.git", 162 | "branch": "42218-20211021" 163 | } 164 | }, 165 | { 166 | "id": "ds3615xs-7.1.0-42661", 167 | "platform_name": "DS3615xs", 168 | "platform_version": "bromolow-7.1.0-42661", 169 | "user_config_json": "ds3615xs_user_config.json", 170 | "docker_base_image": "debian:8-slim", 171 | "compile_with": "toolkit_dev", 172 | "redpill_lkm_make_target": "dev-v7", 173 | "downloads": { 174 | "kernel": { 175 | "url": "https://sourceforge.net/projects/dsgpl/files/Synology%20NAS%20GPL%20Source/25426branch/bromolow-source/linux-3.10.x.txz/download", 176 | "sha256": "18aecead760526d652a731121d5b8eae5d6e45087efede0da057413af0b489ed" 177 | }, 178 | "toolkit_dev": { 179 | "url": "https://sourceforge.net/projects/dsgpl/files/toolkit/DSM7.0/ds.bromolow-7.0.dev.txz/download", 180 | "sha256": "a5fbc3019ae8787988c2e64191549bfc665a5a9a4cdddb5ee44c10a48ff96cdd" 181 | } 182 | }, 183 | "redpill_lkm": { 184 | "source_url": "https://github.com/pocopico/redpill-lkm.git", 185 | "branch": "master" 186 | }, 187 | "redpill_load": { 188 | "source_url": "https://github.com/pocopico/redpill-load.git", 189 | "branch": "develop" 190 | } 191 | }, 192 | { 193 | "id": "ds3617xs-7.0.1-42218", 194 | "platform_name": "DS3617xs", 195 | "platform_version": "broadwell-7.0.1-42218", 196 | "user_config_json": "ds3617xs_user_config.json", 197 | "docker_base_image": "debian:8-slim", 198 | "compile_with": "toolkit_dev", 199 | "redpill_lkm_make_target": "dev-v7", 200 | "downloads": { 201 | "kernel": { 202 | "url": "https://sourceforge.net/projects/dsgpl/files/Synology%20NAS%20GPL%20Source/25426branch/broadwell-source/linux-3.10.x.txz/download", 203 | "sha256": "d3e85eb80f16a83244fcae6016ab6783cd8ac55e3af2b4240455261396e1e1be" 204 | }, 205 | "toolkit_dev": { 206 | "url": "https://sourceforge.net/projects/dsgpl/files/toolkit/DSM7.0/ds.broadwell-7.0.dev.txz/download", 207 | "sha256": "e050987fbbab0c246aff2af935b1d8a4140ce490915aa4c92f3c8d163eea970c" 208 | } 209 | }, 210 | "redpill_lkm": { 211 | "source_url": "https://github.com/jimmyGALLAND/redpill-lkm.git", 212 | "branch": "develop" 213 | }, 214 | "redpill_load": { 215 | "source_url": "https://github.com/jimmyGALLAND/redpill-load.git", 216 | "branch": "develop" 217 | } 218 | }, 219 | { 220 | "id": "ds3617xs-7.1.0-42661", 221 | "platform_name": "DS3617xs", 222 | "platform_version": "broadwell-7.1.0-42661", 223 | "user_config_json": "ds3617xs_user_config.json", 224 | "docker_base_image": "debian:8-slim", 225 | "compile_with": "toolkit_dev", 226 | "redpill_lkm_make_target": "dev-v7", 227 | "downloads": { 228 | "kernel": { 229 | "url": "https://sourceforge.net/projects/dsgpl/files/Synology%20NAS%20GPL%20Source/25426branch/broadwell-source/linux-3.10.x.txz/download", 230 | "sha256": "d3e85eb80f16a83244fcae6016ab6783cd8ac55e3af2b4240455261396e1e1be" 231 | }, 232 | "toolkit_dev": { 233 | "url": "https://sourceforge.net/projects/dsgpl/files/toolkit/DSM7.0/ds.broadwell-7.0.dev.txz/download", 234 | "sha256": "e050987fbbab0c246aff2af935b1d8a4140ce490915aa4c92f3c8d163eea970c" 235 | } 236 | }, 237 | "redpill_lkm": { 238 | "source_url": "https://github.com/jimmyGALLAND/redpill-lkm.git", 239 | "branch": "develop" 240 | }, 241 | "redpill_load": { 242 | "source_url": "https://github.com/pocopico/redpill-load.git", 243 | "branch": "develop" 244 | } 245 | }, 246 | { 247 | "id": "ds3622xsp-7.0.1-42218", 248 | "platform_name": "DS3622xs+", 249 | "platform_version": "broadwellnk-7.0.1-42218", 250 | "user_config_json": "ds3622xsp_user_config.json", 251 | "docker_base_image": "debian:10-slim", 252 | "compile_with": "toolkit_dev", 253 | "redpill_lkm_make_target": "dev-v7", 254 | "downloads": { 255 | "kernel": { 256 | "url": "https://sourceforge.net/projects/dsgpl/files/Synology%20NAS%20GPL%20Source/25426branch/broadwellnk-source/linux-4.4.x.txz/download", 257 | "sha256": "c485cd73aa66f8437f9deafa654be04a726e0a46a7b55a09c4f7cd2418e92cca" 258 | }, 259 | "toolkit_dev": { 260 | "url": "https://sourceforge.net/projects/dsgpl/files/toolkit/DSM7.0/ds.broadwellnk-7.0.dev.txz/download", 261 | "sha256": "0d9edca67d9e7e14c2529bbb58341b623936124d5264f71f1e4acbacf3ea202d" 262 | } 263 | }, 264 | "redpill_lkm": { 265 | "source_url": "https://github.com/jumkey/redpill-lkm.git", 266 | "branch": "develop" 267 | }, 268 | "redpill_load": { 269 | "source_url": "https://github.com/jumkey/redpill-load.git", 270 | "branch": "develop" 271 | }, 272 | "build_env": { 273 | "jun_mod": 1, 274 | "debug": 0 275 | } 276 | }, 277 | { 278 | "id": "ds3622xsp-7.1.0-42661", 279 | "platform_name": "DS3622xs+", 280 | "platform_version": "broadwellnk-7.1.0-42661", 281 | "user_config_json": "ds3622xsp_user_config.json", 282 | "docker_base_image": "debian:10-slim", 283 | "redpill_lkm_make_target": "dev-v7", 284 | "compile_with": "toolkit_dev", 285 | "downloads": { 286 | "kernel": { 287 | "url": "https://sourceforge.net/projects/dsgpl/files/Synology%20NAS%20GPL%20Source/25426branch/broadwellnk-source/linux-4.4.x.txz/download", 288 | "sha256": "d3e85eb80f16a83244fcae6016ab6783cd8ac55e3af2b4240455261396e1e1be" 289 | }, 290 | "toolkit_dev": { 291 | "url": "https://sourceforge.net/projects/dsgpl/files/toolkit/DSM7.0/ds.broadwellnk-7.0.dev.txz/download", 292 | "sha256": "0d9edca67d9e7e14c2529bbb58341b623936124d5264f71f1e4acbacf3ea202d" 293 | } 294 | }, 295 | "redpill_lkm": { 296 | "source_url": "https://github.com/dogodefi/redpill-lkm.git", 297 | "branch": "develop" 298 | }, 299 | "redpill_load": { 300 | "source_url": "https://github.com/pocopico/redpill-load.git", 301 | "branch": "develop" 302 | } 303 | }, 304 | { 305 | "id": "ds918p-6.2.4-25556", 306 | "platform_name": "DS918+", 307 | "platform_version": "apollolake-6.2.4-25556", 308 | "user_config_json": "ds918p_user_config.json", 309 | "docker_base_image": "debian:8-slim", 310 | "compile_with": "kernel", 311 | "redpill_lkm_make_target": "dev-v6", 312 | "downloads": { 313 | "kernel": { 314 | "url": "https://sourceforge.net/projects/dsgpl/files/Synology%20NAS%20GPL%20Source/25426branch/apollolake-source/linux-4.4.x.txz/download", 315 | "sha256": "af815ee065775d2e569fd7176e25c8ba7ee17a03361557975c8e5a4b64230c5b" 316 | }, 317 | "toolkit_dev": { 318 | "url": "https://sourceforge.net/projects/dsgpl/files/toolkit/DSM6.2/ds.apollolake-6.2.dev.txz/download", 319 | "sha256": "4ed228ed21e4190f1ad77a565616409ea1bfb9d271dbf523c636c62c2e8dcf89" 320 | } 321 | }, 322 | "redpill_lkm": { 323 | "source_url": "https://github.com/RedPill-TTG/redpill-lkm.git", 324 | "branch": "master" 325 | }, 326 | "redpill_load": { 327 | "source_url": "https://github.com/RedPill-TTG/redpill-load.git", 328 | "branch": "master" 329 | } 330 | }, 331 | { 332 | "id": "ds918p-7.0.1-42218", 333 | "platform_name": "DS918+", 334 | "platform_version": "apollolake-7.0.1-42218", 335 | "user_config_json": "ds918p_user_config.json", 336 | "docker_base_image": "debian:10-slim", 337 | "compile_with": "toolkit_dev", 338 | "redpill_lkm_make_target": "dev-v7", 339 | "downloads": { 340 | "kernel": { 341 | "url": "https://sourceforge.net/projects/dsgpl/files/Synology%20NAS%20GPL%20Source/25426branch/apollolake-source/linux-4.4.x.txz/download", 342 | "sha256": "af815ee065775d2e569fd7176e25c8ba7ee17a03361557975c8e5a4b64230c5b" 343 | }, 344 | "toolkit_dev": { 345 | "url": "https://sourceforge.net/projects/dsgpl/files/toolkit/DSM7.0/ds.apollolake-7.0.dev.txz/download", 346 | "sha256": "d349fa644392d4cfab8191243ee38aaa32bd517208c144678e0c855cb5a619ea" 347 | } 348 | }, 349 | "redpill_lkm": { 350 | "source_url": "https://github.com/RedPill-TTG/redpill-lkm.git", 351 | "branch": "master" 352 | }, 353 | "redpill_load": { 354 | "source_url": "https://github.com/jumkey/redpill-load.git", 355 | "branch": "develop" 356 | }, 357 | "build_env":{ 358 | "jun_mod": 1, 359 | "debug": 0 360 | } 361 | }, 362 | { 363 | "id": "ds918p-7.1.0-42661", 364 | "platform_name": "DS918+", 365 | "platform_version": "apollolake-7.1.0-42661", 366 | "user_config_json": "ds918p_user_config.json", 367 | "docker_base_image": "debian:10-slim", 368 | "compile_with": "toolkit_dev", 369 | "redpill_lkm_make_target": "test-v7", 370 | "downloads": { 371 | "kernel": { 372 | "url": "https://sourceforge.net/projects/dsgpl/files/Synology%20NAS%20GPL%20Source/25426branch/apollolake-source/linux-4.4.x.txz/download", 373 | "sha256": "af815ee065775d2e569fd7176e25c8ba7ee17a03361557975c8e5a4b64230c5b" 374 | }, 375 | "toolkit_dev": { 376 | "url": "https://sourceforge.net/projects/dsgpl/files/toolkit/DSM7.0/ds.apollolake-7.0.dev.txz/download", 377 | "sha256": "d349fa644392d4cfab8191243ee38aaa32bd517208c144678e0c855cb5a619ea" 378 | } 379 | }, 380 | "redpill_lkm": { 381 | "source_url": "https://github.com/RedPill-TTG/redpill-lkm.git", 382 | "branch": "master" 383 | }, 384 | "redpill_load": { 385 | "source_url": "https://github.com/pocopico/redpill-load.git", 386 | "branch": "develop" 387 | } 388 | }, 389 | { 390 | "id": "ds920p-7.0.1-42218", 391 | "platform_name": "DS920+", 392 | "platform_version": "geminilake-7.0.1-42218", 393 | "user_config_json": "ds920p_user_config.json", 394 | "docker_base_image": "debian:10-slim", 395 | "compile_with": "toolkit_dev", 396 | "redpill_lkm_make_target": "dev-v7", 397 | "downloads": { 398 | "kernel": { 399 | "url": "https://sourceforge.net/projects/dsgpl/files/Synology%20NAS%20GPL%20Source/25426branch/geminilake-source/linux-4.4.x.txz/download", 400 | "sha256": "7a625433187269afa255be0382dad2ff27ff27fe3421e9b92d45a7e75653797a" 401 | }, 402 | "toolkit_dev": { 403 | "url": "https://sourceforge.net/projects/dsgpl/files/toolkit/DSM7.0/ds.geminilake-7.0.dev.txz/download", 404 | "sha256": "544fbe3b8b6390af180163322864acb3f4a60cbb44f73ae1e79131f0693c6754" 405 | } 406 | }, 407 | "redpill_lkm": { 408 | "source_url": "https://github.com/jumkey/redpill-lkm.git", 409 | "branch": "develop" 410 | }, 411 | "redpill_load": { 412 | "source_url": "https://github.com/jumkey/redpill-load.git", 413 | "branch": "develop" 414 | }, 415 | "build_env": { 416 | "jun_mod": 1, 417 | "debug": 0 418 | } 419 | }, 420 | { 421 | "id": "ds920p-7.1.0-42661", 422 | "platform_name": "DS920+", 423 | "platform_version": "geminilake-7.1.0-42661", 424 | "user_config_json": "ds920p_user_config.json", 425 | "docker_base_image": "debian:10-slim", 426 | "compile_with": "toolkit_dev", 427 | "redpill_lkm_make_target": "test-v7", 428 | "downloads": { 429 | "kernel": { 430 | "url": "https://sourceforge.net/projects/dsgpl/files/Synology%20NAS%20GPL%20Source/25426branch/apollolake-source/linux-4.4.x.txz/download", 431 | "sha256": "af815ee065775d2e569fd7176e25c8ba7ee17a03361557975c8e5a4b64230c5b" 432 | }, 433 | "toolkit_dev": { 434 | "url": "https://sourceforge.net/projects/dsgpl/files/toolkit/DSM7.0/ds.apollolake-7.0.dev.txz/download", 435 | "sha256": "d349fa644392d4cfab8191243ee38aaa32bd517208c144678e0c855cb5a619ea" 436 | } 437 | }, 438 | "redpill_lkm": { 439 | "source_url": "https://github.com/pocopico/redpill-lkm.git", 440 | "branch": "master" 441 | }, 442 | "redpill_load": { 443 | "source_url": "https://github.com/pocopico/redpill-load.git", 444 | "branch": "develop" 445 | } 446 | }, 447 | { 448 | "id": "dva3221-7.0.1-42218", 449 | "platform_name": "DVA3221", 450 | "platform_version": "denverton-7.0.1-42218", 451 | "user_config_json": "dva3221_user_config.json", 452 | "docker_base_image": "debian:10-slim", 453 | "compile_with": "toolkit_dev", 454 | "redpill_lkm_make_target": "dev-v7", 455 | "downloads": { 456 | "kernel": { 457 | "url": "https://sourceforge.net/projects/dsgpl/files/Synology%20NAS%20GPL%20Source/25426branch/denverton-source/linux-4.4.x.txz/download", 458 | "sha256": "05d41c2d29ef0c41acb316b4aae1bdec85457f53de50d64956fbf66a3c4abeff" 459 | }, 460 | "toolkit_dev": { 461 | "url": "https://sourceforge.net/projects/dsgpl/files/toolkit/DSM7.0/ds.denverton-7.0.dev.txz/download", 462 | "sha256": "6dc6818bad28daff4b3b8d27b5e12d0565b65ee60ac17e55c36d913462079f57" 463 | } 464 | }, 465 | "redpill_lkm": { 466 | "source_url": "https://github.com/dogodefi/redpill-lkm.git", 467 | "branch": "develop" 468 | }, 469 | "redpill_load": { 470 | "source_url": "https://github.com/dogodefi/redpill-load.git", 471 | "branch": "develop" 472 | } 473 | }, 474 | { 475 | "id": "dva3221-7.1.0-42661", 476 | "platform_name": "DVA3221", 477 | "platform_version": "denverton-7.1.0-42661", 478 | "user_config_json": "dva3221_user_config.json", 479 | "docker_base_image": "debian:10-slim", 480 | "compile_with": "toolkit_dev", 481 | "redpill_lkm_make_target": "dev-v7", 482 | "downloads": { 483 | "kernel": { 484 | "url": "https://sourceforge.net/projects/dsgpl/files/Synology%20NAS%20GPL%20Source/25426branch/denverton-source/linux-4.4.x.txz/download", 485 | "sha256": "d3e85eb80f16a83244fcae6016ab6783cd8ac55e3af2b4240455261396e1e1be" 486 | }, 487 | "toolkit_dev": { 488 | "url": "https://sourceforge.net/projects/dsgpl/files/toolkit/DSM7.0/ds.denverton-7.0.dev.txz/download", 489 | "sha256": "6dc6818bad28daff4b3b8d27b5e12d0565b65ee60ac17e55c36d913462079f57" 490 | } 491 | }, 492 | "redpill_lkm": { 493 | "source_url": "https://github.com/dogodefi/redpill-lkm.git", 494 | "branch": "develop" 495 | }, 496 | "redpill_load": { 497 | "source_url": "https://github.com/pocopico/redpill-load.git", 498 | "branch": "develop" 499 | } 500 | } 501 | ] 502 | } 503 | -------------------------------------------------------------------------------- /images/.gitignore: -------------------------------------------------------------------------------- 1 | *.img 2 | *.pat 3 | -------------------------------------------------------------------------------- /redpill_tool_chain.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -eu 3 | cd $(dirname $(readlink -f "$0")) 4 | 5 | function checkPreconditon(){ 6 | missing_tools="" 7 | for tool in jq docker realpath sha256sum; do 8 | if [ ! $(which ${tool} ) ];then 9 | missing_tools+=" ${tool}" 10 | fi 11 | done 12 | if [ ${#missing_tools} -gt 0 ]; then 13 | echo "required tool(s) missing:$missing_tools. Please install them and run the command again!" 14 | exit 1 15 | fi 16 | } 17 | checkPreconditon 18 | 19 | function readConfig() { 20 | cat global_config.json 21 | } 22 | 23 | function getValueByJsonPath(){ 24 | local JSONPATH=${1} 25 | local CONFIG=${2} 26 | jq -r "${JSONPATH}" <<<${CONFIG} 27 | } 28 | 29 | function buildImage(){ 30 | local KERNEL_SRC_FILENAME=$( [ "${COMPILE_WITH}" == "kernel" ] && echo "${TARGET_PLATFORM}.${KERNEL_FILENAME}" || echo "${TOOLKIT_DEV_FILENAME}") 31 | local KERNEL_SRC_FILENAME_SHA256=$( [ "${COMPILE_WITH}" == "kernel" ] && echo "${KERNEL_DOWNLOAD_SHA256}" || echo "${TOOLKIT_DEV_DOWNLOAD_SHA256}") 32 | checkFileSHA256Checksum "${DOWNLOAD_FOLDER}/${KERNEL_SRC_FILENAME}" "${KERNEL_SRC_FILENAME_SHA256}" 33 | 34 | [ "${USE_BUILDKIT}" == "true" ] && export DOCKER_BUILDKIT=1 35 | docker build --file docker/Dockerfile --force-rm \ 36 | $( [ "${USE_BUILD_CACHE}" == "false" ] && echo "--no-cache" ) \ 37 | --build-arg DOCKER_BASE_IMAGE="${DOCKER_BASE_IMAGE}" \ 38 | --build-arg COMPILE_WITH="${COMPILE_WITH}" \ 39 | --build-arg EXTRACTED_KSRC="${EXTRACTED_KSRC}" \ 40 | --build-arg KERNEL_SRC_FILENAME="${KERNEL_SRC_FILENAME}" \ 41 | --build-arg REDPILL_LKM_REPO="${REDPILL_LKM_REPO}" \ 42 | --build-arg REDPILL_LKM_BRANCH="${REDPILL_LKM_BRANCH}" \ 43 | --build-arg REDPILL_LOAD_REPO="${REDPILL_LOAD_REPO}" \ 44 | --build-arg REDPILL_LOAD_BRANCH="${REDPILL_LOAD_BRANCH}" \ 45 | --build-arg TARGET_NAME="${TARGET_NAME}" \ 46 | --build-arg TARGET_PLATFORM="${TARGET_PLATFORM}" \ 47 | --build-arg TARGET_VERSION="${TARGET_VERSION}" \ 48 | --build-arg DSM_VERSION="${DSM_VERSION}" \ 49 | --build-arg TARGET_REVISION="${TARGET_REVISION}" \ 50 | --build-arg REDPILL_LKM_MAKE_TARGET=${REDPILL_LKM_MAKE_TARGET} \ 51 | --tag ${DOCKER_IMAGE_NAME}:${ID} ./docker 52 | } 53 | 54 | function clean(){ 55 | if [ "${AUTO_CLEAN}" != "true" ]; then 56 | echo "---------- before clean --------------------------------------" 57 | docker system df 58 | fi 59 | if [ "${ID}" == "all" ];then 60 | OLD_IMAGES=$(docker image ls --filter label=redpill-tool-chain --quiet $( [ "${CLEAN_IMAGES}" == "orphaned" ] && echo "--filter dangling=true")) 61 | docker builder prune --all --filter label=redpill-tool-chain --force 62 | else 63 | OLD_IMAGES=$(docker image ls --filter label=redpill-tool-chain=${ID} --quiet --filter dangling=true) 64 | docker builder prune --filter label=redpill-tool-chain=${ID} --force 65 | fi 66 | if [ ! -z "${OLD_IMAGES}" ]; then 67 | docker image rm ${OLD_IMAGES} 68 | fi 69 | if [ "${AUTO_CLEAN}" != "true" ]; then 70 | echo "---------- after clean ---------------------------------------" 71 | docker system df 72 | fi 73 | } 74 | 75 | function runContainer(){ 76 | local CMD=${1} 77 | if [ ! -e $(realpath "${USER_CONFIG_JSON}") ]; then 78 | echo "user config does not exist: ${USER_CONFIG_JSON}" 79 | echo "run 'cp sample_user_config.json ${USER_CONFIG_JSON}' and edit '${USER_CONFIG_JSON}'." 80 | exit 1 81 | fi 82 | if [[ "${LOCAL_RP_LKM_USE}" == "true" && ! -e $(realpath "${LOCAL_RP_LKM_PATH}") ]]; then 83 | echo "Local redpill-lkm path does not exist: ${LOCAL_RP_LKM_PATH}" 84 | exit 1 85 | fi 86 | if [[ "${LOCAL_RP_LOAD_USE}" == "true" && ! -e $(realpath "${LOCAL_RP_LOAD_PATH}") ]]; then 87 | echo "Local redpill-load path does not exist: ${LOCAL_RP_LOAD_PATH}" 88 | exit 1 89 | fi 90 | if [[ "${USE_CUSTOM_BIND_MOUNTS}" == "true" ]]; then 91 | NUMBER_OF_MOUNTS=$(getValueByJsonPath ". | length" "${CUSTOM_BIND_MOUNTS}") 92 | for (( i=0; i<${NUMBER_OF_MOUNTS}; i++ ));do 93 | HOST_PATH=$(getValueByJsonPath ".[${i}].host_path" "${CUSTOM_BIND_MOUNTS}") 94 | CONTAINER_PATH=$(getValueByJsonPath ".[${i}].container_path" "${CUSTOM_BIND_MOUNTS}") 95 | if [ ! -e $(realpath "${HOST_PATH}") ]; then 96 | echo "Host path does not exist: ${HOST_PATH}" 97 | exit 1 98 | fi 99 | BINDS+="--volume $(realpath ${HOST_PATH}):${CONTAINER_PATH} " 100 | done 101 | fi 102 | BINDS+="--volume $(realpath docker/helper.sh):/opt/helper.sh " 103 | docker run --privileged --rm $( [ "${CMD}" == "run" ] && echo " --interactive") --tty \ 104 | --name redpill-tool-chain \ 105 | --hostname redpill-tool-chain \ 106 | --volume /dev:/dev \ 107 | $( [ "${USE_CUSTOM_BIND_MOUNTS}" == "true" ] && echo "${BINDS}") \ 108 | $( [ "${LOCAL_RP_LOAD_USE}" == "true" ] && echo "--volume $(realpath ${LOCAL_RP_LOAD_PATH}):/opt/redpill-load") \ 109 | $( [ "${LOCAL_RP_LKM_USE}" == "true" ] && echo "--volume $(realpath ${LOCAL_RP_LKM_PATH}):/opt/redpill-lkm") \ 110 | $( [ -e "${USER_CONFIG_JSON}" ] && echo "--volume $(realpath ${USER_CONFIG_JSON}):/opt/redpill-load/user_config.json") \ 111 | $( [ "${BUILD_LOADER_JUN_MOD}" == "1" ] && echo "--env BRP_JUN_MOD=1") \ 112 | $( [ "${BUILD_LOADER_DEBUG}" == "1" ] && echo "--env BRP_DEBUG=1") \ 113 | --volume ${REDPILL_LOAD_CACHE}:/opt/redpill-load/cache \ 114 | --volume ${REDPILL_LOAD_IMAGES}:/opt/redpill-load/images \ 115 | --env REDPILL_LKM_MAKE_TARGET=${REDPILL_LKM_MAKE_TARGET} \ 116 | --env TARGET_PLATFORM="${TARGET_PLATFORM}" \ 117 | --env TARGET_NAME="${TARGET_NAME}" \ 118 | --env TARGET_VERSION="${TARGET_VERSION}" \ 119 | --env DSM_VERSION="${DSM_VERSION}" \ 120 | --env REVISION="${TARGET_REVISION}" \ 121 | --env LOCAL_RP_LKM_USE="${LOCAL_RP_LKM_USE}" \ 122 | --env LOCAL_RP_LOAD_USE="${LOCAL_RP_LOAD_USE}" \ 123 | ${DOCKER_IMAGE_NAME}:${ID} $( [ "${CMD}" == "run" ] && echo "/bin/bash") $( [ "${CMD}" == "pat" ] && echo "/opt/helper.sh") 124 | } 125 | 126 | function __ext_add(){ 127 | if [ -z ${EXT_PATH} ]; then 128 | echo "Custom extension directory is not enabled" 129 | exit 1 130 | fi 131 | if [ ! -d ${EXT_PATH} ];then 132 | mkdir ${EXT_PATH} 133 | fi 134 | readonly URL="${1}" 135 | local MRP_TMP_IDX="${EXT_PATH}/_new_ext_index.tmp_json" 136 | 137 | if [ -f ${MRP_TMP_IDX} ];then 138 | rm ${MRP_TMP_IDX} 139 | fi 140 | 141 | echo "Downloading" 142 | curl -k --progress-bar --location ${URL} --output ${MRP_TMP_IDX} 143 | 144 | ext_json=$(cat ${MRP_TMP_IDX}) 145 | ext_id=$(getValueByJsonPath ".id" "${ext_json}") 146 | ext_name=$(getValueByJsonPath ".info.name" "${ext_json}") 147 | ext_releases="$(getValueByJsonPath ".releases|keys|join(\" \")" "${ext_json}")" 148 | echo -e "${ext_id}\nName:\t\t\t${ext_id}\nDescription:\t\t$(getValueByJsonPath ".info.description" "${ext_json}")\nSupport platform:\t${ext_releases}\nInstallation is complete!" 149 | if [ ! -d "${EXT_PATH}/${ext_id}/${ext_id}" ];then 150 | mkdir -p ${EXT_PATH}/${ext_id} 151 | fi 152 | echo ${ext_json} > "${EXT_PATH}/${ext_id}/${ext_id}.json" 153 | rm ${MRP_TMP_IDX} 154 | } 155 | 156 | function __ext_del(){ 157 | if [ -z ${EXT_PATH} ]; then 158 | echo "Custom extension directory is not enabled" 159 | exit 1 160 | fi 161 | for i in ${EXTENSION_IDS} 162 | do 163 | if [ "${i}" == "${1}" ]; then 164 | rm -rf "${EXT_PATH}/${1}" 165 | exit 0 166 | fi 167 | done 168 | } 169 | 170 | function downloadFromUrlIfNotExists(){ 171 | local DOWNLOAD_URL="${1}" 172 | local OUT_FILE="${2}" 173 | local MSG="${3}" 174 | if [ ! -e ${OUT_FILE} ]; then 175 | echo "Downloading ${MSG} '${OUT_FILE}'" 176 | curl -k --progress-bar --location ${DOWNLOAD_URL} --output ${OUT_FILE} 177 | fi 178 | } 179 | 180 | function checkFileSHA256Checksum(){ 181 | local FILE="${1}" 182 | local EXPECTED_SHA256="${2}" 183 | local SHA256_RESULT=$(sha256sum ${FILE}) 184 | if [ "${SHA256_RESULT%% *}" != "${EXPECTED_SHA256}" ];then 185 | echo "The ${FILE} is corrupted, expected sha256 checksum ${EXPECTED_SHA256}, got ${SHA256_RESULT%% *}" 186 | #rm -f "${FILE}" 187 | #echo "Deleted corrupted file ${FILE}. Please re-run your action!" 188 | echo "Please delete the file ${FILE} manualy and re-run your command!" 189 | exit 1 190 | fi 191 | } 192 | 193 | function showHelp(){ 194 | cat << EOF 195 | Usage: ${0} 196 | 197 | Actions: build, auto, run, clean, add, del, sn, pat 198 | 199 | - build: Build the toolchain image for the specified platform version. 200 | 201 | - auto: Starts the toolchain container using the previosuly build toolchain image for the specified platform. 202 | Updates redpill sources and builds the bootloader image automaticaly. Will end the container once done. 203 | 204 | - run: Starts the toolchain container using the previously built toolchain image for the specified platform. 205 | Interactive Bash terminal. 206 | 207 | - clean: Removes old (=dangling) images and the build cache for a platform version. 208 | Use ‘all’ as platform version to remove images and build caches for all platform versions. 209 | 210 | - add: To install extension you need to know its index file location and nothing more. 211 | eg: add 'https://example.com/some-extension/rpext-index.json' 212 | 213 | - del: To remove an already installed extension you need to know its ID. 214 | eg: del 'example_dev.some_extension' 215 | 216 | - sn: Generates a serial number and mac address for the following platforms 217 | DS3615xs DS3617xs DS916+ DS918+ DS920+ DS3622xs+ FS6400 DVA3219 DVA3221 DS1621+ 218 | eg: sn ds920p 219 | 220 | - pat: For decoding PAT file. see: https://github.com/tossp/redpill-tool-chain/blob/master/.github/workflows/pat.yml 221 | 222 | Available platform versions: 223 | --------------------- 224 | ${AVAILABLE_IDS} 225 | 226 | Custom Extensions: 227 | --------------------- 228 | ${EXTENSION_IDS} 229 | 230 | Check global_settings.json for settings. 231 | EOF 232 | } 233 | 234 | 235 | 236 | # mount-bind host folder with absolute path into redpill-load cache folder 237 | # will not work with relativfe path! If single name is used, a docker volume will be created! 238 | REDPILL_LOAD_CACHE=${PWD}/cache 239 | 240 | # mount bind hots folder with absolute path into redpill load images folder 241 | REDPILL_LOAD_IMAGES=${PWD}/images 242 | 243 | 244 | #################################################### 245 | # Do not touch anything below, unless you know what you are doing... 246 | #################################################### 247 | 248 | # parse paramters from config 249 | CONFIG=$(readConfig) 250 | AVAILABLE_IDS=$(getValueByJsonPath ".build_configs[].id" "${CONFIG}") 251 | AUTO_CLEAN=$(getValueByJsonPath ".docker.auto_clean" "${CONFIG}") 252 | USE_BUILD_CACHE=$(getValueByJsonPath ".docker.use_build_cache" "${CONFIG}") 253 | CLEAN_IMAGES=$(getValueByJsonPath ".docker.clean_images" "${CONFIG}") 254 | USE_CUSTOM_BIND_MOUNTS=$(getValueByJsonPath ".docker.use_custom_bind_mounts" "${CONFIG}") 255 | CUSTOM_BIND_MOUNTS=$(getValueByJsonPath ".docker.custom_bind_mounts" "${CONFIG}") 256 | 257 | EXT_PATH="" 258 | EXTENSION_IDS="[Nothing]" 259 | 260 | if [[ "${USE_CUSTOM_BIND_MOUNTS}" == "true" ]]; then 261 | NUMBER_OF_MOUNTS=$(getValueByJsonPath ". | length" "${CUSTOM_BIND_MOUNTS}") 262 | for (( i=0; i<${NUMBER_OF_MOUNTS}; i++ ));do 263 | HOST_PATH=$(getValueByJsonPath ".[${i}].host_path" "${CUSTOM_BIND_MOUNTS}") 264 | CONTAINER_PATH=$(getValueByJsonPath ".[${i}].container_path" "${CUSTOM_BIND_MOUNTS}") 265 | 266 | if [ -e $(realpath "${HOST_PATH}") ]; then 267 | EXT_PATH="${HOST_PATH}/extensions" 268 | fi 269 | 270 | if [[ "${CONTAINER_PATH}" == "/opt/redpill-load/custom" && -d "${EXT_PATH}" ]];then 271 | EXTENSION_IDS=$(ls ${EXT_PATH}) 272 | fi 273 | done 274 | fi 275 | 276 | if [ $# -lt 2 ]; then 277 | showHelp 278 | exit 1 279 | fi 280 | 281 | ACTION=${1} 282 | ID=${2} 283 | 284 | if [[ "${ACTION}" != "del" && "${ACTION}" != "add" && "${ACTION}" != "sn" && "${ID}" != "all" ]]; then 285 | BUILD_CONFIG=$(getValueByJsonPath ".build_configs[] | select(.id==\"${ID}\")" "${CONFIG}") 286 | if [ -z "${BUILD_CONFIG}" ];then 287 | echo "Error: Platform version ${ID} not specified in global_config.json" 288 | echo 289 | showHelp 290 | exit 1 291 | fi 292 | USE_BUILDKIT=$(getValueByJsonPath ".docker.use_buildkit" "${CONFIG}") 293 | DOCKER_IMAGE_NAME=$(getValueByJsonPath ".docker.image_name" "${CONFIG}") 294 | DOWNLOAD_FOLDER=$(getValueByJsonPath ".docker.download_folder" "${CONFIG}") 295 | LOCAL_RP_LKM_USE=$(getValueByJsonPath ".docker.local_rp_lkm_use" "${CONFIG}") 296 | LOCAL_RP_LKM_PATH=$(getValueByJsonPath ".docker.local_rp_lkm_path" "${CONFIG}") 297 | LOCAL_RP_LOAD_USE=$(getValueByJsonPath ".docker.local_rp_load_use" "${CONFIG}") 298 | LOCAL_RP_LOAD_PATH=$(getValueByJsonPath ".docker.local_rp_load_path" "${CONFIG}") 299 | TARGET_PLATFORM=$(getValueByJsonPath ".platform_version | split(\"-\")[0]" "${BUILD_CONFIG}") 300 | TARGET_VERSION=$(getValueByJsonPath ".platform_version | split(\"-\")[1]" "${BUILD_CONFIG}") 301 | DSM_VERSION=$(getValueByJsonPath ".platform_version | split(\"-\")[1][0:3]" "${BUILD_CONFIG}") 302 | TARGET_REVISION=$(getValueByJsonPath ".platform_version | split(\"-\")[2]" "${BUILD_CONFIG}") 303 | TARGET_NAME=$(getValueByJsonPath ".platform_name" "${BUILD_CONFIG}") 304 | USER_CONFIG_JSON=$(getValueByJsonPath ".user_config_json" "${BUILD_CONFIG}") 305 | DOCKER_BASE_IMAGE=$(getValueByJsonPath ".docker_base_image" "${BUILD_CONFIG}") 306 | COMPILE_WITH=$(getValueByJsonPath ".compile_with" "${BUILD_CONFIG}") 307 | REDPILL_LKM_MAKE_TARGET=$(getValueByJsonPath ".redpill_lkm_make_target" "${BUILD_CONFIG}") 308 | KERNEL_DOWNLOAD_URL=$(getValueByJsonPath ".downloads.kernel.url" "${BUILD_CONFIG}") 309 | KERNEL_DOWNLOAD_SHA256=$(getValueByJsonPath ".downloads.kernel.sha256" "${BUILD_CONFIG}") 310 | KERNEL_FILENAME=$(getValueByJsonPath ".downloads.kernel.url | split(\"/\")[] | select ( . | endswith(\".txz\"))" "${BUILD_CONFIG}") 311 | TOOLKIT_DEV_DOWNLOAD_URL=$(getValueByJsonPath ".downloads.toolkit_dev.url" "${BUILD_CONFIG}") 312 | TOOLKIT_DEV_DOWNLOAD_SHA256=$(getValueByJsonPath ".downloads.toolkit_dev.sha256" "${BUILD_CONFIG}") 313 | TOOLKIT_DEV_FILENAME=$(getValueByJsonPath ".downloads.toolkit_dev.url | split(\"/\")[] | select ( . | endswith(\".txz\"))" "${BUILD_CONFIG}") 314 | REDPILL_LKM_REPO=$(getValueByJsonPath ".redpill_lkm.source_url" "${BUILD_CONFIG}") 315 | REDPILL_LKM_BRANCH=$(getValueByJsonPath ".redpill_lkm.branch" "${BUILD_CONFIG}") 316 | REDPILL_LOAD_REPO=$(getValueByJsonPath ".redpill_load.source_url" "${BUILD_CONFIG}") 317 | REDPILL_LOAD_BRANCH=$(getValueByJsonPath ".redpill_load.branch" "${BUILD_CONFIG}") 318 | 319 | BUILD_LOADER_JUN_MOD=$(getValueByJsonPath ".build_env.jun_mod" "${BUILD_CONFIG}") 320 | BUILD_LOADER_DEBUG=$(getValueByJsonPath ".build_env.debug" "${BUILD_CONFIG}") 321 | 322 | EXTRACTED_KSRC="/linux*" 323 | if [ "${COMPILE_WITH}" == "toolkit_dev" ]; then 324 | # TODO: fix: wait new toolkit 325 | if [ "${DSM_VERSION}" == "7.1" ]; then 326 | DSM_VERSION="7.0" 327 | fi 328 | EXTRACTED_KSRC="/usr/local/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/sys-root/usr/lib/modules/DSM-${DSM_VERSION}/build/" 329 | fi 330 | else 331 | if [[ "${ACTION}" != "del" && "${ACTION}" != "add" && "${ACTION}" != "sn" && "${ACTION}" != "clean" ]]; then 332 | echo "All is not supported for action \"${ACTION}\"" 333 | exit 1 334 | fi 335 | fi 336 | 337 | case "${ACTION}" in 338 | add) __ext_add "${2}" 339 | ;; 340 | del) __ext_del "${2}" 341 | echo -e "Extension ID '${2}' not found:\n---------------------\n${EXTENSION_IDS}" 342 | exit 1 343 | ;; 344 | build) if [ "${COMPILE_WITH}" == "kernel" ];then 345 | downloadFromUrlIfNotExists "${KERNEL_DOWNLOAD_URL}" "${DOWNLOAD_FOLDER}/${TARGET_PLATFORM}.${KERNEL_FILENAME}" "Kernel" 346 | else 347 | downloadFromUrlIfNotExists "${TOOLKIT_DEV_DOWNLOAD_URL}" "${DOWNLOAD_FOLDER}/${TOOLKIT_DEV_FILENAME}" "Toolkit Dev" 348 | fi 349 | buildImage 350 | if [ "${AUTO_CLEAN}" == "true" ]; then 351 | clean 352 | fi 353 | ;; 354 | run) runContainer "run" 355 | ;; 356 | pat) runContainer "pat" 357 | ;; 358 | auto) runContainer "auto" 359 | ;; 360 | clean) clean 361 | ;; 362 | sn) ./serialnumbergen.sh `echo "${2}" | tr 'a-z' 'A-Z' | sed -e 's/P/+/' -e 's/XS/xs/'` 363 | ;; 364 | *) if [ ! -z ${ACTION} ];then 365 | echo "Error: action ${ACTION} does not exist" 366 | echo "" 367 | fi 368 | showHelp 369 | exit 1 370 | ;; 371 | esac 372 | -------------------------------------------------------------------------------- /sample_user_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "extra_cmdline": { 3 | "pid": "0x0001", 4 | "vid": "0x46f4", 5 | "sn": "1234XXX123", 6 | "mac1": "XXYYXXYYXXYY" 7 | }, 8 | "synoinfo": {}, 9 | "ramdisk_copy": {}, 10 | "extensions": [] 11 | } 12 | -------------------------------------------------------------------------------- /serialnumbergen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # form https://github.com/pocopico/tinycore-redpill/blob/main/serialnumbergen.sh 4 | 5 | function beginArray() { 6 | case $1 in 7 | DS3615xs) 8 | permanent="LWN" 9 | serialstart="1130 1230 1330 1430" 10 | ;; 11 | DS3617xs) 12 | permanent="ODN" 13 | serialstart="1130 1230 1330 1430" 14 | ;; 15 | DS916+) 16 | permanent="NZN" 17 | serialstart="1130 1230 1330 1430" 18 | ;; 19 | DS918+) 20 | permanent="PDN" 21 | serialstart="1780 1790 1860 1980" 22 | ;; 23 | DS920+) 24 | permanent="SBR" 25 | serialstart="2030 2040 20C0 2150" 26 | ;; 27 | DS3622xs+) 28 | permanent="SQR" 29 | serialstart="2030 2040 20C0 2150" 30 | ;; 31 | FS6400) 32 | permanent="PSN" 33 | serialstart="1960" 34 | ;; 35 | DVA3219) 36 | permanent="RFR" 37 | serialstart="1930 1940" 38 | ;; 39 | DVA3221) 40 | permanent="SJR" 41 | serialstart="2030 2040 20C0 2150" 42 | ;; 43 | esac 44 | } 45 | 46 | 47 | function random() { 48 | printf "%06d" $(($RANDOM %30000 +1 )) 49 | } 50 | function randomhex() { 51 | val=$(( $RANDOM %255 +1)) 52 | echo "obase=16; $val" | bc 53 | } 54 | 55 | function generateRandomLetter() { 56 | for i in a b c d e f g h j k l m n p q r s t v w x y z 57 | do echo $i 58 | done | sort -R|tail -1 59 | } 60 | 61 | 62 | function generateRandomValue() { 63 | for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f g h j k l m n p q r s t v w x y z 64 | do echo $i 65 | done | sort -R|tail -1 66 | } 67 | 68 | function toupper() { 69 | echo $1 | tr 'a-z' 'A-Z' 70 | } 71 | 72 | function generateMacAddress() { 73 | #toupper "Mac Address: 00:11:32:$(randomhex):$(randomhex):$(randomhex)" 74 | printf '00:11:32:%02X:%02X:%02X' $[RANDOM%256] $[RANDOM%256] $[RANDOM%256] 75 | } 76 | 77 | function generateSerial(){ 78 | beginArray $1 79 | case $1 in 80 | DS3615xs) 81 | serialnum="`echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1`$permanent"$(random) 82 | ;; 83 | DS3617xs) 84 | serialnum="`echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1`$permanent"$(random) 85 | ;; 86 | DS916+) 87 | serialnum="`echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1`$permanent"$(random) 88 | ;; 89 | DS918+) 90 | serialnum="`echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1`$permanent"$(random) 91 | ;; 92 | FS6400) 93 | serialnum="`echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1`$permanent"$(random) 94 | ;; 95 | DS920+) 96 | serialnum=$(toupper "`echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1`$permanent"$(generateRandomLetter)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomLetter)) 97 | ;; 98 | DS3622xs+) 99 | serialnum=$(toupper "`echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1`$permanent"$(generateRandomLetter)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomLetter)) 100 | ;; 101 | DVA3219) 102 | serialnum=$(toupper "`echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1`$permanent"$(generateRandomLetter)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomLetter)) 103 | ;; 104 | DVA3221) 105 | serialnum=$(toupper "`echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1`$permanent"$(generateRandomLetter)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomLetter)) 106 | ;; 107 | esac 108 | echo $serialnum 109 | } 110 | 111 | 112 | function showhelp() { 113 | cat << EOF 114 | $(basename ${0}) 115 | ---------------------------------------------------------------------------------------- 116 | Usage: ${0} 117 | Available platforms : 118 | ---------------------------------------------------------------------------------------- 119 | DS3615xs DS3617xs DS916+ DS918+ DS920+ DS3622xs+ FS6400 DVA3219 DVA3221 120 | e.g. $(basename ${0}) DS3615xs 121 | ---------------------------------------------------------------------------------------- 122 | EOF 123 | } 124 | 125 | if [ -z "$1" ] ; then 126 | showhelp 127 | else 128 | if [ "$1" = "DS3615xs" ] || [ "$1" = "DS3617xs" ] || [ "$1" = "DS916+" ] || [ "$1" = "DS918+" ] || [ "$1" = "DS920+" ] || [ "$1" = "DS3622xs+" ] || [ "$1" = "FS6400" ] || [ "$1" = "DVA3219" ] || [ "$1" = "DVA3221" ]; then 129 | echo -e "Model:\t\t\t$1" 130 | echo -e "Mac Address:\t\t$(generateMacAddress)" 131 | echo -e "Serial Number:\t\t$(generateSerial $1)" 132 | else 133 | echo "Error : $1 is not an available model for serial number generation. " 134 | echo "Available Models : DS3615xs DS3617xs DS916+ DS918+ DS920+ DS3622xs+ DVA3219 DVA3221" 135 | exit 1 136 | fi 137 | fi 138 | -------------------------------------------------------------------------------- /synoboot.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | T='/dev/synoboot' 4 | S='images/redpill-DS[39]*.img' 5 | 6 | cd $(dirname $(readlink -f "$0")) 7 | 8 | IMG_FILE=`ls -lt ${S} 2>/dev/null | awk 'NR==1{print $9}'` 9 | 10 | if [ ! -b "${T}" ];then 11 | echo -e "The target block device address does not exist:\t${T}" 12 | exit 1 13 | fi 14 | 15 | if [ ! -f "${IMG_FILE}" ];then 16 | echo -e "Is not a valid file:\t${IMG_FILE}" 17 | ls -lt ${S} 18 | exit 1 19 | fi 20 | 21 | echo -e "Boot image:\t\t${PWD}/${IMG_FILE}" 22 | echo -e "Target block device:\t${T}" 23 | dd if="${IMG_FILE}" of="${T}" bs=4M conv=nocreat oflag=sync status=progress 24 | 25 | --------------------------------------------------------------------------------