utils/bump-stable-kernel-versions: automatically commit result

Since this script is often used to bump kernel versions in multiple
Buildroot branches, it makes sense to simply commit changes directly
rather than letting the developer do it by hand.

Signed-off-by: Titouan Christophe <titouan.christophe@mind.be>
Signed-off-by: Arnout Vandecappelle <arnout@rnout.be>
This commit is contained in:
Titouan Christophe
2026-05-31 14:05:22 +02:00
committed by Arnout Vandecappelle
parent 79431203c3
commit fab50ed3b1

View File

@@ -25,6 +25,7 @@ latest_version=$(sed -rn 's|^\tdefault "(.+)" if BR2_LINUX_KERNEL_LATEST_VERSION
latest_release_version=$(echo "${latest_version}" | cut -f 1-2 -d .)
echo "${latest_version} -> ${latest_release_version}"
updated_files_list=()
updated_releases_list=''
updated_versions='Update the latest kernel releases to:'
@@ -98,6 +99,7 @@ update_linux_hash() {
# We were iterating over this file so we could not edit in-place.
mv "$HASHFILE.new" "$HASHFILE"
updated_files_list+=("$HASHFILE")
}
while IFS= read -r -d '' hashfile; do
@@ -105,7 +107,12 @@ while IFS= read -r -d '' hashfile; do
done < <(find linux/ -name '*.hash' -type f -print0)
if [ -n "${updated_releases_list}" ]; then
echo ">>> Suggested subject: {linux, linux-headers}: bump${updated_releases_list//.x /.x, } series"
git add "${updated_files_list[@]}" linux/Config.in package/linux-headers/Config.in.host
git commit --verbose --edit --signoff --file=<( {
echo "{linux, linux-headers}: bump${updated_releases_list//.x /.x, } series"
echo
echo "${updated_versions}"
} )
else
echo '>>> Nothing happened.'
fi