From 8f6f144efb012ee8acd9855fd78403be35d09bd5 Mon Sep 17 00:00:00 2001 From: James Meyer Date: Mon, 13 Jul 2009 11:49:28 -0500 Subject: linhes-config: add request_dhcp function --- abs/core-testing/LinHES-config/PKGBUILD | 4 +- .../LinHES-config/install_functions.sh | 47 ++++++++++++++++++++++ 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/abs/core-testing/LinHES-config/PKGBUILD b/abs/core-testing/LinHES-config/PKGBUILD index 5ad1a9c..8ebf3f8 100755 --- a/abs/core-testing/LinHES-config/PKGBUILD +++ b/abs/core-testing/LinHES-config/PKGBUILD @@ -1,9 +1,9 @@ pkgname=LinHES-config pkgver=2.0 -pkgrel=53 +pkgrel=56 conflicts=(MythVantage-config MythVantage-config-dev LinHES-config-dev ) pkgdesc="Install and configure your system" -depends=(bc libstatgrab mysql-python expect curl dnsutils parted sg3_utils nmbscan system-templates rsync python-parted ddcxinfo python-pexpect python-netifaces LinHES-timezone) +depends=(bc libstatgrab mysql-python expect curl dnsutils parted sg3_utils nmbscan system-templates rsync python-parted ddcxinfo python-pexpect python-netifaces LinHES-timezone python-iplib) arch=('i686') source=(mv_install.py mv_config.py mythinstall.bin myth_user_call file_time_offset.py install-ui.xml install_proxy.sh install_functions.sh systemconfig.sh install_db_chroot.sh restore_default_settings.sh xconfig.sh timezip.py soundconfig.sh LinHES-release issue MythVantage.sh create_master.sh build_diskless.sh networkconfig.sh autocard.py restore_km_db_chroot.sh README mv_advanced.py mv_common.py mv_ir.py mv_misc.py mv_network.py mv_screensaver.py mv_smolt.py mv_software.py mv_webuser.py mv_hostype.py systemconfig.py myth_user_call.py) diff --git a/abs/core-testing/LinHES-config/install_functions.sh b/abs/core-testing/LinHES-config/install_functions.sh index 9b39437..94b4375 100755 --- a/abs/core-testing/LinHES-config/install_functions.sh +++ b/abs/core-testing/LinHES-config/install_functions.sh @@ -232,6 +232,53 @@ function init_network { rest_of_network fi fi + + + + +} + +function dev_up_check(){ + /sbin/ifconfig $1 1>/dev/null 2>/dev/null + status=$? + if [ $status -eq 1 ] + then + return 0 + else + devip=`/sbin/ifconfig | grep -C1 $1| grep inet|grep -v inet6 | cut -d: -f2 | awk '{ print $1}'` + if [ "x$devip" = "x" ] + then + return 1 + else + return 0 + fi + fi +} + +function request_dhcp(){ + for ndev in eth0 eth1 wlan0 wlan1 ath0 + do + dev_up_check $ndev + status=$? + if [ $status -eq 1 ] + then + #interface is down, lets see if dhcp responds + dhcpcd -Td -t2 $ndev > /tmp/dhcpinfo.$ndev + TEMPVAR=`grep IPADDR /tmp/dhcpinfo.$ndev |cut -d\' -f2` + if [ ! x$TEMPVAR = x ] + then + update_db_settings HostIP$ndev "$TEMPVAR" + TEMPVAR=`grep NETMASK /tmp/dhcpinfo.$ndev |cut -d\' -f2` + nm=`/usr/bin/nmconv.py -obits $TEMPVAR` + TEMPVAR="/$nm $TEMPVAR" + update_db_settings HostNETMASK$ndev "$TEMPVAR" + TEMPVAR=`grep GATEWAYS /tmp/dhcpinfo.$ndev |cut -d\' -f2` + update_db_settings HostGW$ndev "$TEMPVAR" + TEMPVAR=`grep DNSSERVERS /tmp/dhcpinfo.$ndev |cut -d\' -f2` + update_db_settings HostDNS$ndev "$TEMPVAR" + fi + fi + done } function init_remote { -- cgit v0.12 From e2cb7691fe15d142fc1ae8dcb85a526f9db5edf0 Mon Sep 17 00:00:00 2001 From: James Meyer Date: Mon, 13 Jul 2009 12:10:23 -0500 Subject: linhes-config: prefix a "c" to network parms to avoid conflicts to the ones built into the kernel. --- abs/core-testing/LinHES-config/PKGBUILD | 2 +- abs/core-testing/LinHES-config/install_functions.sh | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/abs/core-testing/LinHES-config/PKGBUILD b/abs/core-testing/LinHES-config/PKGBUILD index 8ebf3f8..9486462 100755 --- a/abs/core-testing/LinHES-config/PKGBUILD +++ b/abs/core-testing/LinHES-config/PKGBUILD @@ -1,6 +1,6 @@ pkgname=LinHES-config pkgver=2.0 -pkgrel=56 +pkgrel=57 conflicts=(MythVantage-config MythVantage-config-dev LinHES-config-dev ) pkgdesc="Install and configure your system" depends=(bc libstatgrab mysql-python expect curl dnsutils parted sg3_utils nmbscan system-templates rsync python-parted ddcxinfo python-pexpect python-netifaces LinHES-timezone python-iplib) diff --git a/abs/core-testing/LinHES-config/install_functions.sh b/abs/core-testing/LinHES-config/install_functions.sh index 94b4375..ea9e61c 100755 --- a/abs/core-testing/LinHES-config/install_functions.sh +++ b/abs/core-testing/LinHES-config/install_functions.sh @@ -161,10 +161,10 @@ fi function rest_of_network () { #netmask - echo $CMDLINE | grep -q netmask + echo $CMDLINE | grep -q cnetmask if [ $? -eq 0 ] then - TEMPVAR=${CMDLINE#*netmask=} + TEMPVAR=${CMDLINE#*cnetmask=} NETMASK=${TEMPVAR%% *} /sbin/ifconfig eth0 $IP netmask $NETMASK nm=`/usr/bin/nmconv.py -obits $NETMASK` @@ -175,10 +175,10 @@ function rest_of_network () { printhl " Netmask not found" fi #gateway - echo $CMDLINE | grep -q gateway + echo $CMDLINE | grep -q cgateway if [ $? -eq 0 ] then - TEMPVAR=${CMDLINE#*gateway=} + TEMPVAR=${CMDLINE#*cgateway=} GATEWAY=${TEMPVAR%% *} /sbin/route add default gw $GATEWAY update_db_settings HostGW${MYTHDEFAULT} "$GATEWAY" @@ -187,10 +187,10 @@ function rest_of_network () { fi #dns - echo $CMDLINE | grep -q dns + echo $CMDLINE | grep -q cdns if [ $? -eq 0 ] then - TEMPVAR=${CMDLINE#*dns=} + TEMPVAR=${CMDLINE#*cdns=} DNS=${TEMPVAR%% *} echo "nameserver $DNS" >> /etc/resolv.conf update_db_settings HostDNS${MYTHDEFAULT} "$DNS" @@ -200,10 +200,10 @@ function rest_of_network () { } function init_network { - echo $CMDLINE |grep -q netdev + echo $CMDLINE |grep -q cnetdev if [ $? -eq 0 ] then - TEMPVAR=${CMDLINE#*netdev=} + TEMPVAR=${CMDLINE#*cnetdev=} MYTHDEFAULT=${TEMPVAR%% *} else MYTHDEFAULT="eth0" @@ -219,7 +219,7 @@ function init_network { update_db_settings HostActiveonboot${MYTHDEFAULT} 1 update_db_settings HostNetDevice ${MYTHDEFAULT} - TEMPVAR=${CMDLINE#*ip=} + TEMPVAR=${CMDLINE#*cip=} IP=${TEMPVAR%% *} if [ "$IP" == "dhcp" ] then -- cgit v0.12 From 5baa3ef4ea235cf4440e3e3f62abd8a935d0ce0d Mon Sep 17 00:00:00 2001 From: James Meyer Date: Mon, 13 Jul 2009 12:21:19 -0500 Subject: nvidia: make it depend on a version of nvidia-utils. This might interfere with some people flipping around drivers trying to get vdpau to work, but oh well. --- abs/core-testing/nvidia/PKGBUILD | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/abs/core-testing/nvidia/PKGBUILD b/abs/core-testing/nvidia/PKGBUILD index 2c25610..eccf01f 100644 --- a/abs/core-testing/nvidia/PKGBUILD +++ b/abs/core-testing/nvidia/PKGBUILD @@ -4,13 +4,13 @@ pkgname=nvidia pkgver=185.18.14 _kernver='2.6.28-LinHES' -pkgrel=1 +pkgrel=2 pkgdesc="NVIDIA drivers for kernel26." arch=('i686' 'x86_64') [ "$CARCH" = "i686" ] && ARCH=x86 [ "$CARCH" = "x86_64" ] && ARCH=x86_64 url="http://www.nvidia.com/" -depends=('kernel26>=2.6.28' 'kernel26<2.6.29' 'nvidia-utils') +depends=('kernel26>=2.6.28' 'kernel26<2.6.29' 'nvidia-utils=185.18.14') conflicts=('nvidia-96xx' 'nvidia-71xx' 'nvidia-legacy' 'nvidia-beta') license=('custom') install=nvidia.install -- cgit v0.12