10
10
#include " logtofile.h"
11
11
#include < filesystem>
12
12
13
+
13
14
static const std::string STR_DTPARAM = " dtparam=audio" ;
14
15
static const std::string STR_DTOVERLAY = " dtoverlay=" ;
15
16
static const std::string STR_LOCAL = " 127.0.1.1" ;
17
+ static const std::string STR_VC4 = " dtoverlay=vc4-kms-v3d" ;
16
18
17
19
int SetHostname (const std::string& sHostname )
18
20
{
@@ -131,7 +133,6 @@ int SetOverlay(const std::string& sOverlay, const std::string& sLineNumber, cons
131
133
}
132
134
133
135
std::string sLine ;
134
- std::string sFind = " dtoverlay=vc4-fkms-v3d" ;
135
136
int nCount = 0 ;
136
137
bool bAdded (false );
137
138
bool bRotateDone (false );
@@ -171,10 +172,14 @@ int SetOverlay(const std::string& sOverlay, const std::string& sLineNumber, cons
171
172
}
172
173
bRotateDone = true ;
173
174
}
174
- else if (sLine .substr (0 ,sFind .length ()) != sFind )
175
+ else if (sLine .substr (0 ,STR_VC4 .length ()) != STR_VC4 )
175
176
{
176
177
output << sLine << ' \n ' ;
177
178
}
179
+ else
180
+ {
181
+ std::cout << " removed" << std::endl;
182
+ }
178
183
nCount++;
179
184
}
180
185
if (!bAdded)
@@ -235,6 +240,7 @@ int main(int argc, char* argv[])
235
240
pmlLog (pml::LOG_ERROR, " dosetup" ) << " Not enough arguments. Need 6 given " << argc;
236
241
pmlLog (pml::LOG_INFO, " dosetup" ) << " Usage: hostname password overlay line_to_replace" ;
237
242
pml::LogStream::Stop ();
243
+ std::cout << " STOPPED" << std::endl;
238
244
return -1 ;
239
245
}
240
246
@@ -243,6 +249,7 @@ int main(int argc, char* argv[])
243
249
{
244
250
pmlLog (pml::LOG_CRITICAL, " dosetup" ) << " Failed to set hostname. Exiting" ;
245
251
pml::LogStream::Stop ();
252
+ std::cout << " STOPPED" << std::endl;
246
253
247
254
return -1 ;
248
255
}
@@ -251,6 +258,7 @@ int main(int argc, char* argv[])
251
258
{
252
259
pmlLog (pml::LOG_CRITICAL, " dosetup" ) << " Failed to set password. Exiting" ;
253
260
pml::LogStream::Stop ();
261
+ std::cout << " STOPPED" << std::endl;
254
262
255
263
return -1 ;
256
264
}
@@ -259,12 +267,15 @@ int main(int argc, char* argv[])
259
267
if (SetOverlay (argv[3 ], argv[4 ], argv[5 ]) != 0 )
260
268
{
261
269
pml::LogStream::Stop ();
270
+ std::cout << " STOPPED" << std::endl;
262
271
return -1 ;
263
272
}
264
273
265
274
SetRotate (argv[5 ]);
266
275
267
276
pmlLog (pml::LOG_INFO, " dosetup" ) << " ------ FINISHED ------" ;
268
277
pml::LogStream::Stop ();
278
+ std::cout << " STOPPED" << std::endl;
279
+
269
280
return 0 ;
270
281
}
0 commit comments