Skip to content

Commit

Permalink
chore(library): Include latest fstab vfs automount features (#37)
Browse files Browse the repository at this point in the history
Reviewed-by: Razvan Deaconescu <[email protected]>
Approved-by: Razvan Deaconescu <[email protected]>
  • Loading branch information
nderjung authored Jan 18, 2024
2 parents 3213e52 + f236c8f commit 0572409
Show file tree
Hide file tree
Showing 9 changed files with 126 additions and 27 deletions.
20 changes: 20 additions & 0 deletions library/base/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
15 changes: 12 additions & 3 deletions library/base/Kraftfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand Down
46 changes: 46 additions & 0 deletions library/base/fallback.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#include <stdio.h>

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;
}
14 changes: 10 additions & 4 deletions library/lua/5.4/Kraftfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,23 @@ rootfs: ./rootfs
cmd: ["/helloworld.lua"]

unikraft:
version: stable
version: staging
kconfig:
CONFIG_LIBRAMFS: 'y'
CONFIG_LIBUK9P: 'y'
CONFIG_LIBUKBUS: 'y'
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
Expand Down
13 changes: 9 additions & 4 deletions library/nginx/1.15/Kraftfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
8 changes: 4 additions & 4 deletions library/node/18/Kraftfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ template:
version: staging

unikraft:
source: https://github.com/unikraft/unikraft.git
version: staging
kconfig:
# Configurations options for app-elfloader
Expand Down Expand Up @@ -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'
Expand Down
12 changes: 8 additions & 4 deletions library/python/3.10/Kraftfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
12 changes: 8 additions & 4 deletions library/redis/7.0/Kraftfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
13 changes: 9 additions & 4 deletions library/sqlite/3.40/Kraftfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ rootfs: ./rootfs
cmd: ["/music.db", ".read query.sql"]

unikraft:
version: stable
version: staging
kconfig:
CONFIG_LIBRAMFS: 'y'
CONFIG_LIBUK9P: 'y'
Expand All @@ -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
Expand Down

0 comments on commit 0572409

Please sign in to comment.