Heimdall is an Open-Source utility to work with Android devices manufactured by Samsung. It allows to flash firmware components into memory via FastBoot/ODIN+USB. I have created a patch to build this nice tool on FreeBSD OS (QT gui works as well, to build it you need qt-{gui,qmake,uic,moc,rcc,…} packages installed). When patch is included into the project sources and release is done, I will prepare a FreeBSD port for this nice utility which is only missing a memory dump and live boot to be totally perfect 🙂

From 84ad32cdc4824505d68718f05e435a9e5043fe44 Mon Sep 17 00:00:00 2001
From: Tomasz CEDRO <cederom@tlen.pl>
Date: Thu, 9 Jan 2014 12:30:15 +0100
Subject: [PATCH] Enabled build on FreeBSD.

configure.ac scripts were updated with OS_FREEBSD detection.
Header files fix. LibUSB-X defines fix to build on FreeBSD-LibUSB.
Heimdall-Frontend works, remember about qt4-{gui,qmake,uic,moc,rcc,..}.
---
heimdall/configure.ac | 6 ++++++
heimdall/source/Heimdall.h | 13 ++++++++++++-
libpit/configure.ac | 5 +++++
3 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/heimdall/configure.ac b/heimdall/configure.ac
index 4654730..b97f7f8 100644
--- a/heimdall/configure.ac
+++ b/heimdall/configure.ac
@@ -37,6 +37,12 @@ case $target in
AC_PROG_CXX
linuxtarget=false
;;
+*-freebsd*)
+ AC_DEFINE(OS_FREEBSD, [], [FreeBSD backend])
+ AC_MSG_RESULT([FreeBSD])
+ AC_PROG_CXX
+ linuxtarget=false
+ ;;
*)
AC_MSG_ERROR([unsupported operating system])
esac
diff --git a/heimdall/source/Heimdall.h b/heimdall/source/Heimdall.h
index 5a5b4c6..eb75ada 100644
--- a/heimdall/source/Heimdall.h
+++ b/heimdall/source/Heimdall.h
@@ -30,7 +30,7 @@

#include "../config.h"

-#if defined(OS_DARWIN) || defined(OS_LINUX)
+#if defined(OS_DARWIN) || defined(OS_LINUX) || defined(OS_FREEBSD)
#include

> cat 0001-Enabled-build-on-FreeBSD.patch
From 84ad32cdc4824505d68718f05e435a9e5043fe44 Mon Sep 17 00:00:00 2001
From: Tomasz CEDRO <cederom@tlen.pl>
Date: Thu, 9 Jan 2014 12:30:15 +0100
Subject: [PATCH] Enabled build on FreeBSD.

configure.ac scripts were updated with OS_FREEBSD detection.
Header files fix. LibUSB-X defines fix to build on FreeBSD-LibUSB.
Heimdall-Frontend works, remember about qt4-{gui,qmake,uic,moc,rcc,..}.
---
heimdall/configure.ac | 6 ++++++
heimdall/source/Heimdall.h | 13 ++++++++++++-
libpit/configure.ac | 5 +++++
3 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/heimdall/configure.ac b/heimdall/configure.ac
index 4654730..b97f7f8 100644
--- a/heimdall/configure.ac
+++ b/heimdall/configure.ac
@@ -37,6 +37,12 @@ case $target in
AC_PROG_CXX
linuxtarget=false
;;
+*-freebsd*)
+ AC_DEFINE(OS_FREEBSD, [], [FreeBSD backend])
+ AC_MSG_RESULT([FreeBSD])
+ AC_PROG_CXX
+ linuxtarget=false
+ ;;
*)
AC_MSG_ERROR([unsupported operating system])
esac
diff --git a/heimdall/source/Heimdall.h b/heimdall/source/Heimdall.h
index 5a5b4c6..eb75ada 100644
--- a/heimdall/source/Heimdall.h
+++ b/heimdall/source/Heimdall.h
@@ -30,7 +30,7 @@

#include "../config.h"

-#if defined(OS_DARWIN) || defined(OS_LINUX)
+#if defined(OS_DARWIN) || defined(OS_LINUX) || defined(OS_FREEBSD)
#include
#define Sleep(t) usleep(1000*t)
#else
@@ -47,4 +47,15 @@

#endif

+#if defined(OS_FREEBSD)
+/* LibUSB-X fix. */
+enum libusb_log_level {
+ LIBUSB_LOG_LEVEL_NONE = 0,
+ LIBUSB_LOG_LEVEL_ERROR,
+ LIBUSB_LOG_LEVEL_WARNING,
+ LIBUSB_LOG_LEVEL_INFO,
+ LIBUSB_LOG_LEVEL_DEBUG,
+};
+#endif
+
#endif
diff --git a/libpit/configure.ac b/libpit/configure.ac
index a86ad28..6fac0cc 100644
--- a/libpit/configure.ac
+++ b/libpit/configure.ac
@@ -36,6 +36,11 @@ case $target in
AC_MSG_RESULT([Windows])
AC_PROG_CXX
;;
+*-freebsd*)
+ AC_DEFINE(OS_FREEBSD, [], [FreeBSD backend])
+ AC_MSG_RESULT([FreeBSD])
+ AC_PROG_CXX
+ ;;
*)
AC_MSG_ERROR([unsupported operating system])
esac
--
1.8.5.2