Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Need help building dhcp6c for armv7

    Scheduled Pinned Locked Moved DHCP and DNS
    10 Posts 3 Posters 1.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      Superpaul209
      last edited by

      Hello,

      My ISP requires that I use raw-options in my dhcp6 client to get an IPv6 on my pfsense. The default binary provided by Netgate uses a very old version of dhcp6 which doesn't work with raw-options.
      I have found that some people updated the source code to get it working https://github.com/opnsense/dhcp6c
      How can I compile it for my pfsense SG-3100 which has an ARMv7 CPU ?

      I have tried everything on cross compiling on an amd64 freebsd server but it doesn't work since its using an arm library from linux.

      Thanks for your help !

      1 Reply Last reply Reply Quote 0
      • bmeeksB
        bmeeks
        last edited by bmeeks

        This pfSense user did something similar a while back for Barnyard2. He posted a "how-to" Wiki here: https://github.com/rickyzhang82/FreeBSDWiki/wiki.

        The summary version is you must create a Poudriere jail emulation environment on a FreeBSD machine (bare-metal or VM) in order to build the 32-bit ARM files. Note this is not for the faint of heart and requires quite a bit of prior knowledge about creating suitable build environments and toolchains.

        You may already know this, but your SG-3100 is a 32-bit device, so make sure you create the appropriate jail. The Wiki linked above should work for you if you replace references to Barnyard2 with the appropriate dhcp6c port you wish to build.

        keyserK 1 Reply Last reply Reply Quote 1
        • keyserK
          keyser Rebel Alliance @bmeeks
          last edited by

          @bmeeks I have the same challenge, and are currently using a AMD64 based device just because I can use the dhcp6c binary from OPNSENSE.
          But I’m going to meet this problem with a bunch of SG-2100’s I’m deploying, and I would really like a dhcp6c binary for Aarch64(ARM64).

          Does anyone know where one might be posted/obtained?

          Ideally netgate would wake up and update the dhcp6c in pfSense so it can handle RAW options. It’s been requested for years but nothing happened.

          Love the no fuss of using the official appliances :-)

          S 1 Reply Last reply Reply Quote 0
          • S
            Superpaul209 @keyser
            last edited by

            @keyser Hello, I have found one guy who has built opnsense on aarch64, you can find all the binaries here : https://ftp.yrzr.tk/opnsense/
            With this new dhcp6c, you will be able to use raw-options on aarch64 for your SG-2100, SG-1100.

            @bmeeks Im trying to build a poudriere jail but I have some errors that happen during the jail making process :

            --- all_subdir_usr.sbin/mixer ---
            ===> usr.sbin/mixer (all)
            --- all_subdir_rescue ---
            --- rescue.o ---
            rescue.c:73:10: fatal error: 'sys/auxv.h' file not found
            #include <sys/auxv.h>
                     ^~~~~~~~~~~~
            --- chflags_stub.o ---
            cc  -O -pipe   -std=gnu99    -Qunused-arguments   -O -pipe -c chflags_stub.c -o chflags_stub.o
            --- all_subdir_usr.sbin ---
            --- .depend ---
            echo mixer.full: /usr/obj/arm.armv6/usr/local/poudriere/jails/pfsense-port-11-2-armv6/usr/src/tmp/usr/lib/libc.a  >> .depend
            --- mixer.o ---
            cc  -O -pipe   -g -MD  -MF.depend.mixer.o -MTmixer.o -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable  -Qunused-arguments  -c /usr/local/poudriere/jails/pfsense-port-11-2-armv6/usr/src/usr.sbin/mixer/mixer.c -o mixer.o
            --- all_subdir_rescue ---
            --- rescue.o ---
            1 error generated.
            *** [rescue.o] Error code 1
            
            make[5]: stopped in /usr/obj/arm.armv6/usr/local/poudriere/jails/pfsense-port-11-2-armv6/usr/src/rescue/rescue
            --- all_subdir_tests ---
            --- lio_kqueue_test.debug ---
            --- all_subdir_rescue ---
            1 error
            
            make[5]: stopped in /usr/obj/arm.armv6/usr/local/poudriere/jails/pfsense-port-11-2-armv6/usr/src/rescue/rescue
            *** [rescue] Error code 2
            
            make[4]: stopped in /usr/local/poudriere/jails/pfsense-port-11-2-armv6/usr/src/rescue/rescue
            1 error
            
            make[4]: stopped in /usr/local/poudriere/jails/pfsense-port-11-2-armv6/usr/src/rescue/rescue
            *** [all] Error code 2
            
            make[3]: stopped in /usr/local/poudriere/jails/pfsense-port-11-2-armv6/usr/src/rescue
            1 error
            
            make[3]: stopped in /usr/local/poudriere/jails/pfsense-port-11-2-armv6/usr/src/rescue
            --- all_subdir_lib ---
            --- all_subdir_usr.sbin ---
            --- all_subdir_secure ---
            *** [all] Error code 2
            
            make[4]: stopped in /usr/local/poudriere/jails/pfsense-port-11-2-armv6/usr/src/secure/lib
            1 error
            
            make[4]: stopped in /usr/local/poudriere/jails/pfsense-port-11-2-armv6/usr/src/secure/lib
            --- all_subdir_gnu ---
            *** [all] Error code 2
            
            make[5]: stopped in /usr/local/poudriere/jails/pfsense-port-11-2-armv6/usr/src/gnu/usr.bin/gdb
            1 error
            
            make[5]: stopped in /usr/local/poudriere/jails/pfsense-port-11-2-armv6/usr/src/gnu/usr.bin/gdb
            --- all_subdir_usr.bin ---
            [00:30:39] Error: Failed to 'make buildworld'
            [00:30:39] Error while creating jail, cleaning up.
            [00:30:39] Removing pfsense-port-11-2-armv6 jail... done
            [00:30:42] Cleaning pfsense-port-11-2-armv6 data... done
            

            Im trying to find a solution how to continue the arm build... its very complicated and its my first time using poudriere / cross compile

            keyserK 1 Reply Last reply Reply Quote 1
            • keyserK
              keyser Rebel Alliance @Superpaul209
              last edited by

              @superpaul209 Thanks mate - I'll give that a try

              Love the no fuss of using the official appliances :-)

              1 Reply Last reply Reply Quote 1
              • S
                Superpaul209
                last edited by

                I have successfully created an armv7 jail with the command, before doing that you need to enable QEMU by adding qemu_user_static_enable="YES" in rc.conf

                sudo poudriere jails -c -j pfsense-port-12-2-armv7 -a arm.armv7 -m svn -v release/12.2.0
                

                Now I need to find how to compile this new dhcp6c package in the jail...
                After a git clone of pfsense ports, I have created a port tree for the jail :

                sudo poudriere ports -c -f none -m null -M /root/FreeBSD-ports -p pfsense
                

                Created a pfsense-port-12-2-armv7-pfsense-pkglist in /usr/local/etc/poudriere.d/ with inside dhcp6c, it will points out to /root/FreeBSD-ports/dhcp6c

                Whatever Im doing a poudriere bulk command, it will outputs that its unable to extract pkg.
                Do you know what Im doing wrong ?

                Do I need pkg-plist, Makefile, pkg-descr and distinfo in my dhcp6c folder to get it working ?

                I didn't know it would be that hard to compile it...

                1 Reply Last reply Reply Quote 0
                • bmeeksB
                  bmeeks
                  last edited by bmeeks

                  I mentioned in my first reply in this thread that compiling packages for the ARM appliances is not for the faint of heart. There is a lot of "magic" required to get things to work, and even then some packages will just not compile in an emulated environment.

                  Building ports on FreeBSD is not the same as compiling something in Linux. The build tools are a bit different.

                  In reply to the question about a Makefile, distinfo file, and pkg-plist file, the answer is "yes" you need all of those to create a proper package that you can then install on pfSense. Examine how the dhcp6c port is packaged in the stock FreeBSD tree. You will need to create a proper patch diff file and put it in the files sub-folder (if there is one, if not create one).

                  Here is an older thread with some tips for creating a patch diff file. You should be able to adapt the info there to the current dhcp6c scenario: https://forum.netgate.com/topic/169749/pfsense-compile-requirements-for-3rd-party-software/14.

                  1 Reply Last reply Reply Quote 1
                  • S
                    Superpaul209
                    last edited by Superpaul209

                    Hello again, thanks for your replies.

                    I have found a solution by myself by compiling it from source code and using poudriere.

                    I have worked really hard and its finally working fine !
                    You can find the tutorial and the compiled dhcp6c for armv7 on my github : https://github.com/Superpaul209/dhcp6c-armv7

                    The new package has been added to my SG-3100 running FreeBSD 12.2 on armv7, the dhcp6 client has got an IPv6 successfully !

                    bmeeksB 1 Reply Last reply Reply Quote 2
                    • bmeeksB
                      bmeeks @Superpaul209
                      last edited by

                      @superpaul209 said in Need help building dhcp6c for armv7:

                      Hello again, thanks for your replies.

                      I have found a solution by myself by compiling it from source code and using poudriere.

                      I have worked really hard and its finally working fine !
                      You can find the tutorial and the compiled dhcp6c for armv7 on my github : https://github.com/Superpaul209/dhcp6c-armv7

                      The new package has been added to my SG-3100 running FreeBSD 12.2 on armv7, the dhcp6 client has got an IPv6 successfully !

                      This is great! You might consider posting this as a pull request on the pfSense FreeBSD-ports repo here: https://github.com/pfsense/FreeBSD-ports. I assume the source code changes are applicable to both x86_64 and ARM systems.

                      S 1 Reply Last reply Reply Quote 1
                      • S
                        Superpaul209 @bmeeks
                        last edited by

                        @bmeeks No problem, I hope my changes will help all users to have access to those new features asap.
                        In France we must use raw-options to get IPv6 and some people prefer to use OpnSense instead of pfSense because of that. At least, developpers should consider to update this package if its not my PR.

                        https://github.com/pfsense/FreeBSD-ports/pull/1181

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post
                        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.