Skip to content

Commit

Permalink
调整制作流程
Browse files Browse the repository at this point in the history
  • Loading branch information
tossp committed Mar 10, 2022
1 parent f1f1fe4 commit 4ac26a8
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 86 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ jobs:
matrix:
include:
# 两行一组,删除不需要的版本
- platform: bromolow
- platform: ds3615xs
version: 6.2.4-25556
- platform: bromolow
- platform: ds3615xs
version: 7.0-41222
- platform: bromolow
- platform: ds3615xs
version: 7.0.1-42218
- platform: apollolake
- platform: ds918p
version: 6.2.4-25556
- platform: apollolake
- platform: ds918p
version: 7.0-41890
- platform: apollolake
- platform: ds918p
version: 7.0.1-42218
- platform: broadwell
- platform: ds3617xs
version: 7.0.1-42218
- platform: broadwellnk
- platform: ds3622xsp
version: 7.0.1-42218
- platform: geminilake
- platform: ds920p
version: 7.0.1-42218

steps:
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
./redpill_tool_chain.sh add https://github.com/jumkey/redpill-load/raw/develop/redpill-misc/rpext-index.json
- name: 添加 jumkey.dtb !!!Create your own device tree binary!!!
if: matrix.platform == 'geminilake'
if: matrix.platform == 'ds920p'
run: |
./redpill_tool_chain.sh add https://github.com/jumkey/redpill-load/raw/develop/redpill-dtb/rpext-index.json
echo '!!!Create your own device tree binary!!!'
Expand Down
37 changes: 15 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,30 +54,23 @@
- 安装 pocopico.mpt3sas : `./redpill_tool_chain.sh add https://raw.githubusercontent.com/pocopico/rp-ext/master/mpt3sas/rpext-index.json`
- 移除 pocopico.mpt3sas : `./redpill_tool_chain.sh del pocopico.mpt3sas`
- 安装 jumkey.dtb : `./redpill_tool_chain.sh add https://github.com/jumkey/redpill-load/raw/develop/redpill-dtb/rpext-index.json`
- 移除 jumkey.dtb : `./redpill_tool_chain.sh del jumkey.dtb`

[获取更多扩展驱动...](https://github.com/pocopico/rp-ext)

### 构建工具链镜像

- `./redpill_tool_chain.sh build bromolow-6.2.4-25556`
- `./redpill_tool_chain.sh build bromolow-7.0-41222`
- `./redpill_tool_chain.sh build apollolake-6.2.4-25556`
- `./redpill_tool_chain.sh build apollolake-7.0-41890`
- `./redpill_tool_chain.sh build ds3615xs-6.2.4-25556`
- `./redpill_tool_chain.sh build ds918p-7.0.1-42218`

### 制作 redpill 引导镜像

- `./redpill_tool_chain.sh auto bromolow-6.2.4-25556`
- `./redpill_tool_chain.sh auto bromolow-7.0-41222`
- `./redpill_tool_chain.sh auto apollolake-6.2.4-25556`
- `./redpill_tool_chain.sh auto apollolake-7.0-41890`
- `./redpill_tool_chain.sh auto ds3615xs-6.2.4-25556`
- `./redpill_tool_chain.sh auto ds918p-7.0.1-42218`

### Clean old redpill bootloader images and build cache

- `./redpill_tool_chain.sh clean bromolow-6.2.4-25556`
- `./redpill_tool_chain.sh clean bromolow-7.0-41222`
- `./redpill_tool_chain.sh clean apollolake-6.2.4-25556`
- `./redpill_tool_chain.sh clean apollolake-7.0-41890`
- `./redpill_tool_chain.sh clean ds3615xs-6.2.4-25556`
- `./redpill_tool_chain.sh clean ds918p-7.0.1-42218`
- `./redpill_tool_chain.sh clean all`

### 查看帮助文本
Expand Down Expand Up @@ -107,15 +100,15 @@ Actions: build, auto, run, clean
Available platform versions:
---------------------
bromolow-6.2.4-25556
bromolow-7.0-41222
bromolow-7.0.1-42218
apollolake-6.2.4-25556
apollolake-7.0-41890
apollolake-7.0.1-42218
broadwell-7.0.1-42218
broadwellnk-7.0.1-42218
geminilake-7.0.1-42218
ds3615xs-6.2.4-25556
ds3615xs-7.0-41222
ds3615xs-7.0.1-42218
ds918p-6.2.4-25556
ds918p-7.0-41890
ds918p-7.0.1-42218
ds3617xs-7.0.1-42218
ds3622xsp-7.0.1-42218
ds920p-7.0.1-42218
Custom Extensions:
---------------------
Expand Down
33 changes: 15 additions & 18 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,15 @@ Actions: build, auto, run, clean
Available platform versions:
---------------------
bromolow-6.2.4-25556
bromolow-7.0-41222
bromolow-7.0.1-42218
apollolake-6.2.4-25556
apollolake-7.0-41890
apollolake-7.0.1-42218
ds3615xs-6.2.4-25556
ds3615xs-7.0-41222
ds3615xs-7.0.1-42218
ds918p-6.2.4-25556
ds918p-7.0-41890
ds918p-7.0.1-42218
ds3617xs-7.0.1-42218
ds3622xsp-7.0.1-42218
ds920p-7.0.1-42218
Custom Extensions:
---------------------
Expand All @@ -102,22 +105,16 @@ thethorgroup.virtio

### Build toolchain image

- For Bromolow 6.2.4 : `./redpill_tool_chain.sh build bromolow-6.2.4-25556`
- For Bromolow 7.0 : `./redpill_tool_chain.sh build bromolow-7.0-41222`
- For Apollolake 6.2.4 : `./redpill_tool_chain.sh build apollolake-6.2.4-25556`
- For Apollolake 7.0 : `./redpill_tool_chain.sh build apollolake-7.0-41890`
- For Bromolow 6.2.4 : `./redpill_tool_chain.sh build ds3615xs-6.2.4-25556`
- For Apollolake 7.0 : `./redpill_tool_chain.sh build ds918p-7.0-41890`

### Create redpill bootloader image

- For Bromolow 6.2.4 : `./redpill_tool_chain.sh auto bromolow-6.2.4-25556`
- For Bromolow 7.0 : `./redpill_tool_chain.sh auto bromolow-7.0-41222`
- For Apollolake 6.2.4 : `./redpill_tool_chain.sh auto apollolake-6.2.4-25556`
- For Apollolake 7.0 : `./redpill_tool_chain.sh auto apollolake-7.0-41890`
- For Bromolow 6.2.4 : `./redpill_tool_chain.sh auto ds3615xs-6.2.4-25556`
- For Apollolake 7.0 : `./redpill_tool_chain.sh auto ds918p-7.0-41890`

### Clean old redpill bootloader images and build cache

- For Bromolow 6.2.4 : `./redpill_tool_chain.sh clean bromolow-6.2.4-25556`
- For Bromolow 7.0 : `./redpill_tool_chain.sh clean bromolow-7.0-41222`
- For Apollolake 6.2.4 : `./redpill_tool_chain.sh clean apollolake-6.2.4-25556`
- For Apollolake 7.0 : `./redpill_tool_chain.sh clean apollolake-7.0-41890`
- For Bromolow 6.2.4 : `./redpill_tool_chain.sh clean ds3615xs-6.2.4-25556`
- For Apollolake 7.0 : `./redpill_tool_chain.sh clean ds918p-7.0-41890`
- For all : `./redpill_tool_chain.sh clean all`
4 changes: 3 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ ARG REDPILL_LOAD_SRC=/opt/redpill-load
RUN git clone ${REDPILL_LKM_REPO} -b ${REDPILL_LKM_BRANCH} ${REDPILL_LKM_SRC} && \
git clone ${REDPILL_LOAD_REPO} -b ${REDPILL_LOAD_BRANCH} ${REDPILL_LOAD_SRC}

ARG TARGET_NAME
ARG TARGET_PLATFORM
ARG TARGET_VERSION
ARG DSM_VERSION
Expand All @@ -43,6 +44,7 @@ ENV ARCH=x86_64 \
LINUX_SRC=/opt/${COMPILE_WITH}-${TARGET_PLATFORM}-${TARGET_VERSION}-${TARGET_REVISION} \
REDPILL_LKM_SRC=${REDPILL_LKM_SRC} \
REDPILL_LOAD_SRC=${REDPILL_LOAD_SRC} \
TARGET_NAME=${TARGET_NAME} \
TARGET_PLATFORM=${TARGET_PLATFORM} \
TARGET_VERSION=${TARGET_VERSION} \
TARGET_REVISION=${TARGET_REVISION} \
Expand All @@ -51,7 +53,7 @@ ENV ARCH=x86_64 \
ARG EXTRACTED_KSRC
COPY --from=extract ${EXTRACTED_KSRC} ${LINUX_SRC}

RUN if [ "apollolake" = "$TARGET_PLATFORM" ]; then echo '+' > ${LINUX_SRC}/.scmversion; fi && \
RUN if [ "apollolake" = "$TARGET_PLATFORM" ] || [ "broadwellnk" = "$TARGET_PLATFORM" ] || [ "geminilake" = "$TARGET_PLATFORM" ]; then echo '+' > ${LINUX_SRC}/.scmversion; fi && \
if [ "$COMPILE_WITH" = "kernel" ]; then \
cp ${LINUX_SRC}/synoconfigs/${TARGET_PLATFORM} ${LINUX_SRC}/.config && \
make -C ${LINUX_SRC} oldconfig && \
Expand Down
22 changes: 2 additions & 20 deletions docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export REDPILL_LKM_MAKE_TARGET := ${REDPILL_LKM_MAKE_TARGET}
export TARGET_PLATFORM := ${TARGET_PLATFORM}
export TARGET_VERSION := ${TARGET_VERSION}
export TARGET_REVISION := ${TARGET_REVISION}
export TARGET_NAME := ${TARGET_NAME}
export LINUX_SRC := ${LINUX_SRC}

.PHONY: all
Expand All @@ -32,26 +33,7 @@ build_redpill_load:
echo "#############################################"
@read -a KVERS <<< "$$(modinfo --field=vermagic redpill-lkm/redpill.ko)" && \
cp -f $(REDPILL_LKM_SRC)/redpill.ko $(REDPILL_LOAD_SRC)/ext/rp-lkm/redpill-linux-v$${KVERS[0]}.ko
@if [ "$(TARGET_PLATFORM)" == "bromolow" ]; then \
pushd $(REDPILL_LOAD_SRC) && \
./build-loader.sh 'DS3615xs' '$(TARGET_VERSION)-$(TARGET_REVISION)'; \
fi
@if [ "$(TARGET_PLATFORM)" == "apollolake" ]; then \
pushd $(REDPILL_LOAD_SRC) && \
./build-loader.sh 'DS918+' '$(TARGET_VERSION)-$(TARGET_REVISION)'; \
fi
@if [ "$(TARGET_PLATFORM)" == "broadwell" ]; then \
pushd $(REDPILL_LOAD_SRC) && \
./build-loader.sh 'DS3617xs' '$(TARGET_VERSION)-$(TARGET_REVISION)'; \
fi
@if [ "$(TARGET_PLATFORM)" == "broadwellnk" ]; then \
pushd $(REDPILL_LOAD_SRC) && \
./build-loader.sh 'DS3622xs+' '$(TARGET_VERSION)-$(TARGET_REVISION)'; \
fi
@if [ "$(TARGET_PLATFORM)" == "geminilake" ]; then \
pushd $(REDPILL_LOAD_SRC) && \
./build-loader.sh 'DS920+' '$(TARGET_VERSION)-$(TARGET_REVISION)'; \
fi
pushd $(REDPILL_LOAD_SRC) && ./build-loader.sh '$(TARGET_NAME)' '$(TARGET_VERSION)-$(TARGET_REVISION)'

.PHONY: build_all
build_all: build_redpill_lkm build_redpill_load
Expand Down
27 changes: 18 additions & 9 deletions global_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
},
"build_configs": [
{
"id": "bromolow-6.2.4-25556",
"id": "ds3615xs-6.2.4-25556",
"platform_name": "DS3615xs",
"platform_version": "bromolow-6.2.4-25556",
"user_config_json": "bromolow_user_config.json",
"docker_base_image": "debian:8-slim",
Expand All @@ -46,7 +47,8 @@
}
},
{
"id": "bromolow-7.0-41222",
"id": "ds3615xs-7.0-41222",
"platform_name": "DS3615xs",
"platform_version": "bromolow-7.0-41222",
"user_config_json": "bromolow_user_config.json",
"docker_base_image": "debian:8-slim",
Expand All @@ -72,7 +74,8 @@
}
},
{
"id": "bromolow-7.0.1-42218",
"id": "ds3615xs-7.0.1-42218",
"platform_name": "DS3615xs",
"platform_version": "bromolow-7.0.1-42218",
"user_config_json": "bromolow_user_config.json",
"docker_base_image": "debian:8-slim",
Expand All @@ -98,7 +101,8 @@
}
},
{
"id": "apollolake-6.2.4-25556",
"id": "ds918p-6.2.4-25556",
"platform_name": "DS918+",
"platform_version": "apollolake-6.2.4-25556",
"user_config_json": "apollolake_user_config.json",
"docker_base_image": "debian:8-slim",
Expand All @@ -124,7 +128,8 @@
}
},
{
"id": "apollolake-7.0-41890",
"id": "ds918p-7.0-41890",
"platform_name": "DS918+",
"platform_version": "apollolake-7.0-41890",
"user_config_json": "apollolake_user_config.json",
"docker_base_image": "debian:10-slim",
Expand All @@ -150,7 +155,8 @@
}
},
{
"id": "apollolake-7.0.1-42218",
"id": "ds918p-7.0.1-42218",
"platform_name": "DS918+",
"platform_version": "apollolake-7.0.1-42218",
"user_config_json": "apollolake_user_config.json",
"docker_base_image": "debian:10-slim",
Expand All @@ -176,7 +182,8 @@
}
},
{
"id": "broadwell-7.0.1-42218",
"id": "ds3617xs-7.0.1-42218",
"platform_name": "DS3617xs",
"platform_version": "broadwell-7.0.1-42218",
"user_config_json": "broadwell_user_config.json",
"docker_base_image": "debian:8-slim",
Expand All @@ -202,7 +209,8 @@
}
},
{
"id": "broadwellnk-7.0.1-42218",
"id": "ds3622xsp-7.0.1-42218",
"platform_name": "DS3622xs+",
"platform_version": "broadwellnk-7.0.1-42218",
"user_config_json": "broadwellnk_user_config.json",
"docker_base_image": "debian:10-slim",
Expand All @@ -228,7 +236,8 @@
}
},
{
"id": "geminilake-7.0.1-42218",
"id": "ds920p-7.0.1-42218",
"platform_name": "DS920+",
"platform_version": "geminilake-7.0.1-42218",
"user_config_json": "geminilake_user_config.json",
"docker_base_image": "debian:10-slim",
Expand Down
16 changes: 10 additions & 6 deletions redpill_tool_chain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@ function buildImage(){
--build-arg REDPILL_LKM_BRANCH="${REDPILL_LKM_BRANCH}" \
--build-arg REDPILL_LOAD_REPO="${REDPILL_LOAD_REPO}" \
--build-arg REDPILL_LOAD_BRANCH="${REDPILL_LOAD_BRANCH}" \
--build-arg TARGET_NAME="${TARGET_NAME}" \
--build-arg TARGET_PLATFORM="${TARGET_PLATFORM}" \
--build-arg TARGET_VERSION="${TARGET_VERSION}" \
--build-arg DSM_VERSION="${DSM_VERSION}" \
--build-arg TARGET_REVISION="${TARGET_REVISION}" \
--build-arg REDPILL_LKM_MAKE_TARGET=${REDPILL_LKM_MAKE_TARGET} \
--tag ${DOCKER_IMAGE_NAME}:${TARGET_PLATFORM}-${TARGET_VERSION}-${TARGET_REVISION} ./docker
--tag ${DOCKER_IMAGE_NAME}:${ID} ./docker
}

function clean(){
Expand All @@ -59,8 +60,8 @@ function clean(){
OLD_IMAGES=$(docker image ls --filter label=redpill-tool-chain --quiet $( [ "${CLEAN_IMAGES}" == "orphaned" ] && echo "--filter dangling=true"))
docker builder prune --all --filter label=redpill-tool-chain --force
else
OLD_IMAGES=$(docker image ls --filter label=redpill-tool-chain=${TARGET_PLATFORM}-${TARGET_VERSION}-${TARGET_REVISION} --quiet --filter dangling=true)
docker builder prune --filter label=redpill-tool-chain=${TARGET_PLATFORM}-${TARGET_VERSION}-${TARGET_REVISION} --force
OLD_IMAGES=$(docker image ls --filter label=redpill-tool-chain=${ID} --quiet --filter dangling=true)
docker builder prune --filter label=redpill-tool-chain=${ID} --force
fi
if [ ! -z "${OLD_IMAGES}" ]; then
docker image rm ${OLD_IMAGES}
Expand All @@ -75,6 +76,7 @@ function runContainer(){
local CMD=${1}
if [ ! -e $(realpath "${USER_CONFIG_JSON}") ]; then
echo "user config does not exist: ${USER_CONFIG_JSON}"
echo "run 'cp sample_user_config.json ${USER_CONFIG_JSON}' and edit '${USER_CONFIG_JSON}'."
exit 1
fi
if [[ "${LOCAL_RP_LKM_USE}" == "true" && ! -e $(realpath "${LOCAL_RP_LKM_PATH}") ]]; then
Expand Down Expand Up @@ -109,12 +111,13 @@ function runContainer(){
--volume ${REDPILL_LOAD_IMAGES}:/opt/redpill-load/images \
--env REDPILL_LKM_MAKE_TARGET=${REDPILL_LKM_MAKE_TARGET} \
--env TARGET_PLATFORM="${TARGET_PLATFORM}" \
--env TARGET_NAME="${TARGET_NAME}" \
--env TARGET_VERSION="${TARGET_VERSION}" \
--env DSM_VERSION="${DSM_VERSION}" \
--env REVISION="${TARGET_REVISION}" \
--env LOCAL_RP_LKM_USE="${LOCAL_RP_LKM_USE}" \
--env LOCAL_RP_LOAD_USE="${LOCAL_RP_LOAD_USE}" \
${DOCKER_IMAGE_NAME}:${TARGET_PLATFORM}-${TARGET_VERSION}-${TARGET_REVISION} $( [ "${CMD}" == "run" ] && echo "/bin/bash")
${DOCKER_IMAGE_NAME}:${ID} $( [ "${CMD}" == "run" ] && echo "/bin/bash")
}

function __ext_add(){
Expand Down Expand Up @@ -288,6 +291,7 @@ if [[ "${ACTION}" != "del" && "${ACTION}" != "add" && "${ID}" != "all" ]]; then
TARGET_VERSION=$(getValueByJsonPath ".platform_version | split(\"-\")[1]" "${BUILD_CONFIG}")
DSM_VERSION=$(getValueByJsonPath ".platform_version | split(\"-\")[1][0:3]" "${BUILD_CONFIG}")
TARGET_REVISION=$(getValueByJsonPath ".platform_version | split(\"-\")[2]" "${BUILD_CONFIG}")
TARGET_NAME=$(getValueByJsonPath ".platform_name" "${BUILD_CONFIG}")
USER_CONFIG_JSON=$(getValueByJsonPath ".user_config_json" "${BUILD_CONFIG}")
DOCKER_BASE_IMAGE=$(getValueByJsonPath ".docker_base_image" "${BUILD_CONFIG}")
COMPILE_WITH=$(getValueByJsonPath ".compile_with" "${BUILD_CONFIG}")
Expand All @@ -303,7 +307,7 @@ if [[ "${ACTION}" != "del" && "${ACTION}" != "add" && "${ID}" != "all" ]]; then
REDPILL_LOAD_REPO=$(getValueByJsonPath ".redpill_load.source_url" "${BUILD_CONFIG}")
REDPILL_LOAD_BRANCH=$(getValueByJsonPath ".redpill_load.branch" "${BUILD_CONFIG}")

EXTRACTED_KSRC='/linux*'
EXTRACTED_KSRC="/${TARGET_PLATFORM}.linux*"
if [ "${COMPILE_WITH}" == "toolkit_dev" ]; then
EXTRACTED_KSRC="/usr/local/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/sys-root/usr/lib/modules/DSM-${DSM_VERSION}/build/"
fi
Expand All @@ -322,7 +326,7 @@ case "${ACTION}" in
exit 1
;;
build) if [ "${COMPILE_WITH}" == "kernel" ];then
downloadFromUrlIfNotExists "${KERNEL_DOWNLOAD_URL}" "${DOWNLOAD_FOLDER}/${KERNEL_FILENAME}" "Kernel"
downloadFromUrlIfNotExists "${KERNEL_DOWNLOAD_URL}" "${DOWNLOAD_FOLDER}/${TARGET_PLATFORM}.${KERNEL_FILENAME}" "Kernel"
else
downloadFromUrlIfNotExists "${TOOLKIT_DEV_DOWNLOAD_URL}" "${DOWNLOAD_FOLDER}/${TOOLKIT_DEV_FILENAME}" "Toolkit Dev"
fi
Expand Down

0 comments on commit 4ac26a8

Please sign in to comment.