diff --git a/library/base/Dockerfile b/library/base/Dockerfile new file mode 100644 index 00000000..12424f4c --- /dev/null +++ b/library/base/Dockerfile @@ -0,0 +1,20 @@ +FROM gcc:13.2.0 AS fallback + +COPY ./fallback.c /fallback.c + +RUN set -xe; \ + gcc \ + -fPIC \ + -g \ + -o /fallback \ + -O3 \ + -static-pie \ + -Wall \ + -Wextra \ + -Wno-unused \ + -Wno-unused-parameter \ + /fallback.c + +FROM scratch + +COPY --from=fallback /fallback /fallback diff --git a/library/base/Kraftfile b/library/base/Kraftfile index 3dd7b1f1..9546dac4 100644 --- a/library/base/Kraftfile +++ b/library/base/Kraftfile @@ -4,8 +4,11 @@ template: source: https://github.com/unikraft/app-elfloader.git version: staging +rootfs: ./Dockerfile + +cmd: ["/fallback"] + unikraft: - source: https://github.com/unikraft/unikraft.git version: staging kconfig: # Configurations options for app-elfloader @@ -82,8 +85,14 @@ unikraft: CONFIG_LIBUKVMEM_DEMAND_PAGE_IN_SIZE: 12 CONFIG_LIBUKVMEM_PAGEFAULT_HANDLER_PRIO: 4 CONFIG_LIBUKVMEM: 'y' - CONFIG_LIBVFSCORE_AUTOMOUNT_ROOTFS: 'n' - CONFIG_LIBVFSCORE_FSTAB: 'y' + CONFIG_LIBVFSCORE_AUTOMOUNT_CI_EINITRD: 'y' + CONFIG_LIBVFSCORE_AUTOMOUNT_CI: 'y' + CONFIG_LIBVFSCORE_AUTOMOUNT_FB: 'y' + CONFIG_LIBVFSCORE_AUTOMOUNT_FB0_DEV: "embedded" + CONFIG_LIBVFSCORE_AUTOMOUNT_FB0_DRIVER: "extract" + CONFIG_LIBVFSCORE_AUTOMOUNT_FB0_MP: "/" + CONFIG_LIBVFSCORE_AUTOMOUNT_UP: 'y' + CONFIG_LIBVFSCORE_AUTOMOUNT: 'y' CONFIG_LIBVFSCORE_NONLARGEFILE: 'y' CONFIG_LIBVFSCORE: 'y' CONFIG_OPTIMIZE_DEADELIM: 'y' diff --git a/library/base/fallback.c b/library/base/fallback.c new file mode 100644 index 00000000..2679325c --- /dev/null +++ b/library/base/fallback.c @@ -0,0 +1,46 @@ +#include + +int main(int argc, char *argv[]) { + printf( + " .--------------------.\n" + " ( Hello from Unikraft! )\n" + " '--------------------'\n" + " \\\n" + " \\\n" + " _\n" + " c'o'o .--.\n" + " (| |)_/\n" + "\n" + "\n" + "This is the default message when no root filesystem is supplied to this\n" + "'base' image. This 'base' image is a general-purpose unikernel runtime\n" + "and is intended to be used for your application.\n" + "\n" + "To use this 'base' image, place a `Kraftfile` in your application\n" + "repository. For example:\n" + "\n" + "\t```yaml\n" + "\tspec: v0.6\n" + "\truntime: unikraft.org/base:latest\n" + "\trootfs: ./Dockerfile\n" + "\t```\n" + "\n" + "In the above example, you can supply this 'base' image with your own \n" + "root filesystem. This filesystem is defined through the `Dockerfile`.\n" + "Once setup, simply call:\n" + "\n" + "\t```bash\n" + "\tkraft run .\n" + "\t```\n" + "\n" + "For more information, how to get started and examples using this 'base'\n" + "image, please visit:\n" + "\n" + "\thttps://unikraft.org/guides/intro-to-base-image\n" + "\n" + "Happy krafting!\n" + "\n" + ); + + return 0; +} diff --git a/library/lua/5.4/Kraftfile b/library/lua/5.4/Kraftfile index cf43f619..1066a9f9 100644 --- a/library/lua/5.4/Kraftfile +++ b/library/lua/5.4/Kraftfile @@ -7,7 +7,7 @@ rootfs: ./rootfs cmd: ["/helloworld.lua"] unikraft: - version: stable + version: staging kconfig: CONFIG_LIBRAMFS: 'y' CONFIG_LIBUK9P: 'y' @@ -15,9 +15,15 @@ unikraft: CONFIG_LIBUKCPIO: 'y' CONFIG_LIBUKDEBUG_ANSI_COLOR: 'y' CONFIG_LIBUKLIBPARAM: 'y' - CONFIG_LIBVFSCORE_AUTOMOUNT_ROOTFS: 'y' - CONFIG_LIBVFSCORE_FSTAB: 'y' - CONFIG_LIBVFSCORE_ROOTFS_INITRD: 'y' + CONFIG_LIBVFSCORE_AUTOMOUNT_CI_EINITRD: 'y' + CONFIG_LIBVFSCORE_AUTOMOUNT_CI: 'y' + CONFIG_LIBVFSCORE_AUTOMOUNT_FB: 'y' + CONFIG_LIBVFSCORE_AUTOMOUNT_FB0_DEV: "embedded" + CONFIG_LIBVFSCORE_AUTOMOUNT_FB0_DRIVER: "extract" + CONFIG_LIBVFSCORE_AUTOMOUNT_FB0_MP: "/" + CONFIG_LIBVFSCORE_AUTOMOUNT_UP: 'y' + CONFIG_LIBVFSCORE_AUTOMOUNT: 'y' + CONFIG_LIBVFSCORE: 'y' targets: - qemu/x86_64 diff --git a/library/nginx/1.15/Kraftfile b/library/nginx/1.15/Kraftfile index 23064416..b2cdc7b8 100644 --- a/library/nginx/1.15/Kraftfile +++ b/library/nginx/1.15/Kraftfile @@ -30,10 +30,15 @@ unikraft: CONFIG_LIBUKSCHEDCOOP: 'y' CONFIG_LIBUKSIGNAL: 'y' CONFIG_LIBUKTIME: 'y' - CONFIG_LIBVFSCORE_AUTOMOUNT_ROOTFS: 'y' - CONFIG_LIBVFSCORE_FSTAB: 'y' - CONFIG_LIBVFSCORE_ROOTDEV: "fs0" - CONFIG_LIBVFSCORE_ROOTFS_INITRD: 'y' + CONFIG_LIBVFSCORE_AUTOMOUNT_CI_EINITRD: 'y' + CONFIG_LIBVFSCORE_AUTOMOUNT_CI: 'y' + CONFIG_LIBVFSCORE_AUTOMOUNT_FB: 'y' + CONFIG_LIBVFSCORE_AUTOMOUNT_FB0_DEV: "embedded" + CONFIG_LIBVFSCORE_AUTOMOUNT_FB0_DRIVER: "extract" + CONFIG_LIBVFSCORE_AUTOMOUNT_FB0_MP: "/" + CONFIG_LIBVFSCORE_AUTOMOUNT_UP: 'y' + CONFIG_LIBVFSCORE_AUTOMOUNT: 'y' + CONFIG_LIBVFSCORE: 'y' CONFIG_UKSYSINFO: 'y' CONFIG_VIRTIO_PCI: 'y' CONFIG_LIBUKNETDEV_EINFO_LIBPARAM: 'y' diff --git a/library/node/18/Kraftfile b/library/node/18/Kraftfile index 786bceea..bf8058cf 100644 --- a/library/node/18/Kraftfile +++ b/library/node/18/Kraftfile @@ -11,7 +11,6 @@ template: version: staging unikraft: - source: https://github.com/unikraft/unikraft.git version: staging kconfig: # Configurations options for app-elfloader @@ -88,9 +87,10 @@ unikraft: CONFIG_LIBUKVMEM_DEMAND_PAGE_IN_SIZE: 12 CONFIG_LIBUKVMEM_PAGEFAULT_HANDLER_PRIO: 4 CONFIG_LIBUKVMEM: 'y' - CONFIG_LIBVFSCORE_AUTOMOUNT_ROOTFS: 'y' # needed for einitrd - CONFIG_LIBVFSCORE_FSTAB: 'y' - CONFIG_LIBVFSCORE_INITRD_EXTRACT_WORKAROUND: 'y' + CONFIG_LIBVFSCORE_AUTOMOUNT_CI_EINITRD: 'y' + CONFIG_LIBVFSCORE_AUTOMOUNT_CI: 'y' + CONFIG_LIBVFSCORE_AUTOMOUNT_UP: 'y' + CONFIG_LIBVFSCORE_AUTOMOUNT: 'y' CONFIG_LIBVFSCORE_NONLARGEFILE: 'y' CONFIG_LIBVFSCORE_ROOTFS_EINITRD: 'y' CONFIG_LIBVFSCORE: 'y' diff --git a/library/python/3.10/Kraftfile b/library/python/3.10/Kraftfile index 3379876d..243613be 100644 --- a/library/python/3.10/Kraftfile +++ b/library/python/3.10/Kraftfile @@ -26,10 +26,14 @@ unikraft: CONFIG_LIBUKSCHEDCOOP: 'y' CONFIG_LIBUKSIGNAL: 'y' CONFIG_LIBUKTIME: 'y' - CONFIG_LIBVFSCORE_AUTOMOUNT_ROOTFS: 'y' - CONFIG_LIBVFSCORE_FSTAB: 'y' - CONFIG_LIBVFSCORE_ROOTDEV: "fs0" - CONFIG_LIBVFSCORE_ROOTFS_INITRD: 'y' + CONFIG_LIBVFSCORE_AUTOMOUNT_CI_EINITRD: 'y' + CONFIG_LIBVFSCORE_AUTOMOUNT_CI: 'y' + CONFIG_LIBVFSCORE_AUTOMOUNT_FB: 'y' + CONFIG_LIBVFSCORE_AUTOMOUNT_FB0_DEV: "embedded" + CONFIG_LIBVFSCORE_AUTOMOUNT_FB0_DRIVER: "extract" + CONFIG_LIBVFSCORE_AUTOMOUNT_FB0_MP: "/" + CONFIG_LIBVFSCORE_AUTOMOUNT_UP: 'y' + CONFIG_LIBVFSCORE_AUTOMOUNT: 'y' CONFIG_STACK_SIZE_PAGE_ORDER: 10 CONFIG_UKSYSINFO: 'y' CONFIG_VIRTIO_PCI: 'y' diff --git a/library/redis/7.0/Kraftfile b/library/redis/7.0/Kraftfile index 49d39073..6647d211 100644 --- a/library/redis/7.0/Kraftfile +++ b/library/redis/7.0/Kraftfile @@ -24,10 +24,14 @@ unikraft: CONFIG_LIBUKSCHEDCOOP: 'y' CONFIG_LIBUKSIGNAL: 'y' CONFIG_LIBUKTIME: 'y' - CONFIG_LIBVFSCORE_AUTOMOUNT_ROOTFS: 'y' - CONFIG_LIBVFSCORE_FSTAB: 'y' - CONFIG_LIBVFSCORE_ROOTDEV: "fs0" - CONFIG_LIBVFSCORE_ROOTFS_INITRD: 'y' + CONFIG_LIBVFSCORE_AUTOMOUNT_CI_EINITRD: 'y' + CONFIG_LIBVFSCORE_AUTOMOUNT_CI: 'y' + CONFIG_LIBVFSCORE_AUTOMOUNT_FB: 'y' + CONFIG_LIBVFSCORE_AUTOMOUNT_FB0_DEV: "embedded" + CONFIG_LIBVFSCORE_AUTOMOUNT_FB0_DRIVER: "extract" + CONFIG_LIBVFSCORE_AUTOMOUNT_FB0_MP: "/" + CONFIG_LIBVFSCORE_AUTOMOUNT_UP: 'y' + CONFIG_LIBVFSCORE_AUTOMOUNT: 'y' CONFIG_UKSYSINFO: 'y' CONFIG_VIRTIO_PCI: 'y' CONFIG_LIBUKNETDEV_EINFO_LIBPARAM: 'y' diff --git a/library/sqlite/3.40/Kraftfile b/library/sqlite/3.40/Kraftfile index be1f3535..67ac8e96 100644 --- a/library/sqlite/3.40/Kraftfile +++ b/library/sqlite/3.40/Kraftfile @@ -7,7 +7,7 @@ rootfs: ./rootfs cmd: ["/music.db", ".read query.sql"] unikraft: - version: stable + version: staging kconfig: CONFIG_LIBRAMFS: 'y' CONFIG_LIBUK9P: 'y' @@ -17,9 +17,14 @@ unikraft: CONFIG_LIBUKLIBPARAM: 'y' CONFIG_LIBPOSIX_MMAP: 'y' CONFIG_LIBPOSIX_SYSINFO: 'y' - CONFIG_LIBVFSCORE_AUTOMOUNT_ROOTFS: 'y' - CONFIG_LIBVFSCORE_FSTAB: 'y' - CONFIG_LIBVFSCORE_ROOTFS_INITRD: 'y' + CONFIG_LIBVFSCORE_AUTOMOUNT_CI_EINITRD: 'y' + CONFIG_LIBVFSCORE_AUTOMOUNT_CI: 'y' + CONFIG_LIBVFSCORE_AUTOMOUNT_FB: 'y' + CONFIG_LIBVFSCORE_AUTOMOUNT_FB0_DEV: "embedded" + CONFIG_LIBVFSCORE_AUTOMOUNT_FB0_DRIVER: "extract" + CONFIG_LIBVFSCORE_AUTOMOUNT_FB0_MP: "/" + CONFIG_LIBVFSCORE_AUTOMOUNT_UP: 'y' + CONFIG_LIBVFSCORE_AUTOMOUNT: 'y' targets: - qemu/x86_64