mirror of
https://github.com/a2-4am/4cade.git
synced 2025-01-12 14:30:29 +00:00
refactor changebootloader
This commit is contained in:
parent
852f6123ea
commit
c3922613ea
2
Makefile
2
Makefile
@ -87,7 +87,7 @@ dsk: md asm
|
||||
$(CADIUS) ADDFOLDER build/"$(DISK)" "/$(VOLUME)/X" "build/X" >>build/log
|
||||
bin/buildfileinfo.sh build/PRELAUNCH "06" "0106" >>build/log
|
||||
$(CADIUS) ADDFOLDER build/"$(DISK)" "/$(VOLUME)/PRELAUNCH" "build/PRELAUNCH" >>build/log
|
||||
bin/changebootloader.py build/"$(DISK)" res/proboothd
|
||||
bin/changebootloader.sh build/"$(DISK)" res/proboothd
|
||||
|
||||
asm: md asmlauncher asmfx asmprelaunch
|
||||
|
||||
|
@ -1,15 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
import os.path
|
||||
|
||||
target_2mg_file, bootloader = sys.argv[1:]
|
||||
assert(os.path.splitext(target_2mg_file)[-1].lower() == ".2mg")
|
||||
with open(bootloader, 'rb') as f:
|
||||
boot = f.read()
|
||||
assert(len(boot) == 512)
|
||||
with open(target_2mg_file, 'rb') as f:
|
||||
data = bytearray(f.read())
|
||||
data[64:64+len(boot)] = boot
|
||||
with open(target_2mg_file, 'wb') as f:
|
||||
f.write(data)
|
3
bin/changebootloader.sh
Executable file
3
bin/changebootloader.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
dd of="$1" bs=1 seek=64 count=512 conv=notrunc < "$2"
|
Loading…
x
Reference in New Issue
Block a user