Add workflow for updating kernel branch

This change adds a Github Actions workflow for updating a kernel branch
and creating a pull request with the change.
This commit is contained in:
Fabian Mastenbroek 2020-09-17 17:24:01 +02:00
parent c5d857229c
commit 228a71465f
No known key found for this signature in database
GPG key ID: 405FC6F81F0A7B85
3 changed files with 88 additions and 8 deletions

View file

@ -5,9 +5,9 @@ set -o pipefail
LINUX_REPOSITORY=submodules/ubuntu-mainline
while getopts "r:t:b:v:h" OPTION; do
while getopts "R:t:b:v:r:h" OPTION; do
case $OPTION in
r)
R)
LINUX_REPOSITORY=$OPTARG
;;
t)
@ -19,13 +19,16 @@ while getopts "r:t:b:v:h" OPTION; do
v)
LINUX_VERSION=$OPTARG
;;
r)
LINUX_PACKAGE_RELEASE=$OPTARG
;;
h)
echo "update.sh -rtbh"
echo " -r path to Linux Git repository"
echo " -R path to Linux Git repository"
echo " -t tag in Linux Git repository to pick"
echo " -b manual basis for this kernel"
echo " -v manual version for this kernel"
echo " -r manual release version for this kernel"
echo " -h this help message"
exit 1
;;
@ -66,7 +69,9 @@ LINUX_VERSION_PATCH=${LINUX_VERSION_PATCH:-0} # Default to 0
LINUX_PACKAGE_RELEASE_PREVIOUS=$(scripts/version.sh -r)
# Check whether we need to increment the package release
if [[ $LINUX_VERSION == "$(scripts/version.sh -L)" ]]; then
if [[ -n $LINUX_PACKAGE_RELEASE ]]; then
echo "Using custom package release $LINUX_PACKAGE_RELEASE"
elif [[ $LINUX_VERSION == "$(scripts/version.sh -L)" ]]; then
LINUX_PACKAGE_RELEASE=$((LINUX_PACKAGE_RELEASE_PREVIOUS + 1))
echo "Incrementing package release to $LINUX_PACKAGE_RELEASE"
else

View file

@ -3,6 +3,7 @@
set -e
set -o pipefail
LINUX_REPOSITORY=submodules/ubuntu-mainline
LINUX_VERSION_MAJOR=$(sed -n "s/^KERNEL_MAJ=\([0-9]*$\)/\1/p" < Makefile | xargs)
LINUX_VERSION_MINOR=$(sed -n "s/^KERNEL_MIN=\([0-9]*$\)/\1/p" < Makefile | xargs)
LINUX_VERSION_PATCHLEVEL=$(sed -n "s/^KERNEL_PATCHLEVEL=\([0-9]*$\)/\1/p" < Makefile | xargs)
@ -11,8 +12,7 @@ LINUX_VERSION=$LINUX_VERSION_MAJOR.$LINUX_VERSION_MINOR.$LINUX_VERSION_PATCHLEVE
LINUX_PACKAGE_RELEASE=$(sed -n "s/^PKGREL=\([0-9]*$\)/\1/p" < Makefile | xargs)
LINUX_FLAVOR=$(sed -n "s/^PVE_BUILD_TYPE ?=\(.*\)$/\1/p" < Makefile | xargs)
while getopts "MmprfdLh" OPTION; do
while getopts "MmprfdLBh" OPTION; do
case $OPTION in
M)
echo $LINUX_VERSION_MAJOR
@ -42,7 +42,11 @@ while getopts "MmprfdLh" OPTION; do
L)
echo $LINUX_VERSION
exit 0
;;
;;
B)
echo $(git --git-dir $LINUX_REPOSITORY/.git log -1 --pretty=%B | sed -n "s/^.*Ubuntu-\([0-9.-]*\).*$/\1/p")
exit 0
;;
h)
echo "commit.sh [-Mmprfh]]"
echo " -M major version"