Updating to 15.0 with source

I am trying to update a box to 15.0 using source. The box has been successfully running 14.3, is fully patched, and has all filesystems zfs, with root having two M.2 memory cards as a mirror. It has rebooted flawlessly time and again.

I went through the usual script for updating by source, with the only anomaly being at etcupdate, which reported a conflict in the sshd configuration. I figured that was normal because off previous patches and I fixed it with 'etcupdate resolve'. Everything went normally - I did the last etcupdate and it appeared normal. Before the final reboot, I did pkg-static -f to update all the packages. Then I rebooted the machine and it won't boot. It appears to go through the normal boot process, but in the end reports:
Code:
/etc/rc: have: not found
/etc/rc: run_rc_scripts: not found
/etc/rc: run_rc_scripts: not found
/etc/rc: have: not found

Then it provides a normal login, which always fails. Does anyone know what is wrong here? Note that
I can boot into single user mode and can run sh /etc/rc, but it gives me the same output as above.

Rick[/I]
 
I can boot into single user mode and can run sh /etc/rc, but it gives me the same output as above.
If you run it as sh -x /etc/rc you might be able to spot where the error happens.

Also, just look through the file, maybe there are still a few "merge" markers left in there. If all else fails, you can copy a /etc/rc from a working 15.0 install and simply replace your broken one.
 
Also note that for a major upgrade, you're supposed to upgrade the kernel, reboot, etcupdate -p, then make installworld, etcupdate -B, reboot, then upgrade packages -- See lines 80-91 in /usr/src/Makefile. I'm not 100% sure this will always work as some time a kernel may end up having userland dependencies but this is what you're supposed to do!

Now if this is the exact method you followed and you still ran into problems, it may be worth filing a bug report.
 
Also note that for a major upgrade, you're supposed to upgrade the kernel, reboot, etcupdate -p, then make installworld, etcupdate -B, reboot, then upgrade packages -- See lines 80-91 in /usr/src/Makefile. I'm not 100% sure this will always work as some time a kernel may end up having userland dependencies but this is what you're supposed to do!

Now if this is the exact method you followed and you still ran into problems, it may be worth filing a bug report.
It is essentially what I followed,except that I updated the packages right after the etcupdate -B and not after the final reboot. Don't know if that matters.
 
Neither are present in /etc/rc.subr.
So you found the problem, or at least one problem. Your /etc/rc.subr is invalid. Note that these functions are also defined in 14.x RELEASE.

In a 15.0-RELEASE-p6, /etc/rc.subr:
Code:
# line 193
have()
{
       type "$1" > /dev/null 2>&1
}

# ...

# line 1884
run_rc_scripts()
{
    local _arg=${_boot}
    local _rc_elem
    local _rc_breaks=

    while :; do
        case "$1" in
        --arg)
                        _arg="$2"
                        shift 2
                        ;;
        --break)
                        _rc_breaks="$_rc_breaks $2"
                        shift 2
                        ;;
        *)
                        break
                        ;;
        esac
    done
    for _rc_elem in "$@"; do
        : _rc_elem=$_rc_elem
        case " $_rc_elem_done " in
        *" $_rc_elem "*)
                        continue
                        ;;
        esac
        run_rc_script ${_rc_elem} ${_arg}
        _rc_elem_done="$_rc_elem_done $_rc_elem"
        case " $_rc_breaks " in
        *" ${_rc_elem##*/} "*)
                        break
                        ;;
        esac
    done
}
 
So you found the problem, or at least one problem. Your /etc/rc.subr is invalid. Note that these functions are also defined in 14.x RELEASE.
Well, here is the scary part. I booted the machine single user and made the root writable. I then copied the source code versions of rc and rc.subr to a freebsd memstick, inserted the memstick into the single user machine that wouldn't boot, and did a direct copy of rc and rc.subr to the /etc directory of the non-booting machine. Then I tried to reboot and it booted fine. I haven't checked all the packages, but mysql (8.4) seemed fine, and ssh was also. Any ideas as to why this happened? I'm a bit reluctant to do my other machines until the problem is understood.
 
What I can think of is that your /etc/rc.subr of 14.3 was somehow edited (or erroneously fixed mis-merges) that causes merge conflicts on upgrading to 15.0 and merge markers are remaining.
 
Well, before to upgrade another machine, check the content of these files to see if they match the standard ones of 14.3-RELEASE. And be careful when merge conflicts come. Before to reboot, check anew these files. Look for remaining merge markers, it's often the culprit.
 
Well, before to upgrade another machine, check the content of these files to see if they match the standard ones of 14.3-RELEASE. And be careful when merge conflicts come. Before to reboot, check anew these files. Look for remaining merge markers, it's often the culprit.
Thanks, good advice. On my nightly email, I received a notice to upgrade one of my k-mods (the re 2.5 gig driver). After investigating, and looking at /etc/pkg/FreeBSD.conf, I was able to do that. Moreover,, in reading a bunch of posts to this forum, I find that I do not understand the role of /usr/local/etc/pkg/repos/FreeBSD.conf? Could someone explain that to me? (Still trying to understand everything.) Thanks.
 
Warning with all the third-party drivers when you upgrade. Most of them won't work or worse, the kernel may panic. Disable all of them before to reboot for the kernel change. Reboot, install the new userland and upgrade them. Then, re-enable them for startup. In your case, I think, you must reboot once more to reload the kernel modules.

As for your question, see here: pkg-repositories(8) in the paragraph FILES.
For a specific repositories file to be take into account, its name needs to end with .conf.

Exemple of use of specific repos are:
- You want to go the latest repos.
- You have enabled the pkgbase system.
- You have a local repo.

Never modify /etc/pkg/FreeBSD.conf.
 
I started the install on a second machine, but it failed on 'make -j4 buildworld'. A few details: I have a separate machine which holds the source and exports the src via NFS. On the machine holding the src, I cloned the src with git and checked out relang/15.0. Then did a 'git pull'. I mounted /usr/src on on the updating machine and started 'make -j4 buildworld'. This ran for a long time but eventually died with thhe following error:

cc: error: no such file or directory: '/usr/src/lib/libc/sys/fstat.c'

Comments?
 
I started the install on a second machine, but it failed on 'make -j4 buildworld'. A few details: I have a separate machine which holds the source and exports the src via NFS. On the machine holding the src, I cloned the src with git and checked out relang/15.0. Then did a 'git pull'. I mounted /usr/src on on the updating machine and started 'make -j4 buildworld'. This ran for a long time but eventually died with thhe following error:

cc: error: no such file or directory: '/usr/src/lib/libc/sys/fstat.c'

Comments?
A further update: I restarted the make and it completed with:

--------------------------------------------------------------
>>> World build completed on Thu Apr 23 11:55:21 EDT 2026
>>> World built in 711 seconds, ncpu: 12, make -j4
--------------------------------------------------------------
 
A further update: I restarted the make and it completed with:

--------------------------------------------------------------
>>> World build completed on Thu Apr 23 11:55:21 EDT 2026
>>> World built in 711 seconds, ncpu: 12, make -j4
--------------------------------------------------------------
I had. forgotten that this stoppage also occurred on the first machine and I had simply gone on anyway.
 
I had. forgotten that this stoppage also occurred on the first machine and I had simply gone on anyway.
For upgrating the second machine, I had the src directory mounted read only. I switched the mount to rw and it completed 'make -j4 buildworld' without stopping. However, the file /etc/rc.subr exhibited the same problem as the first machine. I copied it over before rebooting, and everything seemed to boot fine.
 
For upgrating the second machine, I had the src directory mounted read only. I switched the mount to rw and it completed 'make -j4 buildworld' without stopping. However, the file /etc/rc.subr exhibited the same problem as the first machine. I copied it over before rebooting, and everything seemed to boot fine.
Had the file before upgrade the functions have() and run_rc_script()? I guess yes.
It's a strange story, why etcupdate put a wrong file here?

May I ask why you use the source for the update/upgrade and not freebsd-update (or pkgbase) with a standard kernel and userland?
 
Had the file before upgrade the functions have() and run_rc_script()? I guess yes.
It's a strange story, why etcupdate put a wrong file here?
I can check this when I do the next machine.
May I ask why you use the source for the update/upgrade and not freebsd-update (or pkgbase) with a standard kernel and userland?
When I upgraded to 14.1, I decided to use source, just to learn more about the process. This is my first attempt at a major upgrade with source, however.

To summarize, building from source for 15.0 has two problems:
1) If /usr/src is mounted from afar, it must be mounted rw. This surprised me - I thought nothing should write to /usr/src.
2) /etc/rc.subr seems broken after 'etcupdate -B'.
 
Back
Top