Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions python3-bye/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/rootfs/
/9pfs-rootfs/
30 changes: 30 additions & 0 deletions python3-bye/Config.uk
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Configure Python3 application for a build that uses initrd to pass the root
# filesystem.
# Enable initrd / CPIO-related core components and configurations.

config APPBYEPYTHON3
bool "Configure Python3 application with initrd as rootfs"
default y

# Select application library (Python3). Use main function in
# application library. Other libraries, such as Musl or LWIP, are
# selected as dependencies of Python3.
select LIBPYTHON3
select LIBPYTHON3_MAIN_FUNCTION

# Select filesystem core components: vfscore, cpio, ramfs, devfs. For
# each select corresponding features. The other core components are
# selected as dependencies of Python3.
select LIBVFSCORE
select LIBVFSCORE_AUTOMOUNT_UP
select LIBRAMFS
select LIBUKCPIO

# Pass environment variables as command line arguments. This is
# required for passing the `PYTHONPATH` environment variable.
select LIBPOSIX_ENVIRON
select LIBPOSIX_ENVIRON_LIBPARAM

# Add randomness support.
select LIBUKRANDOM
select LIBUKRANDOM_GETRANDOM
7 changes: 7 additions & 0 deletions python3-bye/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM python:3.10.11 AS base

FROM scratch

COPY --from=base /usr/local/lib/python3.10 /usr/local/lib/python3.10

COPY ./hello.py /app/hello.py
13 changes: 13 additions & 0 deletions python3-bye/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
UK_ROOT ?= $(PWD)/../repos/unikraft
UK_BUILD ?= $(PWD)/out
UK_APP ?= $(PWD)
LIBS_BASE = $(PWD)/../repos/libs
UK_LIBS ?= $(LIBS_BASE)/musl:$(LIBS_BASE)/lwip:$(LIBS_BASE)/python3:$(LIBS_BASE)/compiler-rt

.PHONY: all

all:
@$(MAKE) -C $(UK_ROOT) L=$(UK_LIBS) A=$(UK_APP) O=$(UK_BUILD)

$(MAKECMDGOALS):
@$(MAKE) -C $(UK_ROOT) L=$(UK_LIBS) A=$(UK_APP) O=$(UK_BUILD) $(MAKECMDGOALS)
Empty file added python3-bye/Makefile.uk
Empty file.
Loading