Do I need to recompile the kernel,
No.
or is there a way I can get the changed value to be persistent across reboot.
Yes.
Use the kernel command line parameter loglevel
:
loglevel= All Kernel Messages with a loglevel smaller than the
console loglevel will be printed to the console. It can
also be changed with klogd or other programs. The
loglevels are defined as follows:
0 (KERN_EMERG) system is unusable
1 (KERN_ALERT) action must be taken immediately
2 (KERN_CRIT) critical conditions
3 (KERN_ERR) error conditions
4 (KERN_WARNING) warning conditions
5 (KERN_NOTICE) normal but significant condition
6 (KERN_INFO) informational
7 (KERN_DEBUG) debug-level messages
The entire list of parameters possible on the kernel command line are in the Linux/Documentation/kernel-parameters.txt
file in the source tree.
Depending on your bootloader (e.g. Grub or U-Boot), you will have to edit text to add this new parameter to the command line. Use cat /proc/cmdline
to view the kernel command line used for the previous boot.
Addendum
To display everything, the number supplied for the loglevel parameter would have be be greater than KERN_DEBUG.
That is, you would have to specify loglevel=8
.
Or simply use the ignore_loglevel
parameter to display all kernel messages.