- #!/bin/ksh93
- #
- # build_rovema_kernel.ksh
- #
- # Written by Roland Mainz <roland.mainz@nrubsig.org>
- #
- #
- # build Linux kernel 6.6-RT15
- #
- function build_kernel
- {
- set -o errexit
- set -o nounset
- # subshell so CWD remains unchanged on return
- (
- mkdir build_kernel
- cd build_kernel/
- git clone -b v6.6-rt15 git://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git
- cd linux-rt-devel/
- cp ../../myconfig_linux_v6_6_rt15.config .config
- #
- # fixme: add patches here
- # - rt RCU patch
- # - default boot args patch
- # - i915 patches
- # - rt udev dir
- #
- time nice -n 19 ksh -c 'CC="gcc -m32" make -j2 bindeb-pkg 2>&1 | tee buildlog.log'
- cd ..
- cp linux-headers-*_i386.deb "${c.dist_files_dir}/"
- cp linux-image-*_i386.deb "${c.dist_files_dir}/"
- cp linux-libc-*_i386.deb "${c.dist_files_dir}/"
- )
- print '# build_kernel OK'
- return 0
- }
- #
- # build custom igb_avb module
- #
- function build_igbavb
- {
- set -o errexit
- set -o nounset
- # subshell so CWD remains unchanged on return
- (
- mkdir build_igbavb
- cd build_igbavb/
- git clone https://github.com/Avnu/igb_avb.git
- cd igb_avb/
- # switch to commit 6c115ee89c88f6284d1407244b4a47586c3332d,
- # which is known to work with Linux 6.6-RT15
- git checkout '86c115ee89c88f6284d1407244b4a47586c3332d'
- #
- # apply patches
- #
- # fixme:
- # - pciid patch is missing
- # - igb patches may need backport (bfp ?)
- #
- git am <'../../0001-libigb-Use-PTHREAD_PRIO_INHERIT-for-mutex-to-avoid-r.patch'
- git am <'../../0002-Disable-pci_-_pcie_error_reporting-for-Linux-kernels.patch'
- #
- # build kernel module
- #
- cd kmod/
- CC="gcc -m32" make -j4 -C "$PWD/../../../build_kernel/linux-rt-devel/" KSRC="$PWD/../../../build_kernel/linux-rt-devel/" M=$PWD
- cp igb_avb.ko "${c.dist_files_dir}/"
- cd ..
- #
- # build libigb.a
- #
- cd lib
- CC="gcc -m32" make all
- #
- # build shared library vesion of libigb.a
- #
- gcc -m32 -shared -fPIC -o libigb.so -Wl,--whole-archive libigb.a -Wl,--no-whole-archive -lpthread
- cp libigb.so "${c.dist_files_dir}/"
- )
- print '# build_igbavb OK'
- return 0
- }
- #
- # main
- #
- # use ksh93 builtins
- export PATH="/opt/ast/bin/:/usr/ast/bin:$PATH"
- builtin mkdir
- # keep all global script data in a compound variable
- # so we can use $ print -u2 -v c # for debugging
- compound c
- typeset c.dist_files_dir="$PWD/dist_files"
- mkdir -p "${c.dist_files_dir}"
- build_kernel
- build_igbavb
- ls -l "${c.dist_files_dir}"
- # EOF.
build_rovema_kernel.ksh (version 4, new worseisbetter attempt)
Posted by Anonymous on Tue 12th Dec 2023 17:06
raw | new post
view followups (newest first): build_rovema_kernel.ksh (version 4, new worseisbetter attempt) by Anonymous
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.