@@ -39,23 +39,31 @@ as follows:
3939
4040 You may wish to include ` -j$(nproc) ` on the first ` make ` command to build in parallel.
4141
42- 4 . Calculate the modules size (plus 256 MB for slack) :
43- ` $ modules_size=$(du -bs "$PWD/modules" | awk '{print $1;}'); modules_size=$((modules_size + (256*(1<<20)))); `
42+ Then, you can use a provided script to create a VHDX containing the modules :
43+ `$ ./Microsoft/scripts/gen_modules_vhdx.sh "$PWD/modules" modules.vhdx"
4444
45- 5 . Create a blank image file for the modules :
46- ` $ dd if=/dev/zero of= "$PWD/modules.img" bs=1024 count=$((modules_size / 1024)) `
45+ To save space, you can now delete the compilation artifacts :
46+ ` $ make clean && rm -r "$PWD/modules" `
4747
48- 6 . Setup filesystem and mount img file:
49- ` $ lo_dev=$(sudo losetup --find --show "$PWD/modules.img") && sudo mkfs -t ext4 "$lo_dev"; mkdir "$PWD/modules_img" && sudo mount "$lo_dev" "$PWD/modules_img" && sudo chmod a+w "$PWD/modules_img" `
48+ If you prefer, you can also build the modules VHDX manually as follows:
5049
51- 7 . Copy over the modules, unmount the img now that we're done with it :
52- ` $ cp -r "$PWD/modules/lib/modules/$(make -s kernelrelease)"/* " $PWD/modules_img" && sudo umount "$PWD/modules_img" `
50+ 1 . Calculate the modules size (plus 1024 bytes for slack) :
51+ ` modules_size=$(du -s " $PWD/modules" | awk '{print $1;}'); modules_size=$((modules_size + 1024)); `
5352
54- 8 . Convert the img to VHDX :
55- ` $ qemu-img convert -O vhdx "$PWD/modules.img" "$PWD/modules.vhdx" `
53+ 2 . Create a blank image file for the modules :
54+ ` dd if=/dev/zero of= "$PWD/modules.img" bs=1 count=$modules_size `
5655
57- 9 . Clean up:
58- ` $ rm -r modules.img modules_img # optionally $PWD/modules dir too `
56+ 3 . Setup filesystem and mount img file:
57+ ` lo_dev=$(losetup --find --show "$PWD/modules.img"); mkfs -t ext4 $lo_dev; sudo mount $lo_dev "$PWD/modules_img" `
58+
59+ 4 . Copy over the modules, unmount the img now that we're done with it:
60+ ` cp -r "$PWD/modules" "$PWD/modules_img"; sudo umount "$PWD/modules_img" `
61+
62+ 5 . Convert the img to VHDX:
63+ ` qemu-img convert -O VHDX "$PWD/modules.img" "$PWD/modules.vhdx" `
64+
65+ 6 . Clean up:
66+ ` rm modules.img # optionally $PWD/modules dir too `
5967
6068# Install Instructions
6169
0 commit comments