Skip to content

Commit

Permalink
Merge pull request #65 from winnscode/winn-dev-2.2
Browse files Browse the repository at this point in the history
virtme: fix virtme's kernel modules directory check
  • Loading branch information
Andrea Righi authored Feb 2, 2024
2 parents b7cb323 + 5f4cdc5 commit abfca37
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions bin/virtme-prep-kdir-mods
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ if ! [ -f "modules.order" ]; then
exit 1
fi


# Delete existing .virtme_modes/lib/modules/0.0.0/modules.dep file at the beginning,
# and regenerated by depmod at the end. So if we are interrupted during the
# preparation of .virtme_mods folder, the next run command can correctly trigger the
# prepararion work again.

if [ -f "$MODDIR/modules.dep" ]; then
rm $MODDIR/modules.dep
fi

# Set up .virtme_mods/lib/modules/0.0.0 as a module directory for this kernel,
# but fill it with symlinks instead of actual modules.

Expand Down
2 changes: 1 addition & 1 deletion virtme/commands/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ def find_kernel_and_mods(arch, args) -> Kernel:
# Check if modules.order exists, otherwise fallback to mods=none
if os.path.exists(mod_file):
# Check if virtme's kernel modules directory needs to be updated
if not os.path.exists(virtme_mods) or is_file_more_recent(
if not os.path.exists(virtme_mod_file) or is_file_more_recent(
mod_file, virtme_mod_file
):
if modmode == "use":
Expand Down

0 comments on commit abfca37

Please sign in to comment.