1931a250b3
Build system: - Switch from GRUB 2.04 → 2.12 with Ventoy module via build_grub2_212.sh - New patch_ventoy_212.py: compat typedefs, mem: protocol, VTOY_CMD_CHECK bypass - Fix EFI libstub compile with GCC 16 (cflags -std=gnu11 on X86_64) - Disable busybox CONFIG_TC (broken with modern kernel headers) - New Makefile targets: install, update, rebuild (single-command USB deploy) GRUB 2.12 compat fixes: - Add grub_mem_fs with fs_read/fs_close to kern/file.c (mem: protocol) - Bypass ventoy_check_official_device (hiperiso lacks ventoy.cpio on ESP) - Disable VTOY_CMD_CHECK anti-tamper (ESP size != 33554432) Kernel (hiperiso_defconfig): - Enable CONFIG_EFI, CONFIG_EFI_STUB, CONFIG_FB_EFI (fixes black screen boot) - Add CONFIG_FONT_SUPPORT, CONFIG_FONT_8x16 grub.cfg: - Theme path: try themes/hiperiso/ then themes/ventoy/ (path mismatch fix) - Kernel cmdline: add console=tty0 console=ttyS0 ignore_loglevel earlyprintk=efi - Restore ventoy_* function names (matching modsrc binary)
130 lines
4.3 KiB
Makefile
130 lines
4.3 KiB
Makefile
HIPERISO_VERSION := 1.0.0
|
|
BUILD_DIR := build
|
|
STAGING := $(CURDIR)/$(BUILD_DIR)/staging
|
|
PAYLOAD := $(CURDIR)/$(BUILD_DIR)/payload
|
|
SCRIPTS := scripts
|
|
|
|
.PHONY: all grub2 kernel qemu ovmf busybox initramfs hiperiso-log gui package payload dist install update rebuild clean distclean help
|
|
|
|
help:
|
|
@echo "hiperiso build system"
|
|
@echo ""
|
|
@echo "Targets:"
|
|
@echo " all Build everything (staging artifacts)"
|
|
@echo " grub2 Build GRUB2 2.12 with Ventoy module"
|
|
@echo " kernel Build host kernel (KVM built-in)"
|
|
@echo " qemu Build stripped QEMU system-x86_64"
|
|
@echo " ovmf Acquire OVMF UEFI firmware"
|
|
@echo " busybox Build static busybox for initramfs"
|
|
@echo " initramfs Pack initramfs.cpio.gz"
|
|
@echo " hiperiso-log Build log analysis tool"
|
|
@echo " gui Build all GUI/web tools (Qt5, GTK3, WebUI, Plugson)"
|
|
@echo " package Build all artifacts and assemble release payload"
|
|
@echo " payload Alias for 'package'"
|
|
@echo " dist Alias for 'package'"
|
|
@echo " install Build payload and install to USB=/dev/sdX (destructive)"
|
|
@echo " update Build payload and update existing USB=/dev/sdX (keeps ISOs)"
|
|
@echo " rebuild clean + all + package (no USB — add USB=/dev/sdX to install)"
|
|
@echo " download Download source tarballs"
|
|
@echo " clean Remove build/"
|
|
@echo " distclean Remove build/ + payload/"
|
|
|
|
all: kernel qemu ovmf grub2 busybox initramfs hiperiso-log
|
|
@echo "=== All staging artifacts built ==="
|
|
@echo "Run 'make package' to build GUI tools and assemble release payload"
|
|
|
|
dist: package
|
|
|
|
payload: package
|
|
|
|
download:
|
|
@echo "=== Downloading sources ==="
|
|
sh $(SCRIPTS)/download_sources.sh $(BUILD_DIR)
|
|
|
|
grub2:
|
|
@echo "=== Building GRUB2 2.12 with Ventoy module ==="
|
|
sh $(SCRIPTS)/build_grub2_212.sh
|
|
|
|
gui:
|
|
@echo "=== Building all GUI/web tools ==="
|
|
sh $(SCRIPTS)/build_gui_all.sh
|
|
|
|
kernel:
|
|
@echo "=== Building host kernel ==="
|
|
cd $(BUILD_DIR)/linux && \
|
|
cp ../../host/kernel/hiperiso_defconfig .config && \
|
|
make olddefconfig && \
|
|
sed -i 's/^cflags-\$$(CONFIG_X86_64)[[:space:]]*:= -mcmodel=small/cflags-\$$(CONFIG_X86_64) := -mcmodel=small -std=gnu11/' drivers/firmware/efi/libstub/Makefile && \
|
|
make -j$$(nproc) bzImage && \
|
|
mkdir -p $(STAGING) && \
|
|
cp arch/x86/boot/bzImage $(STAGING)/vmlinuz
|
|
|
|
qemu:
|
|
@echo "=== Building QEMU ==="
|
|
cd $(BUILD_DIR)/qemu && \
|
|
../../scripts/configure_qemu.sh && \
|
|
make -j$$(nproc) qemu-system-x86_64 && \
|
|
cp build/qemu-system-x86_64 $(STAGING)/qemu-system-x86_64 && \
|
|
strip $(STAGING)/qemu-system-x86_64
|
|
|
|
ovmf:
|
|
@echo "=== Acquiring OVMF firmware ==="
|
|
@if [ -f /usr/share/edk2/x64/OVMF.4m.fd ]; then \
|
|
cp /usr/share/edk2/x64/OVMF.4m.fd $(STAGING)/OVMF.fd; \
|
|
elif [ -f /usr/share/OVMF/OVMF.fd ]; then \
|
|
cp /usr/share/OVMF/OVMF.fd $(STAGING)/OVMF.fd; \
|
|
else \
|
|
echo "ERROR: No OVMF available. Install edk2-ovmf."; \
|
|
exit 1; \
|
|
fi
|
|
|
|
busybox:
|
|
@echo "=== Building busybox (static) ==="
|
|
cd $(BUILD_DIR)/busybox && \
|
|
make defconfig && \
|
|
sed -i 's/# CONFIG_STATIC is not set/CONFIG_STATIC=y/' .config && \
|
|
sed -i 's/^CONFIG_TC=y/# CONFIG_TC is not set/' .config && \
|
|
yes "" | make oldconfig >/dev/null 2>&1 && \
|
|
make -j$$(nproc) && \
|
|
cp busybox $(STAGING)/busybox
|
|
|
|
initramfs:
|
|
@echo "=== Building initramfs ==="
|
|
sh scripts/build_initramfs.sh $(STAGING)
|
|
|
|
hiperiso-log:
|
|
@echo "=== Building hiperiso-log tool ==="
|
|
cd logging/hiperiso-log && make && \
|
|
cp hiperiso-log $(STAGING)/hiperiso-log
|
|
|
|
package: all gui
|
|
@echo "=== Assembling release payload + ESP disk image ==="
|
|
sh $(SCRIPTS)/package_release.sh
|
|
|
|
install: package
|
|
@if [ -z "$(USB)" ]; then echo "Usage: make install USB=/dev/sdX"; exit 1; fi
|
|
@echo "=== Installing Hiperiso to $(USB) ==="
|
|
@if [ "$$(id -u)" -eq 0 ]; then \
|
|
bash $(PAYLOAD)/Hiperiso2Disk.sh -I -g $(USB); \
|
|
else \
|
|
sudo bash $(PAYLOAD)/Hiperiso2Disk.sh -I -g $(USB); \
|
|
fi
|
|
|
|
update: package
|
|
@if [ -z "$(USB)" ]; then echo "Usage: make update USB=/dev/sdX"; exit 1; fi
|
|
@echo "=== Updating Hiperiso on $(USB) ==="
|
|
@if [ "$$(id -u)" -eq 0 ]; then \
|
|
bash $(PAYLOAD)/Hiperiso2Disk.sh -u $(USB); \
|
|
else \
|
|
sudo bash $(PAYLOAD)/Hiperiso2Disk.sh -u $(USB); \
|
|
fi
|
|
|
|
rebuild: clean package
|
|
@echo "=== Rebuild complete. Run: sudo make install USB=/dev/sdX ==="
|
|
|
|
clean:
|
|
rm -rf $(BUILD_DIR)
|
|
|
|
distclean: clean
|
|
rm -rf $(PAYLOAD)
|