mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-01-11 07:19:34 -05:00
Use head/cat, /dev/zero to pad HackRF firmware
dd approach didn't work for at least one user. Resolves #42.
This commit is contained in:
parent
985cbb874c
commit
255de16d3e
@ -25,7 +25,7 @@ PATH_BASEBAND=baseband
|
||||
|
||||
# TODO: Pass these (as #defines?) to Makefiles, use values in code.
|
||||
PAD_BOOTSTRAP=0x10000
|
||||
PAD_HACKRF_FIRMWARE=0x10000
|
||||
PAD_HACKRF_FIRMWARE=65536
|
||||
PAD_BASEBAND=0x20000
|
||||
|
||||
TARGET=portapack-h1-firmware
|
||||
@ -64,8 +64,8 @@ $(TARGET_BOOTSTRAP)_pad.bin: $(TARGET_BOOTSTRAP).elf
|
||||
|
||||
$(TARGET_HACKRF_FIRMWARE)_dfu_pad.bin: $(TARGET_HACKRF_FIRMWARE).dfu
|
||||
# TODO: Not confident this is reliable. It certainly won't work on Windows.
|
||||
cp $(TARGET_HACKRF_FIRMWARE).dfu $(TARGET_HACKRF_FIRMWARE)_dfu_pad.bin
|
||||
dd if=/dev/null of=$(TARGET_HACKRF_FIRMWARE)_dfu_pad.bin bs=1 count=1 seek=$(PAD_HACKRF_FIRMWARE)
|
||||
# Pad the .dfu with zeros, then truncate to the desired length.
|
||||
head -c $(PAD_HACKRF_FIRMWARE) /dev/zero | cat $(TARGET_HACKRF_FIRMWARE).dfu - | head -c $(PAD_HACKRF_FIRMWARE) >$(TARGET_HACKRF_FIRMWARE)_dfu_pad.bin
|
||||
|
||||
$(TARGET_BASEBAND)_pad.bin: $(TARGET_BASEBAND).elf
|
||||
$(CP) -O binary --pad-to $(PAD_BASEBAND) $(TARGET_BASEBAND).elf $(TARGET_BASEBAND)_pad.bin
|
||||
|
Loading…
Reference in New Issue
Block a user