# This is a bit obsolete now Follow https://github.com/DorianRudolph/pinenotes#compile-the-kernel For a general getting started, and the debian specific bits from: https://musings.martyn.berlin/ for a better writeup! On a debian 11 box # rkdeveloptool apt install scdoc # uboot sudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu sudo apt install device-tree-compiler sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1 sudo apt install python3-pyelftools git clone -b quartz64 https://gitlab.com/pgwipeout/u-boot-rockchip.git git clone -b rkbin https://github.com/JeffyCN/rockchip_mirrors.git rkbin cd u-boot-rockchip export CROSS_COMPILE=aarch64-linux-gnu- make rk3566-quartz64_defconfig ./make.sh # Kernel sudo apt install flex git clone https://github.com/smaeul/linux.git cd linux git checkout rk356x-ebc-dev make ARCH=arm64 pinenote_defconfig ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make all -j git clone https://gitlab.com/pine64-org/quartz-bsp/linux-next.git cd linux-next/ git checkout rk356x-ebc-dev ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make pinenote_defconfig cp ../linux/arch/arm64/configs/pinenote_defconfig arch/arm64/configs/ ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make pinenote_defconfig ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make all -j #Getting the UART working open the USB cable box, dig out breakout tool! screen /dev/ttyUSB0 1500000 # Booting stuff Get into maskrom mode rkdeveloptool boot ./u-boot-rockchip/rk356x_spol_loader_v1.10.111.bin Reports successful, but seems to stay in Maskrom mode and nothing on UART # Custom kernel/system boot fallocate -l 128MiB myrecovery.bin sudo mkfs.ext2 ./myrecovery.bin sudo mount -o loop -t ext2 ./myrecovery.bin /mnt/pinenote # using smaeul's kernel sudo cp linux/arch/arm64/boot/Image /mnt/pinenote/ sudo cp linux/arch/arm64/boot/dts/rockchip/rk3566-pinenote.dtb /mnt/pinenote/ # Busybox # bits from: https://embeddedgreg.com/2017/06/02/creating-a-busybox-root-filesystem-for-zybo-zynq/ git clone https://git.busybox.net/busybox.git ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make menuconfig ## I chose a statically linked default build ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make -j ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make install rsync -av /._install/ /mnt/pinenote/ sudo cat > /mnt/pinenote/extlinux.conf << EOF timeout 10 default MAINLINE menu title boot prev kernel label MAINLINE kernel /Image fdt /rk3566-pinenote.dtb append earlycon console=tty0 console=ttyS2,1500000n8 fw_devlink=off PMOS_NO_OUTPUT_REDIRECT root=/dev/mmcblk0p9 init=/sbin/init rootwait EOF sudo su - cd /mnt/pinenote mkdir proc sys dev etc mnt opt root tmp var var/log mkdir etc/init.d cat > ./etc/fstab << EOF /dev/root / ext2 defaults 0 0 none /dev/pts devpts gid=5,mode=620 0 0 none /proc proc defaults 0 0 none /sys sysfs defaults 0 0 none /tmp tmpfs defaults 0 0 EOF cat > ./etc/inittab << EOF ::sysinit:/etc/init.d/rcS # /bin/ash # # Start an askfirst shell on the serial ports ttyS0::respawn:-/bin/ash ttyS2::respawn:-/bin/ash # What to do when restarting the init process ::restart:/sbin/init # What to do before rebooting ::shutdown:/bin/umount -a -r EOF sudo cat > etc/init.d/rcS << EOF #!/bin/ash echo "Starting rcS..." echo "++ Mounting filesystem" mount -t proc none /proc mount -t sysfs none /sys mount -t tmpfs none /tmp echo "++ Setting up mdev" echo /sbin/mdev > /proc/sys/kernel/hotplug mdev -s mkdir -p /dev/pts mkdir -p /dev/i2c mount -t devpts devpts /dev/pts echo "rcS Complete" EOF chmod 755 ./etc/init.d/rcS cat > ./etc/passwd << EOF root:x:0:0:root:/root:/bin/sh EOF cd umount /mnt/pinenote exit # from su # Get in to loader mode (normal USB, magnet on circle, face down) rkdeveloptool write-partition recovery myrecovery.img rkdeveloptool reboot # ctrl-c the uboot prompt: sysboot mmc 0:9 ext2 ${scriptaddr} extlinux.conf