LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 05:45 AM   #1
niiiro
Member
 
Registered: Feb 2010
Posts: 75

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, 07: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, 09:26 AM   #3
niiiro
Member
 
Registered: Feb 2010
Posts: 75

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, 10: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, 02:37 AM   #5
niiiro
Member
 
Registered: Feb 2010
Posts: 75

Original Poster
Rep: Reputation: 1
Thanks Oliv'.

In the meanwhile, has anyone else got a solution maybe...?
 
Old 12-29-2010, 12: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, 03:59 PM   #7
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,145
Blog Entries: 6

Rep: Reputation: 1832Reputation: 1832Reputation: 1832Reputation: 1832Reputation: 1832Reputation: 1832Reputation: 1832Reputation: 1832Reputation: 1832Reputation: 1832Reputation: 1832
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 04:03 PM.
 
  


Reply



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 01:54 AM
message in Terminal after redirecting output and build completes? T. Jump Linux - Newbie 4 10-10-2010 10:57 AM
A little help with redirecting output tybalt Linux - Newbie 1 08-04-2007 10:08 PM
redirecting output using > cmk77 Slackware 8 11-10-2006 02:08 AM
redirecting error message ..? TAAN Linux - Networking 1 08-30-2005 03:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:15 AM.

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
Open Source Consulting | Domain Registration