Blame SOURCES/bltk-1.1.0-rm_sudo.patch

983249
diff -up bltk-1.1.0/include/bltk.h.sec_sudo bltk-1.1.0/include/bltk.h
983249
--- bltk-1.1.0/include/bltk.h.sec_sudo	2009-07-29 11:38:48.000000000 +0200
983249
+++ bltk-1.1.0/include/bltk.h	2009-12-08 14:28:23.868162165 +0100
983249
@@ -429,8 +429,6 @@ extern int dpms_proc_flg;
983249
 
983249
 extern char *results;
983249
 
983249
-extern char *bltk_sudo;
983249
-
983249
 extern int abort_flg;
983249
 extern int ac_ignore;
983249
 
983249
diff -up bltk-1.1.0/Makefile.sec_sudo bltk-1.1.0/Makefile
983249
--- bltk-1.1.0/Makefile.sec_sudo	2009-07-29 11:38:48.000000000 +0200
983249
+++ bltk-1.1.0/Makefile	2009-12-08 14:28:23.868162165 +0100
983249
@@ -89,10 +89,6 @@ clean : FORCE
983249
 	@$(RM) *~ last_cmd last_results history
983249
 	@$(RM) .bltk install.log uninstall.log .plot_history
983249
 
983249
-su : pre-install
983249
-	$(MAKE) -C tools/sudo install
983249
-	@touch .bltk
983249
-
983249
 _lazy : FORCE
983249
 	@for f in $(CMDS); \
983249
 	do \
983249
diff -up bltk-1.1.0/tools/analyzer/bltk_report.sh.sec_sudo bltk-1.1.0/tools/analyzer/bltk_report.sh
983249
diff -up bltk-1.1.0/tools/bat_drain/bat_drain.sh.sec_sudo bltk-1.1.0/tools/bat_drain/bat_drain.sh
983249
--- bltk-1.1.0/tools/bat_drain/bat_drain.sh.sec_sudo	2009-07-29 11:38:48.000000000 +0200
983249
+++ bltk-1.1.0/tools/bat_drain/bat_drain.sh	2009-12-10 13:55:46.454371019 +0100
983249
@@ -100,16 +100,12 @@ set_bltk_root()
983249
 set_bltk_root
983249
 
983249
 export BLTK_BIN=$BLTK_ROOT/bin
983249
-export BLTK_SUDO=$BLTK_BIN/bltk_sudo
983249
 export BLTK_GET_DMIDECODE=$BLTK_BIN/bltk_get_dmidecode
983249
 export BLTK_GET_SYSTEM_RELEASE=$BLTK_BIN/bltk_get_system_release
983249
 
983249
-if [[ -x $BLTK_SUDO ]]
983249
-then
983249
-	MANUFACTURER=`$BLTK_SUDO $BLTK_GET_DMIDECODE -m`
983249
-	PRODUCT_NAME=`$BLTK_SUDO $BLTK_GET_DMIDECODE -p`
983249
-	SYSTEM_RELEASE=`$BLTK_GET_SYSTEM_RELEASE -v`
983249
-fi
983249
+MANUFACTURER=`cat /sys/devices/virtual/dmi/id/sys_vendor`
983249
+PRODUCT_NAME=`cat /sys/devices/virtual/dmi/id/product_name`
983249
+SYSTEM_RELEASE=`$BLTK_GET_SYSTEM_RELEASE -v`
983249
 
983249
 # percents
983249
 BAT_CRITICAL=5
983249
@@ -1874,16 +1870,6 @@ fini_user()
983249
 	$fini_user_cmd
983249
 }
983249
 
983249
-bat_startup()
983249
-{
983249
-	if [[ -x $BLTK_SUDO ]]
983249
-	then
983249
-		$BLTK_SUDO modprobe cpufreq_stats >/dev/null 2>&1
983249
-	fi
983249
-}
983249
-
983249
-bat_startup
983249
-
983249
 init_srgs "$@"
983249
 
983249
 if [[ $left_work_flg = TRUE ]]
983249
diff -up bltk-1.1.0/tools/bltk/bltk_check.sh.sec_sudo bltk-1.1.0/tools/bltk/bltk_check.sh
983249
--- bltk-1.1.0/tools/bltk/bltk_check.sh.sec_sudo	2009-12-08 14:28:23.846162271 +0100
983249
+++ bltk-1.1.0/tools/bltk/bltk_check.sh	2009-12-08 14:28:23.876162742 +0100
983249
@@ -85,14 +85,6 @@ command_line()
983249
 cmd_startup
983249
 [[ $? != 0 ]] && exit 1
983249
 
983249
-$BLTK_SUDO_CMD
983249
-if [[ $? != 0 ]]
983249
-then
983249
-	echo "Cannot run $BLTK_SUDO_CMD"
983249
-	echo "Please perform 'make su' command"
983249
-	exit 2
983249
-fi
983249
-
983249
 command_line "$@"
983249
 
983249
 #rm -rf $RES
983249
diff -up bltk-1.1.0/tools/bltk/bltk_get_dmidecode.sh.sec_sudo bltk-1.1.0/tools/bltk/bltk_get_dmidecode.sh
983249
--- bltk-1.1.0/tools/bltk/bltk_get_dmidecode.sh.sec_sudo	2009-12-08 14:28:23.825191233 +0100
983249
+++ bltk-1.1.0/tools/bltk/bltk_get_dmidecode.sh	2009-12-08 14:28:23.877162125 +0100
983249
@@ -74,65 +74,13 @@ command_line()
983249
 	done
983249
 
983249
 	shift $((OPTIND-1))
983249
-
983249
-	DMIDECODE=$*
983249
-	TMP_FILE=$BLTK_HOME/tmp/dmidecode
983249
-
983249
-	if [[ -z $DMIDECODE ]]
983249
-	then
983249
-		type -p dmidecode >/dev/null 2>&1
983249
-		if [[ $? = 0 ]]
983249
-		then
983249
-			rm -f $TMP_FILE
983249
-			$BLTK_SUDO_CMD dmidecode >$TMP_FILE
983249
-			DMIDECODE=$TMP_FILE
983249
-		else
983249
-			if [[ $manufacturer_flg = TRUE ]]
983249
-			then
983249
-				:
983249
-			elif [[ $product_name_flg = TRUE ]]
983249
-			then
983249
-				:
983249
-			else
983249
-				echo "MANUFACTURER ="
983249
-				echo "PRODUCT_NAME ="
983249
-			fi
983249
-			exit 1
983249
-		fi
983249
-	fi
983249
-
983249
-	MANUFACTURER=
983249
-	PRODUCT_NAME=
983249
 }
983249
 
983249
 command_line "$@"
983249
 
983249
-while read line
983249
-do
983249
-	if [[ "$line" == *"System Information"* ]]
983249
-	then
983249
-		read line_m
983249
-		read line_p
983249
-		break
983249
-	fi
983249
-done < $DMIDECODE
983249
-
983249
-
983249
-if [[ ! -z "$line_m" ]]
983249
-then
983249
-	if [[ "$line_m" == *"Manufacturer: "* ]]
983249
-	then
983249
-		MANUFACTURER=${line_m#Manufacturer: }
983249
-	fi
983249
-fi
983249
+MANUFACTURER=`cat /sys/devices/virtual/dmi/id/sys_vendor`
983249
 
983249
-if [[ ! -z "$line_p" ]]
983249
-then
983249
-	if [[ "$line_p" == *"Product Name: "* ]]
983249
-	then
983249
-		PRODUCT_NAME=${line_p#Product Name: }
983249
-	fi
983249
-fi
983249
+PRODUCT_NAME=`cat /sys/devices/virtual/dmi/id/product_name`
983249
 
983249
 if [[ $manufacturer_flg = TRUE ]]
983249
 then
983249
@@ -145,6 +93,4 @@ else
983249
 	echo "PRODUCT_NAME = $PRODUCT_NAME"
983249
 fi
983249
 
983249
-rm -f $TMP_FILE
983249
-
983249
 exit 0
983249
diff -up bltk/tools/bltk/bltk_get_hdparm.sh.orig bltk/tools/bltk/bltk_get_hdparm.sh
983249
--- bltk/tools/bltk/bltk_get_hdparm.sh.orig	2010-08-18 08:35:02.000000000 +0200
983249
+++ bltk/tools/bltk/bltk_get_hdparm.sh	2012-05-07 16:22:43.000000000 +0200
983249
@@ -44,39 +44,64 @@ PROG=$0
983249
 
983249
 error()
983249
 {
983249
-	echo "$PROG: ERROR: $*" >&2
983249
-	exit 1
983249
+  echo "$PROG: ERROR: $*" >&2
983249
+  exit 1
983249
 }
983249
 
983249
 warning()
983249
 {
983249
-	echo "$PROG: Warning: $*" >&2
983249
+  echo "$PROG: Warning: $*" >&2
983249
 }
983249
 
983249
 PARTITIONS=$1
983249
 
983249
+FOUND=0
983249
+READING=0
983249
 TMP_FILE=$BLTK_ROOT/tmp/hdparm
983249
+DEV_INFO=$BLTK_HOME/tmp/dev_info
983249
+
983249
+/usr/bin/udisksctl dump > $TMP_FILE
983249
 
983249
 #str=`df -lk / | grep -v ^Filesystem`
983249
 str=`df -lk / | grep ^/dev/`
983249
 DF_DEV_NAME=${str%% *}
983249
-if [  -L $DF_DEV_NAME ];then 
983249
-	realname="`readlink $DF_DEV_NAME`"
983249
-	DF_NAME="`basename ${realname}`"
983249
-	HD_NAME=${DF_NAME}
983249
-	DISK_CK_TOOL="lvdisplay -a"
983249
-	HD_DEV_NAME=$DF_DEV_NAME
983249
-else 
983249
-	DF_NAME=${DF_DEV_NAME#/dev/}
983249
-	HD_NAME=${DF_NAME%%[0-9]*}
983249
-	DISK_CK_TOOL="hdparm -iI"
983249
-	HD_DEV_NAME=/dev/$HD_NAME
983249
+if [  -L $DF_DEV_NAME ];then
983249
+  realname="`readlink $DF_DEV_NAME`"
983249
+  DF_NAME="`basename ${realname}`"
983249
+  HD_NAME=${DF_NAME}
983249
+else
983249
+  DF_NAME=${DF_DEV_NAME#/dev/}
983249
+  HD_NAME=${DF_NAME%%[0-9]*}
983249
 fi
983249
 
983249
+HD_DEV_NAME=/dev/$HD_NAME
983249
+
983249
+while read line
983249
+do
983249
+  if [[ $READING -eq 0 && `echo $line | grep '^/'` ]]; then
983249
+    READING=1
983249
+  elif [[ $READING -eq 1 && -z "$line" ]]; then
983249
+    READING=0
983249
+    if [ $FOUND -eq 1 ]; then
983249
+      break;
983249
+    else
983249
+      rm $DEV_INFO
983249
+    fi
983249
+  fi
983249
+
983249
+  if [[ $READING -eq 1 ]]; then
983249
+    echo $line >> $DEV_INFO
983249
+  fi
983249
+
983249
+  if [[ `echo $line | grep "Device: *$HD_DEV_NAME"` ]]; then
983249
+    FOUND=1
983249
+  fi
983249
+done < $TMP_FILE
983249
+
983249
 grep -w "$HD_NAME" "$PARTITIONS" >/dev/null 2>&1
983249
 if [[ $? != 0 ]]
983249
 then
983249
-	warning "Cannot determine hard disk $HD_NAME statistics"
983249
+  warning "Cannot determine hard disk $HD_NAME statistics"
983249
 fi
983249
 
983249
 echo "DF_NAME = $DF_NAME"
983249
@@ -85,34 +110,17 @@ echo "HD_NAME = $HD_NAME"
983249
 echo "HD_DEV_NAME = $HD_DEV_NAME"
983249
 
983249
 rm -f $TMP_FILE
983249
-BLTK_SUDO_CMD=sudo
983249
-$BLTK_SUDO_CMD $DISK_CK_TOOL "$HD_DEV_NAME" >$TMP_FILE 2>&1
983249
-if [  -L $DF_DEV_NAME ];then 
983249
-	echo "HD_MODEL = Logical volume"
983249
-
983249
-	str=`grep 'LV Size' $TMP_FILE`
983249
-	str=${str#*LV Size*}
983249
-	str=`echo $str`
983249
-	echo "HD_SIZE = $str"
983249
-else 
983249
-	
983249
-	str=`grep '^ Model=' $TMP_FILE`
983249
-	str=${str# Model=}
983249
-	str=${str%%, *}
983249
-	if [[ -z "$str" ]]
983249
-	then
983249
-		str=`grep '^	Model Number:' $TMP_FILE`
983249
-		str=${str#*Model Number:}
983249
-		str=`echo $str`
983249
-	fi
983249
-	echo "HD_MODEL = $str"
983249
-	
983249
-	str=`grep 'device size with M = 1000' $TMP_FILE`
983249
-	str=${str#*device size with M = 1000*:}
983249
-	str=`echo $str`
983249
-	echo "HD_SIZE = $str"
983249
+if [  -L $DF_DEV_NAME ];then
983249
+  echo "HD_MODEL = Logical volume"
983249
+
983249
+  str=`grep '^Size:' $DEV_INFO | sed 's/^Size: *//'`
983249
+  echo "HD_SIZE = $((str/1048576)) MBytes ($((str/1073741824)) GB)"
983249
+else
983249
+  echo "HD_MODEL = `grep '^Model:' $DEV_INFO | sed 's/^Model: *//'`"
983249
+  str=`grep '^Size:' $DEV_INFO | sed 's/^Size: *//'`
983249
+  echo "HD_SIZE = $((str/1000000)) MBytes ($((str/1000000000)) GB)"
983249
 fi
983249
 
983249
-rm -f $TMP_FILE
983249
+rm -f $DEV_INFO
983249
 
983249
 exit 0
983249
diff -up bltk/tools/bltk/bltk_get_user_field.sh.orig bltk/tools/bltk/bltk_get_user_field.sh
983249
--- bltk/tools/bltk/bltk_get_user_field.sh.orig	2012-05-07 16:23:42.925939779 +0200
983249
+++ bltk/tools/bltk/bltk_get_user_field.sh	2012-05-07 16:22:43.000000000 +0200
983249
@@ -45,19 +45,24 @@ PROG=$0
983249
 
983249
 error()
983249
 {
983249
-	echo "$PROG: ERROR: $*" >&2
983249
-	exit 1
983249
+  echo "$PROG: ERROR: $*" >&2
983249
+  exit 1
983249
 }
983249
 
983249
 warning()
983249
 {
983249
-	echo "$PROG: Warning: $*" >&2
983249
+  echo "$PROG: Warning: $*" >&2
983249
 }
983249
 
983249
 FIELD_NO=$1
983249
 DELIM=$1
983249
 
983249
+FOUND=0
983249
+READING=0
983249
 TMP_FILE=$BLTK_HOME/tmp/hdparm
983249
+DEV_INFO=$BLTK_HOME/tmp/dev_info
983249
+
983249
+/usr/bin/udisksctl dump > $TMP_FILE
983249
 
983249
 #str=`df -lk / | grep -v ^Filesystem`
983249
 str=`df -lk / | grep ^/dev/`
983249
@@ -69,35 +74,45 @@ HD_NAME=${DF_NAME%%[0-9]*}
983249
 grep -w "$HD_NAME" "$PARTITIONS" >/dev/null 2>&1
983249
 if [[ $? != 0 ]]
983249
 then
983249
-	warning "Cannot determine hard disk $HD_NAME statistics"
983249
+  warning "Cannot determine hard disk $HD_NAME statistics"
983249
 fi
983249
 
983249
 HD_DEV_NAME=/dev/$HD_NAME
983249
 
983249
+while read line
983249
+do
983249
+  if [[ $READING -eq 0 && `echo $line | grep '^/'` ]]; then
983249
+    READING=1
983249
+  elif [[ $READING -eq 1 && -z "$line" ]]; then
983249
+    READING=0
983249
+    if [ $FOUND -eq 1 ]; then
983249
+      break;
983249
+    else
983249
+      rm $DEV_INFO
983249
+    fi
983249
+  fi
983249
+
983249
+  if [[ $READING -eq 1 ]]; then
983249
+    echo $line >> $DEV_INFO
983249
+  fi
983249
+
983249
+  if [[ `echo $line | grep "Device: *$HD_DEV_NAME"` ]]; then
983249
+    FOUND=1
983249
+  fi
983249
+done < $TMP_FILE
983249
+
983249
 rm -f $TMP_FILE
983249
-$BLTK_SUDO_CMD /sbin/hdparm -iI "$HD_DEV_NAME" >$TMP_FILE 2>&1
983249
 
983249
 echo "DF_NAME = $DF_NAME"
983249
 echo "DF_DEV_NAME = $DF_DEV_NAME"
983249
 echo "HD_NAME = $HD_NAME"
983249
 echo "HD_DEV_NAME = $HD_DEV_NAME"
983249
 
983249
-str=`grep '^ Model=' $TMP_FILE`
983249
-str=${str# Model=}
983249
-str=${str%%, *}
983249
-if [[ -z "$str" ]]
983249
-then
983249
-	str=`grep '^	Model Number:' $TMP_FILE`
983249
-	str=${str#*Model Number:}
983249
-	str=`echo $str`
983249
-fi
983249
-echo "HD_MODEL = $str"
983249
+echo "HD_MODEL = `grep '^Model:' $DEV_INFO | sed 's/^Model: *//'`"
983249
 
983249
-str=`grep 'device size with M = 1000' $TMP_FILE`
983249
-str=${str#*device size with M = 1000*:}
983249
-str=`echo $str`
983249
-echo "HD_SIZE = $str"
983249
+str=`grep '^Size:' $DEV_INFO | sed 's/^Size: *//'`
983249
+echo "HD_SIZE = $((str/1000000)) MBytes ($((str/1000000000)) GB)"
983249
 
983249
-rm -f $TMP_FILE
983249
+rm $DEV_INFO
983249
 
983249
 exit 0
983249
diff -up bltk-1.1.0/tools/bltk/bltk_hd_state.sh.sec_sudo bltk-1.1.0/tools/bltk/bltk_hd_state.sh
983249
diff -up bltk-1.1.0/tools/bltk/bltk_install.sh.sec_sudo bltk-1.1.0/tools/bltk/bltk_install.sh
983249
--- bltk-1.1.0/tools/bltk/bltk_install.sh.sec_sudo	2009-07-29 11:38:48.000000000 +0200
983249
+++ bltk-1.1.0/tools/bltk/bltk_install.sh	2009-12-08 14:28:23.879167455 +0100
983249
@@ -100,18 +100,6 @@ done
983249
 cd $BLTK_ROOT
983249
 [[ $? != 0 ]] && exit 1
983249
 
983249
-$BLTK_SUDO_CMD >/dev/null 2>&1
983249
-if [[ $? != 0 ]]
983249
-then
983249
-	SU=TRUE
983249
-fi
983249
-
983249
-if [[ $SU = TRUE ]]
983249
-then
983249
-	make su
983249
-	[[ $? != 0 ]] && exit 1
983249
-fi
983249
-
983249
 CWD=$PWD
983249
 
983249
 for work in $WORK
983249
diff -up bltk-1.1.0/tools/bltk/bltk_save_sys_info.sh.sec_sudo bltk-1.1.0/tools/bltk/bltk_save_sys_info.sh
983249
--- bltk-1.1.0/tools/bltk/bltk_save_sys_info.sh.sec_sudo	2009-07-29 11:38:48.000000000 +0200
983249
+++ bltk-1.1.0/tools/bltk/bltk_save_sys_info.sh	2009-12-08 14:28:23.880163066 +0100
983249
@@ -48,13 +48,6 @@ group=`id -gn`
983249
 
983249
 trap 'trap_action 1; exit 1' 1 2 3 6 15
983249
 #trap 'echo trap 11 >&2' 11
983249
-trap_action()
983249
-{
983249
-	[[ ! -a "$SAVEDIR" ]] && return
983249
-	$BLTK_SUDO_CMD chown -h -R $user:$group $SAVEDIR
983249
-	$BLTK_SUDO_CMD chmod -R a+rw $SAVEDIR
983249
-	$BLTK_SUDO_CMD rm -rf $SAVEDIR
983249
-}
983249
 
983249
 PROG=$0
983249
 
983249
@@ -102,10 +95,7 @@ SAVELIST="
983249
 
983249
 if [[ -a $SAVEDIR ]]
983249
 then
983249
-	CMD="$BLTK_SUDO_CMD chmod -R a+rw $SAVEDIR"
983249
-	$CMD
983249
-	[[ $? != 0 ]] && error "$CMD failed"
983249
-	CMD="$BLTK_SUDO_CMD rm -rf $SAVEDIR"
983249
+	CMD="rm -rf $SAVEDIR"
983249
 	$CMD
983249
 	[[ $? != 0 ]] && error "$CMD failed"
983249
 fi
983249
@@ -122,13 +112,13 @@ do
983249
 	CMD="mkdir -p -m 0777 $dstdir"
983249
 	$CMD
983249
 	[[ $? != 0 ]] && error "$CMD failed"
983249
-	CMD="$BLTK_SUDO_CMD cp -d -r $src $dst"
983249
+	CMD="cp -d -r $src $dst"
983249
 	$CMD
983249
 	[[ $? != 0 ]] && warning "$CMD failed"
983249
-	CMD="$BLTK_SUDO_CMD chown -h -R $user:$group $dst"
983249
+	CMD="chown -h -R $user:$group $dst"
983249
 	$CMD
983249
 	[[ $? != 0 ]] && warning "$CMD failed"
983249
-	CMD="$BLTK_SUDO_CMD chmod -R a+rw $dst"
983249
+	CMD="chmod -R a+rw $dst"
983249
 	$CMD
983249
 	[[ $? != 0 ]] && warning "$CMD failed"
983249
 done >>$SAVEDIR/err.log 2>&1
983249
@@ -144,21 +134,9 @@ free >$SAVEDIR/free 2>&1
983249
 df -lk >$SAVEDIR/df 2>&1
983249
 ps -lef >$SAVEDIR/ps 2>&1
983249
 ###	glxinfo >$SAVEDIR/glxinfo 2>&1
983249
-$BLTK_SUDO_CMD dmidecode >$SAVEDIR/dmidecode 2>&1
983249
 xset q >$SAVEDIR/xset 2>&1
983249
 
983249
 HDPARM=hdparm
983249
 
983249
-for h in hda hdb hdc hdd sda sdb sdc sdd
983249
-do
983249
-	grep " $h " /proc/diskstats >/dev/null 2>&1
983249
-	if [[ $? = 0 ]]
983249
-	then
983249
-		$BLTK_SUDO_CMD $HDPARM /dev/$h >$SAVEDIR/hdparm.$h 2>&1
983249
-		$BLTK_SUDO_CMD $HDPARM -iI /dev/$h >>$SAVEDIR/hdparm.$h 2>&1
983249
-		$BLTK_SUDO_CMD $HDPARM -C /dev/$h >>$SAVEDIR/hdparm.$h 2>&1
983249
-	fi
983249
-done
983249
-
983249
 exit 0
983249
 
983249
diff -up bltk-1.1.0/tools/bltk/bltk_wl_common.sh.sec_sudo bltk-1.1.0/tools/bltk/bltk_wl_common.sh
983249
--- bltk-1.1.0/tools/bltk/bltk_wl_common.sh.sec_sudo	2009-12-08 14:28:23.847162491 +0100
983249
+++ bltk-1.1.0/tools/bltk/bltk_wl_common.sh	2009-12-08 14:28:23.881171389 +0100
983249
@@ -133,7 +133,6 @@ cmd_startup()
983249
 	export BLTK_LIB=$BLTK_ROOT/lib
983249
 	export BLTK_TMP=$HOME/.bltk/tmp
983249
 
983249
-	[[ -z $BLTK_SUDO_CMD ]] && export BLTK_SUDO_CMD=$BLTK_BIN/bltk_sudo
983249
 	[[ -z $BLTK_CALC_CMD ]] && export BLTK_CALC_CMD=$BLTK_BIN/bltk_calc
983249
 	[[ -z $BLTK_TIME_CMD ]] && export BLTK_TIME_CMD=$BLTK_BIN/bltk_time
983249
 	[[ -z $BLTK_TYPE_COMMAND_CMD ]] && export BLTK_TYPE_COMMAND_CMD=$BLTK_BIN/bltk_type_command
983249
@@ -211,7 +210,6 @@ wl_startup()
983249
 
983249
 	export BLTK_WL_INSTALL_FILE=$BLTK_WL_ROOT/.installed
983249
 
983249
-	[[ -z $BLTK_SUDO_CMD ]] && export BLTK_SUDO_CMD=$BLTK_BIN/bltk_sudo
983249
 	[[ -z $BLTK_CALC_CMD ]] && export BLTK_CALC_CMD=$BLTK_BIN/bltk_calc
983249
 	[[ -z $BLTK_TIME_CMD ]] && export BLTK_TIME_CMD=$BLTK_BIN/bltk_time
983249
 	[[ -z $BLTK_TYPE_COMMAND_CMD ]] && export BLTK_TYPE_COMMAND_CMD=$BLTK_BIN/bltk_type_command
983249
@@ -540,27 +538,6 @@ wl_remove_dir()
983249
 	return 0
983249
 }
983249
 
983249
-wl_remove_dir_su()
983249
-{
983249
-	typeset	dir=$1
983249
-
983249
-	if [[ -a $dir ]]
983249
-	then
983249
-		CMD="$BLTK_SUDO_CMD rm -rf $dir"
983249
-		$CMD
983249
-		if [[ $? != 0 ]]
983249
-		then
983249
-			wl_error_msg "$CMD failed"
983249
-			wl_error_msg "Cannot remove $dir"
983249
-			return 1
983249
-		fi
983249
-	fi
983249
-#	CMD="rmdir -p `dirname $dir`"
983249
-#	$CMD >/dev/null 2>&1
983249
-#	return 0
983249
-	return 0
983249
-}
983249
-
983249
 wl_move_dir()
983249
 {
983249
 	typeset	dir1=$1
983249
diff -up bltk-1.1.0/tools/bltk/main.c.sec_sudo bltk-1.1.0/tools/bltk/main.c
983249
--- bltk-1.1.0/tools/bltk/main.c.sec_sudo	2009-12-08 14:28:23.852162407 +0100
983249
+++ bltk-1.1.0/tools/bltk/main.c	2009-12-08 14:28:23.883191456 +0100
983249
@@ -215,8 +215,6 @@ int stat_system = 0;
983249
 int comment_cnt = 0;
983249
 char *comment[MAX_LINES];
983249
 
983249
-char *bltk_sudo = "bltk_sudo_NOT_SET";
983249
-
983249
 char stop_fname[STR_LEN];
983249
 
983249
 int show_demo = 0;
983249
@@ -250,7 +248,6 @@ int debug_workload_flg = 0;
983249
 
983249
 int start_prog_flg = 0;
983249
 char *start_prog = NULL;
983249
-int start_prog_su_flg = 0;
983249
 
983249
 xtime_t arg_time = EMPTY_VALUE;
983249
 xtime_t idle_test_time = EMPTY_VALUE;
983249
@@ -946,15 +943,6 @@ static void start_warning2(void)
983249
 	write_to_stdout_work_out_log("Do NOT touch anything\n");
983249
 }
983249
 
983249
-static void pre_init_vars(void)
983249
-{
983249
-	char cmd[STR_LEN];
983249
-
983249
-	(void)sprintf(cmd, "%s modprobe cpufreq_stats >>%s 2>&1",
983249
-		      bltk_sudo, warning_log_fname);
983249
-	(void)prog_system(cmd);
983249
-}
983249
-
983249
 static int environment_init(int argc, char **argv)
983249
 {
983249
 	char cmdline[STR_LEN];
983249
@@ -1056,26 +1044,6 @@ static int environment_init(int argc, ch
983249
 	(void)sprintf(cmd, "%s >%s/cmd", cmdline, results);
983249
 	(void)prog_system(cmd);
983249
 
983249
-	(void)sprintf(str, "%s/bin/bltk_sudo", bltk_root);
983249
-	bltk_sudo = strdup(str);
983249
-	if (access(str, X_OK) != 0) {
983249
-		(void)sprintf(prt_str, "Cannot access %s\n", str);
983249
-		write_to_err_log(prt_str);
983249
-		(void)sprintf(prt_str, "Please perform 'make su' command\n");
983249
-		write_to_err_log(prt_str);
983249
-		prog_exit(1);
983249
-	}
983249
-	(void)sprintf(cmd, "%s/bin/bltk_sudo", bltk_root);
983249
-	ret = prog_system(cmd);
983249
-	if (ret != 0) {
983249
-		(void)sprintf(prt_str, "Cannot run %s\n", str);
983249
-		write_to_err_log(prt_str);
983249
-		(void)sprintf(prt_str, "Please perform 'make su' command\n");
983249
-		write_to_err_log(prt_str);
983249
-		prog_exit(1);
983249
-	}
983249
-	prog_putenv("BLTK_SUDO_CMD", str);
983249
-
983249
 	set_signal(SIGTERM);
983249
 	set_signal(SIGINT);
983249
 	set_signal(SIGQUIT);
983249
@@ -1092,8 +1060,6 @@ static int environment_init(int argc, ch
983249
 		prog_exit(1);
983249
 	}
983249
 
983249
-	pre_init_vars();
983249
-
983249
 	init_vars();
983249
 
983249
 	return (0);
983249
@@ -2021,11 +1987,6 @@ int main(int argc, char **argv)
983249
 		case 'e':
983249
 			start_prog_flg = 1;
983249
 			start_prog = optarg;
983249
-			start_prog_su_flg = 1;
983249
-			break;
983249
-		case 'E':
983249
-			start_prog_flg = 1;
983249
-			start_prog = optarg;
983249
 			break;
983249
 		case 'y':
983249
 			yes = 1;
983249
@@ -2449,11 +2410,7 @@ int main(int argc, char **argv)
983249
 	}
983249
 
983249
 	if (start_prog_flg) {
983249
-		if (start_prog_su_flg) {
983249
-			(void)sprintf(cmd, "%s '%s'", bltk_sudo, start_prog);
983249
-		} else {
983249
-			(void)sprintf(cmd, "%s", start_prog);
983249
-		}
983249
+		(void)sprintf(cmd, "%s", start_prog);
983249
 		(void)sprintf(prt_str, "Start prog %s\n", cmd);
983249
 		write_to_stdout_work_out_log(prt_str);
983249
 		ret = prog_system(cmd);
983249
diff -up bltk-1.1.0/tools/bltk/Makefile.sec_sudo bltk-1.1.0/tools/bltk/Makefile
983249
--- bltk-1.1.0/tools/bltk/Makefile.sec_sudo	2009-12-08 14:28:23.806162596 +0100
983249
+++ bltk-1.1.0/tools/bltk/Makefile	2009-12-08 14:28:23.875173697 +0100
983249
@@ -14,7 +14,7 @@ HIDERS		= ../../include/bltk.h ../../inc
983249
 TARGETS		= $(BIN)/bltk
983249
 
983249
 SHFILES		= \
983249
-		bltk_hd_state bltk_save_sys_info bltk_get_info \
983249
+		bltk_save_sys_info bltk_get_info \
983249
 		bltk_get_ac_adapter bltk_get_bat bltk_get_cpustat \
983249
 		bltk_get_cpufreq bltk_get_cpuinfo bltk_get_cpustate \
983249
 		bltk_get_dmidecode bltk_get_hdparm \
983249
diff -up bltk-1.1.0/tools/bltk/stat.c.sec_sudo bltk-1.1.0/tools/bltk/stat.c
983249
--- bltk-1.1.0/tools/bltk/stat.c.sec_sudo	2009-07-29 11:38:48.000000000 +0200
983249
+++ bltk-1.1.0/tools/bltk/stat.c	2009-12-08 14:28:23.886191838 +0100
983249
@@ -205,24 +205,6 @@ void turn_off_stat_memory(void)
983249
 	}
983249
 }
983249
 
983249
-#define	LAPTOP_MODE	"laptop_mode"
983249
-
983249
-static int laptop_mode_stop_done = 0;
983249
-
983249
-void laptop_mode_stop(void)
983249
-{
983249
-	char cmd[STR_LEN];
983249
-
983249
-	if (!stat_log_proc_flg || laptop_mode_stop_done) {
983249
-		return;
983249
-	}
983249
-
983249
-	laptop_mode_stop_done = 1;
983249
-	debug("laptop_mode_stop()");
983249
-	(void)sprintf(cmd, "%s %s >/dev/null 2>&1", bltk_sudo, LAPTOP_MODE);
983249
-	(void)prog_system(cmd);
983249
-}
983249
-
983249
 void stat_sync(char *why)
983249
 {
983249
 	debug("stat_sync() by %s", why);
983249
@@ -320,7 +302,6 @@ void check_critical_state(void)
983249
 				if (stat_memory_saved) {
983249
 					send_sighup();
983249
 				}
983249
-				laptop_mode_stop();
983249
 				if (!idle_test_mode) {
983249
 					save_sys_info_2();
983249
 				}
983249
@@ -438,34 +419,6 @@ get_percentage_delta(ll_t val_100, ll_t 
983249
 	return (ret);
983249
 }
983249
 
983249
-void hd_state(char *str)
983249
-{
983249
-	char cmd[STR_LEN];
983249
-	int ret;
983249
-
983249
-	if (hd_stat_ignore) {
983249
-		(void)sprintf(str, "  -");
983249
-		return;
983249
-	}
983249
-
983249
-	(void)sprintf(cmd, "./bin/bltk_hd_state %s >>%s 2>&1",
983249
-		      hd_dev_name, "/dev/null");
983249
-
983249
-	ret = prog_system(cmd);
983249
-	ret = WEXITSTATUS(ret);
983249
-	if (ret == 100) {
983249
-		(void)sprintf(str, "err");
983249
-	} else if (ret == 101) {
983249
-		(void)sprintf(str, "a/i");
983249
-	} else if (ret == 102) {
983249
-		(void)sprintf(str, " st");
983249
-	} else if (ret == 103) {
983249
-		(void)sprintf(str, " sl");
983249
-	} else {
983249
-		(void)sprintf(str, "err");
983249
-	}
983249
-}
983249
-
983249
 static int get_display_state(void)
983249
 {
983249
 	char cmd[STR_LEN];
983249
@@ -1129,7 +1082,7 @@ void write_report_str(char *work_type, c
983249
 	if (hd_stat_ignore == 0) {
983249
 		int del_rd = 0, del_wr = 0;
983249
 
983249
-		hd_state(shd);
983249
+		sprintf(shd, "a/i");
983249
 
983249
 		if (hd_stat_rd_wr_ignore == 0) {
983249
 			get_hd_stat(1, &c_hd_stat);
983249
diff -up bltk-1.1.0/tools/Makefile.sec_sudo bltk-1.1.0/tools/Makefile
983249
--- bltk-1.1.0/tools/Makefile.sec_sudo	2009-07-29 11:38:48.000000000 +0200
983249
+++ bltk-1.1.0/tools/Makefile	2009-12-08 14:28:23.869162456 +0100
983249
@@ -1,5 +1,5 @@
983249
 
983249
-SUBDIRS = xse bltk sudo get_realpath type_command analyzer time bat_drain
983249
+SUBDIRS = xse bltk get_realpath type_command analyzer time bat_drain
983249
 
983249
 all : FORCE
983249
 	@for dir in $(SUBDIRS); \
983249
@@ -19,8 +19,5 @@ install :
983249
 
983249
 uninstall :
983249
 
983249
-su sudo : FORCE
983249
-	$(MAKE) -C sudo
983249
-
983249
 FORCE :
983249
 
983249
diff -up bltk-1.1.0/tools/sudo/bltk_sudo.c.sec_sudo bltk-1.1.0/tools/sudo/bltk_sudo.c
983249
diff -up bltk-1.1.0/tools/sudo/Makefile.sec_sudo bltk-1.1.0/tools/sudo/Makefile
983249
diff -up bltk-1.1.0/wl_game/bltk_wl_game.sh.sec_sudo bltk-1.1.0/wl_game/bltk_wl_game.sh
983249
--- bltk-1.1.0/wl_game/bltk_wl_game.sh.sec_sudo	2009-12-08 14:28:23.797167456 +0100
983249
+++ bltk-1.1.0/wl_game/bltk_wl_game.sh	2009-12-08 14:28:23.887196668 +0100
983249
@@ -81,7 +81,7 @@ clean_gmhome()
983249
 {
983249
 	if [[ -d $GMHOME ]]
983249
 	then
983249
-		CMD="$BLTK_SUDO_CMD rm -rf $GMHOME"
983249
+		CMD="rm -rf $GMHOME"
983249
 		$CMD
983249
 		wl_check_error $? "$CMD failed"
983249
 	fi
983249
diff -up bltk-1.1.0/wl_player/bltk_wl_player.sh.sec_sudo bltk-1.1.0/wl_player/bltk_wl_player.sh
983249
--- bltk-1.1.0/wl_player/bltk_wl_player.sh.sec_sudo	2009-12-08 14:28:23.821177150 +0100
983249
+++ bltk-1.1.0/wl_player/bltk_wl_player.sh	2009-12-08 14:28:23.888191092 +0100
983249
@@ -95,27 +95,6 @@ startup()
983249
 ###	env | sort >env.log
983249
 }
983249
 
983249
-set_dvd_config()
983249
-{
983249
-	typeset dvd
983249
-
983249
-	for d in /dev/cdrom /dev/hdc /dev/hdd /dev/sr0
983249
-	do
983249
-		if [[ -a $d ]]
983249
-		then
983249
-			dvd=$d
983249
-			break
983249
-		fi
983249
-	done
983249
-
983249
-	if [[ ! -a /dev/dvd && ! -z $dvd ]]
983249
-	then
983249
-		$BLTK_SUDO_CMD ln -s $dvd /dev/dvd
983249
-		$BLTK_SUDO_CMD chmod a+r /dev/dvd
983249
-		$BLTK_SUDO_CMD hdparm -d1 /dev/dvd
983249
-	fi
983249
-}
983249
-
983249
 run1()
983249
 {
983249
 	ST_TIME=`$BLTK_TIME_CMD`
983249
diff -up bltk-1.1.0/wl_reader/bltk_wl_reader.sh.sec_sudo bltk-1.1.0/wl_reader/bltk_wl_reader.sh
983249
--- bltk-1.1.0/wl_reader/bltk_wl_reader.sh.sec_sudo	2009-12-08 14:28:23.841162495 +0100
983249
+++ bltk-1.1.0/wl_reader/bltk_wl_reader.sh	2009-12-08 14:28:23.889162188 +0100
983249
@@ -103,7 +103,7 @@ startup()
983249
 	fi
983249
 	if [[ $default_flg = TRUE ]]
983249
 	then
983249
-		CMD="$BLTK_SUDO_CMD rm -f $tmp_reader_file"
983249
+		CMD="rm -f $tmp_reader_file"
983249
 		$CMD
983249
 		wl_check_error $? "$CMD fialed"
983249