reverting back to mono container...

develop
penguin 3 months ago
parent 048b5e0e3f
commit 96f9bbd904

@ -1,34 +1,50 @@
FROM ubuntu:22.04
RUN useradd -r -s /sbin/nologin -c "Microchip tools" -m libby
USER root
ENV LIBERO_VERSION="v2024.1"
ENV SOFTCONSOLE_VERSION="v2022.2-RISC-V-747"
ENV MICROCHIP_TOOLS_DIR="/opt/microchip"
ENV LIBERO_DIR="${MICROCHIP_TOOLS_DIR}/Libero_SoC_${LIBERO_VERSION}"
ENV SC_INSTALL_DIR="${MICROCHIP_TOOLS_DIR}/SoftConsole-${SOFTCONSOLE_VERSION}"
ENV LIBERO_LOG_DIR="${LIBERO_DIR}/Logs"
ENV FPGENPROG="${LIBERO_DIR}/Libero/bin64/fpgenprog"
ENV BASE_DIR="/opt/microchip"
ARG DEBIAN_FRONTEND=noninteractive
ENV XDG_RUNTIME_DIR="/tmp/.xdg/${UID}"
ENV LIBERO_VERSION="v2024.1"
ENV SOFTCONSOLE_VERSION="v2022.2-RISC-V-747"
# install dirs
ENV BASE_DIR="/opt/microchip"
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 FPGENPROG="${LIBERO_DIR}/Libero/bin64/fpgenprog"
# prepare the install dirs
RUN mkdir -p ${MICROCHIP_TOOLS_DIR}/common
RUN mkdir -p ${MICROCHIP_TOOLS_DIR}/installers
RUN mkdir -p ${MICROCHIP_TOOLS_DIR}/scripts
RUN echo "Installer daemons to ${BIN_DIR}..."
RUN mkdir -p ${LICENSE_DIR}
RUN mkdir -p ${INSTALLERS_DIR}
RUN mkdir -p ${SCRIPTS_DIR}
RUN mkdir -p ${LOG_DIR}
RUN chown -R libby:libby ${BASE_DIR}
RUN mkdir -p $XDG_RUNTIME_DIR
ARG DEBIAN_FRONTEND=noninteractive
RUN dpkg --add-architecture i386 && \
apt-get update -y && \
apt-get upgrade -y && \
apt-get install -y libxext6 libx11-6 libxrender1 libxtst6 libxi6 lsb default-jre build-essential
ADD scripts/* ${MICROCHIP_TOOLS_DIR}/scripts/
ADD scripts/* ${BASE_DIR}/scripts/
# run installer in silent mode using config file
RUN echo "Installing Libero... This could take a bit"
RUN ${MICROCHIP_TOOLS_DIR}/installers/Libero_SoC_${LIBERO_VERSION}*.bin -i silent -f ${MICROCHIP_TOOLS_DIR}/installers/installer.cfg
RUN ${BASE_DIR}/installers/Libero_SoC_${LIBERO_VERSION}*.bin -i silent -f ${BASE_DIR}/installers/installer.cfg
# RUN echo "Installing SoftConsole... This could take a bit"
# RUN ${MICROCHIP_TOOLS_DIR}/installers/Microchip-SoftConsole-${SOFTCONSOLE_VERSION}-linux-x64-installer.run \
# RUN ${BASE_DIR}/installers/Microchip-SoftConsole-${SOFTCONSOLE_VERSION}-linux-x64-installer.run \
# --mode unattended --unattendedmodeui minimal --installrenodesources "Yes, I accept Renode's MIT license." \
# --prefix ${SC_INSTALL_DIR}
@ -61,6 +77,10 @@ RUN apt-get install -y xfonts-100dpi xfonts-75dpi xfonts-base \
xfonts-intl-japanese xfonts-intl-japanese-big xkb-data ksh libxft2:i386
RUN bash -c "echo \". ${MICROCHIP_TOOLS_DIR}/scripts/env\"" >> /root/.profile
USER libby
ADD ./scripts/* ${SCRIPTS_DIR}/
RUN bash -c "echo \". ${SCRIPTS_DIR}/env\"" >> $HOME/.bashrc
CMD ["/bin/bash", "-l", "-c"]
ENTRYPOINT ["/bin/bash", "-l", "-c"]

@ -0,0 +1,28 @@
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
C_GREEN= \033[0;32m
C_END= \033[0m
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
# 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}
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

@ -1,37 +0,0 @@
FROM ubuntu:22.04
RUN useradd -r -s /sbin/nologin -c "Microchip daemon runner" -m libby
USER root
ENV BASE_DIR="/opt/microchip"
ENV BIN_DIR="${BASE_DIR}/bin"
ENV INSTALLERS_DIR="${BASE_DIR}/installers"
ENV LICENSE_DIR="${BASE_DIR}/licenses"
ENV LOG_DIR="${BASE_DIR}/logs"
ENV SCRIPTS_DIR="${BASE_DIR}/scripts"
ARG DEBIAN_FRONTEND=noninteractive
RUN dpkg --add-architecture i386 && \
apt-get update -y && \
apt-get upgrade -y && \
apt-get install -y build-essential lsb-core
RUN echo "Installer daemons to ${BIN_DIR}..."
RUN mkdir -p ${LICENSE_DIR}
RUN mkdir -p ${INSTALLERS_DIR}
RUN mkdir -p ${BIN_DIR}
RUN mkdir -p ${SCRIPTS_DIR}
RUN mkdir -p ${LOG_DIR}
RUN chown -R libby:libby ${BASE_DIR}
USER libby
ADD ./scripts/* ${SCRIPTS_DIR}/
RUN tar -xvf "${INSTALLERS_DIR}/Linux_Licensing_Daemon.tar.Z" -C "${INSTALLERS_DIR}"
RUN mv ${INSTALLERS_DIR}/Linux_Licensing_Daemon/* "${BIN_DIR}/"
RUN bash -c "echo \". ${SCRIPTS_DIR}/env\"" >> $HOME/.bashrc
CMD ["/bin/bash", "-l", "-c"]
ENTRYPOINT ["/bin/bash", "-l", "-c"]

@ -1,14 +0,0 @@
LIBERO_LICENSER_IMAGE = libero_licenser
MICROCHIP_TOOLS_POD = microchip_tools_pod
MICROCHIP_TOOLS_NETWORK = microchip_tools_network
LIBERO_LICENSER_CONTAINER ::= localhost/$(LIBERO_LICENSER_IMAGE):latest
build:
podman build . -t libero_licenser --volume="${PWD}/../installers:/opt/microchip/installers"
start:
podman run -it --rm -h libero-licenser --name libero_licenser --network ${MICROCHIP_TOOLS_NETWORK} \
--volume="/etc/localtime:/etc/localtime" --volume="${PWD}/../licenses:/opt/microchip/licenses" \
--mac-address ${LIBERO_LICENSE_MAC} \
${LIBERO_LICENSER_CONTAINER} /opt/microchip/scripts/entrypoint

@ -1,2 +0,0 @@
#!/usr/bin/env bash
"${BIN_DIR}/lmgrd" -z -c "${LICENSE_DIR}/License.dat"

@ -1,12 +0,0 @@
#!/usr/bin/env bash
export BASE_DIR="/opt/microchip"
export BIN_DIR="${BASE_DIR}/bin"
export INSTALLERS_DIR="${BASE_DIR}/installers"
export LICENSE_DIR="${BASE_DIR}/licenses"
export LOG_DIR="${BASE_DIR}/logs"
export SCRIPTS_DIR="${BASE_DIR}/scripts"
export LM_LICENSE_FILE="1702@libero-licenser"
export SNPSLMD_LICENSE_FILE="1702@libero-licenser"
export PATH="${BIN_DIR}:${PATH}"

@ -1,34 +0,0 @@
LIBERO_IMAGE := "libero"
MICROCHIP_TOOLS_NETWORK := "microchip_tools_network"
MICROCHIP_TOOLS_POD := "microchip_tools_pod"
LIBERO_CONTAINER ::= "localhost/$(LIBERO_IMAGE):latest"
LIBERO_CONTAINER_HOSTNAME = $(LIBERO_IMAGE)
C_RED= \033[0;31m
C_YELLOW= \033[0;33m
C_GREEN= \033[0;32m
C_END= \033[0m
all: container
build:
podman build . -t $(LIBERO_IMAGE) --volume="${PWD}/../installers:/opt/microchip/installers"
# launch a bash shell in the libero container
debug:
podman run --rm -it --volume="/etc/localtime:/etc/localtime" --network $(MICROCHIP_TOOLS_NETWORK) \
--mac-address ${LIBERO_LICENSE_MAC} -v "${XAUTHORITY}:${XAUTHORITY}:ro" -v /tmp/.X11-unix:/tmp/.X11-unix:ro \
-e "DISPLAY" --security-opt label=type:container_runtime_t ${LIBERO_CONTAINER}
# run libero
run:
podman run -it --volume="/etc/localtime:/etc/localtime" --network $(MICROCHIP_TOOLS_NETWORK) \
--mac-address ${LIBERO_LICENSE_MAC} -v "${XAUTHORITY}:${XAUTHORITY}:ro" -v /tmp/.X11-unix:/tmp/.X11-unix:ro \
-e "DISPLAY" --security-opt label=type:container_runtime_t ${LIBERO_CONTAINER} libero
network:
@podman network create $(MICROCHIP_TOOLS_NETWORK) >/dev/null 2>&1 \
&& printf "${C_GREEN}Created podman network: ${MICROCHIP_TOOLS_NETWORK}${C_END}\n" \
|| printf "${C_YELLOW}network \"${MICROCHIP_TOOLS_NETWORK}\" already exists${C_END}\n"
# end

@ -1,14 +0,0 @@
#!/usr/bin/env bash
export LIBERO_VERSION="v2024.1"
export SOFTCONSOLE_VERSION="v2022.2-RISC-V-747"
export MICROCHIP_TOOLS_DIR="/opt/microchip"
export LIBERO_DIR="${MICROCHIP_TOOLS_DIR}/Libero_SoC_${LIBERO_VERSION}"
export SC_INSTALL_DIR="${MICROCHIP_TOOLS_DIR}/SoftConsole-${SOFTCONSOLE_VERSION}"
export LIBERO_LICENSE_DIR="${LIBERO_DIR}/license"
export LIBERO_LOG_DIR="${LIBERO_DIR}/Logs"
export LM_LICENSE_FILE="1702@LPOD"
export SNPSLMD_LICENSE_FILE="1702@LPOD"
export PATH="${PATH}:${LIBERO_DIR}/Libero/bin64"
export PATH="${PATH}:${SC_INSTALL_DIR}/python3/bin:${SC_INSTALL_DIR}"
export FPGENPROG="${LIBERO_DIR}/Libero/bin64/fpgenprog"

@ -0,0 +1,24 @@
#!/usr/bin/env bash
__hostname=$(hostname)
# versions
export LIBERO_VERSION="v2024.1"
export SOFTCONSOLE_VERSION="v2022.2-RISC-V-747"
# install dirs
export BASE_DIR="/opt/microchip"
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 FPGENPROG="${LIBERO_DIR}/Libero/bin64/fpgenprog"
# license vars
export LM_LICENSE_FILE="1702@gpenguin"
export SNPSLMD_LICENSE_FILE="1702@gpenguin"
# paths
export PATH="${PATH}:${LIBERO_DIR}/Libero/bin64"
export PATH="${PATH}:${SC_INSTALL_DIR}/python3/bin:${SC_INSTALL_DIR}"
Loading…
Cancel
Save