-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> Signed-off-by: Andrea Righi <[email protected]>
- Loading branch information
Andrea Righi
committed
Nov 14, 2023
1 parent
84b9a13
commit 5425a2a
Showing
4 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()) |