1
0

Use Docker instead of Vagrant for generate images

Fixes #2
This commit is contained in:
2018-10-25 23:38:12 +00:00
parent 37c2e05062
commit a93073e0be
10 changed files with 76 additions and 231 deletions

View File

@ -15,26 +15,23 @@ Features:
First of all we need to generate rootfs for run qemu.
#### GNU/Linux
#### Install qemu and docker
$ sudo apt install -y debootstrap qemu
$ sudo qemu-debian-img generate sid.img
##### GNU/Linux
#### macOS
$ sudo apt install -y qemu docker
##### macOS
Note: qemu on macOS since v2.12 (24 April 2018) supports Hypervisor.framework.
$ brew install qemu
$ brew cask install docker
Because it's a very complicated to debootstrap qemu images from macOS,
preferred way is to use Vagrant with any hypervisor.
#### Generate image
$ brew cask install vagrant
$ vagrant plugin install vagrant-vbguest
$ cd $GOPATH/src/github.com/jollheef/out-of-tree/qemu/tools/qemu-debian-image
$ vagrant up && vagrant destroy -f
bionic.img, vmlinuz-bionic and initrd-bionic will be created in current directory.
$ cd $GOPATH/src/github.com/jollheef/out-of-tree/tools/qemu-debian-img
$ ./bootstrap.sh
### Fill configuration file

View File

@ -4,7 +4,7 @@
package qemukernel
const testConfigVmlinuz = "../tools/qemu-debian-img/vmlinuz-bionic"
const testConfigInitrd = "../tools/qemu-debian-img/initrd-bionic"
const testConfigRootfs = "../tools/qemu-debian-img/bionic.img"
const testConfigSampleKo = "../tools/qemu-debian-img/sample.ko"
const testConfigVmlinuz = "../tools/qemu-debian-img/ubuntu1804.vmlinuz"
const testConfigInitrd = "../tools/qemu-debian-img/ubuntu1804.initrd"
const testConfigRootfs = "../tools/qemu-debian-img/ubuntu1804.img"
const testConfigSampleKo = "../tools/qemu-debian-img/ubuntu1804.ko"