summaryrefslogtreecommitdiff
path: root/rbutil/rbutilqt
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/rbutilqt')
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstallams.cpp33
1 files changed, 17 insertions, 16 deletions
diff --git a/rbutil/rbutilqt/base/bootloaderinstallams.cpp b/rbutil/rbutilqt/base/bootloaderinstallams.cpp
index b1f47eda93..3bdd084c60 100644
--- a/rbutil/rbutilqt/base/bootloaderinstallams.cpp
+++ b/rbutil/rbutilqt/base/bootloaderinstallams.cpp
@@ -72,6 +72,7 @@ void BootloaderInstallAms::installStage2(void)
72 struct md5sums sum; 72 struct md5sums sum;
73 char md5sum[33]; /* 32 hex digits, plus terminating zero */ 73 char md5sum[33]; /* 32 hex digits, plus terminating zero */
74 int n; 74 int n;
75 int model;
75 int firmware_size; 76 int firmware_size;
76 int bootloader_size; 77 int bootloader_size;
77 int patchable; 78 int patchable;
@@ -84,33 +85,33 @@ void BootloaderInstallAms::installStage2(void)
84 QString bootfile = m_tempfile.fileName(); 85 QString bootfile = m_tempfile.fileName();
85 m_tempfile.close(); 86 m_tempfile.close();
86 87
87 /* Load original firmware file */
88 buf = load_of_file(m_offile.toLocal8Bit().data(), &len,&sum,&firmware_size,
89 &of_packed,&of_packedsize,errstr,sizeof(errstr));
90 if (buf == NULL)
91 {
92 qDebug() << "[BootloaderInstallAms] could not load OF: " << m_offile;
93 emit logItem(errstr, LOGERROR);
94 emit logItem(tr("Could not load %1").arg(m_offile), LOGERROR);
95 emit done(true);
96 return;
97 }
98
99 /* Load bootloader file */ 88 /* Load bootloader file */
100 rb_packed = load_rockbox_file(bootfile.toLocal8Bit().data(), sum.model, 89 rb_packed = load_rockbox_file(bootfile.toLocal8Bit().data(), &model,
101 &bootloader_size,&rb_packedsize, 90 &bootloader_size,&rb_packedsize,
102 errstr,sizeof(errstr)); 91 errstr,sizeof(errstr));
103 if (rb_packed == NULL) 92 if (rb_packed == NULL)
104 { 93 {
105 qDebug() << "[BootloaderInstallAms] could not load bootloader: " << bootfile; 94 qDebug() << "[BootloaderInstallAms] could not load bootloader: " << bootfile;
106 emit logItem(errstr, LOGERROR); 95 emit logItem(errstr, LOGERROR);
107 emit logItem(tr("Could not load %1").arg(bootfile), LOGERROR); 96 emit logItem(tr("Could not load %1").arg(bootfile), LOGERROR);
108 free(buf);
109 free(of_packed);
110 emit done(true); 97 emit done(true);
111 return; 98 return;
112 } 99 }
113 100
101 /* Load original firmware file */
102 buf = load_of_file(m_offile.toLocal8Bit().data(), model, &len, &sum,
103 &firmware_size, &of_packed ,&of_packedsize,
104 errstr, sizeof(errstr));
105 if (buf == NULL)
106 {
107 qDebug() << "[BootloaderInstallAms] could not load OF: " << m_offile;
108 emit logItem(errstr, LOGERROR);
109 emit logItem(tr("Could not load %1").arg(m_offile), LOGERROR);
110 free(rb_packed);
111 emit done(true);
112 return;
113 }
114
114 /* check total size */ 115 /* check total size */
115 patchable = check_sizes(sum.model, rb_packedsize, bootloader_size, 116 patchable = check_sizes(sum.model, rb_packedsize, bootloader_size,
116 of_packedsize, firmware_size, &totalsize, errstr, sizeof(errstr)); 117 of_packedsize, firmware_size, &totalsize, errstr, sizeof(errstr));