Index: rbutil/rbutilqt/rbutil.ini
===================================================================
--- rbutil/rbutilqt/rbutil.ini	(révision 31041)
+++ rbutil/rbutilqt/rbutil.ini	(copie de travail)
@@ -501,7 +501,7 @@
 [sansafuzeplus]
 name="Sansa Fuze+"
 buildserver_modelname=sansafuzeplus
-bootloadermethod=none ; no bootloader for now
+bootloadermethod=imx
 bootloadername=/sandisk-sansa/fuzeplus/bootloader-fuzeplus.sansa
 bootloaderfile=/firmware.sb
 manualname=
@@ -510,7 +510,7 @@
 usberror=
 configure_modelname=sansafuzeplus
 encoder=rbspeex
-status=disabled
+;status=disabled
 
 [sansam200v4]
 name="Sansa m200v4"
Index: rbutil/rbutilqt/rbutilqt.pri
===================================================================
--- rbutil/rbutilqt/rbutilqt.pri	(révision 31041)
+++ rbutil/rbutilqt/rbutilqt.pri	(copie de travail)
@@ -63,6 +63,7 @@
  base/bootloaderinstallams.cpp \
  base/bootloaderinstalltcc.cpp \
  base/bootloaderinstallmpio.cpp \
+ base/bootloaderinstallimx.cpp \
  base/rockboxinfo.cpp \
  ../../tools/mkboot.c \
  ../../tools/iriver.c \
@@ -130,6 +131,7 @@
  base/bootloaderinstallams.h \
  base/bootloaderinstalltcc.h \
  base/bootloaderinstallmpio.h \
+ base/bootloaderinstallimx.h \
  base/rockboxinfo.h \
  ../../tools/mkboot.h \
  ../../tools/iriver.h \
Index: rbutil/rbutilqt/rbutilqt.pro
===================================================================
--- rbutil/rbutilqt/rbutilqt.pro	(révision 31041)
+++ rbutil/rbutilqt/rbutilqt.pro	(copie de travail)
@@ -95,8 +95,13 @@
         APPVERSION=\"rbutil\" \
         libmkmpioboot$$RBLIBPOSTFIX \
         CC=\"$$QMAKE_CC $$MACHINEFLAGS\" AR=\"$$MYAR\"
-QMAKE_EXTRA_TARGETS += rbspeex libucl libmkamsboot libmktccboot libmkmpioboot
-PRE_TARGETDEPS += rbspeex libucl libmkamsboot libmktccboot libmkmpioboot
+libmkimxboot.commands = @$(MAKE) -s \
+        TARGET_DIR=$$MYBUILDDIR -C $$RBBASE_DIR/rbutil/mkimxboot \
+        APPVERSION=\"rbutil\" \
+        libmkimxboot$$RBLIBPOSTFIX \
+        CC=\"$$QMAKE_CC $$MACHINEFLAGS\" AR=\"$$MYAR\"
+QMAKE_EXTRA_TARGETS += rbspeex libucl libmkamsboot libmktccboot libmkmpioboot libmkimxboot
+PRE_TARGETDEPS += rbspeex libucl libmkamsboot libmktccboot libmkmpioboot libmkimxboot
 
 # rule for creating ctags file
 tags.commands = ctags -R --c++-kinds=+p --fields=+iaS --extra=+q $(SOURCES)
@@ -114,11 +119,11 @@
 INCLUDEPATH = $$_PRO_FILE_PWD_ $$_PRO_FILE_PWD_/irivertools \
             $$_PRO_FILE_PWD_/quazip $$_PRO_FILE_PWD_/zlib $$_PRO_FILE_PWD_/base
 INCLUDEPATH += $$RBBASE_DIR/rbutil/ipodpatcher $$RBBASE_DIR/rbutil/sansapatcher \
-            $$RBBASE_DIR/tools/rbspeex $$RBBASE_DIR/tools
+            $$RBBASE_DIR/tools/rbspeex $$RBBASE_DIR/tools 
 
 DEPENDPATH = $$INCLUDEPATH
 
-LIBS += -L$$OUT_PWD -L$$MYBUILDDIR -lrbspeex -lmkamsboot -lmktccboot -lmkmpioboot -lucl
+LIBS += -L$$OUT_PWD -L$$MYBUILDDIR -lrbspeex -lmkamsboot -lmktccboot -lmkmpioboot -lmkimxboot -lucl
 !win32 {
     LIBS += -lz
 }
Index: rbutil/rbutilqt/base/bootloaderinstallimx.h
===================================================================
--- rbutil/rbutilqt/base/bootloaderinstallimx.h	(révision 0)
+++ rbutil/rbutilqt/base/bootloaderinstallimx.h	(révision 0)
@@ -0,0 +1,43 @@
+/***************************************************************************
+ *             __________               __   ___.
+ *   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
+ *   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
+ *   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
+ *   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
+ *                     \/            \/     \/    \/            \/
+ *
+ *   Copyright (C) 2011 by Jean-Louis Biasini
+ *
+ *
+ * All files in this archive are subject to the GNU General Public License.
+ * See the file COPYING in the source tree root for full license agreement.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+#ifndef BOOTLOADERINSTALLIMX_H
+#define BOOTLOADERINSTALLIMX_H
+
+#include <QtCore>
+#include "bootloaderinstallbase.h"
+
+//! bootloader installation class for devices handled by mkimxboot.
+class BootloaderInstallImx : public BootloaderInstallBase
+{
+    Q_OBJECT
+    public:
+        BootloaderInstallImx(QObject *parent);
+        bool install(void);
+        bool uninstall(void);
+        BootloaderInstallBase::BootloaderType installed(void);
+        Capabilities capabilities(void);
+        QString ofHint();
+
+    private:
+
+    private slots:
+        void installStage2(void);
+};
+
+#endif
Index: rbutil/rbutilqt/base/bootloaderinstallimx.cpp
===================================================================
--- rbutil/rbutilqt/base/bootloaderinstallimx.cpp	(révision 0)
+++ rbutil/rbutilqt/base/bootloaderinstallimx.cpp	(révision 0)
@@ -0,0 +1,113 @@
+/***************************************************************************
+ *             __________               __   ___.
+ *   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
+ *   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
+ *   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
+ *   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
+ *                     \/            \/     \/    \/            \/
+ *
+ *   Copyright (C) 2008 by Dominik Riebeling
+ *
+ * All files in this archive are subject to the GNU General Public License.
+ * See the file COPYING in the source tree root for full license agreement.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+
+#include <QtCore>
+#include "bootloaderinstallbase.h"
+#include "bootloaderinstallimx.h"
+
+#include "../../mkimxboot/mkimxboot.h"
+#include "utils.h"
+
+BootloaderInstallImx::BootloaderInstallImx(QObject *parent)
+        : BootloaderInstallBase(parent)
+{
+}
+
+QString BootloaderInstallImx::ofHint()
+{
+    return tr("Bootloader installation requires you to provide "
+              "a copy of the original Sandisk firmware (sb file). "
+              "This firmware file will be patched and then installed to your "
+              "player along with the rockbox bootloader. "
+              "You need to download this file yourself due to legal "
+              "reasons. Please browse the "
+              "<a href='http://forums.sandisk.com/sansa/'>Sansa Forums'</a> "
+              //"or refer to the "
+              //"<a href='http://www.rockbox.org/manual.shtml'>manual</a> and "
+              //"the <a href='http://www.rockbox.org/wiki/SansaAMS'>SansaAMS</a> "
+              //"wiki page on how to obtain this file.<br/>"
+              "Press Ok to continue and browse your computer for the firmware "
+              "file.");
+}
+
+
+/** Start bootloader installation.
+ */
+bool BootloaderInstallImx::install(void)
+{
+    if(m_offile.isEmpty())
+        return false;
+
+    //qDebug() << "[BootloaderInstallImx] installing bootloader";
+
+    // download firmware from server
+    //emit logItem(tr("Downloading bootloader file"), LOGINFO);
+
+    //connect(this, SIGNAL(downloadDone()), this, SLOT(installStage2()));
+    //downloadBlStart(m_blurl);
+
+    return true;
+}
+
+void BootloaderInstallImx::installStage2(void)
+{
+    qDebug() << "[BootloaderInstallImx] installStage2";
+
+    m_tempfile.open();
+    QString bootfile = m_tempfile.fileName();
+    m_tempfile.close();
+
+    struct imx_option_t opt;
+    
+    /* default option untill we know how to use the interface :)                                  TODO */
+    opt.debug = true;
+    opt.output = IMX_DUALBOOT;
+    const char* outfile = "firmware.sb";
+    enum imx_error_t err = mkimxboot(m_offile.toLocal8Bit().data(), bootfile.toLocal8Bit().data(), outfile, opt);
+
+
+
+
+    //end of install
+    if (err == 0)
+    {
+    qDebug() << "[BootloaderInstallImx] install successfull";
+    emit logItem(tr("Success: modified firmware file created"), LOGINFO);
+    logInstall(LogAdd);
+    emit done(false);
+    }
+    return;
+}
+
+bool BootloaderInstallImx::uninstall(void)
+{
+    emit logItem(tr("To uninstall, perform a normal upgrade with an unmodified "
+                    "original firmware"), LOGINFO);
+    logInstall(LogRemove);
+    return false;
+}
+
+BootloaderInstallBase::BootloaderType BootloaderInstallImx::installed(void)
+{
+    return BootloaderUnknown;
+}
+
+BootloaderInstallBase::Capabilities BootloaderInstallImx::capabilities(void)
+{
+    return (Install | NeedsOf);
+}
Index: rbutil/rbutilqt/base/bootloaderinstallbase.cpp
===================================================================
--- rbutil/rbutilqt/base/bootloaderinstallbase.cpp	(révision 31041)
+++ rbutil/rbutilqt/base/bootloaderinstallbase.cpp	(copie de travail)
@@ -29,6 +29,7 @@
 #include "bootloaderinstallams.h"
 #include "bootloaderinstalltcc.h"
 #include "bootloaderinstallmpio.h"
+#include "bootloaderinstallimx.h"
 #include "utils.h"
 
 #if defined(Q_OS_MACX)
@@ -67,6 +68,9 @@
     else if(type == "mpio") {
         return new BootloaderInstallMpio(parent);
     }
+    else if(type == "imx") {
+        return new BootloaderInstallImx(parent);
+    }
     else {
         return NULL;
     }
Index: rbutil/mkimxboot/mkimxboot.h
===================================================================
--- rbutil/mkimxboot/mkimxboot.h	(révision 31041)
+++ rbutil/mkimxboot/mkimxboot.h	(copie de travail)
@@ -18,12 +18,17 @@
  * KIND, either express or implied.
  *
  ****************************************************************************/
+#ifndef MKIMXBOOT_H
+#define MKIMXBOOT_H
 
 #include <stdbool.h>
 #include <stdint.h>
 #include <sys/types.h>
-#include "sb.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 enum imx_error_t
 {
     IMX_SUCCESS = 0,
@@ -53,3 +58,9 @@
 
 enum imx_error_t mkimxboot(const char *infile, const char *bootfile,
     const char *outfile, struct imx_option_t opt);
+
+#ifdef __cplusplus
+};
+#endif 
+
+#endif
