summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/device/odevice_zaurus.cpp
Unidiff
Diffstat (limited to 'libopie2/opiecore/device/odevice_zaurus.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.cpp61
1 files changed, 23 insertions, 38 deletions
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp
index e8b813e..6ac3157 100644
--- a/libopie2/opiecore/device/odevice_zaurus.cpp
+++ b/libopie2/opiecore/device/odevice_zaurus.cpp
@@ -115,36 +115,28 @@ struct z_button z_buttons_c700 [] = {
115// 115//
116// Comments? - mickeyl. 116// Comments? - mickeyl.
117 117
118void Zaurus::init(const QString&) 118void Zaurus::init(const QString& cpu_info)
119{
120 // generic distribution code already scanned /etc/issue at that point -
121 // embedix releases contain "Embedix <version> | Linux for Embedded Devices"
122 if ( d->m_sysverstr.contains( "embedix", false ) )
119{ 123{
120 d->m_vendorstr = "Sharp"; 124 d->m_vendorstr = "Sharp";
121 d->m_vendor = Vendor_Sharp; 125 d->m_vendor = Vendor_Sharp;
122 m_embedix = true; // Not openzaurus means: It has an embedix kernel ! 126 d->m_systemstr = "Zaurus";
123 127 d->m_system = System_Zaurus;
124 // QFile f ( "/proc/filesystems" ); 128 m_embedix = true;
125 QString model; 129 }
126 130 else
127 // It isn't a good idea to check the system configuration to 131 {
128 // detect the distribution !
129 // Otherwise it may happen that any other distribution is detected as openzaurus, just
130 // because it uses a jffs2 filesystem..
131 // (eilers)
132 // if ( f. open ( IO_ReadOnly ) && ( QTextStream ( &f ). read(). find ( "\tjffs2\n" ) >= 0 )) {
133 QFile f ("/etc/oz_version");
134 if ( f.exists() ){
135 d->m_vendorstr = "OpenZaurus Team"; 132 d->m_vendorstr = "OpenZaurus Team";
136 d->m_systemstr = "OpenZaurus"; 133 d->m_systemstr = "OpenZaurus";
137 d->m_system = System_OpenZaurus; 134 d->m_system = System_OpenZaurus;
135 // sysver already gathered
138 136
139 if ( f. open ( IO_ReadOnly )) { 137 // Openzaurus sometimes uses the embedix kernel, check if this is one
140 QTextStream ts ( &f );
141 d->m_sysverstr = ts. readLine();//. mid ( 10 );
142 f. close();
143 }
144
145 // Openzaurus sometimes uses the embedix kernel!
146 // => Check whether this is an embedix kernel
147 FILE *uname = popen("uname -r", "r"); 138 FILE *uname = popen("uname -r", "r");
139 QFile f;
148 QString line; 140 QString line;
149 if ( f.open(IO_ReadOnly, uname) ) { 141 if ( f.open(IO_ReadOnly, uname) ) {
150 QTextStream ts ( &f ); 142 QTextStream ts ( &f );
@@ -158,23 +150,14 @@ void Zaurus::init(const QString&)
158 } 150 }
159 pclose(uname); 151 pclose(uname);
160 } 152 }
161 else {
162 d->m_systemstr = "Zaurus";
163 d->m_system = System_Zaurus;
164 }
165 153
166 f. setName ( "/proc/cpuinfo" ); 154 // check the Zaurus model
167 if ( f. open ( IO_ReadOnly ) ) { 155 QString model;
168 QTextStream ts ( &f ); 156 int loc = cpu_info.find( ":" );
169 QString line;
170 while( line = ts. readLine() ) {
171 if ( line. left ( 8 ) == "Hardware" )
172 break;
173 }
174 int loc = line. find ( ":" );
175 if ( loc != -1 ) 157 if ( loc != -1 )
176 model = line. mid ( loc + 2 ). simplifyWhiteSpace( ); 158 model = cpu_info.mid( loc+2 ).simplifyWhiteSpace();
177 } 159 else
160 model = cpu_info;
178 161
179 if ( model == "SHARP Corgi" ) { 162 if ( model == "SHARP Corgi" ) {
180 d->m_model = Model_Zaurus_SLC7x0; 163 d->m_model = Model_Zaurus_SLC7x0;
@@ -193,9 +176,11 @@ void Zaurus::init(const QString&)
193 d->m_modelstr = "Zaurus SL-5500 or SL-5000d"; 176 d->m_modelstr = "Zaurus SL-5500 or SL-5000d";
194 } else { 177 } else {
195 d->m_model = Model_Zaurus_SL5500; 178 d->m_model = Model_Zaurus_SL5500;
196 d->m_modelstr = "Zaurus (Model unknown)"; 179 d->m_modelstr = "Unkown Zaurus";
197 } 180 }
198 181
182 // set initial rotation
183
199 bool flipstate = false; 184 bool flipstate = false;
200 switch ( d->m_model ) { 185 switch ( d->m_model ) {
201 case Model_Zaurus_SLA300: 186 case Model_Zaurus_SLA300: