Step by step creation of Coolpi image files
-
The partitioning situation of the Coolpi image file is as follow
- The first partition has a size of 512M and a partition format of fat32, used to store boot- files. The default boot mode is extLinux.
- The second partition is the file system, with different sizes depending on the distribution. The partition format is ext4. The label of the partition is writable, which needs to be consistent with the configuration information under extLinux.
- The file of the boot partition is shown in the following figure, which you can access through/ The build kernel. sh command compiles the coolpi kernel, and then the files in the out directory need to be copied to the boot partition.
- The content is as follows extlinux.conf,Pay special attention to the loading method of the file system, which is searched through label (writable). Of course, it can also be modified to UUID or other types.
default Linux coolpi label Linux coolpi kernel /Image initrd /initrd.img fdt /rk3588-cpcm5-notebook-v20.dtb append root=LABEL=writable rw rootfstype=ext4 console=ttyS0,115200n81 quiet splash plymouth.ignore-serial-consoles vt.global_cursor_default=1 irqchip.gicv3_pseudo_nmi=0 net.ifnames=0
Start creating a mirror image
- Create an 8GB img file using the following command. Then partition and format.
LOOP_NUMBER=$(losetup -f) dd if=/dev/zero of=./coolpi.img bs=1M count=8192 printf 'n\np\n1\n32768\n1081343\nn\np\n2\n1081344\n16777215\nw\n' | fdisk ./coolpi.img partx -a -v ./coolpi.img mkfs.vfat $LOOP_NUMBER"p1" echo 'yes\n' | mkfs.ext4 $LOOP_NUMBER"p2" e2label $LOOP_NUMBER"p2" writable
- Copy files to boot partition,kernel-dir is the file directory corresponding to the Coolpi kernel.
mkdir ./mnt mount $LOOP_NUMBER"p1" ./mnt cp kernel-dir/out/* ./mnt -r umount ./mnt
- Create a file system, Add rc.local file to automatically expand partitions and configure some system node permissions.
wget https://mirrors.aliyun.com/archlinuxarm/os/ArchLinuxARM-aarch64-latest.tar.gz mkdir ./archlinux tar -zxvf ArchLinuxARM-aarch64-latest.tar.gz -C ./archlinux/ mount $LOOP_NUMBER"p2" ./mnt cp -rf ./archlinux/* ./mnt/ tar -zxvf kernel-dir/out/modules.tar.gz -C ./mnt/lib/ cp ./rc.local ./mnt/etc/ umount ./mnt e2fsck -p -f $LOOP_NUMBER"p2" resize2fs -M $LOOP_NUMBER"p2" losetup -D $LOOP_NUMBER
-
Thanks for the guilde.
But I'm afriaid the biggest issues is make panfork/npu working. -
@plumlis
Refer to the following link to compile and install.
https://github.com/coolpi-george/panfork.git -
@george THX.
Tried to compile mesa-panfork under Fedora 40. Finally make it work.But seeem fedora arch64 still have some stable issues with rk3588 support. especially kernel 5.10 and panfork. maybe fedora arch64 is make to working with arch64 mainline kernel. not Kernel rockchip bsp.
Move back to ubuntu and will try it next time.
-
@plumlis
At present, the mainline kernel is stuck in the edp driver. Due to significant changes in the display framework, the workload of porting is huge. The mainline kernel can be used in subsequent updates. -
@george
Many thanks for your reply. Is there any guide about how to compile mpp/rknpu module with cool pi kernel?And is it possible to compile cool pi kernel 6.1 with panfork?
-