System preparation
- Install Ubuntu 22.04.2 LTS
- Install the software package
|
|
Download code
Clone the repository code
|
|
Kernel compilation
Kernel overclocking
Modify the file linux/drivers/clk/qcom/a53-pll.c
|
|
The first column is the operating frequency, and the second column is the supply voltage.
According to the previous rules, it can be roughly judged that the voltage value is increased by 10 for every 200Mhz increase. However, since the chip design frequency is exceeded, power consumption and heat generation must be considered at the same time, so the voltage value must be slightly increased when increasing later. The data after 1401600000 is added according to the above rules.
Modify the file linux/arch/arm64/boot/dts/qcom/msm8916.dtsi. The default frequency appears around line 220. After that, increase the frequency. The increased frequency needs to be added in the previous file.
|
|
Compile configuration
|
|
make msm8916_defconfig imports preset compilation parameters make menuconfig configuration options
Add Klipper USB serial driver
Applicable to the problem that USB devices can be found, but the serial directory and device cannot be found in /dev
- Install lsub sudo apt-get install usbutils
- Switch the USB port to host mode (run as root) echo host > /sys/kernel/debug/usb/ci_hdrc.0/role
- View USB devices Run the lsusb command and you should be able to see the corresponding USB device. If there is no corresponding USB device, it may be a communication problem, a firmware problem, or the board itself is abnormal.
- After all the above problems are solved, add the serial port driver
|
|
Start compiling
|
|
The above command directly generates the deb file package in one step. Enter ls ../ to see it.
The software package corresponding to make-kpkg cannot be updated in Ubuntu 22.04. The official statement is that it has not been maintained for too long, so it was removed. Therefore, the following command cannot be run. It may be possible in some earlier versions.
|
|
After compilation is completed, 3 parts of the file will be generated
-
Kernel deb package, including headers and image linux-headers-5.15.0-handsomekernel+_5.15.0-handsomekernel+-7_arm64.deb and linux-image-5.15.0-handsomekernel+_5.15.0-handsomekernel+-7_arm64.deb are one level above the compilation directory ../
-
Image.gz linux/arch/arm64/boot/Image.gz
-
Device tree dtb linux/arch/arm64/boot/dts/qcom/msm8916-handsome-openstick-xxxxxxxx, choose according to your device
|
|
Process rootfs, root partition
The modification is completed based on the root partition package released by the original openstick project.
Download the original openstick debian base package
|
|
In the debian.zip package, rootfs.img is the img file of the root partition.
使用simg2img转化成可以mount的格式
|
|
chroot handles rootfs
mount root.img
|
|
Install the latest compiled kernel
|
|
Use chroot to enter the mounted system, remove the original linux-image package in the system, and install the just-generated deb software package. Delete the deb file after installation.
|
|
Create rc.local boot script
|
|
Reconfigure locale
The debian used by OpenStick may have been streamlined, so error messages may sometimes appear. warning: setlocale: LC_ALL: cannot change locale (en_US)
The following methods can solve this problem
|
|
You can choose en_US.UTF-8
apt source modification
/etc/apt/sources.list.d/mobian.list is invalid and can be deleted directly
Extract files needed for subsequent boot partitions
File:/mnt/boot/initrd**.img Just copy it in advance
End chroot End umount
Directly enter exit to exit
|
|
Use simg2img to convert back
Convert boot.img to rootfs.img format for flashing
|
|
rootfs.img is the root partition image file after final processing.
Process the boot partition
The following takes the ufi001c device as an example, and other devices can be deduced by analogy.
Required file list
- Image.gz (linux/arch/arm64/boot/Image.gz) generated during compilation
- The device tree dtb (linux/arch/arm64/boot/dts/qcom/msm8916-handsome-openstick-ufi001c.dtb) generated during the compilation process is selected according to your device
- /boot/initrd**.img generated after modifying rootfs
Generate boot
|
|
ufi001c-boot.img is the final generated boot partition image file
At this point, rootfs.img ufi001c-boot.img has been generated. Just replace rootfs.img boot.img in the debian.zip flash package and flash it.