aboutsummaryrefslogtreecommitdiffhomepage
path: root/QC-dev-environment/init_system.sh
diff options
context:
space:
mode:
authorThomas Van Iseghem <[email protected]>2023-03-09 20:22:56 +0100
committerThomas Van Iseghem <[email protected]>2023-03-09 20:22:56 +0100
commitd7814640a57323fc3fb410831e8d26083c7e0067 (patch)
treebfc493da2115890c0b78fa5ae9cff7fd30c27deb /QC-dev-environment/init_system.sh
parent83728ae0b6584fcfec776abbb47afa1d12de6b24 (diff)
parent03c976530b91ab70510479bbc75c04cbe4c6d979 (diff)
downloadOpenCortex-develop.tar.gz
OpenCortex-develop.zip
Merge branch 'feature/docker-dev-environment' into developdevelop
Diffstat (limited to 'QC-dev-environment/init_system.sh')
-rw-r--r--QC-dev-environment/init_system.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/QC-dev-environment/init_system.sh b/QC-dev-environment/init_system.sh
new file mode 100644
index 0000000..8b931f9
--- /dev/null
+++ b/QC-dev-environment/init_system.sh
@@ -0,0 +1,41 @@
+#!/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