lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 03 May 2010 19:05:23 +0200
From:	Marco Stornelli <marco.stornelli@...il.com>
To:	Samo Pogacnik <samo_pogacnik@....net>
CC:	Alan Cox <alan@...rguk.ukuu.org.uk>,
	linux-embedded <linux-embedded@...r.kernel.org>,
	linux kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] console logging detour via printk

Il 02/05/2010 15:29, Samo Pogacnik ha scritto:
> Dne 02.05.2010 (ned) ob 11:58 +0200 je Marco Stornelli zapisal(a):
>> 01/05/2010 20:48, Samo Pogacnik wrote:
>>
>> Mmm...It's an interesting problem. I see in my distro (openSuse) a
>> script called boot.klog that it seems to perform that (even initrd
>> part). In the file boot.msg I can see the initial prints of the kernel
>> and user space scripts.
>>
> Thanks for the info. 
> Is this boot.klog script from the initrd image or from the real rootfs?
> As you can see, i am still suspicious about the initrd part user console
> messages:)
> 
> Samo
> 
> 

In the initrd there's the script blogd.sh:

if test -z "$fboot" -a -z "$quiet" -a -z "$REDIRECT" ; then
    REDIRECT=$(showconsole 2>/dev/null)
    if test -n "$REDIRECT" ; then
	if test "$devpts" != "yes" ; then
	    mount -t devpts devpts /dev/pts
	    devpts=yes
	fi
	> /dev/shm/initrd.msg
	ln -sf /dev/shm/initrd.msg /var/log/boot.msg
	mkdir -p /var/run
	/sbin/blogd $REDIRECT
    fi
fi

And in the rootfs the boot.klog script:

# Read all kernel messages generated until now and put them in one file.
    test -s /var/log/boot.msg && mv -f /var/log/boot.msg /var/log/boot.omsg
    echo Creating /var/log/boot.msg
    if test -x /sbin/klogd ; then
        # klogd syncs out the file
	/sbin/klogd -s -o -n -f /var/log/boot.msg
	test -s /var/log/boot.msg
	rc_status -v1 -r
    elif test -x /bin/dmesg ; then
	/bin/dmesg > /var/log/boot.msg
	/bin/sync
	test -s /var/log/boot.msg
	rc_status -v1 -r
    fi
    if test -e /dev/shm/initrd.msg ; then
	cat /dev/shm/initrd.msg >> /var/log/boot.msg
	rm -f /dev/shm/initrd.msg
    fi
[ --- cut here --- ]

Regards,

Marco
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ