From 5425a2a8f808c92f23539d9bb862b1b942c3d39f Mon Sep 17 00:00:00 2001 From: Andrea Righi Date: Tue, 14 Nov 2023 09:58:07 -0500 Subject: [PATCH] virtme-ng: allow to run main commands directly from source Provide helper scripts for the virtme-ng commands that can be executed directly from the source directory (without necessarily installing virtme-ng in the system). This restores an old behavior of the legacy virtme that used to provide such helpers. Suggested-by: Paul McKenney Signed-off-by: Andrea Righi --- virtme-configkernel | 17 +++++++++++++++++ virtme-mkinitramfs | 17 +++++++++++++++++ virtme-run | 17 +++++++++++++++++ vng | 21 +++++++++++++++++++++ 4 files changed, 72 insertions(+) create mode 100755 virtme-configkernel create mode 100755 virtme-mkinitramfs create mode 100755 virtme-run create mode 100755 vng diff --git a/virtme-configkernel b/virtme-configkernel new file mode 100755 index 0000000..698595a --- /dev/null +++ b/virtme-configkernel @@ -0,0 +1,17 @@ +#!/usr/bin/env python3 +# -*- mode: python -*- +# virtme-configkernel: Configure a kernel for virtme +# Copyright © 2014 Andy Lutomirski +# Licensed under the GPLv2, which is available in the virtme distribution +# as a file called LICENSE with SHA-256 hash: +# 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 + +# This file is not installed; it's just used to run virtme from inside +# a source distribution. + +# NOTE: this command is deprecated, please use vng instead. + +import sys +from virtme.commands import configkernel + +exit(configkernel.main()) diff --git a/virtme-mkinitramfs b/virtme-mkinitramfs new file mode 100755 index 0000000..a33371c --- /dev/null +++ b/virtme-mkinitramfs @@ -0,0 +1,17 @@ +#!/usr/bin/env python3 +# -*- mode: python -*- +# virtme-mkinitramfs: Generate an initramfs image for virtme +# Copyright © 2019 Marcos Paulo de Souza +# Licensed under the GPLv2, which is available in the virtme distribution +# as a file called LICENSE with SHA-256 hash: +# 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 + +# This file is not installed; it's just use to run virtme from inside +# a source distribution. + +# NOTE: this command is deprecated, please use vng instead. + +import sys +from virtme.commands import mkinitramfs + +exit(mkinitramfs.main()) diff --git a/virtme-run b/virtme-run new file mode 100755 index 0000000..70f8bed --- /dev/null +++ b/virtme-run @@ -0,0 +1,17 @@ +#!/usr/bin/env python3 +# -*- mode: python -*- +# virtme-run: The legacy command-line virtme frontend +# Copyright © 2014 Andy Lutomirski +# Licensed under the GPLv2, which is available in the virtme distribution +# as a file called LICENSE with SHA-256 hash: +# 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 + +# This file is not installed; it's just use to run virtme from inside +# a source distribution. + +# NOTE: this command is deprecated, please use vng instead. + +import sys +from virtme.commands import run + +exit(run.main()) diff --git a/vng b/vng new file mode 100755 index 0000000..8644456 --- /dev/null +++ b/vng @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 +# -*- mode: python -*- +# vng: The main command-line virtme-ng frontend + +# This file is not installed; it's just use to run virtme-ng from inside a +# source distribution. + +import os +import sys +from virtme_ng import run + +# Update PATH to make sure that virtme-ng can be executed directly from the +# source directory, without necessarily installing virtme-ng in the system. +def update_path(): + script_dir = os.path.dirname(os.path.abspath(__file__)) + current_path = os.environ.get('PATH', '') + new_path = f'{script_dir}:{current_path}' + os.environ['PATH'] = new_path + +update_path() +exit(run.main())