pmaports/main/postmarketos-initramfs
Caleb Connolly 95b22138c4
postmarketos-initramfs: log to kernel ringbuffer (MR 5000)
Rework logging to always log the initramfs output to the kernel
ringbuffer and deprecate PMOS_NO_OUTPUT_REDIRECT in favour of following
the kernel loglevel.

I know it seems silly to use syslogd for this, but it's necessary to
buffer writes to /dev/kmsg per-line if we want to correctly set the log
level, and "tee" does not do this (it will write multiple lines at once,
resulting in "<14>" prints in the ringbuffer). The main advantage to
this is that we won't have kernel logs cut in half by initramfs logs
anymore, everything will be nicely line buffered!

The previous logging solution of multiple "tail" commands would actually
fail to log up to the last few lines before a crash due to how tail
works (it polls the file and buffers lines).

I attempted something like this before, but I stopped after running into
ratelimiting issues. These are now resolved by configuring the
printk_devkmsg sysctl.

Dropping PMOS_NO_OUTPUT_REDIRECT:

The general motivations behind PMOS_NO_OUTPUT_REDIRECT was to avoid
cluttering up the console with initramfs logs when they aren't wanted;
this is now handled instead by the kernels logging facility. We log to
the ringbuffer at LOGLEVEL_INFO, so if "quiet" is specified on the
cmdline (or the loglevel is otherwise set above info) then initramfs
logs will also not be shown.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
2024-06-18 12:35:04 -07:00
..
00-default.modules main/postmarketos-initramfs: add crc32_generic module for F2FS (MR 4973) 2024-04-18 14:44:55 +02:00
00-initramfs-base.dirs main/postmarketos-initramfs: Allow packages to define cleanup hooks (MR 5191) 2024-06-04 18:44:34 +00:00
00-initramfs-base.files main/postmarketos-initramfs: add new deviceinfo path to initramfs (MR 4283) 2023-09-25 09:20:32 +02:00
00-initramfs-extra-base.files main/postmarketos-initramfs: switch_root with /dev (MR 3230) (MR 4204) 2023-09-07 20:33:55 +01:00
APKBUILD postmarketos-initramfs: log to kernel ringbuffer (MR 5000) 2024-06-18 12:35:04 -07:00
init.sh postmarketos-initramfs: log to kernel ringbuffer (MR 5000) 2024-06-18 12:35:04 -07:00
init_functions.sh postmarketos-initramfs: log to kernel ringbuffer (MR 5000) 2024-06-18 12:35:04 -07:00
mdev.conf main/postmarketos-initramfs: use mdev properly (MR 4204) 2023-09-07 20:33:55 +01:00
unudhcpd.conf main/postmarketos-initramfs: support custom IP addresses for USB net (MR 3349) 2023-08-23 13:06:15 -07:00