I have been trying to capture console logs from the init script.
When the ramfs is mounted, i check if usb is connected , if conncted, i mount it and redirected the console logs like so:
cat & /dev/ttyS1 >> /mnt/logs.txt
I'm getting
/bin/sh : /dev/ttyS1 :permission denied
I tried changing the permission to 777, but to no avail.
I also tried sudo, and found out that our ramfs does not support this command.
The console logs are still being printed on the monitor.
setterm is packaged with util-linux for RHEL, in case you need to track down the source.
I'm not sure this will meet your needs in the long-term, since that command will do only 1-time snapshots. So in the long-term, in your rc/init files, replace "echo" with "logger -s". You could implement this with a function that's included by every rc file: