可能是世界首发的破烂指引 =。=,贼懒没有记笔记,能想起来的暂时那么多,各位看官凑活凑活看。

1) Config

1. Partition

  • /boot vfat 1G # On the SD card
  • none swap 4G
  • / zfs 1T # USB3.0 link to hdd

2. config.txt

initramfs initramfs-5.4.27-raspberrypi-v8+.img followkernel

3. cmdline.txt

rootwait rootfstype=zfs root=ZFS=r-zcat/gentoo/os zfs.zfs_arc_max=67108864 dwc_otg.lpm_enable=0 console=tty1 console=ttyAMA0,115200 zfs_force=1

2) Kernel

1. Kernel Config

Cryptographic API ---> <*> Deflate compression algorithm

2. Install Kernel

# cat /etc/portage/package.accept_keywords/rpi 
=sys-kernel/raspberrypi-sources-5.4.9999 **

# eselect kernel list
Available kernel symlink targets:
  [1]   linux-5.4.9999-raspberrypi *

# uname -a
Linux rcat 5.4.27-raspberrypi-v8+ #2 SMP Tue Mar 24 19:41:38 -00 2020 aarch64 GNU/Linux

3) Generate Initramfs

Initramfs
Because zfs needs initramfs to mount the /, we need to generate initramfs.

Unfortunately , the initramfs generated by genkernel does not work, and genkernel-next does not support the arm64 and cross options.

So we use dracut to generate here:

# dracut --kver  5.4.27-raspberrypi-v8+