diff options
author | Thomas Van Iseghem <[email protected]> | 2023-02-01 17:35:58 +0100 |
---|---|---|
committer | Thomas Van Iseghem <[email protected]> | 2023-02-01 17:35:58 +0100 |
commit | 6aceac7a93a42152789abdc4532d0209d5d7304d (patch) | |
tree | d3d659b153d9bcf9ac4fee58b8ab3e8052e3425f | |
parent | 7dc2868aea601a7aa5c2f096c63af51e8b4ec0af (diff) | |
download | OpenCortex-6aceac7a93a42152789abdc4532d0209d5d7304d.tar.gz OpenCortex-6aceac7a93a42152789abdc4532d0209d5d7304d.zip |
Added docker development environment
-rw-r--r-- | .gitattributes | 2 | ||||
-rw-r--r-- | QC-dev-environment/.gitignore | 6 | ||||
-rw-r--r-- | QC-dev-environment/Dockerfile | 34 | ||||
-rw-r--r-- | QC-dev-environment/REAME.md | 28 | ||||
-rw-r--r-- | QC-dev-environment/filesystems/2.0.0-vanilla.bin.gz | 3 | ||||
-rw-r--r-- | QC-dev-environment/filesystems/README.md | 3 | ||||
-rw-r--r-- | QC-dev-environment/init_system.sh | 19 | ||||
-rw-r--r-- | QC-dev-environment/install_qt_compiled.sh | 6 | ||||
-rw-r--r-- | QC-dev-environment/qt-compiled-4.8.7.tar.gz | 3 |
9 files changed, 94 insertions, 10 deletions
diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..edc7a3f --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +QC-dev-environment/filesystems/2.0.0-vanilla.bin.gz filter=lfs diff=lfs merge=lfs -text +QC-dev-environment/qt-compiled-4.8.7.tar.gz filter=lfs diff=lfs merge=lfs -text diff --git a/QC-dev-environment/.gitignore b/QC-dev-environment/.gitignore index 9ef6d6e..faecd0a 100644 --- a/QC-dev-environment/.gitignore +++ b/QC-dev-environment/.gitignore @@ -1 +1,5 @@ -mount/*
\ No newline at end of file +# ignore everything in the mount folder except the filesystems folder +# and the mount folder itself + +/mount/* +!/mount
\ No newline at end of file diff --git a/QC-dev-environment/Dockerfile b/QC-dev-environment/Dockerfile index cc514ff..f758cc8 100644 --- a/QC-dev-environment/Dockerfile +++ b/QC-dev-environment/Dockerfile @@ -1,32 +1,48 @@ # Use official Ubuntu as our base# Use official Ubuntu as our base -FROM ubuntu:20.04 +FROM ubuntu:18.04 as builder # Add required packages in the noninteractive mode RUN apt-get -y update RUN DEBIAN_FRONTEND=noninteractive apt-get -y -q install curl net-tools build-essential minicom tftpd-hpa git-all subversion openssh-server ncurses-dev php gawk g++ m4 libncurses5-dev texinfo flex bison php-cli vim php-xml python-setuptools python-dev make unzip rsync cpio bc lib32z1 lib32stdc++6 qemu qemu-user-static # Set the workspace in /sc5xx_dev -ARG WORK_PATH=/sc5xx_dev -RUN mkdir -p ${WORK_PATH} +ARG TOOLCHAIN_PATH=/sc5xx_dev +RUN mkdir -p ${TOOLCHAIN_PATH} # Set the path and name of Patch in /sc5xx_dev/linuxaddin-dockerfile/lib -ARG PATCH_PATH=${WORK_PATH}/lib +ARG PATCH_PATH=${TOOLCHAIN_PATH}/lib ARG PATCH=${PATCH_PATH}/0002-port-to-perl-5.22-and-later.patch # Set the Version and Path of cces-linux-add-in. ARG LINUX_ADDIN_VERSION="1.3.1" # Working directory set to /sc5xx_dev -WORKDIR ${WORK_PATH} +WORKDIR ${TOOLCHAIN_PATH} # Copy the install_toolchain.sh to /sc5xx_dev COPY install_toolchain.sh . - -# Install the toolchain -RUN ./install_toolchain.sh ${WORK_PATH} +RUN ./install_toolchain.sh ${TOOLCHAIN_PATH} # # Set toolchain PATH for remote container ENV PATH=${PATH}:/opt/analog/cces-linux-add-in/${LINUX_ADDIN_VERSION}/ARM/arm-linux-gnueabi/bin/ ENV QEMU_LD_PREFIX="/opt/analog/cces-linux-add-in/1.3.1/ARM/arm-linux-gnueabi/sysroot" -ENTRYPOINT ["/bin/bash"]
\ No newline at end of file +# Mounting the QC-rootfs +RUN mkdir /qc-fs +WORKDIR /qc-fs +COPY ./filesystems/2.0.0-vanilla.bin.gz . +# Use gunzip to decompress the QC-rootfs +RUN gunzip -d 2.0.0-vanilla.bin.gz +# The extracted QC-rootfs is a tar file +RUN tar -xvf 2.0.0-vanilla.bin + +RUN mkdir -p /qt_src +WORKDIR /qt_src +# # Copy and run the installer +COPY qt-compiled-4.8.7.tar.gz . +COPY install_qt_compiled.sh . + +WORKDIR / +COPY init_system.sh . + +ENTRYPOINT ["/bin/bash"] diff --git a/QC-dev-environment/REAME.md b/QC-dev-environment/REAME.md new file mode 100644 index 0000000..edbe683 --- /dev/null +++ b/QC-dev-environment/REAME.md @@ -0,0 +1,28 @@ +# A safe development environment + +## Usage + +### Building the container + +Go into the QC-dev-environment directory and run: + +``` +docker build . -t <your-wanted-tag e.g. cortex-dev> +``` + +### Running the container + +It needs to run privileged since we need to run the `mount` command inside it. You can run it without the `--privileged` path if you're not planning to mount the QC's file system and just want to compile something + +``` +docker run --privileged -it -p 5900:5900 -v <absolute-path-to-current-folder>/mount:/mnt cortex-dev +``` + +When attached to the docker container's shell, there is one post-install step left. Run the following command: + +``` +./init_system.sh +``` + +This will mount the QC filesystem and install a custom compiled version of QT inside it that has support for VNC. + diff --git a/QC-dev-environment/filesystems/2.0.0-vanilla.bin.gz b/QC-dev-environment/filesystems/2.0.0-vanilla.bin.gz new file mode 100644 index 0000000..9c7c5ce --- /dev/null +++ b/QC-dev-environment/filesystems/2.0.0-vanilla.bin.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ce0243c17db4f9f5a69c923144ca455c95711548c70a24bd1ce8f06b849c11e5 +size 109101861 diff --git a/QC-dev-environment/filesystems/README.md b/QC-dev-environment/filesystems/README.md new file mode 100644 index 0000000..a03527b --- /dev/null +++ b/QC-dev-environment/filesystems/README.md @@ -0,0 +1,3 @@ +# Update name registry + +**2.0.0:** update-vm44GCkrMujYR8o47OkF8UW.AdVYyu0U
\ No newline at end of file diff --git a/QC-dev-environment/init_system.sh b/QC-dev-environment/init_system.sh new file mode 100644 index 0000000..c6aa3d5 --- /dev/null +++ b/QC-dev-environment/init_system.sh @@ -0,0 +1,19 @@ +#!/bin/bash +echo "Mounting rootfs.ext3" +mount -t ext4 /qc-fs/rootfs.ext3 $QEMU_LD_PREFIX +echo "Mounting rootfs.ext3 finished" + +echo "Installing QT" +cd /qt_src && ./install_qt_compiled.sh +echo "Installing QT finished" + +# Prompt user to chroot into the $QEMU_LD_PREFIX directory +# if the user types "y" or "Y" then chroot into the $QEMU_LD_PREFIX directory +# otherwise exit the script +echo "Do you want to chroot into the created QC-filesystem? (y/n)" +read -n 1 -r +if [[ $REPLY =~ ^[Yy]$ ]] +then + echo "Chrooting into $QEMU_LD_PREFIX" + chroot $QEMU_LD_PREFIX +fi diff --git a/QC-dev-environment/install_qt_compiled.sh b/QC-dev-environment/install_qt_compiled.sh new file mode 100644 index 0000000..ccb3931 --- /dev/null +++ b/QC-dev-environment/install_qt_compiled.sh @@ -0,0 +1,6 @@ +#!/bin/bash +tar -xf qt-compiled-4.8.7.tar.gz +rm qt-compiled-4.8.7.tar.gz +# Then install it +cp -a QtEmbedded-4.8.7-arm/lib/. $QEMU_LD_PREFIX/usr/lib/ +cp -a QtEmbedded-4.8.7-arm/bin/. $QEMU_LD_PREFIX/usr/bin/
\ No newline at end of file diff --git a/QC-dev-environment/qt-compiled-4.8.7.tar.gz b/QC-dev-environment/qt-compiled-4.8.7.tar.gz new file mode 100644 index 0000000..b6c5d9e --- /dev/null +++ b/QC-dev-environment/qt-compiled-4.8.7.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fe15ddfe0556182666237ec6cc767eef3216d59f51529b9d7a62654a4d07dbee +size 29628859 |