From a20fa7f98b9d172580b083f76e04e5a17c25829b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Krzysztof=20Rekucki?= Date: Tue, 20 Aug 2024 12:50:44 +0200 Subject: [PATCH 01/22] revert: remove poc files --- runtime/poc/gvmkit.sh | 126 ++++++++++++++++++++++++++ runtime/poc/runtime/efi-virtio.rom | 3 + runtime/poc/runtime/kvmvapic.bin | 3 + runtime/poc/runtime/linuxboot_dma.bin | 3 + 4 files changed, 135 insertions(+) create mode 100755 runtime/poc/gvmkit.sh create mode 100644 runtime/poc/runtime/efi-virtio.rom create mode 100644 runtime/poc/runtime/kvmvapic.bin create mode 100644 runtime/poc/runtime/linuxboot_dma.bin diff --git a/runtime/poc/gvmkit.sh b/runtime/poc/gvmkit.sh new file mode 100755 index 00000000..e740c59b --- /dev/null +++ b/runtime/poc/gvmkit.sh @@ -0,0 +1,126 @@ +#! /bin/bash + +usage() { + local ME=$(basename $0) + echo "" + echo -e "\tGolem VMKIT" + echo "" + echo "Usage:" + echo "" + echo "$ME build [output-name]" + echo "" + echo "$ME run {-v : } [-m ] [ ... ]" + echo "" +} + +err() { + echo $@ >&2 + exit 1 +} + +do_build() { + set -x + local IMAGE CONTAINER + IMAGE="$1" + CONTAINER=$(docker create "${IMAGE}") || err "unable to load image: $IMAGE" + IMAGE_HASH=$(docker inspect $CONTAINER| jq .[0].Image -r | cut -c 8-20) + local OUT_DIR="out-$IMAGE_HASH" + mkdir "$OUT_DIR" + fakeroot "$0" repack "$CONTAINER" "$OUT_DIR" + rm -fr "$OUT_DIR" + docker rm "$CONTAINER" +} + +do_repack() { + local cmd + local OUT="$2" + docker export "$1" | tar xf - -C "$OUT" + docker inspect "$1" | jq '.[0].Config.Env[]' -r > $OUT/.env + ep=$(docker inspect "$1" | jq '.[0].Config.Entrypoint[]' -e -r) && echo $ep > $OUT/.entrypoint + cmd=$(docker inspect "$1" | jq '.[0].Config.Cmd[]' -e -r) && echo $cmd > $OUT/.cmd + vols=$(docker inspect "$1" | jq '.[0].Config.Volumes | keys[]' -e -r) && echo $vols > $OUT/.vols + docker inspect "$1" | jq '.[0].Config' > "${OUT}.json" + mksquashfs "$OUT" "$OUT.golem-app" -comp lzo + ( + cat "${OUT}.json" + printf "%08d" $(stat -c%s "${OUT}.json") + ) >> "$OUT.golem-app" + +} + +SCRIPT_DIR=$(readlink -f ${0%/*}) + +do_run() { + echo script_dir=$SCRIPT_DIR + local CUR=$(pwd) + local memory="200m" + local arg="" + local append="" + local tag=0 + + while getopts "dm:v:" o; do + case "${o}" in + m) + memory=${OPTARG} + ;; + d) + echo debug + append="$append NO_LOADER=1 NO_POWEROFF=1" + ;; + v) + IFS=':' read -ra VOLDEF <<< "$OPTARG" + SRC=$(cd ${VOLDEF[0]} 2>/dev/null && pwd) || err "invalid path :${VOLDEF[0]}" + DST="${VOLDEF[1]}" + MODE=${VOLDEF[2]:-rw} + tag=$[tag+1] + arg="$arg -virtfs local,path=$SRC,id=vol${tag},mount_tag=vol${tag},security_model=none" + arg="$arg -device virtio-9p-pci,fsdev=vol${tag},mount_tag=vol${tag}" + append="$append volmnt=vol${tag}:$DST" + ;; + *) + usage + ;; + esac + done + shift $((OPTIND-1)) + echo memory=$memory + echo arg=$arg + + local VMIMG="$(cd $(dirname "$1") && pwd)/$(basename "$1")" + test -f "$VMIMG" || err "missing application image: $VMIMG" + + echo vmkit=$VMIMG + + cd $SCRIPT_DIR/runtime + shift + for a in $@ + do + append="$append apparg=\"$a\"" + done + echo $@ + ./vmrt -m "$memory" -nographic -vga none -kernel vmlinuz-virt -initrd initramfs-virt -net none -accel kvm -cpu "host" -smp $(nproc) \ + -device virtio-serial,id=ser0 -device virtserialport,chardev=foo,name=org.fedoraproject.port.0 -chardev socket,path=/tmp/foo,server,nowait,id=foo \ + -append "console=ttyS0 panic=1 $append" \ + -drive file="$VMIMG",cache=none,readonly=on,format=raw,if=virtio -no-reboot \ + $arg +} + +case $1 +in + build) + do_build $2 + ;; + repack) + shift + do_repack $@ + ;; + run) + shift + do_run $@ + ;; + *) + usage + exit 1 +esac + + diff --git a/runtime/poc/runtime/efi-virtio.rom b/runtime/poc/runtime/efi-virtio.rom new file mode 100644 index 00000000..1e14be5e --- /dev/null +++ b/runtime/poc/runtime/efi-virtio.rom @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:26be36901db7f8181c306cc62bd74891d8646528965a78e40cceadba5dd7c8e7 +size 160768 diff --git a/runtime/poc/runtime/kvmvapic.bin b/runtime/poc/runtime/kvmvapic.bin new file mode 100644 index 00000000..6f7ae45d --- /dev/null +++ b/runtime/poc/runtime/kvmvapic.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cdf057a71b07e3b52b19cbe210bdefa59250d01a9810b960f7fe1f98eed95a27 +size 9216 diff --git a/runtime/poc/runtime/linuxboot_dma.bin b/runtime/poc/runtime/linuxboot_dma.bin new file mode 100644 index 00000000..52e882f9 --- /dev/null +++ b/runtime/poc/runtime/linuxboot_dma.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c49e255340c78fc12e54ed043462bca02fb7fca29b7cfab62ff88a5344b6950 +size 1536 From 01f5e2f59fcdf0416903b8688c359c56e90b34f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Krzysztof=20Rekucki?= Date: Tue, 20 Aug 2024 15:03:12 +0200 Subject: [PATCH 02/22] fix /proc/self/fd + permisions to '/' --- runtime/init-container/src/init.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/runtime/init-container/src/init.c b/runtime/init-container/src/init.c index a388cbf9..cd78c7e0 100644 --- a/runtime/init-container/src/init.c +++ b/runtime/init-container/src/init.c @@ -2188,10 +2188,14 @@ int main(int argc, char **argv) { MS_NOSUID | MS_NODEV, "mode=0700,size=128M")); - CHECK(mkdir("/mnt/overlay/upper", S_IRWXU)); - CHECK(mkdir("/mnt/overlay/work", S_IRWXU)); - CHECK(mount("/dev/vda", "/mnt/image", "squashfs", MS_RDONLY | MS_NODEV, "")); + { + struct stat statbuf; + CHECK(stat("/mnt/image", &statbuf)); + CHECK(mkdir("/mnt/overlay/upper", statbuf.st_mode)); + CHECK(mkdir("/mnt/overlay/work", statbuf.st_mode)); + } + if (access("/dev/vdb", R_OK) == 0) { CHECK(mkdir("/mnt/gpu-files", S_IRWXU)); CHECK(mount("/dev/vdb", "/mnt/gpu-files", "squashfs", MS_RDONLY | MS_NODEV, "")); @@ -2220,6 +2224,9 @@ int main(int argc, char **argv) { CHECK(mount("devtmpfs", SYSROOT "/dev", "devtmpfs", MS_NOSUID, "mode=0755,size=2M")); + + CHECK(symlinkat("/proc/self/fd", AT_FDCWD, SYSROOT "/dev/fd")); + CHECK(mount("tmpfs", SYSROOT "/tmp", "tmpfs", MS_NOSUID, "mode=0777")); From a9fe92396c6dde697e69866d74328772794bef54 Mon Sep 17 00:00:00 2001 From: Kamil Koczurek Date: Thu, 22 Aug 2024 10:09:59 +0200 Subject: [PATCH 03/22] runtime: add initial support for volume override --- Cargo.lock | 281 +++++++++++++++++++++++++++++++++++++------- README.md | 4 +- runtime/Cargo.toml | 80 +++++++++++-- runtime/src/lib.rs | 27 ++++- rust-toolchain.toml | 2 +- 5 files changed, 333 insertions(+), 61 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ccc3f8af..9190368f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -30,7 +30,7 @@ dependencies = [ "actix-service", "actix-utils", "ahash", - "base64", + "base64 0.13.0", "bitflags", "brotli", "bytes", @@ -63,7 +63,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "465a6172cf69b960917811022d8f29bc0b7fa1398bc4f78b3c466673db1213b6" dependencies = [ "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -194,7 +194,7 @@ checksum = "44318e776df68115a881de9a8fd1b9e53368d7a4a5ce4cc48517da3393233a5e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -227,7 +227,7 @@ dependencies = [ "actix-tls", "actix-utils", "ahash", - "base64", + "base64 0.13.0", "bytes", "cfg-if", "cookie", @@ -254,6 +254,24 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bigdecimal" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1e50562e37200edf7c6c43e54a08e64a5553bfb59d9c297d5572512aa517256" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", + "serde", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -275,7 +293,7 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c92fed694fd5a7468c971538351c61b9c115f1ae6ed411cd2800f0f299403a4b" dependencies = [ - "base64", + "base64 0.13.0", "bollard-stubs", "bytes", "chrono", @@ -307,7 +325,7 @@ checksum = "ed2f2e73fffe9455141e170fb9c1feb0ac521ec7e7dcd47a7cab72a658490fb8" dependencies = [ "chrono", "serde", - "serde_with", + "serde_with 1.11.0", ] [[package]] @@ -355,6 +373,15 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" +[[package]] +name = "bytesize" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e368af43e418a04d52505cf3dbc23dda4e3407ae2fa99fd0e4f308ce546acc" +dependencies = [ + "serde", +] + [[package]] name = "bytestring" version = "1.1.0" @@ -560,7 +587,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn", + "syn 1.0.109", ] [[package]] @@ -577,7 +604,7 @@ checksum = "747b608fecf06b0d72d440f27acc99288207324b793be2c17991839f3d4995ea" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -586,8 +613,18 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "757c0ded2af11d8e739c4daea1ac623dd1624b06c844cf3f5a39f1bdbd99bb12" dependencies = [ - "darling_core", - "darling_macro", + "darling_core 0.13.0", + "darling_macro 0.13.0", +] + +[[package]] +name = "darling" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +dependencies = [ + "darling_core 0.20.10", + "darling_macro 0.20.10", ] [[package]] @@ -601,7 +638,21 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.10.0", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "darling_core" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.11.1", + "syn 2.0.43", ] [[package]] @@ -610,9 +661,20 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ade7bff147130fe5e6d39f089c6bd49ec0250f35d70b2eebf72afdfc919f15cc" dependencies = [ - "darling_core", + "darling_core 0.13.0", "quote", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +dependencies = [ + "darling_core 0.20.10", + "quote", + "syn 2.0.43", ] [[package]] @@ -631,7 +693,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn", + "syn 1.0.109", ] [[package]] @@ -715,7 +777,7 @@ dependencies = [ "heck 0.4.0", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -744,6 +806,12 @@ dependencies = [ "termcolor", ] +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "errno" version = "0.3.1" @@ -908,7 +976,7 @@ dependencies = [ "proc-macro-hack", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1011,7 +1079,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap", + "indexmap 1.9.1", "slab", "tokio", "tokio-util 0.7.3", @@ -1024,6 +1092,12 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + [[package]] name = "heck" version = "0.3.3" @@ -1206,7 +1280,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" +dependencies = [ + "equivalent", + "hashbrown 0.14.5", + "serde", ] [[package]] @@ -1536,6 +1622,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "num-bigint" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-integer" version = "0.1.44" @@ -1643,7 +1740,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" dependencies = [ "fixedbitset", - "indexmap", + "indexmap 1.9.1", ] [[package]] @@ -1663,7 +1760,7 @@ checksum = "6e8fe8163d14ce7f0cdac2e040116f22eac817edabff0be91e8aff7e9accf389" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1723,7 +1820,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn", + "syn 1.0.109", ] [[package]] @@ -1784,7 +1881,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "version_check", ] @@ -1813,9 +1910,9 @@ checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" [[package]] name = "proc-macro2" -version = "1.0.59" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] @@ -1862,7 +1959,7 @@ dependencies = [ "itertools", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2116,31 +2213,40 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.145" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" dependencies = [ "serde_derive", ] +[[package]] +name = "serde_bytes" +version = "0.11.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" +dependencies = [ + "serde", +] + [[package]] name = "serde_derive" -version = "1.0.145" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fa1584d3d1bcacd84c277a0dfe21f5b0f6accf4a23d04d4c6d61f1af522b4c" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.43", ] [[package]] name = "serde_json" -version = "1.0.70" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e277c495ac6cd1a01a58d0a0c574568b4d1ddf14f59965c6a58b8d96400b54f3" +checksum = "cb0652c533506ad7a2e353cce269330d6afd8bdfb6d75e0ace5b35aacbd7b9e9" dependencies = [ - "itoa 0.4.8", + "itoa 1.0.2", "ryu", "serde", ] @@ -2165,7 +2271,25 @@ checksum = "ad6056b4cb69b6e43e3a0f055def223380baecc99da683884f205bf347f7c4b3" dependencies = [ "rustversion", "serde", - "serde_with_macros", + "serde_with_macros 1.5.1", +] + +[[package]] +name = "serde_with" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20" +dependencies = [ + "base64 0.22.1", + "chrono", + "hex", + "indexmap 1.9.1", + "indexmap 2.4.0", + "serde", + "serde_derive", + "serde_json", + "serde_with_macros 3.8.1", + "time 0.3.11", ] [[package]] @@ -2174,10 +2298,22 @@ version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12e47be9471c72889ebafb5e14d5ff930d89ae7a67bbdb5f8abb564f845a927e" dependencies = [ - "darling", + "darling 0.13.0", "proc-macro2", "quote", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "serde_with_macros" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65569b702f41443e8bc8bbb1c5779bd0450bbe723b56198980e80ec45780bce2" +dependencies = [ + "darling 0.20.10", + "proc-macro2", + "quote", + "syn 2.0.43", ] [[package]] @@ -2186,7 +2322,7 @@ version = "0.9.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8613d593412a0deb7bbd8de9d908efff5a0cb9ccd8f62c641e7b2ed2f57291d1" dependencies = [ - "indexmap", + "indexmap 1.9.1", "itoa 1.0.2", "ryu", "serde", @@ -2266,6 +2402,12 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + [[package]] name = "structopt" version = "0.3.25" @@ -2287,7 +2429,26 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" + +[[package]] +name = "strum_macros" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +dependencies = [ + "heck 0.4.0", + "proc-macro2", + "quote", + "rustversion", + "syn 1.0.109", ] [[package]] @@ -2301,6 +2462,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee659fb5f3d355364e1f3e5bc10fb82068efbf824a1e9d1c9504244a6469ad53" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "tar" version = "0.4.37" @@ -2381,7 +2553,7 @@ checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2403,6 +2575,7 @@ dependencies = [ "itoa 1.0.2", "libc", "num_threads", + "serde", "time-macros", ] @@ -2465,7 +2638,7 @@ checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2532,7 +2705,7 @@ checksum = "11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2758,7 +2931,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "wasm-bindgen-shared", ] @@ -2780,7 +2953,7 @@ checksum = "7d94ac45fcf608c1f45ef53e748d35660f168490c10b23704c7779ab8f5c3048" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3032,6 +3205,25 @@ dependencies = [ "libc", ] +[[package]] +name = "ya-client-model" +version = "0.7.0" +source = "git+https://github.com/golemfactory/ya-client.git?rev=c74a2b323a7fc5f077d5ff5c229bd1e1e709513a#c74a2b323a7fc5f077d5ff5c229bd1e1e709513a" +dependencies = [ + "bigdecimal", + "bytesize", + "chrono", + "derive_more", + "rand 0.8.4", + "serde", + "serde_bytes", + "serde_json", + "serde_with 3.8.1", + "strum", + "strum_macros", + "thiserror", +] + [[package]] name = "ya-runtime-api" version = "0.6.0" @@ -3078,7 +3270,7 @@ source = "git+https://github.com/golemfactory/ya-runtime-sdk.git?rev=0395b0c704e dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -3104,6 +3296,7 @@ dependencies = [ "tokio-byteorder", "url", "uuid", + "ya-client-model", "ya-runtime-sdk", ] diff --git a/README.md b/README.md index 5231c72d..f1d26246 100644 --- a/README.md +++ b/README.md @@ -21,12 +21,12 @@ Prerequisites: Recommendation: use the Rust toolchain installer from [https://rustup.rs/](https://rustup.rs/) -- `musl-gcc` +- `musl-gcc` and `gperf` On a Ubuntu system, execute in terminal: ```bash - sudo apt install musl musl-tools + sudo apt install musl musl-tools gperf ``` Git checkout: diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index c1caf7c9..df722304 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -7,20 +7,64 @@ license = "GPL-3.0" [package.metadata.deb] assets = [ - ["target/release/ya-runtime-vm", "usr/lib/yagna/plugins/ya-runtime-vm/", "755"], - ["conf/ya-runtime-vm.json", "usr/lib/yagna/plugins/", "644"], + [ + "target/release/ya-runtime-vm", + "usr/lib/yagna/plugins/ya-runtime-vm/", + "755", + ], + [ + "conf/ya-runtime-vm.json", + "usr/lib/yagna/plugins/", + "644", + ], # self-test.gvmi is downloaded by .github/workflows/release.yml from https://github.com/golemfactory/ya-self-test-img/releases - ["image/self-test.gvmi", "usr/lib/yagna/plugins/ya-runtime-vm/runtime/", "644"], + [ + "image/self-test.gvmi", + "usr/lib/yagna/plugins/ya-runtime-vm/runtime/", + "644", + ], - ["poc/runtime/vmrt", "usr/lib/yagna/plugins/ya-runtime-vm/runtime/", "755"], - ["poc/runtime/vgabios-stdvga.bin", "usr/lib/yagna/plugins/ya-runtime-vm/runtime/", "644"], - ["poc/runtime/bios-256k.bin", "usr/lib/yagna/plugins/ya-runtime-vm/runtime/", "644"], - ["poc/runtime/kvmvapic.bin", "usr/lib/yagna/plugins/ya-runtime-vm/runtime/", "644"], - ["poc/runtime/linuxboot_dma.bin", "usr/lib/yagna/plugins/ya-runtime-vm/runtime/", "644"], - ["poc/runtime/efi-virtio.rom", "usr/lib/yagna/plugins/ya-runtime-vm/runtime/", "644"], + [ + "poc/runtime/vmrt", + "usr/lib/yagna/plugins/ya-runtime-vm/runtime/", + "755", + ], + [ + "poc/runtime/vgabios-stdvga.bin", + "usr/lib/yagna/plugins/ya-runtime-vm/runtime/", + "644", + ], + [ + "poc/runtime/bios-256k.bin", + "usr/lib/yagna/plugins/ya-runtime-vm/runtime/", + "644", + ], + [ + "poc/runtime/kvmvapic.bin", + "usr/lib/yagna/plugins/ya-runtime-vm/runtime/", + "644", + ], + [ + "poc/runtime/linuxboot_dma.bin", + "usr/lib/yagna/plugins/ya-runtime-vm/runtime/", + "644", + ], + [ + "poc/runtime/efi-virtio.rom", + "usr/lib/yagna/plugins/ya-runtime-vm/runtime/", + "644", + ], - ["init-container/initramfs.cpio.gz", "usr/lib/yagna/plugins/ya-runtime-vm/runtime/", "644"], - ["init-container/vmlinuz-virt", "usr/lib/yagna/plugins/ya-runtime-vm/runtime/", "644"], + [ + "init-container/initramfs.cpio.gz", + "usr/lib/yagna/plugins/ya-runtime-vm/runtime/", + "644", + ], + [ + "init-container/vmlinuz-virt", + "usr/lib/yagna/plugins/ya-runtime-vm/runtime/", + "644", + ], ] [dependencies.ya-runtime-sdk] @@ -42,10 +86,22 @@ serde = { version = "^1.0", features = ["derive"] } serde_json = "1.0" strip-ansi-escapes = "0.1.0" structopt = "0.3" -tokio = { version = "1.21.2", features = ["fs", "io-std", "io-util", "macros", "process", "rt", "rt-multi-thread", "sync", "time", "net"] } +tokio = { version = "1.21.2", features = [ + "fs", + "io-std", + "io-util", + "macros", + "process", + "rt", + "rt-multi-thread", + "sync", + "time", + "net", +] } tokio-byteorder = "0.3" uuid = { version = "1.1", features = ["v4"] } url = "2.3" +ya-client-model = { git = "https://github.com/golemfactory/ya-client.git", rev = "c74a2b323a7fc5f077d5ff5c229bd1e1e709513a" } [dev-dependencies] env_logger = "0.10" diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index fcebe01c..420861cd 100755 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -9,6 +9,7 @@ use bollard_stubs::models::ContainerConfig; use futures::future::FutureExt; use futures::lock::Mutex; use futures::TryFutureExt; +use std::collections::HashMap; use std::convert::TryFrom; use std::env; use std::path::{Component, Path, PathBuf}; @@ -20,6 +21,8 @@ use tokio::{ io::{self, AsyncWriteExt}, }; use url::Url; +use uuid::Uuid; +use ya_client_model::activity::exe_script_command::VolumeInfo; use crate::{ cpu::CpuInfo, @@ -27,7 +30,7 @@ use crate::{ guest_agent_comm::{RedirectFdType, RemoteCommandResult}, vmrt::{start_vmrt, RuntimeData}, }; -use ya_runtime_sdk::runtime_api::deploy::ContainerEndpoint; +use ya_runtime_sdk::runtime_api::deploy::{ContainerEndpoint, ContainerVolume}; use ya_runtime_sdk::{ runtime_api::{ @@ -72,6 +75,8 @@ pub struct Cli { /// PCI device identifier #[structopt(long, env = "YA_RUNTIME_VM_PCI_DEVICE")] pci_device: Option>, + #[structopt(long, env = "YA_RUNTIME_VOLUME_OVERRIDE")] + volume_override: Option, #[structopt(flatten)] test_config: TestConfig, } @@ -253,8 +258,12 @@ async fn deploy(workdir: PathBuf, cli: Cli) -> anyhow::Result>(&vo_str)) + .transpose()?; - let deployment = Deployment::try_from_input( + let mut deployment = Deployment::try_from_input( package_file, cli.cpu_cores, (cli.mem_gib * 1024.) as usize, @@ -263,6 +272,20 @@ async fn deploy(workdir: PathBuf, cli: Cli) -> anyhow::Result Date: Thu, 22 Aug 2024 11:38:20 +0200 Subject: [PATCH 04/22] ci: disable macos build --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f5e01b90..4b212224 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: strategy: matrix: #os: [macos-latest, windows-latest, ubuntu-latest] - os: [macos-latest, ubuntu-latest] + os: [ubuntu-latest] steps: - name: Checkout From 05d8253c1a01a5f33669cd3b49a550f4c6454f0a Mon Sep 17 00:00:00 2001 From: Kamil Koczurek Date: Thu, 22 Aug 2024 11:38:37 +0200 Subject: [PATCH 05/22] chore: fix warning --- runtime/examples/commands.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/examples/commands.rs b/runtime/examples/commands.rs index 11656176..850ed9a2 100644 --- a/runtime/examples/commands.rs +++ b/runtime/examples/commands.rs @@ -165,7 +165,7 @@ async fn main() -> anyhow::Result<()> { .pid; log::info!("pid: {}", pid); - c.kill_process(server::KillProcess { + let _ = c.kill_process(server::KillProcess { pid, signal: 0, // TODO }); From 81bb74596b5ef805fef5307a963eb1b804c1f973 Mon Sep 17 00:00:00 2001 From: Kamil Koczurek Date: Thu, 22 Aug 2024 11:45:02 +0200 Subject: [PATCH 06/22] chore: appease clippy --- gvmkit/src/image_builder.rs | 2 +- runtime/examples/commands.rs | 9 ++-- runtime/src/cpu.rs | 83 +++++++++++++++++------------------- runtime/src/deploy.rs | 2 +- 4 files changed, 46 insertions(+), 50 deletions(-) diff --git a/gvmkit/src/image_builder.rs b/gvmkit/src/image_builder.rs index c26e573e..6caebc91 100644 --- a/gvmkit/src/image_builder.rs +++ b/gvmkit/src/image_builder.rs @@ -153,7 +153,7 @@ async fn repack( let squashfs_image = "prekucki/squashfs-tools:latest"; let squashfs_cont = "sqfs-tools"; - let start_cmd = vec!["tail", "-f", "/dev/null"]; // prevent container from exiting + let start_cmd = ["tail", "-f", "/dev/null"]; // prevent container from exiting let options = ContainerOptions { image_name: squashfs_image.to_owned(), container_name: squashfs_cont.to_owned(), diff --git a/runtime/examples/commands.rs b/runtime/examples/commands.rs index 850ed9a2..6b2e2259 100644 --- a/runtime/examples/commands.rs +++ b/runtime/examples/commands.rs @@ -128,10 +128,7 @@ async fn main() -> anyhow::Result<()> { { let run = server::RunProcess { bin: "/bin/ls".to_string(), - args: vec!["ls", "-al", "."] - .iter() - .map(|s| s.to_string()) - .collect(), + args: ["ls", "-al", "."].iter().map(|s| s.to_string()).collect(), work_dir: "/".to_string(), stdout: None, stderr: None, @@ -165,10 +162,12 @@ async fn main() -> anyhow::Result<()> { .pid; log::info!("pid: {}", pid); - let _ = c.kill_process(server::KillProcess { + let fut = c.kill_process(server::KillProcess { pid, signal: 0, // TODO }); + std::mem::drop(fut); + events.process_died(pid).notified().await; } diff --git a/runtime/src/cpu.rs b/runtime/src/cpu.rs index 2ec1c820..49c65cf9 100644 --- a/runtime/src/cpu.rs +++ b/runtime/src/cpu.rs @@ -131,49 +131,46 @@ fn cpu_features(info: &CpuId) -> anyhow::Result> { (has_tm, TM), (has_pbe, PBE) ); - capabilities.extend( - flags!( - ext_features, - (has_fsgsbase, FSGSBASE), - (has_tsc_adjust_msr, ADJUST_MSR), - (has_bmi1, BMI1), - (has_hle, HLE), - (has_avx2, AVX2), - (has_fdp, FDP), - (has_smep, SMEP), - (has_bmi2, BMI2), - (has_rep_movsb_stosb, REP_MOVSB_STOSB), - (has_invpcid, INVPCID), - (has_rtm, RTM), - (has_rdtm, RDTM), - (has_fpu_cs_ds_deprecated, DEPRECATE_FPU_CS_DS), - (has_mpx, MPX), - (has_rdta, RDTA), - (has_rdseed, RDSEED), - (has_adx, ADX), - (has_smap, SMAP), - (has_clflushopt, CLFLUSHOPT), - (has_processor_trace, PROCESSOR_TRACE), - (has_sha, SHA), - (has_sgx, SGX), - (has_avx512f, AVX512F), - (has_avx512dq, AVX512DQ), - (has_avx512_ifma, AVX512_IFMA), - (has_avx512pf, AVX512PF), - (has_avx512er, AVX512ER), - (has_avx512cd, AVX512CD), - (has_avx512bw, AVX512BW), - (has_avx512vl, AVX512VL), - (has_clwb, CLWB), - (has_prefetchwt1, PREFETCHWT1), - (has_umip, UMIP), - (has_pku, PKU), - (has_ospke, OSPKE), - (has_rdpid, RDPID), - (has_sgx_lc, SGX_LC) - ) - .into_iter(), - ); + capabilities.extend(flags!( + ext_features, + (has_fsgsbase, FSGSBASE), + (has_tsc_adjust_msr, ADJUST_MSR), + (has_bmi1, BMI1), + (has_hle, HLE), + (has_avx2, AVX2), + (has_fdp, FDP), + (has_smep, SMEP), + (has_bmi2, BMI2), + (has_rep_movsb_stosb, REP_MOVSB_STOSB), + (has_invpcid, INVPCID), + (has_rtm, RTM), + (has_rdtm, RDTM), + (has_fpu_cs_ds_deprecated, DEPRECATE_FPU_CS_DS), + (has_mpx, MPX), + (has_rdta, RDTA), + (has_rdseed, RDSEED), + (has_adx, ADX), + (has_smap, SMAP), + (has_clflushopt, CLFLUSHOPT), + (has_processor_trace, PROCESSOR_TRACE), + (has_sha, SHA), + (has_sgx, SGX), + (has_avx512f, AVX512F), + (has_avx512dq, AVX512DQ), + (has_avx512_ifma, AVX512_IFMA), + (has_avx512pf, AVX512PF), + (has_avx512er, AVX512ER), + (has_avx512cd, AVX512CD), + (has_avx512bw, AVX512BW), + (has_avx512vl, AVX512VL), + (has_clwb, CLWB), + (has_prefetchwt1, PREFETCHWT1), + (has_umip, UMIP), + (has_pku, PKU), + (has_ospke, OSPKE), + (has_rdpid, RDPID), + (has_sgx_lc, SGX_LC) + )); Ok(capabilities) } diff --git a/runtime/src/deploy.rs b/runtime/src/deploy.rs index 81b6851b..aec7a02d 100644 --- a/runtime/src/deploy.rs +++ b/runtime/src/deploy.rs @@ -72,7 +72,7 @@ impl Deployment { .env .as_ref() .map(|v| v.iter().map(|s| s.as_str()).collect()) - .unwrap_or_else(Vec::new) + .unwrap_or_default() } } From f5e49ea42bd915274f0e7b74a5b3e2b80b83badb Mon Sep 17 00:00:00 2001 From: Kamil Koczurek Date: Tue, 27 Aug 2024 13:15:19 +0200 Subject: [PATCH 07/22] runtime: add deploy mount support * Emit cmdline for each mount: * storage: vol-{k}={path}[,errors={errors}]:{device id} * ram: vol-{k}={path},size={size} * Minimal implementation of qcow2 to create files for storage. * Emit nvidia=true cmdline to signify that the last vdX is the nvidia drive. --- Cargo.lock | 4 +- runtime/Cargo.toml | 2 +- runtime/src/deploy.rs | 45 +++++++++++++- runtime/src/lib.rs | 41 +++++++------ runtime/src/qcow2_min/10k.header | Bin 0 -> 480 bytes runtime/src/qcow2_min/mod.rs | 97 +++++++++++++++++++++++++++++++ runtime/src/self_test.rs | 67 +++++++++++++++++++-- runtime/src/vmrt.rs | 46 ++++++++++++++- 8 files changed, 270 insertions(+), 32 deletions(-) create mode 100644 runtime/src/qcow2_min/10k.header create mode 100644 runtime/src/qcow2_min/mod.rs diff --git a/Cargo.lock b/Cargo.lock index 9190368f..121c5fd7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3207,8 +3207,8 @@ dependencies = [ [[package]] name = "ya-client-model" -version = "0.7.0" -source = "git+https://github.com/golemfactory/ya-client.git?rev=c74a2b323a7fc5f077d5ff5c229bd1e1e709513a#c74a2b323a7fc5f077d5ff5c229bd1e1e709513a" +version = "0.6.0" +source = "git+https://github.com/golemfactory/ya-client.git?rev=8d1a7e549b9febeda20008215e08bea5e8375751#8d1a7e549b9febeda20008215e08bea5e8375751" dependencies = [ "bigdecimal", "bytesize", diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index df722304..48a39589 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -101,7 +101,7 @@ tokio = { version = "1.21.2", features = [ tokio-byteorder = "0.3" uuid = { version = "1.1", features = ["v4"] } url = "2.3" -ya-client-model = { git = "https://github.com/golemfactory/ya-client.git", rev = "c74a2b323a7fc5f077d5ff5c229bd1e1e709513a" } +ya-client-model = { git = "https://github.com/golemfactory/ya-client.git", rev = "8d1a7e549b9febeda20008215e08bea5e8375751" } [dev-dependencies] env_logger = "0.10" diff --git a/runtime/src/deploy.rs b/runtime/src/deploy.rs index aec7a02d..dc2650c5 100644 --- a/runtime/src/deploy.rs +++ b/runtime/src/deploy.rs @@ -9,8 +9,16 @@ use tokio::io::{AsyncRead, AsyncReadExt, AsyncSeek, AsyncSeekExt}; use tokio_byteorder::LittleEndian; use uuid::Uuid; +use ya_client_model::activity::exe_script_command::{VolumeInfo, VolumeMount}; use ya_runtime_sdk::runtime_api::deploy::ContainerVolume; +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct DeploymentMount { + pub name: String, + pub guest_path: String, + pub mount: VolumeMount, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct Deployment { #[serde(default)] @@ -21,6 +29,7 @@ pub struct Deployment { pub task_package: PathBuf, pub user: (u32, u32), pub volumes: Vec, + pub mounts: Vec, pub config: ContainerConfig, } @@ -30,6 +39,7 @@ impl Deployment { cpu_cores: usize, mem_mib: usize, task_package: PathBuf, + volume_override: HashMap, ) -> Result where Input: AsyncRead + AsyncSeek + Unpin, @@ -57,12 +67,45 @@ impl Deployment { } let config: ContainerConfig = serde_json::from_str(&json)?; + + let mut volumes = parse_volumes(config.volumes.as_ref()); + + let mounts = volume_override + .into_iter() + .filter_map(|(path, vol_info)| match vol_info { + VolumeInfo::Override {} => { + let volume_present = volumes.iter().any(|vol| vol.path == path); + if !volume_present { + volumes.push(ContainerVolume { + name: format!("vol-{}", Uuid::new_v4()), + path: path, + }); + } + + None + } + + VolumeInfo::Mount(mount) => { + volumes.retain(|vol| vol.path != path); + Some(DeploymentMount { + name: match mount { + VolumeMount::Ram { .. } => format!("tmpfs-{}", Uuid::new_v4()), + VolumeMount::Storage { .. } => format!("vol-{}.img", Uuid::new_v4()), + }, + guest_path: path, + mount, + }) + } + }) + .collect(); + Ok(Deployment { cpu_cores, mem_mib, task_package, user: parse_user(config.user.as_ref()).unwrap_or((0, 0)), - volumes: parse_volumes(config.volumes.as_ref()), + volumes, + mounts, config, }) } diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 420861cd..7c10d173 100755 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -1,11 +1,13 @@ pub mod cpu; pub mod deploy; pub mod guest_agent_comm; +mod qcow2_min; mod response_parser; mod self_test; pub mod vmrt; use bollard_stubs::models::ContainerConfig; +use deploy::DeploymentMount; use futures::future::FutureExt; use futures::lock::Mutex; use futures::TryFutureExt; @@ -21,8 +23,7 @@ use tokio::{ io::{self, AsyncWriteExt}, }; use url::Url; -use uuid::Uuid; -use ya_client_model::activity::exe_script_command::VolumeInfo; +use ya_client_model::activity::exe_script_command::{VolumeInfo, VolumeMount}; use crate::{ cpu::CpuInfo, @@ -30,7 +31,7 @@ use crate::{ guest_agent_comm::{RedirectFdType, RemoteCommandResult}, vmrt::{start_vmrt, RuntimeData}, }; -use ya_runtime_sdk::runtime_api::deploy::{ContainerEndpoint, ContainerVolume}; +use ya_runtime_sdk::runtime_api::deploy::ContainerEndpoint; use ya_runtime_sdk::{ runtime_api::{ @@ -261,35 +262,37 @@ async fn deploy(workdir: PathBuf, cli: Cli) -> anyhow::Result>(&vo_str)) - .transpose()?; + .transpose()? + .unwrap_or_default(); - let mut deployment = Deployment::try_from_input( + let deployment = Deployment::try_from_input( package_file, cli.cpu_cores, (cli.mem_gib * 1024.) as usize, package_path, + volume_override, ) .await .or_err("Error reading package metadata")?; - if let Some(volume_override) = volume_override { - deployment.volumes.clear(); - - for (guest_path, vol_info) in volume_override { - // Only VolumeInfo::Override creates a hole in the FS for transfers. - if matches!(&vol_info, VolumeInfo::Override {}) { - deployment.volumes.push(ContainerVolume { - name: format!("vol-{}", Uuid::new_v4()), - path: guest_path, - }); - } - } - } - for vol in &deployment.volumes { fs::create_dir_all(work_dir.join(&vol.name)).await?; } + for DeploymentMount { name, mount, .. } in &deployment.mounts { + let VolumeMount::Storage { + size, preallocate, .. + } = mount + else { + continue; + }; + + let file = fs::File::create(work_dir.join(name)).await?; + let qcow2 = + qcow2_min::Qcow2Image::new(size.as_u64(), preallocate.unwrap_or_default().as_u64()); + qcow2.write(file).await?; + } + fs::OpenOptions::new() .create(true) .write(true) diff --git a/runtime/src/qcow2_min/10k.header b/runtime/src/qcow2_min/10k.header new file mode 100644 index 0000000000000000000000000000000000000000..f1b31f6edd5f2de24c3adc7b58501f5951217f94 GIT binary patch literal 480 zcma)&!3x4K42IKf58xx@=-G!51TUUE*EPe!)|MYotJ*UULH>PF&{>F` zZqaDb*w~h`24(HLz|{BFJCrfxX@Kh4-x)HvT_HJPOMS*bL8~t#GBvdyoaE5hrGV*Y SIvsw3FV8};KH Self { + Qcow2Image { size, preallocate } + } + + /// Writes a valid qcow2 image according to the parameters. + /// + /// Resultant `qemu-img info`: + /// ``` + /// cluster_size: 65536 + /// Format specific information: + /// compat: 1.1 + /// compression type: zlib + /// lazy refcounts: false + /// refcount bits: 16 + /// corrupt: false + /// extended l2: false + /// ``` + pub async fn write( + &self, + mut writer: W, + ) -> Result<()> { + let clusters = ((self.size - 1) / QCOW2_CLUSTERS_SZ_DIV + 4).max(QCOW2_CLUSTERS_MIN); + let clusters2 = self.size.div_ceil(QCOW2_CLUSTERS_SZ_DIV2); + let mut file_sz = self + .preallocate + .max(clusters2 * QCOW2_CLUSTER_SIZE + QCOW2_CLUSTER_OFFSET); + + const BLOCK_SZ: u64 = 4096; + let block: &'static [u8] = &[0; BLOCK_SZ as usize]; + + while file_sz >= BLOCK_SZ { + writer.write_all(&block).await?; + file_sz -= BLOCK_SZ as u64; + } + if file_sz > 0 { + writer.write_all(&block[0..file_sz as usize]).await?; + } + + writer.rewind().await?; + writer.write_all(QCOW2_HEADER).await?; + + writer.seek(SeekFrom::Start(QCOW2_SIZE_OFFSET)).await?; + writer.write_all(&self.size.to_be_bytes()).await?; + + writer + .seek(SeekFrom::Start(QCOW2_L1_ENTRIES_OFFSET)) + .await?; + let l1_entries = self.size.div_ceil(QCOW2_L1_SIZE_DIV); + writer.write_all(&l1_entries.to_be_bytes()).await?; + + writer + .seek(SeekFrom::Start(QCOW2_MYSTERY_CONST1_OFFSET)) + .await?; + writer + .write_all(&QCOW2_MYSTERY_CONST1.to_be_bytes()) + .await?; + + for k in 0..clusters { + let offset = QCOW2_CLUSTERS_OFFSET + 2 * k; + writer.seek(SeekFrom::Start(offset)).await?; + writer.write_all(&[0, 1]).await?; + } + + Ok(()) + } +} diff --git a/runtime/src/self_test.rs b/runtime/src/self_test.rs index dc9fc165..89bb27c3 100644 --- a/runtime/src/self_test.rs +++ b/runtime/src/self_test.rs @@ -3,6 +3,7 @@ use futures::lock::Mutex; use notify::event::{AccessKind, AccessMode}; use notify::{Event, EventKind, RecommendedWatcher, RecursiveMode, Watcher}; use serde_json::Value; +use std::collections::HashMap; use std::path::{Path, PathBuf}; use std::str::FromStr; use std::sync::Arc; @@ -10,14 +11,15 @@ use std::time::Duration; use tokio::fs; use tokio::sync::Notify; use uuid::Uuid; +use ya_client_model::activity::exe_script_command::{VolumeInfo, VolumeMount}; use ya_runtime_sdk::runtime_api::deploy::ContainerVolume; use ya_runtime_sdk::runtime_api::server::RuntimeHandler; use ya_runtime_sdk::{runtime_api::server, server::Server, Context, Error, ErrorExt, EventEmitter}; use ya_runtime_sdk::{ProcessStatus, RunProcess, RuntimeStatus}; -use crate::deploy::Deployment; +use crate::deploy::{Deployment, DeploymentMount}; use crate::vmrt::{runtime_dir, RuntimeData}; -use crate::{Runtime, TestConfig}; +use crate::{qcow2_min, Runtime, TestConfig}; const FILE_TEST_IMAGE: &str = "self-test.gvmi"; const FILE_TEST_EXECUTABLE: &str = "ya-self-test"; @@ -137,10 +139,39 @@ async fn self_test_deployment( let package_file = fs::File::open(package_path.clone()) .await .or_err("Error reading package file")?; - let deployment = - Deployment::try_from_input(package_file, cpu_cores, mem_mib, package_path.clone()) - .await - .or_err("Error reading package metadata")?; + let deployment = Deployment::try_from_input( + package_file, + cpu_cores, + mem_mib, + package_path.clone(), + HashMap::from_iter([ + ( + "/golem/storage".to_string(), + VolumeInfo::Mount(VolumeMount::Storage { + size: "10gi".parse().unwrap(), + preallocate: None, + errors: Some("remount-ro".to_string()), + }), + ), + ( + "/golem/storage2".to_string(), + VolumeInfo::Mount(VolumeMount::Storage { + size: "10ti".parse().unwrap(), + preallocate: Some("128ki".parse().unwrap()), + errors: None, + }), + ), + ( + "/".to_string(), + VolumeInfo::Mount(VolumeMount::Ram { + size: "1gi".parse().unwrap(), + }), + ), + ]), + ) + .await + .or_err("Error reading package metadata")?; + for vol in &deployment.volumes { let vol_dir = work_dir.join(&vol.name); log::debug!("Creating volume dir: {vol_dir:?} for path {}", vol.path); @@ -148,6 +179,30 @@ async fn self_test_deployment( .await .or_err("Failed to create volume dir")?; } + + for DeploymentMount { + name, + mount, + guest_path, + } in &deployment.mounts + { + let VolumeMount::Storage { + size, preallocate, .. + } = mount + else { + continue; + }; + + let qcow2_dir = work_dir.join(name); + log::debug!( + "Creating qcow2 image: {qcow2_dir:?} for path {guest_path} with parameters {mount:?}" + ); + let file = fs::File::create(qcow2_dir).await?; + let qcow2 = + qcow2_min::Qcow2Image::new(size.as_u64(), preallocate.unwrap_or_default().as_u64()); + qcow2.write(file).await?; + } + Ok(deployment) } diff --git a/runtime/src/vmrt.rs b/runtime/src/vmrt.rs index 4370cb14..fa913cc3 100755 --- a/runtime/src/vmrt.rs +++ b/runtime/src/vmrt.rs @@ -10,11 +10,12 @@ use futures::FutureExt; use tokio::io::AsyncBufReadExt; use tokio::{io, process, spawn}; +use ya_client_model::activity::exe_script_command::VolumeMount; use ya_runtime_sdk::runtime_api::server; use ya_runtime_sdk::server::ContainerEndpoint; use ya_runtime_sdk::{serialize, ErrorExt, EventEmitter}; -use crate::deploy::Deployment; +use crate::deploy::{Deployment, DeploymentMount}; use crate::guest_agent_comm::{GuestAgent, Notification}; const DIR_RUNTIME: &str = "runtime"; @@ -70,6 +71,8 @@ pub async fn start_vmrt( let vpn_remote = data.vpn.clone(); let inet_remote = data.inet.clone(); + let mut kernel_cmdline = "console=ttyS0 panic=1".to_string(); + let mut cmd = process::Command::new(runtime_dir.join(FILE_RUNTIME)); cmd.current_dir(&runtime_dir); cmd.args([ @@ -85,8 +88,6 @@ pub async fn start_vmrt( "host", "-smp", deployment.cpu_cores.to_string().as_str(), - "-append", - "console=ttyS0 panic=1", "-device", "virtio-serial", "-device", @@ -108,6 +109,41 @@ pub async fn start_vmrt( "-no-reboot", ]); + let mut vol_idx = 0; + let mut dev_idx = 0; + for DeploymentMount { + name, + guest_path, + mount, + } in &deployment.mounts + { + match mount { + VolumeMount::Storage { errors, .. } => { + let img_path = work_dir.join(name); + cmd.args([ + "-drive", + format!( + "file={},format=qcow2,media=disk,if=virtio", + img_path.display() + ) + .as_str(), + ]); + kernel_cmdline.push_str(&match errors { + None => format!(" vol-{vol_idx}={guest_path}:{dev_idx}"), + Some(errors) => { + format!(" vol-{vol_idx}={guest_path},errors={errors}:{dev_idx}") + } + }); + dev_idx += 1; + } + VolumeMount::Ram { size } => { + let size = size.as_u64(); + kernel_cmdline.push_str(&format!(" vol-{vol_idx}={guest_path},size={size}")); + } + } + vol_idx += 1; + } + if let Some(pci_device_id) = &data.pci_device_id { for device_id in pci_device_id.iter() { cmd.arg("-device"); @@ -127,8 +163,12 @@ pub async fn start_vmrt( ) .as_str(), ); + + kernel_cmdline.push_str(&format!(" nvidia=true")); } + cmd.args(["-append", &kernel_cmdline]); + let (vpn, inet) = // backward-compatibility mode if vpn_remote.is_none() && inet_remote.is_none() { From 9c9513d9da61ecb0825a21d8ce1230deff5da7cb Mon Sep 17 00:00:00 2001 From: Kamil Koczurek Date: Wed, 28 Aug 2024 00:14:56 +0200 Subject: [PATCH 08/22] init-container: build busybox mkfs.ext2 --- runtime/init-container/.gitignore | 1 + runtime/init-container/Makefile | 13 +- runtime/init-container/busybox/Dockerfile | 9 + runtime/init-container/busybox/config | 1199 +++++++++++++++++++++ 4 files changed, 1221 insertions(+), 1 deletion(-) create mode 100644 runtime/init-container/busybox/Dockerfile create mode 100644 runtime/init-container/busybox/config diff --git a/runtime/init-container/.gitignore b/runtime/init-container/.gitignore index 4ea7c5a1..2d24aa90 100644 --- a/runtime/init-container/.gitignore +++ b/runtime/init-container/.gitignore @@ -4,3 +4,4 @@ vmlinuz-virt init initramfs.cpio.gz squashfs_drive +busybox/mkfs.ext2 \ No newline at end of file diff --git a/runtime/init-container/Makefile b/runtime/init-container/Makefile index 8f24e30c..31a64083 100644 --- a/runtime/init-container/Makefile +++ b/runtime/init-container/Makefile @@ -22,6 +22,9 @@ KERNEL_SHA256 ?= f3f7ca3421c5232e260b2a8a741bbf72c21881006afcf790aa3bc938e226271 HEADERS_URL ?= https://ya-runtime.s3-eu-west-1.amazonaws.com/vm/kernel/linux-headers-5.7.8-r0.apk HEADERS_SHA256 ?= 0b0f0c30be30ff367f5d1eaee227e919efc4b7f442bc03b3190c6e0d1a165362 +BUSYBOX := busybox +MKFS_NAME := mkfs.ext2 + UNPACKED_KERNEL := unpacked_kernel UNPACKED_HEADERS := unpacked_headers LIBURING_SUBMODULE ?= liburing @@ -94,6 +97,13 @@ uring: $(UNPACKED_HEADERS) (cd $(LIBURING_SUBMODULE) && CC=$(CC) CXX=$(CXX) ./configure > /dev/null) $(MAKE) -e CC=$(CC) -e CFLAGS=-I"$(CURDIR)/$(UNPACKED_HEADERS)/usr/include" -C "$(LIBURING_SUBMODULE)/src" all +mkfs: + cd $(BUSYBOX); \ + docker build -t busybox .; \ + docker create --name busybox-tmp busybox; \ + docker cp busybox-tmp:/busybox/busybox_MKFS_EXT2 $(MKFS_NAME); \ + docker rm -f busybox-tmp + SHELL := /bin/bash $(CURDIR)/$(LIBSECCOMP_SUBMODULE)/src/.libs/libseccomp.a $(CURDIR)/$(LIBSECCOMP_SUBMODULE)/include/seccomp.h: $(UNPACKED_HEADERS) $(LIBSECCOMP_SUBMODULE) set -euo pipefail; \ @@ -106,7 +116,7 @@ $(CURDIR)/$(LIBSECCOMP_SUBMODULE)/src/.libs/libseccomp.a $(CURDIR)/$(LIBSECCOMP_ vmlinuz-virt: $(UNPACKED_KERNEL) cp $(UNPACKED_KERNEL)/boot/vmlinuz-virt . -initramfs.cpio.gz: init $(UNPACKED_KERNEL) +initramfs.cpio.gz: init mkfs $(UNPACKED_KERNEL) $(RM) -rf initramfs mkdir initramfs cp $< initramfs @@ -129,6 +139,7 @@ initramfs.cpio.gz: init $(UNPACKED_KERNEL) cp $(UNPACKED_KERNEL)/lib/modules/$(KERNEL_VER)/kernel/net/core/failover.ko initramfs cp $(UNPACKED_KERNEL)/lib/modules/$(KERNEL_VER)/kernel/net/ipv6/ipv6.ko initramfs cp $(UNPACKED_KERNEL)/lib/modules/$(KERNEL_VER)/kernel/net/packet/af_packet.ko initramfs + cp $(BUSYBOX)/$(MKFS_NAME) initramfs mkdir initramfs/$(NEW_ROOT) set -euo pipefail; cd initramfs && find . | cpio --quiet -o -H newc -R 0:0 | gzip -9 > ../$@ $(RM) -rf initramfs diff --git a/runtime/init-container/busybox/Dockerfile b/runtime/init-container/busybox/Dockerfile new file mode 100644 index 00000000..e9d616c1 --- /dev/null +++ b/runtime/init-container/busybox/Dockerfile @@ -0,0 +1,9 @@ +FROM alpine:3.14 +RUN apk update \ + && apk add git build-base linux-headers \ + && git clone https://github.com/mirror/busybox +COPY config busybox/.config +RUN cd busybox \ + && git checkout 2d4a3d9e6c1493a9520b907e07a41aca90cdfd94 \ + && make oldconfig \ + && CFLAGS="-Os" LDFLAGS="--static" ./make_single_applets.sh \ No newline at end of file diff --git a/runtime/init-container/busybox/config b/runtime/init-container/busybox/config new file mode 100644 index 00000000..33c15aac --- /dev/null +++ b/runtime/init-container/busybox/config @@ -0,0 +1,1199 @@ +# +# Automatically generated make config: don't edit +# Busybox version: 1.37.0.git +# Tue Aug 27 16:43:17 2024 +# +# CONFIG_HAVE_DOT_CONFIG is not set + +# +# Settings +# +# CONFIG_DESKTOP is not set +# CONFIG_EXTRA_COMPAT is not set +# CONFIG_FEDORA_COMPAT is not set +# CONFIG_INCLUDE_SUSv2 is not set +# CONFIG_LONG_OPTS is not set +# CONFIG_SHOW_USAGE is not set +# CONFIG_FEATURE_VERBOSE_USAGE is not set +# CONFIG_FEATURE_COMPRESS_USAGE is not set +# CONFIG_LFS is not set +# CONFIG_PAM is not set +# CONFIG_FEATURE_DEVPTS is not set +# CONFIG_FEATURE_UTMP is not set +# CONFIG_FEATURE_WTMP is not set +# CONFIG_FEATURE_PIDFILE is not set +CONFIG_PID_FILE_PATH="" +# CONFIG_BUSYBOX is not set +# CONFIG_FEATURE_SHOW_SCRIPT is not set +# CONFIG_FEATURE_INSTALLER is not set +# CONFIG_INSTALL_NO_USR is not set +# CONFIG_FEATURE_SUID is not set +# CONFIG_FEATURE_SUID_CONFIG is not set +# CONFIG_FEATURE_SUID_CONFIG_QUIET is not set +# CONFIG_FEATURE_PREFER_APPLETS is not set +CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe" +# CONFIG_SELINUX is not set +# CONFIG_FEATURE_CLEAN_UP is not set +# CONFIG_FEATURE_SYSLOG_INFO is not set +# CONFIG_FEATURE_SYSLOG is not set + +# +# Build Options +# +# CONFIG_STATIC is not set +# CONFIG_PIE is not set +# CONFIG_NOMMU is not set +# CONFIG_BUILD_LIBBUSYBOX is not set +# CONFIG_FEATURE_LIBBUSYBOX_STATIC is not set +# CONFIG_FEATURE_INDIVIDUAL is not set +# CONFIG_FEATURE_SHARED_BUSYBOX is not set +CONFIG_CROSS_COMPILER_PREFIX="" +CONFIG_SYSROOT="" +CONFIG_EXTRA_CFLAGS="" +CONFIG_EXTRA_LDFLAGS="" +CONFIG_EXTRA_LDLIBS="" +# CONFIG_USE_PORTABLE_CODE is not set +# CONFIG_STACK_OPTIMIZATION_386 is not set +# CONFIG_STATIC_LIBGCC is not set + +# +# Installation Options ("make install" behavior) +# +CONFIG_INSTALL_APPLET_SYMLINKS=y +# CONFIG_INSTALL_APPLET_HARDLINKS is not set +# CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS is not set +# CONFIG_INSTALL_APPLET_DONT is not set +# CONFIG_INSTALL_SH_APPLET_SYMLINK is not set +# CONFIG_INSTALL_SH_APPLET_HARDLINK is not set +# CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER is not set +CONFIG_PREFIX="./_install" + +# +# Debugging Options +# +# CONFIG_DEBUG is not set +# CONFIG_DEBUG_PESSIMIZE is not set +# CONFIG_DEBUG_SANITIZE is not set +# CONFIG_UNIT_TEST is not set +# CONFIG_WERROR is not set +# CONFIG_WARN_SIMPLE_MSG is not set +CONFIG_NO_DEBUG_LIB=y +# CONFIG_DMALLOC is not set +# CONFIG_EFENCE is not set + +# +# Library Tuning +# +# CONFIG_FEATURE_USE_BSS_TAIL is not set +# CONFIG_FLOAT_DURATION is not set +# CONFIG_FEATURE_RTMINMAX is not set +# CONFIG_FEATURE_RTMINMAX_USE_LIBC_DEFINITIONS is not set +CONFIG_FEATURE_BUFFERS_USE_MALLOC=y +# CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set +# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set +CONFIG_PASSWORD_MINLEN=6 +CONFIG_MD5_SMALL=1 +CONFIG_SHA1_SMALL=3 +# CONFIG_SHA1_HWACCEL is not set +# CONFIG_SHA256_HWACCEL is not set +CONFIG_SHA3_SMALL=1 +# CONFIG_FEATURE_NON_POSIX_CP is not set +# CONFIG_FEATURE_VERBOSE_CP_MESSAGE is not set +# CONFIG_FEATURE_USE_SENDFILE is not set +CONFIG_FEATURE_COPYBUF_KB=4 +# CONFIG_MONOTONIC_SYSCALL is not set +# CONFIG_IOCTL_HEX2STR_ERROR is not set +# CONFIG_FEATURE_EDITING is not set +CONFIG_FEATURE_EDITING_MAX_LEN=0 +# CONFIG_FEATURE_EDITING_VI is not set +CONFIG_FEATURE_EDITING_HISTORY=0 +# CONFIG_FEATURE_EDITING_SAVEHISTORY is not set +# CONFIG_FEATURE_EDITING_SAVE_ON_EXIT is not set +# CONFIG_FEATURE_REVERSE_SEARCH is not set +# CONFIG_FEATURE_TAB_COMPLETION is not set +# CONFIG_FEATURE_USERNAME_COMPLETION is not set +# CONFIG_FEATURE_EDITING_FANCY_PROMPT is not set +# CONFIG_FEATURE_EDITING_WINCH is not set +# CONFIG_FEATURE_EDITING_ASK_TERMINAL is not set +# CONFIG_LOCALE_SUPPORT is not set +# CONFIG_UNICODE_SUPPORT is not set +# CONFIG_UNICODE_USING_LOCALE is not set +# CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set +CONFIG_SUBST_WCHAR=0 +CONFIG_LAST_SUPPORTED_WCHAR=0 +# CONFIG_UNICODE_COMBINING_WCHARS is not set +# CONFIG_UNICODE_WIDE_WCHARS is not set +# CONFIG_UNICODE_BIDI_SUPPORT is not set +# CONFIG_UNICODE_NEUTRAL_TABLE is not set +# CONFIG_UNICODE_PRESERVE_BROKEN is not set +# CONFIG_LOOP_CONFIGURE is not set +# CONFIG_NO_LOOP_CONFIGURE is not set +CONFIG_TRY_LOOP_CONFIGURE=y + +# +# Applets +# + +# +# Archival Utilities +# +# CONFIG_FEATURE_SEAMLESS_XZ is not set +# CONFIG_FEATURE_SEAMLESS_LZMA is not set +# CONFIG_FEATURE_SEAMLESS_BZ2 is not set +# CONFIG_FEATURE_SEAMLESS_GZ is not set +# CONFIG_FEATURE_SEAMLESS_Z is not set +# CONFIG_AR is not set +# CONFIG_FEATURE_AR_LONG_FILENAMES is not set +# CONFIG_FEATURE_AR_CREATE is not set +# CONFIG_UNCOMPRESS is not set +# CONFIG_GUNZIP is not set +# CONFIG_ZCAT is not set +# CONFIG_FEATURE_GUNZIP_LONG_OPTIONS is not set +# CONFIG_BUNZIP2 is not set +# CONFIG_BZCAT is not set +# CONFIG_UNLZMA is not set +# CONFIG_LZCAT is not set +# CONFIG_LZMA is not set +# CONFIG_UNXZ is not set +# CONFIG_XZCAT is not set +# CONFIG_XZ is not set +# CONFIG_BZIP2 is not set +CONFIG_BZIP2_SMALL=0 +# CONFIG_FEATURE_BZIP2_DECOMPRESS is not set +# CONFIG_CPIO is not set +# CONFIG_FEATURE_CPIO_O is not set +# CONFIG_FEATURE_CPIO_P is not set +# CONFIG_FEATURE_CPIO_IGNORE_DEVNO is not set +# CONFIG_FEATURE_CPIO_RENUMBER_INODES is not set +# CONFIG_DPKG is not set +# CONFIG_DPKG_DEB is not set +# CONFIG_GZIP is not set +# CONFIG_FEATURE_GZIP_LONG_OPTIONS is not set +CONFIG_GZIP_FAST=0 +# CONFIG_FEATURE_GZIP_LEVELS is not set +# CONFIG_FEATURE_GZIP_DECOMPRESS is not set +# CONFIG_LZOP is not set +# CONFIG_UNLZOP is not set +# CONFIG_LZOPCAT is not set +# CONFIG_LZOP_COMPR_HIGH is not set +# CONFIG_RPM is not set +# CONFIG_RPM2CPIO is not set +# CONFIG_TAR is not set +# CONFIG_FEATURE_TAR_LONG_OPTIONS is not set +# CONFIG_FEATURE_TAR_CREATE is not set +# CONFIG_FEATURE_TAR_AUTODETECT is not set +# CONFIG_FEATURE_TAR_FROM is not set +# CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY is not set +# CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY is not set +# CONFIG_FEATURE_TAR_GNU_EXTENSIONS is not set +# CONFIG_FEATURE_TAR_TO_COMMAND is not set +# CONFIG_FEATURE_TAR_UNAME_GNAME is not set +# CONFIG_FEATURE_TAR_NOPRESERVE_TIME is not set +# CONFIG_FEATURE_TAR_SELINUX is not set +# CONFIG_UNZIP is not set +# CONFIG_FEATURE_UNZIP_CDF is not set +# CONFIG_FEATURE_UNZIP_BZIP2 is not set +# CONFIG_FEATURE_UNZIP_LZMA is not set +# CONFIG_FEATURE_UNZIP_XZ is not set +# CONFIG_FEATURE_LZMA_FAST is not set + +# +# Coreutils +# +# CONFIG_FEATURE_VERBOSE is not set + +# +# Common options for date and touch +# +# CONFIG_FEATURE_TIMEZONE is not set +# CONFIG_FEATURE_PRESERVE_HARDLINKS is not set +# CONFIG_FEATURE_HUMAN_READABLE is not set +# CONFIG_BASENAME is not set +# CONFIG_CAT is not set +# CONFIG_FEATURE_CATN is not set +# CONFIG_FEATURE_CATV is not set +# CONFIG_CHGRP is not set +# CONFIG_CHMOD is not set +# CONFIG_CHOWN is not set +# CONFIG_FEATURE_CHOWN_LONG_OPTIONS is not set +# CONFIG_CHROOT is not set +# CONFIG_CKSUM is not set +# CONFIG_CRC32 is not set +# CONFIG_COMM is not set +# CONFIG_CP is not set +# CONFIG_FEATURE_CP_LONG_OPTIONS is not set +# CONFIG_FEATURE_CP_REFLINK is not set +# CONFIG_CUT is not set +# CONFIG_FEATURE_CUT_REGEX is not set +# CONFIG_DATE is not set +# CONFIG_FEATURE_DATE_ISOFMT is not set +# CONFIG_FEATURE_DATE_NANO is not set +# CONFIG_FEATURE_DATE_COMPAT is not set +# CONFIG_DD is not set +# CONFIG_FEATURE_DD_SIGNAL_HANDLING is not set +# CONFIG_FEATURE_DD_THIRD_STATUS_LINE is not set +# CONFIG_FEATURE_DD_IBS_OBS is not set +# CONFIG_FEATURE_DD_STATUS is not set +# CONFIG_DF is not set +# CONFIG_FEATURE_DF_FANCY is not set +# CONFIG_FEATURE_SKIP_ROOTFS is not set +# CONFIG_DIRNAME is not set +# CONFIG_DOS2UNIX is not set +# CONFIG_UNIX2DOS is not set +# CONFIG_DU is not set +# CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K is not set +# CONFIG_ECHO is not set +# CONFIG_FEATURE_FANCY_ECHO is not set +# CONFIG_ENV is not set +# CONFIG_EXPAND is not set +# CONFIG_UNEXPAND is not set +# CONFIG_EXPR is not set +# CONFIG_EXPR_MATH_SUPPORT_64 is not set +# CONFIG_FACTOR is not set +# CONFIG_FALSE is not set +# CONFIG_FOLD is not set +# CONFIG_HEAD is not set +# CONFIG_FEATURE_FANCY_HEAD is not set +# CONFIG_HOSTID is not set +# CONFIG_ID is not set +# CONFIG_GROUPS is not set +# CONFIG_INSTALL is not set +# CONFIG_FEATURE_INSTALL_LONG_OPTIONS is not set +# CONFIG_LINK is not set +# CONFIG_LN is not set +# CONFIG_LOGNAME is not set +# CONFIG_LS is not set +# CONFIG_FEATURE_LS_FILETYPES is not set +# CONFIG_FEATURE_LS_FOLLOWLINKS is not set +# CONFIG_FEATURE_LS_RECURSIVE is not set +# CONFIG_FEATURE_LS_WIDTH is not set +# CONFIG_FEATURE_LS_SORTFILES is not set +# CONFIG_FEATURE_LS_TIMESTAMPS is not set +# CONFIG_FEATURE_LS_USERNAME is not set +# CONFIG_FEATURE_LS_COLOR is not set +# CONFIG_FEATURE_LS_COLOR_IS_DEFAULT is not set +# CONFIG_MD5SUM is not set +# CONFIG_SHA1SUM is not set +# CONFIG_SHA256SUM is not set +# CONFIG_SHA512SUM is not set +# CONFIG_SHA3SUM is not set +# CONFIG_FEATURE_MD5_SHA1_SUM_CHECK is not set +# CONFIG_MKDIR is not set +# CONFIG_MKFIFO is not set +# CONFIG_MKNOD is not set +# CONFIG_MKTEMP is not set +# CONFIG_MV is not set +# CONFIG_NICE is not set +# CONFIG_NL is not set +# CONFIG_NOHUP is not set +# CONFIG_NPROC is not set +# CONFIG_OD is not set +# CONFIG_PASTE is not set +# CONFIG_PRINTENV is not set +# CONFIG_PRINTF is not set +# CONFIG_PWD is not set +# CONFIG_READLINK is not set +# CONFIG_FEATURE_READLINK_FOLLOW is not set +# CONFIG_REALPATH is not set +# CONFIG_RM is not set +# CONFIG_RMDIR is not set +# CONFIG_SEQ is not set +# CONFIG_SHRED is not set +# CONFIG_SHUF is not set +# CONFIG_SLEEP is not set +# CONFIG_FEATURE_FANCY_SLEEP is not set +# CONFIG_SORT is not set +# CONFIG_FEATURE_SORT_BIG is not set +# CONFIG_FEATURE_SORT_OPTIMIZE_MEMORY is not set +# CONFIG_SPLIT is not set +# CONFIG_FEATURE_SPLIT_FANCY is not set +# CONFIG_STAT is not set +# CONFIG_FEATURE_STAT_FORMAT is not set +# CONFIG_FEATURE_STAT_FILESYSTEM is not set +# CONFIG_STTY is not set +# CONFIG_SUM is not set +# CONFIG_SYNC is not set +# CONFIG_FEATURE_SYNC_FANCY is not set +# CONFIG_FSYNC is not set +# CONFIG_TAC is not set +# CONFIG_TAIL is not set +# CONFIG_FEATURE_FANCY_TAIL is not set +# CONFIG_TEE is not set +# CONFIG_FEATURE_TEE_USE_BLOCK_IO is not set +# CONFIG_TEST is not set +# CONFIG_TEST1 is not set +# CONFIG_TEST2 is not set +# CONFIG_FEATURE_TEST_64 is not set +# CONFIG_TIMEOUT is not set +# CONFIG_TOUCH is not set +# CONFIG_FEATURE_TOUCH_SUSV3 is not set +# CONFIG_TR is not set +# CONFIG_FEATURE_TR_CLASSES is not set +# CONFIG_FEATURE_TR_EQUIV is not set +# CONFIG_TRUE is not set +# CONFIG_TRUNCATE is not set +# CONFIG_TSORT is not set +# CONFIG_TTY is not set +# CONFIG_UNAME is not set +CONFIG_UNAME_OSNAME="" +# CONFIG_BB_ARCH is not set +# CONFIG_UNIQ is not set +# CONFIG_UNLINK is not set +# CONFIG_USLEEP is not set +# CONFIG_UUDECODE is not set +# CONFIG_BASE32 is not set +# CONFIG_BASE64 is not set +# CONFIG_UUENCODE is not set +# CONFIG_WC is not set +# CONFIG_FEATURE_WC_LARGE is not set +# CONFIG_WHO is not set +# CONFIG_W is not set +# CONFIG_USERS is not set +# CONFIG_WHOAMI is not set +# CONFIG_YES is not set + +# +# Console Utilities +# +# CONFIG_CHVT is not set +# CONFIG_CLEAR is not set +# CONFIG_DEALLOCVT is not set +# CONFIG_DUMPKMAP is not set +# CONFIG_FGCONSOLE is not set +# CONFIG_KBD_MODE is not set +# CONFIG_LOADFONT is not set +# CONFIG_SETFONT is not set +# CONFIG_FEATURE_SETFONT_TEXTUAL_MAP is not set +CONFIG_DEFAULT_SETFONT_DIR="" +# CONFIG_FEATURE_LOADFONT_PSF2 is not set +# CONFIG_FEATURE_LOADFONT_RAW is not set +# CONFIG_LOADKMAP is not set +# CONFIG_OPENVT is not set +# CONFIG_RESET is not set +# CONFIG_RESIZE is not set +# CONFIG_FEATURE_RESIZE_PRINT is not set +# CONFIG_SETCONSOLE is not set +# CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS is not set +# CONFIG_SETKEYCODES is not set +# CONFIG_SETLOGCONS is not set +# CONFIG_SHOWKEY is not set + +# +# Debian Utilities +# +# CONFIG_PIPE_PROGRESS is not set +# CONFIG_RUN_PARTS is not set +# CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS is not set +# CONFIG_FEATURE_RUN_PARTS_FANCY is not set +# CONFIG_START_STOP_DAEMON is not set +# CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS is not set +# CONFIG_FEATURE_START_STOP_DAEMON_FANCY is not set +# CONFIG_WHICH is not set + +# +# klibc-utils +# +# CONFIG_MINIPS is not set +# CONFIG_NUKE is not set +# CONFIG_RESUME is not set +# CONFIG_RUN_INIT is not set + +# +# Editors +# +# CONFIG_AWK is not set +# CONFIG_FEATURE_AWK_LIBM is not set +# CONFIG_FEATURE_AWK_GNU_EXTENSIONS is not set +# CONFIG_CMP is not set +# CONFIG_DIFF is not set +# CONFIG_FEATURE_DIFF_LONG_OPTIONS is not set +# CONFIG_FEATURE_DIFF_DIR is not set +# CONFIG_ED is not set +# CONFIG_PATCH is not set +# CONFIG_SED is not set +# CONFIG_VI is not set +CONFIG_FEATURE_VI_MAX_LEN=0 +# CONFIG_FEATURE_VI_8BIT is not set +# CONFIG_FEATURE_VI_COLON is not set +# CONFIG_FEATURE_VI_COLON_EXPAND is not set +# CONFIG_FEATURE_VI_YANKMARK is not set +# CONFIG_FEATURE_VI_SEARCH is not set +# CONFIG_FEATURE_VI_REGEX_SEARCH is not set +# CONFIG_FEATURE_VI_USE_SIGNALS is not set +# CONFIG_FEATURE_VI_DOT_CMD is not set +# CONFIG_FEATURE_VI_READONLY is not set +# CONFIG_FEATURE_VI_SETOPTS is not set +# CONFIG_FEATURE_VI_SET is not set +# CONFIG_FEATURE_VI_WIN_RESIZE is not set +# CONFIG_FEATURE_VI_ASK_TERMINAL is not set +# CONFIG_FEATURE_VI_UNDO is not set +# CONFIG_FEATURE_VI_UNDO_QUEUE is not set +CONFIG_FEATURE_VI_UNDO_QUEUE_MAX=0 +# CONFIG_FEATURE_VI_VERBOSE_STATUS is not set +# CONFIG_FEATURE_ALLOW_EXEC is not set + +# +# Finding Utilities +# +# CONFIG_FIND is not set +# CONFIG_FEATURE_FIND_PRINT0 is not set +# CONFIG_FEATURE_FIND_MTIME is not set +# CONFIG_FEATURE_FIND_ATIME is not set +# CONFIG_FEATURE_FIND_CTIME is not set +# CONFIG_FEATURE_FIND_MMIN is not set +# CONFIG_FEATURE_FIND_AMIN is not set +# CONFIG_FEATURE_FIND_CMIN is not set +# CONFIG_FEATURE_FIND_PERM is not set +# CONFIG_FEATURE_FIND_TYPE is not set +# CONFIG_FEATURE_FIND_EXECUTABLE is not set +# CONFIG_FEATURE_FIND_XDEV is not set +# CONFIG_FEATURE_FIND_MAXDEPTH is not set +# CONFIG_FEATURE_FIND_NEWER is not set +# CONFIG_FEATURE_FIND_INUM is not set +# CONFIG_FEATURE_FIND_SAMEFILE is not set +# CONFIG_FEATURE_FIND_EXEC is not set +# CONFIG_FEATURE_FIND_EXEC_PLUS is not set +# CONFIG_FEATURE_FIND_USER is not set +# CONFIG_FEATURE_FIND_GROUP is not set +# CONFIG_FEATURE_FIND_NOT is not set +# CONFIG_FEATURE_FIND_DEPTH is not set +# CONFIG_FEATURE_FIND_PAREN is not set +# CONFIG_FEATURE_FIND_SIZE is not set +# CONFIG_FEATURE_FIND_PRUNE is not set +# CONFIG_FEATURE_FIND_QUIT is not set +# CONFIG_FEATURE_FIND_DELETE is not set +# CONFIG_FEATURE_FIND_EMPTY is not set +# CONFIG_FEATURE_FIND_PATH is not set +# CONFIG_FEATURE_FIND_REGEX is not set +# CONFIG_FEATURE_FIND_CONTEXT is not set +# CONFIG_FEATURE_FIND_LINKS is not set +# CONFIG_GREP is not set +# CONFIG_EGREP is not set +# CONFIG_FGREP is not set +# CONFIG_FEATURE_GREP_CONTEXT is not set +# CONFIG_XARGS is not set +# CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION is not set +# CONFIG_FEATURE_XARGS_SUPPORT_QUOTES is not set +# CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT is not set +# CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM is not set +# CONFIG_FEATURE_XARGS_SUPPORT_REPL_STR is not set +# CONFIG_FEATURE_XARGS_SUPPORT_PARALLEL is not set +# CONFIG_FEATURE_XARGS_SUPPORT_ARGS_FILE is not set + +# +# Init Utilities +# +# CONFIG_BOOTCHARTD is not set +# CONFIG_FEATURE_BOOTCHARTD_BLOATED_HEADER is not set +# CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE is not set +# CONFIG_HALT is not set +# CONFIG_POWEROFF is not set +# CONFIG_REBOOT is not set +# CONFIG_FEATURE_WAIT_FOR_INIT is not set +# CONFIG_FEATURE_CALL_TELINIT is not set +CONFIG_TELINIT_PATH="" +# CONFIG_INIT is not set +# CONFIG_LINUXRC is not set +# CONFIG_FEATURE_USE_INITTAB is not set +# CONFIG_FEATURE_KILL_REMOVED is not set +CONFIG_FEATURE_KILL_DELAY=0 +# CONFIG_FEATURE_INIT_SCTTY is not set +# CONFIG_FEATURE_INIT_SYSLOG is not set +# CONFIG_FEATURE_INIT_QUIET is not set +# CONFIG_FEATURE_INIT_COREDUMPS is not set +CONFIG_INIT_TERMINAL_TYPE="" +# CONFIG_FEATURE_INIT_MODIFY_CMDLINE is not set + +# +# Login/Password Management Utilities +# +# CONFIG_FEATURE_SHADOWPASSWDS is not set +# CONFIG_USE_BB_PWD_GRP is not set +# CONFIG_USE_BB_SHADOW is not set +# CONFIG_USE_BB_CRYPT is not set +# CONFIG_USE_BB_CRYPT_SHA is not set +# CONFIG_ADD_SHELL is not set +# CONFIG_REMOVE_SHELL is not set +# CONFIG_ADDGROUP is not set +# CONFIG_FEATURE_ADDUSER_TO_GROUP is not set +# CONFIG_ADDUSER is not set +# CONFIG_FEATURE_CHECK_NAMES is not set +CONFIG_LAST_ID=0 +CONFIG_FIRST_SYSTEM_ID=0 +CONFIG_LAST_SYSTEM_ID=0 +# CONFIG_CHPASSWD is not set +CONFIG_FEATURE_DEFAULT_PASSWD_ALGO="" +# CONFIG_CRYPTPW is not set +# CONFIG_MKPASSWD is not set +# CONFIG_DELUSER is not set +# CONFIG_DELGROUP is not set +# CONFIG_FEATURE_DEL_USER_FROM_GROUP is not set +# CONFIG_GETTY is not set +# CONFIG_LOGIN is not set +# CONFIG_LOGIN_SESSION_AS_CHILD is not set +# CONFIG_LOGIN_SCRIPTS is not set +# CONFIG_FEATURE_NOLOGIN is not set +# CONFIG_FEATURE_SECURETTY is not set +# CONFIG_PASSWD is not set +# CONFIG_FEATURE_PASSWD_WEAK_CHECK is not set +# CONFIG_SU is not set +# CONFIG_FEATURE_SU_SYSLOG is not set +# CONFIG_FEATURE_SU_CHECKS_SHELLS is not set +# CONFIG_FEATURE_SU_BLANK_PW_NEEDS_SECURE_TTY is not set +# CONFIG_SULOGIN is not set +# CONFIG_VLOCK is not set + +# +# Linux Ext2 FS Progs +# +# CONFIG_CHATTR is not set +# CONFIG_FSCK is not set +# CONFIG_LSATTR is not set +# CONFIG_TUNE2FS is not set + +# +# Linux Module Utilities +# +# CONFIG_MODPROBE_SMALL is not set +# CONFIG_DEPMOD is not set +# CONFIG_INSMOD is not set +# CONFIG_LSMOD is not set +# CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set +# CONFIG_MODINFO is not set +# CONFIG_MODPROBE is not set +# CONFIG_FEATURE_MODPROBE_BLACKLIST is not set +# CONFIG_RMMOD is not set + +# +# Options common to multiple modutils +# +# CONFIG_FEATURE_CMDLINE_MODULE_OPTIONS is not set +# CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED is not set +# CONFIG_FEATURE_2_4_MODULES is not set +# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set +# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set +# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set +# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set +# CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set +# CONFIG_FEATURE_CHECK_TAINTED_MODULE is not set +# CONFIG_FEATURE_INSMOD_TRY_MMAP is not set +# CONFIG_FEATURE_MODUTILS_ALIAS is not set +# CONFIG_FEATURE_MODUTILS_SYMBOLS is not set +CONFIG_DEFAULT_MODULES_DIR="" +CONFIG_DEFAULT_DEPMOD_FILE="" + +# +# Linux System Utilities +# +# CONFIG_ACPID is not set +# CONFIG_FEATURE_ACPID_COMPAT is not set +# CONFIG_BLKDISCARD is not set +# CONFIG_BLKID is not set +# CONFIG_FEATURE_BLKID_TYPE is not set +# CONFIG_BLOCKDEV is not set +# CONFIG_CAL is not set +# CONFIG_CHRT is not set +# CONFIG_DMESG is not set +# CONFIG_FEATURE_DMESG_PRETTY is not set +# CONFIG_EJECT is not set +# CONFIG_FEATURE_EJECT_SCSI is not set +# CONFIG_FALLOCATE is not set +# CONFIG_FATATTR is not set +# CONFIG_FBSET is not set +# CONFIG_FEATURE_FBSET_FANCY is not set +# CONFIG_FEATURE_FBSET_READMODE is not set +# CONFIG_FDFORMAT is not set +# CONFIG_FDISK is not set +# CONFIG_FDISK_SUPPORT_LARGE_DISKS is not set +# CONFIG_FEATURE_FDISK_WRITABLE is not set +# CONFIG_FEATURE_AIX_LABEL is not set +# CONFIG_FEATURE_SGI_LABEL is not set +# CONFIG_FEATURE_SUN_LABEL is not set +# CONFIG_FEATURE_OSF_LABEL is not set +# CONFIG_FEATURE_GPT_LABEL is not set +# CONFIG_FEATURE_FDISK_ADVANCED is not set +# CONFIG_FINDFS is not set +# CONFIG_FLOCK is not set +# CONFIG_FDFLUSH is not set +# CONFIG_FREERAMDISK is not set +# CONFIG_FSCK_MINIX is not set +# CONFIG_FSFREEZE is not set +# CONFIG_FSTRIM is not set +# CONFIG_GETOPT is not set +# CONFIG_FEATURE_GETOPT_LONG is not set +# CONFIG_HEXDUMP is not set +# CONFIG_HD is not set +# CONFIG_XXD is not set +# CONFIG_HWCLOCK is not set +# CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS is not set +# CONFIG_IONICE is not set +# CONFIG_IPCRM is not set +# CONFIG_IPCS is not set +# CONFIG_LAST is not set +# CONFIG_FEATURE_LAST_FANCY is not set +# CONFIG_LOSETUP is not set +# CONFIG_LSPCI is not set +# CONFIG_LSUSB is not set +# CONFIG_MDEV is not set +# CONFIG_FEATURE_MDEV_CONF is not set +# CONFIG_FEATURE_MDEV_RENAME is not set +# CONFIG_FEATURE_MDEV_RENAME_REGEXP is not set +# CONFIG_FEATURE_MDEV_EXEC is not set +# CONFIG_FEATURE_MDEV_LOAD_FIRMWARE is not set +# CONFIG_FEATURE_MDEV_DAEMON is not set +# CONFIG_MESG is not set +# CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP is not set +# CONFIG_MKE2FS is not set +CONFIG_MKFS_EXT2=y +# CONFIG_MKFS_MINIX is not set +# CONFIG_FEATURE_MINIX2 is not set +# CONFIG_MKFS_REISER is not set +# CONFIG_MKDOSFS is not set +# CONFIG_MKFS_VFAT is not set +# CONFIG_MKSWAP is not set +# CONFIG_FEATURE_MKSWAP_UUID is not set +# CONFIG_MORE is not set +# CONFIG_MOUNT is not set +# CONFIG_FEATURE_MOUNT_FAKE is not set +# CONFIG_FEATURE_MOUNT_VERBOSE is not set +# CONFIG_FEATURE_MOUNT_HELPERS is not set +# CONFIG_FEATURE_MOUNT_LABEL is not set +# CONFIG_FEATURE_MOUNT_NFS is not set +# CONFIG_FEATURE_MOUNT_CIFS is not set +# CONFIG_FEATURE_MOUNT_FLAGS is not set +# CONFIG_FEATURE_MOUNT_FSTAB is not set +# CONFIG_FEATURE_MOUNT_OTHERTAB is not set +# CONFIG_MOUNTPOINT is not set +# CONFIG_NOLOGIN is not set +# CONFIG_NOLOGIN_DEPENDENCIES is not set +# CONFIG_NSENTER is not set +# CONFIG_PIVOT_ROOT is not set +# CONFIG_RDATE is not set +# CONFIG_RDEV is not set +# CONFIG_READPROFILE is not set +# CONFIG_RENICE is not set +# CONFIG_REV is not set +# CONFIG_RTCWAKE is not set +# CONFIG_SCRIPT is not set +# CONFIG_SCRIPTREPLAY is not set +# CONFIG_SETARCH is not set +# CONFIG_LINUX32 is not set +# CONFIG_LINUX64 is not set +# CONFIG_SETPRIV is not set +# CONFIG_FEATURE_SETPRIV_DUMP is not set +# CONFIG_FEATURE_SETPRIV_CAPABILITIES is not set +# CONFIG_FEATURE_SETPRIV_CAPABILITY_NAMES is not set +# CONFIG_SETSID is not set +# CONFIG_SWAPON is not set +# CONFIG_FEATURE_SWAPON_DISCARD is not set +# CONFIG_FEATURE_SWAPON_PRI is not set +# CONFIG_SWAPOFF is not set +# CONFIG_FEATURE_SWAPONOFF_LABEL is not set +# CONFIG_SWITCH_ROOT is not set +# CONFIG_TASKSET is not set +# CONFIG_FEATURE_TASKSET_FANCY is not set +# CONFIG_FEATURE_TASKSET_CPULIST is not set +# CONFIG_UEVENT is not set +# CONFIG_UMOUNT is not set +# CONFIG_FEATURE_UMOUNT_ALL is not set +# CONFIG_UNSHARE is not set +# CONFIG_WALL is not set +# CONFIG_FEATURE_MOUNT_LOOP is not set +# CONFIG_FEATURE_MOUNT_LOOP_CREATE is not set +# CONFIG_FEATURE_MTAB_SUPPORT is not set +# CONFIG_VOLUMEID is not set +# CONFIG_FEATURE_VOLUMEID_BCACHE is not set +# CONFIG_FEATURE_VOLUMEID_BTRFS is not set +# CONFIG_FEATURE_VOLUMEID_CRAMFS is not set +# CONFIG_FEATURE_VOLUMEID_EROFS is not set +# CONFIG_FEATURE_VOLUMEID_EXFAT is not set +# CONFIG_FEATURE_VOLUMEID_EXT is not set +# CONFIG_FEATURE_VOLUMEID_F2FS is not set +# CONFIG_FEATURE_VOLUMEID_FAT is not set +# CONFIG_FEATURE_VOLUMEID_HFS is not set +# CONFIG_FEATURE_VOLUMEID_ISO9660 is not set +# CONFIG_FEATURE_VOLUMEID_JFS is not set +# CONFIG_FEATURE_VOLUMEID_LFS is not set +# CONFIG_FEATURE_VOLUMEID_LINUXRAID is not set +# CONFIG_FEATURE_VOLUMEID_LINUXSWAP is not set +# CONFIG_FEATURE_VOLUMEID_LUKS is not set +# CONFIG_FEATURE_VOLUMEID_MINIX is not set +# CONFIG_FEATURE_VOLUMEID_NILFS is not set +# CONFIG_FEATURE_VOLUMEID_NTFS is not set +# CONFIG_FEATURE_VOLUMEID_OCFS2 is not set +# CONFIG_FEATURE_VOLUMEID_REISERFS is not set +# CONFIG_FEATURE_VOLUMEID_ROMFS is not set +# CONFIG_FEATURE_VOLUMEID_SQUASHFS is not set +# CONFIG_FEATURE_VOLUMEID_SYSV is not set +# CONFIG_FEATURE_VOLUMEID_UBIFS is not set +# CONFIG_FEATURE_VOLUMEID_UDF is not set +# CONFIG_FEATURE_VOLUMEID_XFS is not set + +# +# Miscellaneous Utilities +# +# CONFIG_ADJTIMEX is not set +# CONFIG_ASCII is not set +# CONFIG_BBCONFIG is not set +# CONFIG_FEATURE_COMPRESS_BBCONFIG is not set +# CONFIG_BC is not set +# CONFIG_DC is not set +# CONFIG_FEATURE_DC_BIG is not set +# CONFIG_FEATURE_DC_LIBM is not set +# CONFIG_FEATURE_BC_INTERACTIVE is not set +# CONFIG_FEATURE_BC_LONG_OPTIONS is not set +# CONFIG_BEEP is not set +CONFIG_FEATURE_BEEP_FREQ=0 +CONFIG_FEATURE_BEEP_LENGTH_MS=0 +# CONFIG_CHAT is not set +# CONFIG_FEATURE_CHAT_NOFAIL is not set +# CONFIG_FEATURE_CHAT_TTY_HIFI is not set +# CONFIG_FEATURE_CHAT_IMPLICIT_CR is not set +# CONFIG_FEATURE_CHAT_SWALLOW_OPTS is not set +# CONFIG_FEATURE_CHAT_SEND_ESCAPES is not set +# CONFIG_FEATURE_CHAT_VAR_ABORT_LEN is not set +# CONFIG_FEATURE_CHAT_CLR_ABORT is not set +# CONFIG_CONSPY is not set +# CONFIG_CROND is not set +# CONFIG_FEATURE_CROND_D is not set +# CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set +# CONFIG_FEATURE_CROND_SPECIAL_TIMES is not set +CONFIG_FEATURE_CROND_DIR="" +# CONFIG_CRONTAB is not set +# CONFIG_DEVFSD is not set +# CONFIG_DEVFSD_MODLOAD is not set +# CONFIG_DEVFSD_FG_NP is not set +# CONFIG_DEVFSD_VERBOSE is not set +# CONFIG_FEATURE_DEVFS is not set +# CONFIG_DEVMEM is not set +# CONFIG_FBSPLASH is not set +# CONFIG_FLASH_ERASEALL is not set +# CONFIG_FLASH_LOCK is not set +# CONFIG_FLASH_UNLOCK is not set +# CONFIG_FLASHCP is not set +# CONFIG_HDPARM is not set +# CONFIG_FEATURE_HDPARM_GET_IDENTITY is not set +# CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF is not set +# CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF is not set +# CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET is not set +# CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF is not set +# CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA is not set +# CONFIG_HEXEDIT is not set +# CONFIG_I2CGET is not set +# CONFIG_I2CSET is not set +# CONFIG_I2CDUMP is not set +# CONFIG_I2CDETECT is not set +# CONFIG_I2CTRANSFER is not set +# CONFIG_INOTIFYD is not set +# CONFIG_LESS is not set +CONFIG_FEATURE_LESS_MAXLINES=0 +# CONFIG_FEATURE_LESS_BRACKETS is not set +# CONFIG_FEATURE_LESS_FLAGS is not set +# CONFIG_FEATURE_LESS_TRUNCATE is not set +# CONFIG_FEATURE_LESS_MARKS is not set +# CONFIG_FEATURE_LESS_REGEXP is not set +# CONFIG_FEATURE_LESS_WINCH is not set +# CONFIG_FEATURE_LESS_ASK_TERMINAL is not set +# CONFIG_FEATURE_LESS_DASHCMD is not set +# CONFIG_FEATURE_LESS_LINENUMS is not set +# CONFIG_FEATURE_LESS_RAW is not set +# CONFIG_FEATURE_LESS_ENV is not set +# CONFIG_LSSCSI is not set +# CONFIG_MAKEDEVS is not set +# CONFIG_FEATURE_MAKEDEVS_LEAF is not set +# CONFIG_FEATURE_MAKEDEVS_TABLE is not set +# CONFIG_MAN is not set +# CONFIG_MICROCOM is not set +# CONFIG_MIM is not set +# CONFIG_MT is not set +# CONFIG_NANDWRITE is not set +# CONFIG_NANDDUMP is not set +# CONFIG_PARTPROBE is not set +# CONFIG_RAIDAUTORUN is not set +# CONFIG_READAHEAD is not set +# CONFIG_RFKILL is not set +# CONFIG_RUNLEVEL is not set +# CONFIG_RX is not set +# CONFIG_SEEDRNG is not set +# CONFIG_SETFATTR is not set +# CONFIG_SETSERIAL is not set +# CONFIG_STRINGS is not set +# CONFIG_TIME is not set +# CONFIG_TREE is not set +# CONFIG_TS is not set +# CONFIG_TTYSIZE is not set +# CONFIG_UBIATTACH is not set +# CONFIG_UBIDETACH is not set +# CONFIG_UBIMKVOL is not set +# CONFIG_UBIRMVOL is not set +# CONFIG_UBIRSVOL is not set +# CONFIG_UBIUPDATEVOL is not set +# CONFIG_UBIRENAME is not set +# CONFIG_VOLNAME is not set +# CONFIG_WATCHDOG is not set +# CONFIG_FEATURE_WATCHDOG_OPEN_TWICE is not set + +# +# Networking Utilities +# +# CONFIG_FEATURE_IPV6 is not set +# CONFIG_FEATURE_UNIX_LOCAL is not set +# CONFIG_FEATURE_PREFER_IPV4_ADDRESS is not set +# CONFIG_VERBOSE_RESOLUTION_ERRORS is not set +# CONFIG_FEATURE_ETC_NETWORKS is not set +# CONFIG_FEATURE_ETC_SERVICES is not set +# CONFIG_FEATURE_HWIB is not set +# CONFIG_FEATURE_TLS_SHA1 is not set +# CONFIG_ARP is not set +# CONFIG_ARPING is not set +# CONFIG_BRCTL is not set +# CONFIG_FEATURE_BRCTL_FANCY is not set +# CONFIG_FEATURE_BRCTL_SHOW is not set +# CONFIG_DNSD is not set +# CONFIG_ETHER_WAKE is not set +# CONFIG_FTPD is not set +# CONFIG_FEATURE_FTPD_WRITE is not set +# CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST is not set +# CONFIG_FEATURE_FTPD_AUTHENTICATION is not set +# CONFIG_FTPGET is not set +# CONFIG_FTPPUT is not set +# CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS is not set +# CONFIG_HOSTNAME is not set +# CONFIG_DNSDOMAINNAME is not set +# CONFIG_HTTPD is not set +CONFIG_FEATURE_HTTPD_PORT_DEFAULT=0 +# CONFIG_FEATURE_HTTPD_RANGES is not set +# CONFIG_FEATURE_HTTPD_SETUID is not set +# CONFIG_FEATURE_HTTPD_BASIC_AUTH is not set +# CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set +# CONFIG_FEATURE_HTTPD_CGI is not set +# CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR is not set +# CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV is not set +# CONFIG_FEATURE_HTTPD_ENCODE_URL_STR is not set +# CONFIG_FEATURE_HTTPD_ERROR_PAGES is not set +# CONFIG_FEATURE_HTTPD_PROXY is not set +# CONFIG_FEATURE_HTTPD_GZIP is not set +# CONFIG_FEATURE_HTTPD_ETAG is not set +# CONFIG_FEATURE_HTTPD_LAST_MODIFIED is not set +# CONFIG_FEATURE_HTTPD_DATE is not set +# CONFIG_FEATURE_HTTPD_ACL_IP is not set +# CONFIG_IFCONFIG is not set +# CONFIG_FEATURE_IFCONFIG_STATUS is not set +# CONFIG_FEATURE_IFCONFIG_SLIP is not set +# CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ is not set +# CONFIG_FEATURE_IFCONFIG_HW is not set +# CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS is not set +# CONFIG_IFENSLAVE is not set +# CONFIG_IFPLUGD is not set +# CONFIG_IFUP is not set +# CONFIG_IFDOWN is not set +CONFIG_IFUPDOWN_IFSTATE_PATH="" +# CONFIG_FEATURE_IFUPDOWN_IP is not set +# CONFIG_FEATURE_IFUPDOWN_IPV4 is not set +# CONFIG_FEATURE_IFUPDOWN_IPV6 is not set +# CONFIG_FEATURE_IFUPDOWN_MAPPING is not set +# CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP is not set +# CONFIG_INETD is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME is not set +# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN is not set +# CONFIG_FEATURE_INETD_RPC is not set +# CONFIG_IP is not set +# CONFIG_IPADDR is not set +# CONFIG_IPLINK is not set +# CONFIG_IPROUTE is not set +# CONFIG_IPTUNNEL is not set +# CONFIG_IPRULE is not set +# CONFIG_IPNEIGH is not set +# CONFIG_FEATURE_IP_ADDRESS is not set +# CONFIG_FEATURE_IP_LINK is not set +# CONFIG_FEATURE_IP_ROUTE is not set +CONFIG_FEATURE_IP_ROUTE_DIR="" +# CONFIG_FEATURE_IP_TUNNEL is not set +# CONFIG_FEATURE_IP_RULE is not set +# CONFIG_FEATURE_IP_NEIGH is not set +# CONFIG_FEATURE_IP_RARE_PROTOCOLS is not set +# CONFIG_IPCALC is not set +# CONFIG_FEATURE_IPCALC_LONG_OPTIONS is not set +# CONFIG_FEATURE_IPCALC_FANCY is not set +# CONFIG_FAKEIDENTD is not set +# CONFIG_NAMEIF is not set +# CONFIG_FEATURE_NAMEIF_EXTENDED is not set +# CONFIG_NBDCLIENT is not set +# CONFIG_NC is not set +# CONFIG_NETCAT is not set +# CONFIG_NC_SERVER is not set +# CONFIG_NC_EXTRA is not set +# CONFIG_NC_110_COMPAT is not set +# CONFIG_NETSTAT is not set +# CONFIG_FEATURE_NETSTAT_WIDE is not set +# CONFIG_FEATURE_NETSTAT_PRG is not set +# CONFIG_NSLOOKUP is not set +# CONFIG_FEATURE_NSLOOKUP_BIG is not set +# CONFIG_FEATURE_NSLOOKUP_LONG_OPTIONS is not set +# CONFIG_NTPD is not set +# CONFIG_FEATURE_NTPD_SERVER is not set +# CONFIG_FEATURE_NTPD_CONF is not set +# CONFIG_FEATURE_NTP_AUTH is not set +# CONFIG_PING is not set +# CONFIG_PING6 is not set +# CONFIG_FEATURE_FANCY_PING is not set +# CONFIG_PSCAN is not set +# CONFIG_ROUTE is not set +# CONFIG_SLATTACH is not set +# CONFIG_SSL_CLIENT is not set +# CONFIG_TC is not set +# CONFIG_FEATURE_TC_INGRESS is not set +# CONFIG_TCPSVD is not set +# CONFIG_UDPSVD is not set +# CONFIG_TELNET is not set +# CONFIG_FEATURE_TELNET_TTYPE is not set +# CONFIG_FEATURE_TELNET_AUTOLOGIN is not set +# CONFIG_FEATURE_TELNET_WIDTH is not set +# CONFIG_TELNETD is not set +# CONFIG_FEATURE_TELNETD_STANDALONE is not set +CONFIG_FEATURE_TELNETD_PORT_DEFAULT=0 +# CONFIG_FEATURE_TELNETD_INETD_WAIT is not set +# CONFIG_TFTP is not set +# CONFIG_FEATURE_TFTP_PROGRESS_BAR is not set +# CONFIG_FEATURE_TFTP_HPA_COMPAT is not set +# CONFIG_TFTPD is not set +# CONFIG_FEATURE_TFTP_GET is not set +# CONFIG_FEATURE_TFTP_PUT is not set +# CONFIG_FEATURE_TFTP_BLOCKSIZE is not set +# CONFIG_TFTP_DEBUG is not set +# CONFIG_TLS is not set +# CONFIG_TRACEROUTE is not set +# CONFIG_TRACEROUTE6 is not set +# CONFIG_FEATURE_TRACEROUTE_VERBOSE is not set +# CONFIG_FEATURE_TRACEROUTE_USE_ICMP is not set +# CONFIG_TUNCTL is not set +# CONFIG_FEATURE_TUNCTL_UG is not set +# CONFIG_VCONFIG is not set +# CONFIG_WGET is not set +# CONFIG_FEATURE_WGET_LONG_OPTIONS is not set +# CONFIG_FEATURE_WGET_STATUSBAR is not set +# CONFIG_FEATURE_WGET_FTP is not set +# CONFIG_FEATURE_WGET_AUTHENTICATION is not set +# CONFIG_FEATURE_WGET_TIMEOUT is not set +# CONFIG_FEATURE_WGET_HTTPS is not set +# CONFIG_FEATURE_WGET_OPENSSL is not set +# CONFIG_WHOIS is not set +# CONFIG_ZCIP is not set +# CONFIG_UDHCPD is not set +# CONFIG_FEATURE_UDHCPD_BASE_IP_ON_MAC is not set +# CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY is not set +CONFIG_DHCPD_LEASES_FILE="" +# CONFIG_DUMPLEASES is not set +# CONFIG_DHCPRELAY is not set +# CONFIG_UDHCPC is not set +# CONFIG_FEATURE_UDHCPC_ARPING is not set +# CONFIG_FEATURE_UDHCPC_SANITIZEOPT is not set +CONFIG_UDHCPC_DEFAULT_SCRIPT="" +CONFIG_UDHCPC6_DEFAULT_SCRIPT="" +# CONFIG_UDHCPC6 is not set +# CONFIG_FEATURE_UDHCPC6_RFC3646 is not set +# CONFIG_FEATURE_UDHCPC6_RFC4704 is not set +# CONFIG_FEATURE_UDHCPC6_RFC4833 is not set +# CONFIG_FEATURE_UDHCPC6_RFC5970 is not set +CONFIG_UDHCPC_DEFAULT_INTERFACE="" +# CONFIG_FEATURE_UDHCP_PORT is not set +CONFIG_UDHCP_DEBUG=0 +CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=0 +# CONFIG_FEATURE_UDHCP_RFC3397 is not set +# CONFIG_FEATURE_UDHCP_8021Q is not set +CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="" + +# +# Print Utilities +# +# CONFIG_LPD is not set +# CONFIG_LPR is not set +# CONFIG_LPQ is not set + +# +# Mail Utilities +# +CONFIG_FEATURE_MIME_CHARSET="" +# CONFIG_MAKEMIME is not set +# CONFIG_POPMAILDIR is not set +# CONFIG_FEATURE_POPMAILDIR_DELIVERY is not set +# CONFIG_REFORMIME is not set +# CONFIG_FEATURE_REFORMIME_COMPAT is not set +# CONFIG_SENDMAIL is not set + +# +# Process Utilities +# +# CONFIG_FEATURE_FAST_TOP is not set +# CONFIG_FEATURE_SHOW_THREADS is not set +# CONFIG_FREE is not set +# CONFIG_FUSER is not set +# CONFIG_IOSTAT is not set +# CONFIG_KILL is not set +# CONFIG_KILLALL is not set +# CONFIG_KILLALL5 is not set +# CONFIG_LSOF is not set +# CONFIG_MPSTAT is not set +# CONFIG_NMETER is not set +# CONFIG_PGREP is not set +# CONFIG_PKILL is not set +# CONFIG_PIDOF is not set +# CONFIG_FEATURE_PIDOF_SINGLE is not set +# CONFIG_FEATURE_PIDOF_OMIT is not set +# CONFIG_PMAP is not set +# CONFIG_POWERTOP is not set +# CONFIG_FEATURE_POWERTOP_INTERACTIVE is not set +# CONFIG_PS is not set +# CONFIG_FEATURE_PS_WIDE is not set +# CONFIG_FEATURE_PS_LONG is not set +# CONFIG_FEATURE_PS_TIME is not set +# CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS is not set +# CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS is not set +# CONFIG_PSTREE is not set +# CONFIG_PWDX is not set +# CONFIG_SMEMCAP is not set +# CONFIG_BB_SYSCTL is not set +# CONFIG_TOP is not set +# CONFIG_FEATURE_TOP_INTERACTIVE is not set +# CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE is not set +# CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS is not set +# CONFIG_FEATURE_TOP_SMP_CPU is not set +# CONFIG_FEATURE_TOP_DECIMALS is not set +# CONFIG_FEATURE_TOP_SMP_PROCESS is not set +# CONFIG_FEATURE_TOPMEM is not set +# CONFIG_UPTIME is not set +# CONFIG_FEATURE_UPTIME_UTMP_SUPPORT is not set +# CONFIG_WATCH is not set + +# +# Runit Utilities +# +# CONFIG_CHPST is not set +# CONFIG_SETUIDGID is not set +# CONFIG_ENVUIDGID is not set +# CONFIG_ENVDIR is not set +# CONFIG_SOFTLIMIT is not set +# CONFIG_RUNSV is not set +# CONFIG_RUNSVDIR is not set +# CONFIG_FEATURE_RUNSVDIR_LOG is not set +# CONFIG_SV is not set +CONFIG_SV_DEFAULT_SERVICE_DIR="" +# CONFIG_SVC is not set +# CONFIG_SVOK is not set +# CONFIG_SVLOGD is not set +# CONFIG_CHCON is not set +# CONFIG_GETENFORCE is not set +# CONFIG_GETSEBOOL is not set +# CONFIG_LOAD_POLICY is not set +# CONFIG_MATCHPATHCON is not set +# CONFIG_RUNCON is not set +# CONFIG_SELINUXENABLED is not set +# CONFIG_SESTATUS is not set +# CONFIG_SETENFORCE is not set +# CONFIG_SETFILES is not set +# CONFIG_FEATURE_SETFILES_CHECK_OPTION is not set +# CONFIG_RESTORECON is not set +# CONFIG_SETSEBOOL is not set + +# +# Shells +# +# CONFIG_SH_IS_ASH is not set +# CONFIG_SH_IS_HUSH is not set +CONFIG_SH_IS_NONE=y +# CONFIG_BASH_IS_ASH is not set +# CONFIG_BASH_IS_HUSH is not set +CONFIG_BASH_IS_NONE=y +# CONFIG_SHELL_ASH is not set +# CONFIG_ASH is not set +# CONFIG_ASH_OPTIMIZE_FOR_SIZE is not set +# CONFIG_ASH_INTERNAL_GLOB is not set +# CONFIG_ASH_BASH_COMPAT is not set +# CONFIG_ASH_BASH_SOURCE_CURDIR is not set +# CONFIG_ASH_BASH_NOT_FOUND_HOOK is not set +# CONFIG_ASH_JOB_CONTROL is not set +# CONFIG_ASH_ALIAS is not set +# CONFIG_ASH_RANDOM_SUPPORT is not set +# CONFIG_ASH_EXPAND_PRMT is not set +# CONFIG_ASH_IDLE_TIMEOUT is not set +# CONFIG_ASH_MAIL is not set +# CONFIG_ASH_ECHO is not set +# CONFIG_ASH_PRINTF is not set +# CONFIG_ASH_TEST is not set +# CONFIG_ASH_SLEEP is not set +# CONFIG_ASH_HELP is not set +# CONFIG_ASH_GETOPTS is not set +# CONFIG_ASH_CMDCMD is not set +# CONFIG_CTTYHACK is not set +# CONFIG_HUSH is not set +# CONFIG_SHELL_HUSH is not set +# CONFIG_HUSH_BASH_COMPAT is not set +# CONFIG_HUSH_BRACE_EXPANSION is not set +# CONFIG_HUSH_BASH_SOURCE_CURDIR is not set +# CONFIG_HUSH_LINENO_VAR is not set +# CONFIG_HUSH_INTERACTIVE is not set +# CONFIG_HUSH_SAVEHISTORY is not set +# CONFIG_HUSH_JOB is not set +# CONFIG_HUSH_TICK is not set +# CONFIG_HUSH_IF is not set +# CONFIG_HUSH_LOOPS is not set +# CONFIG_HUSH_CASE is not set +# CONFIG_HUSH_FUNCTIONS is not set +# CONFIG_HUSH_LOCAL is not set +# CONFIG_HUSH_RANDOM_SUPPORT is not set +# CONFIG_HUSH_MODE_X is not set +# CONFIG_HUSH_ECHO is not set +# CONFIG_HUSH_PRINTF is not set +# CONFIG_HUSH_TEST is not set +# CONFIG_HUSH_HELP is not set +# CONFIG_HUSH_EXPORT is not set +# CONFIG_HUSH_EXPORT_N is not set +# CONFIG_HUSH_READONLY is not set +# CONFIG_HUSH_KILL is not set +# CONFIG_HUSH_WAIT is not set +# CONFIG_HUSH_COMMAND is not set +# CONFIG_HUSH_TRAP is not set +# CONFIG_HUSH_TYPE is not set +# CONFIG_HUSH_TIMES is not set +# CONFIG_HUSH_READ is not set +# CONFIG_HUSH_SET is not set +# CONFIG_HUSH_UNSET is not set +# CONFIG_HUSH_ULIMIT is not set +# CONFIG_HUSH_UMASK is not set +# CONFIG_HUSH_GETOPTS is not set +# CONFIG_HUSH_MEMLEAK is not set + +# +# Options common to all shells +# +# CONFIG_FEATURE_SH_MATH is not set +# CONFIG_FEATURE_SH_MATH_64 is not set +# CONFIG_FEATURE_SH_MATH_BASE is not set +# CONFIG_FEATURE_SH_EXTRA_QUIET is not set +# CONFIG_FEATURE_SH_STANDALONE is not set +# CONFIG_FEATURE_SH_NOFORK is not set +# CONFIG_FEATURE_SH_READ_FRAC is not set +# CONFIG_FEATURE_SH_HISTFILESIZE is not set +# CONFIG_FEATURE_SH_EMBEDDED_SCRIPTS is not set + +# +# System Logging Utilities +# +# CONFIG_KLOGD is not set +# CONFIG_FEATURE_KLOGD_KLOGCTL is not set +# CONFIG_LOGGER is not set +# CONFIG_LOGREAD is not set +# CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING is not set +# CONFIG_SYSLOGD is not set +# CONFIG_FEATURE_ROTATE_LOGFILE is not set +# CONFIG_FEATURE_REMOTE_LOG is not set +# CONFIG_FEATURE_SYSLOGD_DUP is not set +# CONFIG_FEATURE_SYSLOGD_CFG is not set +# CONFIG_FEATURE_SYSLOGD_PRECISE_TIMESTAMPS is not set +CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=0 +# CONFIG_FEATURE_IPC_SYSLOG is not set +CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=0 +# CONFIG_FEATURE_KMSG_SYSLOG is not set From 7ca1a03da290babe07faca72320cfb75ec7090c4 Mon Sep 17 00:00:00 2001 From: Kamil Koczurek Date: Wed, 28 Aug 2024 00:27:16 +0200 Subject: [PATCH 09/22] runtime: use device serial for storage identification * Assign serial numbers of the form vol-{k} to identify external storage. * Emit command line parameters vol-{k}-path=.. and vol-{k}-errors for each of the external drives. * Split tmpfs specification into vol-{k}-path=.. and vol-{k}-size. * Assign serial `vol-nvidia` to the nvidia files drive. * Don't emit command line nvidia=true --- runtime/src/vmrt.rs | 50 +++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/runtime/src/vmrt.rs b/runtime/src/vmrt.rs index fa913cc3..2dff3906 100755 --- a/runtime/src/vmrt.rs +++ b/runtime/src/vmrt.rs @@ -102,46 +102,48 @@ pub async fn start_vmrt( "virtserialport,chardev=manager_cdev,name=manager_port", "-drive", format!( - "file={},cache=unsafe,readonly=on,format=raw,if=virtio", + "file={},cache=unsafe,readonly=on,format=raw,id=rootfs,if=none", deployment.task_package.display() ) .as_str(), + "-device", + format!("virtio-blk-pci,drive=rootfs,serial=rootfs").as_str(), "-no-reboot", ]); - let mut vol_idx = 0; - let mut dev_idx = 0; - for DeploymentMount { - name, - guest_path, - mount, - } in &deployment.mounts + for ( + vol_idx, + DeploymentMount { + name, + guest_path, + mount, + }, + ) in deployment.mounts.iter().enumerate() { match mount { VolumeMount::Storage { errors, .. } => { + let errors = errors.as_deref().unwrap_or("continue"); + let img_path = work_dir.join(name); cmd.args([ "-drive", format!( - "file={},format=qcow2,media=disk,if=virtio", + "file={},format=qcow2,media=disk,id=vol-{vol_idx},if=none", img_path.display() ) .as_str(), + "-device", + format!("virtio-blk-pci,drive=vol-{vol_idx},serial=vol-{vol_idx}").as_ref(), ]); - kernel_cmdline.push_str(&match errors { - None => format!(" vol-{vol_idx}={guest_path}:{dev_idx}"), - Some(errors) => { - format!(" vol-{vol_idx}={guest_path},errors={errors}:{dev_idx}") - } - }); - dev_idx += 1; + kernel_cmdline.push_str(&format!(" vol-{vol_idx}-path={guest_path}")); + kernel_cmdline.push_str(&format!(" vol-{vol_idx}-errors={errors}")); } VolumeMount::Ram { size } => { let size = size.as_u64(); - kernel_cmdline.push_str(&format!(" vol-{vol_idx}={guest_path},size={size}")); + kernel_cmdline.push_str(&format!(" vol-{vol_idx}-path={guest_path}")); + kernel_cmdline.push_str(&format!(" vol-{vol_idx}-size={size}")); } } - vol_idx += 1; } if let Some(pci_device_id) = &data.pci_device_id { @@ -155,16 +157,16 @@ pub async fn start_vmrt( } if runtime_dir.join(FILE_NVIDIA_FILES).exists() { - cmd.arg("-drive"); - cmd.arg( + cmd.args([ + "-drive", format!( - "file={},cache=unsafe,readonly=on,format=raw,if=virtio", + "file={},cache=unsafe,readonly=on,format=raw,id=vol-nvidia,if=none", runtime_dir.join(FILE_NVIDIA_FILES).display() ) .as_str(), - ); - - kernel_cmdline.push_str(&format!(" nvidia=true")); + "-device", + format!("virtio-blk-pci,drive=vol-nvidia,serial=vol-nvidia").as_ref(), + ]); } cmd.args(["-append", &kernel_cmdline]); From f89a4eb8baf68de95c0d199df71ca11d40aaebf0 Mon Sep 17 00:00:00 2001 From: Kamil Koczurek Date: Wed, 28 Aug 2024 14:55:22 +0200 Subject: [PATCH 10/22] runtime: replace vol-nvidia serial with nvidia-files --- runtime/src/vmrt.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/src/vmrt.rs b/runtime/src/vmrt.rs index 2dff3906..699ca177 100755 --- a/runtime/src/vmrt.rs +++ b/runtime/src/vmrt.rs @@ -160,12 +160,12 @@ pub async fn start_vmrt( cmd.args([ "-drive", format!( - "file={},cache=unsafe,readonly=on,format=raw,id=vol-nvidia,if=none", + "file={},cache=unsafe,readonly=on,format=raw,id=nvidia-files,if=none", runtime_dir.join(FILE_NVIDIA_FILES).display() ) .as_str(), "-device", - format!("virtio-blk-pci,drive=vol-nvidia,serial=vol-nvidia").as_ref(), + format!("virtio-blk-pci,drive=nvidia-files,serial=nvidia-files").as_ref(), ]); } From 6aa822a3289fd5f535097288037e4cbc3aaa4dc6 Mon Sep 17 00:00:00 2001 From: Kamil Koczurek Date: Wed, 28 Aug 2024 14:56:01 +0200 Subject: [PATCH 11/22] runtime: Fix storage leak * self-test didn't remove its artifacts from /tmp, which wasn't harmful when those were only directories but with the introduction of qcow2 storage, the storage leak became considerable. Now each invocation of the self-test creates it's dedicated subdirectory within /tmp which is deleted after the test concludes. * lower storage sizes for self-test. --- runtime/src/self_test.rs | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/runtime/src/self_test.rs b/runtime/src/self_test.rs index 89bb27c3..f65cda97 100644 --- a/runtime/src/self_test.rs +++ b/runtime/src/self_test.rs @@ -24,6 +24,21 @@ use crate::{qcow2_min, Runtime, TestConfig}; const FILE_TEST_IMAGE: &str = "self-test.gvmi"; const FILE_TEST_EXECUTABLE: &str = "ya-self-test"; +struct RaiiDir(PathBuf); + +impl RaiiDir { + pub fn create(path: PathBuf) -> std::io::Result { + std::fs::create_dir(&path)?; + Ok(Self(path)) + } +} + +impl Drop for RaiiDir { + fn drop(&mut self) { + std::fs::remove_dir_all(&self.0).expect(&format!("Couldn't remove {}", self.0.display())); + } +} + pub(crate) async fn test( pci_device_id: Option>, test_config: TestConfig, @@ -45,7 +60,10 @@ pub(crate) async fn run_self_test( ) where HANDLER: Fn(anyhow::Result) -> anyhow::Result, { - let work_dir = std::env::temp_dir(); + let tmp = std::env::temp_dir(); + let work_dir = tmp.join(format!("ya-runtime-vm-self-test-{}", Uuid::new_v4())); + let work_dir_handle = + RaiiDir::create(work_dir.clone()).expect("Failed to create workdir for self-test"); let deployment = self_test_deployment(&work_dir, &test_config) .await @@ -62,7 +80,8 @@ pub(crate) async fn run_self_test( let runtime = self_test_runtime(deployment, pci_device_id); - server::run_async(|emitter| async { + let work_dir = &work_dir; + server::run_async(|emitter| async move { let ctx = Context::try_new().expect("Creates runtime context"); log::info!("Starting runtime"); @@ -100,8 +119,9 @@ pub(crate) async fn run_self_test( log::debug!("Deleting output files"); std::fs::remove_dir_all(output_dir).expect("Removes self-test output dir"); + // the server refuses to stop by itself; force quit tokio::spawn(async move { - // the server refuses to stop by itself; force quit + drop(work_dir_handle); std::process::exit(0); }); @@ -148,7 +168,7 @@ async fn self_test_deployment( ( "/golem/storage".to_string(), VolumeInfo::Mount(VolumeMount::Storage { - size: "10gi".parse().unwrap(), + size: "1mi".parse().unwrap(), preallocate: None, errors: Some("remount-ro".to_string()), }), @@ -156,7 +176,7 @@ async fn self_test_deployment( ( "/golem/storage2".to_string(), VolumeInfo::Mount(VolumeMount::Storage { - size: "10ti".parse().unwrap(), + size: "10mi".parse().unwrap(), preallocate: Some("128ki".parse().unwrap()), errors: None, }), From e6748680d9513c76442720c57621fa0633b5a152 Mon Sep 17 00:00:00 2001 From: Kamil Koczurek Date: Wed, 28 Aug 2024 14:59:05 +0200 Subject: [PATCH 12/22] init: identify storage devices and format them using mkfs.ext2 * Temporarily disable nvidia storage support --- runtime/init-container/src/init.c | 69 ++++++++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/runtime/init-container/src/init.c b/runtime/init-container/src/init.c index cd78c7e0..a41b7e4f 100644 --- a/runtime/init-container/src/init.c +++ b/runtime/init-container/src/init.c @@ -69,6 +69,8 @@ #define MTU_VPN 1220 #define MTU_INET 65521 +#define MKFS "mkfs.ext2" + static int g_sysroot_fd = AT_FDCWD; struct new_process_args { @@ -2114,6 +2116,65 @@ static int nvidia_gpu_count() { return counter; } +static void mkfs_storage() { + static const char *block_dir = "/sys/class/block"; + + DIR* ptr_dir = opendir(block_dir); + CHECK_BOOL(ptr_dir != NULL); + + int len = offsetof(struct dirent, d_name) + fpathconf(dirfd(ptr_dir), _PC_NAME_MAX) + 1; + struct dirent *prev = malloc(len); + struct dirent *curr = NULL; + CHECK_BOOL(prev != NULL); + + for(;;) { + CHECK(readdir_r(ptr_dir, prev, &curr)); + if(curr == NULL) { + break; + } + + // virtio-blk device names are vdX, ignore others. + if(strncmp(curr->d_name, "vd", 2) != 0) { + continue; + } + + int vdx_fd = openat(dirfd(ptr_dir), curr->d_name, O_RDONLY | O_DIRECTORY); + CHECK_BOOL(vdx_fd != -1); + + int serial_fd = openat(vdx_fd, "serial", O_RDONLY); + if(serial_fd == -1) { + fprintf(stderr, "virtio-blk %s/%s/serial doesn't exist, skip\n", block_dir, curr->d_name); + continue; + } + + char serial[128]; + int bytes_read = read(serial_fd, serial, 127); + CHECK_BOOL(bytes_read != -1); + serial[bytes_read] = '\0'; + + if(strncmp(serial, "vol-", 4) != 0) { + fprintf(stderr, "Found virtio-blk: %s/%s with SN=%s, skip\n", block_dir, curr->d_name, serial); + continue; + } else { + fprintf(stderr, "Found virtio-blk: %s/%s with SN=%s, format as ext2\n", block_dir, curr->d_name, serial); + } + + char path[64]; + CHECK_BOOL(snprintf(path, 64, "/dev/%s", curr->d_name) >= 6); + + pid_t pid = fork(); + CHECK_BOOL(pid != -1); + + if(pid == 0) { + execl("/" MKFS, MKFS, path, (char*) NULL); + } else { + waitpid(pid, NULL, 0); + } + } + + free(prev); +} + int main(int argc, char **argv) { CHECK_BOOL(setvbuf(stdin, NULL, _IONBF, BUFSIZ) == 0); CHECK_BOOL(setvbuf(stdout, NULL, _IONBF, BUFSIZ) == 0); @@ -2126,6 +2187,10 @@ int main(int argc, char **argv) { create_dir("/dev", DEFAULT_DIR_PERMS); CHECK(mount("devtmpfs", "/dev", "devtmpfs", MS_NOSUID, "mode=0755,size=2M")); + create_dir("/sys", DEFAULT_DIR_PERMS); + CHECK(mount("sysfs", "/sys", "sysfs", + MS_NODEV | MS_NOSUID | MS_NOEXEC, + NULL)); load_module("/failover.ko"); load_module("/virtio.ko"); @@ -2183,6 +2248,8 @@ int main(int argc, char **argv) { CHECK(mkdir("/mnt/overlay", S_IRWXU)); CHECK(mkdir(SYSROOT, DEFAULT_DIR_PERMS)); + mkfs_storage(); + // 'workdir' and 'upperdir' have to be on the same filesystem CHECK(mount("tmpfs", "/mnt/overlay", "tmpfs", MS_NOSUID | MS_NODEV, @@ -2196,7 +2263,7 @@ int main(int argc, char **argv) { CHECK(mkdir("/mnt/overlay/work", statbuf.st_mode)); } - if (access("/dev/vdb", R_OK) == 0) { + if (access("/dev/vdb", R_OK) == 0 && false) { CHECK(mkdir("/mnt/gpu-files", S_IRWXU)); CHECK(mount("/dev/vdb", "/mnt/gpu-files", "squashfs", MS_RDONLY | MS_NODEV, "")); CHECK(mount("overlay", SYSROOT, "overlay", MS_NODEV, From beb8cf1b7166d6f94f17a9f1e24e911adc44fff0 Mon Sep 17 00:00:00 2001 From: Kamil Koczurek Date: Wed, 28 Aug 2024 15:56:29 +0200 Subject: [PATCH 13/22] init: create list of storages with info for building overlayfs Extra: * hide mkfs.ext2 output * validate that the failure to open /sys/class/block/vdX/serial is reported as the absence of the file only when errno is ENOENT. Fail otherwise. --- runtime/init-container/src/init.c | 104 ++++++++++++++++++++++++++---- 1 file changed, 93 insertions(+), 11 deletions(-) diff --git a/runtime/init-container/src/init.c b/runtime/init-container/src/init.c index a41b7e4f..01e08a5e 100644 --- a/runtime/init-container/src/init.c +++ b/runtime/init-container/src/init.c @@ -2116,7 +2116,71 @@ static int nvidia_gpu_count() { return counter; } -static void mkfs_storage() { +static const char* environ_get(const char* name) { + int name_len = strlen(name); + for(int k = 0; environ[k] != NULL; k += 1) { + if(strncmp(environ[k], name, name_len) == 0 && environ[k][name_len] == '=') { + return environ[k] + name_len + 1; + } + } + + return "NOT FOUND"; +} + +struct storage_node_t { + struct storage_node_t *next; + const char *path; + const char *dev; + const char *fstype; + const char *data; + unsigned long flags; +}; + +static void storage_append( + struct storage_node_t **node, + const char *path, + const char *dev, + const char *fstype, + const char *data, + unsigned long flags +) { + while (*node != NULL) { + node = &(*node)->next; + } + + *node = malloc(sizeof(struct storage_node_t)); + CHECK(*node != 0); + + (*node)->next = NULL; + (*node)->path = path; + (*node)->dev = dev; + (*node)->fstype = fstype; + (*node)->data = data; + (*node)->flags = flags; +} + +static void do_mkfs(const char *path) { + pid_t pid = fork(); + CHECK_BOOL(pid != -1); + + if(pid == 0) { + // Hide stdout + int null = open("/dev/null", O_WRONLY); + dup2(null, 1); + close(null); + + execl("/" MKFS, MKFS, path, (char*) NULL); + // exit will only run if execl fails + exit(1); + } else { + int status; + waitpid(pid, &status, 0); + fprintf(stderr, MKFS " finished with status = %d\n", status); + CHECK_BOOL(status == 0); + } +} + +static void scan_storage(struct storage_node_t **list) { static const char *block_dir = "/sys/class/block"; DIR* ptr_dir = opendir(block_dir); @@ -2143,6 +2207,8 @@ static void mkfs_storage() { int serial_fd = openat(vdx_fd, "serial", O_RDONLY); if(serial_fd == -1) { + CHECK_BOOL(errno == ENOENT); + fprintf(stderr, "virtio-blk %s/%s/serial doesn't exist, skip\n", block_dir, curr->d_name); continue; } @@ -2152,6 +2218,16 @@ static void mkfs_storage() { CHECK_BOOL(bytes_read != -1); serial[bytes_read] = '\0'; + char *dev_path = malloc(16); + CHECK_BOOL(snprintf(dev_path, 64, "/dev/%s", curr->d_name) >= 6); + + // nvidia-files does not require formatting + if(strcmp(serial, "nvidia-files") == 0 || strcmp(serial, "rootfs") == 0) { + fprintf(stderr, "Storage volume %s [%s] to be mounted at %s with data=\"\".\n", serial, dev_path, "/"); + storage_append(list, "/", dev_path, "squashfs", "", MS_RDONLY | MS_NODEV); + continue; + } + if(strncmp(serial, "vol-", 4) != 0) { fprintf(stderr, "Found virtio-blk: %s/%s with SN=%s, skip\n", block_dir, curr->d_name, serial); continue; @@ -2159,17 +2235,22 @@ static void mkfs_storage() { fprintf(stderr, "Found virtio-blk: %s/%s with SN=%s, format as ext2\n", block_dir, curr->d_name, serial); } - char path[64]; - CHECK_BOOL(snprintf(path, 64, "/dev/%s", curr->d_name) >= 6); + do_mkfs(dev_path); - pid_t pid = fork(); - CHECK_BOOL(pid != -1); + int path_env_len = strlen(serial) + strlen("-path") + 1; + char *path_env = malloc(path_env_len); + snprintf(path_env, path_env_len, "%s-path", serial); + const char *mount_point = environ_get(path_env); - if(pid == 0) { - execl("/" MKFS, MKFS, path, (char*) NULL); - } else { - waitpid(pid, NULL, 0); - } + int errors_env_len = strlen(serial) + strlen("-errors") + 1; + char *errors_env = malloc(errors_env_len); + snprintf(errors_env, errors_env_len, "%s-errors", serial); + + // hacky but avoids an extra allocation + const char *data = environ_get(errors_env) - strlen("errors="); + + fprintf(stderr, "Storage volume %s [%s] to be mounted at %s with data=\"%s\".\n", serial, dev_path, mount_point, data); + storage_append(list, mount_point, dev_path, "ext4", data, MS_NODEV); } free(prev); @@ -2248,7 +2329,8 @@ int main(int argc, char **argv) { CHECK(mkdir("/mnt/overlay", S_IRWXU)); CHECK(mkdir(SYSROOT, DEFAULT_DIR_PERMS)); - mkfs_storage(); + struct storage_node_t *storage = NULL; + scan_storage(&storage); // 'workdir' and 'upperdir' have to be on the same filesystem CHECK(mount("tmpfs", "/mnt/overlay", "tmpfs", From 5fc7f40958a23a034b7b7fa1f7538498cc1d8907 Mon Sep 17 00:00:00 2001 From: Kamil Koczurek Date: Wed, 28 Aug 2024 16:14:32 +0200 Subject: [PATCH 14/22] chore: clippy --- runtime/src/deploy.rs | 2 +- runtime/src/qcow2_min/mod.rs | 4 ++-- runtime/src/self_test.rs | 2 +- runtime/src/vmrt.rs | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/runtime/src/deploy.rs b/runtime/src/deploy.rs index dc2650c5..c5e11465 100644 --- a/runtime/src/deploy.rs +++ b/runtime/src/deploy.rs @@ -78,7 +78,7 @@ impl Deployment { if !volume_present { volumes.push(ContainerVolume { name: format!("vol-{}", Uuid::new_v4()), - path: path, + path, }); } diff --git a/runtime/src/qcow2_min/mod.rs b/runtime/src/qcow2_min/mod.rs index d06df072..b72594ec 100644 --- a/runtime/src/qcow2_min/mod.rs +++ b/runtime/src/qcow2_min/mod.rs @@ -60,8 +60,8 @@ impl Qcow2Image { let block: &'static [u8] = &[0; BLOCK_SZ as usize]; while file_sz >= BLOCK_SZ { - writer.write_all(&block).await?; - file_sz -= BLOCK_SZ as u64; + writer.write_all(block).await?; + file_sz -= BLOCK_SZ; } if file_sz > 0 { writer.write_all(&block[0..file_sz as usize]).await?; diff --git a/runtime/src/self_test.rs b/runtime/src/self_test.rs index f65cda97..39eff04c 100644 --- a/runtime/src/self_test.rs +++ b/runtime/src/self_test.rs @@ -35,7 +35,7 @@ impl RaiiDir { impl Drop for RaiiDir { fn drop(&mut self) { - std::fs::remove_dir_all(&self.0).expect(&format!("Couldn't remove {}", self.0.display())); + std::fs::remove_dir_all(&self.0).unwrap_or_else(|_| panic!("Couldn't remove {}", self.0.display())); } } diff --git a/runtime/src/vmrt.rs b/runtime/src/vmrt.rs index 699ca177..60144960 100755 --- a/runtime/src/vmrt.rs +++ b/runtime/src/vmrt.rs @@ -107,7 +107,7 @@ pub async fn start_vmrt( ) .as_str(), "-device", - format!("virtio-blk-pci,drive=rootfs,serial=rootfs").as_str(), + "virtio-blk-pci,drive=rootfs,serial=rootfs".to_string().as_str(), "-no-reboot", ]); @@ -165,7 +165,7 @@ pub async fn start_vmrt( ) .as_str(), "-device", - format!("virtio-blk-pci,drive=nvidia-files,serial=nvidia-files").as_ref(), + "virtio-blk-pci,drive=nvidia-files,serial=nvidia-files".to_string().as_ref(), ]); } From cc28e2e0cf303f521fa1ffcdd2db23e98d6b783d Mon Sep 17 00:00:00 2001 From: Kamil Koczurek Date: Wed, 28 Aug 2024 16:52:16 +0200 Subject: [PATCH 15/22] ci: fix macos build --- .github/workflows/build.yml | 2 +- rust-toolchain.toml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4b212224..f5e01b90 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: strategy: matrix: #os: [macos-latest, windows-latest, ubuntu-latest] - os: [ubuntu-latest] + os: [macos-latest, ubuntu-latest] steps: - name: Checkout diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 2f2d52c2..85cb9e7b 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,3 @@ [toolchain] channel = "1.80.0" components = ["rustfmt", "clippy"] -targets = ["x86_64-unknown-linux-musl"] From 5347abdb46a746407e91e4cf382dbaaff0ad677e Mon Sep 17 00:00:00 2001 From: Kamil Koczurek Date: Wed, 28 Aug 2024 16:53:14 +0200 Subject: [PATCH 16/22] chore: fmt --- runtime/src/self_test.rs | 3 ++- runtime/src/vmrt.rs | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/runtime/src/self_test.rs b/runtime/src/self_test.rs index 39eff04c..a1db0409 100644 --- a/runtime/src/self_test.rs +++ b/runtime/src/self_test.rs @@ -35,7 +35,8 @@ impl RaiiDir { impl Drop for RaiiDir { fn drop(&mut self) { - std::fs::remove_dir_all(&self.0).unwrap_or_else(|_| panic!("Couldn't remove {}", self.0.display())); + std::fs::remove_dir_all(&self.0) + .unwrap_or_else(|_| panic!("Couldn't remove {}", self.0.display())); } } diff --git a/runtime/src/vmrt.rs b/runtime/src/vmrt.rs index 60144960..45d2aae8 100755 --- a/runtime/src/vmrt.rs +++ b/runtime/src/vmrt.rs @@ -107,7 +107,9 @@ pub async fn start_vmrt( ) .as_str(), "-device", - "virtio-blk-pci,drive=rootfs,serial=rootfs".to_string().as_str(), + "virtio-blk-pci,drive=rootfs,serial=rootfs" + .to_string() + .as_str(), "-no-reboot", ]); @@ -165,7 +167,9 @@ pub async fn start_vmrt( ) .as_str(), "-device", - "virtio-blk-pci,drive=nvidia-files,serial=nvidia-files".to_string().as_ref(), + "virtio-blk-pci,drive=nvidia-files,serial=nvidia-files" + .to_string() + .as_ref(), ]); } From 02612412aa95f046d9926acdeec1241e866790b4 Mon Sep 17 00:00:00 2001 From: Kamil Koczurek Date: Thu, 29 Aug 2024 07:48:57 +0200 Subject: [PATCH 17/22] ci: fix macos (again) --- .github/workflows/build.yml | 4 ++-- .github/workflows/release.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f5e01b90..002566b2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,9 +14,9 @@ jobs: build: name: Build env: - RUSTFLAGS: "-D warnings -C opt-level=z -C target-cpu=x86-64 -C debuginfo=1" + RUSTFLAGS: "-D warnings -C opt-level=z -C debuginfo=1" X86_64_PC_WINDOWS_MSVC_OPENSSL_DIR: c:/vcpkg/installed/x64-windows - rust_stable: 1.70.0 + rust_stable: 1.80.0 runs-on: ${{ matrix.os }} strategy: matrix: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4a984430..7036cba7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,7 +8,7 @@ on: env: self-test-img_tag: v0.1.4 self-test-img_repository: golemfactory/ya-self-test-img - rust_stable: 1.70.0 + rust_stable: 1.80.0 jobs: create-release: From 7d606e84c4c947d4ffae6ececf9b31f1de62f05f Mon Sep 17 00:00:00 2001 From: Kamil Koczurek Date: Thu, 29 Aug 2024 08:06:18 +0200 Subject: [PATCH 18/22] Revert "ci: fix macos (again)" This reverts commit 02612412aa95f046d9926acdeec1241e866790b4. --- .github/workflows/build.yml | 4 ++-- .github/workflows/release.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 002566b2..f5e01b90 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,9 +14,9 @@ jobs: build: name: Build env: - RUSTFLAGS: "-D warnings -C opt-level=z -C debuginfo=1" + RUSTFLAGS: "-D warnings -C opt-level=z -C target-cpu=x86-64 -C debuginfo=1" X86_64_PC_WINDOWS_MSVC_OPENSSL_DIR: c:/vcpkg/installed/x64-windows - rust_stable: 1.80.0 + rust_stable: 1.70.0 runs-on: ${{ matrix.os }} strategy: matrix: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7036cba7..4a984430 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,7 +8,7 @@ on: env: self-test-img_tag: v0.1.4 self-test-img_repository: golemfactory/ya-self-test-img - rust_stable: 1.80.0 + rust_stable: 1.70.0 jobs: create-release: From ac1863a927b80feef4179ab87dc1ba01671a065d Mon Sep 17 00:00:00 2001 From: Kamil Koczurek Date: Thu, 29 Aug 2024 08:07:03 +0200 Subject: [PATCH 19/22] Revert "ci: fix macos build" This reverts commit cc28e2e0cf303f521fa1ffcdd2db23e98d6b783d. --- .github/workflows/build.yml | 2 +- rust-toolchain.toml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f5e01b90..4b212224 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: strategy: matrix: #os: [macos-latest, windows-latest, ubuntu-latest] - os: [macos-latest, ubuntu-latest] + os: [ubuntu-latest] steps: - name: Checkout diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 85cb9e7b..2f2d52c2 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,4 @@ [toolchain] channel = "1.80.0" components = ["rustfmt", "clippy"] +targets = ["x86_64-unknown-linux-musl"] From 7656463d1b89302d89553b8a034571638e4c6b57 Mon Sep 17 00:00:00 2001 From: Kamil Koczurek Date: Thu, 29 Aug 2024 08:50:30 +0200 Subject: [PATCH 20/22] runtime: fix accidental doctest --- runtime/src/qcow2_min/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/src/qcow2_min/mod.rs b/runtime/src/qcow2_min/mod.rs index b72594ec..d0f8c6ad 100644 --- a/runtime/src/qcow2_min/mod.rs +++ b/runtime/src/qcow2_min/mod.rs @@ -36,7 +36,7 @@ impl Qcow2Image { /// Writes a valid qcow2 image according to the parameters. /// /// Resultant `qemu-img info`: - /// ``` + /// ```plain /// cluster_size: 65536 /// Format specific information: /// compat: 1.1 From 959737426911fdc7617f07e3b7d91dc023de76b6 Mon Sep 17 00:00:00 2001 From: Kamil Koczurek Date: Thu, 29 Aug 2024 09:58:34 +0200 Subject: [PATCH 21/22] init: cleanup * Handle missing vol- envs properly * Fix memory leaks --- runtime/init-container/src/init.c | 64 +++++++++++++++++++++++-------- 1 file changed, 49 insertions(+), 15 deletions(-) diff --git a/runtime/init-container/src/init.c b/runtime/init-container/src/init.c index 01e08a5e..f434648b 100644 --- a/runtime/init-container/src/init.c +++ b/runtime/init-container/src/init.c @@ -2124,15 +2124,15 @@ static const char* environ_get(const char* name) { } } - return "NOT FOUND"; + return NULL; } struct storage_node_t { struct storage_node_t *next; - const char *path; - const char *dev; - const char *fstype; - const char *data; + char *path; + char *dev; + char *fstype; + char *data; unsigned long flags; }; @@ -2152,13 +2152,39 @@ static void storage_append( CHECK(*node != 0); (*node)->next = NULL; - (*node)->path = path; - (*node)->dev = dev; - (*node)->fstype = fstype; - (*node)->data = data; + + (*node)->path = malloc(strlen(path) + 1); + CHECK_BOOL((*node)->path != NULL); + strcpy((*node)->path, path); + + (*node)->dev = malloc(strlen(dev) + 1); + CHECK_BOOL((*node)->dev != NULL); + strcpy((*node)->dev, dev); + + (*node)->fstype = malloc(strlen(fstype) + 1); + CHECK_BOOL((*node)->fstype != NULL); + strcpy((*node)->fstype, fstype); + + (*node)->data = malloc(strlen(data) + 1); + CHECK_BOOL((*node)->data != NULL); + strcpy((*node)->data, data); + (*node)->flags = flags; } +static void storage_free(struct storage_node_t *node) { + while (node != NULL) { + struct storage_node_t *to_free = node; + node = node->next; + + free(to_free->path); + free(to_free->dev); + free(to_free->fstype); + free(to_free->data); + free(to_free); + } +} + static void do_mkfs(const char *path) { pid_t pid = fork(); CHECK_BOOL(pid != -1); @@ -2218,13 +2244,13 @@ static void scan_storage(struct storage_node_t **list) { CHECK_BOOL(bytes_read != -1); serial[bytes_read] = '\0'; - char *dev_path = malloc(16); - CHECK_BOOL(snprintf(dev_path, 64, "/dev/%s", curr->d_name) >= 6); + char dev_path[16]; + CHECK_BOOL(snprintf(dev_path, 16, "/dev/%s", curr->d_name) >= 6); // nvidia-files does not require formatting if(strcmp(serial, "nvidia-files") == 0 || strcmp(serial, "rootfs") == 0) { - fprintf(stderr, "Storage volume %s [%s] to be mounted at %s with data=\"\".\n", serial, dev_path, "/"); storage_append(list, "/", dev_path, "squashfs", "", MS_RDONLY | MS_NODEV); + fprintf(stderr, "Storage volume %s [%s] to be mounted at %s with data=\"\".\n", serial, dev_path, "/"); continue; } @@ -2241,16 +2267,23 @@ static void scan_storage(struct storage_node_t **list) { char *path_env = malloc(path_env_len); snprintf(path_env, path_env_len, "%s-path", serial); const char *mount_point = environ_get(path_env); + CHECK_BOOL(mount_point != NULL); + free(path_env); int errors_env_len = strlen(serial) + strlen("-errors") + 1; char *errors_env = malloc(errors_env_len); snprintf(errors_env, errors_env_len, "%s-errors", serial); + const char *errors = environ_get(errors_env); + CHECK_BOOL(errors != NULL); + free(errors_env); - // hacky but avoids an extra allocation - const char *data = environ_get(errors_env) - strlen("errors="); + int data_len = strlen("errors=") + strlen(errors) + 1; + char *data = malloc(data_len); + snprintf(data, data_len, "errors=%s", errors); - fprintf(stderr, "Storage volume %s [%s] to be mounted at %s with data=\"%s\".\n", serial, dev_path, mount_point, data); storage_append(list, mount_point, dev_path, "ext4", data, MS_NODEV); + fprintf(stderr, "Storage volume %s [%s] to be mounted at %s with data=\"%s\".\n", serial, dev_path, mount_point, data); + free(data); } free(prev); @@ -2331,6 +2364,7 @@ int main(int argc, char **argv) { struct storage_node_t *storage = NULL; scan_storage(&storage); + storage_free(storage); // 'workdir' and 'upperdir' have to be on the same filesystem CHECK(mount("tmpfs", "/mnt/overlay", "tmpfs", From 75a817cedc327333986aae76da620d5714851057 Mon Sep 17 00:00:00 2001 From: Kamil Koczurek Date: Fri, 30 Aug 2024 11:30:27 +0200 Subject: [PATCH 22/22] ci: ultimate fix for macos build --- .github/workflows/build.yml | 8 ++++---- .github/workflows/release.yml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4b212224..c4e74cc2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,14 +14,14 @@ jobs: build: name: Build env: - RUSTFLAGS: "-D warnings -C opt-level=z -C target-cpu=x86-64 -C debuginfo=1" + RUSTFLAGS: "-D warnings -C opt-level=z -C debuginfo=1" X86_64_PC_WINDOWS_MSVC_OPENSSL_DIR: c:/vcpkg/installed/x64-windows - rust_stable: 1.70.0 + rust_stable: 1.80.0 runs-on: ${{ matrix.os }} strategy: matrix: - #os: [macos-latest, windows-latest, ubuntu-latest] - os: [ubuntu-latest] + #os: [macos-13, windows-latest, ubuntu-latest] + os: [macos-13, ubuntu-latest] steps: - name: Checkout diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4a984430..7036cba7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,7 +8,7 @@ on: env: self-test-img_tag: v0.1.4 self-test-img_repository: golemfactory/ya-self-test-img - rust_stable: 1.70.0 + rust_stable: 1.80.0 jobs: create-release: