Created
October 29, 2020 20:53
-
-
Save tobert/f8dc693301ffbb83a1f9f1ed276d1f3c to your computer and use it in GitHub Desktop.
xhyve system rescue
This file contains hidden or 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/bash | |
# start up my Arch machine | |
# for this to work I had to extract kernel & initramfs from the ISO | |
# which is a surprisingly a pain in the butt on OSX but easy enough | |
# to find on Google, tldr add 2K of zeroes to the front of the ISO | |
# then it'll mount just fine | |
# to make root disk: | |
# dd if=/dev/zero of=root.img conv=sparse bs=1000000 count=20000 | |
data=/Users/atobey/archbox | |
# System Rescue seems to need those last 2 params to work in xhyve | |
# maybe a newer version will fix this? | |
cmdline="earlyprintk=serial console=ttyS0 archisolabel=RESCUE700 archisobasedir=sysresccd" | |
/usr/local/bin/xhyve \ | |
-A \ | |
-m 4G \ | |
-c 4 \ | |
-s 1,ahci-cd,$data/tmp/systemrescue-7.00-amd64.iso \ | |
-s 2,virtio-blk,$data/root-disk.img \ | |
-s 3,virtio-net,vmnet0 \ | |
-s 0:0,hostbridge -s 31,lpc -l com1,stdio \ | |
-f "kexec,$data/rescue-vmlinuz,$data/rescue-initramfs.img,$cmdline" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment