aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorThomas Van Iseghem <[email protected]>2023-03-09 19:14:18 +0100
committerThomas Van Iseghem <[email protected]>2023-03-09 19:14:18 +0100
commit4ff0548eaa990926864ea61f7990e9586a8ba09f (patch)
tree27bce957404d21deea4de369c1ce03e82769d435
parentd3ab9d161e5f30247a6e59359ba1d93c41116305 (diff)
downloadOpenCortex-4ff0548eaa990926864ea61f7990e9586a8ba09f.tar.gz
OpenCortex-4ff0548eaa990926864ea61f7990e9586a8ba09f.zip
Added a update package builder
-rw-r--r--QC-dev-environment/Dockerfile1
-rw-r--r--QC-dev-environment/REAME.md5
-rw-r--r--QC-dev-environment/docker-compose.yaml2
-rw-r--r--QC-dev-environment/init_system.sh19
-rw-r--r--QC-dev-environment/update-builder.sh23
5 files changed, 46 insertions, 4 deletions
diff --git a/QC-dev-environment/Dockerfile b/QC-dev-environment/Dockerfile
index 8c7e67a..a1bd7c4 100644
--- a/QC-dev-environment/Dockerfile
+++ b/QC-dev-environment/Dockerfile
@@ -39,5 +39,6 @@ COPY install_qt_compiled.sh .
WORKDIR /
COPY init_system.sh .
+COPY update-builder.sh .
ENTRYPOINT ["/bin/bash"]
diff --git a/QC-dev-environment/REAME.md b/QC-dev-environment/REAME.md
index 5964867..b236306 100644
--- a/QC-dev-environment/REAME.md
+++ b/QC-dev-environment/REAME.md
@@ -60,6 +60,11 @@ To link QT to the right fonts folder, run:
export QT_QWS_FONTDIR=/etc/fonts
```
+## Creating an update package
+
+You can create a custom update package based on the mounted filesystem, by running the `update-builder.sh` script. This can be found in the root of the docker container. This way you can patch your update to include all mods and ssh access, without opening the QC up everytime.
+
+The update file should be available on your host machine at `filesystems/update-opencortex.bin.gz`. You can validate the update file by mounting it as the actual update file using the `UPDATE_FILE` environment variable and running `init_system.sh`.
## Config for custom compiled QT
diff --git a/QC-dev-environment/docker-compose.yaml b/QC-dev-environment/docker-compose.yaml
index 975726b..9f2943f 100644
--- a/QC-dev-environment/docker-compose.yaml
+++ b/QC-dev-environment/docker-compose.yaml
@@ -15,7 +15,7 @@ services:
environment:
# Edit this to your needs. This should be just the file name, not the path.
- - UPDATE_FILE=2.0.1.bin.gz
+ - UPDATE_FILE=update-opencortex.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/init_system.sh b/QC-dev-environment/init_system.sh
index d870aff..8b931f9 100644
--- a/QC-dev-environment/init_system.sh
+++ b/QC-dev-environment/init_system.sh
@@ -11,15 +11,28 @@ echo "Mounting rootfs.ext3"
mount -t ext4 /qc-fs-uncompressed/rootfs.ext3 $QEMU_LD_PREFIX
echo "Mounting rootfs.ext3 finished"
-echo "Installing QT"
-cd /qt_src && ./install_qt_compiled.sh
-echo "Installing QT 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 ""
diff --git a/QC-dev-environment/update-builder.sh b/QC-dev-environment/update-builder.sh
new file mode 100644
index 0000000..ab4e8b9
--- /dev/null
+++ b/QC-dev-environment/update-builder.sh
@@ -0,0 +1,23 @@
+#!/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