| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add 'efi' key into the refresh payload. The value for that key
has the following structure:
'efi': {
'entries': [
{
"order": 0,
"name": "Boot0000",
"active": false,
"description": "grub"
},
{
"order": 1,
"name": "Boot0001",
"active": true,
"description": "UEFI: PXE IP4 Realtek PCIe GBE Family Controller"
}
]
}
If the client is not a EFI system it won't add the 'efi' field.
If an entry is not in the boot order it won't have the 'order' field.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fe40f9c5 ('src: add POST cache/fetch method') broke unicast cache restore.
(2024-09-09 10:05:22) ogClient: [ERROR] - name 'image_name' is not defined
Traceback (most recent call last):
File "/opt/opengnsys/ogClient/src/ogRest.py", line 175, in image_restore
payload = ogRest.operations.image_restore(request, ogRest)
File "/opt/opengnsys/ogClient/src/live/ogOperations.py", line 520, in image_restore
self._restore_image_unicast(repo, name, partdev, cache)
File "/opt/opengnsys/ogClient/src/live/ogOperations.py", line 242, in _restore_image_unicast
image_path = f'{OG_CACHE_IMAGE_PATH}{image_name}.img'
NameError: name 'image_name' is not defined
|
|
|
|
|
| |
f2a2f5307464 ('live: remove file from cache with no checksum file') broke
indentation which breaks ogClient.
|
|
|
|
|
| |
Add disk index bounds checks for setup() and image_create().
Prevent backtrace logging when an invalid disk index is used.
|
|
|
|
|
| |
Maybe result of a partial download? then, remove it to leave cache in consistent
state.
|
| |
|
|
|
|
|
|
|
| |
logging.warn() is deprecated since 3.3.
And use .error() instead when command is unsupported or client is busy, that
should not ever happen.
|
| |
|
|
|
|
| |
remove call to custom version of legacy script, display warning.
|
|
|
|
| |
Remove image files after a failed image copy operation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add API REST method to fetch an image.
Consolidate image fetch loging for cache/fetch and image/restore.
Resquest payload structure:
{
'image': 'linux.img'
'type': 'TIPTORRENT'
'repository': '12.141.10.2'
}
The client will try to fetch'image' from 'repository' into cache.
Resquest response structure:
{
'cache': [
{'name': 'windows.img', 'size': 2432370213, checksum: '5d4dcc677bc19f40a647d0002f4ade90'},
{'name': 'linux.img', 'size': 243234534213, checksum: '3eb22f888f88a55ad954f55644e1192e'}
]
}
|
|
|
|
| |
just a clean up.
|
|
|
|
| |
instead of using info to report errors.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
if image already exists in the cache, skip a second checksum validation.
log shows duplicated entries:
Verifying checksum for example.img, please wait...
Checksum is OK for example.img
Verifying checksum for example.img, please wait...
Checksum is OK for example.img
because tip_check_csum() is called twice in this case.
|
|
|
|
|
|
|
| |
Restoring an updated image file (with different checksum) could fail while the
old checksum file could remain in place.
Remove image and checksum file before fetching the new files.
|
|
|
|
| |
this restore method is unreliable, add warning to the logs.
|
|
|
|
|
| |
after copying file to cache, validate that file exists in cache and checksum
correct.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace ConfigureOs script by native calls to:
- update BCD via hivex using bcd.py and winreg.py infrastructure.
- restore efi bootloader restore_windows_efi_bootloader().
Call legacy scripts for remaining postinstall procedures to
replace them incrementally.
Define variable CONFIGUREOS_LEGACY_ENABLED as False by default.
Run legacy configureOs when CONFIGUREOS_LEGACY_ENABLED = True.
This serves as a auxiliar method to keep the restoration functional
in case of problems with the new configure_os logic.
|
|
|
|
| |
Use a more consistent name format for the ogExtendFs function.
|
|
|
|
|
|
|
|
|
|
| |
If formatting fails, log shows:
mkfs.ntfs reports return code 1 for /dev/sda2
but ogclient reports success to the ogserver.
Raise an exception so front-end gets an indication that formatting has failed.
|
|
|
|
| |
Provide a bit more logging to make it easier to debug issues.
|
|
|
|
| |
For consistency with tiptorrent download.
|
|
|
|
| |
Report image checksum to ogserver through HTTP response.
|
|
|
|
| |
check sufficient permissions and bail out in case of issues.
|
|
|
|
|
|
|
|
| |
Add explicit check for .full.sum after downloading it.
Rewrite errors log, one of them is misleading when checksum validation
fails, it refers to missing .full.sum, but it could be a different
reason.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Try to find the script to run for a shell/run request in
/opt/opengnsys/shell/, restricted mode is enabled if the
script is found.
Excute the script without shell=True and executable=OG_SHELL in
restricted mode.
Restricted mode is a safer execution method as it only executes
code manually defined by the administrator.
Each script needs to define a shebang, this way more than just bash
is supported.
|
|
|
|
|
| |
echo command that has been run for storage in ogserver, until GET /shell/output
is invoked.
|
|
|
|
|
|
|
|
| |
provide return code as result to ogserver.
Update virtual mode driver to return dummy value, although this command
is unimplemented, this seems to be broken due to possible TypeError when
accessing result from caller.
|
|
|
|
|
|
| |
Properly report the lack of cache partition when restoring an
image using TIPTORRENT and UNICAST as methods.
Abort any restore in case of no cache partition.
|
|
|
|
|
|
|
| |
Fix image size, permissions and creation time.
Improve error report related to these parameters now showing the
exact cause of the problem if any occurred during the definition
of image size, file permissions or image creation time values.
|
|
|
|
|
| |
DE94BBA4-06D1-4D40-A16A-BFD50179D6AC is already set in in GUID_MAP as partition
code, but not in GPT_PARTTYPES.
|
|
|
|
|
| |
Add logging before calculating checksum to provide a hint to user on what is
going on while ogClient is still busy.
|
|
|
|
|
|
| |
Rename ogGetImageInfo to get_image_info.
Move code from ogOperations.py to obtain image data into
get_image_info.
|
|
|
|
|
| |
legacy.py contais mostly functions related to system images.
Rename the file to better represent the contents in it.
|
|
|
|
|
|
| |
Use the constant OG_CACHE_IMAGE_PATH from cache.py to obtain the
location of the directory where images are stored.
This way the path can be changed from one single point.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a 'cache' field into the json payload the client sends to
the server after a restore operation so the server can update
the new cache contents.
Resquest response structure:
{
...
'cache': [
{'name': 'windows.img', 'size': 2432370213, checksum: '5d4dcc677bc19f40a647d0002f4ade90'},
{'name': 'linux.img', 'size': 243234534213, checksum: '3eb22f888f88a55ad954f55644e1192e'}
]
...
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add API REST method to delete cache contents.
Resquest payload structure:
{
'images': ['windows.img', 'linux.img']
}
The client will try to delete as many images in cache as available
with names matching the list of filenames in the 'images' field.
Resquest response structure:
{
'cache': [
{'name': 'windows.img', 'size': 2432370213, checksum: '5d4dcc677bc19f40a647d0002f4ade90'},
{'name': 'linux.img', 'size': 243234534213, checksum: '3eb22f888f88a55ad954f55644e1192e'}
]
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add the list of images in the client's cache partition in the
payload sent to the server.
The information sent is a list of {image_name, img_size, checksum}
elements where img_size is the size of the respective image in bytes.
Resquest response structure:
{
...
'cache': [
{'name': 'windows.img', 'size': 2432370213, checksum: '5d4dcc677bc19f40a647d0002f4ade90'},
{'name': 'linux.img', 'size': 243234534213, checksum: '3eb22f888f88a55ad954f55644e1192e'}
]
...
}
|
|
|
|
| |
Never used what configureOs() returns, remove it.
|
|
|
|
| |
checksum file name end by .img.full.sum, not .full.sum
|
|
|
|
| |
Just a simple cleanup.
|
|
|
|
| |
Add 0xef partition type for EFI in MBR.
|
|
|
|
| |
Remove reference to external website in code.
|
|
|
|
|
|
|
|
| |
This method reports the /dev path to cache partition, rename it.
Add explicit check if blkid is successful.
And add logging to report that device path to cache is not found.
|
|
|
|
|
|
|
| |
ogCP expects LINUX-SWAP to specify a swap filesystem.
Add a similar workaround to the one that is done for VFAT for symmetry between
inputs and outputs that circulate over the API.
|
|
|
|
|
| |
Specify that image file cannot be found in cache because tiptorrent has failed,
otherwise it is confusing.
|
|
|
|
| |
Otherwise mkfs silently fails because OS reports out-of-sync partition table.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
partprobe requires that all disk partitions are unmounted.
partprobe needs to be called to report the OS that the partition table
has changed, otherwise ogclient reports incorrect partition information.
iterate over the partition list and mount cache after partprobe is
called.
|