LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-28-2010, 06:45 AM   #1
niiiro
Member
 
Registered: Feb 2010
Posts: 65

Rep: Reputation: 1
Redirecting output message while inserting a new device


Hey Guys,

When inserting/removing a usb device to a board based on linux system, an output is given:

Code:
# mmc1: card 0001 removed

mmc1: new SD card at address 0001
mmcblk1: mmc1:0001 128MB 110 MiB
 mmcblk1:<7>mmc1: starting CMD18 arg 00000000 flags 000000b5
 p1
how can I redirect its default output so it will write it to a file instead?


thanks in advanced.

Nir.
 
Old 12-28-2010, 08:34 AM   #2
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
Hello,

I think taht adding "console=null" on your kernel command line should do the trick.

Kind regards,

Oliv'
 
Old 12-28-2010, 10:26 AM   #3
niiiro
Member
 
Registered: Feb 2010
Posts: 65

Original Poster
Rep: Reputation: 1
Hey Oliv' and thanks for your reply.

unfortunately that didn't do the trick. I even tried directing him to a file by doing:

"console=~\file.txt" but no good..
 
Old 12-28-2010, 11:58 AM   #4
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
ah yes, my method may only work to disable kernel log through serial console. In fact console argument on kernel command line requires a /dev file. So redirecting to the file is not so easy.... I will think a bit more about your problems and tell you if I find a solution.

Kind regards
 
Old 12-29-2010, 03:37 AM   #5
niiiro
Member
 
Registered: Feb 2010
Posts: 65

Original Poster
Rep: Reputation: 1
Thanks Oliv'.

In the meanwhile, has anyone else got a solution maybe...?
 
Old 12-29-2010, 01:40 PM   #6
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
Well I see 2 potentials solutions, but I am not sure it will work as I have not tested them.
1) configure syslogd to handle that... and maybe even install it as it seems you use an embedded device, so I am nopt sure that's already installed.
2) these messages are due to printk() function in the kernel. So you may hack some kernel parts to directly log these message into a file. But it implies that you have some basic kernel coding knowledge.

Regards,

Oliv'
 
Old 12-29-2010, 04:59 PM   #7
teckk
Senior Member
 
Registered: Oct 2004
Distribution: FreeBSD Arch
Posts: 1,825

Rep: Reputation: 221Reputation: 221Reputation: 221
Isn't that info being appended to dmesg whenever you plugin or remove a usb device?

For a BSD box
Code:
$ dmesg | tail
da0: 40.000MB/s transfers
da0: Attempt to query device size failed: NOT READY, Medium not present
ulpt0: at uhub3 port 2 (addr 2) disconnected
ulpt0: detached
umass0: at uhub3 port 2 (addr 2) disconnected
(da0:umass-sim0:0:0:0): lost device
(da0:umass-sim0:0:0:0): removing device entry
umass0: detached
Where does dmesg keep it's log file on that Linux box?

/var/log/messages
Code:
Dec 29 11:06:05 hostname kernel: ulpt0: at uhub3 port 2 (addr 2) disconnected
Dec 29 11:06:05 hostname kernel: ulpt0: detached
Dec 29 11:06:05 hostname kernel: umass0: at uhub3 port 2 (addr 2) disconnected
Dec 29 11:06:05 hostname kernel: (da0:umass-sim0:0:0:0): lost device
Dec 29 11:06:05 hostname kernel: (da0:umass-sim0:0:0:0): removing device entry
Dec 29 11:06:05 hostname kernel: umass0: detached

Last edited by teckk; 12-29-2010 at 05:03 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
awk: how can I print out a message to the screen when redirecting the output to file. quanba Programming 8 07-13-2015 02:54 AM
message in Terminal after redirecting output and build completes? T. Jump Linux - Newbie 4 10-10-2010 11:57 AM
A little help with redirecting output tybalt Linux - Newbie 1 08-04-2007 11:08 PM
redirecting output using > cmk77 Slackware 8 11-10-2006 03:08 AM
redirecting error message ..? TAAN Linux - Networking 1 08-30-2005 04:28 PM


All times are GMT -5. The time now is 01:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration