# Keeping my system up to date - after installing custom kernel and programs from ports.



## HexagonWin (Nov 19, 2021)

Hello!
First, I'm very new to FreeBSD, so sorry if I am misunderstanding anything.
I recently installed FreeBSD 13.0 release onto my old MacBook, MacBook4,1. (uname -a : 
FreeBSD freecrad 13.0-RELEASE FreeBSD 13.0-RELEASE #0: Wed Nov 17 09:41:22 KST 2021     root@freecrad:/usr/obj/usr/src/amd64.amd64/sys/WIFI  amd64)

I built and installed a custom kernel since my wlan card is a bcm43xx. The "custom kernel" is just copied generic config and enabled bwn phy? configurations. I saw infos from the wiki's MacMini document and such, the bwn driver, I installed it, and also some programs I don't remember I had may installed from ports instead of the pkg tool.
What I am curious now is, how can I keep my system up to date? Do I need to rebuild the kernel every releases? And what about the program I built from ports? Is there any "updater" program in FreeBSD that auto detects which programs are built from source and builds them again or something...?

Thanks!
Best Regards, HexagonWin.


----------



## Alain De Vos (Nov 19, 2021)

There are two ways.
When you don't compile from source you can update using "freebsd-update" & "pkg update" & "pkg upgrade".
[Have also a look at /etc/freebsd-update.conf]

When you compile from source it's advised to update from source by updating the sources using "git pull" & then install.
For the compilation of the userland i use "poudriere" but there are other tools.
For the base you can do a "git pull" to update the sources and a "make buildworld" , "make installworld".
For the kernel you can do a "git pull" to update the sources and a "make buildkernel" , "make installkernel".


----------



## a6h (Nov 19, 2021)

You have to re-build base -- both kernel and userland.
For minor version update, there's no need to re-build ports.
For major version update, you have to re-build all ports -- due to the possible ABI incompatibility.


----------



## HexagonWin (Nov 20, 2021)

Alain De Vos said:


> There are two ways.
> When you don't compile from source you can update using "freebsd-update" & "pkg update" & "pkg upgrade".
> [Have also a look at /etc/freebsd-update.conf]
> 
> ...


Then, as some of my things are directly installed from binary and some are from sources, can I use those freebsd-update, pkg update/upgrade tools to upgrade binaries and use those git and make commands for the source parts?
I actually am not able to understand the meaning of userland and base, afaik isn't the base not touched? I installed with the installer usbstick image.

Thanks. One more question, for the kernel, as I made a new config file based on the default one, when I keep pulling the upstream branch to my local computer, I believe that if a change gets made to the generic config my wifi config wouldn't change and would cause issues. Do I have to copy the generic and add the broadcom lines every time I do the pull?

Thanks a lot! I'm sorry if there are newbie question.
Best Regards, HexagonWin.


----------



## grahamperrin@ (Nov 20, 2021)

For part of what's required, see the _COMMON ITEMS_ section of your /usr/src/UPDATING

<https://cgit.freebsd.org/src/tree/UPDATING?id=e641c29a006ae9f528f196386052355b42a53d75#n2455> is a subsection as it appeared a few days ago.

If you use a desktop environment, it's sane to log out before performing the installations.

FreeBSD bug 209744 – Move installation instructions from UPDATING to new file


----------



## Tieks (Nov 20, 2021)

HexagonWin said:


> the meaning of userland and base


Base means kernel, kerneldrivers and related files, mostly installed in /boot. Userland is the collection of FreeBSD-supplied software tools like grep, sed and awk. Software in ports and packages are supplied by other parties.


HexagonWin said:


> Do I have to copy the generic and add the broadcom lines every time I do the pull?


If the GENERIC file changes you must check if your own config file needs that update too. That's why I keep a copy of both files outside /usr/src. GENERIC doesn´t change very often, though.


----------



## grahamperrin@ (Nov 20, 2021)

wblock@ said:


> … "Userland" refers to where code runs, …





SirDice said:


> … Userland only refers to how stuff runs, in kernelmode or userland. So ports can be userland (most ports are in fact).



<https://en.wikipedia.org/wiki/User_space#USERLAND>


----------

