Index: rbutil/rbutilqt/rbutil.ini
===================================================================
--- rbutil/rbutilqt/rbutil.ini	(révision 31416)
+++ rbutil/rbutilqt/rbutil.ini	(copie de travail)
@@ -501,7 +503,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 +512,6 @@
 usberror=
 configure_modelname=sansafuzeplus
 encoder=rbspeex
-status=disabled
 
 [sansam200v4]
 name="Sansa m200v4"
Index: rbutil/rbutilqt/rbutilqt.pri
===================================================================
--- rbutil/rbutilqt/rbutilqt.pri	(révision 31416)
+++ rbutil/rbutilqt/rbutilqt.pri	(copie de travail)
@@ -60,6 +60,7 @@
  base/bootloaderinstallams.cpp \
  base/bootloaderinstalltcc.cpp \
  base/bootloaderinstallmpio.cpp \
+ base/bootloaderinstallimx.cpp \
  base/rockboxinfo.cpp \
  ../../tools/mkboot.c \
  ../../tools/iriver.c \
@@ -121,6 +122,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 31416)
+++ rbutil/rbutilqt/rbutilqt.pro	(copie de travail)
@@ -119,10 +119,15 @@
         APPVERSION=\"rbutil\" \
         libchinachippatcher$$RBLIBPOSTFIX \
         CC=\"$$QMAKE_CC $$MACHINEFLAGS\" AR=\"$$MYAR\"
+libmkimxboot.commands = @$(MAKE) -s \
+        TARGET_DIR=$$MYBUILDDIR -C $$RBBASE_DIR/rbutil/mkimxboot \
+        APPVERSION=\"rbutil\" \
+        libmkimxboot$$RBLIBPOSTFIX \
+        CC=\"$$QMAKE_CC $$MACHINEFLAGS\" AR=\"$$MYAR\"
 # Note: order is important for RBLIBS! The libs are appended to the linker
 # flags in this order, put libucl at the end.
 RBLIBS = librbspeex libipodpatcher libsansapatcher libmkamsboot libmktccboot \
-         libmkmpioboot libchinachippatcher libucl
+         libmkmpioboot libchinachippatcher libmkimxboot libucl
 QMAKE_EXTRA_TARGETS += $$RBLIBS
 PRE_TARGETDEPS += $$RBLIBS
 
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,42 @@
+/***************************************************************************
+ *             __________               __   ___.
+ *   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,146 @@
+/***************************************************************************
+ *             __________               __   ___.
+ *   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.
+ *
+ ****************************************************************************/
+
+#include <QtCore>
+#include <QtDebug>
+#include "bootloaderinstallbase.h"
+#include "bootloaderinstallimx.h"
+#include "../mkimxboot/mkimxboot.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 (firmware.sb file). "
+              "This 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 "
+              "<a href= 'http://www.rockbox.org/wiki/SansaFuzePlus'>Rockbox Fuze+</a> "
+              "wiki page on how to obtain this file.<br/>"
+              "<b>Please also check that your device's battery is over 70% before "
+              "starting the installation of the bootloader</b><br/>"
+              "Press Ok to continue and browse your computer for the firmware's "
+              "file.");
+}
+
+
+/** Start bootloader installation.
+ */
+bool BootloaderInstallImx::install(void)
+{
+    if(m_offile.isEmpty())
+    {
+        qDebug() << "[BootloaderInstallImx] original Sandisk firmware file not found";
+        return false;
+    }
+
+    qDebug() << "[BootloaderInstallImx] downloading 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] patching file...";
+    emit logItem(tr("Patching file..."), LOGINFO);
+    m_tempfile.open();
+    QString rbBootloader = m_tempfile.fileName();
+    m_tempfile.close();
+    
+    struct imx_option_t opt;
+    opt.debug = true;
+    opt.output = IMX_DUALBOOT;
+    
+    enum imx_error_t err = mkimxboot(m_offile.toLocal8Bit().data(), \
+                           rbBootloader.toLocal8Bit().data(), \
+                           "patchedBootloader", \
+                           opt);
+
+    qDebug() << "[BootloaderInstallImx] mkimxboot returned: " << err;
+
+    //if the patch failed 
+    if (err != IMX_SUCCESS)
+    {
+        qDebug() << "[BootloaderInstallImx] Could not patch the original firmware file";
+        emit logItem(tr("Could not patch the original firmware"),LOGERROR);
+        emit done(true);
+        return;
+    }
+    
+    qDebug() << "[BootloaderInstallImx] Original Firmware succesfully patched";
+    emit logItem(tr("The original Sandisk firmware was succesfully patched"), LOGINFO);
+
+    qDebug() << "[BootloaderInstallImx] installing the file in the target's"
+                                                               " folder...";
+    emit logItem(tr("installing the file in the target's folder..."), LOGINFO);
+    // if a bootloader is already present delete it.
+    QString fwfile(m_blfile);
+    if(!fwfile.isEmpty())
+    {
+        qDebug() << "[BootloaderInstallFile] deleting and old target file";
+        QFile::remove(fwfile);
+    }
+
+    // place (new) bootloader
+    QFile patchedBootFile("patchedBootloader");
+    qDebug() << "[BootloaderInstallFile] moving the patched bootloader to"
+                                                                     << fwfile;
+    if(patchedBootFile.rename(fwfile))
+    {
+        emit logItem(tr("Bootloader successful installed"), LOGOK);
+        logInstall(LogAdd);
+        emit done(false);
+
+    }
+    else
+    {
+        emit logItem(tr("Patched booloader could not be installed"), LOGERROR);
+        emit done(true);
+    } 
+    patchedBootFile.close();
+    return;
+
+}
+
+bool BootloaderInstallImx::uninstall(void)
+{
+    emit logItem(tr("To uninstall, perform a normal upgrade with an unmodified "
+                    "original firmware from Sansa Forum"), 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 31416)
+++ 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;
     }
@@ -204,9 +208,12 @@
             "following steps manually:");
 
     msg += "<ol>";
+    if(model == "sansafuzeplus") {
+        msg += tr("<li>Remove any previously inserted microSD card</li>");
+    }
     msg += tr("<li>Safely remove your player.</li>");
     if(model == "h100" || model == "h120" || model == "h300" ||
-       model == "ondavx747") {
+       model == "ondavx747" || model == "sansafuzeplus") {
         hint = true;
         msg += tr("<li>Reboot your player into the original firmware.</li>"
                 "<li>Perform a firmware upgrade using the update functionality "
