Difference between
modified post 3770b138 by Anonymous on Wed 16th Mar 2022 14:06
original post 4bec58 by Anonymous on Fri 11th Mar 2022 09:29
Download diff
Show
old version |
new version |
both versions
| 1 | 1 | #!/usr/bin/ksh93 | |
| 2 | 2 | ||
| 3 | 3 | # | |
| 4 | 4 | # Build Debian RT kernel from source, | |
| 5 | 5 | # and retain the kernel build including source and *.o | |
| 6 | 6 | # files so we can build custom kernel modules from | |
| 7 | 7 | # that | |
| 8 | 8 | # | |
| 9 | 9 | ||
| 10 | 10 | compound bconfig=( | |
| 11 | 11 | # config | |
| 12 | 12 | typeset kernel_maj_min='5.10' | |
| 13 | 13 | ||
| 14 | 14 | # calculated values | |
| 15 | 15 | typeset kernel_build_path | |
| 16 | 16 | ) | |
| 17 | 17 | ||
| 18 | 18 | function build_debian_kernel_from_src | |
| 19 | 19 | { | |
| 20 | 20 | set -o xtrace | |
| 21 | 21 | set -o errexit | |
| 22 | 22 | set -o nounset | |
| 23 | 23 | ||
| 24 | 24 | integer res | |
| 25 | 25 | integer num_cpus=$(getconf '_NPROCESSORS_CONF') | |
| 26 | 26 | ||
| 27 | 27 | tar xf "/usr/src/linux-source-${bconfig.kernel_maj_min}.tar.xz" | |
| 28 | 28 | ||
| 29 | 29 | cd "linux-source-${bconfig.kernel_maj_min}" | |
| 30 | 30 | ||
| 31 | 31 | unxz <"/usr/src/linux-patch-${bconfig.kernel_maj_min}-rt.patch.xz" | patch -p1 | |
| 32 | 32 | ||
| 33 | 33 | cp "/usr/src/linux-config-${bconfig.kernel_maj_min}/config.amd64_rt_amd64.xz" . | |
| 34 | 34 | unxz 'config.amd64_rt_amd64.xz' | |
| 35 | 35 | ||
| 36 | 36 | # copy config and make kernel build accept it without | |
| 37 | 37 | # jumping to the $ make menu # menu | |
| 38 | 38 | cp 'config.amd64_rt_amd64' '.config' | |
| 39 | 39 | make oldconfig <'/dev/null' | |
| 40 | 40 | ||
| 41 | 41 | # show any modifications $ make oldconfig # did to the kernel config | |
| 42 | 42 | print '--------------------------------------' | |
| 43 | 43 | diff -u 'config.amd64_rt_amd64' '.config' || true | |
| 44 | 44 | print '--------------------------------------' | |
| 45 | 45 | ||
| 46 | 46 | make clean | |
| 47 | 47 | time nice -n 19 make -j$((num_cpus*2)) deb-pkg 2>&1 | tee -a buildlog.log | |
| 48 | 48 | (( res=$? )) | |
| 49 | 49 | ||
| 50 | 50 | printf '#### Finished, return code = %d\n' res | |
| 51 | 51 | ||
| 52 | 52 | if (( res == 0 )) ; then | |
| 53 | 53 | # remember the path to the kernel build, but only if we were successful | |
| 54 | 54 | bconfig.kernel_build_path="$PWD" | |
| 55 | 55 | fi | |
| 56 | 56 | ||
| 57 | 57 | return $res | |
| 58 | 58 | } | |
| 59 | 59 | ||
| 60 | 60 | function build_simatic_kernel_modules | |
| 61 | 61 | { | |
| 62 | 62 | set -o xtrace | |
| 63 | 63 | set -o errexit | |
| 64 | 64 | set -o nounset | |
| 65 | 65 | ||
| 66 | - | cd "${bconfig.kernel_build_path}" | |
| 67 | - | ||
| 66 | + | # dummy for now |
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.
rovema.kpaste.net RSS