Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Aug 2023 08:05:10 -0700
From:      Kevin Oberman <rkoberman@gmail.com>
To:        Matthias Apitz <guru@unixarea.de>, freebsd-current@freebsd.org
Subject:   Re: Has the update procedure changed?
Message-ID:  <CAN6yY1tiq4XQT_apnLo_aDgoMPEZ%2BZ4PfB8uqfMw3PeJbMGMqw@mail.gmail.com>
In-Reply-To: <ZM80rBrlSf8NVNr5@c720-r368166>
References:  <ZM80rBrlSf8NVNr5@c720-r368166>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On Sat, Aug 5, 2023 at 10:51 PM Matthias Apitz <guru@unixarea.de> wrote:

> In the past I was used to use the following procedure to install a new
> kernel and world:
>
>     # cd /usr/src
>     # make installkernel
>     # shutdown -r now
>
>     boot -s from the loader prompt
>
>     # adjkerntz -i
>     # mount -a -t ufs
>     # mergemaster -p
>     # cd /usr/src
>     # make installworld
>     # mergemaster
>     # yes | make delete-old
>     # yes | make delete-old-libs
>
>     # reboot
>
> Now the handbook
> https://docs.freebsd.org/en/books/handbook/cutting-edge/#makeworld
> says only:
>
>     # cd /usr/src
>     # make installkernel
>     # shutdown -r now
>     # cd /usr/src
>     # make installworld
>     # shutdown -r now
>
> Has this changed in past two years?
>
> Thanks
>
>         matthias
> --
> Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/
> +49-176-38902045
> Public GnuPG key: http://www.unixarea.de/key.pub
>

Wow! Several obvious reasons that this looks just wrong. (Then again, so is
yours in one case.)
1. "mergemaster -p" MUST be run before you build the kernel. (Actually, hte
man page says it should be run BEFORE buildworld and that is what I've
always done although I have never seen a case where it was needed until
buildkernel.
2. While mergemaster(8) is still in the system, you really should be using
etcupdate(8). You also need to understand how a three-way merge is done and
that you  often need to edit the merged file when first running it.  It's
pretty simple to run and rarely is needed after the first run, but it is
critical to do this for /etc files that you have modified. It's generally
just picking which of the two (original/yours) you want in the final file.
The big win with etcupdate(8) is that it only needs to be run once for
modified files in almost all cases.
3. Where is "make check-old" and the other tests to get rid of old files.
Leaving these around can lead to serious issues.
4. If you don't do adjkerntz -i, you might find files installed in the
future which can get REALLY  confusing!

Historically, the final source of truth for all of this is
/usr/src/UPDATING. It has been updated for etcupdate(8) and is handled by
imp@, so I tend to believe it is correct.

OK. Everyone who knows better, please explain why. I didn't mention "fsck
-p" but I'm really paranoid and it really, really should not be needed
unless something goes wrong in the shutdown after installing the new kernel.
-- 
Kevin Oberman, Part time kid herder and retired Network Engineer
E-mail: rkoberman@gmail.com
PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683

[-- Attachment #2 --]
<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small">On Sat, Aug 5, 2023 at 10:51 PM Matthias Apitz &lt;<a href="mailto:guru@unixarea.de">guru@unixarea.de</a>&gt; wrote:</div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">In the past I was used to use the following procedure to install a new<br>
kernel and world:<br>
<br>
    # cd /usr/src<br>
    # make installkernel<br>
    # shutdown -r now<br>
<br>
    boot -s from the loader prompt<br>
<br>
    # adjkerntz -i<br>
    # mount -a -t ufs<br>
    # mergemaster -p<br>
    # cd /usr/src<br>
    # make installworld<br>
    # mergemaster<br>
    # yes | make delete-old<br>
    # yes | make delete-old-libs<br>
<br>
    # reboot<br>
<br>
Now the handbook <a href="https://docs.freebsd.org/en/books/handbook/cutting-edge/#makeworld" rel="noreferrer" target="_blank">https://docs.freebsd.org/en/books/handbook/cutting-edge/#makeworld</a><br>;
says only:<br>
<br>
    # cd /usr/src<br>
    # make installkernel<br>
    # shutdown -r now<br>
    # cd /usr/src<br>
    # make installworld<br>
    # shutdown -r now<br>
<br>
Has this changed in past two years?<br>
<br>
Thanks<br>
<br>
        matthias<br>
-- <br>
Matthias Apitz, ✉ <a href="mailto:guru@unixarea.de" target="_blank">guru@unixarea.de</a>, <a href="http://www.unixarea.de/" rel="noreferrer" target="_blank">http://www.unixarea.de/</a>; +49-176-38902045<br>
Public GnuPG key: <a href="http://www.unixarea.de/key.pub" rel="noreferrer" target="_blank">http://www.unixarea.de/key.pub</a><br></blockquote><div> </div></div><div style="font-family:tahoma,sans-serif;font-size:small" class="gmail_default">Wow! Several obvious reasons that this looks just wrong. (Then again, so is yours in one case.)</div><div style="font-family:tahoma,sans-serif;font-size:small" class="gmail_default">1. &quot;mergemaster -p&quot; MUST be run before you build the kernel. (Actually, hte man page says it should be run BEFORE buildworld and that is what I&#39;ve always done although I have never seen a case where it was needed until buildkernel.</div><div style="font-family:tahoma,sans-serif;font-size:small" class="gmail_default">2. While mergemaster(8) is still in the system, you really should be using etcupdate(8). You also need to understand how a three-way merge is done and that you  often need to edit the merged file when first running it.  It&#39;s pretty simple to run and rarely is needed after the first run, but it is critical to do this for /etc files that you have modified. It&#39;s generally just picking which of the two (original/yours) you want in the final file. The big win with etcupdate(8) is that it only needs to be run once for modified files in almost all cases.</div><div style="font-family:tahoma,sans-serif;font-size:small" class="gmail_default">3. Where is &quot;make check-old&quot; and the other tests to get rid of old files. Leaving these around can lead to serious issues.</div><div style="font-family:tahoma,sans-serif;font-size:small" class="gmail_default">4. If you don&#39;t do adjkerntz -i, you might find files installed in the future which can get REALLY  confusing! <br></div><div style="font-family:tahoma,sans-serif;font-size:small" class="gmail_default"><br></div><div style="font-family:tahoma,sans-serif;font-size:small" class="gmail_default">Historically, the final source of truth for all of this is /usr/src/UPDATING. It has been updated for etcupdate(8) and is handled by imp@, so I tend to believe it is correct.</div><div style="font-family:tahoma,sans-serif;font-size:small" class="gmail_default"><br></div><div style="font-family:tahoma,sans-serif;font-size:small" class="gmail_default">OK. Everyone who knows better, please explain why. I didn&#39;t mention &quot;fsck -p&quot; but I&#39;m really paranoid and it really, really should not be needed unless something goes wrong in the shutdown after installing the new kernel.<br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Kevin Oberman, Part time kid herder and retired Network Engineer<br>E-mail: <a href="mailto:rkoberman@gmail.com" target="_blank">rkoberman@gmail.com</a><br></div><div>PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683</div></div></div></div></div></div></div></div></div>

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAN6yY1tiq4XQT_apnLo_aDgoMPEZ%2BZ4PfB8uqfMw3PeJbMGMqw>