diff options
17 files changed, 152 insertions, 93 deletions
diff --git a/QC-dev-environment/.gitignore b/CorOS-dev-environment/.gitignore index b631c5c..b631c5c 100644 --- a/QC-dev-environment/.gitignore +++ b/CorOS-dev-environment/.gitignore diff --git a/QC-dev-environment/Dockerfile b/CorOS-dev-environment/CorOS-build-env/Dockerfile index e6da7c5..9ddd439 100644 --- a/QC-dev-environment/Dockerfile +++ b/CorOS-dev-environment/CorOS-build-env/Dockerfile @@ -1,9 +1,8 @@ # Use official Ubuntu as our base# Use official Ubuntu as our base -FROM ubuntu:18.04 as builder +FROM opencortex/coros-emu:latest # Add required packages in the noninteractive mode -RUN apt-get -y update -RUN DEBIAN_FRONTEND=noninteractive apt-get -y -q install curl dos2unix 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 +RUN apt-get -y update && 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 # Set the workspace in /sc5xx_dev ARG TOOLCHAIN_PATH=/sc5xx_dev @@ -21,26 +20,12 @@ WORKDIR ${TOOLCHAIN_PATH} # Copy the install_toolchain.sh to /sc5xx_dev COPY install_toolchain.sh . -RUN dos2unix install_toolchain.sh -RUN chmod +x install_toolchain.sh -RUN ./install_toolchain.sh ${TOOLCHAIN_PATH} +RUN dos2unix install_toolchain.sh && chmod +x install_toolchain.sh && ./install_toolchain.sh ${TOOLCHAIN_PATH} -# # Set toolchain PATH for remote container +# 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" -# Mounting the QC-rootfs -RUN mkdir /qc-fs -RUN mkdir /qc-fs-uncompressed - -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 . -COPY update-builder.sh . ENTRYPOINT ["/bin/bash"] diff --git a/QC-dev-environment/docker-compose.yaml b/CorOS-dev-environment/CorOS-build-env/docker-compose.yaml index 44f870e..6abd5da 100644 --- a/QC-dev-environment/docker-compose.yaml +++ b/CorOS-dev-environment/CorOS-build-env/docker-compose.yaml @@ -1,17 +1,17 @@ # Docker compose file for easy volume mounting and running of the container services: - cortex-dev: - image: cortex-dev:latest + coros-dev: + image: opencortex/coros-dev:latest build: - context: . - dockerfile: Dockerfile + context: ../ + dockerfile: CorOS-build-env/Dockerfile tags: - - cortex-dev:latest + - opencortex/coros-dev:latest volumes: - - ./filesystems:/qc-fs - - ./mount:/mnt + - ../filesystems:/qc-fs + - ../mount:/mnt environment: # Edit this to your needs. This should be just the file name, not the path. diff --git a/CorOS-dev-environment/CorOS-emulation/Dockerfile b/CorOS-dev-environment/CorOS-emulation/Dockerfile new file mode 100644 index 0000000..1f24b79 --- /dev/null +++ b/CorOS-dev-environment/CorOS-emulation/Dockerfile @@ -0,0 +1,22 @@ +# Slim Debian image with QEMU and dos2unix +FROM debian:buster-slim + +# Add required packages in the noninteractive mode +RUN apt-get -y update && apt-get -y -q install dos2unix qemu qemu-user-static + +# # Set toolchain PATH for remote container +RUN mkdir -p /opt/ARM/sysroot +ENV QEMU_LD_PREFIX="/opt/ARM/sysroot" + +# Mounting the QC-rootfs +RUN mkdir qc-fs qc-fs-uncompressed qt_src + +WORKDIR /qt_src +# # Copy and run the installer +COPY qt-compiled-4.8.7.tar.gz install_qt_compiled.sh . + +WORKDIR / +COPY init_system.sh update-builder.sh . +RUN dos2unix init_system.sh update-builder.sh /qt_src/install_qt_compiled.sh + +ENTRYPOINT ["/bin/bash"] diff --git a/CorOS-dev-environment/CorOS-emulation/docker-compose.yaml b/CorOS-dev-environment/CorOS-emulation/docker-compose.yaml new file mode 100644 index 0000000..f83534c --- /dev/null +++ b/CorOS-dev-environment/CorOS-emulation/docker-compose.yaml @@ -0,0 +1,21 @@ +# Docker compose file for easy volume mounting and running of the container + +services: + coros-emu: + image: opencortex/coros-emu:latest + build: + context: ../ + dockerfile: CorOS-emulation/Dockerfile + tags: + - opencortex/coros-emu:latest + + volumes: + - ../filesystems:/qc-fs + - ../mount:/mnt + + environment: + # Edit this to your needs. This should be just the file name, not the path. + - UPDATE_FILE=verify.bin.gz + + privileged: true + entrypoint: /bin/bash -c "while true; do sleep 1; done"
\ No newline at end of file diff --git a/QC-dev-environment/README.md b/CorOS-dev-environment/README.md index b236306..b236306 100644 --- a/QC-dev-environment/README.md +++ b/CorOS-dev-environment/README.md diff --git a/QC-dev-environment/filesystems/README.md b/CorOS-dev-environment/filesystems/README.md index fc4da30..fc4da30 100644 --- a/QC-dev-environment/filesystems/README.md +++ b/CorOS-dev-environment/filesystems/README.md diff --git a/CorOS-dev-environment/init_system.sh b/CorOS-dev-environment/init_system.sh new file mode 100644 index 0000000..5009cfa --- /dev/null +++ b/CorOS-dev-environment/init_system.sh @@ -0,0 +1,56 @@ +#!/bin/bash +BLUE='\033[0;34m' +YELLOW='\033[1;33m' +NC='\033[0m' # No Color + +# echo the ascii art banner +echo -e "${YELLOW}" +echo " ____ ______ __ " +echo " / __ \____ ___ ____ / ____/___ _____/ /____ _ __ " +echo " / / / / __ \/ _ \/ __ \/ / / __ \/ ___/ __/ _ \| |/_/ " +echo " / /_/ / /_/ / __/ / / / /___/ /_/ / / / /_/ __/> < " +echo " \____/ .___/\___/_/ /_/\____/\____/_/ \__/\___/_/|_| " +echo " /_/ CorOS emulation environment " +echo -e "${NC}" + +echo -e "${BLUE}========= Initializing CorOS emulation environment =========${NC}" + +echo "" +echo -e "${YELLOW}[!]${NC} Mounting the QC-filesystem, this can take a couple of seconds..." +# Decompress archive and mount rootfs.ext3 +gunzip -d -k /qc-fs/$UPDATE_FILE +# Run tar command on the decompressed file to extract the rootfs.ext3 file +# We need to remove the .gz extension from the file name +tar -xvf /qc-fs/${UPDATE_FILE::-3} -C /qc-fs-uncompressed +rm /qc-fs/${UPDATE_FILE::-3} + +echo "Mounting rootfs.ext3" +mount -t ext4 /qc-fs-uncompressed/rootfs.ext3 $QEMU_LD_PREFIX +echo -e "${YELLOW}Mounting rootfs.ext3 finished!${NC}" +echo "" + +# Promt the user to install custom QT +# if the user types "y" or "Y" then install custom QT +read -p "Do you want to install the custom compiled QT? (y/n) " -r + +if [[ $REPLY =~ ^[Yy]$ ]] +then + echo -e "${YELLOW}[!]${NC} Installing QT" + cd /qt_src && ./install_qt_compiled.sh + echo -e "${YELLOW}Installing QT finished${NC}" +fi +echo "" + +# 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 +read -p "Do you want to chroot into the created QC-filesystem? (y/n) " -r + +if [[ $REPLY =~ ^[Yy]$ ]] +then + echo "" + echo "[->] Chrooting into $QEMU_LD_PREFIX" + echo $(uname -a) + echo "" + chroot $QEMU_LD_PREFIX +fi diff --git a/QC-dev-environment/install_qt_compiled.sh b/CorOS-dev-environment/install_qt_compiled.sh index 2094de0..2094de0 100644 --- a/QC-dev-environment/install_qt_compiled.sh +++ b/CorOS-dev-environment/install_qt_compiled.sh diff --git a/QC-dev-environment/install_qt_src.sh b/CorOS-dev-environment/install_qt_src.sh index 66a381b..66a381b 100644 --- a/QC-dev-environment/install_qt_src.sh +++ b/CorOS-dev-environment/install_qt_src.sh diff --git a/QC-dev-environment/install_toolchain(broken).sh b/CorOS-dev-environment/install_toolchain(broken).sh index c3b05fa..c3b05fa 100644 --- a/QC-dev-environment/install_toolchain(broken).sh +++ b/CorOS-dev-environment/install_toolchain(broken).sh diff --git a/QC-dev-environment/install_toolchain.sh b/CorOS-dev-environment/install_toolchain.sh index d4a5465..d4a5465 100644 --- a/QC-dev-environment/install_toolchain.sh +++ b/CorOS-dev-environment/install_toolchain.sh diff --git a/CorOS-dev-environment/qt-compiled-4.8.7.tar.gz b/CorOS-dev-environment/qt-compiled-4.8.7.tar.gz Binary files differnew file mode 100644 index 0000000..8b8658c --- /dev/null +++ b/CorOS-dev-environment/qt-compiled-4.8.7.tar.gz diff --git a/CorOS-dev-environment/update-builder.sh b/CorOS-dev-environment/update-builder.sh new file mode 100644 index 0000000..da6ea99 --- /dev/null +++ b/CorOS-dev-environment/update-builder.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +# This script can be used to apply OpenCortex patches to a mounted QC file system +# And create a new update file from it + +# This script is intended to be run from the QC-dev-environment directory +BLUE='\033[0;34m' +YELLOW='\033[1;33m' +NC='\033[0m' # No Color + +# echo the ascii art banner +echo -e "${YELLOW}" +echo -e " ____ ______ __ " +echo -e " / __ \____ ___ ____ / ____/___ _____/ /____ _ __ " +echo -e " / / / / __ \/ _ \/ __ \/ / / __ \/ ___/ __/ _ \| |/_/ " +echo -e " / /_/ / /_/ / __/ / / / /___/ /_/ / / / /_/ __/> < " +echo -e " \____/ .___/\___/_/ /_/\____/\____/_/ \__/\___/_/|_| " +echo -e " /_/ CorOS update builder " +echo -e "${NC}" + +echo "This tool can be used to create a new update file based on the mounted CorOS file system" + +echo -e "${BLUE}========= OpenCortex Update Builder =========${NC}" + +read -p "Do you want create a new update package from the current mounted CorOS? (y/n) " -r + +if [[ $REPLY =~ ^[Yy]$ ]] +then + cd /qc-fs-uncompressed + + echo "" + echo -e "${YELLOW}[!]${NC} Building update file..." + echo "" + tar cvf update-opencortex.bin rootfs.ext3 uImage zpu.dtb + echo "" + echo -e "${YELLOW}[!]${NC} Creating archive. This can take some seconds, please wait..." + gzip -k update-opencortex.bin + cp update-opencortex.bin.gz /qc-fs/update-opencortex.bin.gz + echo "" + echo -e "${BLUE}[+]${NC} Update file created: update-opencortex.bin.gz" +fi +echo "" diff --git a/QC-dev-environment/init_system.sh b/QC-dev-environment/init_system.sh deleted file mode 100644 index 8b931f9..0000000 --- a/QC-dev-environment/init_system.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash - -# Decompress archive and mount rootfs.ext3 -gunzip -d -k /qc-fs/$UPDATE_FILE -# Run tar command on the decompressed file to extract the rootfs.ext3 file -# We need to remove the .gz extension from the file name -tar -xvf /qc-fs/${UPDATE_FILE::-3} -C /qc-fs-uncompressed -rm /qc-fs/${UPDATE_FILE::-3} - -echo "Mounting rootfs.ext3" -mount -t ext4 /qc-fs-uncompressed/rootfs.ext3 $QEMU_LD_PREFIX -echo "Mounting rootfs.ext3 finished" - -# Promt the user to install custom QT -# if the user types "y" or "Y" then install custom QT -echo "Do you want to install the custom compiled QT? (y/n)" -echo "" -read -n 1 -r -echo "" - -if [[ $REPLY =~ ^[Yy]$ ]] -then - echo "Installing QT" - cd /qt_src && ./install_qt_compiled.sh - echo "Installing QT finished" -fi - -# 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)" -echo "" -read -n 1 -r -echo "" - -if [[ $REPLY =~ ^[Yy]$ ]] -then - echo "" - echo "Chrooting into $QEMU_LD_PREFIX" - chroot $QEMU_LD_PREFIX -fi diff --git a/QC-dev-environment/qt-compiled-4.8.7.tar.gz b/QC-dev-environment/qt-compiled-4.8.7.tar.gz deleted file mode 100644 index b6c5d9e..0000000 --- a/QC-dev-environment/qt-compiled-4.8.7.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fe15ddfe0556182666237ec6cc767eef3216d59f51529b9d7a62654a4d07dbee -size 29628859 diff --git a/QC-dev-environment/update-builder.sh b/QC-dev-environment/update-builder.sh deleted file mode 100644 index ab4e8b9..0000000 --- a/QC-dev-environment/update-builder.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -# This script can be used to apply OpenCortex patches to a mounted QC file system -# And create a new update file from it - -# This script is intended to be run from the QC-dev-environment directory -BLUE='\033[0;34m' -NC='\033[0m' # No Color - -echo "${BLUE}========= OpenCortex Update Builder =========${NC}" - -cd /qc-fs-uncompressed - -echo "" -echo "${BLUE}[+]${NC} Building update file..." -echo "" -tar cvf update-opencortex.bin rootfs.ext3 uImage zpu.dtb -echo "" -echo "This can take some seconds, please wait..." -gzip -k update-opencortex.bin -cp update-opencortex.bin.gz /qc-fs/update-opencortex.bin.gz -echo "" -echo "${BLUE}[+]${NC} Update file created: update-opencortex.bin.gz"
\ No newline at end of file |