From: <ow...@us...> - 2008-10-26 17:39:33
|
Revision: 2020 http://ipcop.svn.sourceforge.net/ipcop/?rev=2020&view=rev Author: owes Date: 2008-10-26 17:39:22 +0000 (Sun, 26 Oct 2008) Log Message: ----------- Upgrade dhcpcd to 4.0.2 Some commandline options were dropped and the use of script has changed, so change rc.red and dchpcd.sh to match. Modified Paths: -------------- ipcop/trunk/config/rootfiles/common/dhcpcd ipcop/trunk/lfs/dhcpcd ipcop/trunk/src/rc.d/rc.red ipcop/trunk/src/scripts/dhcpcd.sh Modified: ipcop/trunk/config/rootfiles/common/dhcpcd =================================================================== --- ipcop/trunk/config/rootfiles/common/dhcpcd 2008-10-25 10:38:33 UTC (rev 2019) +++ ipcop/trunk/config/rootfiles/common/dhcpcd 2008-10-26 17:39:22 UTC (rev 2020) @@ -1,4 +1,13 @@ -## dhcpcd-3.2.3 +## dhcpcd-4.0.2 ## +etc/dhcpcd.conf +#usr/libexec/dhcpcd-hooks +#usr/libexec/dhcpcd-hooks/01-test +#usr/libexec/dhcpcd-hooks/10-mtu +#usr/libexec/dhcpcd-hooks/20-resolv.conf +#usr/libexec/dhcpcd-hooks/30-hostname +#usr/libexec/dhcpcd-run-hooks usr/sbin/dhcpcd +#usr/share/man/man5/dhcpcd.conf.5 +#usr/share/man/man8/dhcpcd-run-hooks.8 #usr/share/man/man8/dhcpcd.8 Modified: ipcop/trunk/lfs/dhcpcd =================================================================== --- ipcop/trunk/lfs/dhcpcd 2008-10-25 10:38:33 UTC (rev 2019) +++ ipcop/trunk/lfs/dhcpcd 2008-10-26 17:39:22 UTC (rev 2020) @@ -33,13 +33,13 @@ include Config PKG_NAME = dhcpcd -VER = 3.2.3 +VER = 4.0.2 HOST_ARCH = all OTHER_SRC = yes -THISAPP = dhcpcd-$(VER) +THISAPP = $(PKG_NAME)-$(VER) DL_FILE = $(THISAPP).tar.bz2 -DL_FROM = http://roy.marples.name/dhcpcd/ +DL_FROM = http://roy.marples.name/downloads/dhcpcd DIR_APP = $(DIR_SRC)/$(THISAPP) TARGET = $(DIR_INFO)/$(STAGE_ORDER)_$(STAGE)/$(THISAPP) @@ -51,7 +51,7 @@ $(DL_FILE) = $(DL_FROM)/$(DL_FILE) -$(DL_FILE)_MD5 = f7b0b302307e27e00412d81c22df28b3 +$(DL_FILE)_MD5 = 7cdc25f37f37260f94335d5b6c76f40e install : $(TARGET) @@ -82,8 +82,8 @@ @$(PREBUILD) @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE) - cd $(DIR_APP) && make INFOD=/var/run - cd $(DIR_APP) && make install BINDIR=/usr/sbin + cd $(DIR_APP) && make DBDIR=/var/run LIBEXECDIR=/usr/libexec + cd $(DIR_APP) && make install BINDIR=/usr/sbin DBDIR=/var/run LIBEXECDIR=/usr/libexec - @rm -rf $(DIR_APP) + #@rm -rf $(DIR_APP) @$(POSTBUILD) Modified: ipcop/trunk/src/rc.d/rc.red =================================================================== --- ipcop/trunk/src/rc.d/rc.red 2008-10-25 10:38:33 UTC (rev 2019) +++ ipcop/trunk/src/rc.d/rc.red 2008-10-26 17:39:22 UTC (rev 2020) @@ -49,7 +49,7 @@ unlink "/var/log/dhcpclient.info" if (-e "/var/log/dhcpclient.info"); my @dhcpcommand = ('/usr/sbin/dhcpcd'); - push(@dhcpcommand, ('-L', '-N', '-R', '-Y', '--script', '/usr/local/bin/dhcpcd.sh', "$iface")); + push(@dhcpcommand, ('-L', '--script', '/usr/local/bin/dhcpcd.sh', "$iface")); if ($dhcp_name ne '') { push(@dhcpcommand, ('-h', "$dhcp_name")); } if ($netsettings{'RED_TYPE'} eq 'PPTP') { push(@dhcpcommand, '-G'); } Modified: ipcop/trunk/src/scripts/dhcpcd.sh =================================================================== --- ipcop/trunk/src/scripts/dhcpcd.sh 2008-10-25 10:38:33 UTC (rev 2019) +++ ipcop/trunk/src/scripts/dhcpcd.sh 2008-10-26 17:39:22 UTC (rev 2020) @@ -33,74 +33,64 @@ make_info_file() { cat /dev/null > $FILE_INFO - echo "DHCLIENT_IPADDR=$IPADDR" >> $FILE_INFO - echo "DHCLIENT_INTERFACE=$INTERFACE" >> $FILE_INFO - router=`echo $GATEWAYS | /usr/bin/cut -d ' ' -f 1` + echo "DHCLIENT_IPADDR=${new_ip_address}" >> $FILE_INFO + echo "DHCLIENT_INTERFACE=${interface}" >> $FILE_INFO + router=`echo ${new_routers} | /usr/bin/cut -d ' ' -f 1` echo "DHCLIENT_GATEWAY=$router" >> $FILE_INFO count=1 - for nameserver in $DNSSERVERS; do + for nameserver in ${new_domain_name_servers}; do echo "DHCLIENT_DNS$count=$nameserver" >> $FILE_INFO ((++count)) done echo "DHCLIENT_HOSTNAME=$new_host_name" >> $FILE_INFO - echo "DHCLIENT_DOMAIN=$DNSDOMAIN" >> $FILE_INFO - echo "DHCLIENT_SIADDR=$DHCPSID" >> $FILE_INFO - echo "DHCLIENT_LEASETIME=$LEASETIME" >> $FILE_INFO - EXPIRY=$(( ${LEASEDFROM} + ${LEASETIME} )) + echo "DHCLIENT_DOMAIN=${new_domain_name}" >> $FILE_INFO + echo "DHCLIENT_SIADDR=${new_dhcp_server_identifier}" >> $FILE_INFO + echo "DHCLIENT_LEASETIME=${new_dhcp_lease_time}" >> $FILE_INFO + # TODO: Need to retrieve lease start time from somewhere, or use something like time now ? + # EXPIRY=$(( ${LEASEDFROM} + ${LEASETIME} )) echo "DHCLIENT_EXPIRY=$EXPIRY" >> $FILE_INFO } -# The following parameters are passed to dhcpcd.exe script: -# $1 = HostInfoFilePath, e.g "/var/lib/dhcpcd/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; -# -# Sanity checks - -if [ $# -lt 2 ]; then - logger -s -p local0.err -t dhcpcd.sh "wrong usage" - exit 1 -fi - -hostinfo="$1" -state="$2" - FILE_INFO=/var/log/dhcpclient.info -# Reading HostInfo file for configuration parameters -[ -e "${hostinfo}" ] && . "${hostinfo}" +# Write all variables to file for testing, code snippet from dhcpcd-hooks/01-test +# echo `set | grep "^\(new_\|old_\)" | sort` > /tmp/dhcpcd.env +# -case "${state}" in - up) +case "${reason}" in + RENEW) logger -s -p local0.info -t dhcpcd.sh \ - "interface ${INTERFACE} has been configured with old IP=${IPADDR}" + "interface ${INTERFACE} has been configured with old IP=${new_ip_address}" # Put your code here for when the interface has been brought up with an # old IP address here make_info_file + state=up ;; - new) + BOUND) logger -s -p local0.info -t dhcpcd.sh \ - "interface ${INTERFACE} has been configured with new IP=${IPADDR}" + "interface ${INTERFACE} has been configured with new IP=${new_ip_address}" # Put your code here for when the interface has been brought up with a # new IP address make_info_file + state=new ;; - down) + RELEASE|EXPIRE) logger -s -p local0.info -t dhcpcd.sh \ "interface ${INTERFACE} has been brought down" # Put your code here for the when the interface has been shut down + state=down ;; + PREINIT) + exit 1 + ;; + *) - if [ $# -lt 2 ]; then - logger -s -p local0.err -t dhcpcd.sh "wrong usage" - exit 1 - fi + logger -s -p local0.err -t dhcpcd.sh "unknown usage ${reason}" + exit 1 ;; esac This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |