From c3922613ea20450b3cca6c21f3b22e76aa618165 Mon Sep 17 00:00:00 2001 From: 4am Date: Fri, 20 Sep 2019 20:56:24 -0400 Subject: [PATCH] refactor changebootloader --- Makefile | 2 +- bin/changebootloader.py | 15 --------------- bin/changebootloader.sh | 3 +++ 3 files changed, 4 insertions(+), 16 deletions(-) delete mode 100755 bin/changebootloader.py create mode 100755 bin/changebootloader.sh diff --git a/Makefile b/Makefile index e1162c58b..53bf87350 100644 --- a/Makefile +++ b/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 diff --git a/bin/changebootloader.py b/bin/changebootloader.py deleted file mode 100755 index 87e59d366..000000000 --- a/bin/changebootloader.py +++ /dev/null @@ -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) diff --git a/bin/changebootloader.sh b/bin/changebootloader.sh new file mode 100755 index 000000000..9f4b8c6d4 --- /dev/null +++ b/bin/changebootloader.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +dd of="$1" bs=1 seek=64 count=512 conv=notrunc < "$2"