Hi Mosta,<br><br>Thanks for the prompt reply, I added the same printk message in the other kernel files like here /usr/src/linux-2.6.33.3/init/calibrate.c <br><br> int lps_precision = LPS_PREC;<br> printk("*** Just testing prinkt to work ***\n");<br>
static bool printed;<br><br>and recompiled the kernel and its showing in the dmesg. Is this means kernel logger is fine?<br><br>also can please verify the steps i made to make lsm module just for pirnkt message.<br>
<br>Regards <br><br><div class="gmail_quote">On Fri, May 20, 2011 at 1:56 PM, mosta <span dir="ltr"><<a href="http://mosta.me">mosta.me</a>@<a href="http://googlemail.com">googlemail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
you have to check at what level you're kernel logger is and set it to<br>
the according level.<br>
<br>
<br>
greetings mosta<br>
<div><div></div><div class="h5"><br>
On 05/20/11 06:29, toqeer ali wrote:<br>
> Hi All,<br>
><br>
><br>
> I am writing a skeleton LSM module to only print the message at boot<br>
> time, but I could not see any printk message in the dmesg.<br>
><br>
> Below are steps i did to enable the printk messages in the LSM module.<br>
><br>
> What i did is download linux kernel 2.6.33.3.<br>
><br>
> 1) added the line source security/lsmcustommod/Kconfig in<br>
> linuxsrc/security/Kconfig near ima/Kconfig.<br>
> 2) added "subdir-$(CONFIG_SECURITY_LSMCUSTOMMOD) +=<br>
> lsmcustommod" line at linuxsrc/security/Makefile<br>
> 3) created a directory in linuxsrc/security/lsmcustommod and putted<br>
> three files<br>
><br>
> i) lsmcustommod.c<br>
> ii) Kconfig<br>
> iii) Makefile<br>
><br>
> *Kconfig file contents*<br>
><br>
> config SECURITY_LSMCUSTOMMOD<br>
> bool "LSMCUSTOMMOD Support"<br>
> depends on SECURITY<br>
> select NETWORK_SECMARK<br>
> default n<br>
> help<br>
><br>
> *Makefile Contents*<br>
><br>
> obj-$(CONFIG_SECURITY_LSMCUSTOMMOD) := lsmcustommod.o<br>
><br>
> *lsmcustommod.c* contents<br>
><br>
> static __init lsmcustommod_init(void){<br>
> /* register the hooks */<br>
><br>
> if (register_security(&lsmcustommod_ops))<br>
> panic("lsmcustommod: Unable to register lsmcustommod<br>
> with kernel.\n");<br>
> else<br>
> printk("lsmcustommod: registered with the kernel\n");<br>
><br>
> return 0;<br>
> }<br>
><br>
> static void __exit lsmcustommod_exit (void)<br>
> {<br>
> return;<br>
> }<br>
><br>
><br>
><br>
> module_init (lsmcustommod_init);<br>
> module_exit (lsmcustommod_exit);<br>
><br>
> MODULE_DESCRIPTION("lsmcustommod");<br>
> MODULE_LICENSE("GPL");<br>
> #endif /* CONFIG_SECURITY_LSMCUSTOMMOD */<br>
><br>
><br>
><br>
> After that I also added some return 0 and printk statments in the<br>
> lsmcustommod_ops stucture.<br>
><br>
> lastly disabled all modules in make menuconfig and select LSMCUTOMMOD<br>
> in security sections of the menufile and compile the kernel by the<br>
> following command.<br>
><br>
> make && make modules && make modules_install && make install<br>
> updategrub2<br>
><br>
><br>
> --<br>
> Toqeer Ali Syed<br>
><br>
> Red Hat Certified Engineer<br>
><br>
</div></div>> mob: <a href="tel:%2B60166205504" value="+60166205504">+60166205504</a> <tel:%2B60166205504><br>
> mob: <a href="tel:%2B92%20321%209059916" value="+923219059916">+92 321 9059916</a> <tel:%2B92%20321%209059916><br>
><br>
><br>
> _______________________________________________<br>
> Kernelnewbies mailing list<br>
> <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
> <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br>
</blockquote></div><br><br clear="all"><br>-- <br>Toqeer Ali Syed<br><br>Red Hat Certified Engineer<br><br>mob: +60166205504<br>mob: +92 321 9059916<br>