Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Installing NetBSD to Banana Pi SATA HD



Hi Nick
 
bpi# cat /boot/uEnv.txt
bootargs=root=wd0a
aload_script=fatload mmc 0 0x43000000 bananapi/script.bin;
aload_kernel=fatload mmc 0 0x48000000 netbsd.ub; bootm 0x48000000;
uenvcmd=run aload_script aload_kernel

Is this NetBSD 6.x? I was under the impression that uEnv is the legacy boot config file and has been deprected in favour of boot.cmd / boot.scr under NetBSD 7.

My boot.cmd looks like this:

setenv kernel_addr      82000000
setenv kernel           netbsd-BPI.ub
setenv bootargs         "root=wd0a console=fb"

fatload mmc 0:1 ${kernel_addr} ${kernel}
bootm ${kernel_addr}

Just to make sure, I changed all the instances of ld0a within my uEnv.txt to wd0a in an effort to get it to boot off HD for good measure so it now looks like this:

loaduimage=if test $board = am335x; then fatload mmc 0 82000000 netbsd-BEAGLEBONE.ub; bootm 82000000 root=wd0a; else fatload mmc 0 81000000 netbsd-BEAGLEBOARD.ub; bootm 81000000 root=wd0a; fi
bootargs=root=wd0a console=fb
uenvcmd=mmc dev 0; mmc rescan; if test $fdtfile = sun7i-a20-cubieboard2.dtb; then setenv kernel netbsd-CUBIEBOARD.ub; elif test $fdtfile = sun7i-a20-cubietruck.dtb; then setenv kernel netbsd-CUBIETRUCK.ub; elif test $fdtfile = sun6i-a31-hummingbird.dtb; then setenv kernel netbsd-HUMMINGBIRD_A31.ub; elif test $fdtfile = sun7i-a20-bananapi.dtb; then setenv kernel netbsd-BPI.ub; fi; fatload mmc 0:1 82000000 $kernel; bootm 82000000
 

bpi# cat /etc/fstab
# See /usr/share/examples/fstab/ for more examples.
/dev/wd0a       /               ffs     rw      1 1
/dev/wd0b       none            swap    sw      0 0
/dev/ld0e       /boot           msdos   rw      1 1
kernfs          /kern           kernfs  rw
ptyfs           /dev/pts        ptyfs   rw
procfs          /proc           procfs  rw
tmpfs           /tmp            tmpfs   rw,-m=1777
tmpfs           /var/shm        tmpfs   rw,-m1777,-sram%25
bpi#


I have the same fstab.
 



Also, when sysinst was downloading the tarballs I noticed the TX LED didn't
blink. In fact I haven't seen it blink at all whilst I've been running
NetBSD on my BPi. Is this a known bug? It works fine under Linux.

No-one has added the code, I guess.


Can we expect power off for the BPi to be implemented too, maybe for 7.1?

Does the BPI support this?

Yes, poweroff works for me under Arch and successfully turns off my HD when run.

So what process did you use to install? Here's what I did:

Installing NetBSD on the BPi

<following on from official install guide>

Upon first boot of the Netbsd binary image it will resize itself to fill your SD card and automatically reboot. The second boot will boot into the OS but will take longer than usual because it will have to generate the SSH keys. You can log in as root - there is no default password.

The easiest way to partition and format your HD for use with NetBSD is to run `sysinst`. As its name implies, sysinst should be able to install the OS but I have yet to have it work without the installer failing a sanity check near the end of the process so instead I just use sysinst to partition and format the drive and then I do the rest of the OS install manually.

<Maybe document using sysinst to partition & format here>

After preparing the HD, we need to copy the root fs from our SD card. We will use rsync to do this but first we need to install it. At the time of writing the PKG_PATH address given at https://www.pkgsrc.org/ doesn't work for BPi / armv7 users so use these commands instead:

PKG_PATH="http://ftp.NetBSD.org/pub/pkgsrc/packages/$(uname -s)/earmv7hf/$(uname -r|cut -f '1 2' -d.)/All/"
export PKG_PATH
pkg_add rsync

With rsync installed, we can proceed to mount our HD and copy the root fs:

mount /dev/wd0a /mnt
rm -rf /mnt/*
rsync -av --exclude /mnt --exclude /boot / /mnt
cd /mnt
mkdir boot mnt

Now edit /etc/fstab and change the root device from /dev/ld0a to /dev/wd0a and ld0b (swap) for wd0b then create a new boot.scr that uses wd0a as the root device instead of ld0a.

The first problem I have when I try booting off HD is:

mount_ffs: /dev/ld0a on /: specified device does not match mounted device

Then I get lots of Read-only file system errors then `/var/run/lvm: File exists`and mountcritlocal exits with an error so I get dropped into single-user mode and root is mounted read only.

Thanks for your help!


Home | Main Index | Thread Index | Old Index