Skip to content
This repository was archived by the owner on Jan 14, 2026. It is now read-only.

Commit 25b509f

Browse files
committed
upd makefile to img gen logic
1 parent 613e07f commit 25b509f

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

Makefile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ $(K_OUT_DIR)/%.o: $(SRC_KERNEL)/%.asm
7676
@$(NASM) -f elf64 $< -o $@
7777

7878
$(ESP_IMG): $(BOOTX64) $(KERNEL)
79+
@rm -f $(ESP_IMG)
7980
@echo "Creating UEFI ESP image..."
8081
@rm -f $(ESP_IMG)
8182
@dd if=/dev/zero of=$(ESP_IMG) bs=1M count=64 2>/dev/null
@@ -90,13 +91,11 @@ $(ESP_IMG): $(BOOTX64) $(KERNEL)
9091
@echo "ESP image created: $(ESP_IMG)"
9192

9293
$(EXT2_IMG): $(KERNEL)
94+
@rm -f $(EXT2_IMG)
9395
@echo "Creating ext2 filesystem image..."
9496
@mkdir -p bin/fs_tmp
95-
@cp -r bin/kernel/*.bin bin/fs_tmp/kernel/ 2>/dev/null || true
96-
@cp -r bin/kernel/*.elf bin/fs_tmp/kernel/ 2>/dev/null || true
97-
@cp -r bin/boot/*.EFI bin/fs_tmp/boot/ 2>/dev/null || true
98-
@cp -r bin/LiteCore.img bin/fs_tmp 2>/dev/null || true nt/ || true
99-
@python3 tools/mk_ext2_image.py $(EXT2_IMG) 2048 bin/fs_tmp
97+
@find bin -type f -not -name "*.o" -not -name "fs.img" -not -path "*/fs_tmp/*" -exec bash -c 'dest="bin/fs_tmp/$${1#bin/}"; mkdir -p "$$(dirname "$$dest")"; cp "$$1" "$$dest"' _ {} \;
98+
@python3 tools/mk_ext2_image.py $(EXT2_IMG) 256000 bin/fs_tmp
10099
@rm -rf bin/fs_tmp/fs_content
101100
@echo "ext2 image created: $(EXT2_IMG)"
102101

uefi

Submodule uefi updated from 66d7648 to a79465c

0 commit comments

Comments
 (0)