[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT/PYTHON3 PATCH 11/12] Makefile.uk: Add rule for creating root filesystem


  • To: minios-devel@xxxxxxxxxxxxx
  • From: Costin Lupu <costin.lupu@xxxxxxxxx>
  • Date: Fri, 13 Sep 2019 15:53:52 +0300
  • Cc: felipe.huici@xxxxxxxxx, vlad_andrei.badoiu@xxxxxxxxxxxxxxx
  • Delivery-date: Fri, 13 Sep 2019 12:54:35 +0000
  • Ironport-phdr: 9a23:3FXf1RWc07r/SBiOLYf7qva+uLzV8LGtZVwlr6E/grcLSJyIuqrYbReEt8tkgFKBZ4jH8fUM07OQ7/m7HzRfqsvc+DBaKdoQDkVD0Z1X1yUbQ+e9QXXhK/DrayFoVO9jb3RCu0+BDE5OBczlbEfTqHDhpRQbGxH4KBYnbr+tQt2agMu4zf299IPOaAtUmjW9falyLBKrpgnNq8Uam4RvJrs/xxfTvndFeetayGNoKFmOmxrw+tq88IRs/ihNpf4t7dJMXbn/c68lUbFWETMqPnwv6sb2rxfDVwyP5nUdUmUSjBVFBhXO4Q/5UJnsrCb0r/Jx1yaGM8L4S7A0Qimi4LxwSBD0kicHNiU2/3/Rh8dtka9UuhOhpxh4w47JfIGYMed1c63Bcd8GQ2dKQ8BcXDFDDIyhdYsCF+oPM/hFoYfzpFUAqhmxBQe3Ce/z1jNFnGP60Lcm3+g9FwzNwQwuH8gJsHTRtNj4KqASUfupzKnJyzXIcvVY2Srl6IjVbxsspu2DXbVrccrNyEkvERnJjlGNqYz9IjOYzfgCs3OB4+p4SOKgkHQrqxt2ojW2wMonl4rHhpoNx1zZ+ih13Zw5KN64RUJhf9KoDplduzuUOoduX88vTHxktDw5x7AGo5K3YiYHxZo9yxLCZPGLbY6F6Q/5WumLOzd3nndldaq6hxa17Eev1PXxVtKx0FZWtipFlcTMtmwV2xzT9MeHTvx981+/2TaKzQ/T6+VELVoomqrAMZIh2qMwmYEJvUTZGS/6gET2jKmIeUU44uWk9uvqbqj8qpKfN4J4kB/yProsl8ClD+k0Kg0OUHKa+eS42r3j50r5QLBSg/IqlanZq4zaJcUdpqKjBw9Vz54j6wukAji6y9QUh2EHLE9edx6dlYjpPEnCIOrkAvenn1SsjDBryujDPr3gBJXNL3/DkKz4cblg9UFc1hQ8zdRE6pJQC7EBO+7zWlTruN3XEBA5NRa4w+H9CNVyzokeQ36AAreFMKPOtl+F/uwvLPeIZI8UoDbyNeIp5/7zjX84hVAdfLKk3Z0JZ3+kGvRpOV6WbWDyjdccCW0KpBYxTPT2iF2eVj5ef2iyX6Ym6T4mEI2pF4HDSZ23gLOf3Se3BIZZaXpbBVCLEHfoap6JW+wQaCKPP8BtiCYLWqS6S4M7yBGurBT1x6B9LurTqWUkssfm1d504PaWmRws+DhcC8WGz3rLX2xy2GQSSGwYxqd69Gd60UuC1+BcnuRFXYhY4OhVUwF8MYPE0sRxEJbqRwiHZNDfGwXuecmvHTxkFoF5+NQJeUsoQ9g=
  • Ironport-sdr: vCeVADOeXRg8OhJK/SxjGx5pNFJnEiaEeSdnHwTO2UcqD3PxvBaLBS+p6qyj/8V1toZlHxilbl DqJ6EYJWmEcw==
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>

The Python interpreter needs a filesystem where to keep its libraries. This
patch creates a Python virtual environment and installs the Python 3 standard
library in /lib/python3.7 directory. For creating the filesystem the following
command has to be run:

$ make python-rootfs path=<directory>

Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
---
 Makefile.uk | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/Makefile.uk b/Makefile.uk
index 8fbc37c..27eaba5 100644
--- a/Makefile.uk
+++ b/Makefile.uk
@@ -450,3 +450,24 @@ LIBPYTHON3_PREPARED_DEPS = \
 $(LIBPYTHON3_BUILD)/.prepared: $(LIBPYTHON3_PREPARED_DEPS)
 
 UK_PREPARE += $(LIBPYTHON3_BUILD)/.prepared
+
+################################################################################
+# Root filesystem
+################################################################################
+
+# Build root filesystem for Python interpreter
+PYTHON_ROOTFS = $(APP_BASE)/$(path)
+
+# Create virtual environment
+$(PYTHON_ROOTFS)/.keep:
+       python3 -m venv $(PYTHON_ROOTFS) && touch $@
+
+# Configure origin
+$(LIBPYTHON3_SRC)/config.status:
+       cd $(LIBPYTHON3_SRC) && ./configure --prefix=$(shell realpath 
$(APP_BASE)/$(path))
+
+# Install Python standard library into virtual environment
+.PHONY: python-rootfs
+python-rootfs: $(PYTHON_ROOTFS)/.keep $(LIBPYTHON3_SRC)/config.status
+       cd $(LIBPYTHON3_SRC) && make libinstall
+       cp $(LIBPYTHON3_BASE)/_sysconfigdata.py $(PYTHON_ROOTFS)/lib/python3.7/
-- 
2.20.1


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.