Net-tools

Richard Lightman richard at reika.demon.co.uk
Sun Jul 8 22:58:56 PDT 2001


Misquoted from Marcel Mulder on 2001/07/ 8 at 18:03 +0000:
> Hi,
> Why is
> nothing said about the question's the make of net-tools asks.
> Has somebody a predefined input script so it can be automated?
> 
Yes. This one uses /usr/src/linux/.config to choose sensible
answers. It will still work if the order of the questions, or
the wording gets changed. It will even handle extra questions
by giving the default answer.


~/net-tools-answers # log to /dev/null
~/net-tools-answers ~/log # Adds this to ~/log:
  Does your system support GNU gettext? Yes, but perhaps I should have checked
  UNIX protocol family? Yes, kernel has CONFIG_UNIX
  INET (TCP/IP) protocol family? Yes, kernel has CONFIG_INET
  INET6 (IPv6) protocol family? No, CONFIG_IPV6 not in kernel
  Novell IPX/SPX protocol family? No, CONFIG_IPX not in kernel
  Appletalk DDP protocol family? No, CONFIG_ATALK not in kernel
  AX25 (packet radio) protocol family? No, CONFIG_HAMRADIO not in kernel
  NET/ROM (packet radio) protocol family? No, CONFIG_NETROM not in kernel
  Rose (packet radio) protocol family? No, CONFIG_ROSE not in kernel
  X.25 (CCITT) protocol family? No, CONFIG_X25 not in kernel
  Econet protocol family? No, CONFIG_ECONET not in kernel
  DECnet protocol family? No, CONFIG_DECNET not in kernel
  Ash protocol family? No, not supported by kernel
  Ethernet (generic) support? Yes, kernel has CONFIG_NET_ETHERNET
  ARCnet support? No, CONFIG_ARCNET not in kernel
  SLIP (serial line) support? No, CONFIG_SLIP not in kernel
  PPP (serial line) support? Yes, kernel has CONFIG_PPP
  IPIP Tunnel support? No, CONFIG_NET_IPIP not in kernel
  STRIP (Metricom radio) support? No, CONFIG_STRIP not in kernel
  Token ring (generic) support? No, CONFIG_TR not in kernel
  AX25 (packet radio) support? No, CONFIG_AX25 not in kernel
  Rose (packet radio) support? No, CONFIG_ROSE not in kernel
  NET/ROM (packet radio) support? No, CONFIG_NETROM not in kernel
  X.25 (generic) support? No, CONFIG_WAN not in kernel
  DLCI/FRAD (frame relay) support? No, CONFIG_DLCI not in kernel
  SIT (IPv6-in-IPv4) support? No, CONFIG_NET_IPGRE not in kernel
  FDDI (generic) support? No, CONFIG_FDDI not in kernel
  HIPPI (generic) support? No, CONFIG_HIPPI not in kernel
  Ash hardware support? No, not supported by kernel
  (Cisco)-HDLC/LAPB support? No, CONFIG_LAPB not in kernel
  IrDA support? No, CONFIG_IRDA not in kernel
  Econet hardware support? No, CONFIG_ECONET not in kernel
  IP Masquerading support? No, CONFIG_IP_MASQUERADE not in kernel
  Build iptunnel and ipmaddr? No, CONFIG_NET_IPGRE not in kernel
  Said yes to 'Build mii-tool' because it's Monday



There are a couple of questions where I need help:

1) The kernel often has symbols for protocols and hardware.
   net-tools asks about each separately. For these protocols
   in the kernel, it is not clear which symbols selects the
   hardware:

   CONFIG_ROSE selects a protocol. What selects rose hardware?
   CONFIG_NETROM selects a protocol. What selects netrom hardware?
   CONFIG_ECONET selects a protocol. What selects acorn hardware?

   The script assumes that if you have the protocol in the kernel
   then you want hardware support too.

2) Last time I checked, there was no support for Ash in the
   kernel. What symbol would be set if there was?

   The script assume you do not want Ash.

3) What is MII?
   I said yes because I get the following from klogd:
   tulip0:  MII transceiver #1 config 1000 status 782d advertising 01e1.
   eth0: Setting full-duplex based on MII#1 link partner capability of 05e1.

-------------- next part --------------
#!/bin/bash
# Guess the answers to the net-tools interactive configure script
# based on choices in /usr/src/linux/.config
# Assumes you are in the net-tools source directory

# CONFIG_ROSE selects a protocol. What selects rose hardware?
# CONFIG_NETROM selects a protocol. What selects netrom hardware?
# Last time I checked, there was no support for Ash
# CONFIG_ECONET selects a protocol. What selects acorn hardware?
# What is MII?

log=${1:-/dev/null}

check_kernel ()
# Output y or n to the ******* interactive configure script
{
  local guess
  if [ "$1" = y -o "$1" = n ]; then
    guess=$1
    echo "  $2" >>$log
  else
    if grep "$1=" /usr/src/linux/.config > /dev/null; then
      echo "  $2? Yes, kernel has $1" >>$log
      guess=y
    else
      echo "  $2? No, $1 not in kernel" >>$log
      guess=n
    fi
  fi
  echo $guess
}

consider ()
# Guess what is wanted from then kernel configuration
{
  case "$3" in
  I18N)               check_kernel y "$2 Yes, but perhaps I should have checked";;
  HAVE_AFUNIX)        check_kernel CONFIG_UNIX "$2";;
  HAVE_AFINET)        check_kernel CONFIG_INET "$2";;
  HAVE_AFINET6)       check_kernel CONFIG_IPV6 "$2";;
  HAVE_AFIPX)         check_kernel CONFIG_IPX "$2";;
  HAVE_AFATALK)       check_kernel CONFIG_ATALK "$2";;
  HAVE_AFAX25)        check_kernel CONFIG_HAMRADIO "$2";;
  HAVE_AFNETROM)      check_kernel CONFIG_NETROM "$2";;
  HAVE_AFROSE)        check_kernel CONFIG_ROSE "$2";;
  HAVE_AFX25)         check_kernel CONFIG_X25 "$2";;
  HAVE_AFECONET)      check_kernel CONFIG_ECONET "$2";;
  HAVE_AFDECnet)      check_kernel CONFIG_DECNET "$2";;
  HAVE_AFASH)         check_kernel n "$2? No, not supported by kernel";;
  HAVE_HWETHER)       check_kernel CONFIG_NET_ETHERNET "$2";;
  HAVE_HWARC)         check_kernel CONFIG_ARCNET "$2";;
  HAVE_HWSLIP)        check_kernel CONFIG_SLIP "$2";;
  HAVE_HWPPP)         check_kernel CONFIG_PPP "$2";;
  HAVE_HWTUNNEL)      check_kernel CONFIG_NET_IPIP "$2";;
  HAVE_HWSTRIP)       check_kernel CONFIG_STRIP "$2";;
  HAVE_HWTR)          check_kernel CONFIG_TR "$2";;
  HAVE_HWAX25)        check_kernel CONFIG_AX25 "$2";;
  HAVE_HWROSE)        check_kernel CONFIG_ROSE "$2";;
  HAVE_HWNETROM)      check_kernel CONFIG_NETROM "$2";;
  HAVE_HWX25)         check_kernel CONFIG_WAN "$2";;
  HAVE_HWFR)          check_kernel CONFIG_DLCI "$2";;
  HAVE_HWSIT)         check_kernel CONFIG_NET_IPGRE "$2";;
  HAVE_HWFDDI)        check_kernel CONFIG_FDDI "$2";;
  HAVE_HWHIPPI)       check_kernel CONFIG_HIPPI "$2";;
  HAVE_HWASH)         check_kernel n "$2? No, not supported by kernel";;
  HAVE_HWHDLCLAPB)    check_kernel CONFIG_LAPB "$2";;
  HAVE_HWIRDA)        check_kernel CONFIG_IRDA "$2";;
  HAVE_HWEC)          check_kernel CONFIG_ECONET "$2";;
  HAVE_FW_MASQUERADE) check_kernel CONFIG_IP_MASQUERADE "$2";;
  HAVE_IP_TOOLS)      check_kernel CONFIG_NET_IPGRE "$2";;
  HAVE_MII)           check_kernel y "Said yes to '$2' because it's $(date +%A)";;
  *)                  check_kernel $4 "What is $2? default=$4";;
  esac
}

grep bool config.in | while read line; do
  eval consider $line
done | ./configure.sh config.in



More information about the lfs-dev mailing list