ogClonningEnginetest-python-scriptsticket-693ticket-700
Last change
on this file since 1b42de9 was
5b1449d,
checked in by Antonio Emmanuel Guerrero Silva <aguerrero@…>, 7 months ago
|
refs #700 shared files convert to Python3
|
-
Property mode set to
100644
|
File size:
840 bytes
|
Line | |
---|
1 | #!/usr/bin/env python3 |
---|
2 | |
---|
3 | import os |
---|
4 | import subprocess |
---|
5 | import glob |
---|
6 | |
---|
7 | """ |
---|
8 | @file loadmodules.py |
---|
9 | @brief Script de inicio para cargar módulos complementarios del kernel. |
---|
10 | @version 1.0.5 - Cargar módulos específicos para el cliente. |
---|
11 | """ |
---|
12 | |
---|
13 | |
---|
14 | def main(): |
---|
15 | msg_loadmodules = os.getenv('MSG_LOADMODULES', '.') |
---|
16 | print(msg_loadmodules) |
---|
17 | |
---|
18 | # Módulo del ratón. |
---|
19 | subprocess.run(['modprobe', 'psmouse'], stderr=subprocess.DEVNULL) |
---|
20 | |
---|
21 | # Cargar módulos específicos del kernel del cliente. |
---|
22 | kernel_version = os.uname().release |
---|
23 | module_path = os.path.join(os.getenv('OGLIB', ''), 'modules', kernel_version, '*.ko') |
---|
24 | for module in glob.glob(module_path): |
---|
25 | if os.access(module, os.R_OK): |
---|
26 | subprocess.run(['insmod', module], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) |
---|
27 | |
---|
28 | if __name__ == "__main__": |
---|
29 | main() |
---|
Note: See
TracBrowser
for help on using the repository browser.