1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # T2 SDE: package/*/linux/linux.conf
3 # Copyright (C) 2004 - 2021 The T2 SDE Project
4 # Copyright (C) 1998 - 2003 ROCK Linux Project
6 # This Copyright note is generated by scripts/Create-CopyPatch,
7 # more information can be found in the files COPYING and README.
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License version 2.
11 # --- T2-COPYRIGHT-NOTE-END ---
13 . $base/package/*/linux*/linux-conf.in
17 var_append CC_WRAPPER_APPEND ' ' 'crypto/jitterentropy.c?-O0:'
18 var_append KCC_WRAPPER_APPEND ' ' 'crypto/jitterentropy.c?-O0:'
19 var_append KCC_WRAPPER_APPEND ' ' '*/vdso/*?-O2:'
25 moduledir="$root/lib/modules/${lx_kernelrelease}"
28 hook_add preconf 5 linux_preconf
31 # we need to rerun the oldconfig since the used .config
32 # might not match the one used in the last oldconfig run
33 # (e.g. the nomods is run last - and normally the module
35 yes '' | eval $MAKE $makeopt oldconfig > /dev/null
37 echo "Cleanup kernel ..."
38 eval $MAKE $makeopt clean > /dev/null
40 cp -vf .config $root/boot/kconfig_${lx_kernelrelease}
41 [ -e $confdir/t2logo.ppm ] &&
42 cp -vf $confdir/t2logo.ppm drivers/video/logo/logo_linux_clut224.ppm
44 if [ $SDECFG_PKG_LINUX_KEEP_SRC = 1 ]; then
45 echo "Copying kernel source ..."
46 rm -rf $root/usr/src/linux-${lx_kernelrelease}
47 mkdir -p $root/usr/src/linux-${lx_kernelrelease}
48 cp -ar . $root/usr/src/linux-${lx_kernelrelease}
52 mips) var_append makeopt ' ' 'vmlinux vmlinux.ecoff' ;;
53 nios2) var_append makeopt ' ' 'vmlinux zImage' ;;
56 if grep -q "CONFIG_MODULES=y" .config; then
57 [ "${makeopt% vmlinux *}" != "$makeopt" ] && var_append makeopt ' ' 'modules'
58 var_append makeinstopt ' ' "INSTALL_MOD_PATH=$root DEPMOD=/bin/true modules_install"
59 #var_append makeinstopt ' ' "mod_compress_cmd='zstd -f --rm -18'"
64 hook_add premake 5 linux_premake
67 echo "Installing the kernel ..."
68 cp -vf System.map $root/boot/System.map-${lx_kernelrelease}
70 # for debugging with oprofile, also used to boot on some arches
71 cp -vf vmlinux $root/boot/vmlinux-${lx_kernelrelease}
74 cp -vf arch/${lx_cpu}/boot/bzImage $root/boot/vmlinuz-${lx_kernelrelease}
77 cp -vf arch/${lx_cpu}/boot/images/uImage $root/boot/uImage-${lx_kernelrelease}
80 cp -vf arch/${lx_cpu}/boot/zImage $root/boot/zImage-${lx_kernelrelease}
83 cp -vf arch/${lx_cpu}/boot/Image.gz $root/boot/Image-${lx_kernelrelease}.gz
86 cp -vf arch/alpha/boot/vmlinux.gz $root/boot/vmlinux-${lx_kernelrelease}.gz
89 cp -vf arch/${lx_cpu}/boot/vmlinux.ecoff $root/boot/vmlinux-${lx_kernelrelease}.ecoff
92 for x in arch/powerpc/boot/zImage*; do
93 [[ $x != *lds* ]] && cp -v $x $root/boot/${x/*\//}-${lx_kernelrelease}
97 cp -vf arch/sh/boot/zImage $root/boot/vmlinux-${lx_kernelrelease}
100 cp -vf arch/sparc/boot/image $root/boot/vmlinuz-${lx_kernelrelease}
104 echo "Copying DTB ..."
105 find arch/$lx_cpu -name "*.dtb" | while read f; do
106 mkdir -p $root/boot/dtb
107 cp -vf $f $root/boot/dtb/
110 # iterate over the packages that provide 3rd party linux kernel modules
111 if grep -q "CONFIG_MODULES=y" .config; then
113 echo "Building registered 3rd party module packages ..."
114 for x in $lx_3rd_party_modules; do
115 echo "Sub-building 3rd party module package $x ..."
117 # ugly, bash does not abort properly when we have this in a if
118 # and without it the return 1 aborts immediatly ... :-(
120 build_package $x postlinux.conf
123 if [ $error -ne 0 ]; then
124 echo_warning "Failed building $x"
127 echo "Done building $x"
132 if ! atstage rebuild && [ $module_error = 1 ]; then
133 abort "At least one of the 3rd party kernel modules failed!"
136 local depmod="depmod"
137 atstage native || depmod="${archprefix}depmod"
138 echo "Running $depmod -a -b $root/ ..."
139 $depmod -a -b $root/ -F $root/boot/System.map-${lx_kernelrelease} ${lx_kernelrelease}
141 # due "mostly" static depmod :-(
142 for x in $moduledir/modules.*
143 do [ -f $x ] && add_flist $x; done
145 echo "Fixing /lib/modules/${ver}/{build,source} symlink ..."
146 rm -f $root/lib/modules/${lx_kernelrelease}/{build,source}
147 ln -sf ../../../usr/src/linux-${lx_kernelrelease} \
148 $root/lib/modules/${lx_kernelrelease}/build
149 ln -sf ../../../usr/src/linux-${lx_kernelrelease} \
150 $root/lib/modules/${lx_kernelrelease}/source
154 atstage native || initrdopts="-R $root -a $archprefix"
155 if [ -e $root/sbin/mkinitrd ]; then
156 $root/sbin/mkinitrd $initrdopts --minimal --network \
157 -o $root/boot/minird-${lx_kernelrelease} ${lx_kernelrelease}
158 $root/sbin/mkinitrd $initrdopts ${lx_kernelrelease}
162 cp -arv Documentation/{*.txt,fb,networking,power} $root$docdir/
164 echo "Copying kernel patches ..."
167 rm -rf linux-patches; mkdir -p linux-patches
168 echo -e "This directory contains all the applied patches, used\n\
169 to build the kernel (in addition to the official kernel sources)." > \
171 for x in $patchfiles; do
172 # if the patch does not exist it was downloaded or so
173 # and we just do not copy it ...
174 [ -f $x ] && cp -vf $x linux-patches/
178 hook_add postmake 5 linux_install