Skip to content

Commit

Permalink
ship tooling to ease qcow2 volumes creation
Browse files Browse the repository at this point in the history
Signed-off-by: António Meireles <[email protected]>
  • Loading branch information
AntonioMeireles committed Jul 18, 2016
1 parent 8f897c9 commit 3e6018b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.imdoneignore
.vscode
hyperkit
qcow-tool
imgs
*.img
tmp.*
Expand Down
17 changes: 15 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ BUILDDATE = $(shell /bin/date "+%FT%T%Z")

HYPERKIT_GIT = "https://github.com/docker/hyperkit.git"
HYPERKIT_COMMIT = 1e4b9b8d252c2fb5eee39830591a819c490eaf5e
QCOWTOOL_GIT = "https://github.com/mirage/ocaml-qcow.git"
QCOWTOOL_COMMIT = 96db516

MKDIR = /bin/mkdir -p
CP = /bin/cp
Expand Down Expand Up @@ -74,13 +76,13 @@ components/common/assets: force

clean: components/common/assets
$(RM) $(BUILD_DIR)/*
$(RM) hyperkit
$(RM) hyperkit qcow-tool
$(RM) documentation/
$(RM) $(PROG)-$(VERSION).tar.gz

tarball: $(PROG)-$(VERSION).tar.gz

$(PROG)-$(VERSION).tar.gz: documentation hyperkit
$(PROG)-$(VERSION).tar.gz: documentation hyperkit qcow-tool
cd bin; tar cvzf ../$@ *

release: force
Expand Down Expand Up @@ -140,6 +142,17 @@ hyperkit: force
$(RM) dtrace/*.bak ; \
$(CP) -r dtrace ../examples

qcow-tool: force
$(RM) $@
$(GIT) clone $(QCOWTOOL_GIT) qcow-tool;
cd $@; \
$(GIT) checkout $(QCOWTOOL_COMMIT); \
$(MKDIR) bin; \
$(shell opam config env) PREFIX=$$(pwd) NAME=$@ $(MAKE);\
$(shell opam config env) PREFIX=$$(pwd) NAME=$@ \
$(MAKE) reinstall
$(CP) $@/bin/$@ $(BUILD_DIR)/$@

documentation/man: cmd force
$(MKDIR) $@
$(BUILD_DIR)/$(PROG) utils genManPages
Expand Down
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,19 +138,21 @@ Accessing the newly created CoreOS instance is just a few more clicks away...
## simple usage recipe: a **docker** and **rkt** playground

### create a volume to store your persistent data
> the step bellow requires `qemu-img`to be present in you macOS host
> one way to achieve that is having it installed through
> [homebrew's](http://brew.sh) by issuing `❯❯❯ brew install qemu`
> [`qcow-tool`](https://github.com/mirage/ocaml-qcow), that we use bellow, is
> shipped together with **corectl** and creates qcow2 images.
>
> Please do note that the `--size` argument
> **must** to be suffixed the _right_ way - `KiB`/`MiB`/`GiB`/`TiB`/`PiB`
```
❯❯❯ qemu-img create -f qcow2 var_lib_docker.img.qcow2 16G
❯❯❯ qcow-tool create --size=16GiB var_lib_docker.img.qcow2
```
> will become `/var/lib/{docker|rkt}`. in this example case we created a
> will become `/var/lib/{docker|rkt}`. In this example case we created a
> **QCow2** volume with 16GB.
**Raw** volumes were the default until version
**[0.7.12](https://github.com/TheNewNormal/corectl/releases/tag/v0.7.12)**.
They are still supported but become a deprecated feature that may disappear
some point in the future.
| a quick note regarding Raw volumes |
| -- |
| **Raw** volumes were the default until version **[0.7.12](https://github.com/TheNewNormal/corectl/releases/tag/v0.7.12)**. <br> They are still supported but become a deprecated feature that may disappear some point in the future. |

### *format* and label it
> we'll format and label the newly create volume from within a transient VM
Expand Down

0 comments on commit 3e6018b

Please sign in to comment.