Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Architectures & Platforms Gentoo on ARM
  • Search

Gentoo on Pinetab2

Gentoo on all things ARM. Both 32 bit and 64 bit.
Tell about your hardware and CHOST.
Problems with crossdev targeting ARM hardware go here too.
Post Reply
  • Print view
Advanced search
2 posts • Page 1 of 1
Author
Message
ianthebadguy
n00b
n00b
Posts: 1
Joined: Sun Feb 02, 2025 4:50 am

Gentoo on Pinetab2

  • Quote

Post by ianthebadguy » Sun Feb 02, 2025 5:03 am

Hello all,

I've had a Pine64 Pinetab2 for a couple weeks, and I've been looking to get Gentoo running off an SD card, with primarily official binhost packages from the default/linux/arm64/23.0/desktop/plasma/systemd profile. My daily driver desktop is Gentoo on amd64, but this is my first experience trying to run arm64. I first posted at the official Pine64 forums, but I haven't gotten any response there in over a week. Here's my original post from over there:
Hello,

I've been trying to set up Gentoo on an SD card in my Pinetab2 since I received it a few weeks ago. I am generally more comfortable with Portage than pacman, and I would also like to test and possibly provide support for Gentoo's arm64 binary packages. This means that I have built a partition table up from scratch on the SD card, rather than duplicating an existing installation image. It's a very simple partition table:

mmcblk1p1: EFI boot partition mounted at /efi, FAT32
mmcblk1p2: swap
mmcblk1p3: root partition, ext4

The Pine64 RockPro64 entry on the Gentoo wiki: https://wiki.gentoo.org/wiki/PINE64_ROC ... bootloader indicates that whoever wrote it had success using a standalone build of Grub on an EFI system partition to get the RockPro to boot, but I am not having the same success on the Pinetab. Should I instead be installing U-Boot to the boot partition? Or flashing it to the first sectors of the SD card? I am still unsure about the normal procedure for using U-Boot or where it should be installed.

At what point might I also want to consider the rk2aw bootloader? This person had success using it with Fedora: https://www.jistr.com/blog/2023-11-27-f ... -pinetab2/

It also seems like the tablet is now not booting at all with the SD card inserted, which was not the case before I formatted the SD card with the boot partition. But it could be possible that it is actually attempting to boot but I just have no video output/keyboard backlight, since the stock Gentoo binary kernel probably doesn't have drivers for these. I can attempt to use the Danctnix kernel patches and build my own kernel, but I am curious, exactly what devices does it patch in support for?

The bes2600 wifi driver is not important to start with, as I have a USB-Ethernet adapter that has Linux kernel support. I plan to install the wifi driver after I have a properly booting system, and also write a Gentoo ebuild for it.
Basically, the first step I'm trying to take is figure out if I can use Das U-Boot on the FAT32 UEFI partition. rk2aw seems like it may be more useful as a replacement bootloader on the internal SPI flash. Neither arm64 specific bootloader, U-Boot or rk2aw, seems to be in the main gentoo package tree, so I will likely end up writing custom ebuilds for those as well as the bes2600 wifi driver. Hoping somebody with more arm64 experience can point me in the right direction.
Top
CmdrMoozy
n00b
n00b
Posts: 5
Joined: Wed Feb 13, 2013 4:49 pm

  • Quote

Post by CmdrMoozy » Wed Jul 02, 2025 4:00 am

Hi,

I too own a Pinetab2, and I recently got Gentoo working on it. As far as I know the Pinetab2 doesn't support EFI whatsoever; I boot with U-Boot. Getting that working was a bit complicated.

As far as I've been able to determine, you *need* some binary blobs to get a fully working U-Boot. These are available from: https://github.com/rockchip-linux/rkbin.git

I grabbed the U-Boot sources from https://source.denx.de/u-boot/u-boot.git, and the blobs from there. Then from within the root U-Boot directory you can build like this:

Code: Select all

export BL31=../rkbin/bin/rk35/rk3568_bl31_ultra_v2.17.elf
export ROCKCHIP_TPL=../rkbin/bin/rk35/rk3566_ddr_1056MHz_ultra_v1.20.bin
make pinetab2-rk3566_defconfig
CROSS_COMPILE=aarch64-unknown-linux-musl- make -j16
Then to install the resulting U-Boot binary on an SDCard, you need a fairly particular partition layout. Here's mine (the ordering and sizes of the first 3 partitions are important!):

Code: Select all

Disk /dev/mmcblk1: 238.75 GiB, 256355860480 bytes, 500695040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier:

Device           Start       End   Sectors   Size Type
/dev/mmcblk1p1      64     16383     16320     8M U-Boot environment
/dev/mmcblk1p2   16384     24575      8192     4M U-Boot environment
/dev/mmcblk1p3   24576     32767      8192     4M U-Boot environment
/dev/mmcblk1p4   32768   2097151   2064384  1008M EFI System
/dev/mmcblk1p5 2097152 500694975 498597824 237.7G Linux filesystem
Then you can copy the U-Boot image:

Code: Select all

dd if=u-boot-rockchip.bin of=/dev/sdX1
Then you need to write a boot.scr to tell U-Boot how to boot your kernel. Here is mine:

Code: Select all

# On pinetab2, devnum 1 => SDCARD, devnum 0 => eMMC
#
# This script assumes we are booting from the SDCARD. We assume it has a GPT
# partition table like this (from [1]):
#
# GPT fdisk (gdisk) version 1.0.10
#
# Partition table scan:
#   MBR: protective
#   BSD: not present
#   APM: not present
#   GPT: present
#
# Found valid GPT with protective MBR; using GPT.
# Disk /dev/sdb: 500695040 sectors, 238.8 GiB
# Model: USB3.0 CRW   -SD
# Sector size (logical/physical): 512/512 bytes
# Disk identifier (GUID): 
# Partition table holds up to 128 entries
# Main partition table begins at sector 2 and ends at sector 33
# First usable sector is 34, last usable sector is 500695006
# Partitions will be aligned on 64-sector boundaries
# Total free space is 61 sectors (30.5 KiB)
#
# Number  Start (sector)    End (sector)  Size       Code  Name
#    1              64           16383   8.0 MiB     B000  loader1
#    2           16384           24575   4.0 MiB     B000  loader2
#    3           24576           32767   4.0 MiB     B000  trust
#    4           32768         2097151   1008.0 MiB  EF00  boot
#    5         2097152       500694975   237.7 GiB   8300  root
#
# So we're going to load the initramfs, kernel image, and dtb from partition 4.
#
# [1]: https://opensource.rock-chips.com/wiki_Boot_option

setenv bootargs earlycon=uart8250,mmio32,0xfe660000 console=ttyS2,1500000n8 console=tty0 earlyprintk root=UUID=... rw rootwait

echo "Loading kernel..."
load mmc ${devnum}:4 ${ramdisk_addr_r} vmlinuz

echo "Uncompressing kernel..."
unzip ${ramdisk_addr_r} ${kernel_addr_r}

echo "Loading initramfs..."
load mmc ${devnum}:4 ${ramdisk_addr_r} initramfs.img
setenv ramdisk_size ${filesize}

echo "Loading dtb..."
load mmc ${devnum}:4 ${fdt_addr_r} dtbs/${fdtfile}

echo "Booting..."
booti ${kernel_addr_r} ${ramdisk_addr_r}:${ramdisk_size} ${fdt_addr_r}
You write that in a .txt file and then generate a .scr with:

Code: Select all

/usr/bin/mkimage \
    -A arm -O linux -T script -C none \
    -n "U-Boot boot script" \
    -d /boot/boot.txt \
    /boot/boot.scr
(mkimage is from u-boot-tools, available in regular Gentoo ebuild repo)

For the kernel, the bes2600 WiFi driver isn't the only thing gentoo-sources / upstream are missing. You can see all the commits the "official" Pinetab2 kernel adds here: https://github.com/dreemurrs-embedded/l ... danctnix2/ -- I wrote my own ebuild to apply those on top of gentoo-sources.

One other bit of fair warning. The bes2600 WiFi driver's code quality is, not great. One thing is, the Makefile is straight up broken so if you build it in (instead of as a module) it just doesn't compile it. Also once that's solved, there's some race where if the module loads before the hardware is ready, it just bails out with an error in the module init function. Best strategy to get it working "out of the box" is to just build it as a module.

Hope this helps. It took quite a lot of time to get working, Pine64 sort of assumes you'll use one of the pre-packaged distros they offer, and they don't really document all these details to get it working "from scratch".
Top
Post Reply
  • Print view

2 posts • Page 1 of 1

Return to “Gentoo on ARM”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy