-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauto-update
executable file
·47 lines (33 loc) · 1.22 KB
/
auto-update
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
set -ex
MAINLINE_KERNEL_VERSION=6.8
UBUNTU_VERSION=22.04
echo "===Starting auto-update.==="
SCRIPT=$(realpath "${0}")
SCRIPTPATH=$(dirname "${SCRIPT}")
cd "${SCRIPTPATH}"
echo "===Get current version.==="
TUXEDO_KERNEL_BRANCH=tuxedo-${MAINLINE_KERNEL_VERSION}
TUXEDO_KERNEL_BRANCH_FULL=${TUXEDO_KERNEL_BRANCH}-${UBUNTU_VERSION}
CURRENT_VERSION=$(grep --perl-regexp --only-matching --max-count 1 "(?<=^linux-meta-tuxedo-${UBUNTU_VERSION} \().*(?=\))" debian/changelog)
echo "===Checking out correct Ubuntu kernel.==="
if ! [[ ${LINUX_REPO_URL} ]]; then
LINUX_REPO_URL="https://github.com/tuxedocomputers/linux.git"
fi
rm -rf ../linux-for-linux-meta
git clone --branch ${TUXEDO_KERNEL_BRANCH_FULL} ${LINUX_REPO_URL} ../linux-for-linux-meta
git -C ../linux-for-linux-meta fetch --tags
if [[ ${1} ]]; then
NEW_TAG=${1}
else
NEW_TAG=$(git -C ../linux-for-linux-meta describe --abbrev=0)
fi
NEW_VERSION=${NEW_TAG#Ubuntu-"${TUXEDO_KERNEL_BRANCH}"-}
if [[ ${CURRENT_VERSION} == "${NEW_VERSION}" ]]; then
echo "===Version already up to date. Exiting.==="
exit
fi
git -C ../linux-for-linux-meta checkout "${NEW_TAG}"
echo "===Run update script.==="
./update-version --commit ../linux-for-linux-meta
echo "===Done.==="