[Work In Progress] OPNsense Ported into ARM Devices

Started by nekoprog, March 25, 2019, 11:55:58 AM

Previous topic - Next topic
Quote from: tsgan on January 03, 2020, 10:08:42 AM
pfsense works on this device:

https://www.netgate.com/solutions/pfsense/sg-1100.html

As for OPNsense, you can try my image (it is not official one):

https://people.freebsd.org/~ganbold/OPNsense-201912171639-OpenSSL-arm-aarch64.img.xz

It works for me on espressobin.

Can I use it in a V5 espressobin?, any instructions on how to install it?

I am new here.
Got myself NanoPI R2S, please let me know if you'd like me to test any OPNSense Image.

BTW: something seems to be preventing download of https://people.freebsd.org/~ganbold/OPNsense-201912171639-OpenSSL-arm-aarch64.img.xz

Getting lots of these errors, to the point when it just dies:
2020-06-22 15:40:24 (5.81 MB/s) - Connection closed at byte 20316160. Retrying.

--2020-06-22 15:40:24--  (try: 6)  https://people.freebsd.org/~ganbold/OPNsense-201912171639-OpenSSL-arm-aarch64.img.xz
Connecting to people.freebsd.org (people.freebsd.org)|96.47.72.75|:443... connected.
HTTP request sent, awaiting response... 206 Partial Content
Length: 398789268 (380M), 378473108 (361M) remaining [application/octet-stream]
Saving to: 'OPNsense-201912171639-OpenSSL-arm-aarch64.img.xz.2'

OPNsense-201912171639-OpenSSL-arm-aarch64.img.xz.2           15%[+++++++=============>                                                                                                                     ]  59.58M  12.6MB/s    in 3.9s

2020-06-22 15:40:28 (10.2 MB/s) - Connection closed at byte 62472192. Retrying.


Thanks

Hi,
Same problem when I download freebsd-13.0 for nanopi r2s from same site...
Have you try your img in your nano pi ? It is works?

I don't think there is any problem from the ftp side as I have downloaded many image from the same link.
I think the aarch64 image is not a device specific image.
I have placed my order for R2s and hopefully will receive it by the end of july.

I am trying to download the same image and if it is successful then I will try to upload it somewhere on the web for you to download it without any problem.

@nekoprog
with the help of freebsd dev's I have a working freebsd image for Radxa RockPi E and I am working on adding it to your opnsense tools.


Quote from: mnoga on June 22, 2020, 04:41:37 PM
BTW: something seems to be preventing download of https://people.freebsd.org/~ganbold/OPNsense-201912171639-OpenSSL-arm-aarch64.img.xz
I was getting the same error but with infinite retries it completed 35 minutes or so:

wget --tries=0 https://people.freebsd.org/\~ganbold/OPNsense-201912171639-OpenSSL-arm-aarch64.img.xz


I received my Nanopi R2S today and will try to compile the kernel hopefully soon. My attempts are stored in this repo:
https://github.com/wilmardo/tools/tree/nanopi-r2s

Are there working device configs and kernel configs around for the NanoPi R2s? I am trying to set them up myself but starting from something that is known to work is much nicer.

July 12, 2020, 12:58:17 AM #185 Last Edit: July 13, 2020, 08:38:13 AM by mipsou
Hi,
In this img, there a no dtb for macchiatobin

i found howto get defconfig for macchiatobin http://wiki.macchiatobin.net/tiki-index.php?page=Build+from+source+-+Kernel

Regards
mipsou

EDIT:
i recommend to Looking https://github.com/openwrt/openwrt/commit/2534141322b0541daa627a516280638c12a262fe

You can see default and some tips hardware.

July 13, 2020, 09:20:54 PM #186 Last Edit: July 15, 2020, 09:57:16 PM by mnoga
The only thing that runs for me on NanoPi R2S is ganbold's image of FreeBSD 13 and that's with a caveat that only one ethernet port works, USB ethernet fails with:
ure0: attaching PHYs failed

Full dmesg attached.

I tried armbian and friendly elec's images of friendlywrt and friendly core. They do not even boot. I have a decent 16GB Transcend microsd card and I think I know how to use dd because FreeBSD boots. What can I try next?

Edit: i have managed to run friendlywrt and armbian on NanoPi R2S in the end.

July 14, 2020, 09:43:07 AM #187 Last Edit: July 15, 2020, 11:22:51 AM by mnoga
Can somebody smarter than me tell how to use serial console with NanoPi R2S?
I use macos Catalina and USB to TTL dongle (CP2102) from ebay. I installed drivers from https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers

and get following devices show up:
crw-rw-rw-  1 root       wheel   18,   2 14 Jul 08:27 /dev/tty.SLAB_USBtoUART
crw-rw-rw-  1 root  wheel   18,   5 14 Jul 08:27 /dev/cu.usbserial-0001
crw-rw-rw-  1 root       wheel   18,   4 14 Jul 08:27 /dev/tty.usbserial-0001


When i try to connect to any of them with screen:
screen /dev/tty.SLAB_USBtoUART 152000 8N1

Gibberish shows up:
���������m��������������R�������������ϓɖegr��γt�����������������������������������������������������������������������?���������������������������������������������������������������������������������������������������B��1���6���[���o�2��?����y�O����������������������������������������������������������������������������������������~�������������������������}�������������������_�ᾟ��������������Y�����������������y����������������������������

Edit: turns out the USB to UART I have is CP2102 based which cannot do baud rates higher than 921600 and friendly elec's wiki talks about using 1500000 baud rate. Guess i need a different dongle.

I don't know about the FreeBSD image (I will wait for a working OPNsense image, not a developer), but armbian and friendlywrt both worked for me. R2S support will get merged into openwrt, so you won't need friendlywrt anymore.

 ;D ;D ;D ;D ;D
Hi guys, i'm new to this,
can someone pls point me towards a working build/image/file of "OPNsense" for "NanoPi-R2S"?
(any version will do, as long as it works) [also where would i get future updates from?]
Many thanks, cheers ^_^

;D ;D ;D ;D ;D

It's very much work in progress with some attempts on github. To produce working image you'd need to cross compile and build it yourself and since nobody has shared any image yet I am not sure if the existing code will produce something that works.

Quote from: mnoga on July 14, 2020, 09:43:07 AM
Can somebody smarter than me tell how to use serial console with NanoPi R2S?
I use macos Catalina and USB to TTL dongle (CP2102) from ebay. I installed drivers from https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers

and get following devices show up:
crw-rw-rw-  1 root       wheel   18,   2 14 Jul 08:27 /dev/tty.SLAB_USBtoUART
crw-rw-rw-  1 root  wheel   18,   5 14 Jul 08:27 /dev/cu.usbserial-0001
crw-rw-rw-  1 root       wheel   18,   4 14 Jul 08:27 /dev/tty.usbserial-0001


When i try to connect to any of them with screen:
screen /dev/tty.SLAB_USBtoUART 152000 8N1

Gibberish shows up:
���������m��������������R�������������ϓɖegr��γt�����������������������������������������������������������������������?���������������������������������������������������������������������������������������������������B��1���6���[���o�2��?����y�O����������������������������������������������������������������������������������������~�������������������������}�������������������_�ᾟ��������������Y�����������������y����������������������������

Edit: turns out the USB to UART I have is CP2102 based which cannot do baud rates higher than 921600 and friendly elec's wiki talks about using 1500000 baud rate. Guess i need a different dongle.

Cp2102 have bad support for some of the rk and allwinner soc.

I have it but i cannot use it with some devices.  I have good experience with profolic pl series. 
Id recommend using pl series.

Hi @nekoprog

I have the Radxa RockPiE and with freebsd team support we have Freebsd running on it with both lan working.

Now I will start looking into opnsens port for the same device.

I am going to build it on native aarch64 device but I have been facing some issue with qemu as your tools are completely based on qemu.

Please check the issues on git.

Thanks.

@spikerguy
I would like to contribute to porting to NanoPiR2S. I managed so far:

  • Run Ganbold's freebsd image - 1 interface comes up - info posted above
  • Run Armbian/FriendlyWrt
  • Cross Compile various forks of Opnsense from github - so I have at this point cross compiling workflow working - wilmardo's looks promising but it fails when building image due to missing arm_install_uboot
  • Got myself some other usb to uart dongles: one on PL2303HX, other on CP2104
  • Reviewed various videos about u-boot on YT, i get the gist of it but got lost on details what is really required when porting. I have no idea what is uboot missing in here to get it running on R2S: https://github.com/opnsense/tools/compare/master...wilmardo:nanopi-r2s#diff-bd6443d009b4e5cb4bb4487c64127585
  • I have looked at Armbian boot directory for some clues
  • I have examined Armbian images with kpartx to get some ideas

I was thinking about either building upstream u-boot, or getting u-boot image from Armbian and sticking it all together. But still my understanding of u-boot is quite poor.
And then we have a problem with 1 ethernet coming up and the usb one being down.
If someone could point me in the right direction on the above, then maybe I can make some progress.

Quote from: mnoga on July 25, 2020, 09:05:57 AM
@spikerguy
I would like to contribute to porting to NanoPiR2S. I managed so far:

  • Run Ganbold's freebsd image - 1 interface comes up - info posted above
  • Run Armbian/FriendlyWrt
  • Cross Compile various forks of Opnsense from github - so I have at this point cross compiling workflow working - wilmardo's looks promising but it fails when building image due to missing arm_install_uboot
  • Got myself some other usb to uart dongles: one on PL2303HX, other on CP2104
  • Reviewed various videos about u-boot on YT, i get the gist of it but got lost on details what is really required when porting. I have no idea what is uboot missing in here to get it running on R2S: https://github.com/opnsense/tools/compare/master...wilmardo:nanopi-r2s#diff-bd6443d009b4e5cb4bb4487c64127585
  • I have looked at Armbian boot directory for some clues
  • I have examined Armbian images with kpartx to get some ideas

I was thinking about either building upstream u-boot, or getting u-boot image from Armbian and sticking it all together. But still my understanding of u-boot is quite poor.
And then we have a problem with 1 ethernet coming up and the usb one being down.
If someone could point me in the right direction on the above, then maybe I can make some progress.
Hello,
You should be able to build uboot from mainline uboot git and you can flash it on the emmc or sd card from any of the storage you want to use as boot drive.
I have my R2s dispatched but Idk when I will recieve it as it is coming directly from China.  Can you share the bootlog of freebsd on pastebin link?  I want to see which Ethernet device is working and I think Ganbold sir must be busy to not look into r2s lately but an email in mailing list will help.

Let me contact him about this issue.

Thanks for your contribution.