Skip to content

Instantly share code, notes, and snippets.

@mcandre
Last active July 6, 2019 19:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcandre/04f77b7b9c516cb09f893a842de84c54 to your computer and use it in GitHub Desktop.
Save mcandre/04f77b7b9c516cb09f893a842de84c54 to your computer and use it in GitHub Desktop.
work in progress mips provision

preseed:

https://gist.githubusercontent.com/mcandre/2dbbf31b4cd7cc96cade6c2e6643ce52/raw/166e105e4f9896ceff639ed0def2749a3a5f239d/preseed

Commands:

$ IMG='debian-mips64el.qcow2'

$ qemu-img create -f qcow2 "$IMG" 8G

$ python -m SimpleHTTPServer 9999

$ PRESEED_HOST="$(ip address | awk '/inet 192/ { print $2 }' | sed 's/\/[0-9]*//' | head -n 1)"

$ qemu-system-mips64el \
    -cpu 5KEc \
    -m 1024 \
    -no-reboot \
    -hda "$IMG" \
    -initrd initrd.gz \
    -kernel vmlinux-4.9.0-9-5kc-malta \
    -append "nokaslr console=ttyS0 auto=true priority=critical locale=en_US language=en country=US preseed/url=http://${PRESEED_HOST}:9999/p kbd-chooser/method=us keyboard-configuration/xkb-keymap=us netcfg/get_hostname=vagrant netcfg/get_domain=vagrantup.com debconf/frontend=noninteractive fb=false"

$ sudo modprobe nbd max_part=8
$ sudo qemu-nbd --connect=/dev/nbd0 "$IMG"
$ mkdir debian-mips64el
$ mkdir debian-mips64el-mount
$ sudo mount /dev/nbd0p1 debian-mips64el-mount
$ cp -r debian-mips64el/* debian-mips64el/
$ sudo umount /dev/nbd0p1
$ sudo nbd-client -d /dev/nbd0

$ qemu-system-mips64el \
    -cpu 5KEc \
    -m 1024 \
    -hda "$IMG" \
    -initrd debian-mips64el/initrd.img \
    -kernel debian-mips64el/vmlinux \
    -append 'nokaslr console=ttyS0 root=/dev/sda1'

(Ctrl+Alt+3)

WARNING: Failed to connect to lvmetad. Falling back to device scanning.

Screenshot:

https://i.imgur.com/mOlKtfP.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment