diff options
author | Andy Lutomirski <luto@kernel.org> | 2019-08-29 17:01:38 -0700 |
---|---|---|
committer | Andy Lutomirski <luto@kernel.org> | 2019-08-29 17:01:38 -0700 |
commit | 342e75481b13f09ed83794ff42cfbd679a61a2da (patch) | |
tree | 94124951e9fea4b603dc7e49793e1fd6b2a560a8 | |
parent | d16d93d24e3fc5f6b7ecec1cc8a666c6ddeef851 (diff) | |
download | virtme-342e75481b13f09ed83794ff42cfbd679a61a2da.tar.gz |
virtme-prep-kdir-mods: Add a better error message and fix shellcheck warnings
Signed-off-by: Andy Lutomirski <luto@kernel.org>
-rwxr-xr-x | bin/virtme-prep-kdir-mods | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/virtme-prep-kdir-mods b/bin/virtme-prep-kdir-mods index 309e755..be28fb6 100755 --- a/bin/virtme-prep-kdir-mods +++ b/bin/virtme-prep-kdir-mods @@ -10,6 +10,11 @@ fi FAKEVER=0.0.0 MODDIR=".virtme_mods/lib/modules/$FAKEVER" +if ! [ -f "modules.order" ]; then + echo "modules.order is missing. Your kernel may be too old or you didn't make modules." >&2 + exit 1 +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. @@ -20,7 +25,7 @@ ln -srfT . "$MODDIR/build" # to the build kenrnel. find "$MODDIR/kernel" -type l -print0 |xargs -0 rm -f -- while read -r i; do - [ ! -e $i ] && i=$(echo $i | sed s:^kernel/::) + [ ! -e "$i" ] && i=$(echo "$i" | sed s:^kernel/::) mkdir -p "$MODDIR/kernel/$(dirname "$i")" ln -sr "$i" "$MODDIR/kernel/$i" done < modules.order |