diff --git a/Makefile b/Makefile index 8710428ce..8684e1496 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ endif PREFIX?=/usr/local/ MOBY_REPO=https://github.com/moby/tool.git -MOBY_COMMIT=57c6720356a8ede6758d60c5d66752d8e19b9ecf +MOBY_COMMIT=99480b5dd01b18ff2c80a2ce33ad46a436ccdb25 MOBY_VERSION=0.0 bin/moby: tmp_moby_bin.tar | bin tar xf $< diff --git a/README.md b/README.md index c196aa477..e864512a5 100644 --- a/README.md +++ b/README.md @@ -45,8 +45,8 @@ Once you have built the tool, use ``` moby build linuxkit.yml ``` -to build the example configuration. You can also specify different output formats, eg `moby build -format raw linuxkit.yml` to -output a raw bootable disk image. See `moby build -help` for more information. +to build the example configuration. You can also specify different output formats, eg `moby build -format raw-bios linuxkit.yml` to +output a raw BIOS bootable disk image, or `moby build -format iso-efi linuxkit.yml` to output an EFI bootable ISO image. See `moby build -help` for more information. ### Booting and Testing diff --git a/docs/platform-aws.md b/docs/platform-aws.md index 9f9a09d1a..03e88a776 100644 --- a/docs/platform-aws.md +++ b/docs/platform-aws.md @@ -22,7 +22,7 @@ export AWS_REGION=eu-west-1 AWS requires a `RAW` image. To create one: ``` -$ moby build -format raw examples/aws.yml +$ moby build -format aws examples/aws.yml ``` ## Push image diff --git a/test/cases/000_build/000_outputs/004_raw/test.sh b/test/cases/000_build/000_outputs/004_aws/test.sh similarity index 84% rename from test/cases/000_build/000_outputs/004_raw/test.sh rename to test/cases/000_build/000_outputs/004_aws/test.sh index bd1ac9c13..b972cb7a5 100644 --- a/test/cases/000_build/000_outputs/004_raw/test.sh +++ b/test/cases/000_build/000_outputs/004_aws/test.sh @@ -16,7 +16,7 @@ clean_up() { trap clean_up EXIT -moby build -format raw -name "${NAME}" ../test.yml +moby build -format aws -name "${NAME}" ../test.yml [ -f "${NAME}.raw" ] || exit 1 exit 0 diff --git a/test/cases/000_build/000_outputs/008_raw_bios/test.sh b/test/cases/000_build/000_outputs/008_raw_bios/test.sh new file mode 100644 index 000000000..ee353aa6b --- /dev/null +++ b/test/cases/000_build/000_outputs/008_raw_bios/test.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# SUMMARY: Check that raw output format is generated +# LABELS: + +set -e + +# Source libraries. Uncomment if needed/defined +#. "${RT_LIB}" +. "${RT_PROJECT_ROOT}/_lib/lib.sh" + +NAME=check + +clean_up() { + rm -f ${NAME}* +} + +trap clean_up EXIT + +moby build -format raw-bios -name "${NAME}" ../test.yml +[ -f "${NAME}-bios.img" ] || exit 1 + +exit 0 diff --git a/test/cases/000_build/000_outputs/009_raw_efi/test.sh b/test/cases/000_build/000_outputs/009_raw_efi/test.sh new file mode 100644 index 000000000..8466e0add --- /dev/null +++ b/test/cases/000_build/000_outputs/009_raw_efi/test.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# SUMMARY: Check that raw output format is generated +# LABELS: + +set -e + +# Source libraries. Uncomment if needed/defined +#. "${RT_LIB}" +. "${RT_PROJECT_ROOT}/_lib/lib.sh" + +NAME=check + +clean_up() { + rm -f ${NAME}* +} + +trap clean_up EXIT + +moby build -format raw-efi -name "${NAME}" ../test.yml +[ -f "${NAME}-efi.img" ] || exit 1 + +exit 0 diff --git a/test/cases/000_build/000_outputs/005_qcow2/test.sh b/test/cases/000_build/000_outputs/010_qcow2_bios/test.sh similarity index 83% rename from test/cases/000_build/000_outputs/005_qcow2/test.sh rename to test/cases/000_build/000_outputs/010_qcow2_bios/test.sh index edba153c2..72091f5cd 100644 --- a/test/cases/000_build/000_outputs/005_qcow2/test.sh +++ b/test/cases/000_build/000_outputs/010_qcow2_bios/test.sh @@ -16,7 +16,7 @@ clean_up() { trap clean_up EXIT -moby build -format qcow2 -name "${NAME}" ../test.yml +moby build -format qcow2-bios -name "${NAME}" ../test.yml [ -f "${NAME}.qcow2" ] || exit 1 exit 0 diff --git a/test/cases/010_platforms/000_qemu/030_run_qcow/test.sh b/test/cases/010_platforms/000_qemu/030_run_qcow_bios/test.sh similarity index 86% rename from test/cases/010_platforms/000_qemu/030_run_qcow/test.sh rename to test/cases/010_platforms/000_qemu/030_run_qcow_bios/test.sh index 0de332136..fad0db79d 100644 --- a/test/cases/010_platforms/000_qemu/030_run_qcow/test.sh +++ b/test/cases/010_platforms/000_qemu/030_run_qcow_bios/test.sh @@ -15,7 +15,7 @@ clean_up() { } trap clean_up EXIT -moby build -format qcow2 -name "${NAME}" test.yml +moby build -format qcow2-bios -name "${NAME}" test.yml [ -f "${NAME}.qcow2" ] || exit 1 linuxkit run qemu "${NAME}.qcow2" | grep -q "Welcome to LinuxKit" diff --git a/test/cases/010_platforms/000_qemu/030_run_qcow/test.yml b/test/cases/010_platforms/000_qemu/030_run_qcow_bios/test.yml similarity index 100% rename from test/cases/010_platforms/000_qemu/030_run_qcow/test.yml rename to test/cases/010_platforms/000_qemu/030_run_qcow_bios/test.yml diff --git a/test/cases/010_platforms/000_qemu/040_run_raw_bios/test.sh b/test/cases/010_platforms/000_qemu/040_run_raw_bios/test.sh new file mode 100644 index 000000000..e65467eb6 --- /dev/null +++ b/test/cases/010_platforms/000_qemu/040_run_raw_bios/test.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# SUMMARY: Check that raw image boots in qemu +# LABELS: + +set -e + +# Source libraries. Uncomment if needed/defined +#. "${RT_LIB}" +. "${RT_PROJECT_ROOT}/_lib/lib.sh" + +NAME=qemu-raw + +clean_up() { + rm -rf ${NAME}* +} +trap clean_up EXIT + +moby build -format raw-bios -name "${NAME}" test.yml +[ -f "${NAME}-bios.img" ] || exit 1 +linuxkit run qemu "${NAME}-bios.img" | grep -q "Welcome to LinuxKit" + +exit 0 diff --git a/test/cases/010_platforms/000_qemu/040_run_raw/test.yml b/test/cases/010_platforms/000_qemu/040_run_raw_bios/test.yml similarity index 100% rename from test/cases/010_platforms/000_qemu/040_run_raw/test.yml rename to test/cases/010_platforms/000_qemu/040_run_raw_bios/test.yml diff --git a/test/cases/010_platforms/000_qemu/040_run_raw/test.sh b/test/cases/010_platforms/000_qemu/050_run_aws/test.sh similarity index 87% rename from test/cases/010_platforms/000_qemu/040_run_raw/test.sh rename to test/cases/010_platforms/000_qemu/050_run_aws/test.sh index c9f18a310..4c4bff9ab 100644 --- a/test/cases/010_platforms/000_qemu/040_run_raw/test.sh +++ b/test/cases/010_platforms/000_qemu/050_run_aws/test.sh @@ -15,7 +15,7 @@ clean_up() { } trap clean_up EXIT -moby build -format raw -name "${NAME}" test.yml +moby build -format aws -name "${NAME}" test.yml [ -f "${NAME}.raw" ] || exit 1 linuxkit run qemu "${NAME}.raw" | grep -q "Welcome to LinuxKit" diff --git a/test/cases/010_platforms/000_qemu/050_run_aws/test.yml b/test/cases/010_platforms/000_qemu/050_run_aws/test.yml new file mode 100644 index 000000000..c562e779c --- /dev/null +++ b/test/cases/010_platforms/000_qemu/050_run_aws/test.yml @@ -0,0 +1,13 @@ +kernel: + image: linuxkit/kernel:4.9.59 + cmdline: "console=ttyS0" +init: + - linuxkit/init:42a92119e1ca10380e0d33e26c0cbcf85b9b3558 + - linuxkit/runc:817fdc592eac6cb7804fa1721a43a7f6e23fb50f +onboot: + - name: poweroff + image: linuxkit/poweroff:280bd01daa8776fbe1f4d912977f1886b8374834 + command: ["/bin/sh", "/poweroff.sh", "10"] +trust: + org: + - linuxkit diff --git a/tools/mkimage-dynamic-vhd/make-dynamic-vhd b/tools/mkimage-dynamic-vhd/make-dynamic-vhd index 5115cb8ff..c7675c67f 100755 --- a/tools/mkimage-dynamic-vhd/make-dynamic-vhd +++ b/tools/mkimage-dynamic-vhd/make-dynamic-vhd @@ -40,7 +40,7 @@ cd .. tar cf files.tar -C files . # Disk is created in qcow format. -virt-make-fs --size=25G --type=ext4 --partition files.tar --format=qcow2 disk.qcow +virt-make-fs --size=25G --type=ext4 --partition files.tar --format=qcow2-bios disk.qcow guestfish -a disk.qcow -m /dev/sda1 <vmdk conversion makes any efficency gains -virt-make-fs --size=1G --type=ext4 --partition files.tar --format=qcow2 disk.qcow +virt-make-fs --size=1G --type=ext4 --partition files.tar --format=qcow2-bios disk.qcow guestfish -a disk.qcow -m /dev/sda1 <