Update of /cvsroot/leaf/src/The_UnNamed_One/apps/dhcpcd
In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv15949/apps/dhcpcd

Added Files:
        buildtool.cfg buildtool.mk config dhcpcd dhcpcd.exe 
        dhcpcd_1.3.22pl4-22.diff.gz dhcpcd_1.3.22pl4.orig.tar.gz 
Log Message:
initial import


--- NEW FILE: dhcpcd_1.3.22pl4-22.diff.gz ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: dhcpcd.exe ---
#!/bin/sh
#
#  This is a sample /etc/dhcpc/dhcpcd.exe script.
#  /etc/dhcpc/dhcpcd.exe script is executed by dhcpcd daemon
#  any time it configures or shuts down interface.
#  The following parameters are passed to dhcpcd.exe script:
#  $1 = HostInfoFilePath, e.g  "/var/lib/dhcpc/dhcpcd-eth0.info"
#  $2 = "up" if interface has been configured with the same
#       IP address as before reboot;
#  $2 = "down" if interface has been shut down;
#  $2 = "new" if interface has been configured with new IP address;
#  $3 (optional) = "-d" debug flag passed if dhcpcd daemon has been
#       invoked with "-d" flag
#
# This script sources /var/lib/dhcpc/dhcpcd-<interface>.info which defines 
# a set of variables. 
# NOTE THAT THE DATA IN SOME OF THESE VARIABLES COME FROM 
# UNTRUSTED SOURCES AND ARE UNCHECKED.
# The variables in question are HOSTNAME, DOMAIN, NISDOMAIN, 
# ROOTPATH DNSSEARCH and DHCPSNAME. Enough quoting is done to ensure that
# execution of this script is safe, but beware if you pass the value of any of
# these variables to another shell or perl script - there is nothing to
# stop an attacker putting dangerous characters in these variables. 
#
# This is important: if noglob not set a filename expansion metachar may be
# included in one of the variables set in the info file and executed
# if that variable is used.
# Try this to see the effect:
# TEST='*'; echo $TEST
set -o noglob

#  Sanity checks

if [ $# -lt 2 ]; then
  logger -s -p local0.err -t dhcpcd.exe "wrong usage"
  exit 1
fi

hostinfo="$1"
state="$2"
debug="$3"

# Reading HostInfo file for configuration parameters
if ! [ -f ${hostinfo} ]; then
   logger -s -p local0.err -t dhcpcd.exe "No hostinfo file"
   exit 1
fi

. ${hostinfo}

write_resolv_info()
{
    dnsservs=`echo $DNS | sed s/,/\ /g`
    r=""
    [ "$dnsservs" != "" ] && [ "$DNSSEARCH" != "" ] && r="${r}search $DNSSEARCH
"
    [ "$dnsservs" != "" ] && [ "$DNSSEARCH" = "" ] && [ "$DOMAIN" != "" ] && 
r="${r}search $DOMAIN
"
    for serv in $dnsservs; do
        r="${r}nameserver $serv
"
    done
    # set /etc/dhcpc/resolv.conf (dnsmasq uses this)
    echo -n "$r" >| /etc/dhcpc/resolv.conf
    chmod 644 /etc/dhcpc/resolv.conf
}

case ${INTERFACE} in
  eth*) ;;
 wlan*) ;;
     *) logger -s -p local0.err -t dhcpcd.exe "wrong interface name 
\"${INTERFACE}\""
        exit 1
        ;;
esac

case ${state} in
 up) logger -s -p local0.info -t dhcpcd.exe "interface ${INTERFACE} has been 
configured with old IP=${IPADDR}"
     write_resolv_info

# ====  Put your code for the case interface has been brought up with old IP 
address here

# ====  End
     ;;

 new) logger -s -p local0.info -t dhcpcd.exe "interface ${INTERFACE} has been 
configured with new IP=${IPADDR}"
     write_resolv_info

# ====  Put your code for the case interface has been brought up with new IP 
address here
        [ -r /var/run/shorewall ] && shorewall refresh
# ====  End
     ;;

 down) logger -s -p local0.info -t dhcpcd.exe "interface ${INTERFACE} has been 
brought down"
# ====  Put your code for the case interface has been shut down here

# ====  End
     ;;
esac

exit 0

--- NEW FILE: buildtool.mk ---
# makefile for dhcpcd
include $(MASTERMAKEFILE)

DHCPCD_DIR:=dhcpcd-1.3.22-pl4.orig
DHCPCD_TARGET_DIR:=$(BT_BUILD_DIR)/dhcpcd

$(DHCPCD_DIR)/.source:
        zcat $(DHCPCD_SOURCE) | tar -xvf -
        zcat $(DHCPCD_PATCH1) | patch -d $(DHCPCD_DIR) -p1
        touch $(DHCPCD_DIR)/.source

source: $(DHCPCD_DIR)/.source
                        
$(DHCPCD_DIR)/.configured: $(DHCPCD_DIR)/.source
        (cd $(DHCPCD_DIR) ; CC=$(TARGET_CC) LD=$(TARGET_LD) ./configure 
--prefix=/ )
        touch $(DHCPCD_DIR)/.configured
                                                                 
$(DHCPCD_DIR)/.build: $(DHCPCD_DIR)/.configured
        mkdir -p $(DHCPCD_TARGET_DIR)
        mkdir -p $(DHCPCD_TARGET_DIR)/sbin
        mkdir -p $(DHCPCD_TARGET_DIR)/etc/dhcpc
        make -C $(DHCPCD_DIR) CFLAGS="$(BT_COPT_FLAGS) -fomit-frame-pointer 
-Wall"
        -$(BT_STRIP) $(BT_STRIP_BINOPTS) $(DHCPCD_DIR)/dhcpcd
        cp -a $(DHCPCD_DIR)/dhcpcd $(DHCPCD_TARGET_DIR)/sbin/dhcpcd-bin
        cp -a dhcpcd $(DHCPCD_TARGET_DIR)/sbin  
        cp -a dhcpcd.exe $(DHCPCD_TARGET_DIR)/etc/dhcpc
        cp -a config $(DHCPCD_TARGET_DIR)/etc/dhcpc
        cp -a $(DHCPCD_TARGET_DIR)/* $(BT_STAGING_DIR)
        touch $(DHCPCD_DIR)/.build

build: $(DHCPCD_DIR)/.build
                                                                                
         
clean:
        make -C $(DHCPCD_DIR) clean
        rm -rf $(DHCPCD_TARGET_DIR)
        rm $(DHCPCD_DIR)/.build
        rm $(DHCPCD_DIR)/.configured
                                                                                
                                 
srcclean: clean
        rm -rf $(DHCPCD_DIR) 
        rm $(DHCPCD_DIR)/.source

--- NEW FILE: dhcpcd_1.3.22pl4.orig.tar.gz ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: buildtool.cfg ---
<File buildtool.mk>
  Server = cvs-sourceforge
  Revision = HEAD
  Directory = dhcpcd
</File>
                 
<File dhcpcd_1.3.22pl4.orig.tar.gz>
  Server = cvs-sourceforge
  Revision = HEAD
  envname = DHCPCD_SOURCE
  Directory = dhcpcd
</File>

<File dhcpcd_1.3.22pl4-22.diff.gz>
  Server = cvs-sourceforge
  Revision = HEAD
  envname = DHCPCD_PATCH1
  directory = dhcpcd
</File>

<File dhcpcd.exe>
  Server = cvs-sourceforge
  Revision = HEAD
  Directory = dhcpcd
</File>

<File dhcpcd>
  Server = cvs-sourceforge
  Revision = HEAD
  Directory = dhcpcd
</File>

<File config>
  Server = cvs-sourceforge
  Revision = HEAD
  Directory = dhcpcd
</File>

<Package>
        <dhcpcd>
                Version = 1.3.22pl4-22
                Revision = 2

                Help <<EOF
                dhcpcd is a RFC2131, RFC3397 and RFC1541 compliant DHCP client 
                daemon for automatically configuring IPv4 networking.
                Homepage: http://www.phystech.com/download/dhcpcd.html
                LEAF package by __PACKAGER__, __BUILDDATE__             
                EOF
                
                <Permissions>
                        Files = 644
                        Directories = 755
                </Permissions>

                <Owner>
                        Files = root:root
                        Directories = root:root
                </Owner>
                
                <Contents>
                        <File>          
                                Source          = sbin/dhcpcd
                                Filename        = sbin/dhcpcd
                                Type            = binary
                                Permissions = 755
                        </File>         

                        <File>          
                                Source          = sbin/dhcpcd-bin
                                Filename        = sbin/dhcpcd-bin
                                Type            = binary
                                Permissions = 755
                        </File>         

                        <File>          
                                Source          = etc/dhcpc/config
                                Filename        = etc/dhcpc/config
                                Type            = conf
                                Type            = binary
                                Type            = local
                                Description     = dhcpcd configuration
                        </File>         
                        <File>          
                                Source          = etc/dhcpc/dhcpcd.exe
                                Filename        = etc/dhcpc/dhcpcd.exe
                                Type            = binary
                                Type            = local
                                Permissions = 744
                        </File>         
#                       <File>          
#                               Filename        = etc/dhcpc
#                               Type            = local
#                       </File>         
                        <File>          
                                Filename        = var/lib/dhcpc
                                Type            = directory
                        </File>         
                </Contents>                     
        </dhcpcd>
</Package>

--- NEW FILE: config ---
# Config file for dhcpcd.

case ${INTERFACE} in
eth0) 

# Uncomment this to allow dhcpcd to set the DNS servers in /etc/resolv.conf
#SET_DNS='yes'

# Uncomment this to allow dhcpcd to set domainname of the host to the
# domainname option supplied by DHCP server.
#SET_DOMAIN='yes'

# Uncomment this to allow dhcpcd to set hostname of the host to the
# hostname option supplied by DHCP server.
#SET_HOSTNAME='yes'

# Uncomment this to allow dhcpcd to set the NTP servers in /etc/ntp.conf
#SET_NTP='yes'

# Uncomment this to allow dhcpcd to set the YP servers in /etc/yp.conf
#SET_YP='yes'

# Add other options here, see man 8 dhcpcd-bin for details.
OPTIONS='-d'
;;

# Add other interfaces here
*)
;;

esac






--- NEW FILE: dhcpcd ---
#!/bin/sh

# dhcpcd doesn't support a config file, just command line options.
# ifup can set some  options (-h -i -I -l) but no others.
# This wrapper adds any other options set in /etc/dhcpc/config
# and then calls the dhcpcd binary, named dhcpcd-bin.
#
# Note that this wrapper _requires_ the interface name: it doesn't support
# the eth0 default that dhcpcd proper does.

# get interface
eval INTERFACE=\${$#}

# dhcpcd will fail to start if pid file exists, so delete it
# if there is no process around. Note that calling dhcpcd -k or dhcpcd -n
# both affect running processes, so skip this for those.
keeppid=no

for o 
do
   if [ $o = "-k" ]; then
      keeppid=yes
   fi
   if [ $o = "-n" ]; then
      keeppid=yes
   fi
done

ps ax | grep -v grep | grep -s dhcpcd-bin | grep -q $INTERFACE
if [ $? = 0 ] &&
   [ $keeppid = no ] 
then
    echo "Dhcpcd is already running."
    exit 0
fi
     
if [ $keeppid = no ]; then
   rm -f /var/run/dhcpcd-$INTERFACE.pid
fi

# load configuration file
if [ -f /etc/dhcpc/config ] ; then
    . /etc/dhcpc/config
fi

# Note that in the absence of /etc/dhcpc/config we play safe and disallow
# changes to /etc/resolv.conf and friends.

if [ "$SET_DNS" != "yes" ]; then
  OPTIONS="-R $OPTIONS"
fi

if [ "$SET_DOMAIN" = "yes" ]; then
  OPTIONS="-D $OPTIONS"
fi

if [ "$SET_HOSTNAME" = "yes" ]; then
  OPTIONS="-H $OPTIONS"
fi

if [ "$SET_NTP" != "yes" ]; then
  OPTIONS="-N $OPTIONS"
fi

if [ "$SET_YP" != "yes" ]; then
  OPTIONS="-Y $OPTIONS"
fi

exec /sbin/dhcpcd-bin $OPTIONS $*


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
leaf-cvs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/leaf-cvs-commits

Reply via email to