Enable generation of FL2 files - unfortunately, needs a custom rule for each output - just x230 for now

update
Hamish Coleman 8 years ago
parent 7199f87771
commit 3dbdedbd3f

@ -46,6 +46,8 @@ install.radare.projects:
# just the Xx30 series, these generic rules will need to be reworked
# keep intermediate files
.PRECIOUS: %.orig
.PRECIOUS: %.img
.PRECIOUS: %.img.orig
# Generate a working file with any known patches applied
@ -81,3 +83,9 @@ x220.8DHT34WW.img.enc.slice: x220.8DHT34WW.s01CB000.FL2.orig
x230.G2HT35WW.img.enc.slice: x230.G2HT35WW.s01D3000.FL2.orig
t430.G1HT35WW.img.enc.slice: g1uj38us.iso.orig
t430s.G7HT39WW.img.enc.slice: g7uj18us.iso.orig
x230.G2HT35WW.s01D3000.FL2: x230.G2HT35WW.img.enc.slice x230.G2HT35WW.img.enc
# Hacky, non generic rule
x230.G2HT35WW.s01D3000.FL2: x230.G2HT35WW.img.enc
./slice.insert $<.slice $< $@

@ -24,5 +24,5 @@ read SOURCE OFFSET LENGTH <"$INFOFILE"
set -x
dd iflag=count_bytes,skip_bytes if=$SOURCE skip=$[$OFFSET] count=$[$LENGTH] of="$OUT"
dd status=none iflag=count_bytes,skip_bytes if=$SOURCE skip=$[$OFFSET] count=$[$LENGTH] of="$OUT"

@ -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…
Cancel
Save