From 8f94262e8fa2477700c50303ea6e2c6ddad72adb Mon Sep 17 00:00:00 2001 From: zsdc Date: Thu, 19 Jan 2023 20:18:42 +0200 Subject: image: T4516: Added system image tools This commit adds the whole set of system image tools written from the scratch in Python that allows performing all the operations on images: * check information * perform installation and deletion * versions management Also, it contains a new service that will update the GRUB menu and keep tracking its version in the future. WARNING: The commit contains non-reversible changes. Because of boot menu changes, it will not be possible to manage images from older VyOS versions after an update. --- op-mode-definitions/add-system-image.xml.in | 62 --------- op-mode-definitions/system-image.xml.in | 189 ++++++++++++++++++++++++++++ 2 files changed, 189 insertions(+), 62 deletions(-) delete mode 100644 op-mode-definitions/add-system-image.xml.in create mode 100644 op-mode-definitions/system-image.xml.in (limited to 'op-mode-definitions') diff --git a/op-mode-definitions/add-system-image.xml.in b/op-mode-definitions/add-system-image.xml.in deleted file mode 100644 index 67d8aa3b4..000000000 --- a/op-mode-definitions/add-system-image.xml.in +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - Add item to a system facility - - - - - Add a new image to the system - - /path/to/vyos-image.iso "http://example.com/vyos-image.iso" - - - sudo ${vyatta_sbindir}/install-image --url "${4}" - - - - Download image via specified VRF - - vrf name - - - sudo ${vyatta_sbindir}/install-image --url "${4}" --vrf "${6}" - - - - Username for authentication - - - - - Password to use with authentication - - sudo ${vyatta_sbindir}/install-image --url "${4}" --vrf "${6}" --username "${8}" --password "${10}" - - - - - - - - Username for authentication - - - - - Password to use with authentication - - sudo ${vyatta_sbindir}/install-image --url "${4}" --username "${6}" --password "${8}" - - - - - - - - - - diff --git a/op-mode-definitions/system-image.xml.in b/op-mode-definitions/system-image.xml.in new file mode 100644 index 000000000..57aeb7bb4 --- /dev/null +++ b/op-mode-definitions/system-image.xml.in @@ -0,0 +1,189 @@ + + + + + Add an object + + + + + Add item to a system facility + + + + + Add a new image to the system + + /path/to/vyos-image.iso "http://example.com/vyos-image.iso" + + + sudo ${vyos_op_scripts_dir}/image_installer.py --action add --image_path "${4}" + + + + Download image via specified VRF + + vrf name + + + sudo ${vyos_op_scripts_dir}/image_installer.py --action add --image_path "${4}" --vrf "${6}" + + + + Username for authentication + + + + + Password to use with authentication + + sudo ${vyos_op_scripts_dir}/image_installer.py --action add --image_path "${4}" --vrf "${6}" --username "${8}" --password "${10}" + + + + + + + + Username for authentication + + + + + Password to use with authentication + + sudo ${vyos_op_scripts_dir}/image_installer.py --action add --image_path "${4}" --username "${6}" --password "${8}" + + + + + + + + + + + + Install a new system + + + + + Set system operational parameters + + + + + Set system image parameters + + + + + Set default image to boot. + + + + + sudo ${vyos_op_scripts_dir}/image_manager.py --action set --image_name "${5}" + + + + + + + + + + Install a new system + + + + + Install new system image to hard drive + + sudo ${vyos_op_scripts_dir}/image_installer.py --action install + + + + + + Delete an object + + + + + Delete system objects + + + + + Remove an installed image from the system + + + + + sudo ${vyos_op_scripts_dir}/image_manager.py --action delete --image_name "${4}" + + + + + + + + Rename an object + + + + + Rename a system object + + + + + System image to rename + + + + + + + + A new name for an image + + sudo ${vyos_op_scripts_dir}/image_manager.py --action rename --image_name "${4}" --image_new_name "${6}" + + + + + + + + + + Rename an object + + + + + Show system information + + + + + Show installed VyOS images + + sudo ${vyos_op_scripts_dir}/image_info.py show_images_summary + + + + Show details about installed VyOS images + + sudo ${vyos_op_scripts_dir}/image_info.py show_images_details + + + + + + + + -- cgit v1.2.3