On Saturday 04 March 2006 10:07, Masood Ahmed <[EMAIL PROTECTED]> wrote 
about 'Re: [gentoo-user]  Re: modules built post kernel install (on the 
fly)':
> Harry Putnam wrote:
> > Masood Ahmed <[EMAIL PROTECTED]> writes:
> > Thanks Masood, for the pointers.. I have a question about your sig.
> > Do you get that info from a single command or several?
>
> The answer is several,
> for kernel version i did 'uname -r'
> for gcc-version i did 'gcc -v'
> for processor i did 'cat /proc/cpuinfo'
> for ram 'free -t'
> for CFLAGS 'cat /etc/make.conf | grep CFLAGS'
> for CXXFLAGS 'cat /etc/make.conf | grep CXXFLAGS'
>
> I think this is not what you expected. I dont have enough sed and grep
> knowledge to automate the process, but i'm learning it. I'd like to
> write a script that would output only the required contents from the
> output of the commands above.
>
> Got any idea's anyone?

Starting from what you gave me, here's what I have:
echo -n "Linux Kernel  : "; uname -r; echo -n "GCC version   : "; gcc -v 
2>&1 | tail -n 1 | cut -d' ' -f3-; PROCS="$(grep "model 
name" /proc/cpuinfo)"; PROC_CNT=$(echo "$PROCS" | wc -l); echo -n 
"Processor     : "; if [ "$PROC_CNT" -gt 1 ]; then echo -n "${PROC_CNT}x 
"; fi; echo "$PROCS" | head -n 1 | sed -e 's/^model name[[:space:]]*: //'; 
echo -n "CFLAGS USED   : "; grep CFLAGS /etc/make.conf | grep -v 
'^[[:space:]]*#' | grep -v CXXFLAGS | sed -e 's/CFLAGS="//' -e 
's/"[[:space:]]*$//'; echo -n "CXXFLAGS USED : "; grep 
CXXFLAGS /etc/make.conf | sed -e 's/CXXFLAGS="//' -e 's/"[[:space:]]*$//'

Which, on my system, gives:
Linux Kernel  : 2.6.16-rc4-mm2
GCC version   : 3.4.5 (Gentoo 3.4.5, ssp-3.4.5-1.0, pie-8.7.9)
Processor     : 4x Dual Core AMD Opteron(tm) Processor 275
CFLAGS USED   : -O2 -pipe
CXXFLAGS USED : ${CFLAGS}

I highly doubt you got your ram line from 'free -t', on my system it gives:
             total       used       free     shared    buffers     cached
Mem:       4022704    3934496      88208          0     255028    2858408
-/+ buffers/cache:     821060    3201644
Swap:      7992312       1128    7991184
Total:    12015016    3935624    8079392

Which doesn't tell me it'd DDR or SDRAM, nor if I'm using one stick or 
many.

Modifying my script to break long CFLAGS and also accent CFLAGS that span 
multiple physical lines in make.conf is left as an excersize for the 
reader.

-- 
"If there's one thing we've established over the years,
it's that the vast majority of our users don't have the slightest
clue what's best for them in terms of package stability."
-- Gentoo Developer Ciaran McCreesh
-- 
gentoo-user@gentoo.org mailing list

Reply via email to