Moved code to autoboot into its own function to avoid code duplication.
Fixed bug which caused -f option not to work if the system was not booting from disk.