Skip to content

Commit

Permalink
scripts/kernel_bump: Allow bumping sub-targets
Browse files Browse the repository at this point in the history
Some targets may need to bump specific sub-targets only. So lets offer
this as an option.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
  • Loading branch information
oliv3r committed Mar 22, 2024
1 parent e0ef875 commit 402d268
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions scripts/kernel_bump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ usage()
echo 'Helper script to bump the target kernel version, whilst keeping history.'
echo ' -c Migrate config files (e.g. subtargets) only.'
echo " -p Optional Platform name (e.g. 'ath79' [PLATFORM_NAME]"
echo " -r Optional comma separated list of sub-targets (e.g. 'rtl930x' [SUBTARGET_NAMES]"
echo " -s Source version of kernel (e.g. 'v6.1' [SOURCE_VERSION])"
echo " -t Target version of kernel (e.g. 'v6.6' [TARGET_VERSION]')"
echo
Expand Down Expand Up @@ -145,7 +146,15 @@ bump_kernel()
fi

_subtarget="${_config%%"/config-${source_version}"}"
git mv "${_config}" "${_subtarget}/config-${target_version}"
if [ -n "${subtarget_names:-}" ]; then
echo "${subtarget_names:-}" | while IFS=',' read -r _subtarget_name; do
if [ "${_subtarget_name}" = "${_subtarget##*'/'}" ]; then
git mv "${_config}" "${_subtarget}/config-${target_version}"
fi
done
else
git mv "${_config}" "${_subtarget}/config-${target_version}"
fi
done

git commit \
Expand Down Expand Up @@ -195,7 +204,7 @@ check_requirements()

main()
{
while getopts 'chp:s:t:' _options; do
while getopts 'chp:r:s:t:' _options; do
case "${_options}" in
'c')
config_only='true'
Expand All @@ -207,6 +216,9 @@ main()
'p')
platform_name="${OPTARG}"
;;
'r')
subtarget_names="${OPTARG}"
;;
's')
source_version="${OPTARG}"
;;
Expand All @@ -226,6 +238,7 @@ main()
shift "$((OPTIND - 1))"

platform_name="${platform_name:-${PLATFORM_NAME:-}}"
subtarget_names="${subtarget_names:-${SUBTARGET_NAMES:-}}"
source_version="${source_version:-${SOURCE_VERSION:-}}"
target_version="${target_version:-${TARGET_VERSION:-}}"

Expand Down

0 comments on commit 402d268

Please sign in to comment.