mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-28 11:43:01 +02:00
Before this change, setting `GIT_VERSION` in `make`'s environment was intended to allow the user to specify a custom build id. As it turns out, `test/test.mk` had duplicated the logic from `board/common/post-build.sh` to unconditionally override any value set in it. Because of the way `make` handles variables, where assignments to variables inherited from the environment are exported back to it[^1], this would mean that `test.mk` would always clobber any value set by the user. Furthermore, there is also this file called `buildroot/package/git/git.mk`, which also (reasonably) has opinions about what the proper value of `GIT_VERSION` should be. In summary, this was a bit of a mess. Therefore: Make sure that there is one single place where we determine the build id and version, and make sure that those variables are scoped under the `INFIX_` prefix to avoid clashing with any other component. [^1]: https://www.gnu.org/software/make/manual/html_node/Environment.html
44 lines
758 B
Bash
Executable File
44 lines
758 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
name=$1
|
|
compat=$2
|
|
sign=$3
|
|
|
|
crt=$(ls $sign/*.crt)
|
|
key=$(ls $sign/*.key)
|
|
|
|
common=$(dirname "$(readlink -f "$0")")
|
|
|
|
work=$BUILD_DIR/mkrauc
|
|
mkdir -p "$work"
|
|
|
|
cp -f "$common/rauc-hooks.sh" "$work/hooks.sh"
|
|
|
|
# RAUC internally uses the file extension to find a suitable install
|
|
# handler, hence the name must be .img
|
|
cp -f "$BINARIES_DIR/rootfs.squashfs" "$work/rootfs.img"
|
|
cp -f "$BINARIES_DIR/rootfs.itbh" "$work/rootfs.itbh"
|
|
|
|
cat >"$work/manifest.raucm" <<EOF
|
|
[update]
|
|
compatible=${compat}
|
|
version=${INFIX_VERSION}
|
|
|
|
[bundle]
|
|
format=verity
|
|
|
|
[hooks]
|
|
filename=hooks.sh
|
|
|
|
[image.rootfs]
|
|
filename=rootfs.img
|
|
hooks=post-install
|
|
EOF
|
|
|
|
rm -f "$BINARIES_DIR/$name.pkg"
|
|
|
|
rauc --cert="$crt" --key="$key" \
|
|
bundle "$work" "$BINARIES_DIR/$name.pkg"
|