Skip to content

Commit c313d73

Browse files
committed
Fix the structure of the generated VHDX
1 parent 81cf978 commit c313d73

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Microsoft/scripts/gen_modules_vhdx.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/bin/bash
22
set -ueo pipefail
33

4-
if [ $# -ne 2 ] || [ ! -d "$1" ]; then
5-
printf '%s' "Usage ./$0 <modules dir> <output file>" 1>&2
4+
if [ $# -ne 3 ] || [ ! -d "$1" ]; then
5+
printf '%s' "Usage ./$0 <modules dir> <kernelversion> <output file>" 1>&2
66
exit 1
77
fi
88

9-
if [ -e "$2" ]; then
10-
printf '%s' "Refusing to overwrite existing file $2" 1>&2
9+
if [ -e "$3" ]; then
10+
printf '%s' "Refusing to overwrite existing file $3" 1>&2
1111
exit 2
1212
fi
1313

@@ -30,14 +30,14 @@ mount "$lo_dev" "$tmp_dir/modules_img"
3030
chmod a+rw "$tmp_dir/modules_img"
3131

3232
# Copy over the contents of $1
33-
cp -r "$1"/* "$tmp_dir/modules_img"
33+
cp -r "$1/lib/modules/$2"/* "$tmp_dir/modules_img"
3434
umount "$tmp_dir/modules_img"
3535

3636
# Do the final conversion
37-
qemu-img convert -O vhdx "$tmp_dir/modules.img" "$2"
37+
qemu-img convert -O vhdx "$tmp_dir/modules.img" "$3"
3838

3939
# Fix ownership since we're probably running under sudo
4040
if [ -n "$SUDO_USER" ]; then
41-
chown "$SUDO_USER:$SUDO_USER" "$2"
41+
chown "$SUDO_USER:$SUDO_USER" "$3"
4242
fi
4343

0 commit comments

Comments
 (0)