Discussion:
kernel names
(too old to reply)
blubee blubeeme
2017-12-14 05:47:13 UTC
Permalink
When you boot into FreeBSD and you can select kernels, there's only 2
options:
default and kernel.old

Is there a way to have better output and support multiple kernels without
having to login to the system and running uname -v or something like that?

Would it be possible to add options for more kernels from that boot menu?
Allan Jude
2017-12-14 05:51:54 UTC
Permalink
Post by blubee blubeeme
When you boot into FreeBSD and you can select kernels, there's only 2
default and kernel.old
Is there a way to have better output and support multiple kernels without
having to login to the system and running uname -v or something like that?
Would it be possible to add options for more kernels from that boot menu?
_______________________________________________
https://lists.freebsd.org/mailman/listinfo/freebsd-current
The list is controlled by the /boot/loader.conf variable kernels=
which defaults to "kernel kernel.old"

I have a patch almost ready to land that will search all subdirectories
of /boot for a file named 'kernel' and add the names of those
directories to the list, such that the list will basically be autogenerated.

It currently contains too much copy/pasted code, and I just need to
clean it up a bit: https://reviews.freebsd.org/D11886

It was originally designed as part of my contributions towards packaged
base, where pkg will keep the last N (default to 5 I think) kernel
packages you have installed around, incase an upgrade goes bad.

This feature will work on any filesystem supported by the loader.
--
Allan Jude
blubee blubeeme
2017-12-14 07:15:04 UTC
Permalink
Post by blubee blubeeme
When you boot into FreeBSD and you can select kernels, there's only 2
default and kernel.old
Is there a way to have better output and support multiple kernels without
having to login to the system and running uname -v or something like
that?
Post by blubee blubeeme
Would it be possible to add options for more kernels from that boot menu?
_______________________________________________
https://lists.freebsd.org/mailman/listinfo/freebsd-current
freebsd.org"
The list is controlled by the /boot/loader.conf variable kernels=
which defaults to "kernel kernel.old"
I have a patch almost ready to land that will search all subdirectories
of /boot for a file named 'kernel' and add the names of those
directories to the list, such that the list will basically be
autogenerated.
It currently contains too much copy/pasted code, and I just need to
clean it up a bit: https://reviews.freebsd.org/D11886
It was originally designed as part of my contributions towards packaged
base, where pkg will keep the last N (default to 5 I think) kernel
packages you have installed around, incase an upgrade goes bad.
This feature will work on any filesystem supported by the loader.
--
Allan Jude
_______________________________________________
https://lists.freebsd.org/mailman/listinfo/freebsd-current
Allen, thanks for the great work. I'll test it out but I can't wait to have
it merged in.
Shane Ambler
2017-12-15 09:59:07 UTC
Permalink
Post by Allan Jude
Post by blubee blubeeme
When you boot into FreeBSD and you can select kernels, there's only 2
default and kernel.old
Is there a way to have better output and support multiple kernels without
having to login to the system and running uname -v or something like that?
Would it be possible to add options for more kernels from that boot menu?
The list is controlled by the /boot/loader.conf variable kernels=
which defaults to "kernel kernel.old"
I have a patch almost ready to land that will search all subdirectories
of /boot for a file named 'kernel' and add the names of those
directories to the list, such that the list will basically be autogenerated.
It currently contains too much copy/pasted code, and I just need to
clean it up a bit: https://reviews.freebsd.org/D11886
It was originally designed as part of my contributions towards packaged
base, where pkg will keep the last N (default to 5 I think) kernel
packages you have installed around, incase an upgrade goes bad.
This feature will work on any filesystem supported by the loader.
Thanks Allen, that's much better than manually setting the list.

A nice addition to this would be having make installkernel automatically
install multiple kernels.

Currently we can add KERNCONF to make.conf and have multiple kernels
build with one buildkernel command. Then we have to manually run
installkernel for each kernel by setting KERNCONF and KODIR for each
one. Maybe the kernel config file can have a kodir variable that
specifies the kernel name that it should be installed into, unless
overridden by KODIR in the installkernel command.

Another option might be to have KODIR in make.conf, where each item
provides a KODIR for each KERNCONF

Normally I build and install two kernels with each system update, one is
GENERIC, the other is a debug kernel with things like WITNESS and
INVARIANTS enabled.
--
FreeBSD - the place to B...Software Developing

Shane Ambler
Chris H
2017-12-14 07:58:53 UTC
Permalink
Post by Allan Jude
Post by blubee blubeeme
When you boot into FreeBSD and you can select kernels, there's only 2
default and kernel.old
Is there a way to have better output and support multiple kernels without
having to login to the system and running uname -v or something like that?
Would it be possible to add options for more kernels from that boot menu?
_______________________________________________
https://lists.freebsd.org/mailman/listinfo/freebsd-current
The list is controlled by the /boot/loader.conf variable kernels=
which defaults to "kernel kernel.old"
I have a patch almost ready to land that will search all subdirectories
of /boot for a file named 'kernel' and add the names of those
directories to the list, such that the list will basically be autogenerated.
It currently contains too much copy/pasted code, and I just need to
clean it up a bit: https://reviews.freebsd.org/D11886
It was originally designed as part of my contributions towards packaged
base, where pkg will keep the last N (default to 5 I think) kernel
packages you have installed around, incase an upgrade goes bad.
This feature will work on any filesystem supported by the loader.
Outstanding, Allan! Well done. I eagerly await it's arrival.
I've often thought about whipping something like this up. But something
else always seemed to get in the way.

Thanks, Allan.

--Chris
Post by Allan Jude
--
Allan Jude
David Wolfskill
2017-12-14 17:46:37 UTC
Permalink
Post by blubee blubeeme
When you boot into FreeBSD and you can select kernels, there's only 2
default and kernel.old
Is there a way to have better output and support multiple kernels without
having to login to the system and running uname -v or something like that?
Would it be possible to add options for more kernels from that boot menu?
Unless I've been fooling myself, it's possible now. Just stop the boot
loader during loading by hitting the spacebar and type
boot kernelname
at the loader prompt
....
As Allan Jude pointed out earlier in the thread, it's a lot easier than
that: just set the "kernels" variable in /boot/loader.conf.

For example, I update, build, boot, and run FreeBSD on my laptop daily.
That process installs /boot/kernel (after moving the previous one to
/boot/kernel.old). I like to keep a "recent known-working" kernel
around that isn't automagically replaced, so:

g1-252(11.1-S)[1] grep kernel /boot/loader.conf
# Experiment to see if kernel.save can be an option from the boot menu
kernels="kernel kernel.old kernel.save"
g1-252(11.1-S)[2]

(And yes, it does work -- verified empirically.)

Peace,
david
--
David H. Wolfskill ***@catwhisker.org
The US "cannot afford" Trump as President or Roy Moore in the Senate.

See http://www.catwhisker.org/~david/publickey.gpg for my public key.
Rodney W. Grimes
2017-12-14 18:19:09 UTC
Permalink
Post by David Wolfskill
Post by blubee blubeeme
When you boot into FreeBSD and you can select kernels, there's only 2
default and kernel.old
Is there a way to have better output and support multiple kernels without
having to login to the system and running uname -v or something like that?
Would it be possible to add options for more kernels from that boot menu?
Unless I've been fooling myself, it's possible now. Just stop the boot
loader during loading by hitting the spacebar and type
boot kernelname
at the loader prompt
....
As Allan Jude pointed out earlier in the thread, it's a lot easier than
that: just set the "kernels" variable in /boot/loader.conf.
For example, I update, build, boot, and run FreeBSD on my laptop daily.
That process installs /boot/kernel (after moving the previous one to
/boot/kernel.old). I like to keep a "recent known-working" kernel
g1-252(11.1-S)[1] grep kernel /boot/loader.conf
# Experiment to see if kernel.save can be an option from the boot menu
kernels="kernel kernel.old kernel.save"
g1-252(11.1-S)[2]
(And yes, it does work -- verified empirically.)
And you can also do an
ls /boot
while at a loader prompt to see all the kernels you have
laying around you might want to choose from.
--
Rod Grimes ***@freebsd.org
Loading...