Skip to content

Commit

Permalink
virtme-ng: allow to run main commands directly from source
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Andrea Righi <[email protected]>
  • Loading branch information
Andrea Righi committed Nov 14, 2023
1 parent 84b9a13 commit 5425a2a
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 0 deletions.
17 changes: 17 additions & 0 deletions virtme-configkernel
Original file line number Diff line number Diff line change
@@ -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())
17 changes: 17 additions & 0 deletions virtme-mkinitramfs
Original file line number Diff line number Diff line change
@@ -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())
17 changes: 17 additions & 0 deletions virtme-run
Original file line number Diff line number Diff line change
@@ -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())
21 changes: 21 additions & 0 deletions vng
Original file line number Diff line number Diff line change
@@ -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())

0 comments on commit 5425a2a

Please sign in to comment.