Skip to content

Instantly share code, notes, and snippets.

@onyxhat
Last active June 15, 2018 03:05
Show Gist options
  • Select an option

  • Save onyxhat/5d268d39fb600b59ab4d94fa78e69c5a to your computer and use it in GitHub Desktop.

Select an option

Save onyxhat/5d268d39fb600b59ab4d94fa78e69c5a to your computer and use it in GitHub Desktop.
Ubuntu fd0 Errors on boot in Hyper-V
#! /bin/bash
set -e
#Re-run the script if not using sudo/root
detect_current_uid() {
echo $(id -u)
}
rerun_script_as_root() {
if [ $(detect_current_uid) -ne "0" ]; then
local ENVVARS=$(echo $@)
echo "Re-running script as root..."
exec sudo $ENVVARS bash $0
fi
}
rerun_script_as_root
rmmod floppy
echo "blacklist floppy" | tee /etc/modprobe.d/blacklist-floppy.conf
dpkg-reconfigure initramfs-tools
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment