pastebin - collaborative debugging tool
rovema.kpaste.net RSS

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

    
11
#!/usr/bin/ksh93
22
33
#
44
# Build Debian RT kernel from source,
55
# and retain the kernel build including source and *.o
66
# files so we can build custom kernel modules from
77
# that
88
#
99
1010
compound bconfig=(
1111
	# config
1212
	typeset kernel_maj_min='5.10'
1313
1414
	# calculated values
1515
	typeset kernel_build_path
1616
)
1717
1818
function build_debian_kernel_from_src
1919
{
2020
	set -o xtrace
2121
	set -o errexit
2222
	set -o nounset
2323
2424
	integer res
2525
	integer num_cpus=$(getconf '_NPROCESSORS_CONF')
2626
2727
	tar xf "/usr/src/linux-source-${bconfig.kernel_maj_min}.tar.xz"
2828
2929
	cd "linux-source-${bconfig.kernel_maj_min}"
3030
3131
	unxz <"/usr/src/linux-patch-${bconfig.kernel_maj_min}-rt.patch.xz" | patch -p1
3232
3333
	cp "/usr/src/linux-config-${bconfig.kernel_maj_min}/config.amd64_rt_amd64.xz" .
3434
	unxz 'config.amd64_rt_amd64.xz'
3535
3636
	# copy config and make kernel build accept it without
3737
	# jumping to the $ make menu # menu
3838
	cp 'config.amd64_rt_amd64' '.config'
3939
	make oldconfig <'/dev/null'
4040
4141
	# show any modifications $ make oldconfig # did to the kernel config
4242
	print '--------------------------------------'
4343
	diff -u 'config.amd64_rt_amd64' '.config' || true
4444
	print '--------------------------------------'
4545
4646
	make clean
4747
	time nice -n 19 make -j$((num_cpus*2)) deb-pkg 2>&1 | tee -a buildlog.log
4848
	(( res=$? ))
4949
5050
	printf '#### Finished, return code = %d\n' res
5151
5252
	if (( res == 0 )) ; then
5353
		# remember the path to the kernel build, but only if we were successful
5454
		bconfig.kernel_build_path="$PWD"
5555
	fi
5656
5757
	return $res
5858
}
5959
6060
function build_simatic_kernel_modules
6161
{
6262
	set -o xtrace
6363
	set -o errexit
6464
	set -o nounset
6565
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.

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