Skip to content

Instantly share code, notes, and snippets.

@hak8or
Created January 5, 2015 02:37
Show Gist options
  • Save hak8or/35877e736efc306a464e to your computer and use it in GitHub Desktop.
Save hak8or/35877e736efc306a464e to your computer and use it in GitHub Desktop.
Write BCB to SD card
echo "Remove old files"
rm bcb
rm bcb_512.cfg
rm bcb_sdcard_part.old
rm bcb_sdcard_part.readback
echo "Compiling bcb tool"
gcc bcb.c -o bcb
echo "Running bcb tool"
./bcb
echo "Saving old partition contents to bcb_sdcard_part.old"
dd if=/dev/sdb3 of=bcb_sdcard_part.old
echo "============= Contents of ->OLD<- BCD ============="
hd bcb_sdcard_part.old
echo "Clear the SD card boot block partition first"
dd if=/dev/zero of=/dev/sdb3
sync
echo "Write the BCD to the sd card BCD parition"
dd if=bcb_512.cfg of=/dev/sdb3
sync
echo "Reading back BCD partition for verification"
dd if=/dev/sdb3 of=bcb_sdcard_part.readback
echo "============= Contents of ->NEW<- BCD ============="
hd bcb_sdcard_part.readback
sync
echo "Done, remove card"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment