Chameleon

Chameleon Commit Details

Date:2010-10-09 07:43:56 (8 years 7 months ago)
Author:Evan Lojewski
Commit:573
Parents: 572
Message:NetbookInstaller module now works.
Changes:
M/branches/meklort/i386/modules/NetbookInstaller/NBI.c

File differences

branches/meklort/i386/modules/NetbookInstaller/NBI.c
2121
2222
2323
24
25
2426
25
26
2727
2828
2929
......
105105
106106
107107
108
108
109
110
111
112
113
114
115
109116
110117
111118
......
114121
115122
116123
117
124
125
126
118127
119
120
121128
122129
130
123131
124132
125133
......
248256
249257
250258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
long NBI_LoadDrivers( char * dirSpec );
void NBI_md0Ramdisk();
void NBI_PreBoot_hook(void* arg1, void* arg2, void* arg3, void* arg4);
void NBI_loadBootGraphics(void);
#ifndef OPTION_ROM
extern long (*LoadExtraDrivers_p)(FileLoadDrivers_t FileLoadDrivers_p);
//else printf("Unable to locate Extra/SystemVersion.LastPatched.plist\n");
char dummyVal = 0;
register_hook_callback("PreBoot", &NBI_PreBoot_hook);
}
void NBI_PreBoot_hook(void* arg1, void* arg2, void* arg3, void* arg4)
{
extern bool usePngImage;
bool dummyVal = 0;
if (getBoolForKey("recovery", &dummyVal, &bootInfo->bootConfig) && dummyVal)
{
if(dummyVal) runNetbookInstaller = 2;
if(runNetbookInstaller)
{
replace_function("_LoadDrivers", &NBI_LoadDrivers);
replace_function("_md0Ramdisk", &NBI_md0Ramdisk);
replace_function("_md0Ramdisk", &NBI_md0Ramdisk);
replace_function("_loadBootGraphics", &NBI_loadBootGraphics);
usePngImage = true;
}
}
void NBI_md0Ramdisk()
{
RAMDiskParam ramdiskPtr;
}
extern int loadPngImage(const char *filename, uint16_t *width, uint16_t *height, uint8_t **imageData);
//==========================================================================
// loadBootGraphics
void NBI_loadBootGraphics(void)
{
extern uint8_t *bootImageData;
extern uint16_t bootImageWidth;
extern uint16_t bootImageHeight;
extern const char* theme_name;
extern bool usePngImage;
if (bootImageData != NULL) {
return;
}
char dirspec[256];
if ((strlen(theme_name) + 24) > sizeof(dirspec)) {
usePngImage = false;
return;
}
sprintf(dirspec, "/Extra/Themes/%s/NBI.png", theme_name);
if (loadPngImage(dirspec, &bootImageWidth, &bootImageHeight, &bootImageData) != 0) {
#ifdef EMBED_THEME
if ((loadEmbeddedPngImage(__boot_png, __boot_png_len, &bootImageWidth, &bootImageHeight, &bootImageData)) != 0)
#endif
usePngImage = false;
}
}

Archive Download the corresponding diff file

Revision: 573