Tiny Core Linux

Tiny Core Base => TCB Talk => Topic started by: SvOlli on July 21, 2010, 01:26:37 PM

Title: slight improvement for tce-setup
Post by: SvOlli on July 21, 2010, 01:26:37 PM
Hello, I found a slight improvement for /usr/bin/tce-setup

the parsing of /proc/cmdline has some overhead. Instead of:
Code: [Select]
for i in `cat /proc/cmdline`; do
  case $i in
    *=*)
      case $i in
        tce*) TCE=${i#*=} ;;
        lst*) MYLIST=${i#*=} ;;
      esac
    ;;
  esac
done

One could go for:
Code: [Select]
for i in `cat /proc/cmdline`; do
  case $i in
    tce=*) TCE=${i#*=} ;;
    lst=*) MYLIST=${i#*=} ;;
  esac
done
Or am I missing something?
Title: Re: slight improvement for tce-setup
Post by: roberts on July 21, 2010, 05:15:56 PM
True. But what is in tce-setup is the same construct as in tc-config, and at the time, it was not determined if single boot codes , e.g., no = would be required or desired. Looking back now, it appears that no such requirement is needed so could be simplified as you suggest.