diff --git a/README.md b/README.md index d46b09a4..4bf83845 100644 --- a/README.md +++ b/README.md @@ -162,21 +162,26 @@ which contains the following two files: These files can be created manually: -1. Build the release image and then switch into the build directory -2. Run the following command to create the version file +1. Build the release image inside `cmake-build-release-q7s` +2. Switch into the build directory +3. Run the following command to create the version file ```sh git describe --tags --always --exclude docker_* > obsw_version.txt ``` -3. Run the following command to create the compressed archive + You can also use the `create-version-file.sh` helper shell script + located in the `scripts` folder to do this. + +4. Run the following command to create the compressed archive ```sh tar -cJvf eive-sw-update.tar.xz eive-obsw-stripped obsw_version.txt ``` -You can also use the helper script `prepare-obsw-update.sh` inside the build folder -after sourcing the `q7s-env.sh` helper script to perform all three steps. +You can also use the helper script `create-sw-update.sh` inside the build folder +after sourcing the `q7s-env.sh` helper script to perform all steps including +a rebuild. After creating these files, they need to be transferred onto the Q7S to either the `/mnt/sd0/bin` or `/mnt/sd1/bin` folder if the OBSW update diff --git a/bsp_q7s/core/CoreController.h b/bsp_q7s/core/CoreController.h index bf3e41d8..381a134c 100644 --- a/bsp_q7s/core/CoreController.h +++ b/bsp_q7s/core/CoreController.h @@ -55,8 +55,8 @@ class CoreController : public ExtendedControllerBase { static constexpr char CONF_FOLDER[] = "conf"; static constexpr char OBSW_UPDATE_ARCHIVE_FILE_NAME[] = "eive-sw-update.tar.xz"; - static constexpr char STRIPPED_OBSW_BINARY_FILE_NAME = "eive-obsw-stripped"; - static constexpr char OBSW_VERSION_FILE_NAME = "obsw_version.txt"; + static constexpr char STRIPPED_OBSW_BINARY_FILE_NAME[] = "eive-obsw-stripped"; + static constexpr char OBSW_VERSION_FILE_NAME[] = "obsw_version.txt"; static constexpr char VERSION_FILE_NAME[] = "version.txt"; static constexpr char REBOOT_FILE_NAME[] = "reboot.txt"; static constexpr char TIME_FILE_NAME[] = "time.txt"; @@ -67,10 +67,10 @@ class CoreController : public ExtendedControllerBase { "/" + std::string(CONF_FOLDER) + "/" + std::string(REBOOT_FILE_NAME); const std::string TIME_FILE = "/" + std::string(CONF_FOLDER) + "/" + std::string(TIME_FILE_NAME); - static constexpr char CHIP_0_COPY_0_MOUNT_DIR = "/tmp/mntupdate-xdi-qspi0-nom-rootfs"; - static constexpr char CHIP_0_COPY_1_MOUNT_DIR = "/tmp/mntupdate-xdi-qspi0-gold-rootfs"; - static constexpr char CHIP_1_COPY_0_MOUNT_DIR = "/tmp/mntupdate-xdi-qspi1-nom-rootfs"; - static constexpr char CHIP_1_COPY_1_MOUNT_DIR = "/tmp/mntupdate-xdi-qspi1-gold-rootfs"; + static constexpr char CHIP_0_COPY_0_MOUNT_DIR[] = "/tmp/mntupdate-xdi-qspi0-nom-rootfs"; + static constexpr char CHIP_0_COPY_1_MOUNT_DIR[] = "/tmp/mntupdate-xdi-qspi0-gold-rootfs"; + static constexpr char CHIP_1_COPY_0_MOUNT_DIR[] = "/tmp/mntupdate-xdi-qspi1-nom-rootfs"; + static constexpr char CHIP_1_COPY_1_MOUNT_DIR[] = "/tmp/mntupdate-xdi-qspi1-gold-rootfs"; static constexpr ActionId_t LIST_DIRECTORY_INTO_FILE = 0; static constexpr ActionId_t SWITCH_REBOOT_FILE_HANDLING = 5; diff --git a/scripts/create-sw-update.sh b/scripts/create-sw-update.sh index 89ad9aff..3aff1c2d 100755 --- a/scripts/create-sw-update.sh +++ b/scripts/create-sw-update.sh @@ -1,17 +1,21 @@ #!/bin/bash -if [ -f eive-obsw-stripped ]; then +cmake --build . -j +source create-version-file.sh + +if [ ! -f eive-obsw-stripped ]; then echo "No file eive-obsw-stripped found. Please ensure you are in the " echo "build folder and the OBSW was built properly" exit 1 fi -if [ -f obsw_version.txt ]; then +if [ ! -f obsw_version.txt ]; then echo "No OBSW version file found." echo "You can use the create-version-file.sh script to create it" exit 1 fi -cmd="tar -cJvf eive-obsw.tar.xz eive-obsw-stripped obsw_version.txt" -echo "Running command ${cmd} to generate compressed SW update archive" +cmd="tar -cJvf eive-sw-update.tar.xz eive-obsw-stripped obsw_version.txt" +echo "Running command ${cmd} to generate compressed SW update archive." eval ${cmd} +echo "Generated eive-sw-update.tar.xz update archive." diff --git a/scripts/prepare-obsw-update.sh b/scripts/prepare-obsw-update.sh deleted file mode 100755 index 3d18df21..00000000 --- a/scripts/prepare-obsw-update.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -source create-version-file.sh -source create-sw-update.sh