Commit 61319af6 authored by Martin Rubli's avatar Martin Rubli Committed by Martin Rubli
Browse files

stm32cubemx: fix broken software package database update

For some reason, STM32CubeMX initially creates one of its database files with
missing user-write permissions. When this happens, refreshing the package list
in the Embedded Software Packages Manager seems to succeed but new packages
don't become available. (As of the time of writing, this is the case with
TouchGFX 4.25.0, which fails to appear, and 4.24.2 showing as the latest
version.)

To work around this problem, we run
  chmod u+w $HOME/.stm32cubemx/thirdparties/db/updaterThirdParties.xml
when the startup wrapper script recognizes this problem.
parent 4cd944ad
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -52,6 +52,11 @@ let

      cat << EOF > $out/bin/${pname}
      #!${stdenvNoCC.shell}
      updater_xml="\$HOME/.stm32cubemx/thirdparties/db/updaterThirdParties.xml"
      if [ -e "\$updater_xml" ] && [ ! -w "\$updater_xml" ]; then
        echo "Warning: Unwritable \$updater_xml prevents CubeMX software packages from working correctly. Fixing that."
        (set -x; chmod u+w "\$updater_xml")
      fi
      ${jdk21}/bin/java -jar $out/opt/STM32CubeMX/STM32CubeMX "\$@"
      EOF
      chmod +x $out/bin/${pname}