Enable generation of FL2 files - unfortunately, needs a custom rule for each output - just x230 for now
parent
7199f87771
commit
3dbdedbd3f
@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Quick and dirty script to insert a slice into a binary file
|
||||
# Copyright (C) 2016 Hamish Coleman
|
||||
#
|
||||
# TODO:
|
||||
# - a tool that is portable to Windows
|
||||
# - should output dependancy information
|
||||
|
||||
INFOFILE="$1"
|
||||
if [ ! -r "$INFOFILE" ]; then
|
||||
echo Need file with source and offset info
|
||||
exit 1
|
||||
fi
|
||||
shift
|
||||
|
||||
INPUT="$1"
|
||||
if [ -z "$INPUT" ]; then
|
||||
echo Need input filename
|
||||
exit 1
|
||||
fi
|
||||
shift
|
||||
|
||||
OUT="$1"
|
||||
if [ -z "$OUT" ]; then
|
||||
echo Need output filename
|
||||
exit 1
|
||||
fi
|
||||
|
||||
read SOURCE OFFSET LENGTH <"$INFOFILE"
|
||||
|
||||
set -x
|
||||
|
||||
cp --reflink=auto $SOURCE $OUT
|
||||
dd status=none if=$INPUT bs=$[$LENGTH] count=1 | dd status=none conv=notrunc bs=$[$OFFSET] seek=1 of="$OUT"
|
||||
|
Loading…
Reference in New Issue