From ffd1f029b11a1c41c942901880e46702fbd38dca Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Sat, 28 Apr 2007 12:23:13 +0000 Subject: Simplification of (u)sleep (applets in busybox) git-svn-id: http://svn.openslx.org/svn/openslx/trunk@938 95ad53e4-c205-0410-b2fa-d234c58c8868 --- initramfs/initrd-stuff/etc/functions | 33 +-------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) (limited to 'initramfs/initrd-stuff') diff --git a/initramfs/initrd-stuff/etc/functions b/initramfs/initrd-stuff/etc/functions index aef02ad8..f42c4d0b 100644 --- a/initramfs/initrd-stuff/etc/functions +++ b/initramfs/initrd-stuff/etc/functions @@ -112,37 +112,6 @@ uptime=$(sed -e "s, .*,," /proc/uptime) echo "${uptime} s." # if start times are kept, a summary of runtimes would be possible too } - - -############################################################################# -# micro sleep - argument takes number of milliseconds. either busybox command -# or simply use uptime information -usleep () { -if [ -x /bin/usleep ]; then - /bin/usleep `expr $1 \* 1000` -else - local i=0 - local starttime=$(sed -e "s, .*,,;s,\.,," /proc/uptime) - while [ $(sed -e "s, .*,,;s,\.,," /proc/uptime) -le \ - $(expr $starttime + $1 - 2) ] ; do - # burn some cycles - while [ $i -le 100 ] ; do - i=$(expr 1 + $i) - done - done -fi -return 0 -} -# standard sleep command -sleep () { -if [ -x /bin/sleep ]; then - /bin/sleep $1 -#elif [ -x /bin/bash ]; then -# TMOUT=$1 read -else - usleep `expr $1 \* 1000` -fi -} ############################################################################# # (re)generate dynamic linked libraries cache from /etc/ld.so.conf ldcfg () { @@ -389,7 +358,7 @@ fi rundhcp () { local vci="$1" -for dhcp in dhclient dhcpcd pump udhcpc none; do +for dhcp in dhclient dhcpcd udhcpc none; do test -e /bin/$dhcp && break; done if [ "$dhcp" = "none" ] ; then -- cgit v1.2.3-55-g7522