8 |
|
|
9 |
device="$(get_hwinfo netcard)" |
device="$(get_hwinfo netcard)" |
10 |
|
|
11 |
CONFIG="${MCORE_CONFIG_PATH}/hardware/netcard.device" |
CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/hardware/netcard.device" |
12 |
clearconfig |
clearconfig |
13 |
addconfig "${device}" |
addconfig "${device}" |
14 |
|
|
15 |
echo "${device}" |
rvecho "${device}" |
16 |
} |
} |
17 |
|
|
18 |
helper_hardware_netcard_driver() |
helper_hardware_netcard_driver() |
22 |
|
|
23 |
driver="$(get_driver_modules netcard)" |
driver="$(get_driver_modules netcard)" |
24 |
|
|
25 |
CONFIG="${MCORE_CONFIG_PATH}/hardware/netcard.driver" |
CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/hardware/netcard.driver" |
26 |
clearconfig |
clearconfig |
27 |
addconfig "${driver}" |
addconfig "${driver}" |
28 |
|
|
29 |
echo "${driver}" |
rvecho "${driver}" |
30 |
} |
} |
31 |
|
|
32 |
#wlan.device |
#wlan.device |
48 |
# sane fallback |
# sane fallback |
49 |
[[ -z ${driver} ]] && driver="vesa" |
[[ -z ${driver} ]] && driver="vesa" |
50 |
|
|
51 |
CONFIG="${MCORE_CONFIG_PATH}/hardware/graphic.driver" |
CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/hardware/graphic.driver" |
52 |
clearconfig |
clearconfig |
53 |
addconfig "${driver}" |
addconfig "${driver}" |
54 |
|
|
55 |
echo "${driver}" |
rvecho "${driver}" |
56 |
} |
} |
57 |
|
|
58 |
helper_hardware_disk_device() |
helper_hardware_disk_device() |
62 |
|
|
63 |
device="$(get_hwinfo disk)" |
device="$(get_hwinfo disk)" |
64 |
|
|
65 |
CONFIG="${MCORE_CONFIG_PATH}/hardware/disk.device" |
CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/hardware/disk.device" |
66 |
clearconfig |
clearconfig |
67 |
addconfig "${device}" |
addconfig "${device}" |
68 |
|
|
69 |
echo "${device}" |
rvecho "${device}" |
70 |
} |
} |
71 |
|
|
72 |
helper_hardware_cdrom_device() |
helper_hardware_cdrom_device() |
76 |
|
|
77 |
device="$(get_hwinfo cdrom)" |
device="$(get_hwinfo cdrom)" |
78 |
|
|
79 |
CONFIG="${MCORE_CONFIG_PATH}/hardware/cdrom.device" |
CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/hardware/cdrom.device" |
80 |
clearconfig |
clearconfig |
81 |
addconfig "${device}" |
addconfig "${device}" |
82 |
|
|
83 |
echo "${device}" |
rvecho "${device}" |
84 |
} |
} |
85 |
|
|
86 |
helper_hardware_keyboard_device() |
helper_hardware_keyboard_device() |
90 |
|
|
91 |
device="$(get_hwinfo keyboard)" |
device="$(get_hwinfo keyboard)" |
92 |
|
|
93 |
CONFIG="${MCORE_CONFIG_PATH}/hardware/keyboard.device" |
CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/hardware/keyboard.device" |
94 |
clearconfig |
clearconfig |
95 |
addconfig "${device}" |
addconfig "${device}" |
96 |
|
|
97 |
echo "${device}" |
rvecho "${device}" |
98 |
} |
} |
99 |
|
|
100 |
# helper_hardware_keyboard_info() |
# helper_hardware_keyboard_info() |
109 |
|
|
110 |
device="$(get_hwinfo mouse)" |
device="$(get_hwinfo mouse)" |
111 |
|
|
112 |
CONFIG="${MCORE_CONFIG_PATH}/hardware/mouse.device" |
CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/hardware/mouse.device" |
113 |
clearconfig |
clearconfig |
114 |
addconfig "${device}" |
addconfig "${device}" |
115 |
|
|
116 |
echo "${device}" |
rvecho "${device}" |
117 |
} |
} |
118 |
|
|
119 |
# helper_hardware_mouse_info() |
# helper_hardware_mouse_info() |
128 |
|
|
129 |
device="$(get_hwinfo printer)" |
device="$(get_hwinfo printer)" |
130 |
|
|
131 |
CONFIG="${MCORE_CONFIG_PATH}/hardware/printer.device" |
CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/hardware/printer.device" |
132 |
clearconfig |
clearconfig |
133 |
addconfig "${device}" |
addconfig "${device}" |
134 |
|
|
135 |
echo "${device}" |
rvecho "${device}" |
136 |
} |
} |
137 |
|
|
138 |
helper_hardware_printer_driver() |
helper_hardware_printer_driver() |
142 |
|
|
143 |
driver="$(get_driver_modules printer)" |
driver="$(get_driver_modules printer)" |
144 |
|
|
145 |
CONFIG="${MCORE_CONFIG_PATH}/hardware/printer.driver" |
CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/hardware/printer.driver" |
146 |
clearconfig |
clearconfig |
147 |
addconfig "${driver}" |
addconfig "${driver}" |
148 |
|
|
149 |
echo "${driver}" |
rvecho "${driver}" |
150 |
} |
} |
151 |
|
|
152 |
# hardware_printer_info() |
# hardware_printer_info() |
161 |
|
|
162 |
device="$(get_hwinfo sound)" |
device="$(get_hwinfo sound)" |
163 |
|
|
164 |
CONFIG="${MCORE_CONFIG_PATH}/hardware/sound.device" |
CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/hardware/sound.device" |
165 |
clearconfig |
clearconfig |
166 |
addconfig "${device}" |
addconfig "${device}" |
167 |
|
|
168 |
echo "${device}" |
rvecho "${device}" |
169 |
} |
} |
170 |
|
|
171 |
helper_hardware_sound_driver() |
helper_hardware_sound_driver() |
175 |
|
|
176 |
driver="$(get_driver_modules sound)" |
driver="$(get_driver_modules sound)" |
177 |
|
|
178 |
CONFIG="${MCORE_CONFIG_PATH}/hardware/sound.driver" |
CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/hardware/sound.driver" |
179 |
clearconfig |
clearconfig |
180 |
addconfig "${driver}" |
addconfig "${driver}" |
181 |
|
|
182 |
echo "${driver}" |
rvecho "${driver}" |
183 |
} |
} |
184 |
|
|
185 |
# helper_hardware_sound_info() |
# helper_hardware_sound_info() |
194 |
|
|
195 |
info="$(get_hwinfo_monitor)" |
info="$(get_hwinfo_monitor)" |
196 |
|
|
197 |
CONFIG="${MCORE_CONFIG_PATH}/hardware/monitor.hsync" |
CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/hardware/monitor.hsync" |
198 |
clearconfig |
clearconfig |
199 |
addconfig "$(echo ${info} | cut -d';' -f1)" |
addconfig "$(echo ${info} | cut -d';' -f1)" |
200 |
|
|
201 |
CONFIG="${MCORE_CONFIG_PATH}/hardware/monitor.vsync" |
CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/hardware/monitor.vsync" |
202 |
clearconfig |
clearconfig |
203 |
addconfig "$(echo ${info} | cut -d';' -f2)" |
addconfig "$(echo ${info} | cut -d';' -f2)" |
204 |
|
|
205 |
CONFIG="${MCORE_CONFIG_PATH}/hardware/monitor.resolution" |
CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/hardware/monitor.resolution" |
206 |
clearconfig |
clearconfig |
207 |
addconfig "$(echo ${info} | cut -d';' -f3)" |
addconfig "$(echo ${info} | cut -d';' -f3)" |
208 |
|
|
209 |
echo "${info}" |
rvecho "${info}" |
210 |
} |
} |
211 |
|
|
212 |
helper_hardware_arch_info() |
helper_hardware_arch_info() |
216 |
|
|
217 |
info="$(hwinfo --short --arch)" |
info="$(hwinfo --short --arch)" |
218 |
|
|
219 |
CONFIG="${MCORE_CONFIG_PATH}/hardware/arch.info" |
CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/hardware/arch.info" |
220 |
clearconfig |
clearconfig |
221 |
addconfig "${info}" |
addconfig "${info}" |
222 |
|
|
223 |
echo "${info}" |
rvecho "${info}" |
224 |
} |
} |
225 |
|
|
226 |
helper_hardware_cpu_info() |
helper_hardware_cpu_info() |
230 |
|
|
231 |
info="$(hwinfo --short --cpu)" |
info="$(hwinfo --short --cpu)" |
232 |
|
|
233 |
CONFIG="${MCORE_CONFIG_PATH}/hardware/cpu.info" |
CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/hardware/cpu.info" |
234 |
clearconfig |
clearconfig |
235 |
addconfig "${info}" |
addconfig "${info}" |
236 |
|
|
237 |
echo "${info}" |
rvecho "${info}" |
238 |
} |
} |
239 |
|
|
240 |
helper_hardware_memory_info() |
helper_hardware_memory_info() |
244 |
|
|
245 |
info="$(get_hwinfo memory)" |
info="$(get_hwinfo memory)" |
246 |
|
|
247 |
CONFIG="${MCORE_CONFIG_PATH}/hardware/memory.info" |
CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/hardware/memory.info" |
248 |
clearconfig |
clearconfig |
249 |
addconfig "${info}" |
addconfig "${info}" |
250 |
|
|
251 |
echo "${info}" |
rvecho "${info}" |
252 |
|
} |
253 |
|
|
254 |
|
helper_hardware_connected-iface_info() |
255 |
|
{ |
256 |
|
local CONFIG |
257 |
|
|
258 |
|
local control_server_ip=$(dns_to_ip ${MCORE_CONTROL_SERVER}) |
259 |
|
local iface_ip=$(iface_for_remote_addr ${control_server_ip}) |
260 |
|
local iface=$(iface_for_ip ${iface_ip}) |
261 |
|
|
262 |
|
CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/hardware/connected-iface.info" |
263 |
|
clearconfig |
264 |
|
addconfig "${iface}" |
265 |
|
|
266 |
|
rvecho "${iface}" |
267 |
|
} |
268 |
|
|
269 |
|
helper_hardware_connected-iface_driver() |
270 |
|
{ |
271 |
|
local driver |
272 |
|
local CONFIG |
273 |
|
|
274 |
|
local control_server_ip=$(dns_to_ip ${MCORE_CONTROL_SERVER}) |
275 |
|
local iface_ip=$(iface_for_remote_addr ${control_server_ip}) |
276 |
|
local iface=$(iface_for_ip ${iface_ip}) |
277 |
|
|
278 |
|
driver=$(get_driver_modules "netcard --only ${iface}") |
279 |
|
|
280 |
|
CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/hardware/connected-iface.driver" |
281 |
|
clearconfig |
282 |
|
addconfig "${driver}" |
283 |
|
|
284 |
|
rvecho "${driver}" |
285 |
} |
} |
286 |
|
|
287 |
# helper_hardware_framebuffer_info() |
# helper_hardware_framebuffer_info() |
324 |
|
|
325 |
help_hardware_detect() |
help_hardware_detect() |
326 |
{ |
{ |
327 |
mecho "get hardware.detect [class] [action]" |
mecho "get hardware.detect [action] [class]" |
328 |
mecho " Prints information about the systems hardware" |
mecho " Prints information about the systems hardware" |
329 |
mecho " Available classes:" |
mecho " Available classes:" |
330 |
mecho " memory, cpu, arch, monitor, netcard, graphic, sound," |
mecho " memory, cpu, arch, monitor, netcard, graphic, sound," |
337 |
|
|
338 |
get_hardware_detect() |
get_hardware_detect() |
339 |
{ |
{ |
340 |
local action="$1" |
local action="${CLASS_ARGV[0]}" |
341 |
local class="$2" |
local class="${CLASS_ARGV[1]}" |
342 |
|
|
343 |
|
# sanity check |
344 |
|
case "${action}" in |
345 |
|
info|driver|device) ;; |
346 |
|
*) help_hardware_detect && return 1 ;; |
347 |
|
esac |
348 |
|
|
349 |
case "${class}" in |
case "${class}" in |
350 |
memory) helper_hardware_"${class}"_"${action}" ;; |
memory) helper_hardware_"${class}"_"${action}" ;; |
359 |
cdrom) helper_hardware_"${class}"_"${action}" ;; |
cdrom) helper_hardware_"${class}"_"${action}" ;; |
360 |
keyboard) helper_hardware_"${class}"_"${action}" ;; |
keyboard) helper_hardware_"${class}"_"${action}" ;; |
361 |
mouse) helper_hardware_"${class}"_"${action}" ;; |
mouse) helper_hardware_"${class}"_"${action}" ;; |
362 |
|
connected-iface) helper_hardware_"${class}"_"${action}" ;; |
363 |
|
*) help_hardware_detect && return 1 ;; |
364 |
esac |
esac |
365 |
} |
} |