Chameleon Applications

Chameleon Applications Commit Details

Date:2010-01-26 06:25:09 (14 years 2 months ago)
Author:Rekursor
Commit:59
Parents: 58
Message:Fixed filtering of partition, false assumptions that windows directory is windows, also changed the boot detecttion filter for OSX. Released a beta5 for that issue
Changes:
M/trunk/ChameleonPrefPane/Info.plist
M/trunk/ChameleonPrefPane/Sources/ShellProcess.cpp
M/trunk/ChameleonPrefPane/Sources/ShellProcess.h

File differences

trunk/ChameleonPrefPane/Sources/ShellProcess.cpp
8585
8686
8787
88
89
90
91
8892
8993
9094
......
106110
107111
108112
113
114
115
116
109117
118
110119
111120
112121
......
121130
122131
123132
124
133
125134
126135
127136
......
151160
152161
153162
154
155
163
156164
157165
158
159
166
167
168
169
170
171
172
173
174
175
176
160177
161
162
163
164
178
165179
166180
167181
return szAlias;
}
// uncomment the following line for debug
#define DEBUG_DISKUTIL 0
//----------------------------------------------------------------
const std::vector<PartitionInfo>&
PartitionExtractor::extractPartitions(const char* szHide, const char* szRenamed)
_partList.clear();
if (szHide) hidePartitions(szHide);
if (szRenamed) renamedPartitions(szRenamed);
#if DEBUG_DISKUTIL
this->open("cat /diskutil.txt");
#else
this->open("diskutil list");
#endif
while(get_line(line, sizeof(line)-1))
{
if (sdisk)
{
// extract disk number
disk= sdisk[strlen(diskTag)]-'0';
sscanf(&sdisk[strlen(diskTag)],"%d", &disk);
if (disk>=0 && disk <MAX_HD)
disk = _hdRedirTable[disk];
}
partInfo.fsType()!="Apple_Free"
)
{
std::string DiskLabel(label), UnixPath, WinPath;
DiskLabel.erase( DiskLabel.find_last_not_of(" ") + 1);
std::string diskLabel(trim(label));
bool found=false;
// early bail out if we found what we need:
if (fileExists((UnixPath = "/Volumes/" + DiskLabel + "/usr/bin/man")))
// early bail out if we found what we need: DON't make any assumption
// that Windows is the name of WIN32 bootable disk dir ...
if (
fileExists("/Volumes/" + diskLabel + "/boot") ||
fileExists("/Volumes/" + diskLabel + "/System/Library/Extensions") ||
fileExists("/Volumes/" + diskLabel + "/ntldr") ||
fileExists("/Volumes/" + diskLabel + "/bootmgr") ||
fileExists("/Volumes/" + diskLabel + "/Boot") ||
fileExists("/Volumes/" + diskLabel + "/pagefile.sys") ||
fileExists("/Volumes/" + diskLabel + "/hiberfil.sys")
)
found=true;
else if ((strstr(label,"System Reserved") ) || // don't filter system reserved windows 7 boot parts
fileExists((WinPath="/Volumes/" + DiskLabel + "/Windows/system.ini")))
found=true;
else if (strstr(fsType,"Linux") && !strstr(fsType, "Linux_Swap"))
else if ((strstr(fsType,"Linux") ) && !strstr(fsType, "Linux_Swap"))
found=true; // Added Linux case
if (found)
{ //check if one of them exists
trunk/ChameleonPrefPane/Sources/ShellProcess.h
1616
1717
1818
19
19
2020
2121
2222
......
6666
6767
6868
69
70
71
72
69
70
71
7372
7473
7574
#include <string>
#include "file_util.h"
//----------------------------------------------------------------
const int MAX_HD = 10;
const int MAX_HD = 32;
//----------------------------------------------------------------
class ShellProcess
bool fromPartitionHdString(const char * inHdStr);
std::string toHdStr() const
{
std::string buf = "hd(n,m)";
buf[3]= '0'+disk();
buf[5]='0'+partition();
return buf;
char buf[16]="";
sprintf(buf, "hd(%d,%d)", disk(),partition());
return std::string(buf);
}
int imageIndexFromFs() const;
protected:
trunk/ChameleonPrefPane/Info.plist
1717
1818
1919
20
20
2121
2222
2323
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>2.0 b4</string>
<string>2.0 b5</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>

Archive Download the corresponding diff file

Revision: 59