4
0

added more configurations

This commit is contained in:
Benjamin Böhmke 2019-11-17 10:58:55 +01:00
parent 4a77046bb4
commit ce335164ff
2 changed files with 20 additions and 15 deletions

View File

@ -55,18 +55,21 @@ chroot_exec rc-update add example_daemon default
The following variables can be used to modify the base behaviour of the image The following variables can be used to modify the base behaviour of the image
builder. builder.
| Variable | Default Value | Description | | Variable | Default Value | Description |
| --------------------- | ------------------------------------ | -------------------------------- | | --------------------- | ------------------------------------ | ------------------------------------------------------------------------------------------------- |
| ALPINE_MIRROR | http://dl-cdn.alpinelinux.org/alpine | Mirror used for package download | | ALPINE_BRANCH | 3.10 | [Alpine Branch](https://wiki.alpinelinux.org/wiki/Alpine_Linux:Releases) to use for image |
| ALPINE_BRANCH | 3.10 | [Alpine Branch](https://wiki.alpinelinux.org/wiki/Alpine_Linux:Releases) to use for image | | ALPINE_MIRROR | http://dl-cdn.alpinelinux.org/alpine | Mirror used for package download |
| CUSTOM_IMAGE_SCRIPT | image.sh | Name of script for image customizations (relative to input dir) |
| DEFAULT_HOSTNAME | alpine | Default hostname |
| DEFAULT_ROOT_PASSWORD | alpine | Default password for root user |
| DEFAULT_TIMEZONE | Etc/UTC | Default [Timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) to use for image | | DEFAULT_TIMEZONE | Etc/UTC | Default [Timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) to use for image |
| DEFAULT_HOSTNAME | alpine | Default hostname | | IMG_NAME | sdcard | Base name of created image file |
| DEFAULT_ROOT_PASSWORD | alpine | Default password for root user | | INPUT_PATH | /input | Input directory inside container |
| SIZE_BOOT | 100M | Size of boot partition | | OUTPUT_PATH | /output | Output directory inside container |
| SIZE_ROOT_FS | 200M | Size of root file system | | SIZE_BOOT | 100M | Size of boot partition |
| SIZE_ROOT_PART | 500M | Size of root partition | | SIZE_DATA | 20M | Initial Size of data partition |
| SIZE_DATA | 20M | Initial Size of data partition | | SIZE_ROOT_FS | 200M | Size of root file system |
| IMG_NAME | sdcard | Base name of created image file | | SIZE_ROOT_PART | 500M | Size of root partition |
### Update running system ### Update running system

View File

@ -17,6 +17,10 @@ set -e
: ${SIZE_DATA:="20M"} : ${SIZE_DATA:="20M"}
: ${IMG_NAME:="sdcard"} : ${IMG_NAME:="sdcard"}
: ${OUTPUT_PATH:="/output"}
: ${INPUT_PATH:="/input"}
: ${CUSTOM_IMAGE_SCRIPT:="image.sh"}
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# static config # static config
@ -25,8 +29,6 @@ RES_PATH=/resources/
BASE_PACKAGES="alpine-base tzdata parted ifupdown e2fsprogs-extra util-linux coreutils linux-rpi linux-rpi2" BASE_PACKAGES="alpine-base tzdata parted ifupdown e2fsprogs-extra util-linux coreutils linux-rpi linux-rpi2"
WORK_PATH="/work" WORK_PATH="/work"
OUTPUT_PATH="/output"
INPUT_PATH="/input"
ROOTFS_PATH="${WORK_PATH}/root_fs" ROOTFS_PATH="${WORK_PATH}/root_fs"
BOOTFS_PATH="${WORK_PATH}/boot_fs" BOOTFS_PATH="${WORK_PATH}/boot_fs"
DATAFS_PATH="${WORK_PATH}/data_fs" DATAFS_PATH="${WORK_PATH}/data_fs"
@ -327,8 +329,8 @@ mkdir -p ${DATAFS_PATH}
# Custom modification # Custom modification
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
if [ -f ${INPUT_PATH}/image.sh ]; then if [ -f ${INPUT_PATH}/${CUSTOM_IMAGE_SCRIPT} ]; then
. ${INPUT_PATH}/image.sh . ${INPUT_PATH}/${CUSTOM_IMAGE_SCRIPT}
fi fi
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #