Linux kernel source with OnePlus 5 (cheeseburger) / 5T (dumpling) mainlining efforts
This repository is deprecated in favor of msm8998-mainline/linux on GitLab where development has continued where this tree left off :)
Linux mainline kernel fork focused on OnePlus 5 (cheeseburger) / 5T (dumpling) devices.
Ubuntu 20.04 LTS
# apt install build-essential flex bison libssl-dev bc kmod gcc-aarch64-linux-gnu mkbootimg
export ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
make oneplus5_defconfig # see arch/arm64/configs/
make -j$(nproc)
make INSTALL_MOD_PATH=rootfs modules_install -j$(nproc)
tar -czf modules.tar.gz -C rootfs/lib/modules . --owner=0 --group=0 --numeric-owner
NOTE: In case you want to boot without a ramdisk you need to make menuconfig
after generating a .config
and tweak the following:
# change sde21 (system) below to match your desired rootfs partition
CONFIG_CMDLINE="clk_ignore_unused loglevel=3 quiet root=/dev/sde21"
CONFIG_CMDLINE_FORCE=y
Otherwise see e.g. my initramfs-tools after building; the cmdline below will contain rd.*
option examples that are specific to my ramdisk, such as booting a loopback-based rootfs.img
on the userdata
partition root :)
Next install osm0sis/mkbootimg to create an Android bootloader compatible boot image:
DEVICE="cheeseburger" # change depending on which device you're targeting
cat arch/arm64/boot/{Image.gz,dts/qcom/msm8998-oneplus-$DEVICE.dtb} > Image.gz-dtb
mkbootimg --kernel Image.gz-dtb --ramdisk /path/to/initramfs.cpio* \
--cmdline "clk_ignore_unused loglevel=3 quiet rd.rootfs=/dev/sda13/rootfs.img rd.extra_hooks=configfs,rndis" \
--base 0x0 --pagesize 4096 -o boot.img
Same steps as above apply, except instead of mkbootimg
run:
abootimg -u /path/to/boot.img -k Image.gz-dtb
NOTE: Kernel cmdline can also be easily tweaked using abootimg -u ... -c "cmdline=..."
(assuming you’re not using CMDLINE_FORCE=y
).
Now you can use e.g. fastboot boot boot.img
or fastboot flash boot boot.img && fastboot reboot
to boot the newly compiled kernel.
Currently probing ipa
(built as a module) without firmware in place causes a kernel panic (as of v5.12). If you don’t wish to deal with this you can:
CONFIG_QCOM_IPA=n
in make menuconfig
and rebuild the kernelmodprobe.blacklist=ipa
added to cmdlineOtherwise follow these steps to enable features such as Bluetooth and Wi-Fi:
wget https://github.com/JamiKettunen/firmware-mainline-oneplus5/archive/10.0.1.tar.gz
scp 10.0.1.tar.gz user@172.16.42.1:~
ssh -t user@172.16.42.1 "sudo sh -c 'mkdir -p /lib/firmware && tar -xmf 10.0.1.tar.gz --strip-components=1 -C /lib/firmware && find /lib/firmware/* -maxdepth 0 ! -name qca ! -name ath10k ! -name qcom -delete && rm 10.0.1.tar.gz && sync; echo Firmware deployed.'"
Once booted you should have an SSH connection via USB RNDIS to the device, which means you can just scp
over the previously made modules.tar.gz
and extract it:
scp modules.tar.gz user@172.16.42.1:~
ssh -t user@172.16.42.1 "sudo sh -c 'mkdir -p /lib/modules && tar -xmf modules.tar.gz -C /lib/modules && rm modules.tar.gz && sync && reboot'"
NOTE: 172.16.42.1
is the default IP address my ramdisk assigns to the device’s USB interface from the RNDIS hook.
/sys/class/leds/white:kbd_backlight
)ath10k_snoc
driver probed the shutdown is additionally hung by some amount due to the remoteproc refusing to shutdown cleanlydashd
Android blob is reverse engineereddmesg
fastboot boot
working so far