# # SPDX-License-Identifier: BlueOak-1.0.0 # # Copyright (c) Berkus Decker # # Build chainboot binary # [env] CHAINBOOT_ELF = "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/target/${TARGET}/release/chainboot" CHAINBOOT_BIN = "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/target/chainboot.bin" [tasks.chainboot] dependencies = ["build-device", "build-kernel-binary"] command = "echo" args = ["\n***===***\n", "🏎️ Run the following command in your terminal:\n", "🏎️ ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/target/debug/chainofcommand ${CHAINBOOT_SERIAL} ${CHAINBOOT_BAUD} --kernel ${KERNEL_BIN}\n", "***===***\n\n"] [tasks.build-kernel-binary] env = { "BINARY_FILE" = "${CHAINBOOT_ELF}" } run_task = "build-custom-binary" [tasks.zellij-cb] env = { "KERNEL_BIN" = "${CHAINBOOT_BIN}", "QEMU_OPTS" = "${QEMU_OPTS} ${QEMU_DISASM_OPTS}" } run_task = "zellij-config" [tasks.zellij-cb-gdb] env = { "KERNEL_BIN" = "${CHAINBOOT_BIN}", "QEMU_OPTS" = "${QEMU_OPTS} ${QEMU_DISASM_OPTS} ${QEMU_GDB_OPTS}", "TARGET_BOARD" = "rpi3", "TARGET_DTB" = "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/targets/bcm2710-rpi-3-b-plus.dtb" } run_task = "zellij-config" [tasks.qemu-cb] env = { "QEMU_RUNNER_OPTS" = "${QEMU_DISASM_OPTS} -serial pty", "KERNEL_BIN" = "${CHAINBOOT_BIN}", "TARGET_DTB" = "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/targets/bcm2710-rpi-3-b-plus.dtb" } extend = "qemu-runner" [tasks.qemu-cb-gdb] env = { "QEMU_RUNNER_OPTS" = "${QEMU_DISASM_OPTS} ${QEMU_GDB_OPTS} -serial pty", "KERNEL_BIN" = "${CHAINBOOT_BIN}", "TARGET_DTB" = "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/targets/bcm2710-rpi-3-b-plus.dtb" } extend = "qemu-runner" [tasks.gdb-cb] dependencies = ["build", "build-kernel-binary", "gdb-config"] env = { "RUST_GDB" = "${GDB}" } script = [ "exec < /dev/tty && rust-gdb -x ${GDB_CONNECT_FILE} ${CHAINBOOT_ELF}" ] [tasks.sdcard] clear = true alias = "sdcard-cb" [tasks.sdcard-cb] dependencies = ["build", "build-kernel-binary"] script_runner = "@duckscript" script = [ ''' kernelImage = set "chain_boot_rpi4.img" cp ${CHAINBOOT_BIN} ${VOLUME}/${kernelImage} echo 🔄 Copied chainboot to ${VOLUME}/${kernelImage} ''' ] # Just use sdeject #[tasks.cb-eject] #clean = true #alias = "cb-eject-chainboot" # #[tasks.cb-eject-chainboot] #dependencies = ["sdeject"]