commit
[crak.git] / src / mk-config
blob3b1c5f8c9b182c616f3476c42664aa07e18c5c15
1 #!/bin/bash
3 UNAME=`uname -r`
5 if [ ! -f "/boot/System.map-$UNAME" ]; then
6 echo "/boot/System.map-$UNAME doesn't exist" 1>&2
7 echo "mk-config failed" 1>&2
8 exit 1
9 fi
11 OFFSET=`grep "\b$1\b" "/boot/System.map-$UNAME" | cut -d' ' -f1`
12 OFFSET=`grep "\b$1\b" "/boot/System.map-$UNAME" | head -n 1 | cut -d' ' -f1`
14 if [ "$OFFSET" = '' ]; then
15 OFFSET="00000000"
18 echo "#define $2 0x$OFFSET"