├── cache └── .gitignore ├── docker ├── downloads │ └── .gitignore ├── entrypoint.sh ├── Makefile ├── Dockerfile └── helper.sh ├── images └── .gitignore ├── custom └── .gitignore ├── redpill-dtb ├── releases │ ├── dtc │ ├── install.sh │ ├── model_ds1621p.dtb │ ├── model_ds2422p.dtb │ ├── model_ds920p.dtb │ └── install_rd.sh ├── README.md ├── rpext-index.json └── recipes │ └── universal.json ├── extensions ├── r8125 │ ├── releases │ │ ├── r8125-4.4.180plus.tgz │ │ └── ds918p_42218.json │ └── src │ │ └── check-r8125.sh ├── r8152 │ ├── releases │ │ ├── r8152-4.4.180plus.tgz │ │ └── ds918p_42218.json │ └── src │ │ └── check-r8152.sh ├── pocopico-r8125.json ├── pocopico-r8152.json ├── redpill-dtb.json ├── redpill-acpid.json ├── redpill-boot-wait.json ├── redpill-virtio.json └── redpill-misc.json ├── .gitignore ├── sample_user_config.json ├── .editorconfig ├── synoboot.sh ├── README.md ├── .github └── workflows │ ├── build_r8125.yml │ └── test.yml ├── README_EN.md ├── serialnumbergen.sh ├── redpill_tool_chain.sh └── global_config.json /cache/.gitignore: -------------------------------------------------------------------------------- 1 | *.img 2 | *.pat 3 | -------------------------------------------------------------------------------- /docker/downloads/.gitignore: -------------------------------------------------------------------------------- 1 | *.txz 2 | -------------------------------------------------------------------------------- /images/.gitignore: -------------------------------------------------------------------------------- 1 | *.img 2 | *.pat 3 | -------------------------------------------------------------------------------- /custom/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /redpill-dtb/releases/dtc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinlife/redpill-tool-chain/HEAD/redpill-dtb/releases/dtc -------------------------------------------------------------------------------- /redpill-dtb/releases/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # copy file 4 | cp -vf model_${PLATFORM_ID%%_*}.dtb /tmpRoot/etc.defaults/model.dtb 5 | -------------------------------------------------------------------------------- /redpill-dtb/releases/model_ds1621p.dtb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinlife/redpill-tool-chain/HEAD/redpill-dtb/releases/model_ds1621p.dtb -------------------------------------------------------------------------------- /redpill-dtb/releases/model_ds2422p.dtb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinlife/redpill-tool-chain/HEAD/redpill-dtb/releases/model_ds2422p.dtb -------------------------------------------------------------------------------- /redpill-dtb/releases/model_ds920p.dtb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinlife/redpill-tool-chain/HEAD/redpill-dtb/releases/model_ds920p.dtb -------------------------------------------------------------------------------- /extensions/r8125/releases/r8125-4.4.180plus.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinlife/redpill-tool-chain/HEAD/extensions/r8125/releases/r8125-4.4.180plus.tgz -------------------------------------------------------------------------------- /extensions/r8152/releases/r8152-4.4.180plus.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinlife/redpill-tool-chain/HEAD/extensions/r8152/releases/r8152-4.4.180plus.tgz -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.txz 2 | *.json 3 | !extensions/*.json 4 | !extensions/r8125/releases/*.json 5 | !extensions/r8152/releases/*.json 6 | !redpill-dtb/*.json 7 | !redpill-dtb/recipes/*.json 8 | !sample_user_config.json 9 | -------------------------------------------------------------------------------- /redpill-dtb/README.md: -------------------------------------------------------------------------------- 1 | Create your own device tree binary. 2 | 3 | ```shell 4 | dtc -I dtb -O dts -o output.dts model.dtb 5 | cat /sys/block/sataX/device/syno_block_info 6 | nano output.dts 7 | dtc -I dts -O dtb -o model_r2.dtb output.dts 8 | ``` 9 | -------------------------------------------------------------------------------- /redpill-dtb/releases/install_rd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # install dtc 4 | chmod +x dtc 5 | cp dtc /usr/sbin/dtc 6 | 7 | # copy file 8 | cp -vf model_${PLATFORM_ID%%_*}.dtb /etc.defaults/model.dtb 9 | cp -vf model_${PLATFORM_ID%%_*}.dtb /var/run/model.dtb 10 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /extensions/r8152/src/check-r8152.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Checking modules is loaded 3 | # 4 | 5 | echo -n "Loading module r8152 -> " 6 | 7 | if [ `/sbin/lsmod |grep -i r8152|wc -l` -gt 0 ] ; then 8 | echo "Module r8152 loaded succesfully" 9 | else echo "Module r8152 is not loaded " 10 | fi -------------------------------------------------------------------------------- /extensions/r8125/src/check-r8125.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Checking modules is loaded 3 | # 4 | 5 | echo -n "Loading module r8125 -> " 6 | 7 | if [ `/sbin/lsmod |grep -i r8125|wc -l` -gt 0 ] ; then 8 | echo "Module r8125 loaded succesfully" 9 | else echo "Module r8125 is not loaded " 10 | fi 11 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /extensions/r8125/releases/ds918p_42218.json: -------------------------------------------------------------------------------- 1 | { 2 | "mod_version": "v1", 3 | 4 | "files": [ 5 | { 6 | "name": "r8125-4.4.180plus.tgz", 7 | "url": "https://raw.githubusercontent.com/jinlife/redpill-tool-chain/master/extensions/r8125/releases/r8125-4.4.180plus.tgz", 8 | "sha256": "92396d8602f21c6fa9314c141c26afa5026f741eed8834181ee5825eb4d1e51e", 9 | "packed": true 10 | }, 11 | { 12 | "name": "check-r8125.sh", 13 | "url": "https://raw.githubusercontent.com/jinlife/redpill-tool-chain/master/extensions/r8125/src/check-r8125.sh", 14 | "sha256": "ec4f266812ed308c0e15363315cfe696a2eee48b024130260fca15bd6e63dd91", 15 | "packed": false 16 | } 17 | ], 18 | 19 | "kmods": { 20 | "r8125.ko": "" 21 | }, 22 | 23 | "scripts": { 24 | "on_boot": "check-r8125.sh" 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /extensions/r8152/releases/ds918p_42218.json: -------------------------------------------------------------------------------- 1 | { 2 | "mod_version": "v1", 3 | 4 | "files": [ 5 | { 6 | "name": "r8152-4.4.180plus.tgz", 7 | "url": "https://raw.githubusercontent.com/jinlife/redpill-tool-chain/master/extensions/r8152/releases/r8152-4.4.180plus.tgz", 8 | "sha256": "5f532a3d65f507a1f73e063c0d1cf5bce04a32a3cc4b44e8a53e6b8aa70ebd28", 9 | "packed": true 10 | }, 11 | { 12 | "name": "check-r8152.sh", 13 | "url": "https://raw.githubusercontent.com/jinlife/redpill-tool-chain/master/extensions/r8152/src/check-r8152.sh", 14 | "sha256": "6e9fb21b788773c286d7929c3dbbff07dc08686e7b80d7f8ff5bdf00a93f9490", 15 | "packed": false 16 | } 17 | ], 18 | 19 | "kmods": { 20 | "r8152.ko": "" 21 | }, 22 | 23 | "scripts": { 24 | "on_boot": "check-r8152.sh" 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /extensions/pocopico-r8125.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "pocopico.r8125", 3 | "url": "https://github.com/jinlife/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/master/r8125", 9 | "help_url": "" 10 | }, 11 | "releases": { 12 | "ds918p_42621": "https://github.com/jinlife/redpill-tool-chain/raw/master/extensions/r8125/releases/ds918p_42218.json", 13 | "ds918p_42661": "https://github.com/jinlife/redpill-tool-chain/raw/master/extensions/r8125/releases/ds918p_42218.json", 14 | "ds920p_42621": "https://github.com/jinlife/redpill-tool-chain/raw/master/extensions/r8125/releases/ds918p_42218.json", 15 | "ds920p_42661": "https://github.com/jinlife/redpill-tool-chain/raw/master/extensions/r8125/releases/ds918p_42218.json" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /extensions/pocopico-r8152.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "pocopico.r8152", 3 | "url": "https://github.com/jinlife/redpill-tool-chain/raw/master/extensions/pocopico-r8152.json", 4 | "info": { 5 | "name": "r8152", 6 | "description": "Adds Realtek RTL8152 USB 2.5Gigabit Ethernet driver Support", 7 | "author_url": "https://github.com/pocopico", 8 | "packer_url": "https://github.com/pocopico/rp-ext/tree/master/r8152", 9 | "help_url": "" 10 | }, 11 | "releases": { 12 | "ds918p_42621": "https://github.com/jinlife/redpill-tool-chain/raw/master/extensions/r8152/releases/ds918p_42218.json", 13 | "ds918p_42661": "https://github.com/jinlife/redpill-tool-chain/raw/master/extensions/r8152/releases/ds918p_42218.json", 14 | "ds920p_42621": "https://github.com/jinlife/redpill-tool-chain/raw/master/extensions/r8152/releases/ds918p_42218.json", 15 | "ds920p_42661": "https://github.com/jinlife/redpill-tool-chain/raw/master/extensions/r8152/releases/ds918p_42218.json" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /extensions/redpill-dtb.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "redpill-dtb", 3 | "url": "https://github.com/jinlife/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/jinlife/redpill-tool-chain/raw/master/redpill-dtb", 8 | "packer_url": "https://github.com/jinlife/redpill-tool-chain/raw/master/redpill-dtb", 9 | "help_url": "https://github.com/jinlife/redpill-tool-chain/raw/master/redpill-dtb" 10 | }, 11 | "releases": { 12 | "ds920p_42218": "https://github.com/jinlife/redpill-tool-chain/raw/master/redpill-dtb/recipes/universal.json", 13 | "ds920p_42550": "https://github.com/jinlife/redpill-tool-chain/raw/master/redpill-dtb/recipes/universal.json", 14 | "ds920p_42621": "https://github.com/jinlife/redpill-tool-chain/raw/master/redpill-dtb/recipes/universal.json", 15 | "ds920p_42661": "https://github.com/jinlife/redpill-tool-chain/raw/master/redpill-dtb/recipes/universal.json", 16 | "ds1621p_42218": "https://github.com/jinlife/redpill-tool-chain/raw/master/redpill-dtb/recipes/universal.json", 17 | "ds1621p_42621": "https://github.com/jinlife/redpill-tool-chain/raw/master/redpill-dtb/recipes/universal.json", 18 | "ds1621p_42661": "https://github.com/jinlife/redpill-tool-chain/raw/master/redpill-dtb/recipes/universal.json", 19 | "ds2422p_42218": "https://github.com/jinlife/redpill-tool-chain/raw/master/redpill-dtb/recipes/universal.json", 20 | "ds2422p_42621": "https://github.com/jinlife/redpill-tool-chain/raw/master/redpill-dtb/recipes/universal.json", 21 | "ds2422p_42661": "https://github.com/jinlife/redpill-tool-chain/raw/master/redpill-dtb/recipes/universal.json" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /redpill-dtb/rpext-index.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "redpill-dtb", 3 | "url": "https://github.com/jinlife/redpill-tool-chain/raw/master/redpill-dtb/rpext-index.json", 4 | "info": { 5 | "name": "Device tree binary", 6 | "description": "Create your own device tree binary", 7 | "author_url": "https://github.com/jinlife/redpill-tool-chain/raw/master/redpill-dtb", 8 | "packer_url": "https://github.com/jinlife/redpill-tool-chain/raw/master/redpill-dtb", 9 | "help_url": "https://github.com/jinlife/redpill-tool-chain/raw/master/redpill-dtb" 10 | }, 11 | "releases": { 12 | "ds920p_42218": "https://github.com/jinlife/redpill-tool-chain/raw/master/redpill-dtb/recipes/universal.json", 13 | "ds920p_42550": "https://github.com/jinlife/redpill-tool-chain/raw/master/redpill-dtb/recipes/universal.json", 14 | "ds920p_42621": "https://github.com/jinlife/redpill-tool-chain/raw/master/redpill-dtb/recipes/universal.json", 15 | "ds920p_42661": "https://github.com/jinlife/redpill-tool-chain/raw/master/redpill-dtb/recipes/universal.json", 16 | "ds1621p_42218": "https://github.com/jinlife/redpill-tool-chain/raw/master/redpill-dtb/recipes/universal.json", 17 | "ds1621p_42621": "https://github.com/jinlife/redpill-tool-chain/raw/master/redpill-dtb/recipes/universal.json", 18 | "ds1621p_42661": "https://github.com/jinlife/redpill-tool-chain/raw/master/redpill-dtb/recipes/universal.json", 19 | "ds2422p_42218": "https://github.com/jinlife/redpill-tool-chain/raw/master/redpill-dtb/recipes/universal.json", 20 | "ds2422p_42621": "https://github.com/jinlife/redpill-tool-chain/raw/master/redpill-dtb/recipes/universal.json", 21 | "ds2422p_42661": "https://github.com/jinlife/redpill-tool-chain/raw/master/redpill-dtb/recipes/universal.json" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /redpill-dtb/recipes/universal.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "name": "install_rd.sh", 5 | "url": "https://github.com/jinlife/redpill-tool-chain/raw/master/redpill-dtb/releases/install_rd.sh", 6 | "sha256": "41a626b6af537240727e059da14a225fda7c78904fcbdc9b457a8cbf84d95a3a", 7 | "packed": false 8 | }, 9 | { 10 | "name": "install.sh", 11 | "url": "https://github.com/jinlife/redpill-tool-chain/raw/master/redpill-dtb/releases/install.sh", 12 | "sha256": "22e49bc661e1789af2634346fb1dd587dd00cc3ace9d91de9abfe3f77a371c39", 13 | "packed": false 14 | }, 15 | { 16 | "name": "model_ds920p.dtb", 17 | "url": "https://github.com/jinlife/redpill-tool-chain/raw/master/redpill-dtb/releases/model_ds920p.dtb", 18 | "sha256": "20dc3ceb58c42e192603a3bc2ea3875ec3629645360032488455399448dd7ea0", 19 | "packed": false 20 | }, 21 | { 22 | "name": "model_ds1621p.dtb", 23 | "url": "https://github.com/jinlife/redpill-tool-chain/raw/master/redpill-dtb/releases/model_ds1621p.dtb", 24 | "sha256": "e045eabbc6ca98fb324b20ef8e973d310ef939a8d87d76bfb87674437beabcd4", 25 | "packed": false 26 | }, 27 | { 28 | "name": "model_ds2422p.dtb", 29 | "url": "https://github.com/jinlife/redpill-tool-chain/raw/master/redpill-dtb/releases/model_ds2422p.dtb", 30 | "sha256": "b853bc937664e1867f341882731a6837d8a1ac45eabc37a7e4eeb148b8a63986", 31 | "packed": false 32 | }, 33 | { 34 | "name": "dtc", 35 | "url": "https://github.com/jinlife/redpill-tool-chain/raw/master/redpill-dtb/releases/dtc", 36 | "sha256": "14f7f87a5822050eab7c30a064912a6efe99f49bf6b896bbb38c2ba003803e78", 37 | "packed": false 38 | } 39 | ], 40 | "scripts": { 41 | "on_boot": "install_rd.sh", 42 | "on_os_load": "install.sh" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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-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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | ## 关于此Fork 12 | 1. 这个Fork是个人用来建立Unraid里面的虚拟机的。所以VID和PID都是没改过的0x0001和0x46f4。 这个主要是用在虚拟机的。PVE和ESXI应该也能用。 13 | 2. 加了r8125的2.5G网卡驱动V9.009.02, r8152的USB2.5G网卡驱动V2.16.1。开机启动即可识别。 14 | 3. 貌似更新到最新的Jumkey的loader,没有无限循环的情况了。dtb也自动适配了。 15 | 16 | ## 关于项目? 17 | 18 | - 基于[RedPill-TTG](https://github.com/RedPill-TTG)源码制作 19 | - 为`DS918+`提供DSM7适配支持 ( 感谢 [@jumkey](https://github.com/jumkey) ) 20 | - 为`DS3617xs`提供DSM7适配支持 ( 感谢 [@jimmyGALLAND](https://github.com/jimmyGALLAND) ) 21 | - 为`DVA3221`提供DSM7适配支持 ( 感谢 [@dogodefi](https://github.com/dogodefi) ) 22 | - 整理社区扩展驱动 ( 感谢 [@pocopico](https://github.com/pocopico) ) 23 | - 部分引导提取自 [@tinycore-redpill](https://github.com/pocopico/tinycore-redpill) 项目 24 | - `redpill_lkm_make_target`字段的可选值有 `dev-v6`, `dev-v7`, `test-v6`, `test-v7`, `prod-v6` 或者 `prod-v7`, 25 | 需要注意后缀为`-v6`的值用于 DSM6 版本构建, 需要注意后缀为`-v7`的值用于 DSM7 版本构建. 默认使用的是 `dev-v6` 和 `dev-v7`。 26 | 27 | > PS: 由于toolkit dev缺少fs/proc所需的源代码,因此它们取自提取的DSM6.2.4内核源代码。 28 | 构建需要此单个文件夹的源代码,但不使用内核源代码构建redpill.ko模块。 29 | 30 | 如果您发现工具链的构建方式有问题或者有改进的想法,请让我知道。 31 | 32 | 33 | ## 如何使用? 34 | 35 | 1. 复制`sample_user_config.json`为`ds3615xs_user_config.json`或者`ds918p_user_config.json` 36 | 1. 编辑`_user_config.json`比如 918+ 就编辑 `ds918p_user_config.json` 文件 37 | 1. 添加扩展驱动: 38 | 比如 `./redpill_tool_chain.sh add https://raw.githubusercontent.com/pocopico/rp-ext/master/mpt3sas/rpext-index.json` 39 | 1. 为你想要的平台和版本构建编译镜像: 40 | 比如 `./redpill_tool_chain.sh build ds918p-7.0-41890` 41 | 1. 为你想要的平台和版本构建引导: 42 | 比如 `./redpill_tool_chain.sh auto ds918p-7.0-41890` 43 | 44 | `./redpill_tool_chain.sh auto`运行结束之后,将会在宿主机的`./image`文件夹中生成 RedPill引导镜像。 45 | 46 | `_user_config.json`文件中的`extensions`字段保持为空,会自动打包所有已安装的自定义驱动。 47 | 自定义驱动请按需添加,尽量不要加载无关驱动,否则会因为扩展驱动太大导致打包失败。 48 | 49 | 依赖: `docker` 50 | 51 | --- 52 | ⚠️⚠️⚠️ 53 | 由于各版本环境不完全一致,制作策略会有细节变化,具体可以参考 [工作流配置文件](https://github.com/tossp/redpill-tool-chain/blob/master/.github/workflows/test.yml) 54 | 55 | 在 [Gtihub Actions](https://github.com/tossp/redpill-tool-chain/actions) 中查看执行结果,并下载生成的镜像 56 | 57 | ❗❗❗ 58 | [工作流配置文件](https://github.com/tossp/redpill-tool-chain/blob/master/.github/workflows/test.yml) 中引入的扩展都是推荐必装扩展 59 | 60 | --- 61 | 62 | ## 快捷说明 63 | 64 | - `docker/Dockerfile` 中补入了阿里云镜像 65 | - `./redpill_tool_chain.sh add `添加扩展驱动 66 | - `./redpill_tool_chain.sh del `删除扩展驱动 67 | - `./redpill_tool_chain.sh run `自定义引导构建过程 68 | - 使用`synoboot.sh`写入引导 69 | 70 | ### 自定义扩展驱动管理 71 | 72 | - 安装 thethorgroup.virtio : `./redpill_tool_chain.sh add https://github.com/jumkey/redpill-load/raw/develop/redpill-virtio/rpext-index.json` 73 | - 安装 thethorgroup.boot-wait : `./redpill_tool_chain.sh add https://github.com/jumkey/redpill-load/raw/develop/redpill-boot-wait/rpext-index.json` 74 | - 安装 pocopico.mpt3sas : `./redpill_tool_chain.sh add https://raw.githubusercontent.com/pocopico/rp-ext/master/mpt3sas/rpext-index.json` 75 | - 移除 pocopico.mpt3sas : `./redpill_tool_chain.sh del pocopico.mpt3sas` 76 | - 安装 jumkey.dtb : `./redpill_tool_chain.sh add https://github.com/jumkey/redpill-load/raw/develop/redpill-dtb/rpext-index.json` 77 | 78 | [获取更多扩展驱动...](https://github.com/pocopico/rp-ext) 79 | 80 | ### 构建工具链镜像 81 | 82 | - `./redpill_tool_chain.sh build ds3615xs-6.2.4-25556` 83 | - `./redpill_tool_chain.sh build ds918p-7.0.1-42218` 84 | 85 | ### 制作 redpill 引导镜像 86 | 87 | - `./redpill_tool_chain.sh auto ds3615xs-6.2.4-25556` 88 | - `./redpill_tool_chain.sh auto ds918p-7.0.1-42218` 89 | 90 | ### 清除旧的引导镜像和缓存 91 | 92 | - `./redpill_tool_chain.sh clean ds3615xs-6.2.4-25556` 93 | - `./redpill_tool_chain.sh clean ds918p-7.0.1-42218` 94 | - `./redpill_tool_chain.sh clean all` 95 | 96 | ### 生成指定平台的序列号和MAC地址 97 | 98 | - `./redpill_tool_chain.sh sn ds918p` 99 | - `./redpill_tool_chain.sh sn dva3221` 100 | 101 | ### 查看帮助文本 102 | 103 | `./redpill_tool_chain.sh` 104 | 105 | ```txt 106 | Usage: ./redpill_tool_chain.sh 107 | 108 | Actions: build, auto, run, clean, add, del, sn, pat 109 | 110 | - build: Build the toolchain image for the specified platform version. 111 | 112 | - auto: Starts the toolchain container using the previosuly build toolchain image for the specified platform. 113 | Updates redpill sources and builds the bootloader image automaticaly. Will end the container once done. 114 | 115 | - run: Starts the toolchain container using the previously built toolchain image for the specified platform. 116 | Interactive Bash terminal. 117 | 118 | - clean: Removes old (=dangling) images and the build cache for a platform version. 119 | Use ‘all’ as platform version to remove images and build caches for all platform versions. 120 | 121 | - add: To install extension you need to know its index file location and nothing more. 122 | eg: add 'https://example.com/some-extension/rpext-index.json' 123 | 124 | - del: To remove an already installed extension you need to know its ID. 125 | eg: del 'example_dev.some_extension' 126 | 127 | - sn: Generates a serial number and mac address for the following platforms 128 | DS3615xs DS3617xs DS916+ DS918+ DS920+ DS3622xs+ FS6400 DVA3219 DVA3221 DS1621+ 129 | eg: sn ds920p 130 | 131 | - pat: For decoding PAT file. 132 | 133 | Available platform versions: 134 | --------------------- 135 | ds1621p-7.0.1-42218 136 | ds1621p-7.1.0-42661 137 | ds2422p-7.0.1-42218 138 | ds3615xs-6.2.4-25556 139 | ds3615xs-7.0.1-42218 140 | ds3615xs-7.1.0-42661 141 | ds3617xs-7.0.1-42218 142 | ds3617xs-7.1.0-42661 143 | ds3622xsp-7.0.1-42218 144 | ds3622xsp-7.1.0-42661 145 | ds918p-6.2.4-25556 146 | ds918p-7.0.1-42218 147 | ds918p-7.1.0-42661 148 | ds920p-7.0.1-42218 149 | ds920p-7.1.0-42661 150 | dva3221-7.0.1-42218 151 | dva3221-7.1.0-42661 152 | 153 | Custom Extensions: 154 | --------------------- 155 | jumkey.acpid2 156 | thethorgroup.boot-wait 157 | thethorgroup.virtio 158 | 159 | Check global_settings.json for settings. 160 | ``` 161 | 162 | ## 更多细节 163 | 164 | 编译`DS920+`和`DS1621+`需要加入`jumkey.dtb`扩展并参考[这里](https://github.com/jumkey/redpill-load/blob/develop/redpill-dtb/README.md)创建设备的二进制设备树 165 | 166 | 查看基于[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) 167 | -------------------------------------------------------------------------------- /.github/workflows/build_r8125.yml: -------------------------------------------------------------------------------- 1 | name: Build_R8125 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | build: 8 | runs-on: jinlife-ubuntu-18.04 9 | name: Compile "${{matrix.platform}} ${{matrix.version}}" 10 | strategy: 11 | fail-fast: false 12 | matrix: 13 | include: 14 | - platform: apollolake 15 | version: "7.0" 16 | - platform: geminilake 17 | version: "7.0" 18 | 19 | steps: 20 | - name: Clone Repository 21 | uses: actions/checkout@v3 22 | with: 23 | ref: master 24 | 25 | - name: Checkout toolkit repository 26 | uses: actions/checkout@v2 27 | with: 28 | repository: SynologyOpenSource/pkgscripts-ng 29 | ref: DSM7.0 30 | path: pkgscripts-ng 31 | 32 | - name: Init build dependencies 33 | env: 34 | DEBIAN_FRONTEND: noninteractive 35 | run: | 36 | sudo -E swapoff -a 37 | sudo -E rm -f /swapfile 38 | sudo -E docker image prune -a -f 39 | sudo -E snap set system refresh.retain=2 40 | sudo -E apt-get -y purge azure* dotnet* firefox ghc* google* hhvm llvm* mono* mysql* openjdk* php* zulu* 41 | sudo -E apt-get -y autoremove --purge 42 | sudo -E rm -rf /usr/share/dotnet /usr/local/lib/android/sdk /etc/mysql /etc/php /usr/local/share/boost 43 | [ -n "$AGENT_TOOLSDIRECTORY" ] && sudo rm -rf "$AGENT_TOOLSDIRECTORY" 44 | sudo -E apt-get update -y 45 | sudo -E apt-get install -y python3 wget tar pinentry && ln -s /usr/bin/python3 /usr/local/bin/python 46 | sudo -E apt-get clean 47 | git config --global user.name 'GitHub Actions' && git config --global user.email 'noreply@github.com' 48 | df -h 49 | 50 | # https://github.com/cwuensch/SynoBuild 51 | - name: Download DSM toolkit 52 | run: | 53 | sudo mkdir -p /toolkit/build_env/ds.${{matrix.platform}}-${{matrix.version}} /toolkit/source 54 | sudo rsync -aIv pkgscripts-ng/ /toolkit/pkgscripts-ng/ 55 | sudo rsync -aIv pkgscripts-ng/ /pkgscripts-ng/ 56 | cd /toolkit 57 | sudo wget -qO- https://downloads.sourceforge.net/project/dsgpl/toolkit/DSM${{matrix.version}}/base_env-${{matrix.version}}.txz | sudo tar -xJhv -C build_env/ds.${{matrix.platform}}-${{matrix.version}} 58 | sudo wget -qO- https://downloads.sourceforge.net/project/dsgpl/toolkit/DSM${{matrix.version}}/ds.${{matrix.platform}}-${{matrix.version}}.env.txz | sudo tar -xJhv -C build_env/ds.${{matrix.platform}}-${{matrix.version}} 59 | sudo wget -qO- https://downloads.sourceforge.net/project/dsgpl/toolkit/DSM${{matrix.version}}/ds.${{matrix.platform}}-${{matrix.version}}.dev.txz | sudo tar -xJhv -C build_env/ds.${{matrix.platform}}-${{matrix.version}} 60 | 61 | # http://www.wolfteck.com/2019/03/02/packaging_rtl88x2bu_for_synology_nas/ 62 | # http://dd-han.tw/2018/synology-development-emviroment-create 63 | - name: ENV Prepare 64 | working-directory: /toolkit/pkgscripts-ng 65 | run: | 66 | sudo ./EnvDeploy -v ${{matrix.version}} --list 67 | ls /toolkit/build_env/ds.${{matrix.platform}}-${{matrix.version}} 68 | #sudo ./EnvDeploy -t toolkit_tarballs -v ${{matrix.version}} -p ${{matrix.platform}} 69 | 70 | # https://gist.github.com/woods/8970150 71 | - name: Copy Source 72 | run: | 73 | sudo svn export https://github.com/jinlife/unraid-r8125-r8152-driver/trunk/r8125 /toolkit/source/r8125 74 | sudo svn export https://github.com/jinlife/unraid-r8125-r8152-driver/trunk/r8152 /toolkit/source/r8152 75 | sudo patch -d /toolkit/source/r8152/src -p1 -i /toolkit/source/r8152/patches/100-add-LED-configuration-from-OF.patch 76 | sudo rsync -aIv /toolkit/source/r8125/src/ /toolkit/source/r8125/ 77 | sudo rsync -aIv /toolkit/source/r8152/src/ /toolkit/source/r8152/ 78 | sudo rsync -aIv ./build/r8152/ /toolkit/source/r8152/ 79 | sudo rsync -aIv ./build/r8125/ /toolkit/source/r8125/ 80 | sudo chmod -R 777 /toolkit/source 81 | sudo chmod -R 777 ./build/ 82 | ls ./build/ 83 | 84 | - name: Generate key 85 | run: | 86 | cat <<-EOF > genkey 87 | Key-Type: 1 88 | Key-Length: 4096 89 | Subkey-Type: 1 90 | Subkey-Length: 4096 91 | Name-Real: Testing name 92 | Name-Email: test@test.org 93 | Expire-Date: 0 94 | Passphrase: Test1234~ 95 | %no-protection 96 | EOF 97 | sudo gpg --gen-key --batch genkey 98 | sudo rsync -aIv ~/.gnupg /toolkit/build_env/ds.${{matrix.platform}}-${{matrix.version}}/root/ 99 | 100 | #- name: Make complie 101 | # working-directory: /toolkit 102 | # run: | 103 | # cd /toolkit/source/r8125 104 | # sudo ./INFO.sh > INFO 105 | # cd /toolkit/source/r8152 106 | # sudo ./INFO.sh > INFO 107 | # #chroot /toolkit/build_env/ds.${{matrix.platform}}-${{matrix.version}} 108 | # #sudo pkgscripts-ng/PkgCreate.py -p ${{matrix.platform}} -I r8125 109 | # #sudo pkgscripts-ng/PkgCreate.py -p ${{matrix.platform}} -I r8152 110 | # #sudo make oldconfig 111 | # #sudo sed -i -e 's#CONFIG_SYSTEM_TRUSTED_KEYS="debian/canonical-certs.pem"#CONFIG_SYSTEM_TRUSTED_KEYS=""#g' .config 112 | # #cat .config 113 | 114 | - name: Make Package 115 | working-directory: /toolkit 116 | run: | 117 | sudo pkgscripts-ng/PkgCreate.py -v ${{matrix.version}} -p ${{matrix.platform}} -c r8152 118 | sudo pkgscripts-ng/PkgCreate.py -v ${{matrix.version}} -p ${{matrix.platform}} -c r8125 119 | 120 | - name: Compile Linux 121 | working-directory: /toolkit 122 | run: | 123 | echo 'root start' 124 | ls 125 | echo 'root end' 126 | ls result_spk 127 | 128 | - name: Find files 129 | run: | 130 | sudo rm -rf ./artifact 131 | sudo mkdir -p ./artifact 132 | sudo chmod -R 777 ./artifact 133 | sudo rsync -aIv /toolkit/result_spk/ ./artifact/ 134 | 135 | - name: Upload github actions 136 | uses: actions/upload-artifact@v3 137 | with: 138 | name: ds.${{matrix.platform}}-${{matrix.version}} 139 | path: artifact/* 140 | if-no-files-found: error 141 | 142 | #- name: Delete old workflow 143 | # uses: Mattraks/delete-workflow-runs@v2 144 | # with: 145 | # retain_days: 1 146 | # keep_minimum_runs: 3 147 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /serialnumbergen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # form https://github.com/pocopico/tinycore-redpill/blob/main/serialnumbergen.sh 4 | 5 | function beginArray() { 6 | 7 | case $1 in 8 | DS3615xs) 9 | permanent="LWN" 10 | serialstart="1130 1230 1330 1430" 11 | ;; 12 | DS3617xs) 13 | permanent="ODN" 14 | serialstart="1130 1230 1330 1430" 15 | ;; 16 | DS916+) 17 | permanent="NZN" 18 | serialstart="1130 1230 1330 1430" 19 | ;; 20 | DS918+) 21 | permanent="PDN" 22 | serialstart="1780 1790 1860 1980" 23 | ;; 24 | DS920+) 25 | permanent="SBR" 26 | serialstart="2030 2040 20C0 2150" 27 | ;; 28 | DS3622xs+) 29 | permanent="SQR" 30 | serialstart="2030 2040 20C0 2150" 31 | ;; 32 | DS1621+) 33 | permanent="S7R" 34 | serialstart="2080" 35 | ;; 36 | FS6400) 37 | permanent="PSN" 38 | serialstart="1960" 39 | ;; 40 | FS2500) 41 | permanent="PSN" 42 | serialstart="1960" 43 | ;; 44 | RS3413xs+) 45 | permanent="LWN" 46 | serialstart="1130 1230 1330 1430" 47 | ;; 48 | DVA3219) 49 | permanent="RFR" 50 | serialstart="1930 1940" 51 | ;; 52 | DVA3221) 53 | permanent="SJR" 54 | serialstart="2030 2040 20C0 2150" 55 | ;; 56 | DVA1622) 57 | permanent="UBR" 58 | serialstart="2030 2040 20C0 2150" 59 | ;; 60 | DS2422+) 61 | permanent="S7R" 62 | serialstart="2080" 63 | ;; 64 | RS4021xs+) 65 | permanent="T2R" 66 | serialstart="2250" 67 | ;; 68 | DS923+) 69 | permanent="TQR" 70 | serialstart="2270" 71 | ;; 72 | DS1522+) 73 | permanent="TRR" 74 | serialstart="2270" 75 | ;; 76 | SA6400) 77 | permanent="TQR" 78 | serialstart="2270" 79 | ;; 80 | DS1019+) 81 | permanent="QXR" 82 | serialstart="1850" 83 | ;; 84 | DS1521+) 85 | permanent="RYR" 86 | serialstart="2060" 87 | ;; 88 | DS1621xs+) 89 | permanent="S7R" 90 | serialstart="2080" 91 | ;; 92 | DS723+) 93 | permanent="TQR" 94 | serialstart="2270" 95 | ;; 96 | 97 | esac 98 | 99 | } 100 | 101 | function random() { 102 | printf "%06d" $(($RANDOM % 30000 + 1)) 103 | } 104 | function randomhex() { 105 | val=$(($RANDOM % 255 + 1)) 106 | echo "obase=16; $val" | bc 107 | } 108 | 109 | function generateRandomLetter() { 110 | 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; do 111 | echo $i 112 | done | sort -R | tail -1 113 | } 114 | 115 | function generateRandomValue() { 116 | 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; do 117 | echo $i 118 | done | sort -R | tail -1 119 | } 120 | 121 | function toupper() { 122 | 123 | echo $1 | tr '[:lower:]' '[:upper:]' 124 | 125 | } 126 | 127 | function generateMacAddress() { 128 | 129 | #toupper "Mac Address: 00:11:32:$(randomhex):$(randomhex):$(randomhex)" 130 | if [ "$1" = "DS923+" ] || [ "$1" = "DS1522+" ] || [ "$1" = "RS4021xs+" ]; then 131 | # DS1522+ and DS923+ Mac starts with 90:09:d0 132 | printf '90:09:d0:%02X:%02X:%02X' $((RANDOM % 256)) $((RANDOM % 256)) $((RANDOM % 256)) 133 | else 134 | printf '00:11:32:%02X:%02X:%02X' $((RANDOM % 256)) $((RANDOM % 256)) $((RANDOM % 256)) 135 | fi 136 | 137 | } 138 | 139 | function generateSerial() { 140 | 141 | beginArray $1 142 | 143 | case $1 in 144 | 145 | DS3615xs) 146 | serialnum="$(echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1)$permanent"$(random) 147 | ;; 148 | DS3617xs) 149 | serialnum="$(echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1)$permanent"$(random) 150 | ;; 151 | DS916+) 152 | serialnum="$(echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1)$permanent"$(random) 153 | ;; 154 | DS918+) 155 | serialnum="$(echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1)$permanent"$(random) 156 | ;; 157 | FS6400) 158 | serialnum="$(echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1)$permanent"$(random) 159 | ;; 160 | FS2500) 161 | serialnum="$(echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1)$permanent"$(random) 162 | ;; 163 | RS3413xs+) 164 | serialnum="$(echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1)$permanent"$(random) 165 | ;; 166 | DS920+) 167 | serialnum=$(toupper "$(echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1)$permanent"$(generateRandomLetter)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomLetter)) 168 | ;; 169 | DS3622xs+) 170 | serialnum=$(toupper "$(echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1)$permanent"$(generateRandomLetter)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomLetter)) 171 | ;; 172 | DS1621+) 173 | serialnum=$(toupper "$(echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1)$permanent"$(generateRandomLetter)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomLetter)) 174 | ;; 175 | DVA3219) 176 | serialnum=$(toupper "$(echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1)$permanent"$(generateRandomLetter)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomLetter)) 177 | ;; 178 | DVA3221) 179 | serialnum=$(toupper "$(echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1)$permanent"$(generateRandomLetter)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomLetter)) 180 | ;; 181 | DVA1622) 182 | serialnum=$(toupper "$(echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1)$permanent"$(generateRandomLetter)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomLetter)) 183 | ;; 184 | DS2422+) 185 | serialnum=$(toupper "$(echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1)$permanent"$(generateRandomLetter)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomLetter)) 186 | ;; 187 | RS4021xs+) 188 | serialnum=$(toupper "$(echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1)$permanent"$(generateRandomLetter)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomLetter)) 189 | ;; 190 | DS923+) 191 | serialnum=$(toupper "$(echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1)$permanent"$(generateRandomLetter)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomLetter)) 192 | ;; 193 | DS1522+) 194 | serialnum=$(toupper "$(echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1)$permanent"$(generateRandomLetter)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomLetter)) 195 | ;; 196 | SA6400) 197 | serialnum=$(toupper "$(echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1)$permanent"$(generateRandomLetter)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomLetter)) 198 | ;; 199 | DS1019+) 200 | serialnum=$(toupper "$(echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1)$permanent"$(generateRandomLetter)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomLetter)) 201 | ;; 202 | DS1520+) 203 | serialnum=$(toupper "$(echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1)$permanent"$(generateRandomLetter)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomLetter)) 204 | ;; 205 | DS1621xs+) 206 | serialnum=$(toupper "$(echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1)$permanent"$(generateRandomLetter)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomLetter)) 207 | ;; 208 | DS723+) 209 | serialnum=$(toupper "$(echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1)$permanent"$(generateRandomLetter)$(generateRandomLetter)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomValue)$(generateRandomLetter)) 210 | ;; 211 | 212 | esac 213 | 214 | echo $serialnum 215 | 216 | } 217 | 218 | function showhelp() { 219 | 220 | cat < 225 | 226 | Available platforms : 227 | ---------------------------------------------------------------------------------------- 228 | DS3615xs DS3617xs DS916+ DS918+ DS920+ DS3622xs+ FS6400 DVA3219 DVA3221 DS1621+ DVA1622 229 | DS2422+ RS4021xs+ DS923+ DS1522+ SA6400 FS2500 RS3413xs+ DS1019+ DS1520+ DS1621xs+ DS723+ 230 | 231 | e.g. $(basename ${0}) DS3615xs 232 | ---------------------------------------------------------------------------------------- 233 | EOF 234 | 235 | } 236 | 237 | if [ -z "$1" ]; then 238 | showhelp 239 | else 240 | if [ "$1" = "DS3615xs" ] || [ "$1" = "DS3617xs" ] || [ "$1" = "DS916+" ] || [ "$1" = "DS918+" ] || [ "$1" = "DS920+" ] || 241 | [ "$1" = "DS3622xsp" ] || [ "$1" = "FS6400" ] || [ "$1" = "DVA3219" ] || [ "$1" = "DVA3221" ] || [ "$1" = "DS1621+" ] || 242 | [ "$1" = "DVA1622" ] || [ "$1" = "RS4021xs+" ] || [ "$1" = "DS923+" ] || [ "$1" = "DS1522+" ] || [ "$1" = "SA6400" ] || 243 | [ "$1" = "FS2500" ] || [ "$1" = "RS3413xs+" ] || [ "$1" = "DS1019+" ] || [ "$1" = "DS1520+" ] || [ "$1" = "DS1621xs+" ] || 244 | [ "$1" = "DS723+" ] \ 245 | ; then 246 | echo "Generating a random mac address : " $(generateMacAddress $1) 247 | echo "Generating a Serial Number for Model $1: " $(generateSerial $1) 248 | else 249 | echo "Error : $1 is not an available model for serial number generation. " 250 | echo "Available Models : DS3615xs DS3617xs DS916+ DS918+ DS920+ DS3622xsp DVA3219 DVA3221 DS1621+ DVA1622" 251 | fi 252 | fi 253 | -------------------------------------------------------------------------------- /.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 | 11 | type_VM: 12 | description: 'Q35 or i440fx type of VM in Unraid' 13 | required: true 14 | default: i440fx 15 | type: choice 16 | options: 17 | - Q35 18 | - i440fx 19 | 20 | jobs: 21 | build: 22 | runs-on: ubuntu-latest 23 | name: 编译 "${{matrix.platform}} ${{matrix.version}}" 24 | strategy: 25 | fail-fast: false 26 | matrix: 27 | include: 28 | # 两行一组,删除不需要的版本 29 | #- platform: ds1621p 30 | # version: 7.0.1-42218 31 | #- platform: ds1621p 32 | # version: 7.1.0-42661 33 | 34 | #- platform: ds2422p 35 | # version: 7.0.1-42218 36 | 37 | #- platform: ds3615xs 38 | # version: 6.2.4-25556 39 | #- platform: ds3615xs 40 | # version: 7.0.1-42218 41 | - platform: ds3615xs 42 | version: 7.1.0-42661 43 | 44 | #- platform: ds3617xs 45 | # version: 7.0.1-42218 46 | #- platform: ds3617xs 47 | # version: 7.1.0-42661 48 | 49 | #- platform: ds3622xsp 50 | # version: 7.0.1-42218 51 | #- platform: ds3622xsp 52 | # version: 7.1.0-42661 53 | 54 | #- platform: ds918p 55 | # version: 6.2.4-25556 56 | #- platform: ds918p 57 | # version: 7.0.1-42218 58 | - platform: ds918p 59 | version: 7.1.0-42661 60 | 61 | #- platform: ds920p 62 | # version: 7.0.1-42218 63 | - platform: ds920p 64 | version: 7.1.0-42661 65 | 66 | # - platform: dva3221 67 | # version: 7.0.1-42218 68 | - platform: dva3221 69 | version: 7.1.0-42661 70 | 71 | - platform: dva1622 72 | version: 7.1.0-42661 73 | 74 | steps: 75 | - name: 检出项目文件 76 | uses: actions/checkout@v3 77 | 78 | # https://github.com/marketplace/actions/substring-action substract version for dtb folder 79 | - name: 获得Subversion 80 | uses: bhowell2/github-substring-action@v1 81 | id: subver 82 | with: 83 | value: ${{matrix.version}} 84 | index_of_str: "-" 85 | 86 | - name: 缓存加速 87 | uses: actions/cache@v3 88 | with: 89 | path: | 90 | cache/*.pat 91 | cache/*.org 92 | docker/downloads/*.txz 93 | key: ${{matrix.platform}}-${{matrix.version}}-${{ hashFiles('global_config.json') }} 94 | restore-keys: ${{matrix.platform}}-${{matrix.version}}- 95 | 96 | - name: 清理缓存 97 | if: "${{ github.event.inputs.clean_cache == 'true' }}" 98 | run: | 99 | rm -rf cache/*.pat 100 | rm -rf cache/*.org 101 | rm -rf docker/downloads/*.txz 102 | 103 | # 第一个盘为虚拟的SATA盘。 104 | - name: Variable 105 | id: var 106 | run: | 107 | case ${{ github.event.inputs.type_VM }} in 108 | Q35) 109 | _SataPM="6" 110 | _DiskIM="00" 111 | _dtbValue="00:1f.2" 112 | ;; 113 | i440fx) 114 | _SataPM="62" 115 | _DiskIM="0002" 116 | _dtbValue="00:04.0" 117 | ;; 118 | *) 119 | echo "Wrong type of VM" 120 | ;; 121 | esac 122 | 123 | echo "SataPM=$_SataPM" >> $GITHUB_OUTPUT 124 | echo "DiskIM=$_DiskIM" >> $GITHUB_OUTPUT 125 | echo "dtbValue=$_dtbValue" >> $GITHUB_OUTPUT 126 | 127 | - name: 准备构建环境 128 | run: | 129 | ./redpill_tool_chain.sh build ${{matrix.platform}}-${{matrix.version}} 130 | 131 | - name: 配置引导镜像 132 | run: | 133 | cp sample_user_config.json ${{matrix.platform}}_user_config.json 134 | 135 | # 调整VID和PID 136 | # sed -i -e 's/0x0001/0x88AA/g' -e 's/0x46f4/0x88AA/g' ${{matrix.platform}}_user_config.json 137 | 138 | # 调整SN和MAC,最好使用 actions secrets 引入,SN应该是固定值不应该每次生成 139 | sn=`./redpill_tool_chain.sh sn ${{matrix.platform}} | grep 'Serial Number' | awk '{print $3}'` 140 | sed -i -e "s/1234XXX123/${sn:="1130LWN123456"}/g" -e 's/XXYYXXYYXXYY/0011323D47F7/g' ${{matrix.platform}}_user_config.json 141 | 142 | # 添加第二张网卡mac并设置网卡数量 143 | sed -i -e 's/0011323D47F7"/&,\n\t"mac2": "0011323D47F8",\n\t"SasIdxMap": "0",\n\t"SataPortMap": "${{ steps.var.outputs.SataPM }}",\n\t"DiskIdxMap": "${{ steps.var.outputs.DiskIM }}",\n\t"netif_num": 2/g' ${{matrix.platform}}_user_config.json 144 | 145 | # 调整synoinfo 146 | sed -i -e 's/"synoinfo": {},/"synoinfo": {\n\t"maxlanport": "2"\n },/g' ${{matrix.platform}}_user_config.json 147 | cat ${{matrix.platform}}_user_config.json 148 | 149 | - name: 添加扩展驱动 150 | if: matrix.platform != 'dva3221' 151 | run: | 152 | ./redpill_tool_chain.sh add https://github.com/jinlife/redpill-tool-chain/raw/master/extensions/redpill-boot-wait.json 153 | ./redpill_tool_chain.sh add https://raw.githubusercontent.com/pocopico/redpill-load/master/redpill-acpid/rpext-index.json 154 | ./redpill_tool_chain.sh add https://raw.githubusercontent.com/pocopico/redpill-load/master/redpill-virtio/rpext-index.json 155 | 156 | - name: 添加扩展驱动[r8125] 157 | if: matrix.platform != 'ds920p' && matrix.platform != 'ds918p' 158 | run: | 159 | ./redpill_tool_chain.sh add https://raw.githubusercontent.com/pocopico/rp-ext/master/r8125/rpext-index.json 160 | 161 | - name: 添加扩展驱动[r8125 and r8152] 162 | if: matrix.platform == 'ds920p' || matrix.platform == 'ds918p' 163 | run: | 164 | ./redpill_tool_chain.sh add https://github.com/jinlife/redpill-tool-chain/raw/master/extensions/pocopico-r8125.json 165 | ./redpill_tool_chain.sh add https://github.com/jinlife/redpill-tool-chain/raw/master/extensions/pocopico-r8152.json 166 | 167 | - name: 添加扩展驱动[dva3221] 168 | if: matrix.platform == 'dva3221' 169 | run: | 170 | echo '等待整理兼容性扩展~😀' 171 | ./redpill_tool_chain.sh add https://github.com/jinlife/redpill-tool-chain/raw/master/extensions/redpill-boot-wait.json 172 | 173 | - name: 添加 Misc shell 174 | run: | 175 | ./redpill_tool_chain.sh add https://raw.githubusercontent.com/pocopico/redpill-load/master/redpill-misc/rpext-index.json 176 | 177 | - name: 添加 jumkey.dtb !!!Create your own device tree binary!!! 178 | if: matrix.platform == 'ds920p' || matrix.platform == 'ds1621p' || matrix.platform == 'ds2422p' 179 | run: | 180 | #./redpill_tool_chain.sh add https://github.com/jinlife/redpill-tool-chain/raw/master/extensions/redpill-dtb.json 181 | ./redpill_tool_chain.sh add https://raw.githubusercontent.com/pocopico/redpill-load/develop/redpill-dtb/rpext-index.json 182 | echo '!!!Create your own device tree binary!!!' 183 | echo 'see https://github.com/jumkey/redpill-load/blob/develop/redpill-dtb/README.md' 184 | 185 | - name: 预处理PAT 186 | if: endsWith(matrix.version, '42661') && startsWith(matrix.platform, 'ds361') 187 | run: | 188 | sed -i 's/debian:8-slim/debian:10-slim/g' global_config.json 189 | ./redpill_tool_chain.sh build ${{matrix.platform}}-${{matrix.version}} 190 | ./redpill_tool_chain.sh pat ${{matrix.platform}}-${{matrix.version}} 191 | sed -i 's/debian:10-slim/debian:8-slim/g' global_config.json 192 | ./redpill_tool_chain.sh build ${{matrix.platform}}-${{matrix.version}} 193 | 194 | - name: 编译引导镜像 195 | run: | 196 | ./redpill_tool_chain.sh auto ${{matrix.platform}}-${{matrix.version}} 197 | 198 | #- name: Modify jumkey.dtb 199 | # if: matrix.platform == 'ds920p' || matrix.platform == 'ds1621p' || matrix.platform == 'ds2422p' 200 | # run: | 201 | # echo 'redpill-dtb-dir' 202 | # ls custom/extensions 203 | # cd custom/extensions/redpill-dtb/${{matrix.platform}}_${{steps.subver.outputs.substring}} 204 | # #cd custom/extensions/jumkey.dtb/${{matrix.platform}}_${{steps.subver.outputs.substring}} 205 | # sudo chmod -R 777 ./ 206 | # sudo chmod +x dtc 207 | # #ls 208 | # ./dtc -I dtb -O dts -o output.dts model_${{matrix.platform}}.dtb 209 | # # Jumkey "00:1e.0,01.0,07.0" pocopico "00:13.0,00.0" 210 | # sed -i -e 's/"00:1e.0,01.0,07.0"/"${{ steps.var.outputs.dtbValue }}"/g' output.dts 211 | # cat output.dts 212 | # rm -rf model_${{matrix.platform}}.dtb 213 | # ./dtc -I dts -O dtb -o model_${{matrix.platform}}.dtb output.dts 214 | # 215 | #- name: Build jumkey.dtb 216 | # if: matrix.platform == 'ds920p' || matrix.platform == 'ds1621p' || matrix.platform == 'ds2422p' 217 | # run: | 218 | # sudo rm -rfv images/redpill-*.img 219 | # sudo rm -rfv custom/extensions/redpill-boot-wait 220 | # sudo rm -rfv cache/* 221 | # ./redpill_tool_chain.sh auto ${{matrix.platform}}-${{matrix.version}} 222 | 223 | - name: 上传引导镜像到 github actions 224 | uses: actions/upload-artifact@v3 225 | with: 226 | name: dsm-${{matrix.platform}}-${{matrix.version}} 227 | path: images/redpill-*.img 228 | if-no-files-found: error 229 | 230 | - name: 删除旧的工作流 231 | uses: Mattraks/delete-workflow-runs@v2 232 | with: 233 | retain_days: 1 234 | keep_minimum_runs: 3 235 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | "id": "dva1622-7.1.0-42661", 503 | "platform_name": "DVA1622", 504 | "platform_version": "geminilake-7.1.0-42661", 505 | "user_config_json": "dva1622_user_config.json", 506 | "docker_base_image": "debian:10-slim", 507 | "compile_with": "toolkit_dev", 508 | "redpill_lkm_make_target": "dev-v7", 509 | "downloads": { 510 | "kernel": { 511 | "url": "https://sourceforge.net/projects/dsgpl/files/Synology%20NAS%20GPL%20Source/25426branch/bromolow-source/linux-3.10.x.txz/download", 512 | "sha256": "18aecead760526d652a731121d5b8eae5d6e45087efede0da057413af0b489ed" 513 | }, 514 | "toolkit_dev": { 515 | "url": "https://sourceforge.net/projects/dsgpl/files/toolkit/DSM7.0/ds.bromolow-7.0.dev.txz/download", 516 | "sha256": "a5fbc3019ae8787988c2e64191549bfc665a5a9a4cdddb5ee44c10a48ff96cdd" 517 | } 518 | }, 519 | "redpill_lkm": { 520 | "source_url": "https://github.com/pocopico/redpill-lkm.git", 521 | "branch": "master" 522 | }, 523 | "redpill_load": { 524 | "source_url": "https://github.com/pocopico/redpill-load.git", 525 | "branch": "develop" 526 | } 527 | } 528 | ] 529 | } 530 | --------------------------------------------------------------------------------