mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-19 09:16:29 +00:00
Merge pull request #2658 from deitch/format-docs
Update docs and test cases to work with latest format versions
This commit is contained in:
commit
afc59610f6
2
Makefile
2
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 $<
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
22
test/cases/000_build/000_outputs/008_raw_bios/test.sh
Normal file
22
test/cases/000_build/000_outputs/008_raw_bios/test.sh
Normal file
@ -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
|
22
test/cases/000_build/000_outputs/009_raw_efi/test.sh
Normal file
22
test/cases/000_build/000_outputs/009_raw_efi/test.sh
Normal file
@ -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
|
@ -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
|
@ -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"
|
||||
|
22
test/cases/010_platforms/000_qemu/040_run_raw_bios/test.sh
Normal file
22
test/cases/010_platforms/000_qemu/040_run_raw_bios/test.sh
Normal file
@ -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
|
@ -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"
|
||||
|
13
test/cases/010_platforms/000_qemu/050_run_aws/test.yml
Normal file
13
test/cases/010_platforms/000_qemu/050_run_aws/test.yml
Normal file
@ -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
|
@ -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 <<EOF
|
||||
upload /usr/lib/SYSLINUX/mbr.bin /mbr.bin
|
||||
|
@ -40,7 +40,7 @@ cd ..
|
||||
tar cf files.tar -C files .
|
||||
|
||||
# Disk is created in qcow format, testing needed to see if raw->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 <<EOF
|
||||
upload /usr/lib/SYSLINUX/mbr.bin /mbr.bin
|
||||
|
Loading…
Reference in New Issue
Block a user