Created
January 29, 2017 20:39
-
-
Save ffainelli/ecaed81acc9226fc0531b04f71c3d725 to your computer and use it in GitHub Desktop.
install-modules.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
id=$(id -u) | |
if [ $id != 0 ]; then | |
SUDO=sudo | |
else | |
SUDO="" | |
fi | |
KERN_DIR=${1:-$HOME/dev/linux/} | |
INST_DIR=$PWD/mnt | |
$SUDO qemu-nbd -d /dev/nbd0 | |
$SUDO qemu-nbd -c /dev/nbd0 debian.img | |
$SUDO mount -o loop /dev/nbd0p1 $INST_DIR | |
$SUDO make -C $KERN_DIR INSTALL_MOD_PATH=$INST_DIR modules_install | |
$SUDO umount $INST_DIR | |
$SUDO qemu-nbd -d /dev/nbd0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment