Skip to content

Instantly share code, notes, and snippets.

@doug65536
Created September 25, 2017 02:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doug65536/73d393357c5115c49573a62aee34b816 to your computer and use it in GitHub Desktop.
Save doug65536/73d393357c5115c49573a62aee34b816 to your computer and use it in GitHub Desktop.
fatdisk.img: mbr-bin bootfat-bin diskfat.mk
set -x && \
rm -f fatpart.img fatdisk.img && \
truncate --size=15360K fatpart.img && \
mkfs.vfat -R 16 fatpart.img && \
dd if=bootfat-bin of=fatpart.img \
bs=1 seek=90 skip=90 conv=notrunc && \
truncate --size=16M fatdisk.img && \
echo -e 'o\nn\np\n1\n2048\n\nt\nc\np\nw\n' | \
fdisk fatdisk.img && \
dd if=fatpart.img of=fatdisk.img \
bs=512 seek=2048 conv=notrunc && \
dd if=mbr-bin of=fatdisk.img \
bs=1 count=446 conv=notrunc && \
dd if=mbr-bin of=fatdisk.img \
bs=1 seek=510 skip=510 count=2 conv=notrunc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment