Browse Source

add cmdline compression option

examples:
-upx=-1
-UPX=-9
also usable in profiles
pull/9/head
gorgone 6 years ago
parent
commit
119527719a
  1. 18
      s3
  2. 5
      support/functions/_cmd_build
  3. 3
      support/functions/_compress
  4. 10
      support/functions/_help
  5. 3
      support/functions/_subversion

18
s3

@ -68,6 +68,7 @@ declare -a SHORT_READERS; declare -a SHORT_CARD_READERS; declare -A INTERNAL_
config_cases=( all addons protocols readers card_readers ); config_cases=( all addons protocols readers card_readers );
s3opts=( help cedit clean tccheck tcrepair upload lang_select loadonly checkout ssh_profiles syscheck sysinfo svnup menu get_patch tedit svnpatch profiles svnrestore ); # extendable with plugins s3opts=( help cedit clean tccheck tcrepair upload lang_select loadonly checkout ssh_profiles syscheck sysinfo svnup menu get_patch tedit svnpatch profiles svnrestore ); # extendable with plugins
CUSTOM_CONFDIR="not_set"; CUSTOM_CONFDIR="not_set";
UPX="not_set";
#internal vars #internal vars
OPENBOX=0;UFS916003=0;_verbose=""; OPENBOX=0;UFS916003=0;_verbose="";
@ -229,11 +230,26 @@ else
pf_name="${2#*=}"; pf_name="${2#*=}";
fi; fi;
fi; fi;
if [ "${3:0:3}" == "-p=" ] || [ "${3:0:3}" == "-P=" ];then
if [ -f "$profdir/${2#*=}" ];then
pf=$(cat "$profdir/${2#*=}");
pf_name="${2#*=}";
fi;
fi;
if [ "${2:0:5}" == "-upx=" ] || [ "${2:0:5}" == "-UPX=" ];then
UPX=${2#*=};USE_vars[USE_COMPRESS]="USE_COMPRESS=1";
fi;
if [ "${2:0:5}" == "-upx=" ] || [ "${2:0:5}" == "-UPX=" ];then
UPX=${2#*=};USE_vars[USE_COMPRESS]="USE_COMPRESS=1";
fi;
[ "$pf" == "empty" ] && c_m_d="$*" || c_m_d="all_off $pf $*"; # set only active module with profiles [ "$pf" == "empty" ] && c_m_d="$*" || c_m_d="all_off $pf $*"; # set only active module with profiles
for cmd in $c_m_d;do for cmd in $c_m_d;do
if [ "${cmd:0:3}" == "-c=" ] || [ "${cmd:0:3}" == "-C=" ];then if [ "${cmd:0:3}" == "-c=" ] || [ "${cmd:0:3}" == "-C=" ];then
CUSTOM_CONFDIR="${cmd#*=}"; CUSTOM_CONFDIR="${cmd#*=}";
fi; fi;
if [ "${cmd:0:5}" == "-upx=" ] || [ "${cmd:0:5}" == "-UPX=" ];then
UPX="${cmd#*=}";USE_vars[USE_COMPRESS]="USE_COMPRESS=1";
fi;
for cc in "${config_cases[@]}"; for cc in "${config_cases[@]}";
do do
[ "$cmd" == "$cc$on" ] && all_cc+=($cc$on) && break; [ "$cmd" == "$cc$on" ] && all_cc+=($cc$on) && break;
@ -260,7 +276,5 @@ else
fi; fi;
done; done;
_help; _help;
fi; fi;
exit; exit;

5
support/functions/_cmd_build

@ -29,7 +29,6 @@ _cmd_build(){
[ "$e" == "$d" ] && USE_vars[${e:0: -2}]=; [ "$e" == "$d" ] && USE_vars[${e:0: -2}]=;
done; done;
done; done;
_nl;
cd "$svndir"; cd "$svndir";
#make clean #make clean
@ -119,7 +118,7 @@ fi;
[ ! "$pf" == "empty" ] && echo -e "$y_l | PROFILE : $pf_name"; [ ! "$pf" == "empty" ] && echo -e "$y_l | PROFILE : $pf_name";
#echo IF SVN is Patched #echo IF SVN is Patched
[ -f "$workdir/SVN-IS-PATCHED" ] && echo -e $w_l" ISPATCHED : "$P" YES"; [ -f "$workdir/SVN-IS-PATCHED" ] && echo -e $w_l" | ISPATCHED :$P YES";
#echo max cpu usage #echo max cpu usage
if [ -f "$configdir/max_cpus" ];then if [ -f "$configdir/max_cpus" ];then
@ -198,6 +197,6 @@ fi;
#build error message #build error message
error_on_build=$(grep -c1 error "$ldir/$log_name"); error_on_build=$(grep -c1 error "$ldir/$log_name");
[ "$error_on_build" -gt "0" ] && echo -e "$r_l\terrors on build found$w_l"; [ "$error_on_build" -gt "0" ] && echo -e "$r_l\terrors on build found$w_l";
echo -e "$re_"; echo -e "$re_$w_l";
exit; exit;
}; };

3
support/functions/_compress

@ -4,10 +4,11 @@ compress_cam(){
cd "$bdir"; cd "$bdir";
upx_c="-1"; upx_c="-1";
[ -f "$configdir/upx_option" ] && source "$configdir/upx_option"; [ -f "$configdir/upx_option" ] && source "$configdir/upx_option";
[ ! "$UPX" == "not_set" ] && upx_c=$UPX;
erg=$(upx "$upx_c" "$1" |grep oscam |awk '{print $1" "$3" "$4 }'); erg=$(upx "$upx_c" "$1" |grep oscam |awk '{print $1" "$3" "$4 }');
e1="$(echo "$erg"| awk '{printf("%4.2fk\n", $1 /1024)}')"; e1="$(echo "$erg"| awk '{printf("%4.2fk\n", $1 /1024)}')";
e2="$(echo "$erg"| awk '{printf("%4.2fk\n", $2 /1024)}')"; e2="$(echo "$erg"| awk '{printf("%4.2fk\n", $2 /1024)}')";
e3="$(echo "$erg"| awk '{print $3}')"; e3="$(echo "$erg"| awk '{print $3}') (level=$upx_c)";
echo -e "$w_l\n\n BEFORE -----> $txt_compress1\t= $g_n$e1$w_l\n AFTER ------> $txt_compress2\t= $g_l$e2$w_l\n RESULT -----> $txt_compress3\t= $c_n$e3$rs_\n"; echo -e "$w_l\n\n BEFORE -----> $txt_compress1\t= $g_n$e1$w_l\n AFTER ------> $txt_compress2\t= $g_l$e2$w_l\n RESULT -----> $txt_compress3\t= $c_n$e3$rs_\n";
}; };
compress_cam_gui(){ compress_cam_gui(){

10
support/functions/_help

@ -9,6 +9,11 @@ helpline0(){
ll=0; ll=0;
echo -en " "; echo -en " ";
for s in "$@";do for s in "$@";do
if [ ! "$s" == "USE_SSL" ] \
&& [ ! "$s" == "USE_MCA" ] \
&& [ ! "$s" == "USE_LIBUSB" ] \
&& [ ! "$s" == "USE_CONFDIR" ];
then
ll=$((ll + (${#s} + 4))); ll=$((ll + (${#s} + 4)));
if [ "$ll" -lt "30" ];then if [ "$ll" -lt "30" ];then
echo -en "$s(_off) "; echo -en "$s(_off) ";
@ -16,6 +21,7 @@ helpline0(){
echo -en "$s(_off)\n "; echo -en "$s(_off)\n ";
ll=""; ll="";
fi; fi;
fi;
done; done;
}; };
helpline1(){ helpline1(){
@ -32,10 +38,10 @@ helpline1(){
done; done;
}; };
_help(){ clear;s3logo; _help(){ clear;s3logo;
echo -e " ----------------------------------"; echo -e " --------------------------------------";
echo -e " $txt_help1 $0 menu"; echo -e " $txt_help1 $0 menu";
echo -e " $txt_help2"; echo -e " $txt_help2";
echo -e " ----------------------------------"; echo -e " --------------------------------------";
echo -e "$w_l\n toolchains :\n ------------$g_n"; echo -e "$w_l\n toolchains :\n ------------$g_n";
helpline1 "${AVAI_TCLIST[@]}"; helpline1 "${AVAI_TCLIST[@]}";
echo -e "$w_l\n simplebuild options :\n ---------------------$c_n"; echo -e "$w_l\n simplebuild options :\n ---------------------$c_n";

3
support/functions/_subversion

@ -65,6 +65,9 @@ svnrestore(){
fi; fi;
untarsvn $1; untarsvn $1;
[ -f "$svndir/config.h" ]&& echo -en "$w_l"" SVN Revision : $y_l""$("$svndir/config.sh" -r) restored\n\n$re_"; [ -f "$svndir/config.h" ]&& echo -en "$w_l"" SVN Revision : $y_l""$("$svndir/config.sh" -r) restored\n\n$re_";
[ -L "$workdir/lastbuild.log" ]&& rm "$workdir/lastbuild.log";
[ -L "$workdir/lastpatch.log" ]&& rm "$workdir/lastpatch.log";
[ -f "$workdir/SVN-IS-PATCHED" ] && rm -f "$workdir/SVN-IS-PATCHED";
}; };
quicksvnrestore(){ quicksvnrestore(){
untarsvn $1; untarsvn $1;

Loading…
Cancel
Save