From ebf84216e9838ffb1bdd2d51ee69aacd40a9708d Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Fri, 24 Aug 2018 22:46:03 +0000 Subject: [PATCH] cleanup --- buildroot-external/board/asus/hassos-hook.sh | 28 +++++++++++ buildroot-external/board/asus/post-image.sh | 39 --------------- .../board/hardkernel/odroid-c2/hassos-hook.sh | 27 +++++++++++ .../board/hardkernel/post-image.sh | 43 ----------------- buildroot-external/board/ova/hassos-hook.sh | 20 ++++++++ buildroot-external/board/ova/post-image.sh | 33 ------------- .../board/raspberrypi/hassos-hook.sh | 35 ++++++++++++++ .../board/raspberrypi/post-image.sh | 48 ------------------- .../configs/odroid_c2_defconfig | 4 +- buildroot-external/configs/ova_defconfig | 4 +- buildroot-external/configs/rpi0_w_defconfig | 4 +- buildroot-external/configs/rpi2_defconfig | 4 +- buildroot-external/configs/rpi3_64_defconfig | 4 +- buildroot-external/configs/rpi3_defconfig | 4 +- buildroot-external/configs/rpi_defconfig | 4 +- buildroot-external/configs/tinker_defconfig | 4 +- buildroot-external/scripts/post-image.sh | 29 +++++++++++ 17 files changed, 155 insertions(+), 179 deletions(-) create mode 100755 buildroot-external/board/asus/hassos-hook.sh delete mode 100755 buildroot-external/board/asus/post-image.sh create mode 100755 buildroot-external/board/hardkernel/odroid-c2/hassos-hook.sh delete mode 100755 buildroot-external/board/hardkernel/post-image.sh create mode 100755 buildroot-external/board/ova/hassos-hook.sh delete mode 100755 buildroot-external/board/ova/post-image.sh create mode 100755 buildroot-external/board/raspberrypi/hassos-hook.sh delete mode 100755 buildroot-external/board/raspberrypi/post-image.sh create mode 100755 buildroot-external/scripts/post-image.sh diff --git a/buildroot-external/board/asus/hassos-hook.sh b/buildroot-external/board/asus/hassos-hook.sh new file mode 100755 index 000000000..491e0ebfc --- /dev/null +++ b/buildroot-external/board/asus/hassos-hook.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +function hassos_pre_image() { + local BOOT_DATA="$(path_boot_dir)" + local SPL_IMG="$(path_spl_img)" + + cp -t ${BOOT_DATA} \ + ${BINARIES_DIR}/boot.scr \ + ${BINARIES_DIR}/rk3288-tinker.dtb + + echo "console=tty1" > ${BOOT_DATA}/cmdline.txt + + # Create boot binary + rm -f ${BINARIES_DIR}/u-boot-spl-dtb.img + mkimage -n rk3288 -T rksd -d ${BINARIES_DIR}/u-boot-spl-dtb.bin ${BINARIES_DIR}/u-boot-spl-dtb.img + cat ${BINARIES_DIR}/u-boot-dtb.bin >> ${BINARIES_DIR}/u-boot-spl-dtb.img + + # SPL + create_spl_image + + dd if=${BINARIES_DIR}/u-boot-spl-dtb.img of=${SPL_IMG} conv=notrunc bs=512 seek=64 +} + + +function hassos_post_image() { + convert_disk_image_gz +} + diff --git a/buildroot-external/board/asus/post-image.sh b/buildroot-external/board/asus/post-image.sh deleted file mode 100755 index 2fc602542..000000000 --- a/buildroot-external/board/asus/post-image.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -set -e - -SCRIPT_DIR=${BR2_EXTERNAL_HASSOS_PATH}/scripts -BOARD_DIR=${2} -BOOT_DATA=${BINARIES_DIR}/boot - -. ${BR2_EXTERNAL_HASSOS_PATH}/meta -. ${BOARD_DIR}/meta - -. ${SCRIPT_DIR}/hdd-image.sh -. ${SCRIPT_DIR}/name.sh -. ${SCRIPT_DIR}/ota.sh - -# Init boot data -rm -rf ${BOOT_DATA} -mkdir -p ${BOOT_DATA} - -cp -t ${BOOT_DATA} \ - ${BINARIES_DIR}/boot.scr \ - ${BINARIES_DIR}/rk3288-tinker.dtb - -echo "console=tty1" > ${BOOT_DATA}/cmdline.txt - -# Create boot binary -rm -f $BINARIES_DIR/u-boot-spl-dtb.img -mkimage -n rk3288 -T rksd -d $BINARIES_DIR/u-boot-spl-dtb.bin $BINARIES_DIR/u-boot-spl-dtb.img -cat $BINARIES_DIR/u-boot-dtb.bin >> $BINARIES_DIR/u-boot-spl-dtb.img - -# SPL -create_spl_image - -dd if=$BINARIES_DIR/u-boot-spl-dtb.img of=$BINARIES_DIR/spl.img conv=notrunc bs=512 seek=64 - -# Disk -create_disk_image -convert_disk_image_gz - -create_ota_update diff --git a/buildroot-external/board/hardkernel/odroid-c2/hassos-hook.sh b/buildroot-external/board/hardkernel/odroid-c2/hassos-hook.sh new file mode 100755 index 000000000..b6d11d056 --- /dev/null +++ b/buildroot-external/board/hardkernel/odroid-c2/hassos-hook.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +function hassos_pre_image() { + local BOOT_DATA="$(path_boot_dir)" + local BL1="${BINARIES_DIR}/bl1.bin.hardkernel" + local UBOOT_GXBB="${BINARIES_DIR}/u-boot.gxbb" + local spl_img="$(path_spl_img)" + + cp ${BINARIES_DIR}/boot.scr ${BOOT_DATA}/boot.scr + cp ${BOARD_DIR}/boot-env.txt ${BOOT_DATA}/uboot-settings.txt + cp ${BINARIES_DIR}/meson-gxbb-odroidc2.dtb ${BOOT_DATA}/meson-gxbb-odroidc2.dtb + + echo "console=tty0 console=ttyAML0,115200n8" > ${BOOT_DATA}/cmdline.txt + + # SPL + create_spl_image + + dd if=${BL1} of=${spl_img} conv=notrunc bs=1 count=440 + dd if=${BL1} of=${spl_img} conv=notrunc bs=512 skip=1 seek=1 + dd if=${UBOOT_GXBB} of=${spl_img} conv=notrunc bs=512 seek=97 +} + + +function hassos_post_image() { + convert_disk_image_gz +} + diff --git a/buildroot-external/board/hardkernel/post-image.sh b/buildroot-external/board/hardkernel/post-image.sh deleted file mode 100755 index 6eafacd4c..000000000 --- a/buildroot-external/board/hardkernel/post-image.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -set -e - -SCRIPT_DIR=${BR2_EXTERNAL_HASSOS_PATH}/scripts -BOARD_DIR=${2} -BOOT_DATA=${BINARIES_DIR}/boot - -. ${BR2_EXTERNAL_HASSOS_PATH}/meta -. ${BOARD_DIR}/meta - -. ${SCRIPT_DIR}/hdd-image.sh -. ${SCRIPT_DIR}/name.sh -. ${SCRIPT_DIR}/ota.sh - -# Init boot data -rm -rf ${BOOT_DATA} -mkdir -p ${BOOT_DATA} - -cp ${BINARIES_DIR}/boot.scr ${BOOT_DATA}/boot.scr -cp ${BOARD_DIR}/boot-env.txt ${BOOT_DATA}/uboot-settings.txt -cp ${BINARIES_DIR}/meson-gxbb-odroidc2.dtb ${BOOT_DATA}/meson-gxbb-odroidc2.dtb - -echo "console=tty0 console=ttyAML0,115200n8" > ${BOOT_DATA}/cmdline.txt - -function make_bootable() { - local BL1="${BINARIES_DIR}/bl1.bin.hardkernel" - local UBOOT_GXBB="${BINARIES_DIR}/u-boot.gxbb" - local hdd_img="$(hassos_image_name img)" - - dd if=${BL1} of=${hdd_img} conv=notrunc bs=1 count=442 - dd if=${BL1} of=${hdd_img} conv=notrunc bs=512 skip=1 seek=1 - dd if=${UBOOT_GXBB} of=${hdd_img} conv=notrunc bs=512 seek=97 -} - -# SPL -create_spl_image - -# Disk -create_disk_image -convert_disk_image_gz - -create_ota_update - diff --git a/buildroot-external/board/ova/hassos-hook.sh b/buildroot-external/board/ova/hassos-hook.sh new file mode 100755 index 000000000..d153690ce --- /dev/null +++ b/buildroot-external/board/ova/hassos-hook.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +function hassos_pre_image() { + local BOOT_DATA="$(path_boot_dir)" + + mkdir -p ${BOOT_DATA}/EFI/BOOT + mkdir -p ${BOOT_DATA}/EFI/barebox + + cp ${BINARIES_DIR}/barebox.bin ${BOOT_DATA}/EFI/BOOT/BOOTx64.EFI + cp ${BR2_EXTERNAL_HASSOS_PATH}/misc/barebox-state-efi.dtb ${BOOT_DATA}/EFI/barebox/state.dtb + + echo "console=tty1" > ${BOOT_DATA}/cmdline.txt +} + + +function hassos_post_image() { + convert_disk_image_vmdk + convert_disk_image_gz vmdk +} + diff --git a/buildroot-external/board/ova/post-image.sh b/buildroot-external/board/ova/post-image.sh deleted file mode 100755 index bf3fd36ad..000000000 --- a/buildroot-external/board/ova/post-image.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -set -e - -SCRIPT_DIR=${BR2_EXTERNAL_HASSOS_PATH}/scripts -BOARD_DIR=${2} -BOOT_DATA=${BINARIES_DIR}/boot - -. ${BR2_EXTERNAL_HASSOS_PATH}/meta -. ${BOARD_DIR}/meta - -. ${SCRIPT_DIR}/hdd-image.sh -. ${SCRIPT_DIR}/name.sh -. ${SCRIPT_DIR}/ota.sh - -# Init boot data -rm -rf ${BOOT_DATA} -mkdir -p ${BOOT_DATA}/EFI/BOOT -mkdir -p ${BOOT_DATA}/EFI/barebox - -cp ${BINARIES_DIR}/barebox.bin ${BOOT_DATA}/EFI/BOOT/BOOTx64.EFI -cp ${BR2_EXTERNAL_HASSOS_PATH}/misc/barebox-state-efi.dtb ${BOOT_DATA}/EFI/barebox/state.dtb - -echo "console=tty1" > ${BOOT_DATA}/cmdline.txt - -# Create disk images -create_disk_image - -# Make VM -convert_disk_image_vmdk -convert_disk_image_gz vmdk - -# OTA -create_ota_update diff --git a/buildroot-external/board/raspberrypi/hassos-hook.sh b/buildroot-external/board/raspberrypi/hassos-hook.sh new file mode 100755 index 000000000..4882308d2 --- /dev/null +++ b/buildroot-external/board/raspberrypi/hassos-hook.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +function hassos_pre_image() { + local BOOT_DATA="$(path_boot_dir)" + + cp -t ${BOOT_DATA} \ + ${BINARIES_DIR}/u-boot.bin \ + ${BINARIES_DIR}/boot.scr + cp -t ${BOOT_DATA} \ + ${BINARIES_DIR}/*.dtb \ + ${BINARIES_DIR}/rpi-firmware/bootcode.bin \ + ${BINARIES_DIR}/rpi-firmware/fixup.dat \ + ${BINARIES_DIR}/rpi-firmware/start.elf + cp -r ${BINARIES_DIR}/rpi-firmware/overlays ${BOOT_DATA}/ + + # Update Boot options + ( + echo "kernel=u-boot.bin" + echo "disable_splash=1" + echo "dtparam=audio=on" + ) > ${BOOT_DATA}/config.txt + + echo "dwc_otg.lpm_enable=0 console=tty1" > ${BOOT_DATA}/cmdline.txt + + # Enable 64bit support + if [ "${BOARD_ID}" == "rpi3-64" ]; then + echo "arm_64bit=1" >> ${BOOT_DATA}/config.txt + fi +} + + +function hassos_post_image() { + convert_disk_image_gz +} + diff --git a/buildroot-external/board/raspberrypi/post-image.sh b/buildroot-external/board/raspberrypi/post-image.sh deleted file mode 100755 index e780878e7..000000000 --- a/buildroot-external/board/raspberrypi/post-image.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash -set -e - -SCRIPT_DIR=${BR2_EXTERNAL_HASSOS_PATH}/scripts -BOARD_DIR=${2} -BOOT_DATA=${BINARIES_DIR}/boot - -. ${BR2_EXTERNAL_HASSOS_PATH}/meta -. ${BOARD_DIR}/meta - -. ${SCRIPT_DIR}/hdd-image.sh -. ${SCRIPT_DIR}/name.sh -. ${SCRIPT_DIR}/ota.sh - -# Init boot data -rm -rf ${BOOT_DATA} -mkdir -p ${BOOT_DATA} - -cp -t ${BOOT_DATA} \ - ${BINARIES_DIR}/u-boot.bin \ - ${BINARIES_DIR}/boot.scr -cp -t ${BOOT_DATA} \ - ${BINARIES_DIR}/*.dtb \ - ${BINARIES_DIR}/rpi-firmware/bootcode.bin \ - ${BINARIES_DIR}/rpi-firmware/fixup.dat \ - ${BINARIES_DIR}/rpi-firmware/start.elf -cp -r ${BINARIES_DIR}/rpi-firmware/overlays ${BOOT_DATA}/ - -# Update Boot options -( - echo "kernel=u-boot.bin" - echo "disable_splash=1" - echo "dtparam=audio=on" -) > ${BOOT_DATA}/config.txt - -echo "dwc_otg.lpm_enable=0 console=tty1" > ${BOOT_DATA}/cmdline.txt - -# Enable 64bit support -if [ "${BOARD_ID}" == "rpi3-64" ]; then - echo "arm_64bit=1" >> ${BOOT_DATA}/config.txt -fi - -# Disk -create_disk_image -convert_disk_image_gz - -# OTA -create_ota_update diff --git a/buildroot-external/configs/odroid_c2_defconfig b/buildroot-external/configs/odroid_c2_defconfig index 4da95de71..e5d49842d 100644 --- a/buildroot-external/configs/odroid_c2_defconfig +++ b/buildroot-external/configs/odroid_c2_defconfig @@ -14,8 +14,8 @@ BR2_TARGET_GENERIC_GETTY_PORT="tty1" # BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_HASSOS_PATH)/rootfs-overlay" BR2_ROOTFS_POST_BUILD_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-build.sh" -BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/post-image.sh" -BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/odroid-c2" +BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-image.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/odroid-c2 $(BR2_EXTERNAL_HASSOS_PATH)/board/hardkernel/odroid-c2/hassos-hook.sh" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_VERSION=y BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.14.14" diff --git a/buildroot-external/configs/ova_defconfig b/buildroot-external/configs/ova_defconfig index 97a41477f..9dcb04cb9 100644 --- a/buildroot-external/configs/ova_defconfig +++ b/buildroot-external/configs/ova_defconfig @@ -14,8 +14,8 @@ BR2_TARGET_GENERIC_GETTY_PORT="tty1" # BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_HASSOS_PATH)/rootfs-overlay" BR2_ROOTFS_POST_BUILD_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-build.sh" -BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/board/ova/post-image.sh" -BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/ova" +BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-image.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/ova $(BR2_EXTERNAL_HASSOS_PATH)/board/ova/hassos-hook.sh" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_VERSION=y BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.14.59" diff --git a/buildroot-external/configs/rpi0_w_defconfig b/buildroot-external/configs/rpi0_w_defconfig index 64ad4a76d..68b329f6e 100644 --- a/buildroot-external/configs/rpi0_w_defconfig +++ b/buildroot-external/configs/rpi0_w_defconfig @@ -16,8 +16,8 @@ BR2_TARGET_GENERIC_GETTY_PORT="tty1" # BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_HASSOS_PATH)/rootfs-overlay" BR2_ROOTFS_POST_BUILD_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-build.sh" -BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/post-image.sh" -BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/rpi0-w" +BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-image.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/rpi0-w $(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/hassos-hook.sh" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/raspberrypi/linux" diff --git a/buildroot-external/configs/rpi2_defconfig b/buildroot-external/configs/rpi2_defconfig index 8ccef5297..486f9f2e8 100644 --- a/buildroot-external/configs/rpi2_defconfig +++ b/buildroot-external/configs/rpi2_defconfig @@ -16,8 +16,8 @@ BR2_TARGET_GENERIC_GETTY_PORT="tty1" # BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_HASSOS_PATH)/rootfs-overlay" BR2_ROOTFS_POST_BUILD_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-build.sh" -BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/post-image.sh" -BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/rpi2" +BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-image.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/rpi2 $(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/hassos-hook.sh" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/raspberrypi/linux" diff --git a/buildroot-external/configs/rpi3_64_defconfig b/buildroot-external/configs/rpi3_64_defconfig index d4fc8afc4..1fa8b8721 100644 --- a/buildroot-external/configs/rpi3_64_defconfig +++ b/buildroot-external/configs/rpi3_64_defconfig @@ -16,8 +16,8 @@ BR2_TARGET_GENERIC_GETTY_PORT="tty1" # BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_HASSOS_PATH)/rootfs-overlay" BR2_ROOTFS_POST_BUILD_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-build.sh" -BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/post-image.sh" -BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/rpi3-64" +BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-image.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/rpi3-64 $(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/hassos-hook.sh" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/raspberrypi/linux" diff --git a/buildroot-external/configs/rpi3_defconfig b/buildroot-external/configs/rpi3_defconfig index 33d1ecf37..13866fd82 100644 --- a/buildroot-external/configs/rpi3_defconfig +++ b/buildroot-external/configs/rpi3_defconfig @@ -16,8 +16,8 @@ BR2_TARGET_GENERIC_GETTY_PORT="tty1" # BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_HASSOS_PATH)/rootfs-overlay" BR2_ROOTFS_POST_BUILD_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-build.sh" -BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/post-image.sh" -BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/rpi3" +BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-image.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/rpi3 $(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/hassos-hook.sh" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/raspberrypi/linux" diff --git a/buildroot-external/configs/rpi_defconfig b/buildroot-external/configs/rpi_defconfig index 55d8bbe71..633dc1d6e 100644 --- a/buildroot-external/configs/rpi_defconfig +++ b/buildroot-external/configs/rpi_defconfig @@ -16,8 +16,8 @@ BR2_TARGET_GENERIC_GETTY_PORT="tty1" # BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_HASSOS_PATH)/rootfs-overlay" BR2_ROOTFS_POST_BUILD_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-build.sh" -BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/post-image.sh" -BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/rpi" +BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-image.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/rpi $(BR2_EXTERNAL_HASSOS_PATH)/board/raspberrypi/hassos-hook.sh" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/raspberrypi/linux" diff --git a/buildroot-external/configs/tinker_defconfig b/buildroot-external/configs/tinker_defconfig index 9cf34fe02..190970d79 100644 --- a/buildroot-external/configs/tinker_defconfig +++ b/buildroot-external/configs/tinker_defconfig @@ -16,8 +16,8 @@ BR2_TARGET_GENERIC_GETTY_PORT="tty1" # BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_HASSOS_PATH)/rootfs-overlay" BR2_ROOTFS_POST_BUILD_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-build.sh" -BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/board/asus/post-image.sh" -BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/asus/tinker" +BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_HASSOS_PATH)/scripts/post-image.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_HASSOS_PATH)/board/asus/tinker $(BR2_EXTERNAL_HASSOS_PATH)/board/asus/hassos-hook.sh" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_VERSION=y BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.14.59" diff --git a/buildroot-external/scripts/post-image.sh b/buildroot-external/scripts/post-image.sh new file mode 100755 index 000000000..8662e0651 --- /dev/null +++ b/buildroot-external/scripts/post-image.sh @@ -0,0 +1,29 @@ +#!/bin/bash +set -e + +SCRIPT_DIR=${BR2_EXTERNAL_HASSOS_PATH}/scripts +BOARD_DIR=${2} +HOOK_FILE=${3} + +. ${BR2_EXTERNAL_HASSOS_PATH}/meta +. ${BOARD_DIR}/meta + +. ${SCRIPT_DIR}/rootfs-layer.sh +. ${SCRIPT_DIR}/name.sh +. ${SCRIPT_DIR}/rauc.sh +. ${HOOK_FILE} + +# Cleanup +rm -rf "$(path_boot_dir)" +mkdir -p "$(path_boot_dir)" + +# Hook pre image build stuff +hassos_pre_image + +# Disk & OTA +create_disk_image +create_ota_update + +# Hook post image build stuff +hassos_post_image +