Skip to content

Commit

Permalink
virtme-prep-kdir-mods: delete existing $MODDIR/modules.dep at beginning
Browse files Browse the repository at this point in the history
If preparation process of .virtme_mods is interrupted, the directory
will be in an inconsistent state and needs to updated on the next
run.

Now we use $MODDIR/modules.dep file in run.py to check if virtme_mods
needs to be updated, so we can delete the modules.dep file at the
beginning to ensure that if the command is interrupted, we will update
the directory on the next run.

Signed-off-by: Winston Wen <[email protected]>
  • Loading branch information
winnscode committed Feb 2, 2024
1 parent 22bedd8 commit 5f4cdc5
Showing 1 changed file with 10 additions and 0 deletions.
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

0 comments on commit 5f4cdc5

Please sign in to comment.