4
0
Fork 0

added option disable default boot counter reset

This commit is contained in:
Benjamin Böhmke 2019-12-15 19:42:43 +01:00
parent 00bda84713
commit c2a7e71bd5
2 changed files with 23 additions and 20 deletions

View File

@ -56,7 +56,7 @@ The following variables can be used to modify the base behaviour of the image
builder.
| Variable | Default Value | Description |
| ------------------------ | ------------------------------------ | ------------------------------------------------------------------------------------------------- |
| --------------------------- | ------------------------------------ | ------------------------------------------------------------------------------------------------- |
| 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) |
@ -71,6 +71,7 @@ builder.
| SIZE_DATA | 20M | Initial Size of data partition |
| SIZE_ROOT_FS | 200M | Size of root file system |
| SIZE_ROOT_PART | 500M | Size of root partition |
| UBOOT_COUNTER_RESET_ENABLED | true | True to enable simple boot counter reset service |
### Update running system

View File

@ -11,6 +11,7 @@ set -e
: ${DEFAULT_HOSTNAME:="alpine"}
: ${DEFAULT_ROOT_PASSWORD:="alpine"}
: ${DEFAULT_DROPBEAR_ENABLED:="true"}
: ${UBOOT_COUNTER_RESET_ENABLED:="true"}
: ${SIZE_BOOT:="100M"}
: ${SIZE_ROOT_FS:="200M"}
@ -150,7 +151,7 @@ chroot_exec rc-update add ntpd default
# uboot tools
cp /uboot_tool ${ROOTFS_PATH}/sbin/uboot_tool
# TODO REMOVE THIS
if [ "$UBOOT_COUNTER_RESET_ENABLED" = "true" ]; then
# mark system as booted (should be moved to application)
cat >${ROOTFS_PATH}/etc/local.d/99-uboot.start <<EOF
#!/bin/sh
@ -162,6 +163,7 @@ sync
mount -o remount,ro /uboot
EOF
chmod +x ${ROOTFS_PATH}/etc/local.d/99-uboot.start
fi
# copy helper scripts
cp ${RES_PATH}/scripts/* ${ROOTFS_PATH}/sbin/