diff options
Diffstat (limited to 'rbutil')
-rw-r--r-- | rbutil/chinachippatcher/Makefile | 10 | ||||
-rw-r--r-- | rbutil/chinachippatcher/chinachip.c | 310 | ||||
-rw-r--r-- | rbutil/chinachippatcher/chinachip.h | 39 | ||||
-rw-r--r-- | rbutil/rbutilqt/base/bootloaderinstallbase.cpp | 3 | ||||
-rw-r--r-- | rbutil/rbutilqt/base/bootloaderinstallchinachip.cpp | 117 | ||||
-rw-r--r-- | rbutil/rbutilqt/base/bootloaderinstallchinachip.h | 43 | ||||
-rw-r--r-- | rbutil/rbutilqt/rbutil.ini | 14 | ||||
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.cpp | 5 | ||||
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.pro | 4 |
9 files changed, 544 insertions, 1 deletions
diff --git a/rbutil/chinachippatcher/Makefile b/rbutil/chinachippatcher/Makefile new file mode 100644 index 0000000000..e19052a006 --- /dev/null +++ b/rbutil/chinachippatcher/Makefile | |||
@@ -0,0 +1,10 @@ | |||
1 | CFLAGS=-g -Wall -DSTANDALONE | ||
2 | CC=gcc | ||
3 | |||
4 | all: chinachip | ||
5 | |||
6 | chinachip: chinachip.c | ||
7 | $(CC) $(CFLAGS) -o $@ $^ | ||
8 | |||
9 | clean: | ||
10 | rm -f chinachip | ||
diff --git a/rbutil/chinachippatcher/chinachip.c b/rbutil/chinachippatcher/chinachip.c new file mode 100644 index 0000000000..e7d4095b38 --- /dev/null +++ b/rbutil/chinachippatcher/chinachip.c | |||
@@ -0,0 +1,310 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2009 by Maurus Cuelenaere | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | #include <stdio.h> | ||
22 | #include <stdarg.h> | ||
23 | #include <stddef.h> | ||
24 | #include <stdlib.h> | ||
25 | #include <stdint.h> | ||
26 | #include <string.h> | ||
27 | #include <time.h> | ||
28 | #include "chinachip.h" | ||
29 | |||
30 | /* From http://www.rockbox.org/wiki/ChinaChip */ | ||
31 | struct header | ||
32 | { | ||
33 | uint32_t signature; /* WADF */ | ||
34 | uint32_t unk; | ||
35 | int8_t timestamp[12]; /* 200805081100 */ | ||
36 | uint32_t size; | ||
37 | uint32_t checksum; | ||
38 | uint32_t unk2; | ||
39 | int8_t identifier[32]; /* Chinachip PMP firmware V1.0 */ | ||
40 | } __attribute__ ((packed)); | ||
41 | |||
42 | static inline void int2le(unsigned char* addr, unsigned int val) | ||
43 | { | ||
44 | addr[0] = val & 0xff; | ||
45 | addr[1] = (val >> 8) & 0xff; | ||
46 | addr[2] = (val >> 16) & 0xff; | ||
47 | addr[3] = (val >> 24) & 0xff; | ||
48 | } | ||
49 | |||
50 | static inline unsigned int le2int(unsigned char* buf) | ||
51 | { | ||
52 | return (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; | ||
53 | } | ||
54 | |||
55 | static long int filesize(FILE* fd) | ||
56 | { | ||
57 | long int len; | ||
58 | fseek(fd, 0, SEEK_END); | ||
59 | len = ftell(fd); | ||
60 | fseek(fd, 0, SEEK_SET); | ||
61 | return len; | ||
62 | } | ||
63 | |||
64 | #ifdef STANDALONE | ||
65 | #define ERR(fmt, ...) err(userdata, "[ERR] "fmt"\n", ##__VA_ARGS__) | ||
66 | #define INFO(fmt, ...) info(userdata, "[INFO] "fmt"\n", ##__VA_ARGS__) | ||
67 | #define tr(x) x | ||
68 | #else | ||
69 | #define ERR(fmt, ...) err(userdata, fmt, ##__VA_ARGS__) | ||
70 | #define INFO(fmt, ...) info(userdata, fmt, ##__VA_ARGS__) | ||
71 | #endif | ||
72 | #define FCLOSE(fd) fclose(fd); fd = NULL; | ||
73 | #define CCPMPBIN_HEADER_SIZE (sizeof(uint32_t)*2 + sizeof(uint8_t) + 9) | ||
74 | #define TOTAL_SIZE (fsize + CCPMPBIN_HEADER_SIZE + bsize) | ||
75 | int chinachip_patch(const char* firmware, const char* bootloader, | ||
76 | const char* output, const char* ccpmp_backup, | ||
77 | void (*info)(void*, char*, ...), | ||
78 | void (*err)(void*, char*, ...), | ||
79 | void* userdata) | ||
80 | { | ||
81 | char header_time[13]; | ||
82 | time_t cur_time; | ||
83 | struct tm* time_info; | ||
84 | unsigned char* buf = NULL; | ||
85 | FILE *fd = NULL, *bd = NULL, *od = NULL; | ||
86 | unsigned int ccpmp_size = 0, i, fsize, bsize; | ||
87 | signed int checksum = 0, ccpmp_pos; | ||
88 | |||
89 | fd = fopen(firmware, "rb"); | ||
90 | if(!fd) | ||
91 | { | ||
92 | ERR("Can't open file %s!", firmware); | ||
93 | goto err; | ||
94 | } | ||
95 | bd = fopen(bootloader, "rb"); | ||
96 | if(!bd) | ||
97 | { | ||
98 | ERR("Can't open file %s!", bootloader); | ||
99 | goto err; | ||
100 | } | ||
101 | |||
102 | bsize = filesize(bd); | ||
103 | INFO("Bootloader size is %d bytes", bsize); | ||
104 | FCLOSE(bd); | ||
105 | |||
106 | fsize = filesize(fd); | ||
107 | INFO("Firmware size is %d bytes", fsize); | ||
108 | |||
109 | buf = malloc(TOTAL_SIZE); | ||
110 | if(buf == NULL) | ||
111 | { | ||
112 | ERR("Can't allocate %d bytes!", fsize); | ||
113 | goto err; | ||
114 | } | ||
115 | memset(buf, 0, TOTAL_SIZE); | ||
116 | |||
117 | INFO("Reading %s into memory...", firmware); | ||
118 | if(fread(buf, fsize, 1, fd) != 1) | ||
119 | { | ||
120 | ERR("Can't read file %s to memory!", firmware); | ||
121 | goto err; | ||
122 | } | ||
123 | FCLOSE(fd); | ||
124 | |||
125 | if(memcmp(buf, "WADF", 4)) | ||
126 | { | ||
127 | ERR("File %s isn't a valid ChinaChip firmware!", firmware); | ||
128 | goto err; | ||
129 | } | ||
130 | |||
131 | ccpmp_pos = -1, i = 0x40; | ||
132 | do | ||
133 | { | ||
134 | int filenamesize = le2int(&buf[i]); | ||
135 | i += sizeof(uint32_t); | ||
136 | |||
137 | if(!strncmp((char*) &buf[i], "ccpmp.bin", 9)) | ||
138 | { | ||
139 | ccpmp_pos = i; | ||
140 | ccpmp_size = le2int(&buf[i + sizeof(uint8_t) + filenamesize]); | ||
141 | } | ||
142 | else | ||
143 | i += filenamesize + le2int(&buf[i + sizeof(uint8_t) + filenamesize]) | ||
144 | + sizeof(uint32_t) + sizeof(uint8_t); | ||
145 | } while(ccpmp_pos < 0 && i < fsize); | ||
146 | |||
147 | if(i >= fsize) | ||
148 | { | ||
149 | ERR("Couldn't find ccpmp.bin in %s!", firmware); | ||
150 | goto err; | ||
151 | } | ||
152 | INFO("Found ccpmp.bin at %d bytes", ccpmp_pos); | ||
153 | |||
154 | if(ccpmp_backup) | ||
155 | { | ||
156 | bd = fopen(ccpmp_backup, "wb"); | ||
157 | if(!bd) | ||
158 | { | ||
159 | ERR("Can't open file %s!", ccpmp_backup); | ||
160 | goto err; | ||
161 | } | ||
162 | |||
163 | INFO("Writing %d bytes to %s...", ccpmp_size, ccpmp_backup); | ||
164 | if(fwrite(&buf[ccpmp_pos], ccpmp_size, 1, bd) != 1) | ||
165 | { | ||
166 | ERR("Can't write to file %s!", ccpmp_backup); | ||
167 | goto err; | ||
168 | } | ||
169 | FCLOSE(bd); | ||
170 | } | ||
171 | |||
172 | INFO("Renaming it to ccpmp.old..."); | ||
173 | buf[ccpmp_pos + 6] = 'o'; | ||
174 | buf[ccpmp_pos + 7] = 'l'; | ||
175 | buf[ccpmp_pos + 8] = 'd'; | ||
176 | |||
177 | bd = fopen(bootloader, "rb"); | ||
178 | if(!bd) | ||
179 | { | ||
180 | ERR("Can't open file %s!", bootloader); | ||
181 | goto err; | ||
182 | } | ||
183 | |||
184 | /* Also include path size */ | ||
185 | ccpmp_pos -= sizeof(uint32_t); | ||
186 | |||
187 | INFO("Making place for ccpmp.bin..."); | ||
188 | memmove(&buf[ccpmp_pos + bsize + CCPMPBIN_HEADER_SIZE], | ||
189 | &buf[ccpmp_pos], fsize - ccpmp_pos); | ||
190 | |||
191 | INFO("Reading %s into memory...", bootloader); | ||
192 | if(fread(&buf[ccpmp_pos + CCPMPBIN_HEADER_SIZE], | ||
193 | bsize, 1, bd) != 1) | ||
194 | { | ||
195 | ERR("Can't read file %s to memory!", bootloader); | ||
196 | goto err; | ||
197 | } | ||
198 | FCLOSE(bd); | ||
199 | |||
200 | INFO("Adding header to %s...", bootloader); | ||
201 | int2le(&buf[ccpmp_pos ], 9); /* Pathname Size */ | ||
202 | memcpy(&buf[ccpmp_pos + 4 ], "ccpmp.bin", 9); /* Pathname */ | ||
203 | memset(&buf[ccpmp_pos + 4 + 9 ], 0x20, sizeof(uint8_t)); /* File Type */ | ||
204 | int2le(&buf[ccpmp_pos + 4 + 9 + 1], bsize); /* File Size */ | ||
205 | |||
206 | time(&cur_time); | ||
207 | time_info = localtime(&cur_time); | ||
208 | if(time_info == NULL) | ||
209 | { | ||
210 | ERR("Can't obtain current time!"); | ||
211 | goto err; | ||
212 | } | ||
213 | |||
214 | snprintf(header_time, 13, "%04d%02d%02d%02d%02d", time_info->tm_year + 1900, | ||
215 | time_info->tm_mon, | ||
216 | time_info->tm_mday, | ||
217 | time_info->tm_hour, | ||
218 | time_info->tm_min); | ||
219 | |||
220 | INFO("Computing checksum..."); | ||
221 | for(i = sizeof(struct header); i < TOTAL_SIZE; i+=4) | ||
222 | checksum += le2int(&buf[i]); | ||
223 | |||
224 | INFO("Updating main header..."); | ||
225 | memcpy(&buf[offsetof(struct header, timestamp)], header_time, 12); | ||
226 | int2le(&buf[offsetof(struct header, size) ], TOTAL_SIZE); | ||
227 | int2le(&buf[offsetof(struct header, checksum) ], checksum); | ||
228 | |||
229 | od = fopen(output, "wb"); | ||
230 | if(!od) | ||
231 | { | ||
232 | ERR("Can't open file %s!", output); | ||
233 | goto err; | ||
234 | } | ||
235 | |||
236 | INFO("Writing output to %s...", output); | ||
237 | if(fwrite(buf, TOTAL_SIZE, 1, od) != 1) | ||
238 | { | ||
239 | ERR("Can't write to file %s!", output); | ||
240 | goto err; | ||
241 | } | ||
242 | fclose(od); | ||
243 | free(buf); | ||
244 | |||
245 | return 0; | ||
246 | |||
247 | err: | ||
248 | if(buf) | ||
249 | free(buf); | ||
250 | if(fd) | ||
251 | fclose(fd); | ||
252 | if(bd) | ||
253 | fclose(bd); | ||
254 | if(od) | ||
255 | fclose(od); | ||
256 | |||
257 | return -1; | ||
258 | } | ||
259 | |||
260 | |||
261 | #ifdef STANDALONE | ||
262 | |||
263 | #define VERSION "0.1" | ||
264 | #define PRINT(fmt, ...) fprintf(stderr, fmt"\n", ##__VA_ARGS__) | ||
265 | |||
266 | static void info(void* userdata, char* fmt, ...) | ||
267 | { | ||
268 | (void)userdata; | ||
269 | va_list args; | ||
270 | va_start(args, fmt); | ||
271 | vfprintf(stderr, fmt, args); | ||
272 | va_end(args); | ||
273 | } | ||
274 | |||
275 | static void err(void* userdata, char* fmt, ...) | ||
276 | { | ||
277 | (void)userdata; | ||
278 | va_list args; | ||
279 | va_start(args, fmt); | ||
280 | vfprintf(stderr, fmt, args); | ||
281 | va_end(args); | ||
282 | } | ||
283 | |||
284 | void usage(char* name) | ||
285 | { | ||
286 | PRINT("Usage:"); | ||
287 | PRINT(" %s <firmware> <bootloader> <firmware_output> [backup]", name); | ||
288 | PRINT("\nExample:"); | ||
289 | PRINT(" %s VX747.HXF bootloader.bin output.HXF ccpmp.bak", name); | ||
290 | PRINT(" This will copy ccpmp.bin in VX747.HXF as ccpmp.old and replace it" | ||
291 | " with bootloader.bin, the output will get written to output.HXF." | ||
292 | " The old ccpmp.bin will get written to ccpmp.bak."); | ||
293 | } | ||
294 | |||
295 | int main(int argc, char* argv[]) | ||
296 | { | ||
297 | PRINT("ChinaChipPatcher v" VERSION " - (C) Maurus Cuelenaere 2009"); | ||
298 | PRINT("This is free software; see the source for copying conditions. There is NO"); | ||
299 | PRINT("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"); | ||
300 | |||
301 | if(argc < 4) | ||
302 | { | ||
303 | usage(argv[0]); | ||
304 | return 1; | ||
305 | } | ||
306 | |||
307 | return chinachip_patch(argv[1], argv[2], argv[3], argc > 4 ? argv[4] : NULL, | ||
308 | &info, &err, NULL); | ||
309 | } | ||
310 | #endif | ||
diff --git a/rbutil/chinachippatcher/chinachip.h b/rbutil/chinachippatcher/chinachip.h new file mode 100644 index 0000000000..2f8ba9e18a --- /dev/null +++ b/rbutil/chinachippatcher/chinachip.h | |||
@@ -0,0 +1,39 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2009 by Maurus Cuelenaere | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #ifndef __INCLUDE_CHINACHIP_H_ | ||
23 | #define __INCLUDE_CHINACHIP_H_ | ||
24 | |||
25 | #ifdef __cplusplus | ||
26 | extern "C" { | ||
27 | #endif | ||
28 | |||
29 | int chinachip_patch(const char* firmware, const char* bootloader, | ||
30 | const char* output, const char* ccpmp_backup, | ||
31 | void (*info)(void*, char*, ...), | ||
32 | void (*err)(void*, char*, ...), | ||
33 | void* userdata); | ||
34 | |||
35 | #ifdef __cplusplus | ||
36 | } | ||
37 | #endif | ||
38 | |||
39 | #endif /* __INCLUDE_CHINACHIP_H_ */ | ||
diff --git a/rbutil/rbutilqt/base/bootloaderinstallbase.cpp b/rbutil/rbutilqt/base/bootloaderinstallbase.cpp index 5ce735a5b7..a4cf22af29 100644 --- a/rbutil/rbutilqt/base/bootloaderinstallbase.cpp +++ b/rbutil/rbutilqt/base/bootloaderinstallbase.cpp | |||
@@ -155,7 +155,8 @@ QString BootloaderInstallBase::postinstallHints(QString model) | |||
155 | 155 | ||
156 | msg += "<ol>"; | 156 | msg += "<ol>"; |
157 | msg += tr("<li>Safely remove your player.</li>"); | 157 | msg += tr("<li>Safely remove your player.</li>"); |
158 | if(model == "h100" || model == "h120" || model == "h300") { | 158 | if(model == "h100" || model == "h120" || model == "h300" || |
159 | model == "ondavx747") { | ||
159 | hint = true; | 160 | hint = true; |
160 | msg += tr("<li>Reboot your player into the original firmware.</li>" | 161 | msg += tr("<li>Reboot your player into the original firmware.</li>" |
161 | "<li>Perform a firmware upgrade using the update functionality " | 162 | "<li>Perform a firmware upgrade using the update functionality " |
diff --git a/rbutil/rbutilqt/base/bootloaderinstallchinachip.cpp b/rbutil/rbutilqt/base/bootloaderinstallchinachip.cpp new file mode 100644 index 0000000000..dba2ec8c92 --- /dev/null +++ b/rbutil/rbutilqt/base/bootloaderinstallchinachip.cpp | |||
@@ -0,0 +1,117 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * | ||
9 | * Copyright (C) 2009 by Maurus Cuelenaere | ||
10 | * $Id$ | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | |||
20 | #include <QtCore> | ||
21 | #include "bootloaderinstallbase.h" | ||
22 | #include "bootloaderinstallchinachip.h" | ||
23 | |||
24 | #include "../chinachippatcher/chinachip.h" | ||
25 | |||
26 | BootloaderInstallChinaChip::BootloaderInstallChinaChip(QObject *parent) | ||
27 | : BootloaderInstallBase(parent) | ||
28 | { | ||
29 | (void)parent; | ||
30 | } | ||
31 | |||
32 | QString BootloaderInstallChinaChip::ofHint() | ||
33 | { | ||
34 | return tr("Bootloader installation requires you to provide " | ||
35 | "a firmware file of the original firmware (HXF file). " | ||
36 | "You need to download this file yourself due to legal " | ||
37 | "reasons. Please refer to the " | ||
38 | "<a href='http://www.rockbox.org/manual.shtml'>manual</a> and the " | ||
39 | "<a href='http://www.rockbox.org/wiki/OndaVX747" | ||
40 | "#Download_and_extract_a_recent_ve'>OndaVX747</a> wiki page on " | ||
41 | "how to obtain this file.<br/>" | ||
42 | "Press Ok to continue and browse your computer for the firmware " | ||
43 | "file."); | ||
44 | } | ||
45 | |||
46 | void BootloaderInstallChinaChip::logString(char* format, va_list args, int type) | ||
47 | { | ||
48 | QString buffer; | ||
49 | |||
50 | emit logItem(buffer.vsprintf(format, args), type); | ||
51 | QCoreApplication::processEvents(); | ||
52 | } | ||
53 | |||
54 | static void info(void* userdata, char* format, ...) | ||
55 | { | ||
56 | BootloaderInstallChinaChip* pThis = (BootloaderInstallChinaChip*) userdata; | ||
57 | va_list args; | ||
58 | |||
59 | va_start(args, format); | ||
60 | pThis->logString(format, args, LOGINFO); | ||
61 | va_end(args); | ||
62 | } | ||
63 | |||
64 | static void err(void* userdata, char* format, ...) | ||
65 | { | ||
66 | BootloaderInstallChinaChip* pThis = (BootloaderInstallChinaChip*) userdata; | ||
67 | va_list args; | ||
68 | |||
69 | va_start(args, format); | ||
70 | pThis->logString(format, args, LOGERROR); | ||
71 | va_end(args); | ||
72 | } | ||
73 | |||
74 | bool BootloaderInstallChinaChip::install() | ||
75 | { | ||
76 | if(m_offile.isEmpty()) | ||
77 | return false; | ||
78 | |||
79 | emit logItem(tr("Downloading bootloader file"), LOGINFO); | ||
80 | |||
81 | connect(this, SIGNAL(downloadDone()), this, SLOT(installStage2())); | ||
82 | downloadBlStart(m_blurl); | ||
83 | |||
84 | return true; | ||
85 | } | ||
86 | |||
87 | void BootloaderInstallChinaChip::installStage2() | ||
88 | { | ||
89 | m_tempfile.open(); | ||
90 | QString blfile = m_tempfile.fileName(); | ||
91 | m_tempfile.close(); | ||
92 | |||
93 | QString backupfile = QFileInfo(m_blfile).absoluteDir().absoluteFilePath("ccpmp.bin"); | ||
94 | |||
95 | int ret = chinachip_patch(m_offile.toLocal8Bit(), blfile.toLocal8Bit(), m_blfile.toLocal8Bit(), | ||
96 | backupfile.toLocal8Bit(), &info, &err, (void*)this); | ||
97 | qDebug() << "chinachip_patch" << ret; | ||
98 | |||
99 | emit done(ret); | ||
100 | } | ||
101 | |||
102 | bool BootloaderInstallChinaChip::uninstall() | ||
103 | { | ||
104 | /* TODO: only way is to restore the OF */ | ||
105 | return false; | ||
106 | } | ||
107 | |||
108 | BootloaderInstallBase::BootloaderType BootloaderInstallChinaChip::installed() | ||
109 | { | ||
110 | /* TODO: find a way to figure this out */ | ||
111 | return BootloaderUnknown; | ||
112 | } | ||
113 | |||
114 | BootloaderInstallBase::Capabilities BootloaderInstallChinaChip::capabilities() | ||
115 | { | ||
116 | return (Install | IsFile | NeedsOf); | ||
117 | } | ||
diff --git a/rbutil/rbutilqt/base/bootloaderinstallchinachip.h b/rbutil/rbutilqt/base/bootloaderinstallchinachip.h new file mode 100644 index 0000000000..292799cc0c --- /dev/null +++ b/rbutil/rbutilqt/base/bootloaderinstallchinachip.h | |||
@@ -0,0 +1,43 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * | ||
9 | * Copyright (C) 2009 by Maurus Cuelenaere | ||
10 | * $Id$ | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | |||
20 | #ifndef BOOTLOADERINSTALLCCPMP_H | ||
21 | #define BOOTLOADERINSTALLCCPMP_H | ||
22 | |||
23 | #include <QtCore> | ||
24 | #include "bootloaderinstallbase.h" | ||
25 | |||
26 | class BootloaderInstallChinaChip : public BootloaderInstallBase | ||
27 | { | ||
28 | Q_OBJECT | ||
29 | |||
30 | public: | ||
31 | BootloaderInstallChinaChip(QObject *parent = 0); | ||
32 | bool install(void); | ||
33 | bool uninstall(void); | ||
34 | BootloaderInstallBase::BootloaderType installed(void); | ||
35 | Capabilities capabilities(void); | ||
36 | QString ofHint(); | ||
37 | void logString(char* buffer, va_list args, int type); | ||
38 | |||
39 | private slots: | ||
40 | void installStage2(void); | ||
41 | }; | ||
42 | |||
43 | #endif // BOOTLOADERINSTALLCCPMP_H | ||
diff --git a/rbutil/rbutilqt/rbutil.ini b/rbutil/rbutilqt/rbutil.ini index 739a5d2be4..91770d72b3 100644 --- a/rbutil/rbutilqt/rbutil.ini +++ b/rbutil/rbutilqt/rbutil.ini | |||
@@ -43,6 +43,7 @@ platform31=iaudiom5 | |||
43 | platform32=iaudiox5v | 43 | platform32=iaudiox5v |
44 | platform33=iaudiom3 | 44 | platform33=iaudiom3 |
45 | platform40=gigabeatf | 45 | platform40=gigabeatf |
46 | platform44=ondavx747 | ||
46 | platform50=sansae200 | 47 | platform50=sansae200 |
47 | platform51=sansac200 | 48 | platform51=sansac200 |
48 | platform52=sansae200v2 | 49 | platform52=sansae200v2 |
@@ -481,6 +482,19 @@ configure_modelname=mrobe100 | |||
481 | targetid=33 | 482 | targetid=33 |
482 | encoder=rbspeex | 483 | encoder=rbspeex |
483 | 484 | ||
485 | [ondavx747] | ||
486 | name=VX747 | ||
487 | buildserver_modelname=ondavx747 | ||
488 | bootloadermethod=chinachip | ||
489 | bootloadername=/onda/vx747/ccpmp.bin | ||
490 | bootloaderfile=/SG301.HXF | ||
491 | manualname= | ||
492 | brand=Onda | ||
493 | usbid=0x07c4a4a5 | ||
494 | configure_modelname=ondavx747 | ||
495 | targetid=44 | ||
496 | encoder=rbspeex | ||
497 | |||
484 | [smsgyh820] | 498 | [smsgyh820] |
485 | name="YH-820" | 499 | name="YH-820" |
486 | buildserver_modelname=yh820 | 500 | buildserver_modelname=yh820 |
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp index b0684f7ef7..ec06955eef 100644 --- a/rbutil/rbutilqt/rbutilqt.cpp +++ b/rbutil/rbutilqt/rbutilqt.cpp | |||
@@ -45,6 +45,7 @@ | |||
45 | #include "bootloaderinstallipod.h" | 45 | #include "bootloaderinstallipod.h" |
46 | #include "bootloaderinstallsansa.h" | 46 | #include "bootloaderinstallsansa.h" |
47 | #include "bootloaderinstallfile.h" | 47 | #include "bootloaderinstallfile.h" |
48 | #include "bootloaderinstallchinachip.h" | ||
48 | #include "bootloaderinstallams.h" | 49 | #include "bootloaderinstallams.h" |
49 | 50 | ||
50 | 51 | ||
@@ -659,6 +660,9 @@ void RbUtilQt::installBootloader() | |||
659 | else if(type == "file") { | 660 | else if(type == "file") { |
660 | bl = new BootloaderInstallFile(this); | 661 | bl = new BootloaderInstallFile(this); |
661 | } | 662 | } |
663 | else if(type == "chinachip") { | ||
664 | bl = new BootloaderInstallChinaChip(this); | ||
665 | } | ||
662 | else if(type == "ams") { | 666 | else if(type == "ams") { |
663 | bl = new BootloaderInstallAms(this); | 667 | bl = new BootloaderInstallAms(this); |
664 | } | 668 | } |
@@ -1213,3 +1217,4 @@ bool RbUtilQt::chkConfig(bool warn) | |||
1213 | return error; | 1217 | return error; |
1214 | } | 1218 | } |
1215 | 1219 | ||
1220 | |||
diff --git a/rbutil/rbutilqt/rbutilqt.pro b/rbutil/rbutilqt/rbutilqt.pro index cf7f944824..78c399ebd7 100644 --- a/rbutil/rbutilqt/rbutilqt.pro +++ b/rbutil/rbutilqt/rbutilqt.pro | |||
@@ -77,6 +77,7 @@ SOURCES += rbutilqt.cpp \ | |||
77 | base/autodetection.cpp \ | 77 | base/autodetection.cpp \ |
78 | ../ipodpatcher/ipodpatcher.c \ | 78 | ../ipodpatcher/ipodpatcher.c \ |
79 | ../sansapatcher/sansapatcher.c \ | 79 | ../sansapatcher/sansapatcher.c \ |
80 | ../chinachippatcher/chinachip.c \ | ||
80 | browsedirtree.cpp \ | 81 | browsedirtree.cpp \ |
81 | themesinstallwindow.cpp \ | 82 | themesinstallwindow.cpp \ |
82 | base/uninstall.cpp \ | 83 | base/uninstall.cpp \ |
@@ -103,6 +104,7 @@ SOURCES += rbutilqt.cpp \ | |||
103 | base/bootloaderinstallipod.cpp \ | 104 | base/bootloaderinstallipod.cpp \ |
104 | base/bootloaderinstallsansa.cpp \ | 105 | base/bootloaderinstallsansa.cpp \ |
105 | base/bootloaderinstallfile.cpp \ | 106 | base/bootloaderinstallfile.cpp \ |
107 | base/bootloaderinstallchinachip.cpp \ | ||
106 | base/bootloaderinstallams.cpp \ | 108 | base/bootloaderinstallams.cpp \ |
107 | ../../tools/mkboot.c \ | 109 | ../../tools/mkboot.c \ |
108 | ../../tools/iriver.c | 110 | ../../tools/iriver.c |
@@ -129,6 +131,7 @@ HEADERS += rbutilqt.h \ | |||
129 | ../ipodpatcher/parttypes.h \ | 131 | ../ipodpatcher/parttypes.h \ |
130 | ../sansapatcher/sansapatcher.h \ | 132 | ../sansapatcher/sansapatcher.h \ |
131 | ../sansapatcher/sansaio.h \ | 133 | ../sansapatcher/sansaio.h \ |
134 | ../chinachippatcher/chinachip.h \ | ||
132 | irivertools/h100sums.h \ | 135 | irivertools/h100sums.h \ |
133 | irivertools/h120sums.h \ | 136 | irivertools/h120sums.h \ |
134 | irivertools/h300sums.h \ | 137 | irivertools/h300sums.h \ |
@@ -158,6 +161,7 @@ HEADERS += rbutilqt.h \ | |||
158 | base/bootloaderinstallipod.h \ | 161 | base/bootloaderinstallipod.h \ |
159 | base/bootloaderinstallsansa.h \ | 162 | base/bootloaderinstallsansa.h \ |
160 | base/bootloaderinstallfile.h \ | 163 | base/bootloaderinstallfile.h \ |
164 | base/bootloaderinstallchinachip.h \ | ||
161 | base/bootloaderinstallams.h \ | 165 | base/bootloaderinstallams.h \ |
162 | ../../tools/mkboot.h \ | 166 | ../../tools/mkboot.h \ |
163 | ../../tools/iriver.h | 167 | ../../tools/iriver.h |