File: build_config

package info (click to toggle)
device3dfx 2007.02.06-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 128 kB
  • ctags: 131
  • sloc: ansic: 735; makefile: 227; sh: 74
file content (80 lines) | stat: -rw-r--r-- 1,456 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/sh

print_var()
{
  eval echo "$1 = \$$1"
}

die()
{
  echo "$*" >&2
  exit 1
}

getkpkgvar()
{
  awk -F " *:= *" "\$1 == \"$1\" { print \$2 }" /etc/kernel-pkg.conf
}

getlinuxversion()
{
  sed -ne 's/.*UTS_RELEASE.*"\(.*\)"/\1/p' < $KSRC/include/linux/version.h
}

# Generating build configuation

if [ -f /etc/kernel-pkg.conf ]; then
  [ -n "$KMAINT" ] || KMAINT=`getkpkgvar maintainer`
  [ -n "$KEMAIL" ] || KEMAIL=`getkpkgvar email`
  [ -n "$KDREV" ] || KDREV=`getkpkgvar debian`
  [ -n "$ROOTCMD" ] || ROOTCMD=`getkpkgvar root_cmd`
fi

if [ -z "$KMAINT" ]; then
  # Inventing maintainer name
  KMAINT="Kernel maintainer"
fi
print_var KMAINT

if [ -z "$KEMAIL" ]; then
  # Inventing maintainer email
  if [ -f "/etc/mailname" ]; then
    domain=`cat /etc/mailname`
  else
    domain=`hostname --fqdn`
  fi
  KEMAIL="${LOGNAME-${USER-root}}"
fi
print_var KEMAIL

if [ -z "$KDREV" ]; then
  # Inventing debian rev
  KDREV="custom"
fi
print_var KDREV

if [ -z "$KSRC" ]; then
  # Looking for kernel source
  if [ -d "/usr/src/linux" ]; then
    KSRC="/usr/src/linux"
  elif [ -d "$PWD/linux" ]; then
    KSRC="$PWD/linux"
  else
    die "# Unable to find kernel source"
  fi
fi
print_var KSRC

if [ -z "$ROOTCMD" -a "`id -u`" != "0" ]; then
  # Looking for root cmd
  if [ -f "/usr/bin/fakeroot" ]; then
    ROOTCMD=fakeroot
  elif [ -f "/usr/bin/sudo" ]; then
    ROOTCMD=sudo
  fi
fi
print_var ROOTCMD

KVERS="`getlinuxversion`"
print_var KVERS