Conversation
|
Also there‘s a output sample of |
|
I don't think this is necessary. But I will keep this PR open for someone. The part of building debs and image can just following the armbian build steps. |
build.sh
Outdated
| echo "Building dtb/headers/image debs..." | ||
| ./compile.sh kernel \ | ||
| ALLOW_ROOT=yes \ | ||
| BOARD=onecloud \ | ||
| BRANCH=$CHOOSED_BRANCH \ | ||
| EXPERT=yes \ | ||
| USE_CCACHE=no |
There was a problem hiding this comment.
Uncessary. Building image will also build these packages.
| -b|--branch) | ||
| CHOOSED_BRANCH=$2 | ||
| [[ ${BRANCH[@]/${CHOOSED_BRANCH}/} != ${BRANCH[@]} ]] && echo "Branch $CHOOSED_BRANCH is choosed." || (echo "You should choose from ${BRANCH[*]}." && exit 1) | ||
| shift | ||
| ;; | ||
| -r|--release) | ||
| CHOOSED_RELEASE=$2 | ||
| [[ ${RELEASE[@]/${CHOOSED_RELEASE}/} != ${RELEASE[@]} ]] && echo "Release $CHOOSED_RELEASE is choosed." || (echo "You should choose from ${RELEASE[*]}." && exit 1) | ||
| shift | ||
| ;; |
There was a problem hiding this comment.
All these arguments will be checked by the build framework. So we don't need to check them again.
There was a problem hiding this comment.
I think this is still necessary because users can immediately know that their parameters are incorrect at the beginning of executing the script, rather than being informed of the error only at compile time.
| BRANCH=$CHOOSED_BRANCH \ | ||
| RELEASE=$CHOOSED_RELEASE \ | ||
| KERNEL_CONFIGURE=no \ | ||
| BUILD_MINIMAL=$([ "$CHOOSED_TYPE" == 'minimal' ] && echo 'yes' || echo 'no') \ | ||
| BUILD_DESKTOP=$([ "$CHOOSED_TYPE" == 'desktop' ] && echo 'yes' || echo 'no') \ | ||
| DESKTOP_ENVIRONMENT=$([ "$CHOOSED_TYPE" == 'desktop' ] && echo $DESKTOP_ENVIRONMENT || echo '') \ | ||
| DESKTOP_ENVIRONMENT_CONFIG_NAME=$([ "$CHOOSED_TYPE" == 'desktop' ] && echo $DESKTOP_ENVIRONMENT_CONFIG_NAME || echo '') \ | ||
| DESKTOP_APPGROUPS_SELECTED=$([ "$CHOOSED_TYPE" == 'desktop' ] && echo $DESKTOP_APPGROUPS_SELECTED || echo '') \ |
There was a problem hiding this comment.
If these variables are undefined, the build framework will use dialog to ask. You can use the same way to ask some custom configs.
Hello @hzyitc,
A few weeks ago, I wrote a script to speed up the compilation process after making changes to the source code. With this script, you no longer need to manually follow the steps in ci.yml. Recently, I made some modifications to the script to make it more accessible and user-friendly for everyone.
Now, you can specify the branch, distribution, and type of the image to create image by passing parameters to the script. It also supports compiling from modified source code. This is especially useful for people who want to modify the source code but don't want to manually perform the compilation steps. To use this feature, you can use the "-l" parameter to specify the modified source code location or "-s" to skip patching if it has already been done.The script will automatically package the image and output it to the specified directory as well.
Here are the usages:

For example, if you want to build a "jammy-current-minimal" image from source code, you can run:




./build.sh -b current -r jammy -t minimal. Here are some screenshots:Here're the dists:
Building an image on an Ubuntu system(16C,32G) without compilation cache typically takes around 30 minutes.
This script only supports Debian-based distributions and has been tested on Ubuntu 22.04 LTS ,a GNU/Linux 5.15.0-56-generic x86_64
Hope this script is helpful for those who wants to build images on their own :)