Diffstat (limited to 'noncore/apps/opie-console/fixit.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/fixit.h | 77 |
1 files changed, 11 insertions, 66 deletions
diff --git a/noncore/apps/opie-console/fixit.h b/noncore/apps/opie-console/fixit.h index 6a8a101..c9188cf 100644 --- a/noncore/apps/opie-console/fixit.h +++ b/noncore/apps/opie-console/fixit.h | |||
@@ -3,2 +3,7 @@ | |||
3 | 3 | ||
4 | #include <opie2/oprocess.h> | ||
5 | #include <opie2/odebug.h> | ||
6 | |||
7 | #include <qpe/global.h> | ||
8 | #include <qpe/qpeapplication.h> | ||
4 | 9 | ||
@@ -9,3 +14,3 @@ | |||
9 | #include <signal.h> | 14 | #include <signal.h> |
10 | #include <qfile.h> | 15 | |
11 | 16 | ||
@@ -14,3 +19,6 @@ | |||
14 | */ | 19 | */ |
15 | class FixIt { | 20 | class FixIt : public QObject { |
21 | |||
22 | Q_OBJECT | ||
23 | |||
16 | public: | 24 | public: |
@@ -20,5 +28,3 @@ public: | |||
20 | /* no real interested in implementing it */ | 28 | /* no real interested in implementing it */ |
21 | void breakIt() { | 29 | void breakIt(); |
22 | |||
23 | }; | ||
24 | char* m_file; | 30 | char* m_file; |
@@ -26,62 +32,2 @@ public: | |||
26 | 32 | ||
27 | #ifdef FSCKED_DISTRI | ||
28 | FixIt::FixIt() { | ||
29 | /* the new inittab */ | ||
30 | m_file = "#\n# /etc/inittab" | ||
31 | "#" | ||
32 | "" | ||
33 | "# 0 - halt (Do NOT set initdefault to this)" | ||
34 | "# 1 - Single user mode" | ||
35 | "# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)" | ||
36 | "# 3 - Full multiuser mode" | ||
37 | "# 4 - JavaVM(Intent) developer mode" | ||
38 | "# 5 - JavaVM(Intent)" | ||
39 | "# 6 - reboot (Do NOT set initdefault to this)" | ||
40 | "#" | ||
41 | "id:5:initdefault:" | ||
42 | "" | ||
43 | "# Specify things to do when starting" | ||
44 | "si::sysinit:/etc/rc.d/rc.sysinit" | ||
45 | "" | ||
46 | "l0:0:wait:/root/etc/rc.d/rc 0" | ||
47 | "l1:1:wait:/etc/rc.d/rc 1" | ||
48 | "l2:2:wait:/etc/rc.d/rc 2" | ||
49 | "l3:3:wait:/etc/rc.d/rc 3" | ||
50 | "l4:4:wait:/etc/rc.d/rc 4" | ||
51 | "l5:5:wait:/etc/rc.d/rc 5" | ||
52 | "l6:6:wait:/root/etc/rc.d/rc 6" | ||
53 | "" | ||
54 | "# Specify things to do before rebooting" | ||
55 | "um::ctrlaltdel:/bin/umount -a -r > /dev/null 2>&1" | ||
56 | "sw::ctrlaltdel:/sbin/swapoff -a > /dev/null 2>&1" | ||
57 | "" | ||
58 | "# Specify program to run on ttyS0" | ||
59 | "s0:24:respawn:/sbin/getty 9600 ttyS0" | ||
60 | "#pd:5:respawn:/etc/sync/serialctl" | ||
61 | "" | ||
62 | "# Specify program to run on tty1" | ||
63 | "1:2:respawn:/sbin/getty 9600 tty1" | ||
64 | "ln:345:respawn:survive -l 6 /sbin/launch" | ||
65 | "#qt:5:respawn:/sbin/qt" | ||
66 | "" | ||
67 | "# collie sp." | ||
68 | "sy::respawn:/sbin/shsync\n"; | ||
69 | |||
70 | } | ||
71 | FixIt::~FixIt() { | ||
72 | } | ||
73 | /* | ||
74 | * the retail Zaurus is broken in many ways | ||
75 | * one is that pppd is listening on our port... | ||
76 | * we've to stop it from that and then do kill(SIGHUP,1); | ||
77 | */ | ||
78 | void FixIt::fixIt() { | ||
79 | ::rename("/etc/inittab", QPEApplication::qpeDir() + "/etc/inittab" ); | ||
80 | QFile file( "/etc/inittab" ); | ||
81 | if ( file.open(IO_WriteOnly | IO_Raw ) ) { | ||
82 | file.writeBlock(m_file,strlen(m_file) ); | ||
83 | } | ||
84 | file.close(); | ||
85 | ::kill( SIGHUP, 1 ); | ||
86 | } | ||
87 | 33 | ||
@@ -89,2 +35 @@ void FixIt::fixIt() { | |||
89 | |||
90 | #endif | ||