utils/bump-stable-kernel-versions: only move existing headers directories
PATCH 1/1 utils/bump-stable-kernel-versions: only move existing headers directories
Since commit bd633fe5b4785435d7822251d02289082a0d1b5e ("utils/bump-stable-kernel-versions: update for split hash file"), the script unconditionally renames package/linux-headers/<old_version> to package/linux-headers/<new_version> when it bumps a kernel version.
These version-numbered directories only exist since the hash files were split in commit 0e3ddc9dc85e29cd00338cc79ea4be1d634a75ba. On branches without this split, such as 2025.02.x, the hashes are in a single linux/linux.hash file and the directory does not exist, so 'git mv' fails:
fatal: bad source, source=package/linux-headers/6.12.112, destination=package/linux-headers/6.12.114
As the script runs with 'set -e', it then stops halfway, leaving the Config.in files updated but the hash file unchanged.
Only rename the directory when it exists, as is already done for the linux/<old_version> directory.
--- utils/bump-stable-kernel-versions | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
utils/bump-stable-kernel-versions +3 -1
@@ -79,7 +79,9 @@ update_linux_hash() { echo ">>> Updating version from ${old_version} to ${new_version} in Config.in files" sed -Ei "s/\tdefault \"${old_version}\"([\t ]+)if /\tdefault \"${new_version}\"\1if /" \ package/linux-headers/Config.in.host linux/Config.in - git mv package/linux-headers/"${old_version}" package/linux-headers/"${new_version}" + if [ -d package/linux-headers/"${old_version}" ]; then + git mv package/linux-headers/"${old_version}" package/linux-headers/"${new_version}" + fi if [ -d linux/"${old_version}" ]; then git mv linux/"${old_version}" linux/"${new_version}" fi
Signature · 6 lines
2.54.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
In reply of:
Quoted 13 lines
Since commit
bd633fe5b4785435d7822251d02289082a0d1b5e("utils/bump-stable-kernel-versions: update for split hash file"), the script unconditionally renames package/linux-headers/<old_version> to package/linux-headers/<new_version> when it bumps a kernel version.These version-numbered directories only exist since the hash files were split in commit
0e3ddc9dc85e29cd00338cc79ea4be1d634a75ba. On branches without this split, such as 2025.02.x, the hashes are in a single linux/linux.hash file and the directory does not exist, so 'git mv' fails:fatal: bad source, source=package/linux-headers/6.12.112, destination=package/linux-headers/6.12.114
Quoted 7 lines
As the script runs with 'set -e', it then stops halfway, leaving the Config.in files updated but the hash file unchanged.
Only rename the directory when it exists, as is already done for the linux/<old_version> directory.
Signed-off-by Raphaël Mélotte <[email protected]>
Quoted 26 lines
--- utils/bump-stable-kernel-versions | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)utils/bump-stable-kernel-versions +3
-1@@ -79,7 +79,9 @@ update_linux_hash() { echo ">>> Updating version from ${old_version} to ${new_version} in Config.in files" sed -Ei "s/\tdefault \"${old_version}\"([\t ]+)if /\tdefault \"${new_version}\"\1if /" \ package/linux-headers/Config.in.host linux/Config.in - git mv package/linux-headers/"${old_version}" package/linux-headers/"${new_version}" + if [ -d package/linux-headers/"${old_version}" ]; then + git mv package/linux-headers/"${old_version}" package/linux-headers/"${new_version}" + fi if [ -d linux/"${old_version}" ]; then git mv linux/"${old_version}" linux/"${new_version}" fiSignature · 6 lines
2.54.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot