-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreadme.mup
73 lines (69 loc) · 5.53 KB
/
readme.mup
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
# directories:
# - /compile/doc/stable-mt - the files in this dir
# - /compile/source/linux-stable-mup - the kernel sources checked out from gitrepo
# - /compile/result/stable-mtup - the resulting kernel, modules etc. tar.gz files
# - /compile/doc/kernel-config-options - https://github.com/hexdump0815/kernel-config-options
# name: stb-mup
# IMPORTANT: this is work in progress and not yet ready to use!
# status: not yet known
# credits go to https://github.com/eballetbo/linux.git
# and to https://github.com/eballetbo/chromebooks.git
# INFO: based on the tree commit: 2dd6b216979375d927ee5e953e0b0157a7505d72
# from branch: origin/topic/chromeos/somewhat-stable-5.12
# patches:
patch -p1 < /compile/doc/stable-mt/misc.mup/patches/v5.12/mt8173-higher-temps.patch
patch -p1 < /compile/doc/stable-mt/misc.mup/patches/v5.12/mt8173-fix-mmc-order.patch
patch -p1 < /compile/doc/stable-mt/misc.mup/patches/v5.12/mt8173-fix-mmc1-speed.patch
patch -p1 < /compile/doc/stable-mt/misc.mup/patches/v5.12/mt8183-gce-client.patch
patch -p1 < /compile/doc/stable-mt/misc.mup/patches/v5.12/mt8183-mali-gpu.patch
patch -p1 < /compile/doc/stable-mt/misc.mup/patches/v5.12/mt8183-panel-orientation.patch
patch -p1 < /compile/doc/stable-mt/misc.mup/patches/v5.12/mt8183-panel-power.patch
patch -p1 < /compile/doc/stable-mt/misc.mup/patches/v5.12/mt8183-thermal.patch
patch -p1 < /compile/doc/stable-mt/misc.mup/patches/v5.12/mt8183-drm.patch
export ARCH=arm64
scripts/kconfig/merge_config.sh -m arch/arm64/configs/defconfig /compile/doc/kernel-config-options/chromebooks-aarch64.cfg /compile/doc/kernel-config-options/mediatek.cfg /compile/doc/kernel-config-options/docker-options.cfg /compile/doc/kernel-config-options/options-to-remove-generic.cfg /compile/doc/stable-mt/misc.mup/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-mt/misc.mup/options/additional-options-special.cfg
( cd /compile/doc/kernel-config-options ; git rev-parse --verify HEAD ) > /compile/doc/stable-mt/misc.mup/options/kernel-config-options.version
make olddefconfig
make -j 4 Image dtbs modules
cd tools/perf
make
cd ../power/cpupower
make
cd ../../..
export kver=`make kernelrelease`
echo ${kver}
# remove debug info if there and not 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}
cp -v arch/arm64/boot/Image /boot/Image-${kver}
mkdir -p /boot/dtb-${kver}
cp -v arch/arm64/boot/dts/mediatek/mt81*.dtb /boot/dtb-${kver}
cp -v System.map /boot/System.map-${kver}
# start chromebook special - required: apt-get install liblz4-tool vboot-kernel-utils
cp arch/arm64/boot/Image Image
lz4 -f Image Image.lz4
cp /compile/doc/stable-mt/misc.mup/misc/cmdline cmdline
# for console via usb srial adapter - see: https://github.com/Sonicadvance1/linux/issues/27#issuecomment-823668871
# cp /compile/doc/stable-mt/misc.mup/misc/cmdline.usb cmdline
dd if=/dev/zero of=bootloader.bin bs=512 count=1
# this line would include the rk3399 chromebook dtbs as well
#mkimage -D "-I dts -O dtb -p 2048" -f auto -A arm64 -O linux -T kernel -C lz4 -a 0 -d Image.lz4 -b arch/arm64/boot/dts/mediatek/mt8173-elm.dtb -b arch/arm64/boot/dts/mediatek/mt8173-elm-hana.dtb -b arch/arm64/boot/dts/mediatek/mt8173-elm-hana-rev7.dtb -b arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-damu.dtb -b arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-juniper-sku16.dtb -b arch/arm64/boot/dts/mediatek/mt8183-kukui-krane-sku0.dtb -b arch/arm64/boot/dts/mediatek/mt8183-kukui-krane-sku176.dtb -b arch/arm64/boot/dts/rockchip/rk3399-gru-bob.dtb -b arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dtb -b arch/arm64/boot/dts/rockchip/rk3399-gru-scarlet-inx.dtb -b arch/arm64/boot/dts/rockchip/rk3399-gru-scarlet-kd.dtb kernel.itb
mkimage -D "-I dts -O dtb -p 2048" -f auto -A arm64 -O linux -T kernel -C lz4 -a 0 -d Image.lz4 -b arch/arm64/boot/dts/mediatek/mt8173-elm.dtb -b arch/arm64/boot/dts/mediatek/mt8173-elm-hana.dtb -b arch/arm64/boot/dts/mediatek/mt8173-elm-hana-rev7.dtb -b arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-damu.dtb -b arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-juniper-sku16.dtb -b arch/arm64/boot/dts/mediatek/mt8183-kukui-krane-sku0.dtb -b arch/arm64/boot/dts/mediatek/mt8183-kukui-krane-sku176.dtb kernel.itb
vbutil_kernel --pack vmlinux.kpart --keyblock /usr/share/vboot/devkeys/kernel.keyblock --signprivate /usr/share/vboot/devkeys/kernel_data_key.vbprivk --version 1 --config cmdline --bootloader bootloader.bin --vmlinuz kernel.itb --arch arm
cp -v vmlinux.kpart /boot/vmlinux.kpart-${kver}
rm -f Image Image.lz4 cmdline bootloader.bin kernel.itb vmlinux.kpart
# end chromebook special
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-mup/${kver}.tar.gz /boot/*-${kver} /lib/modules/${kver}
cp -v /compile/doc/stable-mt/config.mup /compile/doc/stable-mt/config.mup.old
cp -v /compile/source/linux-stable-mup/.config /compile/doc/stable-mt/config.mup
cp -v /compile/source/linux-stable-mup/.config /compile/doc/stable-mt/config.mup-${kver}
cp -v /compile/source/linux-stable-mup/*.tar.gz /compile/result/stable-mt