@@ -27,9 +27,22 @@ ifeq (,$(findstring /usr/sbin,$(PATH)))
2727endif
2828export PATH
2929
30- # Default riscv64 disk image file. Change this to point at your local image
31- # if you have one
32- DISK_IMAGE := rootfs.ext4
30+ # Boot artifacts. Override individually, or set IMAGEDIR=<dir> below to pick
31+ # all four from the same directory (useful when bringing your own distro).
32+ KERNEL ?= Image
33+ OPENSBI ?= fw_jump.bin
34+ DTB ?= blackhole-card.dtb
35+ DISK_IMAGE ?= rootfs.ext4
36+
37+ # IMAGEDIR shortcut: e.g. `make boot IMAGEDIR=gentoo` resolves all four to
38+ # gentoo/{Image,fw_jump.bin,blackhole-card.dtb,rootfs.ext4}. Explicit
39+ # overrides above (KERNEL=, OPENSBI=, DTB=, DISK_IMAGE=) still win.
40+ ifdef IMAGEDIR
41+ KERNEL := $(IMAGEDIR ) /Image
42+ OPENSBI := $(IMAGEDIR ) /fw_jump.bin
43+ DTB := $(IMAGEDIR ) /blackhole-card.dtb
44+ DISK_IMAGE := $(IMAGEDIR ) /rootfs.ext4
45+ endif
3346
3447L2CPU ?= 0
3548TTDEVICE ?= 0
@@ -98,12 +111,12 @@ help:
98111
99112# Boot one L2CPU in Blackhole RISC-V CPU
100113boot : _need_linux _need_opensbi _need_dtb _need_rootfs _need_hosttool _need_python _need_luwen _need_ttkmd _need_pylibfdt
101- $(PYTHON ) boot.py --boot --ttdevice $(TTDEVICE ) --l2cpu $(L2CPU ) --opensbi_bin fw_jump.bin --opensbi_dst 0x400030000000 --rootfs_dst 0x4000e5000000 --kernel_bin Image --kernel_dst 0x400030200000 --dtb_bin blackhole-card.dtb --dtb_dst 0x400030100000
114+ $(PYTHON ) boot.py --boot --ttdevice $(TTDEVICE ) --l2cpu $(L2CPU ) --opensbi_bin $( OPENSBI ) --opensbi_dst 0x400030000000 --rootfs_dst 0x4000e5000000 --kernel_bin $( KERNEL ) --kernel_dst 0x400030200000 --dtb_bin $( DTB ) --dtb_dst 0x400030100000
102115 ./console/tt-bh-linux --ttdevice $(TTDEVICE ) --l2cpu $(L2CPU ) --disk $(DISK_IMAGE )
103116
104117# Boot one L2CPU in Blackhole RISC-V CPU into an initramfs specified by $(INITRAMFS)
105118boot_initramfs : _need_linux _need_opensbi _need_dtb _need_rootfs _need_hosttool _need_python _need_luwen _need_ttkmd _need_pylibfdt
106- $(PYTHON ) boot.py --boot --ttdevice $(TTDEVICE ) --l2cpu $(L2CPU ) --opensbi_bin fw_jump.bin --opensbi_dst 0x400030000000 --rootfs_dst 0x4000e5000000 --kernel_bin Image --kernel_dst 0x400030200000 --dtb_bin blackhole-card.dtb --dtb_dst 0x400030100000 --boot_device initramfs --rootfs_bin $(INITRAMFS ) $(DT_NO_VIRTIO_DEVICES ) $(EXTRA_BOOTARGS )
119+ $(PYTHON ) boot.py --boot --ttdevice $(TTDEVICE ) --l2cpu $(L2CPU ) --opensbi_bin $( OPENSBI ) --opensbi_dst 0x400030000000 --rootfs_dst 0x4000e5000000 --kernel_bin $( KERNEL ) --kernel_dst 0x400030200000 --dtb_bin $( DTB ) --dtb_dst 0x400030100000 --boot_device initramfs --rootfs_bin $(INITRAMFS ) $(DT_NO_VIRTIO_DEVICES ) $(EXTRA_BOOTARGS )
107120 ./console/tt-bh-linux --ttdevice $(TTDEVICE ) --l2cpu $(L2CPU ) --disk $(DISK_IMAGE )
108121
109122# boot_all: _need_linux _need_opensbi _need_dtb _need_dtb_all _need_rootfs _need_hosttool _need_python _need_luwen _need_ttkmd _need_pylibfdt
@@ -143,7 +156,7 @@ user-data.img: user-data.yaml _need_cloud_image_utils
143156
144157# Boot with cloud-init image attached
145158boot_cloud_init : _need_linux _need_opensbi _need_dtb _need_rootfs _need_hosttool _need_python _need_luwen _need_ttkmd _need_pylibfdt user-data.img
146- $(PYTHON ) boot.py --boot --ttdevice $(TTDEVICE ) --l2cpu $(L2CPU ) --opensbi_bin fw_jump.bin --opensbi_dst 0x400030000000 --rootfs_dst 0x4000e5000000 --kernel_bin Image --kernel_dst 0x400030200000 --dtb_bin blackhole-card.dtb --dtb_dst 0x400030100000
159+ $(PYTHON ) boot.py --boot --ttdevice $(TTDEVICE ) --l2cpu $(L2CPU ) --opensbi_bin $( OPENSBI ) --opensbi_dst 0x400030000000 --rootfs_dst 0x4000e5000000 --kernel_bin $( KERNEL ) --kernel_dst 0x400030200000 --dtb_bin $( DTB ) --dtb_dst 0x400030100000
147160 ./console/tt-bh-linux --ttdevice $(TTDEVICE ) --l2cpu $(L2CPU ) --disk $(DISK_IMAGE ) --cloud-init user-data.img
148161
149162# ################################
@@ -344,13 +357,13 @@ download_all: download_rootfs download_prebuilt
344357# Helpers
345358
346359_need_linux :
347- $(call _need_file,Image ,build,build_linux)
360+ $(call _need_file,$( KERNEL ) ,build,build_linux)
348361
349362_need_opensbi :
350- $(call _need_file,fw_jump.bin ,build,build_opensbi)
363+ $(call _need_file,$( OPENSBI ) ,build,build_opensbi)
351364
352365_need_dtb :
353- $(call _need_file,blackhole-card.dtb ,build,build_linux)
366+ $(call _need_file,$( DTB ) ,build,build_linux)
354367
355368_need_cloud_image_utils :
356369 $(call _need_prog,cloud-localds,install,install_hosttool_pkgs)
0 commit comments