-
Notifications
You must be signed in to change notification settings - Fork 1
/
readme.rpi
61 lines (57 loc) · 3.47 KB
/
readme.rpi
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
# directories:
# - /compile/doc/stable-rp - the files in this dir
# - /compile/source/linux-stable-rpi - the kernel sources checked out from gitrepo
# - /compile/result/stable-rp - the resulting kernel, modules etc. tar.gz files
# - /compile/doc/kernel-config-options - https://github.com/hexdump0815/kernel-config-options
# name: stb-rpi - raspberry-pi
# it looks like for newer kernel versions like v6.5 the following packages have to be
# installed in order to get the tool compiled well: libelf-dev python3-dev libtraceevent-dev
cd /compile/source/linux-stable-rpi
# patches:
# v5.4 - fix v3d power setup for rpi3 - not sure if this is really required still
#patch -p1 < /compile/doc/stable-rp/misc.rpi/patches/rpi3-v3d-power-fix.patch
# fix a typo to be able to enable the v3d driver - no longer needed with v5.16
#patch -p1 < /compile/doc/stable-rp/misc.rpi/patches/fix-v3d-typo.patch
# add v3d gpu accel support to make mesa opengl work on the rpi4 - should be no longer needed with v6.1
#patch -p1 < /compile/doc/stable-rp/misc.rpi/patches/rpi4-v3d-integration.patch
# fix kernel version number: + instead of -dirty at the end
patch -p1 < /compile/doc/stable/misc.cbq/patches/fix-kernel-version-number-v6.6.patch
export ARCH=arm64
scripts/kconfig/merge_config.sh -m arch/arm64/configs/defconfig /compile/doc/kernel-config-options/docker-options.cfg /compile/doc/kernel-config-options/options-to-remove-generic.cfg /compile/doc/stable-rp/misc.rpi/options/options-to-remove-special.cfg /compile/doc/kernel-config-options/additional-options-generic.cfg /compile/doc/kernel-config-options/additional-options-aarch64.cfg /compile/doc/stable-rp/misc.rpi/options/additional-options-special.cfg
( cd /compile/doc/kernel-config-options ; git rev-parse --verify HEAD ) > /compile/doc/stable-rp/misc.rpi/options/kernel-config-options.version
make olddefconfig
#make -j 4 CFLAGS="-march=armv8-a+crc -mtune=cortex-a72" CXXFLAGS="-march=armv8-a+crc -mtune=cortex-a72" Image dtbs modules
make -j 4 Image dtbs modules
cd tools/perf
# this is to avoid compile errors
export NO_JEVENTS=1
make
cd ../power/cpupower
make
cd ../../..
export kver=`make kernelrelease`
echo ${kver}
# remove debug info if there and wanted
# find . -type f -name '*.ko' | sudo xargs -n 1 objcopy --strip-unneeded
make modules_install
mkdir -p /lib/modules/${kver}/tools
cp -v tools/perf/perf /lib/modules/${kver}/tools
cp -v tools/power/cpupower/cpupower /lib/modules/${kver}/tools
cp -v tools/power/cpupower/libcpupower.so.0.0.1 /lib/modules/${kver}/tools/libcpupower.so.0
# make headers_install INSTALL_HDR_PATH=/usr
cp -v .config /boot/config-${kver}
# for rpi
cp -v arch/arm64/boot/Image /boot/Image-${kver}
# in case that is needed anywhere
mkimage -A arm64 -O linux -T kernel -C none -a 0x1080000 -e 0x1080000 -n linux-${kver} -d arch/arm64/boot/Image /boot/uImage-${kver}
mkdir /boot/dtb-${kver}
cp -v arch/arm64/boot/dts/broadcom/bcm*-rpi-*.dtb /boot/dtb-${kver}/
cp -v System.map /boot/System.map-${kver}
cd /boot
update-initramfs -c -k ${kver}
mkimage -A arm64 -O linux -T ramdisk -a 0x0 -e 0x0 -n initrd.img-${kver} -d initrd.img-${kver} uInitrd-${kver}
tar cvzf /compile/source/linux-stable-rpi/${kver}.tar.gz /boot/*-${kver} /lib/modules/${kver}
cp -v /compile/doc/stable-rp/config.rpi /compile/doc/stable-rp/config.rpi.old
cp -v /compile/source/linux-stable-rpi/.config /compile/doc/stable-rp/config.rpi
cp -v /compile/source/linux-stable-rpi/.config /compile/doc/stable-rp/config.rpi-${kver}
cp -v /compile/source/linux-stable-rpi/*.tar.gz /compile/result/stable-rp