chore(build): build.py 增加 --bootloader(make -C boot / GNU-EFI)
bootx64.efi 不由 viperc 产出,长期停留在旧件——改了 boot.c 却仍在用旧引导器 (本次即踩到:boot.c 的栈区占位因 bootloader 未重编而未生效)。 - 传 --bootloader 时执行 make -C boot(MSYS make → WSL Ubuntu → objcopy 直接 产出 disk/EFI/BOOT/bootx64.efi) - 未传时若 boot/boot.c 比 disk/EFI/BOOT/bootx64.efi 新,打印过期提醒
This commit is contained in:
1 parent
0c6396912b
commit
091efd11fc
1 file changed
+15
@@ -9,6 +9,7 @@ import threading
|
||||
clean = '--noclean' not in sys.argv
|
||||
kernel_only = '--kernel-only' in sys.argv
|
||||
noapp = '--noapp' in sys.argv
|
||||
bootloader = '--bootloader' in sys.argv
|
||||
|
||||
|
||||
# 编译内核
|
||||
@@ -97,6 +98,20 @@ else:
|
||||
shutil.copy(vpui_path, "./disk/libs/vpui64.so")
|
||||
|
||||
|
||||
# 编译 bootloader(GNU-EFI:MSYS make → WSL Ubuntu);
|
||||
# bootx64.efi 不由 viperc 产出,容易忘记重编而一直用旧引导器(改了 boot.c / 内核预留逻辑
|
||||
# 却仍在用旧件)。显式传 --bootloader 才重编;未传时若 boot.c 比产物新则给出提醒。
|
||||
boot_src = "boot/boot.c"
|
||||
boot_out = "disk/EFI/BOOT/bootx64.efi"
|
||||
if bootloader:
|
||||
print("[build] building bootloader (make -C boot)...")
|
||||
boot_rc = os.system('make -C boot')
|
||||
if boot_rc != 0:
|
||||
print("[build] 警告: bootloader 构建失败(需 MSYS make + WSL Ubuntu + _UNCADK/tools/gnu-efi)")
|
||||
elif os.path.exists(boot_src) and os.path.exists(boot_out) and os.path.getmtime(boot_src) > os.path.getmtime(boot_out):
|
||||
print("[build] 警告: boot/boot.c 比 disk/EFI/BOOT/bootx64.efi 新 → bootloader 已过期,请用 --bootloader 重编")
|
||||
|
||||
|
||||
os.system('powershell -ExecutionPolicy Bypass -File ./Scripts/disk.ps1')
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user