File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22set -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
77fi
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
1212fi
1313
@@ -30,14 +30,14 @@ mount "$lo_dev" "$tmp_dir/modules_img"
3030chmod 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"
3434umount " $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
4040if [ -n " $SUDO_USER " ]; then
41- chown " $SUDO_USER :$SUDO_USER " " $2 "
41+ chown " $SUDO_USER :$SUDO_USER " " $3 "
4242fi
4343
You can’t perform that action at this time.
0 commit comments