OpenBSD on Pinebook 1080p?
#12
(02-18-2020, 11:45 AM)ab1jx Wrote: Alright, I'm thoroughly confused.  I used OpenBSD for 15 years but only on x86.  I'm looking at OpenBSD's INSTALL.arm64 and your post and wondering what goes where.

"/usr/mdec/pine64" where is that?  Inside the miniroot?  The OpenBSD directions talk about doing a dd of idbloader.img and u-boot.itb but is that after you dd the miniroot?  Where does the real installation end up relative to this?   Where do the files in the tarball's share/u-boot/pinebook go?  They replace files in the miniroot?


No no, that's all fair. It is confusing. I figured out what I figured out with two sleepless nights in a row. OpenBSD's INSTALL.arm64 needs a editing once-over. It is correct as far as it goes but neglects specific very important details. And getting any of the details wrong just produces a black screen  Angel

I'll show you exactly the commands that worked for me once I can reproduce and test them thoroughly, but I will explain the missing details first.



The very important thing to understand is that every ARM device (or "board" in the lingo) needs a custom bootloader -- it's not like x86 where long ago BIOS was invented to unify the boot API and the same bootloader could be installed on almost any machine. These are in an external package, not the base system, and are actually split in two packages: `u-boot-aarch64` (64 bit, corresponding to OpenBSD arm64) and `u-boot-arm` (32 bit ARM, corresponding to armv7). This is actually mentioned in INSTALL.arm64 but it's easy to miss and misleading:

INSTALL.amd64 Wrote: To do so first install the u-boot-aarch64 and dtb packages.

(misleading too because you don't need the dtb package for the pinebook, and it's not obvious that they mean "install on a separate probably-amd64 machine")

OpenBSD 6.5 and 6.6 have been designed with pine-a64, rock64 and rockpro64 in mind; the pinebook isn't officially supported yet (but 6.7 probably will! Apparently the devs have received their orders). Again this is in the docs but easy to miss and misunderstand:

INSTALL.amd64 Wrote:The following machines are targeted by OpenBSD/arm64:

Allwinner A64/H5
Pine64 Pine 64/64+
...
Rockchip RK3328/RK3399
Pine64 ROCK64
Pine64 ROCKPro64


So you get the bootloaders by

Code:
$ doas pkg_add u-boot-aarch64
$ pkg_info -L u-boot-aarch64
Information for inst:u-boot-aarch64-2019.10

Files:
/usr/local/share/u-boot/a64-olinuxino/sunxi-spl.bin
/usr/local/share/u-boot/a64-olinuxino/u-boot
/usr/local/share/u-boot/a64-olinuxino/u-boot-sunxi-with-spl.bin
/usr/local/share/u-boot/a64-olinuxino/u-boot.bin
/usr/local/share/u-boot/a64-olinuxino/u-boot.img
/usr/local/share/u-boot/a64-olinuxino/u-boot.itb
/usr/local/share/u-boot/bananapi_m64/sunxi-spl.bin
/usr/local/share/u-boot/bananapi_m64/u-boot
/usr/local/share/u-boot/bananapi_m64/u-boot-sunxi-with-spl.bin
/usr/local/share/u-boot/bananapi_m64/u-boot.bin
/usr/local/share/u-boot/bananapi_m64/u-boot.img
/usr/local/share/u-boot/bananapi_m64/u-boot.itb
/usr/local/share/u-boot/firefly-rk3399/idbloader.img
/usr/local/share/u-boot/firefly-rk3399/u-boot
/usr/local/share/u-boot/firefly-rk3399/u-boot.bin
/usr/local/share/u-boot/firefly-rk3399/u-boot.img
/usr/local/share/u-boot/firefly-rk3399/u-boot.itb
/usr/local/share/u-boot/mvebu_espressobin-88f3720/u-boot
/usr/local/share/u-boot/mvebu_espressobin-88f3720/u-boot.bin
/usr/local/share/u-boot/mvebu_mcbin-88f8040/u-boot
/usr/local/share/u-boot/mvebu_mcbin-88f8040/u-boot.bin
/usr/local/share/u-boot/nanopi_a64/sunxi-spl.bin
/usr/local/share/u-boot/nanopi_a64/u-boot
/usr/local/share/u-boot/nanopi_a64/u-boot-sunxi-with-spl.bin
/usr/local/share/u-boot/nanopi_a64/u-boot.bin
/usr/local/share/u-boot/nanopi_a64/u-boot.img
/usr/local/share/u-boot/nanopi_a64/u-boot.itb
/usr/local/share/u-boot/nanopi_neo2/sunxi-spl.bin
/usr/local/share/u-boot/nanopi_neo2/u-boot
/usr/local/share/u-boot/nanopi_neo2/u-boot-sunxi-with-spl.bin
/usr/local/share/u-boot/nanopi_neo2/u-boot.bin
/usr/local/share/u-boot/nanopi_neo2/u-boot.img
/usr/local/share/u-boot/nanopi_neo2/u-boot.itb
/usr/local/share/u-boot/orangepi_pc2/sunxi-spl.bin
/usr/local/share/u-boot/orangepi_pc2/u-boot
/usr/local/share/u-boot/orangepi_pc2/u-boot-sunxi-with-spl.bin
/usr/local/share/u-boot/orangepi_pc2/u-boot.bin
/usr/local/share/u-boot/orangepi_pc2/u-boot.img
/usr/local/share/u-boot/orangepi_pc2/u-boot.itb
/usr/local/share/u-boot/orangepi_prime/sunxi-spl.bin
/usr/local/share/u-boot/orangepi_prime/u-boot
/usr/local/share/u-boot/orangepi_prime/u-boot-sunxi-with-spl.bin
/usr/local/share/u-boot/orangepi_prime/u-boot.bin
/usr/local/share/u-boot/orangepi_prime/u-boot.img
/usr/local/share/u-boot/orangepi_prime/u-boot.itb
/usr/local/share/u-boot/orangepi_win/sunxi-spl.bin
/usr/local/share/u-boot/orangepi_win/u-boot
/usr/local/share/u-boot/orangepi_win/u-boot-sunxi-with-spl.bin
/usr/local/share/u-boot/orangepi_win/u-boot.bin
/usr/local/share/u-boot/orangepi_win/u-boot.img
/usr/local/share/u-boot/orangepi_win/u-boot.itb
/usr/local/share/u-boot/pine64-lts/sunxi-spl.bin
/usr/local/share/u-boot/pine64-lts/u-boot
/usr/local/share/u-boot/pine64-lts/u-boot-sunxi-with-spl.bin
/usr/local/share/u-boot/pine64-lts/u-boot.bin
/usr/local/share/u-boot/pine64-lts/u-boot.img
/usr/local/share/u-boot/pine64-lts/u-boot.itb
/usr/local/share/u-boot/pine64_plus/sunxi-spl.bin
/usr/local/share/u-boot/pine64_plus/u-boot
/usr/local/share/u-boot/pine64_plus/u-boot-sunxi-with-spl.bin
/usr/local/share/u-boot/pine64_plus/u-boot.bin
/usr/local/share/u-boot/pine64_plus/u-boot.img
/usr/local/share/u-boot/pine64_plus/u-boot.itb
/usr/local/share/u-boot/pinebook/sunxi-spl.bin
/usr/local/share/u-boot/pinebook/u-boot
/usr/local/share/u-boot/pinebook/u-boot-sunxi-with-spl.bin
/usr/local/share/u-boot/pinebook/u-boot.bin
/usr/local/share/u-boot/pinebook/u-boot.img
/usr/local/share/u-boot/pinebook/u-boot.itb
/usr/local/share/u-boot/qemu_arm64/u-boot
/usr/local/share/u-boot/qemu_arm64/u-boot.bin
/usr/local/share/u-boot/rock64-rk3328/idbloader.img
/usr/local/share/u-boot/rock64-rk3328/u-boot
/usr/local/share/u-boot/rock64-rk3328/u-boot.bin
/usr/local/share/u-boot/rock64-rk3328/u-boot.img
/usr/local/share/u-boot/rock64-rk3328/u-boot.itb
/usr/local/share/u-boot/rockpro64-rk3399/idbloader.img
/usr/local/share/u-boot/rockpro64-rk3399/u-boot
/usr/local/share/u-boot/rockpro64-rk3399/u-boot.bin
/usr/local/share/u-boot/rockpro64-rk3399/u-boot.img
/usr/local/share/u-boot/rockpro64-rk3399/u-boot.itb
/usr/local/share/u-boot/rpi_3/u-boot
/usr/local/share/u-boot/rpi_3/u-boot.bin
/usr/local/share/u-boot/rpi_4/u-boot
/usr/local/share/u-boot/rpi_4/u-boot.bin
/usr/local/share/u-boot/sopine_baseboard/sunxi-spl.bin
/usr/local/share/u-boot/sopine_baseboard/u-boot
/usr/local/share/u-boot/sopine_baseboard/u-boot-sunxi-with-spl.bin
/usr/local/share/u-boot/sopine_baseboard/u-boot.bin
/usr/local/share/u-boot/sopine_baseboard/u-boot.img
/usr/local/share/u-boot/sopine_baseboard/u-boot.itb

Out of all of these,
Code:
/usr/local/share/u-boot/pinebook/u-boot-sunxi-with-spl.bin
works for the Pinebook and the Pinebook Pro. I don't know why there's two/three copies of u-boot in that folder and why -with-spl is the necessary one, but it is.



The next thing to understand is that -- I'm making some educated guesses here -- instead of using a partition table the pinebook (actually the proprietary Allwinner SoC that pine is built around) looks directly at byte 8192 (aka sector 16) on disk to find a bootloader and decide if it is bootable. So whether microSD, USB or the eMMC card, you need to use this magic-numberful invocation to get a bootable disk:

Code:
ftp https://cdn.openbsd.org/pub/OpenBSD/6.6/i386/miniroot66.fs
dd if=miniroot66.fs of=/dev/sdXc  # replace /dev/sdXc with your disk
dd if=/usr/local/share/u-boot/pinebook/u-boot-sunxi-with-spl.bin \
   of=/dev/sdXc \
   bs=1024 seek=8 # 8x1kB blocks = 16x512B blocks

In fact, even if that's all you do to a blank disk it will still be bootable, it'll just boot to the u-boot prompt (and then wait for instructions). That can still be useful, just to test out the hardware.





What this all means for installing OpenBSD is that you just need to make sure both the install disk and the final system both have /usr/local/share/u-boot/pinebook/u-boot-sunxi-with-spl.bin installed at sector 16.

It took me many hours of reverse engineering the linux pinebook builds and re-re-reading INSTALL.amd64 to understand this simple fact.

The provided miniroot66.fs is designed for RaspberryPis. Even once you modify it according to INSTALL.amd64 as above and boot it, the install script still fails because it only supports RaspberryPis and pine64+s (source -- see md_installboot).

So to get a working system you need to do dd surgery twice, that above on miniroot66.fs before and once on the final system after the install. I copied /usr/local/share/u-boot/pinebook/u-boot-sunxi-with-spl.bin to the same disk I put the install sets on and ran `dd` with it before rebooting out of the installer.

(02-18-2020, 11:45 AM)ab1jx Wrote: "/usr/mdec/pine64" where is that?  Inside the miniroot?  The OpenBSD directions talk about doing a dd of idbloader.img and u-boot.itb but is that after you dd the miniroot?  Where does the real installation end up relative to this?   Where do the files in the tarball's share/u-boot/pinebook go?  They replace files in the miniroot?

It's inside the miniroot but ignore that I even mentioned it. That's the packaged u-boot md_installboot uses if it detects pine64+ (source -- see "usr/mdec/pine64/"). I thought you could use it to do the second dd surgery but I was wrong.

In case it wasn't clear from above, the only file in /usr/local/share/u-boot/pinebook that matters is u-boot-sunxi-with-spl.bin, and it doesn't replace any files; it's not meant to be part of any filesystem. It gets installed to the bootsector directly.

(02-18-2020, 11:45 AM)ab1jx Wrote: I'd assume in this case that the installer won't have a driver for the PBP's WiFi.  So put them in a DOS partition on the SD card, shell out of the install and mount it?

Perfect guess  Big Grin . The WiFi is not working under OpenBSD. You need a WiFi dongle, or to settle for living the offline life. Give it 6 months (and maybe 50$ to the OpenBSD foundation), OpenBSD 6.7 will probably work a lot better on the PBP.
  Reply


Messages In This Thread
OpenBSD on Pinebook 1080p? - by binholz - 01-17-2019, 10:10 AM
RE: OpenBSD on Pinebook 1080p? - by heywire - 01-17-2019, 02:57 PM
RE: OpenBSD on Pinebook 1080p? - by cambridgei - 05-24-2019, 07:45 AM
RE: OpenBSD on Pinebook 1080p? - by ninefathom - 05-30-2019, 06:01 PM
RE: OpenBSD on Pinebook 1080p? - by michaelj - 10-07-2019, 03:00 PM
RE: OpenBSD on Pinebook 1080p? - by elewarr - 10-20-2019, 01:05 PM
RE: OpenBSD on Pinebook 1080p? - by joancatala - 10-21-2019, 11:55 AM
RE: OpenBSD on Pinebook 1080p? - by elewarr - 11-04-2019, 06:17 PM
RE: OpenBSD on Pinebook 1080p? - by rogerroger - 12-20-2019, 06:19 AM
RE: OpenBSD on Pinebook 1080p? - by rogerroger - 12-20-2019, 07:51 AM
RE: OpenBSD on Pinebook 1080p? - by ab1jx - 02-18-2020, 11:45 AM
RE: OpenBSD on Pinebook 1080p? - by rogerroger - 02-18-2020, 02:20 PM
RE: OpenBSD on Pinebook 1080p? - by ab1jx - 02-18-2020, 05:53 PM
RE: OpenBSD on Pinebook 1080p? - by rogerroger - 02-18-2020, 09:18 PM
RE: OpenBSD on Pinebook 1080p? - by ab1jx - 02-18-2020, 09:00 PM
RE: OpenBSD on Pinebook 1080p? - by ab1jx - 02-18-2020, 09:47 PM
RE: OpenBSD on Pinebook 1080p? - by rogerroger - 02-18-2020, 10:01 PM
RE: OpenBSD on Pinebook 1080p? - by rogerroger - 02-19-2020, 12:18 AM
RE: OpenBSD on Pinebook 1080p? - by rogerroger - 02-19-2020, 01:34 AM
RE: OpenBSD on Pinebook 1080p? - by ab1jx - 02-19-2020, 09:50 AM
RE: OpenBSD on Pinebook 1080p? - by rogerroger - 02-20-2020, 10:02 AM
RE: OpenBSD on Pinebook 1080p? - by ab1jx - 02-22-2020, 05:54 PM
RE: OpenBSD on Pinebook 1080p? - by rogerroger - 02-22-2020, 08:06 PM
RE: OpenBSD on Pinebook 1080p? - by ab1jx - 02-22-2020, 09:25 PM
RE: OpenBSD on Pinebook 1080p? - by ab1jx - 03-15-2020, 05:16 PM
RE: OpenBSD on Pinebook 1080p? - by rogerroger - 03-16-2020, 12:59 AM
RE: OpenBSD on Pinebook 1080p? - by ab1jx - 03-16-2020, 11:54 AM
RE: OpenBSD on Pinebook 1080p? - by ab1jx - 03-16-2020, 10:01 PM
RE: OpenBSD on Pinebook 1080p? - by ab1jx - 03-17-2020, 07:59 AM
RE: OpenBSD on Pinebook 1080p? - by ab1jx - 03-18-2020, 06:42 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question OpenBSD 6.7 on Pinebook 1080p SKG 4 382 05-25-2020, 08:15 AM
Last Post: SKG
  OpenBSD on Pinebook - improving user experience elewarr 15 2,367 12-20-2019, 06:57 PM
Last Post: rogerroger
Thumbs Up NetBSD for Pinebook Luke 17 7,413 07-09-2019, 08:11 PM
Last Post: Der Geist der Maschine
  FreeBSD for Pinebook e-minguez 3 2,370 12-19-2018, 01:04 AM
Last Post: k_mp

Forum Jump:


Users browsing this thread: 1 Guest(s)