Skip to content

Instantly share code, notes, and snippets.

@Leask
Created November 27, 2012 13:12
Show Gist options
  • Save Leask/4154169 to your computer and use it in GitHub Desktop.
Save Leask/4154169 to your computer and use it in GitHub Desktop.
Built Linux Ramdisk in order to boot linux from a USB disk on a Mac with VMware Fusion.
#!/bin/bash
# Flora Rebuilt Linux Ramdisk by LeaskH.com
if [ "`/Library/Application\ Support/VMware\ Fusion/vmware-rawdiskCreator print /dev/disk1 | grep -c 'Linux'`" -eq 1 ]; then
LinuxDiskId=1;
fi
if [ "`/Library/Application\ Support/VMware\ Fusion/vmware-rawdiskCreator print /dev/disk2 | grep -c 'Linux'`" -eq 1 ]; then
LinuxDiskId=2;
fi
if [ "`/Library/Application\ Support/VMware\ Fusion/vmware-rawdiskCreator print /dev/disk3 | grep -c 'Linux'`" -eq 1 ]; then
LinuxDiskId=3;
fi
if [ "`/Library/Application\ Support/VMware\ Fusion/vmware-rawdiskCreator print /dev/disk4 | grep -c 'Linux'`" -eq 1 ]; then
LinuxDiskId=4;
fi
if [ "`/Library/Application\ Support/VMware\ Fusion/vmware-rawdiskCreator print /dev/disk5 | grep -c 'Linux'`" -eq 1 ]; then
LinuxDiskId=5;
fi
echo "Found linux disk id is $LinuxDiskId"
rm /Users/leask/Virtual\ Machines.localized/Flora\ Debian.vmwarevm/Flora\ Debian.vmdk
rm /Users/leask/Virtual\ Machines.localized/Flora\ Debian.vmwarevm/Flora\ Debian-pt.vmdk
/Library/Application\ Support/VMware\ Fusion/vmware-rawdiskCreator create /dev/disk$LinuxDiskId 1 /Users/leask/Virtual\ Machines.localized/Flora\ Debian.vmwarevm/Flora\ Debian 'ide'
echo "Rebuilt new linux ramdisk"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment