pastebin - collaborative debugging tool
rovema.kpaste.net RSS


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

  1. #!/bin/ksh93
  2.  
  3. #
  4. # build_rovema_kernel.ksh
  5. #
  6. # Written by Roland Mainz <roland.mainz@nrubsig.org>
  7. #
  8.  
  9. #
  10. # build Linux kernel 6.6-RT15
  11. #
  12.  
  13. function build_kernel
  14. {
  15.         set -o errexit
  16.         set -o nounset
  17.  
  18.         # subshell so CWD remains unchanged on return
  19.         (
  20.                 mkdir build_kernel
  21.  
  22.                 cd build_kernel/
  23.                 git clone -b v6.6-rt15 git://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git
  24.  
  25.                 cd linux-rt-devel/
  26.                 cp ../../myconfig_linux_v6_6_rt15.config .config
  27.  
  28.                 #
  29.                 # fixme: add patches here
  30.                 # - rt RCU patch
  31.                 # - default boot args patch
  32.                 # - i915 patches
  33.                 # - rt udev dir
  34.                 #
  35.  
  36.                 time nice -n 19 ksh -c 'CC="gcc -m32" make -j2 bindeb-pkg 2>&1 | tee buildlog.log'
  37.                
  38.                 cd ..
  39.                
  40.                 cp linux-headers-*_i386.deb     "${c.dist_files_dir}/"
  41.                 cp linux-image-*_i386.deb       "${c.dist_files_dir}/"
  42.                 cp linux-libc-*_i386.deb        "${c.dist_files_dir}/"
  43.         )
  44.  
  45.         print '# build_kernel OK'
  46.  
  47.         return 0
  48. }
  49.  
  50.  
  51. #
  52. # build custom igb_avb module
  53. #
  54. function build_igbavb
  55. {
  56.         set -o errexit
  57.         set -o nounset
  58.  
  59.         # subshell so CWD remains unchanged on return
  60.         (
  61.                 mkdir build_igbavb
  62.                 cd build_igbavb/
  63.  
  64.                 git clone https://github.com/Avnu/igb_avb.git
  65.  
  66.                 cd igb_avb/
  67.  
  68.                 # switch to commit 6c115ee89c88f6284d1407244b4a47586c3332d,
  69.                 # which is known to work with Linux 6.6-RT15
  70.                 git checkout '86c115ee89c88f6284d1407244b4a47586c3332d'
  71.  
  72.                 #
  73.                 # apply patches
  74.                 #
  75.                 # fixme:
  76.                 # - pciid patch is missing
  77.                 # - igb patches may need backport (bfp ?)
  78.                 #
  79.                 git am <'../../0001-libigb-Use-PTHREAD_PRIO_INHERIT-for-mutex-to-avoid-r.patch'
  80.                 git am <'../../0002-Disable-pci_-_pcie_error_reporting-for-Linux-kernels.patch'
  81.  
  82.                 #
  83.                 # build kernel module
  84.                 #
  85.                 cd kmod/
  86.                 CC="gcc -m32" make -j4 -C "$PWD/../../../build_kernel/linux-rt-devel/" KSRC="$PWD/../../../build_kernel/linux-rt-devel/" M=$PWD
  87.                 cp igb_avb.ko   "${c.dist_files_dir}/"
  88.                 cd ..
  89.  
  90.                 #
  91.                 # build libigb.a
  92.                 #
  93.                 cd lib
  94.                 CC="gcc -m32" make all
  95.  
  96.                 #
  97.                 # build shared library vesion of libigb.a
  98.                 #
  99.                 gcc -m32 -shared -fPIC -o libigb.so -Wl,--whole-archive libigb.a -Wl,--no-whole-archive -lpthread
  100.                 cp libigb.so    "${c.dist_files_dir}/"
  101.         )
  102.  
  103.         print '# build_igbavb OK'
  104.  
  105.         return 0
  106. }
  107.  
  108. #
  109. # main
  110. #
  111.  
  112. # use ksh93 builtins
  113. export PATH="/opt/ast/bin/:/usr/ast/bin:$PATH"
  114. builtin mkdir
  115.  
  116. # keep all global script data in a compound variable
  117. # so we can use $ print -u2 -v c # for debugging
  118. compound c
  119.  
  120. typeset c.dist_files_dir="$PWD/dist_files"
  121. mkdir -p "${c.dist_files_dir}"
  122.  
  123.  
  124. build_kernel
  125. build_igbavb
  126.  
  127. ls -l "${c.dist_files_dir}"
  128.  
  129. # EOF.

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.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at