Augustin-FL / building-pfsense-iso-from-source

How to: Building a pfSense .iso from sources
54 stars 50 forks source link

./build.sh --skip-final-rsync iso error(pfsenes 2.6 FreeBSD 12.2) #54

Closed gitmessage closed 5 months ago

gitmessage commented 2 years ago

objcopy --only-keep-debug cryptocheck.full cryptocheck.debug objcopy --strip-debug --add-gnu-debuglink=cryptocheck.debug cryptocheck.full cryptocheck (cd /root/pfsense/tmp/FreeBSD-src/tools/tools/crypto && DEPENDFILE=.depend.cryptotest NO_SUBDIR=1 make -f /root/pfsense/tmp/FreeBSD-src/tools/tools/crypto/Makefile _RECURSING_PROGS=t PROG=cryptotest ) echo cryptotest.full: /root/pfsense/tmp/stage-dir/usr/lib/libc.a >> .depend.cryptotest /root/pfsense/tmp/obj/root/pfsense/tmp/FreeBSD-src/amd64.amd64/tmp/usr/bin/cc -O2 -pipe -fno-common -DNDEBUG -g -MD -MF.depend.cryptotest.cryptotest.o -MTcryptotest.o -std=gnu99 -Wno-format-zero-length -fstack-protector-strong -Qunused-arguments -c /root/pfsense/tmp/FreeBSD-src/tools/tools/crypto/cryptotest.c -o cryptotest.o /root/pfsense/tmp/FreeBSD-src/tools/tools/crypto/cryptotest.c:435:15: error: no member named 'cs_invoke' in 'struct cryptostats' bzero(&stats.cs_invoke, sizeof (stats.cs_invoke));


/root/pfsense/tmp/FreeBSD-src/tools/tools/crypto/cryptotest.c:435:40: error: no member named 'cs_invoke' in 'struct cryptostats'
        bzero(&stats.cs_invoke, sizeof (stats.cs_invoke));
                                        ~~~~~ ^
/root/pfsense/tmp/FreeBSD-src/tools/tools/crypto/cryptotest.c:436:15: error: no member named 'cs_done' in 'struct cryptostats'
        bzero(&stats.cs_done, sizeof (stats.cs_done));
               ~~~~~ ^
/root/pfsense/tmp/FreeBSD-src/tools/tools/crypto/cryptotest.c:436:38: error: no member named 'cs_done' in 'struct cryptostats'
        bzero(&stats.cs_done, sizeof (stats.cs_done));
                                      ~~~~~ ^
/root/pfsense/tmp/FreeBSD-src/tools/tools/crypto/cryptotest.c:437:15: error: no member named 'cs_cb' in 'struct cryptostats'
        bzero(&stats.cs_cb, sizeof (stats.cs_cb));
               ~~~~~ ^
/root/pfsense/tmp/FreeBSD-src/tools/tools/crypto/cryptotest.c:437:36: error: no member named 'cs_cb' in 'struct cryptostats'
        bzero(&stats.cs_cb, sizeof (stats.cs_cb));
                                    ~~~~~ ^
/root/pfsense/tmp/FreeBSD-src/tools/tools/crypto/cryptotest.c:438:15: error: no member named 'cs_finis' in 'struct cryptostats'
        bzero(&stats.cs_finis, sizeof (stats.cs_finis));
               ~~~~~ ^
/root/pfsense/tmp/FreeBSD-src/tools/tools/crypto/cryptotest.c:438:39: error: no member named 'cs_finis' in 'struct cryptostats'
        bzero(&stats.cs_finis, sizeof (stats.cs_finis));
                                       ~~~~~ ^
/root/pfsense/tmp/FreeBSD-src/tools/tools/crypto/cryptotest.c:439:8: error: no member named 'cs_invoke' in 'struct cryptostats'
        stats.cs_invoke.min.tv_sec = 10000;
        ~~~~~ ^
/root/pfsense/tmp/FreeBSD-src/tools/tools/crypto/cryptotest.c:440:8: error: no member named 'cs_done' in 'struct cryptostats'
        stats.cs_done.min.tv_sec = 10000;
        ~~~~~ ^
/root/pfsense/tmp/FreeBSD-src/tools/tools/crypto/cryptotest.c:441:8: error: no member named 'cs_cb' in 'struct cryptostats'
        stats.cs_cb.min.tv_sec = 10000;
        ~~~~~ ^
/root/pfsense/tmp/FreeBSD-src/tools/tools/crypto/cryptotest.c:442:8: error: no member named 'cs_finis' in 'struct cryptostats'
        stats.cs_finis.min.tv_sec = 10000;
        ~~~~~ ^
/root/pfsense/tmp/FreeBSD-src/tools/tools/crypto/cryptotest.c:448:32: warning: declaration of 'struct cryptotstat' will not be
      visible outside of this function [-Wvisibility]
printt(const char* tag, struct cryptotstat *ts)
                               ^
/root/pfsense/tmp/FreeBSD-src/tools/tools/crypto/cryptotest.c:452:8: error: incomplete definition of type 'struct cryptotstat'
        if (ts->count == 0)
            ~~^
/root/pfsense/tmp/FreeBSD-src/tools/tools/crypto/cryptotest.c:448:32: note: forward declaration of 'struct cryptotstat'
printt(const char* tag, struct cryptotstat *ts)
                               ^
/root/pfsense/tmp/FreeBSD-src/tools/tools/crypto/cryptotest.c:454:24: error: incomplete definition of type 'struct cryptotstat'
        avg = (1000000000LL*ts->acc.tv_sec + ts->acc.tv_nsec) / ts->count;
                            ~~^
/root/pfsense/tmp/FreeBSD-src/tools/tools/crypto/cryptotest.c:448:32: note: forward declaration of 'struct cryptotstat'
printt(const char* tag, struct cryptotstat *ts)
                               ^
/root/pfsense/tmp/FreeBSD-src/tools/tools/crypto/cryptotest.c:454:41: error: incomplete definition of type 'struct cryptotstat'
        avg = (1000000000LL*ts->acc.tv_sec + ts->acc.tv_nsec) / ts->count;
                                             ~~^
/root/pfsense/tmp/FreeBSD-src/tools/tools/crypto/cryptotest.c:448:32: note: forward declaration of 'struct cryptotstat'
printt(const char* tag, struct cryptotstat *ts)
                               ^
/root/pfsense/tmp/FreeBSD-src/tools/tools/crypto/cryptotest.c:454:60: error: incomplete definition of type 'struct cryptotstat'
        avg = (1000000000LL*ts->acc.tv_sec + ts->acc.tv_nsec) / ts->count;
                                                                ~~^
/root/pfsense/tmp/FreeBSD-src/tools/tools/crypto/cryptotest.c:448:32: note: forward declaration of 'struct cryptotstat'
printt(const char* tag, struct cryptotstat *ts)
                               ^
/root/pfsense/tmp/FreeBSD-src/tools/tools/crypto/cryptotest.c:455:23: error: incomplete definition of type 'struct cryptotstat'
        min = 1000000000LL*ts->min.tv_sec + ts->min.tv_nsec;
                           ~~^
/root/pfsense/tmp/FreeBSD-src/tools/tools/crypto/cryptotest.c:448:32: note: forward declaration of 'struct cryptotstat'
printt(const char* tag, struct cryptotstat *ts)
                               ^
/root/pfsense/tmp/FreeBSD-src/tools/tools/crypto/cryptotest.c:455:40: error: incomplete definition of type 'struct cryptotstat'
        min = 1000000000LL*ts->min.tv_sec + ts->min.tv_nsec;
                                            ~~^
/root/pfsense/tmp/FreeBSD-src/tools/tools/crypto/cryptotest.c:448:32: note: forward declaration of 'struct cryptotstat'
printt(const char* tag, struct cryptotstat *ts)
                               ^
/root/pfsense/tmp/FreeBSD-src/tools/tools/crypto/cryptotest.c:456:23: error: incomplete definition of type 'struct cryptotstat'
        max = 1000000000LL*ts->max.tv_sec + ts->max.tv_nsec;
                           ~~^
/root/pfsense/tmp/FreeBSD-src/tools/tools/crypto/cryptotest.c:448:32: note: forward declaration of 'struct cryptotstat'
printt(const char* tag, struct cryptotstat *ts)
                               ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
*** Error code 1

Stop.
make[1]: stopped in /root/pfsense/tmp/FreeBSD-src/tools/tools/crypto
*** Error code 1
root@buildFireWall26:~/pfsense/logs # 
Socket error Event: 32 Error: 10053.
Connection closing...Socket close.

Connection closed by foreign host.
nhathoa commented 2 years ago

I have the same issues.

I try: Edit the file /tools/tools/crypto/Makefile : remove cryptokeytest from the PROGS command but it's not work

gitmessage commented 2 years ago

I change FreeBSD 12.2 to FreeBSD 12.3. but Same error I need help Thanks

lpc-v commented 2 years ago

I met this problem too. So, have you found the solution? Thanks

lpc-v commented 2 years ago

Hello?

lpc-v commented 2 years ago

Have you resolve this problem? I need help. Thanks

nhathoa commented 2 years ago

In file builder_common.sh, at line 283: (script -aq $LOGFILE make -C ${FREEBSD_SRC_DIR}/tools/tools/crypto ${makeargs} clean all install || print_error_pfS;) | egrep '^>>>' | tee -a ${LOGFILE} . You add a comment (#) before this line. It shoud work.

gitmessage commented 2 years ago

It worked. Thanks but another error

./build.sh --skip-final-rsync iso

Done!

Installing pkg repository in chroot (/root/pfsense/tmp/stage-dir)... Installing built ports (packages) in chroot (/root/pfsense/tmp/stage-dir)... Done! Creating core packages repository... Done! Signing repository... Done! Cleaning build directories: final-dir Done! Building bootable ISO image for amd64 Previous /root/pfsense/tmp/final-dir detected cleaning up...Done. Preparing Final image staging area: Tue Jun 7 15:02:27 CST 2022 Cloning /root/pfsense/tmp/stage-dir to /root/pfsense/tmp/final-dir Using TAR to clone /root/pfsense/tmp/stage-dir to /root/pfsense/tmp/final-dir ...Done! ERROR: Package GFireWall-rc-2.6.0.txz not found

#################################### Something went wrong, check errors! ####################################

NOTE: a lot of times you can run './build.sh --clean-builder' to resolve.

Log saved on /root/pfsense/logs/isoimage.amd64

Terminated

gitmessage commented 2 years ago

find / -name 'GFireWall-rc-2.6.0.txz'

Can not found any file

LittleCai commented 2 years ago

@gitmessage hi, How did you solve this ".txz not found" problem?

LittleCai commented 2 years ago

I resolved this problem.
In my .../xxx_v2_6_0_amd64-core/All directory, there is only .pkg files. So My solution is: modify the builder_common.sh file, change .txz to .pkg:

$(get_pkg_name kernel-${KERNEL_NAME}).txz -> $(get_pkg_name kernel-${KERNEL_NAME}).pkg $(get_pkg_name kernel-${_EXTRA_KERNEL}).txz -> $(get_pkg_name kernel-${_EXTRA_KERNEL}).pkg ${CORE_PKG_ALL_PATH}/default-config.txz -> ${CORE_PKG_ALL_PATH}/default-config.pkg local _pkg="$(get_pkg_name ${2}).txz" -> local _pkg="$(get_pkg_name ${2}).pkg"

then everything is working.

kontrol-br commented 2 years ago

I resolved this problem. In my .../xxx_v2_6_0_amd64-core/All directory, there is only .pkg files. So My solution is: modify the builder_common.sh file, change .txz to .pkg:

(getpkgnamekernel−{KERNEL_NAME}).txz -> (getpkgnamekernel−{KERNEL_NAME}).pkg (getpkgnamekernel−{_EXTRA_KERNEL}).txz -> (getpkgnamekernel−{_EXTRA_KERNEL}).pkg ${CORE_PKG_ALL_PATH}/default-config.txz -> ${CORE_PKG_ALL_PATH}/default-config.pkg local _pkg="$(get_pkg_name 2).txz"−>localpkg="(get_pkg_name ${2}).pkg"

then everything is working.

Be careful with it cause during the transition from version 2.5x to 2.6.x you will need both file extensions. The ideal is to have both file extensions, at least for the upgrade process from 2.5.x to 2.6.x That's related to the PKG command change on FreeBSD. Hope that helps.

LittleCai commented 2 years ago

@kontrol-br Yes, you are right, and thanks for the reminder.

lc09cn commented 1 year ago

@LittleCai ./build.sh --update-pkg-repo

Finished devel/libffi | libffi-3.3_1: Failed: fetch

do you know what can i do

jargonTSD commented 1 year ago

@LittleCai ./build.sh --update-pkg-repo

Finished devel/libffi | libffi-3.3_1: Failed: fetch

do you know what can i do

At this point you've likely solved this for yourself, but for anyone else: The specific commit that is referenced in the distfile doesn't match the size/hash of the commit as it exists in the repositories. To resolve the error, modify devel/libffi/distinfo and change the two lines

SHA256 (01a75ed76ea7e57f1b7a5c183e2b1e890e6aa0fd.diff) = 627aac849e93debaa21cd85feb82b1a28cf481687a14717cf522eaec2a2b19aa
SIZE (01a75ed76ea7e57f1b7a5c183e2b1e890e6aa0fd.diff) = 412

to

SHA256 (01a75ed76ea7e57f1b7a5c183e2b1e890e6aa0fd.diff) = 79935f5836624a9b38d0d40541a9d7510f4ecff14f6a7881f483b158cf13d335
SIZE (01a75ed76ea7e57f1b7a5c183e2b1e890e6aa0fd.diff) = 414

NOTE: If you make this change on GitHub, you'll need to refresh the ports clone on your build system: ./build.sh --update-poudriere-ports If you make the change directly in your build machine don't forget to commit the changes, as you'll likely need to fix other things later, anyway!

Getachew0557 commented 1 year ago

Hello Everyone, First I Have installed FreeBSD 13.2 on my desktop via VMware. Step1: I have cloned the three files;

Step2:

Then some configuration files were renamed

FreeBSD source code In the folder /release/conf/, rename pfSense_src-env.conf, pfSense_src.conf and pfSense_make.conf to libreSense_src-env.conf, libreSense_src.conf and libreSense_make.conf Rename the file /sys/amd64/conf/pfSense to /sys/amd64/conf/libreSense

FreeBSD ports in the file /security/pfSense/Makefile : there is no wireguard-tools>=0:security/wireguard-tools on the RUN_DEPENDS variable

pfsense source code Go to the folder /tools/templates/pkg_repos/ in the branch you would like to build (masterfor dev version, RELENG_2_5_0 for stable version) and change pfSense to libreSense in the file names (e.g., pfSense-repo.abi => libreSense-repo.abi) Edit the file /src/etc/inc/globals.inc : replace the content of product_name by libreSense, and the content of pkg_prefix by libreSense-pkg-. In the folder /src/usr/local/share/, rename the folder pfSense to libreSense. In the folder /src/etc/, rename the files pfSense-ddb.conf and pfSense-devd.conf to libreSense-ddb.conf and libreSense-devd.conf. Edit the file /tools/builder_defaults.sh : remove if_wg from the MODULES_OVERRIDE variable.

Step3: Build the pfsense source code

Unix@Unix:~/Downloads/pfsense_source/pfsense $ sudo ./build.sh iso

Operation ./build.sh has started at Thu Aug 10 14:24:02 EAT 2023 Building image type(s): iso Cleaning up previous build environment...Please wait! Cleaning build directories: Done! Cleaning previously built kernel stage area...Done! Cleaning previously built images...Done! Cleaning previous builder logs...Done! Cleaning of builder environment has finished. Obtaining FreeBSD sources (devel-12)... ====>> Removing local changes from git repo https://github.com/pfsense/freebsd-src.git (devel-12) ====>> Removing leftovers from git repo https://github.com/pfsense/freebsd-src.git (devel-12) ====>> Retrieving updates from git repo https://github.com/pfsense/freebsd-src.git (devel-12) ====>> Updating git repo https://github.com/pfsense/freebsd-src.git (devel-12) ====>> Rebasing git repo https://github.com/pfsense/freebsd-src.git (devel-12) Last known to commit Kristof Provost - d9601d99bbeb1d941484d777d8d3fbe1839a2faa Missing dependency (sys-utils/screen).

#################################### Something went wrong, check errors! ####################################

NOTE: a lot of times you can run './build.sh --clean-builder' to resolve.

Terminated

Anyone can fix ?

MehrozMustafa commented 11 months ago

I resolved this problem. In my .../xxx_v2_6_0_amd64-core/All directory, there is only .pkg files. So My solution is: modify the builder_common.sh file, change .txz to .pkg: (getpkgnamekernel−{KERNEL_NAME}).txz -> (getpkgnamekernel−{KERNEL_NAME}).pkg (getpkgnamekernel−{_EXTRA_KERNEL}).txz -> (getpkgnamekernel−{_EXTRA_KERNEL}).pkg ${CORE_PKG_ALL_PATH}/default-config.txz -> ${CORE_PKG_ALL_PATH}/default-config.pkg local _pkg="$(get_pkg_name 2).txz"−>localpkg="(get_pkg_name ${2}).pkg" then everything is working.

Be careful with it cause during the transition from version 2.5x to 2.6.x you will need both file extensions. The ideal is to have both file extensions, at least for the upgrade process from 2.5.x to 2.6.x That's related to the PKG command change on FreeBSD. Hope that helps.

Can you explain in detail about this step, like how do I change it to work for both file extensions? I've been stuck building this for ages now,