Issues Installing NetBSD on a PineBook Pro
#1
Question 
Greetings,

I've recently acquired a second-hand PBP. I'm quite impressed with the construction of this laptop, and eager to make it into a useful machine. I've also been looking for an excuse to try a BSD system. Thus, these two developments meet in some problems I've had with the PBP.

So the PineBook Pro came with the default Manjaro ARM OS. This booted without any trouble and was usable. I then went and flashed a NetBSD Current image for the PineBook Pro onto a microSD card. I used `dd` on a Void Linux desktop to do this. I was hoping to eventually flash NetBSD from the microSD onto the internal SSD.

However, when I inserted the SD card into the PineBook, it ignored the microSD card and just went ahead to boot Manjaro. This happened even after a reboot. Then I disassembled it and disabled the internal SSD using the switch. While leaving the microSD card inserted, I powered the PBP on again. However, this time the screen remained black and there was no activity from any of the power lights. I don't think I've bricked it, but I'm not sure what to do next.

I've been looking through the forums, reddit, the wiki. But I'd like clarity from anyone who has successfully installed NetBSD: Did I follow the correct procedure for installing NetBSD? Is it simply a case of flashing the microSD and then switching on the PBP, and that'll present me with a ready-installed NetBSD or an installer?

Also, I'd appreciate any troubleshooting tips. If that's more appropriately asked in the hardware section, I'll begin another thread there.

Regards,
R.T.G.
there will be no peace when they release the geese
  Reply
#2
You might not want to run -current. I'm running it, but I might switch to 9.1 (which I also run on an SD card) soon. The only real advantage I can see at this point is that you can use the inbuilt Wi-Fi, but you won't want to. It just doesn't work. It crashes hard and will give you headaches. So if you want to use Wi-Fi, get a urtwn USB stick. In this case, you don't "need" -current.

I digress. You'll want to get a serial console adaptor, and turn on the serial console switch. This isn't necessary but it's very helpful.

If you're getting the image from armbsd.org, it should just work. You'll get an orange LED for some time, and then it'll turn green and you'll see the familiar boot messages. What you can't see without the serial console are the U-Boot messages, and the NetBSD boot prompt which waits some time for a keypress (which you can only do from the serial console), and then the first lines of NetBSD boot messages before the display hardware is activated.

On first boot, the partition will resize to fill the SD card. If you don't want to do that, you'll want to interrupt it. Else, it will resize and reboot. Then you should have a fully working installation equivalent to installing with X and nothing else. You'll have to either run sysinst (only available on -current) or manually install pkgsrc etc.

You can't really "brick" a PBP. The only caveat to this statement is if someone tried using the SPI NOR Flash in the past, which is highly unlikely (unless maybe they were using an SSD).

Manjaro is a nightmare, unless you're a Linux guy, I don't know. I find it to be a major pain, and if I have to Linux, I use the former official PBP OS, Debian. But we're dealing with NetBSD, so no need to worry about that just now. Let's get NetBSD running on SD and then deal with that Manjaro, and overwriting it. But if you are ambitious you could install the original Debian and make installing NetBSD just a little easier (don't have to switch the eMMC on during boot, with the PBP disassembled).

To the point of your question, you are either not waiting long enough, or maybe have a bad SD card. There are lots of reports of SD cards that just don't work. I have not run into this but many others have. Try re-writing the SD. Then try another SD.

NetBSD works very well at this stage, minus the inbuilt Wi-Fi, and touchpad multitouch. It should be easy to install and easy to use, if you're already familiar with NetBSD. If you're not familiar, it should still be easy to get running, and at least obvious that it works, when you get to that point. Also if you're not very familiar with NetBSD already, please avoid -current for now.
  Reply
#3
Pinebook Pro is probably not the best platform to get your feet wet in BSD. Installation and setup is much smoother on X86 at the moment. And you're limited to mainly NetBSD at the moment if you're looking for an easy install.

That being said, non-X86 arches is where NetBSD shines, and is the main reason I purchased one.

I currently run -Current. The drivers for Pinebook Pro are up-to-date on it, and wifi works. But the downside is, you'll have to build everything yourself from source OR use hackish methods to get NetBSD 9.1 binaries to work.

Anyway, I run from an SD. Here is how I do it:
-Download Image from armbsd.org
-Put in your sd card.
-Open up terminal on your linux machine.
-Double check the device name of your sd card. lsblk
-sudo dd if=Name_Of_The_NetBSD_Image_File.img of=/dev/mmcblk1 bs=4M status=progress
-Reboot

NetBSD will boot up. You might get a fuzzy monitor, if so, turn it off and turn it back on.

-NetBSD will growfs on the sd card.
-Then you'll be at login prompt.
-Root is the user name. No password.

At this point, I suggest passwd to change your root password.
Then 'useradd -m username' a new user.
Then 'passwd username' to change the password
Then 'usermod -G wheel username' to give your username su power.
Then exit out of root, log in to your user account.
type in startx to boot up x.
SU up a terminal.
Use vi to edit your wpa_supplicant: https://wiki.netbsd.org/tutorials/how_to...upplicant/
If you're on 9.1, edit your pkg_paths for pkg-add: https://www.netbsd.org/docs/guide/en/cha...oot-pkgsrc
If you're on -Current download pkgsrc: https://www.netbsd.org/docs/pkgsrc/getting.html I suggest using CVS to get the newest sources. The Image will have compile issues with some packages if you use the ftp tarballs. You may run into compile issues anyway, and get frustrated with how slow PBP is with compiling big stuff.
There is a hackish solution for using 9.1 binaries on -Current, see the other thread on here for how.

If you were looking to not use an SD card, I would try installing it like Manjaro is suggested to be installed. Wget the image while running an OS from the SD card. Then DD that image to your device.

Good luck! And remember, don't take BSD's current state on PBP as an indicator how good or frustrating BSD is. All four BSD are absolutely awesome OSs on supported platforms. PBP support should get better as time progresses.

I forgot to reply to the actual question though... Sorry:

Quote:However, when I inserted the SD card into the PineBook, it ignored the microSD card and just went ahead to boot Manjaro.

Where did you get the netbsd image from?
Did you sha check the image?
Did you properly dd the sd card?

I would try re-imaging the sd card again, and possibly trying a different sd card.
  Reply
#4
Bronzebeard and KC9, thanks very much for the prompt replies and thorough information.

I'm not too afraid of trying BSD on virgin soil. I've set up both Arch and Void systems before (and of the pair I settled for Void, which I'm told was created by a former NetBSD dev). Installing these involves a lot of editing config files. I picture the BSD experience as being similar. But eventually you have a system that's entirely yours, and that's true contentment. A system that's surprise-free.

I'll continue tinkering through the week, taking into account both of your suggestions. Then I'll let everyone know how it went.
there will be no peace when they release the geese
  Reply
#5
Once you get into it, NetBSD is very enjoyable. At least that's how I find it. Exactly the right stuff and only that, comes with the default installation. The rest is entirely up to you. It bugs me to no end when I have to use a new GNU/Linux installation that all kinds of fancy things I'll never use are installed, but not simple necessities like vi and NFS.

I came from Solaris, and found NetBSD to be far more familiar than any of the linuces. I'm not sure how I would've felt coming from a Linux background. BSD is just different, and I think more down-to-Earth.

I don't think you'll have any issues starting out on the PBP. On x86 and other platforms, the installation, via sysinst, is menu-driven and very intuitive. That's the biggest difference. But we start out in a state which is after that process, using the images from armbsd.org. One of the best parts about NetBSD is that it is so platform independent. Once you're running, it's pretty much the same on any hardware platform.
  Reply
#6
Gentlemen, an update.

I think the issue was with the microSD, so for my next attempt I used two USB memory pens, I dd'd Deb to one and just copied the NetBSD image onto the other. Then I booted Debian from its USB stick, inserted the memory stick holding the netbsd.img and flashed it to the PBP's internal nvram.

To my great delight, it worked!

A setback
Unfortunately, my only handy USB wifi caused a hang when plugged into the PBP. (sometimes when booting, other times when querying it in ifconfig) It's an Alpha AR9271 device with an Atheros chip. I decided to give up on it.

I did some digging and specifically sought a chipset that is included in the NetBSD drivers. Then I bought the cheapest USB WiFi dongle that uses it.

To my joy, when I ran ifconfig I saw this new WiFi device listed. I then set up wpa_supplicant and we were online!

A few delights
I found editing wscons.conf to set the KB layout straightforward. Also rc.conf makes it trivial to enable/disable services.

My expectation was to find a tightly integrated Unix, and that is what I've found. Indeed, the system comes with a just the sane packages I'd want, like xorg and a window manager ready to go. CVS is also something I've only heard told of in distant legend, and it comes with this OS! I suppose the aim is 'include well understood standard tools', the thought I presume being CVS is to SCM what VI is to editing.

While setting the locale by symlink isn't someting I've done in Linux, the concept makes sense. It's how services are managed by Runit in Void. It's more a case of applying what I already know of Unix to solve new (or old) problems in different ways.

I also got pkg_add running, I think it built Firefox from scratch. So I now have the WWW to explore.

Quite happy so far, the next step is getting git running, then cloning the suckless repos for st and dwm. My eventual aim is to use the system for light web browsing, ssh and scripting. I'm sure NetBSD is more than up to that.

A plea for wisdom
Thanks for your help so far. The next question on my mind is utilities to specifically control the PBP. Have you any tools or commands that control brightness and sound, also any to do battery level monitoring?

Last thing, I would like to access some local fileshares. Have you experience of NetBSD with SMB? I guess it is simply a case of installing CIFS/Samba and configuring it with an automount tool like in Linux.
there will be no peace when they release the geese
  Reply
#7
Fine business!

Most web browsing works well. I've even used Duo and the camera works but the inbuilt mic doesn't for unknown reasons. The mic does work for recording audio. What doesn't work for me is banking sites. The same sites don't work in Linux with Firefox ESR, but do work with older Firefoxen (in Linux, haven't tried in NetBSD.)

Samba works the same as it does in Linux. I don't use SMB so I can't promise that's as true as it was the last time I tried it which was years at least. Frankly, you're better off ditching SMB and using NFS network-wide if you can. SMB is a nightmare compared to NFS.

Install pkgin so that you can install binary packages from pkgsrc without effort. You'll have to download it and pkg_add it. Get it from the pkgsrc repository at NetBSD.org, and for aarch.

Once you have pkgin, get xbattbar. This is better than any other battery monitor I've used.
`pkgin -y install xbattbar`
else from the command line, use envstat. (I don't recall if you have to install it)
The display brightness can be controlled from the kernel. I keep it set very low and never change it. I'll have to get back to you on exactly how to set it. Use sysctl, especially `sysctl -a` I think, to find the setting for yourself. There's a config file to make such things permanent but at the moment I don't recall what it is. You'll probably figure it out.

To find other binary packages, use `pkgin avail`. All other pkgsrc packages can be built from source very easily, but it's time consuming. And for large packages, like kde4, you'll need a more "disk" space, or, have to build it in parts.

I'm glad you're enjoying it. You'll like it even more, the more you use it. NetBSD just makes a lot of sense.
  Reply
#8
Glad to see more people trying out NetBSD. It's a wonderful, simple *nix operating system.

As mentioned by KC9UDX, use the `sysctl` command to change brightness.
'sysctl -a | grep light' to find the option and if I remember correctly it's called `hw.pwmbacklight0.level`
then to change the value `sysctl -w hw.pwmbacklight0.level=<value>`.

As for audio, use the mixerctl command:
`mixerctl -a` to list options and `mixerctl -w` to overwrite current value e.g. `mixerctl -w outputs.master=80`.

For battery and thermal status use the envstat command.

All of the commands mentioned above are already included in the system.

If you plan to watch videos on your PineBook Pro, I would recommend getting a -Current kernel (you can still use a 9.1 userland for binary packages - just replace the kernel). With recent scheduler changes, NetBSD on RK3399 systems now always prefer the faster 2.0 GHz cores, Mesa LLVMpipe is also enabled wich makes 1080p a lot faster for many things. 1080p 30fps and 720p 60fps plays smoothly.

However, it's worth noting that there's no panfrost/lima support yet, so no 3D acceleration which unfortunately means minor screen tearing and shorter battery life for graphic intense tasks.

Lastly, I would recommend unitedbsd.com - welcoming BSD community with quite a lot of NetBSD users and a few NetBSD developers.
  Reply
#9
Something that I take for granted, but should probably be mentioned; because if you're coming from Linux this might be a surprise: the`man` manual page system in NetBSD is very complete. If ever you want to learn about a command, or a config file, get into the habit of using 'man'. There's a wonderful hoarde of information in the manual pages.
  Reply
#10
Apologies for late reply again, but just wanting to share my thanks for the further tips. pkgin, envstat and sysctl have all been very helpful. It'll take me a few weekends of tinkering on and off to get fully accustomed, but I don't see myself running anything else on this PineBook. I will also avail myself of the manpages, IRC and UnitedBSD if I'm ever in peril with a general question.

Now what's next, NetBSD on the PinePhone? Telephoning your friends and family using `cat /home/rtg/contacts/gf | /dev/handset`, writing out SMSes in Vi. A man can dream!
there will be no peace when they release the geese
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question OpenBSD 6.7 on Pinebook Pro SKG 27 18,605 05-07-2021, 04:03 PM
Last Post: bigtreeman
Music NetBSD and USB "sound cards" KC9UDX 2 866 05-07-2021, 12:11 PM
Last Post: elimark1
  OpenBSD on the pinebook pro e-minguez 5 4,271 04-27-2021, 04:06 AM
Last Post: dreamer_
  PINEBOOK Pro USB-C Docking Deck on FreeBSD S199pWa1k9r 2 548 03-04-2021, 01:53 PM
Last Post: Arwen
  NetBSD and pinebook keyboard/trackpad firmware updater mrgtwentythree 4 2,365 01-19-2021, 06:02 PM
Last Post: KC9UDX
  NetBSD -Current binaries BronzeBeard 8 1,866 12-31-2020, 08:38 PM
Last Post: BronzeBeard
Thumbs Up My NetBSD on Pinebook Pro journey KC9UDX 11 6,341 12-06-2020, 08:26 PM
Last Post: KC9UDX
  NetBSD Der Geist der Maschine 75 38,309 12-06-2020, 03:02 AM
Last Post: KC9UDX

Forum Jump:


Users browsing this thread: 1 Guest(s)