PINE64
Booting NetBSD - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: Pinebook Pro (https://forum.pine64.org/forumdisplay.php?fid=111)
+--- Forum: BSD on Pinebook Pro (https://forum.pine64.org/forumdisplay.php?fid=115)
+--- Thread: Booting NetBSD (/showthread.php?tid=17197)

Pages: 1 2


Booting NetBSD - untitled - 08-22-2022

I managed to install NetBSD on eMMC by booting from an SD card with 9.3 arm64.img and running sysinst.

Now have trouble booting up the installed system. Tow-Boot on SPI complains

"Wrong image format for "source" command."
"Can't get kernel image!"

I reinstalled kernel just to be sure

Code:
install -o root -g wheel -m 555 netbsd-GENERIC64 /netbsd

and wrote u-boot into boot sector

Code:
dd if=/usr/pkg/share/u-boot/rksd_loader.img of=/dev/rld0 seek=64 conv=sync

Also copied everything in /boot of the SD card to /boot on eMMC.

Still no luck, the system won't boot.


RE: Booting NetBSD - KC9UDX - 08-23-2022

I don't know anything about Tow-boot, but it might be Linux-specific.

You will probably have to replace Tow-boot. At this point, I would just zero the SPI ram. I have NetBSD working with what must be the U-boot from the "Debian Desktop" install that originally came with my first PBP.

According to the NetBSD ARM mailing list, we should get bootable images (again) soon, which will come with a working U-boot. When that happens, it'll be here http://nycdn.netbsd.org/pub/arm/netbsd-9/latest-evbarm-aarch64/


RE: Booting NetBSD - untitled - 08-24-2022

(08-23-2022, 05:14 AM)KC9UDX Wrote: I don't know anything about Tow-boot, but it might be Linux-specific.

You will probably have to replace Tow-boot.  At this point, I would just zero the SPI ram.  I have NetBSD working with what must be the U-boot from the "Debian Desktop" install that originally came with my first PBP.

According to the NetBSD ARM mailing list, we should get bootable images (again) soon, which will come with a working U-boot.  When that happens, it'll be here http://nycdn.netbsd.org/pub/arm/netbsd-9/latest-evbarm-aarch64/

There already are generic bootable images for evbarm, don't really know what do we benefit from a pbp specific image.

The main problem here is to make a newly installed system to boot after sysinst. I don't think an image is going to help here.

ps: zeroing SPI will render laptop unbootable at all.


RE: Booting NetBSD - KC9UDX - 08-24-2022

The prebuilt images boot, and you can make a bootable system from them. I've done it (in the past).

Isn't SPI all zeroes from the factory?


RE: Booting NetBSD - wdt - 08-24-2022

>Isn't SPI all zeroes from the factory?
This is correct


RE: Booting NetBSD - untitled - 08-25-2022

(08-23-2022, 05:14 AM)KC9UDX Wrote: According to the NetBSD ARM mailing list, we should get bootable images (again) soon, which will come with a working U-boot.  When that happens, it'll be here http://nycdn.netbsd.org/pub/arm/netbsd-9/latest-evbarm-aarch64/

The eagle has landed.


RE: Booting NetBSD - untitled - 08-25-2022

(08-24-2022, 02:27 PM)KC9UDX Wrote: The prebuilt images boot, and you can make a bootable system from them.  I've done it (in the past).

How exactly did you do it?

I installed u-boot-pinebook-pro from pkgsrc, tried to flash /dev/spiflash0 but get error "Device not configured". Then tried to flash /dev/rld0d and got and unbootable laptop (Wrong image format, can't get kernel image!)

I am talking about newly installed system, with sysinst, not a dd'ed img to eMMC.


RE: Booting NetBSD - untitled - 08-25-2022

Ok, I played with u-boot parameters a little and figured it out.

You have to pass these lines to u-boot console to boot from eMMC:

Code:
setenv bootargs root=ld0a
setenv kernel netbsd.ub
setenv fdtfile dtb/rk3399-pinebook-pro.dtb
boot



RE: Booting NetBSD - KC9UDX - 08-26-2022

I dd'd the image. Originally I had to overwrite U-boot with one from Linux, but at some point the NetBSD images just started booting. But I've heard that the latest one does not. So your solution is probably the only good one at the moment. Hopefully this weekend I'll get time to play with this.


RE: Booting NetBSD - untitled - 08-26-2022

We can automate this thing a little by creating u-boot config file, but it will still boot the kernel from the SD card, only root fs will be from the new system:

1) Write a file myscript.txt in /boot on SD card
Code:
setenv kernel_addr 0x200000
setenv bootargs "root=ld0a console=fb"

2) Make an image. mkubootimage is located in /usr/src/tools. If not, get and unpack src.tar.gz set.
2.1) Remove everything in /boot on SD card, except for "efi" directory.
Code:
mkubootimage -A arm64 -C none -O netbsd -T script -n PBP myscript.txt boot.scr

3) reboot with SD card installed, root fs should be on ld0 now, not on ld1.

I still struggle to install the netbsd provided u-boot from pkgsrc to either SPI or eMMC.
/dev/spiflash0 is "Device not configured" on all kernels I've tried.
Tried flashrom on Linux, says that rkspi_loader.img is too small.
dd'ing img to /dev/ld0d gives no result.