Booting NetBSD
#1
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.
  Reply
#2
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...m-aarch64/
:wq



[ SRA accepts you ]

Everyone wants me to quit using NetBSD
  Reply
#3
(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...m-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.
  Reply
#4
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?
:wq



[ SRA accepts you ]

Everyone wants me to quit using NetBSD
  Reply
#5
>Isn't SPI all zeroes from the factory?
This is correct
  Reply
#6
(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...m-aarch64/

The eagle has landed.
  Reply
#7
(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.
  Reply
#8
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
  Reply
#9
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.
:wq



[ SRA accepts you ]

Everyone wants me to quit using NetBSD
  Reply
#10
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.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  2nd NetBSD boot goes dark donn 6 3,689 02-22-2024, 03:59 AM
Last Post: KC9UDX
  NetBSD 1.0 runs down battery donn 13 3,215 11-15-2023, 04:05 PM
Last Post: KC9UDX
  NetBSD on the Pinebook Pro in August 2022 - or not? KC9UDX 6 4,899 08-24-2022, 01:49 AM
Last Post: KC9UDX
  NetBSD and pinebook keyboard/trackpad firmware updater mrgtwentythree 5 11,175 05-16-2021, 07:37 PM
Last Post: mrgtwentythree
  NetBSD Der Geist der Maschine 76 121,885 05-16-2021, 02:43 PM
Last Post: mrgtwentythree
Music NetBSD and USB "sound cards" KC9UDX 2 6,162 05-07-2021, 12:11 PM
Last Post: elimark1
Question Issues Installing NetBSD on a PineBook Pro ReleaseTheGeese 14 17,000 01-31-2021, 11:20 AM
Last Post: KC9UDX
  NetBSD -Current binaries BronzeBeard 8 13,063 12-31-2020, 08:38 PM
Last Post: BronzeBeard
Thumbs Up My NetBSD on Pinebook Pro journey KC9UDX 11 20,306 12-06-2020, 08:26 PM
Last Post: KC9UDX

Forum Jump:


Users browsing this thread: 1 Guest(s)