redpill-tool-chain/README_EN.md

150 lines
7.4 KiB
Markdown
Raw Normal View History

2021-08-09 13:56:07 +00:00
# RedPill Tool Chain
2022-03-10 22:02:38 +00:00
[![构建](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)
2021-08-09 13:56:07 +00:00
[中文说明](README.md "English")
THX @haydibe
2021-10-23 20:01:29 +00:00
## Inofficial redpill toolchain image builder
2021-08-13 14:36:17 +00:00
- Creates a OCI Container (~= Docker) image based tool chain.
- Takes care of downloading (and caching) the required sources to compile redpill.ko and the required os packages that the build process depends on.
- Caches .pat downloads inside the container on the host.
2021-09-05 01:17:53 +00:00
- Configuration is done in the JSON file `global_config.json`; custom <platform_version> entries can be added underneath the `building_configs` block. Make sure the id is unique per block!
2021-09-08 12:38:08 +00:00
- Supports a `user_config.json` per <platform_version>
2021-10-11 16:29:44 +00:00
- 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"`)
2021-09-08 12:38:08 +00:00
- 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"`)
- Supports to clean old image versions and the build cache per <platform_version> or for `all` of them at once.
- Supports to auto clean old image versions and the build cache for the current build image, set `"docker.auto_clean":`to `"true"`.
2021-09-15 15:33:46 +00:00
- Allows to configure if the build cache is used or not ("docker.use_build_cache")
- Allows to specify if "clean all" should delete all or only orphaned images.
2021-09-22 17:22:58 +00:00
- The default `global_config.json` contains platform versions provided by the official redpill-load image. Please create new <platform_version> and point them to custom repositories if wanted.
2021-10-23 20:01:29 +00:00
- Supports to add custom mounts (set`"docker.use_custom_bind_mounts":` to `"true"` and add your custom bind-mounts in `"docker.custom_bind_mounts"`).
2021-09-22 19:24:19 +00:00
- Performs integrity check of required kernel/toolkit-dev required for the image build
2021-10-23 20:01:29 +00:00
- Supports the make target to specify the redpill.ko build configuration. Set `<platform version>.redpill_lkm_make_target` to `dev-v6`, `dev-v7`, `test-v6`, `test-v7`, `prod-v6` or `prod-v7`.
2021-09-22 19:24:19 +00:00
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.
- dev: all symbols included, debug messages included
- test: fully stripped with only warning & above (no debugs or info)
- prod: fully stripped with no debug messages
2021-08-13 14:36:17 +00:00
## Changes
2021-10-23 20:01:29 +00:00
2021-09-22 19:24:19 +00:00
- added the additionaly required make target when building redpill.ko
2021-10-23 20:01:29 +00:00
- added a new configuration item in `<platform version>.redpill_lkm_make_target` to set the build target
2021-08-09 13:56:07 +00:00
2021-08-13 14:36:17 +00:00
## Usage
2021-08-09 13:56:07 +00:00
2021-10-23 20:01:29 +00:00
1. Edit `<platform>_user_config.json` that matches your <platform_version> according [redpill-load](https://github.com/RedPill-TTG/redpill-load) and place it in the same folder as redpill_tool_chain.sh
2021-08-13 14:36:17 +00:00
2. Build the image for the platform and version you want:
2021-09-05 01:17:53 +00:00
`./redpill_tool_chain.sh build <platform_version>`
2021-08-13 14:36:17 +00:00
3. Run the image for the platform and version you want:
2021-09-05 01:17:53 +00:00
`./redpill_tool_chain.sh auto <platform_version>`
You can always use `./redpill_tool_chain.sh run <platform_version>` to get a bash prompt, modify whatever you want and finaly execute `make -C /opt/build_all` to build the boot loader image.
After step 3. the redpill load image should be build and can be found in the host folder "images".
Note1: run `./redpill_tool_chain.sh` to get the list of supported ids for the <platform_version> parameter.
Note2: if `docker.use_local_rp_load` is set to `true`, the auto action will not pull latest redpill-load sources.
2021-09-22 17:22:58 +00:00
Note3: Please do not ask to add <platform_version> with configurations for other redpill-load repositories.
2021-09-05 01:17:53 +00:00
Feel free to modify any values in `global_config.json` that suite your needs!
2022-05-15 09:58:40 +00:00
---
⚠️⚠️⚠️
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)
View the execution results in [Gtihub Actions](https://github.com/tossp/redpill-tool-chain/actions) and download the generated image.
❗❗❗
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
---
2021-09-05 01:17:53 +00:00
Examples:
2021-10-23 20:01:29 +00:00
2021-09-05 01:17:53 +00:00
### See Help text
2021-10-23 20:01:29 +00:00
```txt
2021-09-05 01:17:53 +00:00
./redpill_tool_chain.sh
Usage: ./redpill_tool_chain.sh <action> <platform version>
2022-04-12 04:46:18 +00:00
Actions: build, auto, run, clean, add, del, sn, pat
2021-09-05 01:17:53 +00:00
- build: Build the toolchain image for the specified platform version.
- auto: Starts the toolchain container using the previosuly build toolchain image for the specified platform.
Updates redpill sources and builds the bootloader image automaticaly. Will end the container once done.
- run: Starts the toolchain container using the previously built toolchain image for the specified platform.
Interactive Bash terminal.
2021-09-08 12:38:08 +00:00
- clean: Removes old (=dangling) images and the build cache for a platform version.
2021-10-13 16:11:31 +00:00
Use all as platform version to remove images and build caches for all platform versions.
- add: To install extension you need to know its index file location and nothing more.
eg: add 'https://example.com/some-extension/rpext-index.json'
- del: To remove an already installed extension you need to know its ID.
eg: del 'example_dev.some_extension'
2021-09-08 12:38:08 +00:00
2022-03-11 22:20:32 +00:00
- sn: Generates a serial number and mac address for the following platforms
DS3615xs DS3617xs DS916+ DS918+ DS920+ DS3622xs+ FS6400 DVA3219 DVA3221 DS1621+
eg: sn ds920p
2022-05-15 09:58:40 +00:00
- pat: For decoding PAT file.
2022-04-12 04:46:18 +00:00
2021-09-05 01:17:53 +00:00
Available platform versions:
---------------------
2022-04-12 04:46:18 +00:00
ds1621p-7.0.1-42218
ds1621p-7.1.0-42661
2022-05-15 09:58:40 +00:00
ds2422p-7.0.1-42218
2022-03-10 20:26:00 +00:00
ds3615xs-6.2.4-25556
ds3615xs-7.0.1-42218
2022-04-12 04:46:18 +00:00
ds3615xs-7.1.0-42661
2022-03-10 20:26:00 +00:00
ds3617xs-7.0.1-42218
2022-04-12 04:46:18 +00:00
ds3617xs-7.1.0-42661
2022-03-10 20:26:00 +00:00
ds3622xsp-7.0.1-42218
2022-04-12 04:46:18 +00:00
ds3622xsp-7.1.0-42661
ds918p-6.2.4-25556
ds918p-7.0.1-42218
ds918p-7.1.0-42661
2022-03-10 20:26:00 +00:00
ds920p-7.0.1-42218
2022-04-12 04:46:18 +00:00
ds920p-7.1.0-42661
2022-03-11 22:20:32 +00:00
dva3221-7.0.1-42218
2022-04-12 04:46:18 +00:00
dva3221-7.1.0-42661
2021-10-13 16:11:31 +00:00
Custom Extensions:
---------------------
2022-03-11 22:20:32 +00:00
jumkey.acpid2
2021-10-13 16:11:31 +00:00
thethorgroup.boot-wait
thethorgroup.virtio
2022-03-11 22:20:32 +00:00
Check global_settings.json for settings.
2021-09-05 01:17:53 +00:00
```
2021-10-13 16:11:31 +00:00
### Custom extended driver management
- Install thethorgroup.virtio : `./redpill_tool_chain.sh add https://github.com/jumkey/redpill-load/raw/develop/redpill-virtio/rpext-index.json`
- Install thethorgroup.boot-wait : `./redpill_tool_chain.sh add https://github.com/jumkey/redpill-load/raw/develop/redpill-boot-wait/rpext-index.json`
- Install pocopico.mpt3sas : `./redpill_tool_chain.sh add https://raw.githubusercontent.com/pocopico/rp-ext/master/mpt3sas/rpext-index.json`
- Remove pocopico.mpt3sas : `./redpill_tool_chain.sh del pocopico.mpt3sas`
[Get more extended drivers....](https://github.com/pocopico/rp-ext)
2021-09-05 01:17:53 +00:00
### Build toolchain image
2022-03-10 20:26:00 +00:00
- 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`
2021-08-09 13:56:07 +00:00
2021-09-05 01:17:53 +00:00
### Create redpill bootloader image
2021-08-09 13:56:07 +00:00
2022-03-10 20:26:00 +00:00
- 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`
2021-09-08 12:38:08 +00:00
### Clean old redpill bootloader images and build cache
2022-03-10 20:26:00 +00:00
- 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`
2021-10-13 16:11:31 +00:00
- For all : `./redpill_tool_chain.sh clean all`