summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* ogclient-systray: add new systray program for ogclientHEADv1.3.2-26masterAlejandro Sirgo Rica6 days3-6/+120
| | | | | | | | | | | | | Add make.bat for an easier building process in Windows. This script generates ogclient.exe and ogclient-systray binaries in a ./dist directory. Add ogclient-systray program. This python program polls the existence of the ogclient process and shows a systray if the ogclient service is active. Update utils/create_version_file.py to generate information for the systray binary.
* windows: remove dead systray codeAlejandro Sirgo Rica6 days1-56/+0
| | | | | Remove dead systray code and unused imports in ogclient for Windows.
* ogclient: remove session event cmd commandsAlejandro Sirgo Rica10 days1-18/+0
| | | | | | Remove commands to send session events as the session report logic is now implemented in the ogOperations.py file of each platform.
* live: add additional error checks for shell runAlejandro Sirgo Rica10 days1-0/+8
| | | | Add checks for invalid arguments and permission errors.
* hw_inventory: fix json parsingAlejandro Sirgo Rica11 days1-3/+3
| | | | | | | | | | | | | | Add support for both lshw -json return formats. The json structure may follow one of the following. output:list flag enabled: [{content}] output:list flag disabled: {content} The output:list flag was defined in the commit 2b1c730 of https://ezix.org/src/pkg/lshw
* src: refactor windows hive codeAlejandro Sirgo Rica11 days2-78/+47
| | | | | | | | | | | | | | | | | | | Remove usage of hivexget as a subprocess and use Python hivex to inspect the Windows Registry. Use registry path constants defined in src.utils.winreg Remove windows_is64bit() funcion as the code to identify the architecture relies on a broken Registry query. Fixing the query proved to be a challenge and the only implication is the removal of the string "64 bits" at the end of the listed Windows OS installed in each partition. Use utility function in src.utils.winreg to make the software inventory code more compact. Rewrite onliner in _fill_package_set function and parse the registry with a for loop.
* log: use INFO as default logging mode for WindowsAlejandro Sirgo Rica2024-11-281-2/+2
|
* install: add script to generate the windows metadata information fileAlejandro Sirgo Rica2024-11-281-0/+77
| | | | | | Add create_version_file.py, running this script creates a file version_info.txt with the data required for the Windows ogClient binary metadata.
* src: update license headerOpenGnSys Support Team2024-11-2839-40/+40
|
* src: add support for direct command executionv1.3.2-25Alejandro Sirgo Rica2024-11-275-62/+72
| | | | | | | | | | | | | | | | Update live shell run mode for the new REST API interface. Evaluate the "inline" field to diferentiate between execution of script in /opt/opengnsys/shell/ and a cmd execution. Remove usage of echo argument of the API REST. Update Windows and Linux mode for direct command execution. Set OutputEncoding environment variable to 'utf-8' in Windows to unify the encoding of stdout for the invoked programs. Decode stdout to utf-8-sig to remove potential BOM. While at this, remove strange legacy ;|\n\r terminator.
* src: add user session detection implementationAlejandro Sirgo Rica2024-11-266-3/+73
| | | | | | | | | | | | | | | | | | | | | | | | Detect user login and logout for Linux and Windows. Report an active interactive session through the /refresh response so a new ogserver instance can update the session status. Poll the session change in 5 second intervals in a thread. Use the same event socket previously used by the old session detection mechanism to notify a session change. Use the method check_interactive_session_change in each ogOperations.py to report the session status. Return values: None: no session changes are found True: login False: logout Windows Verify if psutil.users() has any value. Linux Verify all the psutil.users() asociated to a terminal.
* linux: remove leftover prove() methodAlejandro Sirgo Rica2024-11-261-3/+0
|
* windows: bind the systray process lifetime to ogClientAlejandro Sirgo Rica2024-11-261-1/+1
| | | | | Add daemon=True to the systray process in order to make it close when the ogClient process closes.
* windows: make the systray reference local to OgWindowsOperationsAlejandro Sirgo Rica2024-11-261-6/+4
|
* windows: use a better systray default iconAlejandro Sirgo Rica2024-11-261-10/+13
| | | | | Draw a blue circle as default icon in the systray. Use the same blue color as the one shown in ogCP for an ogClient Windows instance.
* src: update functions for every ogClient modeAlejandro Sirgo Rica2024-11-263-4/+16
| | | | | Add missing ogClient mode functions and show an error in every unimplemented function.
* utils: disable fcntl in ogClient for WindowsAlejandro Sirgo Rica2024-11-151-1/+4
| | | | | Add conditional import for fcntl as it is only supported for Linux and causes ogClient for Windows fail to start.
* live: bogus error in logs when connecting to ogserverv1.3.2-24v1.3.2-23OpenGnSys Support Team2024-11-141-1/+0
| | | | | | | | This error is bogus: (2024-11-14 09:05:37) ogClient: [ERROR] - Partition query error for /dev/sdb: No medium found skip if device cannot be opened instead.
* grub: fix failed grub configuration when a device is not foundAlejandro Sirgo Rica2024-11-141-1/+4
| | | | | Fix "No medium found" error aborting the grub configuration process. Just log it and continue.
* tiptorrent: use absolute path to tiptorrent-clientv1.3.2-22OpenGnSys Support Team2024-11-071-1/+2
| | | | instead of using PATH to find it
* live: fix error report in partition and formatAlejandro Sirgo Rica2024-11-051-1/+1
| | | | Fix error codepath and properly mark the operation as failed.
* disk: use different log message in get_disk_data and get_partition_dataAlejandro Sirgo Rica2024-10-251-2/+2
| | | | | | Use a more specific message to differentiate the source of the error. Add the target device to the log message.
* live: use reboot --force --force to make a hard reboot in new liveOpenGnSys Support Team2024-10-241-1/+4
| | | | | this is a workaround for the new live system to make a hardware reboot that allows UEFI to pick up, otherwise it performs a kernel reboot instead.
* postinstall: remove call to ogFixBootSector scriptAlejandro Sirgo Rica2024-10-241-15/+0
| | | | | Remove call to ogFixBootSector function as it is possibly only required by Windows XP and FAT filesystem.
* cache: add code to cache the oglive boot filesAlejandro Sirgo Rica2024-10-242-0/+49
| | | | | | | | Add update_live_cache() implementing the legacy script updateBootCache() Copy the ogvmlinuz and oginitrd.img files into cache after a partition and format command with an available cache partition.
* live: always enable wol when launching ogclientOpenGnSys Support Team2024-10-241-0/+3
| | | | no need to wait for reboot/poweroff to enable wake-on-lan.
* grub: move get_grub_boot_params() into grub.pyAlejandro Sirgo Rica2024-10-223-16/+19
| | | | | Move get_grub_boot_params() into the file related to all the grub configuration.
* grub: replace legacy grub install scriptsAlejandro Sirgo Rica2024-10-224-31/+401
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Translate old legacy grub scripts into grub.py Implement ogGrubInstallMbr as install_main_grub() and ogGrubInstallPartition as install_linux_grub(). Add grub configuration file generator through the classes GrubConfig and MenuEntry. Ensure EFI tree structure compatibility with legacy code. The structure of the created folders in the ESP is non-standard, efi binaries are usually located in the folder below the EFI/ directory. Structure used by ogClient: EFI/ ├── grub/ │ └── Boot/ │ ├── BOOTX64.CSV │ ├── grub.cfg │ ├── mmx64.efi │ ├── shimx64.efi │ ├── BOOTX64.EFI │ ├── grubx64.efi │ └── ogloader.efi ... The function _mangle_efi_folder handles the folder structure after grub-install to comply with the location expected by ogLive. install_linux_grub() installs a grub local to each Linux install to enable chainloading, each grub is located in EFI/Part-xx-yy/ in UEFI. The local linux BIOS grub in legacy scripts is unreliable, grub-install reports a failure during the install process. install_main_grub() installs a global grub in EFI/grub/ to show a grub menu when the pxe boot fails. The global grub contains entries to every installed os. No global grub is installed for BIOS systems, a Boot partition would be required to store the grub configuration.
* disk: use cxt.label.name to dtect disk type in get_efi_partitionAlejandro Sirgo Rica2024-10-211-1/+1
| | | | | Use cxt.label.name instead of cxt.label to identify if the disk is GPT or MBR. This way is more used in other parts of the codebase.
* bios: fix use of undefined initrd_dir variable in get_vmlinuz_pathAlejandro Sirgo Rica2024-10-211-1/+1
| | | | | Use the intended linuz_dir instead of initrd_dir in the function get_vmlinuz_path.
* uefi: fix error message when no EFI loaderv1.3.2-21Alejandro Sirgo Rica2024-10-111-1/+1
| | | | | Fix log error message when _find_efi_loader does not find any EFI loader in the ESP.
* bios.py: fix typo in GRUB_CMDLINE_LINUX_DEFAULT stringAlejandro Sirgo Rica2024-10-091-1/+1
| | | | | Check against GRUB_CMDLINE_LINUX_DEFAULT instead of GRUB_CMDLINE_LINUE_DEFAULT.
* src: isolate libfdisk operations to enable mount operationsv1.3.2-20Alejandro Sirgo Rica2024-10-083-34/+71
| | | | | | | | | | python-libfdisk does not close file descriptor until the cxt object goes out of scope. Define get_partition_data and get_disk_data functions to isolate the python-libfdisk logic and return the data as an object. Improve error handling of libfdisk operaions in refresh.
* live: improve part not found log in image_createAlejandro Sirgo Rica2024-10-081-1/+1
| | | | Report the partition number of the missing partition.
* src: fix cache mount in new ogLiveAlejandro Sirgo Rica2024-10-082-20/+11
| | | | | | | Mount cache in image_create() image_restore() and cache_fetch(). Remove init_cache() and ensure /opt/opengnsys/images/ exists within the cache mountpoint if it does not exists in cache_mount().
* live: remove useless check in compute_md5OpenGnSys Support Team2024-10-051-2/+0
| | | | this never returns -1 on error, an exception is rised instead
* src: consolidate compute_md5 functionsAlejandro Sirgo Rica2024-10-023-29/+20
| | | | | | | | | | Add compute_md5 function in src/utils/fs.py Remove identical md5 functions from src/live/ogOperations.py and src/utils/tiptorrent.py Move error checks from ogOperations.py into compute_md5 function in src/utils/fs.py
* src: check if the system is hibernated before /image/createAlejandro Sirgo Rica2024-10-023-4/+24
| | | | | | | Mount the system partition in readonly mode and check for the hiberfil.sys file if the target system is a Windows. Fail the image creation process if the target system is hibernated.
* ogclient: add --server-ip flag to override the server's IPAlejandro Sirgo Rica2024-10-021-0/+5
| | | | Add CLI flag to override the server IP defined in the config file.
* live: refactor poweroff and rebootOpenGnSys Support Team2024-10-011-14/+40
| | | | | | - enable WoL - check for poweroff and reboot before checking for busybox. - call new shutdown method
* tiptorrent: missing f-string in errorOpenGnSys Support Team2024-10-011-1/+1
| | | | tip_client_get() needs f-string to display error
* live: fix EBUSY error in newer kernels with mkfsOpenGnSys Support Team2024-10-011-19/+21
| | | | | | | | | | | | python-libfdisk does not close file descriptor to /dev/sda after completing partitioning. This results EBUSY errors when formatting partitions with mkfs in newer kernels. Encapsulate code to partition in method so python garbage collection knows ctx objects can be release then close file descritor to /dev/sda. ogRest is not accessible from _partition(), remove check to ogRest.terminated, actually no need to terminate inmediately when formatting is ongoing, better leave things in consistent state when stop command is received.
* live: report correct partition size unit in setup() logAlejandro Sirgo Rica2024-10-011-1/+1
| | | | Log the correct partition size unit. Use MiB instead of MB.
* src: replace DEVICE env variable with get_ethernet_interface()Alejandro Sirgo Rica2024-10-015-8/+76
| | | | | | Use a python function to obtain the main net interface. Detect the first ethernet inferface in use. Stop using the DEVICE environment variable.
* live: remove unused probeOpenGnSys Support Team2024-09-304-37/+1
| | | | unused since ogserver's commit 87be2ce08 #980 Change initial probe to refresh
* live: use busybox otherwise poweroff/reboot commandsOpenGnSys Support Team2024-09-301-4/+4
|
* live: disable browser operations if the binary is missingAlejandro Sirgo Rica2024-09-272-2/+7
| | | | | Add shutils.which checks before every browser operations to skip the subprocess call if the binary is missing.
* src: report used and free partition data in bytesAlejandro Sirgo Rica2024-09-253-18/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | Add "used_size" and "free_size" to the partition data and the cache data. Old response from ogClient for /cache/delete, /cache/fetch and /image/restore: { 'cache': [ {'name': 'windows.img', 'size': 2432370213, checksum: '5d4dcc677bc19f40a647d0002f4ade90'}, {'name': 'linux.img', 'size': 243234534213, checksum: '3eb22f888f88a55ad954f55644e1192e'} ] } New response: { 'cache': { 'used_size': 4520232322423, 'free_size': 48273465287452945, 'images': [ {'name': 'windows.img', 'size': 2432370213, checksum: '5d4dcc677bc19f40a647d0002f4ade90'}, {'name': 'linux.img', 'size': 243234534213, checksum: '3eb22f888f88a55ad954f55644e1192e'} ] } }
* sw_inventory: consolidate os_probe logicAlejandro Sirgo Rica2024-09-252-7/+3
| | | | | | | | Reuse os_probe() function from probe.py and change the fallback case to "unknown" to prevent OS id mismatch in ogserver. The OS id mismatch causes the images to stop being associated with partitions after the /refresh command.
* src: verify the fields of the efibootmgr json in /refreshAlejandro Sirgo Rica2024-09-252-7/+30
| | | | | | | Don't send the efi data in the /refresh payload if efibootmgr is missing any of the json keys. Log the missing keys in case of missing some.