aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorThomas Van Iseghem <[email protected]>2023-03-09 17:30:25 +0100
committerThomas Van Iseghem <[email protected]>2023-03-09 17:30:25 +0100
commite31fa6e6108a3eec2a7685d21c00ef81cd6bb79c (patch)
tree3d0b1c772250f5483b5ecf09db617f741e27fe4d
parent6aceac7a93a42152789abdc4532d0209d5d7304d (diff)
downloadOpenCortex-e31fa6e6108a3eec2a7685d21c00ef81cd6bb79c.tar.gz
OpenCortex-e31fa6e6108a3eec2a7685d21c00ef81cd6bb79c.zip
Docker env can now mount and use update files from host
-rw-r--r--QC-dev-environment/.gitignore4
-rw-r--r--QC-dev-environment/Dockerfile7
-rw-r--r--QC-dev-environment/REAME.md30
-rw-r--r--QC-dev-environment/filesystems/2.0.0-vanilla.bin.gz3
-rw-r--r--QC-dev-environment/filesystems/README.md6
-rw-r--r--QC-dev-environment/init_system.sh11
-rw-r--r--QC-dev-environment/install_qt_compiled.sh4
-rw-r--r--QC-dev-environment/install_qt_src.sh4
-rw-r--r--QC-dev-environment/install_toolchain(broken).sh37
9 files changed, 92 insertions, 14 deletions
diff --git a/QC-dev-environment/.gitignore b/QC-dev-environment/.gitignore
index faecd0a..b631c5c 100644
--- a/QC-dev-environment/.gitignore
+++ b/QC-dev-environment/.gitignore
@@ -2,4 +2,6 @@
# and the mount folder itself
/mount/*
-!/mount \ No newline at end of file
+/filesystems/*
+!/mount
+!/filesystems/README.md
diff --git a/QC-dev-environment/Dockerfile b/QC-dev-environment/Dockerfile
index f758cc8..8c7e67a 100644
--- a/QC-dev-environment/Dockerfile
+++ b/QC-dev-environment/Dockerfile
@@ -29,12 +29,7 @@ ENV QEMU_LD_PREFIX="/opt/analog/cces-linux-add-in/1.3.1/ARM/arm-linux-gnueabi/sy
# 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 /qc-fs-uncompressed
RUN mkdir -p /qt_src
WORKDIR /qt_src
diff --git a/QC-dev-environment/REAME.md b/QC-dev-environment/REAME.md
index edbe683..5a7e588 100644
--- a/QC-dev-environment/REAME.md
+++ b/QC-dev-environment/REAME.md
@@ -10,12 +10,24 @@ Go into the QC-dev-environment directory and run:
docker build . -t <your-wanted-tag e.g. cortex-dev>
```
+### Getting the update file
+
+The update process of the QC is done in 2 steps. First the download, after that the install. We can use this to our advantage to grab the actual update file. Once you downloaded the update **do not install it yet.** Get an SSH shell going and go to `/media/p4`. There you will find your update file. A registry of these file names is also available inside the `filesystems/README.md` of this folder.
+
+You can use the `scp` tool to send this update file over to your system.
+
+Once you've got the update file, you can put it inside the `filesystems` directory to mount to the docker container. Now you can use the update file to explore your QC (except for the user files), and even create custom update packages.
+
### 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
+docker run --privileged -it -p 5900:5900 \
+ -v <absolute-path-to-current-folder>/mount:/mnt \
+ -v <absolute-path-to-current-folder>/filesystems:/qc-fs \
+ -e UPDATE_FILE=<update-file-name> \
+ cortex-dev
```
When attached to the docker container's shell, there is one post-install step left. Run the following command:
@@ -26,3 +38,19 @@ When attached to the docker container's shell, there is one post-install step le
This will mount the QC filesystem and install a custom compiled version of QT inside it that has support for VNC.
+To link QT to the right fonts folder, run:
+
+```bash
+export QT_QWS_FONTDIR=/etc/fonts
+```
+
+
+
+## Config for custom compiled QT
+
+For running GUI applications such as `ZenUI` it is possible to output the video to a virtual device. One of these posibilities is a simple VNC server. To enable this ability I have compiled QT from source using the following config:
+
+```
+./configure -embedded arm -xplatform qws/linux-arm-gnueabi-g++ -nomake examples -nomake demos -opensource -qt-libtiff -qt-zlib -qt-libpng -qt-libmng -qt-libjpeg -optimized-qmake -qt-freetype -qt-gfx-vnc -no-webkit -no-javascript-jit -optimized-qmake -no-cups && make
+```
+
diff --git a/QC-dev-environment/filesystems/2.0.0-vanilla.bin.gz b/QC-dev-environment/filesystems/2.0.0-vanilla.bin.gz
deleted file mode 100644
index 9c7c5ce..0000000
--- a/QC-dev-environment/filesystems/2.0.0-vanilla.bin.gz
+++ /dev/null
@@ -1,3 +0,0 @@
-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
index a03527b..fc4da30 100644
--- a/QC-dev-environment/filesystems/README.md
+++ b/QC-dev-environment/filesystems/README.md
@@ -1,3 +1,7 @@
# Update name registry
-**2.0.0:** update-vm44GCkrMujYR8o47OkF8UW.AdVYyu0U \ No newline at end of file
+Update download files are found inside `/media/p4/update-<update-name>.bin`
+
+**2.0.0:** update-vm44GCkrMujYR8o47OkF8UW.AdVYyu0U
+
+**2.0.1:** update-cIR97IrfvF4fKfO5_KIm_j_aP2zGiHp_ \ No newline at end of file
diff --git a/QC-dev-environment/init_system.sh b/QC-dev-environment/init_system.sh
index c6aa3d5..d870aff 100644
--- a/QC-dev-environment/init_system.sh
+++ b/QC-dev-environment/init_system.sh
@@ -1,6 +1,14 @@
#!/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/rootfs.ext3 $QEMU_LD_PREFIX
+mount -t ext4 /qc-fs-uncompressed/rootfs.ext3 $QEMU_LD_PREFIX
echo "Mounting rootfs.ext3 finished"
echo "Installing QT"
@@ -14,6 +22,7 @@ echo "Do you want to chroot into the created QC-filesystem? (y/n)"
read -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]
then
+ echo ""
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
index ccb3931..2094de0 100644
--- a/QC-dev-environment/install_qt_compiled.sh
+++ b/QC-dev-environment/install_qt_compiled.sh
@@ -3,4 +3,6 @@ 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
+cp -a QtEmbedded-4.8.7-arm/bin/. $QEMU_LD_PREFIX/usr/bin/
+
+QT_QWS_FONTDIR=/etc/fonts \ No newline at end of file
diff --git a/QC-dev-environment/install_qt_src.sh b/QC-dev-environment/install_qt_src.sh
new file mode 100644
index 0000000..66a381b
--- /dev/null
+++ b/QC-dev-environment/install_qt_src.sh
@@ -0,0 +1,4 @@
+# First download the package using wget
+wget -LO https://src.fedoraproject.org/repo/pkgs/qt/qt-everywhere-opensource-src-4.8.7.tar.gz/d990ee66bf7ab0c785589776f35ba6ad/qt-everywhere-opensource-src-4.8.7.tar.gz
+# Then extract it
+tar -zxvf qt-everywhere-opensource-src-4.8.7.tar.gz
diff --git a/QC-dev-environment/install_toolchain(broken).sh b/QC-dev-environment/install_toolchain(broken).sh
new file mode 100644
index 0000000..c3b05fa
--- /dev/null
+++ b/QC-dev-environment/install_toolchain(broken).sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+# Currently the latest addin .deb package is corrupted. It is unable to be unpacked.
+# This script is used to download the latest addin .deb package and install it.
+
+##################################### Install Toolchain #############################
+linux_addin_version=$1
+
+linux_addin_link="https://download.analog.com/tools/LinuxAddInForCCES/Releases/Release_$linux_addin_version/adi-LinuxAddinForCCES-linux-x86-$linux_addin_version.deb"
+
+echo "Start downloading linux-addin ($linux_addin_link)"
+wget --quiet $linux_addin_link
+echo "linux-addin download finished"
+linux_addin_link=`basename $linux_addin_link`
+linux_addin_name=`basename $linux_addin_link`
+
+
+linux_addin_deb=$linux_addin_link
+echo "Start to install $linux_addin_name, Installing..."
+export DEBIAN_FRONTEND=noninteractive
+ls
+echo "dpkg -i $linux_addin_deb"
+dpkg -i $linux_addin_deb
+echo "Finished, $linux_addin_name installed into PATH=/opt/analog/cces-linux-add-in/${linux_addin_vesion}/ARM/arm-none-eabi/bin/"
+##########################################################################################
+
+##################### Get source codes(u-boot & buildroot) form linu-add-in ############
+echo "Start to unzip the source-code to workspace, Installing..."
+source_code_path=$2
+tar -zxvf /opt/analog/cces-linux-add-in/${linux_addin_version}/buildroot-sc5xx-${linux_addin_version}/src/buildroot-sc5xx-${linux_addin_version}.tar.gz -C ${source_code_path}
+tar -zxvf /opt/analog/cces-linux-add-in/${linux_addin_version}/uboot-sc5xx-${linux_addin_version}/src/uboot-sc5xx-${linux_addin_version}.tar.gz -C ${source_code_path}
+echo "Finished, source-code{uboot & buildroot} in the PATH=${source_code_path}"
+
+#Apply the patch for automake of buildroot
+echo "Apply the patch for automake of buildroot"
+patch=$3
+cp ${patch} ${source_code_path}/buildroot/package/automake/
+########################################################################################## \ No newline at end of file