Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - nekoprog

#1
Quote from: markchang on November 30, 2020, 11:30:09 AM
Nano pi have recently released a "proper" dual Ethernet ( one onboard RTL8211E and one via PCIe R8111H )
https://wiki.friendlyarm.com/wiki/index.php/NanoPi_R4S
Is it possible to port OPNsense to this??

I believe you can port this board.

First you need to compile uboot for rk3399, then put the compiled .bin file to custom folder, make new device config and set that custom folder inside config, build opnsense/tools with that custom device config

Go to my github fork and post new issue if need futher details.
#2
if you have any problem, you can open issue at my repo, we will discuss it there
#3
to make this bootstrap works, we need to include all kernels for all type of armv7 manufacturer, that will do for kernel part. for base and packages, it will have no problem since it will all compiled with armv7 tools.
#4
Quote from: spikerguy on April 28, 2020, 02:09:46 AM
Can you advice how I can contribute?
I have rpi3b+
Khadas edge-v - rk3399 - aarch64 already have freebsd image for it.
Bpi-R2 armvh7 freebsd support is wip.

Can you help with simple tutorial  with steps?  Will be very helpful to try.

Thanks for such a great tool.
come join us at opnsense/tools more help needed there on making a generic arm32 arm64 kernel config, but i will not do anything for now, will wait for 20.7 release

Quote from: orangana on April 30, 2020, 03:30:01 AM
"arm support has been postponed to the 30.7 release"

  :-X
;D

Quote from: chemlud on April 30, 2020, 12:24:34 PM
...many things that were idealistic in the beginning have turned political over time... :-[
it's hard to keep things working for arm 32bit, since they have too many architecture and different kernel modules. but we can have a generic build for arm64 later.

currently i'm targetting this device http://www.banana-pi.org/r64.html
feel free to use my tools if you want to test 20.7 build using freebsd 12.1
#5
Quote from: orangana on November 13, 2019, 10:44:13 PM




http://wiki.friendlyarm.com/wiki/index.php/NanoPi_R1S-H5

Was there ever a opnsense device for less than $25 which does the job? This could be the first one!  ;D

I prefer at least 1GB of RAM to make it worth the time. Currently I'm working on NanoPi R1 device patch, let's hope FreeBSD accept it.

Quote from: kayti on November 23, 2019, 11:44:26 AM
Hello, i have problem with running OPNsense on RPI2. Somehow, after installing img from opening post on SD card, RPI2 boots, but after loading kernel screen goes black and device is unresponsive, ETH not working too.
Last msg before black screen is something like:
Booting [/boot/kernel/kernel]...
/boot/dtb/bcm2836-rpi-2-b.dtb size=0x385e
Loaded DTB from file 'bcm2836-rpi-2-b.dtb'.
Kernel entry at 0x200180...
Kernel args: (null)

I tried 2 different SD cards (which both work normally on raspbian).
After that tried to compile myself but on FreeBSD 11.2 amd64 i get errors when # make base DEVICE=RPI2 so compiling is unsuccessful... Something about [clang], already removed VM so can't check. Any idea?
These two are different problem entirely.
1. Where do you get the image that hangs on boot?
2. If you have the image ready, why did you stuck on first stage of build? What config did you use with FreeBSD11.2? Need more details so that we can help you better.

Attached here is my RPI2 running OPNsense 20.1, I can confirm that opnsense/tools is working just fine.
#6
Does SG3100 boots on normal FreeBSD or HBSD? If it doesn't maybe Netgate installed custom firmware inside. Might want to grab those firmwares from Netgate. Use the Netgate provided .dtb first to see if it works.
#7
Nice, tools.git is now ready for aarch64 production with the upcoming HBSD patch. Hope that in future Deciso will sell arm-based appliances for a low cost deployment on small premises.
#8
Quote from: rene_ on October 12, 2019, 04:12:09 PM
Hi Nekoprog,

i attached the output of the boot sequence.

It seems, that the kernel drivers for the Marvell switch and interfaces are missing.

i found them in the freebsd source, but dont know how to add them to the build procedure.

i used the default ARMADA-38X kernel config for my build, and put the prebuilt dtb files from the running pfsense image into my arm image. (still wondering this works ^^)

Kind regards,
René
Have you tried compiling with GENERIC kernel then copy all DTB into /boot/msdos/dtb?
#9
Quote from: dgktkr on October 11, 2019, 05:38:44 PM
Hi nekoprog,

Base and kernel for ClearFog have been built successfully thanks to your tips. The corresponding tgz files show up in /usr/local/opnsense/build/19.7/armv6/sets.

The packages build make -j4 packages DEVICE=CLEARFOG errors out after many hours. If the command is repeated, it errors out in a few seconds. Taking out the -j4 option gets farther, but it runs into an error I've made (leaving out suricata as well as suricata-devel). I'll fix that and try again.

dgktkr
By default, "make" is running with how many CPUs you have from the output of "sysctl kern.smp.cpus".

Quote from: rene_ on October 11, 2019, 11:29:04 PM
Hi,

i think it better to discuss in this thread.

after some start problems, i got opnsense booting on the armada 385 SoC (Netgate SG3100).

But i am not able to type anything in the serial console, and their are no network ports discoverd :-(

any ideas?

Greets,
René
Need to look further into defconfig or into kernelconf, maybe the port is not loaded on boot. Got full log?

Quote from: dgktkr on October 12, 2019, 07:00:49 AM
After the suggestions by nekoprog and franco were followed, the packages target was successfully built.

Now the problem is when building the arm image

make arm-3G DEVICE=CLEARFOG

the build errors out complaining

ln: /usr/obj/usr/tools/config/19.7/OpenSSL:armv6/boot/dtb/clearfog.dtb: No such file or directory

even though I put a valid clearfog.dtb there before the build. So where do I put a valid dtb file (or valid dts file if that's what is required) so that the build finds it?

dgktkr
You need to copy .dtb into kernel.tgz (look for /boot/dtb, create directory if not exist) in case FreeBSD does not include it during "make kernel". Do not copy into STAGEDIR (/usr/obj/usr/tools/config/19.7/OpenSSL:armv6), files will be replaces with base.tgz and kernel.tgz upon running "make arm".

OR

Edit config/19.7/SMP-CLEARFOG, change include ARMADA38X to include GENERIC, then edit device/CLEARFOG.conf, add this line cp -p ${STAGEDIR}/boot/dtb ${STAGEDIR}/boot/msdos/, this will copy all arm device dtb instead of looking only for clearfog. Hope this will solve both you and rene problem.
#10
Quote from: rene_ on October 08, 2019, 07:52:14 PM
Hello again,

seems quite dead here :-(

I think i read through everything now.
But i still encounter some errors.

when i try to make packages, or ports, the whole thing just stops after some hours.

There is no error or anything, it just wont do anything.

Greets,
René
You need to disable suricata-devel, compiling rust at some point will make your CPU went idle. Try this fix.
#11
Quote from: dgktkr on October 10, 2019, 06:33:42 AM
Hi,

When using FreeBSD 11.2 as the host, make base succeeds, but I'm wondering about the compiles. The build output to the console shows the message

SYSTEM_COMPILER: Determined that CC=cc matches the source tree. Not bootstrapping a cross-compiler.

Is code being cross-compiled? If not, is there some environment variable that has to be set so that cross-compiling is done?

dgktkr
Just ignore it because we set the target arch on device config. If sets are listed here "ls /usr/local/opnsense/build/19.7/armv6/sets", then it's a success. Proceed with next make step.

Don't forget to include DEVICE=CLEARFOG arguments when running "make". Else you will build i386/amd64 arch images.

Forgot to mention you this before. You need to disable suricata-devel when running "make packages DEVICE=CLEARFOG".
#12
Quote from: dgktkr on October 09, 2019, 04:57:05 PM
Hi nekoprog,

Thanks for the prompt reply. The version of the host FreeBSD was 12.0. I'm downloading 11.2 right now so it can be installed and used to cross build OPNsense for arm.

QuoteThis repo has been archived and only works on OPNsense 18.01 where building for arm is not yet supported.

Could you elaborate on that? Where should tools be downloaded from to enable a successful build for armv6? From the console output, it looks like it was trying to build OPNsense 19.7.

dgktkr
pieSense repo has been archived, it's not associated to OPNsense and I use it in the past to test for RPI2 build. Current OPNsense/tools config for arm is more robust, just need to add kernel and device configs.

Quote from: dgktkr on October 09, 2019, 07:53:56 PM
Another question: Where does one specify KERNCONF for the kernel build of the target SOC, in my case: /usr/src/sys/arm/conf/ARMADA38X? For bananapi it seemed to be specified in older versions of BANANAPI.conf as KERNEL=ALLWINNER https://github.com/opnsense/src/blob/8d1a9170bd4d9d50ffeecc2c8366ec34b8ebdb02/release/arm/BANANAPI.conf#L6-L18.

dgktkr
Can you confirm the kernel type? This should be change at https://github.com/opnsense/tools/tree/master/config/19.7 and you need to create new kernel config file, use SMP-BANANAPI for example and rename it to SMP-CLEARFOG and change include ALLWINNER to include ARMADA38X maybe? And ident SMP-BANANAPI to ident SMP-CLEARFOG.

After you have a successful results for BASE KERNEL and PACKAGES, we need to make a minor adjustment to device config for .img creation to make sure it boots into OPNsense later. Here my sample CLEARFOG.conf if you like to test, I have commented out the parts that needed some modifications. Hope you can help with this.
#13
Quote from: dgktkr on October 08, 2019, 10:46:06 PM
Hi,

I have a ClearFog Base which is based on an armv7 SOC, but it can run armv6. I've gotten FreeBSD 11.2, 12.0 and 12.1 to boot and run on it with both ethernet ports working properly.

I've followed nekoprog's instructions https://github.com/nekoprog/pieSense/blob/master/README.md with appropriate modifications.

In the /usr/tools/Makefile the line

ARCH?= ${_ARCH}

was replaced by

ARCH?= arm:armv6

and the line

DEVICE?= A10

was replaced by

DEVICE?= CLEARFOG.


The file /usr/tools/device/CLEARFOG.conf was created and modeled after BANANAPI.conf:


export MAKE_ARGS_DEV="
CROSS_BINUTILS_PREFIX=/usr/local/arm-gnueabi-freebsd11.2/bin
UBLDR_LOADADDR=0x900000
"

export PRODUCT_TARGET=arm
export PRODUCT_ARCH=armv6
export PRODUCT_WANTS="arm-gnueabi-binutils qemu-user-static u-boot-clearfog"

export ARM_FAT_SIZE="32m -b 1m"
export ARM_UBOOT_DIR="/usr/local/share/u-boot/u-boot-clearfog"

arm_install_uboot()
{
arm_unmount
dd if=${ARM_UBOOT_DIR}/u-boot-spl.kwb of=/dev/${DEV} bs=1k seek=8 conv=sync
arm_mount
cp ${ARM_UBOOT_DIR}/boot.scr ${STAGEDIR}/boot/msdos
cp -p ${STAGEDIR}/boot/ubldr.bin ${STAGEDIR}/boot/msdos
ln ${STAGEDIR}/boot/dtb/clearfog.dtb ${STAGEDIR}/boot/dtb/armada-388-clearfog.dtb
}


#pkg install git qemu-user-static arm-gnueabi-binutils u-boot-clearfog


was invoked and completed successfully.

When

/usr/tools #make base

is executed, the computer works for quite a while until the build fails with a relocation overflow. The first sign of trouble is

===> usr.bin/clang/clang (all)
cc1_main.o: In function `cc1_main(llvm::ArrayRef<char const*>, char const*, void*)':
cc1_main.cpp:(.text._Z8cc1_mainN4llvm8ArrayRefIPKcEES2_Pv+0x45c): relocation truncated to fit: R_ARM_CALL against symbol `llvm::install_fatal_error_handler(void (*)(void*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool), void*)' defined in .text._ZN4llvm27install_fatal_error_handlerEPFvPvRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbES0_ section in /usr/obj/arm.armv6/usr/src/lib/clang/libllvm/libllvm.a(ErrorHandling.o)


This problem looks like the same issue reported and supposedly solved about 11 months ago https://github.com/opnsense/tools/issues/113

Running

/usr/tools #make xtools


before

/usr/tools # make base


doesn't solve the problem. And after building xtools, running

/usr/tools #make packages


fails in the same place in the same way as

/usr/tools #make base.

Was the fix that was implemented in tools last December propagated to the current version at https://github.com/opnsense/tools?

This repo has been archived and only works on OPNsense 18.01 where building for arm is not yet supported.  What version of FreeBSD you're using? This line should be edited too following your FreeBSD version.
CROSS_BINUTILS_PREFIX=/usr/local/arm-gnueabi-freebsd11.2/bin

Instead of editing Makefile, you should just create new device config and call it like this make STEP DEVICE=CLEARFOG
#14
Quote from: spikerguy on September 26, 2019, 02:23:04 PM
Hello,
I am new to opnsense forum but not new to the software on x86.
I want to know how can I port opnsense to Armv7 and aarch64 boards? I have good knowledge in linux world but slowly moving to bsd too.
If there is any guide or documentation for porting freebsd or specifically opnsense then I would love to contribute.
Thanks

You can start from here for opnsense build tools. For arm sources, you'll have to look everywhere and bring it back to github opnsense/tools for device configs and build scripts.
#15
Let's hope FreeBSD can add this new port
[new ports] sysutils/u-boot-espressobin