Track partitions and images associated to a restore
operation through a cache.json file located in the
cache partition.
cache.json example contents:
{
'images': [
{
'name': 'xxx.img',
'disk': 1,
'partition': 2
},
{
'name': 'xxx.img',
'disk': 1,
'partition': 3
}
]
}
Add class CacheDataFile to handle the cache.json
file.
Add an entry to the 'images' array each time a
restore operation is executed successfuly,
replace entries with the same disk/partition.
Remove entry to the 'images' array with image delete
operations.
Add image info to kiosk configuration. This enables
image restore operations. This information is not
retroactive, only newly restored images will enable
the restore button in Kiosk.
show IP, MAC, link speed and hostname in the top left of the Kiosk
boot view.
Adjust boot view layout to better fit the new widget.
Add get_mac_from_interface() to net.py
Define a kiosk event "refresh" to send configuration data from
ogClient to Kiosk. Send the OS list after an ogClient refresh
operation.
Reload widgets in Kiosk when a refresh event is received.
Add Kiosk project as a subtree of ogClient. Kiosk is
an interactive GUI featuring basic functionality to
monitor and operate ogClient withing the client through a
graphical interface written in PyQt6.
Right after ogClient launches in live mode it performs a
fork() call to launch Kiosk as an external process to
prevent Kiosk backtraces to affect ogClient.
A pair of sockets are created through socket.socketpair()
and each process is assigned one of them to leverage the
inter process communication.
API Kiosk -> ogClient:
- Poweroff: request client poweroff
{"command": "poweroff"}
- Reboot: request client reboot
{"command": "reboot"}
- Restore: restore image into a partition
{"command": "restore", "image": "windows.img", "disk": 1, "partition": 2}
- Boot: request an OS boot
{"command": "boot", "disk": 1, "partition": 2}
API ogClient -> Kiosk:
- Busy: inform about ogClient thread status
{"command": "busy", "status": True}
- Refresh: reload the theme.
{"command": "refresh"}
- close: request Kiosk termination.
{"command": "close"}
Add internationalization documentation in README
Add "CACHE" mode in image restore to only restore images
available in the cache partition.
Use set_state() function in OgRest to define the idle or busy
status and notify Kiosk about the status change.
Accept image names with .img extension in image_restore(),
image_create() and cache_fetch().
Keep the code working with the actual behaviour of processing
the filename without extension.
Preparatory patch to migrate to image names with extensions for
a more explicit control over cache files.
Send the refresh payload after a completed image restore operation.
The fields sent to ogServer are not enough to update the status of
the client and the OS installed in a partition does not appear in
the database.
Log as warning when efibootmgr fails to update the NVRAM.
Raise an exception when the command is not available or when
there are not enough permissions to execute. Provide contextual
information in the error message.
The GRUB entry is always set as the second boot option, assuming
PXE is first. This is not always true, as disabled entries before
PXE IPv4 can make it the first valid but not the first defined
entry in the boot order.
Move every disabled boot entry at the end of boot order.
otherwise, _get_os_entries() fails when it finds a swap partition:
(2025-01-23 17:44:30) ogClient: [ERROR] - Error generating /mnt/nvme0n1p4/EFI/grub/Boot/grub.cfg: Unable to mount /dev/nvme0n1p3 into /mnt/nvme0n1p3
Reduce interdependency between imports by checking the correct OS for
copy_windows_efi_bootloader() from the code invoking the operation.
Break circular dependency where:
probe.py imports from winreg.py
winreg.py imports from uefi.py
uefi.py imports from probe.py
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.
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
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.
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.
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.
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.
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.
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.