[lkml]   [2002]   [Feb]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: How to check the kernel compile options ?
    On Feb 14, 2002  08:48 -0800, Randy.Dunlap wrote:
    > gziphdr=`binoffset $1 0x1f 0x8b 0x08 0x0`
    > # increment by 1 since tail offsets are 1-based, not 0-based
    > gziphdr=$((gziphdr + 1))
    > tail -c +$gziphdr $1 | gunzip > $1.tmp
    > strings $1.tmp | grep CONFIG_ > $1.old.config
    > rm $1.tmp

    How about something like the below (avoids writing a multi-MB temp file):

    HDR=`binoffset $1 0x1f 0x8b 0x08 0x0`
    dd if=$1 bs=1 skip=$HDR | zcat | strings /dev/stdin | grep CONFIG_

    Note also that it is enough to store the config options without the
    leading CONFIG_ part, and then use 'grep "[A-Z0-9]*=[ym]$"' to get
    the actual config strings. You can add a final 'sed "s/^/CONFIG_/"'
    step to return it to the original format. So:

    dd if=$1 bs=1 skip=$HDR | zcat | strings /dev/stdin | grep "[A-Z0-9]=[ym]$" \
    | sed "s/^//CONFIG_"

    Cheers, Andreas
    Andreas Dilger

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:24    [W:0.022 / U:98.548 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site