blob: 3431825e33efa66ccd7c0b8b309634fe22c30689 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
name=linux
version=6.18.18
release=1
source="https://cdn.kernel.org/pub/$name/kernel/v6.x/$name-$version.tar.xz
dotconfig
andes_export_filldir_readdir.patch
fix-musl-btf-ids.patch
fix-musl-objtool.patch fixdep-largefile.patch"
build() {
make mrproper
cp $SRC/dotconfig .config
sed '/^CONFIG_LOCALVERSION=/d' -i .config
echo 'CONFIG_LOCALVERSION="-Alice"' >> .config
#sed '/^CONFIG_IKHEADERS=/d' -i .config
#echo '# CONFIG_IKHEADERS is not set' >> .config
#sed '/^# CONFIG_MODULE_COMPRESS_XZ/d' -i .config
#echo 'CONFIG_MODULE_COMPRESS_XZ=y' >> .config
#sed '/^CONFIG_FW_LOADER_COMPRESS_ZSTD/d' -i .config
sed '/^# CONFIG_UEVENT_HELPER/d' -i .config
echo 'CONFIG_UEVENT_HELPER=y' >> .config
echo 'CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"' >> .config
make olddefconfig
kernver=${version}$(grep CONFIG_LOCALVERSION= .config | cut -d '"' -f2)
[ "$MENUCONFIG" ] && make menuconfig
make bzImage modules
make INSTALL_MOD_PATH=$PKG INSTALL_MOD_STRIP=1 modules_install
mkdir -p $PKG/boot
cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-linux
touch $PKG/lib/modules/$kernver/current
make clean
make prepare
rm -rf $PKG/lib/firmware
for file in $(ls arch); do
case $file in
x86|Kconfig) continue ;;
*) rm -fr arch/$file ;;
esac
done
# strip down sources
# don't package the kernel in the sources directory
find . -name "*Image" -exec rm "{}" \;
find . -name "*.cmd" -exec rm -f "{}" \;
rm -f .*.d
rm -fr firmware ipc .config.old .version .cocciconfig \
.get_maintainer.ignore .gitattributes .gitignore .mailmap \
COPYING CREDITS MAINTAINERS README Documentation
find . -name ".gitignore" -exec rm "{}" \;
for dir in block certs crypto drivers fs init kernel lib mm net samples security sound usr virt; do
find $dir -type f \( -name "*.c" -o -name "*.h" \) -exec rm "{}" \;
done
for i in $(ls tools); do
[ "$i" = "objtool" ] || rm -fr tools/$i
done
for i in $(ls tools/objtool); do
[ "$i" = "objtool" ] || rm -fr tools/objtool/$i
done
rm $PKG/lib/modules/$kernver/build \
$PKG/lib/modules/$kernver/source || true
mv $SRC/linux-${version%.0} $PKG/lib/modules/$kernver/build
ln -sv build $PKG/lib/modules/$kernver/source
# remove now broken symlinks
find -L $PKG/lib/modules/$kernver/build -type l -exec rm -f "{}" \;
mv $PKG/lib/modules/$kernver $PKG/lib/modules/linux
ln -s linux $PKG/lib/modules/$kernver
}
|