author | zecke <zecke> | 2002-10-23 21:37:35 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-23 21:37:35 (UTC) |
commit | 7f2dc6af10c299075387336f5b115625294151b2 (patch) (unidiff) | |
tree | e478d664ddbeeabd0e544c0155de65fabacb5d44 | |
parent | eb521bfc7d3a05f900f6c81db25aa4cea572f064 (diff) | |
download | opie-7f2dc6af10c299075387336f5b115625294151b2.zip opie-7f2dc6af10c299075387336f5b115625294151b2.tar.gz opie-7f2dc6af10c299075387336f5b115625294151b2.tar.bz2 |
the argv[0]="embedk" did not work the way i wanted
-rw-r--r-- | noncore/apps/opie-console/main.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/apps/opie-console/main.cpp b/noncore/apps/opie-console/main.cpp index 7f9f038..3b4321a 100644 --- a/noncore/apps/opie-console/main.cpp +++ b/noncore/apps/opie-console/main.cpp | |||
@@ -1,114 +1,114 @@ | |||
1 | #include <sys/types.h> | 1 | #include <sys/types.h> |
2 | 2 | ||
3 | #include <stdio.h> | 3 | #include <stdio.h> |
4 | #include <stdlib.h> | 4 | #include <stdlib.h> |
5 | #include <signal.h> | 5 | #include <signal.h> |
6 | 6 | ||
7 | #include <qfile.h> | 7 | #include <qfile.h> |
8 | 8 | ||
9 | #include <qpe/qpeapplication.h> | 9 | #include <qpe/qpeapplication.h> |
10 | 10 | ||
11 | #include "mainwindow.h" | 11 | #include "mainwindow.h" |
12 | 12 | ||
13 | //#define FSCKED_DISTRIBUTION 1 | 13 | //#define FSCKED_DISTRIBUTION 1 |
14 | #ifdef FSCKED_DISTRIBUTION | 14 | #ifdef FSCKED_DISTRIBUTION |
15 | /* | 15 | /* |
16 | * The Zaurus rom | 16 | * The Zaurus rom |
17 | */ | 17 | */ |
18 | class FixIt { | 18 | class FixIt { |
19 | public: | 19 | public: |
20 | FixIt(); | 20 | FixIt(); |
21 | ~FixIt(); | 21 | ~FixIt(); |
22 | void fixIt(); | 22 | void fixIt(); |
23 | /* no real interested in implementing it */ | 23 | /* no real interested in implementing it */ |
24 | void breakIt() { | 24 | void breakIt() { |
25 | 25 | ||
26 | }; | 26 | }; |
27 | char* m_file; | 27 | char* m_file; |
28 | }; | 28 | }; |
29 | 29 | ||
30 | FixIt::FixIt() { | 30 | FixIt::FixIt() { |
31 | /* the new inittab */ | 31 | /* the new inittab */ |
32 | m_file = "#\n# /etc/inittab | 32 | m_file = "#\n# /etc/inittab |
33 | # | 33 | # |
34 | 34 | ||
35 | # 0 - halt (Do NOT set initdefault to this) | 35 | # 0 - halt (Do NOT set initdefault to this) |
36 | # 1 - Single user mode | 36 | # 1 - Single user mode |
37 | # 2 - Multiuser, without NFS (The same as 3, if you do not have networking) | 37 | # 2 - Multiuser, without NFS (The same as 3, if you do not have networking) |
38 | # 3 - Full multiuser mode | 38 | # 3 - Full multiuser mode |
39 | # 4 - JavaVM(Intent) developer mode | 39 | # 4 - JavaVM(Intent) developer mode |
40 | # 5 - JavaVM(Intent) | 40 | # 5 - JavaVM(Intent) |
41 | # 6 - reboot (Do NOT set initdefault to this) | 41 | # 6 - reboot (Do NOT set initdefault to this) |
42 | # | 42 | # |
43 | id:5:initdefault: | 43 | id:5:initdefault: |
44 | 44 | ||
45 | # Specify things to do when starting | 45 | # Specify things to do when starting |
46 | si::sysinit:/etc/rc.d/rc.sysinit | 46 | si::sysinit:/etc/rc.d/rc.sysinit |
47 | 47 | ||
48 | l0:0:wait:/root/etc/rc.d/rc 0 | 48 | l0:0:wait:/root/etc/rc.d/rc 0 |
49 | l1:1:wait:/etc/rc.d/rc 1 | 49 | l1:1:wait:/etc/rc.d/rc 1 |
50 | l2:2:wait:/etc/rc.d/rc 2 | 50 | l2:2:wait:/etc/rc.d/rc 2 |
51 | l3:3:wait:/etc/rc.d/rc 3 | 51 | l3:3:wait:/etc/rc.d/rc 3 |
52 | l4:4:wait:/etc/rc.d/rc 4 | 52 | l4:4:wait:/etc/rc.d/rc 4 |
53 | l5:5:wait:/etc/rc.d/rc 5 | 53 | l5:5:wait:/etc/rc.d/rc 5 |
54 | l6:6:wait:/root/etc/rc.d/rc 6 | 54 | l6:6:wait:/root/etc/rc.d/rc 6 |
55 | 55 | ||
56 | # Specify things to do before rebooting | 56 | # Specify things to do before rebooting |
57 | um::ctrlaltdel:/bin/umount -a -r > /dev/null 2>&1 | 57 | um::ctrlaltdel:/bin/umount -a -r > /dev/null 2>&1 |
58 | sw::ctrlaltdel:/sbin/swapoff -a > /dev/null 2>&1 | 58 | sw::ctrlaltdel:/sbin/swapoff -a > /dev/null 2>&1 |
59 | 59 | ||
60 | # Specify program to run on ttyS0 | 60 | # Specify program to run on ttyS0 |
61 | s0:24:respawn:/sbin/getty 9600 ttyS0 | 61 | s0:24:respawn:/sbin/getty 9600 ttyS0 |
62 | #pd:5:respawn:/etc/sync/serialctl | 62 | #pd:5:respawn:/etc/sync/serialctl |
63 | 63 | ||
64 | # Specify program to run on tty1 | 64 | # Specify program to run on tty1 |
65 | 1:2:respawn:/sbin/getty 9600 tty1 | 65 | 1:2:respawn:/sbin/getty 9600 tty1 |
66 | ln:345:respawn:survive -l 6 /sbin/launch | 66 | ln:345:respawn:survive -l 6 /sbin/launch |
67 | #qt:5:respawn:/sbin/qt | 67 | #qt:5:respawn:/sbin/qt |
68 | 68 | ||
69 | # collie sp. | 69 | # collie sp. |
70 | sy::respawn:/sbin/shsync\n"; | 70 | sy::respawn:/sbin/shsync\n"; |
71 | 71 | ||
72 | 72 | ||
73 | } | 73 | } |
74 | FixIt::~FixIt() { | 74 | FixIt::~FixIt() { |
75 | } | 75 | } |
76 | /* | 76 | /* |
77 | * the retail Zaurus is broken in many ways | 77 | * the retail Zaurus is broken in many ways |
78 | * one is that pppd is listening on our port... | 78 | * one is that pppd is listening on our port... |
79 | * we've to stop it from that and then do kill(SIGHUP,1); | 79 | * we've to stop it from that and then do kill(SIGHUP,1); |
80 | */ | 80 | */ |
81 | void FixIt::fixIt() { | 81 | void FixIt::fixIt() { |
82 | ::rename("/etc/inittab", QPEApplication::qpeDir() + "/etc/inittab" ); | 82 | ::rename("/etc/inittab", QPEApplication::qpeDir() + "/etc/inittab" ); |
83 | QFile file( "/etc/inittab" ); | 83 | QFile file( "/etc/inittab" ); |
84 | if ( file.open(IO_WriteOnly | IO_Raw ) ) { | 84 | if ( file.open(IO_WriteOnly | IO_Raw ) ) { |
85 | file.writeBlock(m_file,strlen(m_file) ); | 85 | file.writeBlock(m_file,strlen(m_file) ); |
86 | } | 86 | } |
87 | file.close(); | 87 | file.close(); |
88 | ::kill( SIGHUP, 1 ); | 88 | ::kill( SIGHUP, 1 ); |
89 | } | 89 | } |
90 | #endif | 90 | #endif |
91 | 91 | ||
92 | 92 | ||
93 | int main(int argc, char **argv) { | 93 | int main(int argc, char **argv) { |
94 | argv[0]="embeddedkonsole"; | 94 | // too bad this gives us trouble the taskbar... argv[0]="embeddedkonsole"; |
95 | QPEApplication app( argc, argv ); | 95 | QPEApplication app( argc, argv ); |
96 | 96 | ||
97 | #ifdef FSCKED_DISTRIBUTION | 97 | #ifdef FSCKED_DISTRIBUTION |
98 | qWarning("fscked"); | 98 | qWarning("fscked"); |
99 | FixIt it; | 99 | FixIt it; |
100 | it.fixIt(); | 100 | it.fixIt(); |
101 | #endif | 101 | #endif |
102 | 102 | ||
103 | MainWindow mw; | 103 | MainWindow mw; |
104 | mw.setCaption(QObject::tr("Opie console") ); | 104 | mw.setCaption(QObject::tr("Opie console") ); |
105 | app.showMainWidget( &mw ); | 105 | app.showMainWidget( &mw ); |
106 | 106 | ||
107 | int ap = app.exec(); | 107 | int ap = app.exec(); |
108 | 108 | ||
109 | #ifdef FSCKED_DISTRIBUTION | 109 | #ifdef FSCKED_DISTRIBUTION |
110 | /* should add a signal handler too */ | 110 | /* should add a signal handler too */ |
111 | it.breakIt(); | 111 | it.breakIt(); |
112 | #endif | 112 | #endif |
113 | return ap; | 113 | return ap; |
114 | } | 114 | } |