glukicov / imgtool

imgtool for Mac

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

imgtool

imgtool for Mac

Loads firmware (GoldenImage.bin) to an SD card to be installed on one of the logic boards.

Instructions:

git clone git@github.com:glukicov/imgtool.git
make clean
make Board=FC7_0
cd bin

Insert and unmount the SD card first

diskutil list (to find e.g. dev/disk2 for the SD card) 
diskutil unmountDisk /dev/disk2
sudo ./imgtool /dev/disk2 format GoldenImage.bin
sudo ./imgtool /dev/disk2 add GoldenImage.bin GoldenImage.bin

List of changes to the original code

A) Changes to imgetool.c in imgtool/src/common

[line 10]

 #include <sys/disk.h> //Mac specific

[line 561-562]

//xRet = ioctl ( gFD, BLKGETSIZE64, &xImageSz );       //Linux
 xRet = ioctl(gFD, DKIOCGETBLOCKCOUNT, &pSize);  //Mac: 

[line 566]

//*pSize = xImageSz / BLK_SIZE;  // Linux: no need to divide here

B) Changes to Makefile (to use gcc instead of clang) gcc-> gcc.49; make sure you have gcc-4.9 installed with brew install gcc49

CC=gcc-4.9 

About

imgtool for Mac


Languages

Language:C 53.6%Language:Objective-C 44.9%Language:Makefile 0.8%Language:C++ 0.7%