summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2021-11-03 08:26:40 +1100
committerGitHub <noreply@github.com>2021-11-03 08:26:40 +1100
commit5da04fb45b0d5cddc6f49f88ea9c6a4037ef82ce (patch)
tree6fb7eafbbbef1278200421290659a13d208d7c31 /util
parent387edab52b1c1ab7585c4c1a11d997a6a90a505c (diff)
Update to ChibiOS 20.3.4, support builds against trunk (#14208)
* Add support for building against ChibiOS svn/trunk. * Swap to 21.6.x * Update to latest branch revision as released version is broken. * Updated configs. * Conf updates. * Updated ChibiOS * Convert STM32L422 to actual L422 ChibiOS platform. * Downgrade to 20.3.4 as ChibiOS 21.6.x is being aborted. * Rollback L422-based boards.
Diffstat (limited to 'util')
-rwxr-xr-xutil/chibios_conf_updater.sh101
-rwxr-xr-xutil/update_chibios_mirror.sh4
2 files changed, 13 insertions, 92 deletions
diff --git a/util/chibios_conf_updater.sh b/util/chibios_conf_updater.sh
index d1640b6729..a5699ca3cb 100755
--- a/util/chibios_conf_updater.sh
+++ b/util/chibios_conf_updater.sh
@@ -3,6 +3,17 @@
set -eEuo pipefail
umask 022
+#####################
+# You will need to get an older JDK -- JDK 8
+#
+# !!!!!!!! DO NOT INSTALL THIS IF YOU HAVE AN EXISTING JDK OR JRE INSTALLED !!!!!!!!
+#
+# For Debian 10-ish distro's:
+# wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -
+# sudo add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/
+# sudo apt-get update && sudo apt-get install adoptopenjdk-8-hotspot
+
+
sinfo() { echo "$@" >&2 ; }
shead() { sinfo "" ; sinfo "---------------------------------" ; sinfo "-- $@" ; sinfo "---------------------------------" ; }
havecmd() { command command type "${1}" >/dev/null 2>&1 || return 1 ; }
@@ -11,8 +22,6 @@ this_script="$(realpath "${BASH_SOURCE[0]}")"
script_dir="$(realpath "$(dirname "$this_script")")"
qmk_firmware_dir="$(realpath "$script_dir/../")"
-declare -A file_hashes
-
export PATH="$PATH:$script_dir/fmpp/bin"
build_fmpp() {
@@ -45,67 +54,6 @@ find_chibi_files() {
done
}
-revert_chibi_files() {
- local search_path="$1"
- shead "Reverting ChibiOS config/board files..."
- for file in $(find_chibi_files "$search_path" -name chconf.h -or -name halconf.h -or -name mcuconf.h -or -name board.c -or -name board.h -or -name board.mk -or -name board.chcfg) ; do
- pushd "$search_path" >/dev/null 2>&1
- local relpath=$(realpath --relative-to="$search_path" "$file")
- git checkout upstream/develop -- "$relpath" || git checkout origin/develop -- "$relpath" || true
- popd >/dev/null 2>&1
- done
-}
-
-populate_file_hashes() {
- local search_path="$1"
- shead "Determining duplicate config/board files..."
- for file in $(find_chibi_files "$search_path" -name chconf.h -or -name halconf.h -or -name mcuconf.h -or -name board.c -or -name board.h) ; do
- local key="file_$(clang-format "$file" | sha1sum | cut -d' ' -f1)"
- local relpath=$(realpath --relative-to="$search_path" "$file")
- file_hashes[$key]="${file_hashes[$key]:-} $relpath"
- done
- for file in $(find_chibi_files "$search_path" -name board.mk -or -name board.chcfg) ; do
- local key="file_$(cat "$file" | sha1sum | cut -d' ' -f1)"
- local relpath=$(realpath --relative-to="$search_path" "$file")
- file_hashes[$key]="${file_hashes[$key]:-} $relpath"
- done
-}
-
-determine_equivalent_files() {
- local search_file="$1"
- for K in "${!file_hashes[@]}"; do
- for V in ${file_hashes[$K]}; do
- if [[ "$V" == "$search_file" ]] ; then
- for V in ${file_hashes[$K]}; do
- echo "$V"
- done
- return 0
- fi
- done
- done
- return 1
-}
-
-deploy_staged_files() {
- shead "Deploying staged files..."
- for file in $(find "$qmk_firmware_dir/util/chibios-upgrade-staging" -type f) ; do
- local relpath=$(realpath --relative-to="$qmk_firmware_dir/util/chibios-upgrade-staging" "$file")
- sinfo "Deploying staged file: $relpath"
- for other in $(determine_equivalent_files "$relpath") ; do
- sinfo " => $other"
- cp "$qmk_firmware_dir/util/chibios-upgrade-staging/$relpath" "$qmk_firmware_dir/$other"
- done
- done
-}
-
-swap_mcuconf_f3xx_f303() {
- shead "Swapping STM32F3xx_MCUCONF -> STM32F303_MCUCONF..."
- for file in $(find_chibi_files "$qmk_firmware_dir" -name mcuconf.h) ; do
- sed -i 's#STM32F3xx_MCUCONF#STM32F303_MCUCONF#g' "$file"
- dos2unix "$file" >/dev/null 2>&1
- done
-}
-
upgrade_conf_files_generic() {
local search_filename="$1"
local update_script="$2"
@@ -150,35 +98,8 @@ upgrade_mcuconf_files() {
popd >/dev/null 2>&1
}
-update_staged_files() {
- shead "Updating staged files with ChibiOS upgraded versions..."
- for file in $(find "$qmk_firmware_dir/util/chibios-upgrade-staging" -type f) ; do
- local relpath=$(realpath --relative-to="$qmk_firmware_dir/util/chibios-upgrade-staging" "$file")
- sinfo "Updating staged file: $relpath"
- cp "$qmk_firmware_dir/$relpath" "$qmk_firmware_dir/util/chibios-upgrade-staging/$relpath"
- done
-}
-
havecmd fmpp || build_fmpp
-revert_chibi_files "$qmk_firmware_dir"
-populate_file_hashes "$qmk_firmware_dir"
-
-shead "Showing duplicate ChibiOS files..."
-for K in "${!file_hashes[@]}"; do
- sinfo ${K#file_}:
- for V in ${file_hashes[$K]}; do
- sinfo " $V"
- done
-done
-
-if [ "${1:-}" == "-r" ] ; then
- exit 0
-fi
-
-swap_mcuconf_f3xx_f303
-deploy_staged_files
upgrade_mcuconf_files
upgrade_chconf_files
upgrade_halconf_files
-update_staged_files
diff --git a/util/update_chibios_mirror.sh b/util/update_chibios_mirror.sh
index 83aee22817..0bf648ebfd 100755
--- a/util/update_chibios_mirror.sh
+++ b/util/update_chibios_mirror.sh
@@ -7,10 +7,10 @@
chibios_branches="trunk stable_20.3.x stable_21.6.x"
# The ChibiOS tags to mirror
-chibios_tags="ver20.3.1 ver20.3.2 ver20.3.3 ver21.6.0"
+chibios_tags="ver20.3.1 ver20.3.2 ver20.3.3 ver20.3.4 ver21.6.0"
# The ChibiOS-Contrib branches to mirror
-contrib_branches="chibios-20.3.x"
+contrib_branches="chibios-20.3.x chibios-21.6.x"
################################
# Actions