fix: Folder structure (#379)

* Moved to src

* Moved to src

* Moved to src

* Moved to src

* Moved to src

* Moved to src

* Moved to src

* Moved to src

* Moved to src

* Moved to src

* Moved to src

* Moved to src

* fix: Check entrypoint

* Moved to src

* Moved to src

* fix: Relative paths

* fix: Relative paths

* fix: Shellcheck

* fix: Relative paths

* Test shellcheck

* Test shellcheck
This commit is contained in:
Kroese 2023-11-15 20:54:51 +01:00 committed by GitHub
parent 0cd1ddf0a1
commit a024294e19
14 changed files with 14 additions and 13 deletions

View File

@ -11,4 +11,4 @@ jobs:
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
env:
SHELLCHECK_OPTS: -x -e SC2001 -e SC2002 -e SC2223 -e SC2034 -e SC2064 -e SC2317 -e SC2028 -e SC2153 -e SC2004
SHELLCHECK_OPTS: -x --source-path=src -e SC2001 -e SC2002 -e SC2223 -e SC2034 -e SC2064 -e SC2317 -e SC2028 -e SC2153 -e SC2004

View File

@ -33,9 +33,8 @@ RUN apt-get update && apt-get -y upgrade && \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY run/*.sh /run/
COPY src/*.sh /run/
COPY --from=builder /qemu-host.bin /run/host.bin
RUN chmod +x /run/*.sh && chmod +x /run/*.bin
VOLUME /storage
@ -66,4 +65,4 @@ LABEL org.opencontainers.image.description="Virtual DSM in a docker container"
HEALTHCHECK --interval=60s --retries=2 CMD /run/check.sh
ENTRYPOINT ["/usr/bin/tini", "-s", "/run/run.sh"]
ENTRYPOINT ["/usr/bin/tini", "-s", "/run/entry.sh"]

View File

@ -4,14 +4,16 @@ set -Eeuo pipefail
echo " Starting Virtual DSM for Docker v${VERSION}..."
echo " For support visit https://github.com/vdsm/virtual-dsm/"
. /run/reset.sh # Initialize system
. /run/install.sh # Run installation
. /run/disk.sh # Initialize disks
. /run/network.sh # Initialize network
. /run/gpu.sh # Initialize graphics
. /run/serial.sh # Initialize serialport
. /run/power.sh # Configure shutdown
. /run/config.sh # Configure arguments
cd /run
. reset.sh # Initialize system
. install.sh # Run installation
. disk.sh # Initialize disks
. network.sh # Initialize network
. gpu.sh # Initialize graphics
. serial.sh # Initialize serialport
. power.sh # Configure shutdown
. config.sh # Configure arguments
trap - ERR

View File

@ -5,7 +5,7 @@ info () { echo -e "\E[1;34m \E[1;36m$1\E[0m" ; }
error () { echo -e >&2 "\E[1;31m ERROR: $1\E[0m" ; }
trap 'error "Status $? while: ${BASH_COMMAND} (line $LINENO/$BASH_LINENO)"' ERR
[ ! -f "/run/run.sh" ] && error "Script must run inside Docker container!" && exit 11
[ ! -f "/run/entry.sh" ] && error "Script must run inside Docker container!" && exit 11
[ "$(id -u)" -ne "0" ] && error "Script must be executed with root privileges." && exit 12
# Docker environment variables