summaryrefslogtreecommitdiff
path: root/board/orangepi/common/post-build.sh
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@dailly.me>2026-05-30 09:58:45 +0200
committerSébastien Dailly <sebastien@dailly.me>2026-05-30 09:58:45 +0200
commit8b2420f74367e4973be0dd9556c021588abfe591 (patch)
treeb95fbf8d5aefc51f619b2506d8ae75ee9f29b75b /board/orangepi/common/post-build.sh
Initial commit
Diffstat (limited to 'board/orangepi/common/post-build.sh')
-rwxr-xr-xboard/orangepi/common/post-build.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/board/orangepi/common/post-build.sh b/board/orangepi/common/post-build.sh
new file mode 100755
index 0000000..bc5d630
--- /dev/null
+++ b/board/orangepi/common/post-build.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+. ${BR2_EXTERNAL_BASTION_PATH}/board/common/post-build.sh
+
+linux_image()
+{
+ if grep -Eq "^BR2_LINUX_KERNEL_UIMAGE=y$" ${BR2_CONFIG}; then
+ echo "uImage"
+ elif grep -Eq "^BR2_LINUX_KERNEL_IMAGE=y$" ${BR2_CONFIG}; then
+ echo "Image"
+ elif grep -Eq "^BR2_LINUX_KERNEL_IMAGEGZ=y$" ${BR2_CONFIG}; then
+ echo "Image.gz"
+ else
+ echo "zImage"
+ fi
+}
+
+generic_getty()
+{
+ if grep -Eq "^BR2_TARGET_GENERIC_GETTY=y$" ${BR2_CONFIG}; then
+ echo ""
+ else
+ echo "s/\s*console=\S*//"
+ fi
+}
+
+PARTUUID="$($HOST_DIR/bin/uuidgen)"
+
+install -d "$TARGET_DIR/boot/extlinux/"
+
+sed -e "$(generic_getty)" \
+ -e "s/%LINUXIMAGE%/$(linux_image)/g" \
+ -e "s/%PARTUUID%/$PARTUUID/g" \
+ "board/orangepi/common/extlinux.conf" > "$TARGET_DIR/boot/extlinux/extlinux.conf"
+
+sed "s/%PARTUUID%/$PARTUUID/g" "board/orangepi/common/genimage.cfg" > "$BINARIES_DIR/genimage.cfg"