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 Code: [Select]ARCH?= ${_ARCH} was replaced by Code: [Select]ARCH?= arm:armv6 and the line Code: [Select]DEVICE?= A10 was replaced by Code: [Select]DEVICE?= CLEARFOG.The file /usr/tools/device/CLEARFOG.conf was created and modeled after BANANAPI.conf:Code: [Select]export MAKE_ARGS_DEV="CROSS_BINUTILS_PREFIX=/usr/local/arm-gnueabi-freebsd11.2/binUBLDR_LOADADDR=0x900000"export PRODUCT_TARGET=armexport PRODUCT_ARCH=armv6export 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}Code: [Select]#pkg install git qemu-user-static arm-gnueabi-binutils u-boot-clearfog was invoked and completed successfully.When Code: [Select]/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 Code: [Select]===> 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/113Running Code: [Select]/usr/tools #make xtools before Code: [Select]/usr/tools # make base doesn't solve the problem. And after building xtools, running Code: [Select]/usr/tools #make packages fails in the same place in the same way asCode: [Select]/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?
ARCH?= ${_ARCH}
ARCH?= arm:armv6
DEVICE?= A10
DEVICE?= CLEARFOG
export MAKE_ARGS_DEV="CROSS_BINUTILS_PREFIX=/usr/local/arm-gnueabi-freebsd11.2/binUBLDR_LOADADDR=0x900000"export PRODUCT_TARGET=armexport PRODUCT_ARCH=armv6export 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
/usr/tools #make base
===> 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)
/usr/tools #make xtools
/usr/tools # make base
/usr/tools #make packages
make STEP DEVICE=CLEARFOG
This repo has been archived and only works on OPNsense 18.01 where building for arm is not yet supported.
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
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
SYSTEM_COMPILER: Determined that CC=cc matches the source tree. Not bootstrapping a cross-compiler.
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 Code: [Select]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
make -j4 packages DEVICE=CLEARFOG
make arm-3G DEVICE=CLEARFOG
ln: /usr/obj/usr/tools/config/19.7/OpenSSL:armv6/boot/dtb/clearfog.dtb: No such file or directory
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 Code: [Select]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
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é
After the suggestions by nekoprog and franco were followed, the packages target was successfully built.Now the problem is when building the arm image Code: [Select]make arm-3G DEVICE=CLEARFOG the build errors out complaining Code: [Select]ln: /usr/obj/usr/tools/config/19.7/OpenSSL:armv6/boot/dtb/clearfog.dtb: No such file or directoryeven 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
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é