From 69126298a4ba6d8c81cf4866b34d195e62f63e67 Mon Sep 17 00:00:00 2001 From: Rose Thompson Date: Tue, 21 Nov 2023 20:21:26 -0600 Subject: [PATCH 1/2] Ok this is much better. Thanks Jacob for the tip about vmlinux always being generated. --- linux/Makefile | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/linux/Makefile b/linux/Makefile index bcf967bb8..9a6977faa 100644 --- a/linux/Makefile +++ b/linux/Makefile @@ -1,5 +1,6 @@ RISCV := /opt/riscv -BUILDROOT := ${RISCV}/buildroot +#BUILDROOT := ${RISCV}/buildroot-test +BUILDROOT := buildroot IMAGES := ${BUILDROOT}/output/images WALLY := $(shell dirname $(shell pwd)) WALLYLINUX := $(shell pwd) @@ -29,13 +30,17 @@ OBJDUMPS := $(foreach name, $(OBJDUMPS), $(DIS)/$(name).objdump) .PHONY: all generate disassemble install clean cleanDTB cleanDriver test -all: - $(MAKE) install +all: download Image disassemble install + +Image: make -C $(BUILDROOT) --jobs $(MAKE) generate # TODO: Need to find a way to set the PATH for child processes. # source ../setup.sh; $(MAKE) disassemble +install: + sudo cp -r $(BUILDROOT) $(RISCV)/$(BUILDROOT) + # Temp rule for debugging test: echo $(shell find $(BUILDROOT)/output/build -maxdepth 2 -type d -regex ".*/linux-[0-9]+\.[0-9]+\.[0-9]+$$") @@ -55,23 +60,12 @@ $(RISCV): # Disassembly rules --------------------------------------------------- -vmlinux: - sed 's/BR2_LINUX_KERNEL_IMAGE=y/\# BR2_LINUX_KERNEL_IMAGE is not set/g' ${BR2023}/main.config > ${BR2023}/main-vmlinux.config - sed -i 's/\# BR2_LINUX_KERNEL_VMLINUX is not set/BR2_LINUX_KERNEL_VMLINUX=y/g' ${BR2023}/main-vmlinux.config - sed -i 's/\# BR2_TARGET_OPENSBI_LINUX_PAYLOAD is not set//g' ${BR2023}/main-vmlinux.config - cp $(BR2023)/main-vmlinux.config $(WALLYBOARD)/main.config - cp $(BR2023)/main-vmlinux.config $(BUILDROOT)/.config - make -C $(BUILDROOT) --jobs disassemble: + cp $(BUILDROOT)/output/build/linux*/vmlinux $(BUILDROOT)/output/images/vmlinux mkdir -p $(DIS) make -j $(OBJDUMPS) -Image: - cp $(BR2023)/main.config $(WALLYBOARD)/main.config - cp $(BR2023)/main.config $(BUILDROOT)/.config - make -C $(BUILDROOT) --jobs - $(DIS)/%.objdump: $(IMAGES)/%.elf riscv64-unknown-elf-objdump -DS $< >> $@ @@ -89,7 +83,7 @@ $(IMAGES)/busybox: # Generating new Buildroot directories -------------------------------- # This directive should be run as: make install BUILDROOT=path/to/buildroot -install: $(BUILDROOT)/package/fpga-axi-sdc $(WALLYBOARD) +download: $(BUILDROOT)/package/fpga-axi-sdc $(WALLYBOARD) cp $(WALLYBOARD)/main.config $(BUILDROOT)/.config # CONFIG DEPENDENCIES 2023.05.1 --------------------------------------- From 25af7d3c78820653777d675e684eca6b3abfb898 Mon Sep 17 00:00:00 2001 From: Rose Thompson Date: Tue, 21 Nov 2023 20:47:57 -0600 Subject: [PATCH 2/2] Ok the disassemble recipe should work now. --- linux/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/Makefile b/linux/Makefile index 9a6977faa..954d162bc 100644 --- a/linux/Makefile +++ b/linux/Makefile @@ -62,7 +62,7 @@ $(RISCV): disassemble: - cp $(BUILDROOT)/output/build/linux*/vmlinux $(BUILDROOT)/output/images/vmlinux + find $(BUILDROOT)/output/build/linux-* -maxdepth 1 -name "vmlinux" | xargs cp -t $(BUILDROOT)/output/images/ mkdir -p $(DIS) make -j $(OBJDUMPS)