From 1a491fa0108db6e4ea81e5384e8018ae02ae0909 Mon Sep 17 00:00:00 2001 From: penguin Date: Mon, 23 Sep 2024 22:10:07 -0500 Subject: [PATCH] libero container + licenser working --- Dockerfile | 4 ++-- Makefile | 27 ++++++++++++++------------- README.org | 3 ++- licenses/README.org | 1 + scripts/entrypoint | 2 +- scripts/env | 4 ++-- 6 files changed, 22 insertions(+), 19 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1b83970..e59963f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,8 +18,8 @@ ENV INSTALLERS_DIR="${BASE_DIR}/installers" ENV SCRIPTS_DIR="${BASE_DIR}/scripts" ENV LIBERO_DIR="${BASE_DIR}/Libero_SoC_${LIBERO_VERSION}" ENV SC_DIR="${BASE_DIR}/SoftConsole-${SOFTCONSOLE_VERSION}" -ENV LICENSE_DIR="${LIBERO_DIR}/license" -ENV LOG_DIR="${LIBERO_DIR}/Logs" +ENV LICENSE_DIR="${BASE_DIR}/licenses" +ENV LOG_DIR="${BASE_DIR}/logs" ENV FPGENPROG="${LIBERO_DIR}/Libero/bin64/fpgenprog" # prepare the install dirs diff --git a/Makefile b/Makefile index f76ccd5..877c743 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ -LIBERO_IMAGE := "libero" -MICROCHIP_TOOLS_NETWORK := "microchip_tools_network" -MICROCHIP_TOOLS_POD := "microchip_tools_pod" -LIBERO_CONTAINER ::= "localhost/$(LIBERO_IMAGE):latest" +LIBERO_IMAGE := libero +MICROCHIP_TOOLS_NETWORK := microchip_tools_network +MICROCHIP_TOOLS_POD := microchip_tools_pod +LIBERO_CONTAINER ::= localhost/$(LIBERO_IMAGE):latest C_RED= \033[0;31m C_YELLOW= \033[0;33m @@ -12,17 +12,18 @@ build: podman build . -t libero --volume="${PWD}/installers:/opt/microchip/installers" daemon: - podman run -dt --rm --replace --name libero \ - --volume="/etc/localtime:/etc/localtime" --volume="${PWD}/licenses:/opt/microchip/licenses" \ - ${LIBERO_LICENSER_CONTAINER} /opt/microchip/scripts/entrypoint + podman run -dt --replace --name libero \ + --net host \ + -v "/etc/localtime:/etc/localtime" \ + -v "${PWD}/licenses:/opt/microchip/licenses" \ + -v "${XAUTHORITY}:/home/libby/.Xauthority:ro" \ + -v "/tmp/.X11-unix:/tmp/.X11-unix:ro" \ + -e "DISPLAY" --security-opt label=type:container_runtime_t \ + ${LIBERO_CONTAINER} /opt/microchip/scripts/entrypoint # launch a bash shell in the libero container debug: - podman exec -it --volume="/etc/localtime:/etc/localtime" \ - -v "${XAUTHORITY}:${XAUTHORITY}:ro" -v /tmp/.X11-unix:/tmp/.X11-unix:ro \ - -e "DISPLAY" --security-opt label=type:container_runtime_t ${LIBERO_CONTAINER} + podman exec -it -e "DISPLAY" libero bash run: - podman exec -it --volume="/etc/localtime:/etc/localtime" \ - -v "${XAUTHORITY}:${XAUTHORITY}:ro" -v /tmp/.X11-unix:/tmp/.X11-unix:ro \ - -e "DISPLAY" --security-opt label=type:container_runtime_t ${LIBERO_CONTAINER} libero + podman exec -it ${LIBERO_CONTAINER} libero diff --git a/README.org b/README.org index e8b4b2b..7f8c03a 100644 --- a/README.org +++ b/README.org @@ -16,7 +16,8 @@ unzip Libero_soc_*.*_web_lin.zip cd .. #+end_src -* TODO Request a License from Microchip +* [[https://docs.beagleboard.org/latest/boards/beaglev/fire/demos-and-tutorials/mchp-fpga-tools-installation-guide.html#request-a-libero-silver-license][Request a License from Microchip]] + * Install the license #+begin_src bash mv /path/to/License.dat ./licenses/. diff --git a/licenses/README.org b/licenses/README.org index e69de29..6240e5a 100644 --- a/licenses/README.org +++ b/licenses/README.org @@ -0,0 +1 @@ +Put your licenses here. diff --git a/scripts/entrypoint b/scripts/entrypoint index 373c6e7..0238720 100755 --- a/scripts/entrypoint +++ b/scripts/entrypoint @@ -1,4 +1,4 @@ #!/usr/bin/env bash . /opt/microchip/scripts/env -${LIBERO_DIR}/Libero/bin64/lmgrd -z -c ${LIBERO_LICENSE_DIR}/License.dat -l ${LIBERO_LOG_DIR}/license.log +${LIBERO_DIR}/Libero/bin64/lmgrd -z -c ${LICENSE_DIR}/License.dat -l ${LOG_DIR}/licenser.log diff --git a/scripts/env b/scripts/env index dae8159..6bdd0f6 100644 --- a/scripts/env +++ b/scripts/env @@ -11,8 +11,8 @@ export INSTALLERS_DIR="${BASE_DIR}/installers" export SCRIPTS_DIR="${BASE_DIR}/scripts" export LIBERO_DIR="${BASE_DIR}/Libero_SoC_${LIBERO_VERSION}" export SC_DIR="${BASE_DIR}/SoftConsole-${SOFTCONSOLE_VERSION}" -export LICENSE_DIR="${LIBERO_DIR}/license" -export LOG_DIR="${LIBERO_DIR}/Logs" +export LICENSE_DIR="${BASE_DIR}/licenses" +export LOG_DIR="${BASE_DIR}/logs" export FPGENPROG="${LIBERO_DIR}/Libero/bin64/fpgenprog" # license vars