Rev 2187 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 2187 | Rev 2189 | ||
|---|---|---|---|
| Line 104... | Line 104... | ||
| 104 | 104 | ||
| 105 | #print "/usr/bin/atomic -s $host -p $port -c \"Node_WaitForInformation\"\n"; |
105 | #print "/usr/bin/atomic -s $host -p $port -c \"Node_WaitForInformation\"\n"; |
| 106 | #my @lines = qx{/usr/bin/atomic -s $host -p $port -c \"Node_GetInformation 0xB23F54EA\"}; |
106 | #my @lines = qx{/usr/bin/atomic -s $host -p $port -c \"Node_GetInformation 0xB23F54EA\"}; |
| 107 | #my @lines = qx{/usr/bin/atomic -s $host -p $port -c \"Node_WaitForInformation\"}; |
107 | #my @lines = qx{/usr/bin/atomic -s $host -p $port -c \"Node_WaitForInformation\"}; |
| 108 | my @lines; |
108 | my @lines; |
| - | 109 | ||
| - | 110 | print "Abort with Ctrl+c\n"; |
|
| 109 | 111 | ||
| 110 | $socket = atomd_initialize($host, $port); |
112 | $socket = atomd_initialize($host, $port); |
| 111 | if ($port == 1203) |
113 | if ($port == 1203) |
| 112 | { |
114 | { |
| 113 | atomjs_write($socket, "Node_WaitForInformationNative();\n"); |
115 | atomjs_write($socket, "Node_WaitForInformationNative();\n"); |
| 114 | 116 | ||
| 115 | $success = 0; |
117 | $success = 0; |
| 116 | for ($count = 0; $count < |
118 | for ($count = 0; $count < 300; $count++) |
| 117 | { |
119 | { |
| 118 | atomjs_write($socket, "Node_WaitNodePollNative();\n"); |
120 | atomjs_write($socket, "Node_WaitNodePollNative();\n"); |
| 119 | $return = atomjs_read_line($socket); |
121 | $return = atomjs_read_line($socket); |
| 120 | if ($return |
122 | if (($return =~ m/NoInfo/) || ($return =~ m/undefined/)) |
| 121 | { |
123 | { |
| 122 | } |
124 | } |
| 123 | elsif ($return =~ m/Error/) |
125 | elsif ($return =~ m/Error/) |
| 124 | { |
126 | { |
| 125 | die $return; |
127 | die $return; |
| 126 | } |
128 | } |
| 127 | else |
129 | else |
| 128 | { |
130 | { |
| 129 | @lines = split(/\t/, $return); |
131 | @lines = split(/\t/, $return); |
| - | 132 | $success = 1; |
|
| - | 133 | last; |
|
| 130 | } |
134 | } |
| 131 | usleep(200000); |
135 | usleep(200000); |
| 132 | } |
136 | } |
| 133 | if ($success == 0) |
137 | if ($success == 0) |
| 134 | { |
138 | { |
| 135 | die "\033[31mTimed out waiting for node to start.\033[0m\n"; |
139 | die "\033[31mTimed out waiting for node to start.\033[0m\n"; |
| 136 | } |
140 | } |
| 137 | - | ||
| 138 | } |
141 | } |
| 139 | else |
142 | else |
| 140 | { |
143 | { |
| 141 | usleep(100000); |
144 | usleep(100000); |
| 142 | atomd_kill_promt($socket); |
145 | atomd_kill_promt($socket); |
| Line 161... | Line 164... | ||
| 161 | $temp =~ s/\s+$//; |
164 | $temp =~ s/\s+$//; |
| 162 | 165 | ||
| 163 | my @hwidChars = split(//, $temp); |
166 | my @hwidChars = split(//, $temp); |
| 164 | $hwid = $hwidChars[0]. $hwidChars[1]. $hwidChars[8]. $hwidChars[9]. $hwidChars[6]. $hwidChars[7]. $hwidChars[4]. $hwidChars[5]. $hwidChars[2]. $hwidChars[3]; |
167 | $hwid = $hwidChars[0]. $hwidChars[1]. $hwidChars[8]. $hwidChars[9]. $hwidChars[6]. $hwidChars[7]. $hwidChars[4]. $hwidChars[5]. $hwidChars[2]. $hwidChars[3]; |
| 165 | 168 | ||
| 166 | print " |
169 | print "\033[32mSetting HWID in bios.inc to ".$hwid."\033[0m\n"; |
| 167 | } |
170 | } |
| 168 | elsif (index($line, "Device Type") != -1) |
171 | elsif (index($line, "Device Type") != -1) |
| 169 | { |
172 | { |
| 170 | $devicename = substr($line, index($line, ":") + 1); |
173 | $devicename = substr($line, index($line, ":") + 1); |
| 171 | 174 | ||