|
7 | 7 | VERSION_MAJOR="${VERSION}"
|
8 | 8 | fi
|
9 | 9 |
|
10 |
| -mkdir -p .fetch_config |
11 |
| -cd .fetch_config || exit |
12 |
| - |
13 |
| -# get config file from ubuntu ppa |
14 |
| -DEB_FILE=$(curl https://kernel.ubuntu.com/\~kernel-ppa/mainline/v${VERSION_MAJOR}/amd64/ | grep -P -o 'linux-headers-.*?-generic.*?_amd64.deb' | awk 'NR==1{print $1}') |
15 |
| -echo "Fetching ${DEB_FILE} from https://kernel.ubuntu.com/~kernel-ppa/mainline/v${VERSION_MAJOR}/amd64/${DEB_FILE}" |
16 |
| -wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v${VERSION_MAJOR}/amd64/${DEB_FILE} |
17 |
| -ar x ${DEB_FILE} |
18 |
| -if [ -f "data.tar.xz" ]; then |
19 |
| - tar xf data.tar.xz |
20 |
| -elif [ -f "data.tar.zst" ]; then |
21 |
| - cat data.tar.zst | zstd -d | tar xf - |
| 10 | +if [ -f config-${VERSION} ]; then |
| 11 | + cp config-${VERSION} .config |
22 | 12 | else
|
23 |
| - echo "No data.tar.xz or data.tar.zst found" |
24 |
| - exit 1 |
| 13 | + mkdir -p .fetch_config |
| 14 | + cd .fetch_config || exit |
| 15 | + |
| 16 | + # get config file from ubuntu ppa |
| 17 | + DEB_FILE=$(curl https://kernel.ubuntu.com/\~kernel-ppa/mainline/v${VERSION_MAJOR}/amd64/ | grep -P -o 'linux-headers-.*?-generic.*?_amd64.deb' | awk 'NR==1{print $1}') |
| 18 | + echo "Fetching ${DEB_FILE} from https://kernel.ubuntu.com/~kernel-ppa/mainline/v${VERSION_MAJOR}/amd64/${DEB_FILE}" |
| 19 | + wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v${VERSION_MAJOR}/amd64/${DEB_FILE} |
| 20 | + ar x ${DEB_FILE} |
| 21 | + if [ -f "data.tar.xz" ]; then |
| 22 | + tar xf data.tar.xz |
| 23 | + elif [ -f "data.tar.zst" ]; then |
| 24 | + cat data.tar.zst | zstd -d | tar xf - |
| 25 | + else |
| 26 | + echo "No data.tar.xz or data.tar.zst found" |
| 27 | + exit 1 |
| 28 | + fi |
| 29 | + |
| 30 | + cd .. |
| 31 | + cp .fetch_config/usr/src/linux-headers-*/.config ./.config |
25 | 32 | fi
|
26 | 33 |
|
27 |
| -cd .. |
28 |
| -cp .fetch_config/usr/src/linux-headers-*/.config ./.config |
29 | 34 | GCC_VERSION=$(cat .config | sed -n 's/CONFIG_CC_VERSION_TEXT=".*\s\(.*\)"$/\1/p')
|
30 | 35 | GCC_VERSION_MAJOR=$(echo "${GCC_VERSION}" | sed -En 's/(.*).[0-9]+/\1/p')
|
31 | 36 |
|
|
0 commit comments