Warning: there may be occasional oddness due to css and blog edits. **remodel of posts done. Overhaul of pages (distilled) in progress 3/9

Updating Kernel & World

Obtain or update source

1. Obtain the initial source

git clone -b master --single-branch --depth 1  git://github.com/freebsd/freebsd.git /usr/src
Github changed security in September 2021 
git clone -b main --single-branch --depth 1 https://github.com/freebsd/freebsd.git /usr/src
     or
git clone -b 15/stable --single-branch --depth 1 https://github.com/freebsd/freebsd.git /usr/src

2. prepare now for future updates

git config pull.rebase true

*. Update after the source tree is setup:

cd /usr/src
git pull

The build process

1. Start fresh

rm -rf /usr/obj/*
make cleanworld
make clean

2. Build world

make -j `sysctl -n hw.ncpu` buildworld

3. Build and install kernel

make -j `sysctl -n hw.ncpu` kernel KERNCONF=GENERIC KERNCONFDIR=/usr/src/sys/amd64/conf

4. Go to single user

reboot
Watch for the FreeBSD startup menu, press space as needed to pause it -- choose 'singleuser' by hitting '2'.  It is NOT recommended to use another shell, at the prompt below, tap the return or enter key.
Enter full pathname of shell or RETURN for /bin/sh

5. Regain access to /usr/src

mount all items in /etc/fstab as read-write:
mount -u /
mount all ZFS datasets
zfs mount -a
cd /usr/src

6. Prepare the system files then install world

Mergemaster removed Nov 20, 2023
mergemaster -p
etcupdate -p
make -j `sysctl -n hw.ncpu` installworld

*. Fix date/time as needed:

Should you see the message below, which can appear,
At installworld Make: "/usr/src/Makefile" line 360: Check your date/time
it is a simple fix, type the following command to continue:
adjkerntz -i

7. Interactively modify configuration files to better fit the new install

mergemaster -iUF
etcupdate -n ; etcupdate

8. Cleanup possibly conflicting remnant files

yes|make delete-old
yes|make delete-old-libs

9. Reboot into your new updated kernel and world.

No comments:

Frequently viewed this week