On 2025-04-21 11:46, Chris wrote:
On 2025-04-21 10:47, Dag-Erling Smørgrav wrote:
Chris <bsd-li...@bsdforge.com> writes:
Can I safely move my new kernel to say, kernel.new while running my current
kernel as kernel and rebuild the new kernel with the kernconf corrections?

If you're booted into kernel.old you can just build a new kernel and run
`make reinstallkernel` to replace the new (non-working) kernel without
touching kernel.old.
Sorry. But this the first failed kernel in some 40+ years. So I'm now second
guessing every move I make...

So if I break to the boot prompt and choose boot kernel.old
followed by cd /usr/src, make buildkernel KERNCONF=<my-kernel>,
make reinstallkernel KERNCONF=<my-kernel>
boot -s
installworld dance. I'm good to go?
Just an update to indicate I answered myself and performed a
$ mv /boot/kernel.old /boot/kernel (old kernel that worked)
$ cp -rp /boot/kernel /boot/kernel-save (as per your advice)
left broken /boot/krernel.new as is.
rebooted
with revised KERNCONF now in place
$ cd /usr/src
$ make -j4 -DALWAYS_CHECK_MAKE buildkernel KERNCONF=<MYKERNCONF>
$ make -j4 -DALWAYS_CHECK_MAKE installkernel KERNCONF=<MYKERNCONF>
rebooted single-user
perform the installworld dance
reboot
build/install iwlwifi-firmware
reboot
now having an internet connection again
build/install gpu/drm bits and reboot to a fully working system.

Thanks a million to you,Warner and Gary for all the time you gave
me for this. Sorry for being a bit of a PITA. :(

--Chris

Same if you're booted into the new kernel with some sort of workaround
and want to preserve the old kernel.

It is 100% safe to replace or rename the kernel and modules, even the
one you're currently running.  Just be aware that you may have trouble
loading modules afterward.  If for instance you boot into kernel.old and
then rename /boot/kernel.old to /boot/kernel.works as I suggested
earlier, you won't be able to load kernel modules until you update
`kern.bootfile` to point to the new location of the running kernel
(`make installkernel` does this when it renames the running kernel to
kernel.old).

DES

--
sent from hardware written from and running on FreeBSD

Attachment: 0xE512722F.asc
Description: application/pgp-keys

Reply via email to