Vileserver
-
Posts
21 -
Joined
-
Last visited
-
Days Won
3
Posts posted by Vileserver
-
-
Thanks, John - it was actually really easy to do, USB drives show up in the DSM interface, the SATA attached drive appeared in the HDD list. Then I was able to use File Station with drag and drop.
-
11 hours ago, FOXBI said:
So, I am worried. About How to distribute in binary format ... (Actually, when I run by shell script, 5.x version also works normally.)
I will think more and make a decision.
So maybe, yet another reason to just distribute in shell script format? I think all XPEnology users are smart enough to run a script. And: less work for you, less secrecy, more compatibility with DSM versions... 😄
Thank you for all that you do.
-
You don't even need a login for a serial connection. Assuming you are using the right correction parameters, the output should just dump to your screen.
-
2 hours ago, FOXBI said:
Exactly speaking, this is encryption. It would be better to understand that you run an encrypted script in a shell environment.
OK. And you're encrypting this why, again? Because you are worried someone will steal your code?
- 1
-
4 minutes ago, FOXBI said:
Typically, shell scripts are created by defining bash, sh, or other shell environments (of course, they work with the default shell environment).
Depending on the shell defined, the source code may change (for example, ksh and bash have different ways of handling variable values in the while statement).
So what exactly are you using to make a binary executable from a shell script? I thought, if it is a proper executable then it doesn't need /bin/bash?
4 minutes ago, FOXBI said:Thank you for your feedback.
Thank you for your code
- 1
-
Also:
6 hours ago, nvrsk said:DiskStation> ./ch_cpuinfo ./ch_cpuinfo: No such file or directory: /bin/bash DiskStation> ls -lrt -rwx------ 1 admin users 852 Sep 14 14:14 synosyslog -rwxr-xr-x 1 root root 33552 Oct 30 08:14 ch_cpuinfo -rwxr-xr-x 1 root root 562 Nov 3 16:34 vpn.reconnect DiskStation> uname -a Linux DiskStation 3.10.35 #1 SMP Sun Jul 17 16:02:22 CEST 2016 x86_64 GNU/Linux synology_bromolow_3615xs
Why does a compile script need to find the bash executable?
I thought FOXBI was using the compile to make it easier to run...
I still think source script (.sh) is easier, and better for sharing. Open source XPEnology 😍
- 1
-
1 hour ago, nvrsk said:
DiskStation> ./ch_cpuinfo ./ch_cpuinfo: No such file or directory: /bin/bash DiskStation> ls -lrt -rwx------ 1 admin users 852 Sep 14 14:14 synosyslog -rwxr-xr-x 1 root root 33552 Oct 30 08:14 ch_cpuinfo -rwxr-xr-x 1 root root 562 Nov 3 16:34 vpn.reconnect DiskStation> uname -a Linux DiskStation 3.10.35 #1 SMP Sun Jul 17 16:02:22 CEST 2016 x86_64 GNU/Linux synology_bromolow_3615xs
am I doing smth wrong, or the latest ch_cpuinfo ver 5.0 works just for 6.x?
Are you running as root?
- 1
-
Hi, I'm trying to connect to my bare metal XPenology box (Intel C236 board) via the serial port. I'm hooking it up to my PC's COM1. I am using a null modem cable, which is correct, right? I am connecting with PuTTY using the recommended settings. But when I reboot I only get garbage showing up in the console:
▒▒▒
Using Jun's loader, version 1.03b. Everything comes up fine, I'm just wondering why the serial output isn't working. Has anyone managed to get it running in a similar setup?
-
Thank you FOXBI. As always, I am looking forward to the bash source of your script! 😃
- 1
-
6 hours ago, FOXBI said:
It is not a difficult part because it is produced through the values collected by the following five variables.
cat /proc/cpuinfo | grep "processor" | sort -u | wc -l cat /proc/cpuinfo | grep "physical id" | sort -u | wc -l cat /proc/cpuinfo | grep "core id" | sort -u | wc -l cat /proc/cpuinfo | grep "siblings" | sort -u | awk '{print $NF}' cat /proc/cpuinfo | grep "cpu cores" | sort -u | awk '{print $NF}'
You can actually get the number of CPU cores in just one line, like this:
grep '^cpu cores' /proc/cpuinfo | uniq | awk '{print $4}'
This works for CPUs that have hyper-threading.
There are some more interesting methods discussed here: http://stackoverflow.com/questions/6481005/how-to-obtain-the-number-of-cpus-cores-in-linux-from-the-command-line
- 1
-
9 hours ago, FOXBI said:
I uploaded a new version file that change to core information collection method. It's possible to use !!
Fantastic! Thanks FOXBI.
Any chance you can also post the shell script? I think most users here prefer the bash source.
Thanks 😊
- 1
-
OK, here is a slightly updated version, I call it 4.01.
Fixes:
- improve CPU core determination
- fix color output
- fix typos
Thanks again to FOXBI for this great script! I hope you don't mind me making some small changes to it.
gericb, does this work for you?
Spoiler#!/bin/bash # ver 4.01 2018.10.28 Made by Vileserver (fix CPU core determination) # ver 4.0 2018.09.13 Made by FOXBI # ver 3.0 2018.08.24 Made by FOXBI # Ver 1.5 2018.08.23 Made by FOXBI # Ver 1.1 2018.08.22 Made by FOXBI # Ver 1.0 2018.08.17 Made by FOXBI ver="4.01" # ============================================================================== # Y or N Function # ============================================================================== READ_YN () { # $1:question $2:default read -n1 -p "$1" Y_N case "$Y_N" in y) Y_N="y" echo -e "\n" ;; n) Y_N="n" echo -e "\n" ;; q) echo -e "\n" exit 0 ;; *) echo -e "\n" ;; esac } # ============================================================================== # Process Function # ============================================================================== PREPARE_FN () { if [ -f "$WORK_DIR/admin_center.js" ] && [ -f "$MWORK_DIR/mobile.js" ] then if [ "$direct_job" == "y" ] then echo "warning!! Work directly on the original file without backup.\n" else cd $WORK_DIR tar -cf $BKUP_DIR/$TIME/admin_center.tar admin_center.js* cd $MWORK_DIR tar -cf $BKUP_DIR/$TIME/mobile.tar mobile.js* fi if [ "$MA_VER" -eq "6" ] && [ "$MI_VER" -ge "2" ] then mv $WORK_DIR/admin_center.js.gz $BKUP_DIR/ mv $MWORK_DIR/mobile.js.gz $BKUP_DIR/ cd $BKUP_DIR/ gzip -df $BKUP_DIR/admin_center.js.gz gzip -df $BKUP_DIR/mobile.js.gz else cp -Rf $WORK_DIR/admin_center.js $BKUP_DIR/ cp -Rf $MWORK_DIR/mobile.js $BKUP_DIR/ fi else COMMENT08_FN fi } GATHER_FN () { DMI_CHK=`dmidecode | grep 'SMBIOS' | egrep 'NO|sorry' | wc -l` if [ "$DMI_CHK" -gt "0" ] then cpu_vendor=`cat /proc/cpuinfo | grep model | grep name | sort -u | sed "s/(.)//g" | sed "s/(..)//g" | sed "s/CPU//g" | awk '{print $4}'` if [ "$cpu_vendor" == "AMD" ] then cpu_family=`cat /proc/cpuinfo | grep model | grep name | sort -u | sed "s/(.)//g" | sed "s/(..)//g" | sed "s/CPU//g" | awk -F "$cpu_vendor " '{ print $2 }' | awk -F "Processor" '{ print $1 }'` cpu_series="" else cpu_family=`cat /proc/cpuinfo | grep model | grep name | sort -u | sed "s/(.)//g" | sed "s/(..)//g" | sed "s/CPU//g" | awk '{print $5}'` cpu_series=`cat /proc/cpuinfo | grep model | grep name | sort -u | sed "s/(.)//g" | sed "s/(..)//g" | sed "s/CPU//g" | awk '{ if (index($7,"@")!=0) { print $6 } else { print $6" "$7 } }'` fi else cpu_vendor=`dmidecode -t processor | grep Version | grep -v Unknown | grep -v Not | sort -u | sed "s/(.)//g" | sed "s/(..)//g" | sed "s/CPU//g" | awk '{print $2}'` if [ "$cpu_vendor" == "AMD" ] then cpu_family=`dmidecode -t processor | grep Version | grep -v Unknown | grep -v Not | sort -u | sed "s/(.)//g" | sed "s/(..)//g" | sed "s/CPU//g" | awk -F "$cpu_vendor " '{ print $2 }' | awk -F "Processor" '{ print $1 }'` cpu_series="" else cpu_family=`dmidecode -t processor | grep Version | grep -v Unknown | grep -v Not | sort -u | sed "s/(.)//g" | sed "s/(..)//g" | sed "s/CPU//g" | awk '{print $3}'` cpu_series=`dmidecode -t processor | grep Version | grep -v Unknown | grep -v Not | sort -u | sed "s/(.)//g" | sed "s/(..)//g" | sed "s/CPU//g" | awk '{ if (index($5,"@")!=0) { print $4 } else { print $4" "$5 } }'` fi fi cpu_cores=`grep '^cpu cores' /proc/cpuinfo | uniq | awk '{print $4}'` } PERFORM_FN () { if [ -f "$BKUP_DIR/admin_center.js" ] && [ -f "$BKUP_DIR/mobile.js" ] then if [ "$MA_VER" -ge "6" ] then cpu_info=`echo "f.cpu_vendor=\"${cpu_vendor}\";f.cpu_family=\"${cpu_family}\";f.cpu_series=\"${cpu_series}\";f.cpu_cores=\"${cpu_cores}\";"` sed -i "s/f.model]);/f.model]);${cpu_info}/g" $BKUP_DIR/admin_center.js cpu_info_m=`echo "{name: \"cpu_series\",renderer: function(value){var cpu_vendor=\"${cpu_vendor}\";var cpu_family=\"${cpu_family}\";var cpu_series=\"${cpu_series}\";var cpu_cores=\"${cpu_cores}\";return Ext.String.format('{0} {1} {2} ({3}Core)', cpu_vendor, cpu_family, cpu_series, cpu_cores);},label: _T(\"status\", \"cpu_model_name\")},"` sed -i "s/\"ds_model\")},/\"ds_model\")},${cpu_info_m}/g" $BKUP_DIR/mobile.js else if [ "$MI_VER" -gt "0" ] then cpu_info=`echo "b.cpu_vendor=\"${cpu_vendor}\";b.cpu_family=\"${cpu_family}\";b.cpu_series=\"${cpu_series}\";b.cpu_cores=\"${cpu_cores}\";"` else cpu_info=`echo "b.cpu_vendor=\"${cpu_vendor}\";b.cpu_family=\"${cpu_family} ${cpu_series}\";b.cpu_cores=\"${cpu_cores}\";"` fi sed -i "s/b.model]);/b.model]);${cpu_info}/g" $BKUP_DIR/admin_center.js fi else COMMENT08_FN fi } APPLY_FN () { if [ -f "$BKUP_DIR/admin_center.js" ] && [ -f "$BKUP_DIR/mobile.js" ] then cp -Rf $BKUP_DIR/admin_center.js $WORK_DIR/ cp -Rf $BKUP_DIR/mobile.js $MWORK_DIR/ if [ "$MA_VER" -eq "6" ] && [ "$MI_VER" -ge "2" ] then gzip -f $BKUP_DIR/admin_center.js gzip -f $BKUP_DIR/mobile.js mv $BKUP_DIR/admin_center.js.gz $WORK_DIR/ mv $BKUP_DIR/mobile.js.gz $MWORK_DIR/ else rm -rf $BKUP_DIR/admin_center.js rm -rf $BKUP_DIR/mobile.js fi else COMMENT08_FN fi } RECOVER_FN () { if [ -d "$BKUP_DIR/$TIME" ] then cd $WORK_DIR tar -xf $BKUP_DIR/$TIME/admin_center.tar if [ -f "$BKUP_DIR/$TIME/mobile.tar" ] then cd $MWORK_DIR tar -xf $BKUP_DIR/$TIME/mobile.tar fi if [ "$re_check" == "y" ] then echo -e "Restore to source and continue.\n" else COMMENT09_FN fi else COMMENT08_FN fi } RERUN_FN () { if [ "$1" == "redo" ] then ls -l $BKUP_DIR/ | grep ^d | grep -v "$BL_CHK" | awk '{print "rm -rf '$BKUP_DIR'/"$9}' | sh GATHER_FN if [ -f "$WORK_DIR/admin_center.js" ] && [ -f "$MWORK_DIR/mobile.js" ] then info_cnt=`cat $WORK_DIR/admin_center.js | grep ".model]);if(Ext.isDefined" | wc -l` info_cnt_m=`cat $MWORK_DIR/mobile.js | grep "ds_model\")},{name:\"ram_size" | wc -l` if [ "$info_cnt" -eq "0" ] && [ "$info_cnt_m" -eq "0" ] then if [ "$MA_VER" -ge "6" ] then cpu_info="f.cpu_vendor=\\\"${cpu_vendor}\\\";f.cpu_family=\\\"${cpu_family}\\\";f.cpu_series=\\\"${cpu_series}\\\";f.cpu_cores=\\\"${cpu_cores}\\\";" sed -i "s/${cpu_info}//g" $WORK_DIR/admin_center.js cpu_info_m="{name: \\\"cpu_series\\\",renderer: function(value){var cpu_vendor=\\\"${cpu_vendor}\\\";var cpu_family=\\\"${cpu_family}\\\";var cpu_series=\\\"${cpu_series}\\\";var cpu_cores=\\\"${cpu_cores}\\\";return Ext.String.format('{0} {1} {2} ({3}Core)', cpu_vendor, cpu_family, cpu_series, cpu_cores);},label: _T(\\\"status\\\", \\\"cpu_model_name\\\")}," sed -i "s/${cpu_info_m}//g" $MWORK_DIR/mobile.js if [ "$MI_VER" -ge "2" ] then cp -Rf $WORK_DIR/admin_center.js $WORK_DIR/admin_center.js.1 cp -Rf $MWORK_DIR/mobile.js $MWORK_DIR/mobile.js.1 gzip -f $WORK_DIR/admin_center.js gzip -f $MWORK_DIR/mobile.js mv $WORK_DIR/admin_center.js.1 $WORK_DIR/admin_center.js mv $MWORK_DIR/mobile.js.1 $MWORK_DIR/mobile.js fi else if [ "$MI_VER" -gt "0" ] then cpu_info="b.cpu_vendor=\\\"${cpu_vendor}\\\";b.cpu_family=\\\"${cpu_family}\\\";b.cpu_series=\\\"${cpu_series}\\\";b.cpu_cores=\\\"${cpu_cores}\\\";" else cpu_info="b.cpu_vendor=\\\"${cpu_vendor}\\\";b.cpu_family=\\\"${cpu_family} ${cpu_series}\\\";b.cpu_cores=\\\"${cpu_cores}\\\";" fi sed -i "s/${cpu_info}//g" $WORK_DIR/admin_center.js fi fi else COMMENT08_FN fi fi } BLCHECK_FN () { bl_check=n if [ -d "$BKUP_DIR" ] then BK_CNT=`ls -l $BKUP_DIR/ | grep ^d | wc -l` if [ "$BK_CNT" -gt "0" ] then BK_CNT=`ls -l $BKUP_DIR/ | grep ^d | grep "$BL_CHK" | wc -l` if [ "$BK_CNT" -gt "0" ] then TIME=`ls -l $BKUP_DIR/ | grep ^d | grep "$BL_CHK" | awk '{print $9}' | head -1` BK_CNT=`ls -l $BKUP_DIR/ | grep ^d | grep -v "$BL_CHK" | wc -l` if [ "$BK_CNT" -gt "0" ] then BLSUB_FN "$1" else if [ "$re_check" == "n" ] then if [ "$1" == "run" ] then COMMENT03_FN fi COMMENT05_FN else STIME=`ls -l $BKUP_DIR/ | grep ^d | awk '{print $9}' | head -1` BLSUB_FN "redo" fi fi else if [ "$1" == "restore" ] then COMMENT07_FN fi BK_CNT=`ls -l $BKUP_DIR/ | grep ^d | grep -v "$BL_CHK" | wc -l` if [ "$BK_CNT" -gt "0" ] then BL_COM=`ls -l $BKUP_DIR/ | grep ^d | awk '{print $9}' | head -1 | awk -F_ '{print $2}'` BL_CNT=`ls -l $BKUP_DIR/ | grep ^d | awk '{print $9}' | head -1 | awk -F_ '{print $2}' | wc -l` if [ "$BL_COM" == "" ] then if [ "$BL_CNT" -gt "0" ] then BLSUB_FN "$1" bl_check=y else COMMENT06_FN fi else TIME=`ls -l $BKUP_DIR/ | grep ^d | awk '{print $9}' | head -1` if [ "$BL_CHK" == "$BL_COM" ] then if [ "$1" == "run" ] then COMMENT03_FN else COMMENT05_FN bl_check=n fi else if [ "$BL_CHK" -gt "$BL_COM" ] then BLSUB_FN "$1" bl_check=y else COMMENT06_FN fi fi fi else COMMENT06_FN fi fi else CASE_FN "$1" fi else CASE_FN "$1" fi } BLSUB_FN () { TIME=`echo "$STIME"` if [ "$1" == "run" ] then RERUN_FN "redo" else RERUN_FN "$1" fi COMMENT05_FN } CASE_FN () { case "$1" in run) COMMENT05_FN ;; redo) COMMENT07_FN ;; restore) COMMENT07_FN ;; *) COMMENT06_FN ;; esac } EXEC_FN () { if [ -d $WORK_DIR ] then READ_YN "Auto Execute, If you select n, proceed interactively (Cancel : q) [y/n] : " if [ "$Y_N" == "y" ] then mkdir -p $BKUP_DIR/$TIME if [ "$re_check" == "y" ] then if [ "$bl_check" == "y" ] then COMMENT04_FN else RECOVER_FN fi fi PREPARE_FN GATHER_FN PERFORM_FN APPLY_FN COMMENT09_FN elif [ "$Y_N" == "n" ] then READ_YN "Proceed with original file backup and preparation.. If you select n, Work directly on the original file. (Cancel : q) [y/n] : " if [ "$Y_N" == "y" ] then mkdir -p $BKUP_DIR/$TIME if [ "$re_check" == "y" ] then if [ "$bl_check" == "y" ] then COMMENT04_FN else RECOVER_FN fi fi PREPARE_FN elif [ "$Y_N" == "n" ] then direct_job=y mkdir -p $BKUP_DIR PREPARE_FN else COMMENT10_FN fi READ_YN "CPU name, Core count and reflects it. If you select n, Restore original file (Cancel : q) [y/n] : " if [ "$Y_N" == "y" ] then GATHER_FN PERFORM_FN APPLY_FN COMMENT09_FN elif [ "$Y_N" == "n" ] then if [ -d "$BKUP_DIR" ] then gzip $BKUP_DIR/admin_center.js gzip $BKUP_DIR/mobile.js mv $BKUP_DIR/admin_center.js.gz $WORK_DIR/ mv $BKUP_DIR/mobile.js.gz $MWORK_DIR/ COMMENT09_FN else COMMENT07_FN fi else COMMENT10_FN fi else COMMENT10_FN fi else COMMENT08_FN fi } COMMENT03_FN () { echo -e "There is a history of running the same version. Please run again select 2) redo .\n" exit 0 } COMMENT04_FN () { echo -e "Do not restore to source when installing a higher version. Continue...\n" } COMMENT05_FN () { echo -e "You have verified and installed the previous version. Continue...\n" } COMMENT06_FN () { echo -e "Problem and exit. Please run again after checking." exit 0 } COMMENT07_FN () { echo -e "No execution history. Please go back to the first run." exit 0 } COMMENT08_FN () { echo -e "The target file(location) does not exist. Please run again after checking." exit 0 } COMMENT09_FN () { echo -e "The operation is complete!! It takes about 1-2 minutes to reflect, \n(Please refresh the DSM page with F5 or after logout/login and check the information.)" exit 0 } COMMENT10_FN () { echo -e "Only y / n / q can be input. Please proceed again." exit 0 } # ============================================================================== # Main Progress # ============================================================================== clear WORK_DIR="/usr/syno/synoman/webman/modules/AdminCenter" MWORK_DIR="/usr/syno/synoman/mobile/ui" BKUP_DIR="/root/Xpenology_backup" VER_DIR="/etc.default" echo -e "DSM CPU Information Change Tool ver. \033[0;31m"$ver"\033[00m - made by FOXBI\n" if [ -d "$VER_DIR" ] then VER_FIL="$VER_DIR/VERSION" else VER_FIL="/etc/VERSION" fi if [ -f "$VER_FIL" ] then MA_VER=`cat $VER_FIL | grep majorversion | awk -F \= '{print $2}' | sed 's/\"//g'` MI_VER=`cat $VER_FIL | grep minorversion | awk -F \= '{print $2}' | sed 's/\"//g'` BL_NUM=`cat $VER_FIL | grep buildnumber | awk -F \= '{print $2}' | sed 's/\"//g'` BL_FIX=`cat $VER_FIL | grep smallfixnumber | awk -F \= '{print $2}' | sed 's/\"//g'` else COMMENT08_FN fi BL_CHK=$BL_NUM$BL_FIX TIME=`date +%Y%m%d%H%M%S`"_"$BL_CHK STIME=`echo "$TIME"` if [ "$MA_VER" -gt "4" ] then if [ "$MA_VER" -eq "5" ] then MWORK_DIR="/usr/syno/synoman/webman/mapp" fi echo -e "Your version of DSM is \033[0;36mDSM \033[0;31m"$MA_VER"."$MI_VER"\033[0;32m continue...\033[00m\n" else echo "DSM version less than 5 is not supported. End the process." exit 0 fi read -n1 -p "1) First run 2) Redo 3) Restore - Select Number : " inst_z case "$inst_z" in 1) inst_check=run echo -e "\n " ;; 2) inst_check=redo echo -e "\n " ;; 3) inst_check=restore echo -e "\n " ;; *) echo -e "\n" ;; esac if [ "$inst_check" == "redo" ] then READ_YN "Do you want to proceed again? Restore to original file backup and proceed.(Cancel : q) [y/n] : " if [ "$Y_N" == "y" ] then re_check=y BLCHECK_FN "$inst_check" inst_check=run EXEC_FN elif [ "$Y_N" == "n" ] then echo "Do not proceed with the redo." else COMMENT10_FN fi elif [ "$inst_check" == "restore" ] then READ_YN "Do you want to restore using the original backup file? (Cancel : q) [y/n] : " if [ "$Y_N" == "y" ] then re_check=n BLCHECK_FN "$inst_check" RECOVER_FN elif [ "$Y_N" == "n" ] then echo "No restore was performed." else COMMENT10_FN fi elif [ "$inst_check" == "run" ] then re_check=n BLCHECK_FN "$inst_check" EXEC_FN else echo "Please select the correct number." fi
- 1
-
2 hours ago, gericb said:
That's exactly what I was trying to share in my earlier post, if just based on the numbers alone....don't know if it's displaying based on Hyper-Threading capable. 🤔
Before I ran FOXBI's script, the specs said 4 cores for Xeon D-1527, which is the CPU in the DS3617xs:
Note this is the number of cores, NOT threads which would be 8 for this CPU! Check Intel's datasheet here.
So DSM is always meant to show physical cores, not logical ones. Therefore this is a small bug in the script....
- 1
- 1
-
On 9/16/2018 at 5:23 PM, FOXBI said:
I am not a professional developer
I am a bit embarrassed every time I release the source ,,
Please see below.
#!/bin/bash # ver 4.0 2018.09.13 Made by FOXBI # ver 3.0 2018.08.24 Made by FOXBI # Ver 1.5 2018.08.23 Made by FOXBI # Ver 1.1 2018.08.22 Made by FOXBI # Ver 1.0 2018.08.17 Made by FOXBI ver="4.0" # ============================================================================== # Y or N Function # ============================================================================== READ_YN () { # $1:question $2:default read -n1 -p "$1" Y_N case "$Y_N" in y) Y_N="y" echo -e "\n" ;; n) Y_N="n" echo -e "\n" ;; q) echo -e "\n" exit 0 ;; *) echo -e "\n" ;; esac } # ============================================================================== # Process Function # ============================================================================== PREPARE_FN () { if [ -f "$WORK_DIR/admin_center.js" ] && [ -f "$MWORK_DIR/mobile.js" ] then if [ "$direct_job" == "y" ] then echo "warning!! Work directly on the original file without backup.\n" else cd $WORK_DIR tar -cf $BKUP_DIR/$TIME/admin_center.tar admin_center.js* cd $MWORK_DIR tar -cf $BKUP_DIR/$TIME/mobile.tar mobile.js* fi if [ "$MA_VER" -eq "6" ] && [ "$MI_VER" -ge "2" ] then mv $WORK_DIR/admin_center.js.gz $BKUP_DIR/ mv $MWORK_DIR/mobile.js.gz $BKUP_DIR/ cd $BKUP_DIR/ gzip -df $BKUP_DIR/admin_center.js.gz gzip -df $BKUP_DIR/mobile.js.gz else cp -Rf $WORK_DIR/admin_center.js $BKUP_DIR/ cp -Rf $MWORK_DIR/mobile.js $BKUP_DIR/ fi else COMMENT08_FN fi } GATHER_FN () { DMI_CHK=`dmidecode | grep 'SMBIOS' | egrep 'NO|sorry' | wc -l` if [ "$DMI_CHK" -gt "0" ] then cpu_vendor=`cat /proc/cpuinfo | grep model | grep name | sort -u | sed "s/(.)//g" | sed "s/(..)//g" | sed "s/CPU//g" | awk '{print $4}'` if [ "$cpu_vendor" == "AMD" ] then cpu_family=`cat /proc/cpuinfo | grep model | grep name | sort -u | sed "s/(.)//g" | sed "s/(..)//g" | sed "s/CPU//g" | awk -F "$cpu_vendor " '{ print $2 }' | awk -F "Processor" '{ print $1 }'` cpu_series="" else cpu_family=`cat /proc/cpuinfo | grep model | grep name | sort -u | sed "s/(.)//g" | sed "s/(..)//g" | sed "s/CPU//g" | awk '{print $5}'` cpu_series=`cat /proc/cpuinfo | grep model | grep name | sort -u | sed "s/(.)//g" | sed "s/(..)//g" | sed "s/CPU//g" | awk '{ if (index($7,"@")!=0) { print $6 } else { print $6" "$7 } }'` fi else cpu_vendor=`dmidecode -t processor | grep Version | grep -v Unknown | grep -v Not | sort -u | sed "s/(.)//g" | sed "s/(..)//g" | sed "s/CPU//g" | awk '{print $2}'` if [ "$cpu_vendor" == "AMD" ] then cpu_family=`dmidecode -t processor | grep Version | grep -v Unknown | grep -v Not | sort -u | sed "s/(.)//g" | sed "s/(..)//g" | sed "s/CPU//g" | awk -F "$cpu_vendor " '{ print $2 }' | awk -F "Processor" '{ print $1 }'` cpu_series="" else cpu_family=`dmidecode -t processor | grep Version | grep -v Unknown | grep -v Not | sort -u | sed "s/(.)//g" | sed "s/(..)//g" | sed "s/CPU//g" | awk '{print $3}'` cpu_series=`dmidecode -t processor | grep Version | grep -v Unknown | grep -v Not | sort -u | sed "s/(.)//g" | sed "s/(..)//g" | sed "s/CPU//g" | awk '{ if (index($5,"@")!=0) { print $4 } else { print $4" "$5 } }'` fi fi cpu_cores=`cat /proc/cpuinfo | grep processor| wc -l` } PERFORM_FN () { if [ -f "$BKUP_DIR/admin_center.js" ] && [ -f "$BKUP_DIR/mobile.js" ] then if [ "$MA_VER" -ge "6" ] then cpu_info=`echo "f.cpu_vendor=\"${cpu_vendor}\";f.cpu_family=\"${cpu_family}\";f.cpu_series=\"${cpu_series}\";f.cpu_cores=\"${cpu_cores}\";"` sed -i "s/f.model]);/f.model]);${cpu_info}/g" $BKUP_DIR/admin_center.js cpu_info_m=`echo "{name: \"cpu_series\",renderer: function(value){var cpu_vendor=\"${cpu_vendor}\";var cpu_family=\"${cpu_family}\";var cpu_series=\"${cpu_series}\";var cpu_cores=\"${cpu_cores}\";return Ext.String.format('{0} {1} {2} ({3}Core)', cpu_vendor, cpu_family, cpu_series, cpu_cores);},label: _T(\"status\", \"cpu_model_name\")},"` sed -i "s/\"ds_model\")},/\"ds_model\")},${cpu_info_m}/g" $BKUP_DIR/mobile.js else if [ "$MI_VER" -gt "0" ] then cpu_info=`echo "b.cpu_vendor=\"${cpu_vendor}\";b.cpu_family=\"${cpu_family}\";b.cpu_series=\"${cpu_series}\";b.cpu_cores=\"${cpu_cores}\";"` else cpu_info=`echo "b.cpu_vendor=\"${cpu_vendor}\";b.cpu_family=\"${cpu_family} ${cpu_series}\";b.cpu_cores=\"${cpu_cores}\";"` fi sed -i "s/b.model]);/b.model]);${cpu_info}/g" $BKUP_DIR/admin_center.js fi else COMMENT08_FN fi } APPLY_FN () { if [ -f "$BKUP_DIR/admin_center.js" ] && [ -f "$BKUP_DIR/mobile.js" ] then cp -Rf $BKUP_DIR/admin_center.js $WORK_DIR/ cp -Rf $BKUP_DIR/mobile.js $MWORK_DIR/ if [ "$MA_VER" -eq "6" ] && [ "$MI_VER" -ge "2" ] then gzip -f $BKUP_DIR/admin_center.js gzip -f $BKUP_DIR/mobile.js mv $BKUP_DIR/admin_center.js.gz $WORK_DIR/ mv $BKUP_DIR/mobile.js.gz $MWORK_DIR/ else rm -rf $BKUP_DIR/admin_center.js rm -rf $BKUP_DIR/mobile.js fi else COMMENT08_FN fi } RECOVER_FN () { if [ -d "$BKUP_DIR/$TIME" ] then cd $WORK_DIR tar -xf $BKUP_DIR/$TIME/admin_center.tar if [ -f "$BKUP_DIR/$TIME/mobile.tar" ] then cd $MWORK_DIR tar -xf $BKUP_DIR/$TIME/mobile.tar fi if [ "$re_check" == "y" ] then echo -e "Restore to source and continue.\n" else COMMENT09_FN fi else COMMENT08_FN fi } RERUN_FN () { if [ "$1" == "redo" ] then ls -l $BKUP_DIR/ | grep ^d | grep -v "$BL_CHK" | awk '{print "rm -rf '$BKUP_DIR'/"$9}' | sh GATHER_FN if [ -f "$WORK_DIR/admin_center.js" ] && [ -f "$MWORK_DIR/mobile.js" ] then info_cnt=`cat $WORK_DIR/admin_center.js | grep ".model]);if(Ext.isDefined" | wc -l` info_cnt_m=`cat $MWORK_DIR/mobile.js | grep "ds_model\")},{name:\"ram_size" | wc -l` if [ "$info_cnt" -eq "0" ] && [ "$info_cnt_m" -eq "0" ] then if [ "$MA_VER" -ge "6" ] then cpu_info="f.cpu_vendor=\\\"${cpu_vendor}\\\";f.cpu_family=\\\"${cpu_family}\\\";f.cpu_series=\\\"${cpu_series}\\\";f.cpu_cores=\\\"${cpu_cores}\\\";" sed -i "s/${cpu_info}//g" $WORK_DIR/admin_center.js cpu_info_m="{name: \\\"cpu_series\\\",renderer: function(value){var cpu_vendor=\\\"${cpu_vendor}\\\";var cpu_family=\\\"${cpu_family}\\\";var cpu_series=\\\"${cpu_series}\\\";var cpu_cores=\\\"${cpu_cores}\\\";return Ext.String.format('{0} {1} {2} ({3}Core)', cpu_vendor, cpu_family, cpu_series, cpu_cores);},label: _T(\\\"status\\\", \\\"cpu_model_name\\\")}," sed -i "s/${cpu_info_m}//g" $MWORK_DIR/mobile.js if [ "$MI_VER" -ge "2" ] then cp -Rf $WORK_DIR/admin_center.js $WORK_DIR/admin_center.js.1 cp -Rf $MWORK_DIR/mobile.js $MWORK_DIR/mobile.js.1 gzip -f $WORK_DIR/admin_center.js gzip -f $MWORK_DIR/mobile.js mv $WORK_DIR/admin_center.js.1 $WORK_DIR/admin_center.js mv $MWORK_DIR/mobile.js.1 $MWORK_DIR/mobile.js fi else if [ "$MI_VER" -gt "0" ] then cpu_info="b.cpu_vendor=\\\"${cpu_vendor}\\\";b.cpu_family=\\\"${cpu_family}\\\";b.cpu_series=\\\"${cpu_series}\\\";b.cpu_cores=\\\"${cpu_cores}\\\";" else cpu_info="b.cpu_vendor=\\\"${cpu_vendor}\\\";b.cpu_family=\\\"${cpu_family} ${cpu_series}\\\";b.cpu_cores=\\\"${cpu_cores}\\\";" fi sed -i "s/${cpu_info}//g" $WORK_DIR/admin_center.js fi fi else COMMENT08_FN fi fi } BLCHECK_FN () { bl_check=n if [ -d "$BKUP_DIR" ] then BK_CNT=`ls -l $BKUP_DIR/ | grep ^d | wc -l` if [ "$BK_CNT" -gt "0" ] then BK_CNT=`ls -l $BKUP_DIR/ | grep ^d | grep "$BL_CHK" | wc -l` if [ "$BK_CNT" -gt "0" ] then TIME=`ls -l $BKUP_DIR/ | grep ^d | grep "$BL_CHK" | awk '{print $9}' | head -1` BK_CNT=`ls -l $BKUP_DIR/ | grep ^d | grep -v "$BL_CHK" | wc -l` if [ "$BK_CNT" -gt "0" ] then BLSUB_FN "$1" else if [ "$re_check" == "n" ] then if [ "$1" == "run" ] then COMMENT03_FN fi COMMENT05_FN else STIME=`ls -l $BKUP_DIR/ | grep ^d | awk '{print $9}' | head -1` BLSUB_FN "redo" fi fi else if [ "$1" == "restore" ] then COMMENT07_FN fi BK_CNT=`ls -l $BKUP_DIR/ | grep ^d | grep -v "$BL_CHK" | wc -l` if [ "$BK_CNT" -gt "0" ] then BL_COM=`ls -l $BKUP_DIR/ | grep ^d | awk '{print $9}' | head -1 | awk -F_ '{print $2}'` BL_CNT=`ls -l $BKUP_DIR/ | grep ^d | awk '{print $9}' | head -1 | awk -F_ '{print $2}' | wc -l` if [ "$BL_COM" == "" ] then if [ "$BL_CNT" -gt "0" ] then BLSUB_FN "$1" bl_check=y else COMMENT06_FN fi else TIME=`ls -l $BKUP_DIR/ | grep ^d | awk '{print $9}' | head -1` if [ "$BL_CHK" == "$BL_COM" ] then if [ "$1" == "run" ] then COMMENT03_FN else COMMENT05_FN bl_check=n fi else if [ "$BL_CHK" -gt "$BL_COM" ] then BLSUB_FN "$1" bl_check=y else COMMENT06_FN fi fi fi else COMMENT06_FN fi fi else CASE_FN "$1" fi else CASE_FN "$1" fi } BLSUB_FN () { TIME=`echo "$STIME"` if [ "$1" == "run" ] then RERUN_FN "redo" else RERUN_FN "$1" fi COMMENT05_FN } CASE_FN () { case "$1" in run) COMMENT05_FN ;; redo) COMMENT07_FN ;; restore) COMMENT07_FN ;; *) COMMENT06_FN ;; esac } EXEC_FN () { if [ -d $WORK_DIR ] then READ_YN "Auto Excute, If you select n, proceed interactively (Cancel : q) [y/n] : " if [ "$Y_N" == "y" ] then mkdir -p $BKUP_DIR/$TIME if [ "$re_check" == "y" ] then if [ "$bl_check" == "y" ] then COMMENT04_FN else RECOVER_FN fi fi PREPARE_FN GATHER_FN PERFORM_FN APPLY_FN COMMENT09_FN elif [ "$Y_N" == "n" ] then READ_YN "Proceed with original file backup and preparation.. If you select n, Work directly on the original file. (Cancel : q) [y/n] : " if [ "$Y_N" == "y" ] then mkdir -p $BKUP_DIR/$TIME if [ "$re_check" == "y" ] then if [ "$bl_check" == "y" ] then COMMENT04_FN else RECOVER_FN fi fi PREPARE_FN elif [ "$Y_N" == "n" ] then direct_job=y mkdir -p $BKUP_DIR PREPARE_FN else COMMENT10_FN fi READ_YN "CPU name, Core count and reflects it. If you select n, Resote original file (Cancel : q) [y/n] : " if [ "$Y_N" == "y" ] then GATHER_FN PERFORM_FN APPLY_FN COMMENT09_FN elif [ "$Y_N" == "n" ] then if [ -d "$BKUP_DIR" ] then gzip $BKUP_DIR/admin_center.js gzip $BKUP_DIR/mobile.js mv $BKUP_DIR/admin_center.js.gz $WORK_DIR/ mv $BKUP_DIR/mobile.js.gz $MWORK_DIR/ COMMENT09_FN else COMMENT07_FN fi else COMMENT10_FN fi else COMMENT10_FN fi else COMMENT08_FN fi } COMMENT03_FN () { echo -e "There is a history of running the same version. Please run again select 2) redo .\n" exit 0 } COMMENT04_FN () { echo -e "Do not restore to source when installing a higher version. Contiue...\n" } COMMENT05_FN () { echo -e "You have verified and installed the previous version. Contiue...\n" } COMMENT06_FN () { echo -e "Problem and exit. Please run again after checking." exit 0 } COMMENT07_FN () { echo -e "No execution history. Please go back to the first run." exit 0 } COMMENT08_FN () { echo -e "The target file(location) does not exist. Please run again after checking." exit 0 } COMMENT09_FN () { echo -e "The operation is complete!! It takes about 1-2 minutes to reflect, \n(Please refresh the DSM page with F5 or after logout/login and check the information.)" exit 0 } COMMENT10_FN () { echo -e "Only y / n / q can be input. Please proceed again." exit 0 } # ============================================================================== # Main Progress # ============================================================================== clear WORK_DIR="/usr/syno/synoman/webman/modules/AdminCenter" MWORK_DIR="/usr/syno/synoman/mobile/ui" BKUP_DIR="/root/Xpenology_backup" VER_DIR="/etc.default" echo "DSM CPU Information Change Tool ver. \033[0;31m"$ver"\033[00m - made by FOXBI\n" if [ -d "$VER_DIR" ] then VER_FIL="$VER_DIR/VERSION" else VER_FIL="/etc/VERSION" fi if [ -f "$VER_FIL" ] then MA_VER=`cat $VER_FIL | grep majorversion | awk -F \= '{print $2}' | sed 's/\"//g'` MI_VER=`cat $VER_FIL | grep minorversion | awk -F \= '{print $2}' | sed 's/\"//g'` BL_NUM=`cat $VER_FIL | grep buildnumber | awk -F \= '{print $2}' | sed 's/\"//g'` BL_FIX=`cat $VER_FIL | grep smallfixnumber | awk -F \= '{print $2}' | sed 's/\"//g'` else COMMENT08_FN fi BL_CHK=$BL_NUM$BL_FIX TIME=`date +%Y%m%d%H%M%S`"_"$BL_CHK STIME=`echo "$TIME"` if [ "$MA_VER" -gt "4" ] then if [ "$MA_VER" -eq "5" ] then MWORK_DIR="/usr/syno/synoman/webman/mapp" fi echo "Your version of DSM is \033[0;36mDSM \033[0;31m"$MA_VER"."$MI_VER"\033[0;32m continue...\n" else echo "DSM version less than 5 is not supported. End the process." exit 0 fi read -n1 -p "1) First run 2) Redo 3) Restore - Select Number : " inst_z case "$inst_z" in 1) inst_check=run echo -e "\n " ;; 2) inst_check=redo echo -e "\n " ;; 3) inst_check=restore echo -e "\n " ;; *) echo -e "\n" ;; esac if [ "$inst_check" == "redo" ] then READ_YN "Do you want to proceed again? Restore to original file backup and proceed.(Cancel : q) [y/n] : " if [ "$Y_N" == "y" ] then re_check=y BLCHECK_FN "$inst_check" inst_check=run EXEC_FN elif [ "$Y_N" == "n" ] then echo "Do not proceed with the redo." else COMMENT10_FN fi elif [ "$inst_check" == "restore" ] then READ_YN "Do you want to restore using the original backup file? (Cancel : q) [y/n] : " if [ "$Y_N" == "y" ] then re_check=n BLCHECK_FN "$inst_check" RECOVER_FN elif [ "$Y_N" == "n" ] then echo "No restore was performed." else COMMENT10_FN fi elif [ "$inst_check" == "run" ] then re_check=n BLCHECK_FN "$inst_check" EXEC_FN else echo "Please select the correct number." fi
You have nothing to be embarrassed about, FOXBI! Your code is much more elegant than some of my bash scripts 😉
감사합니다 !!
Unfortunately, it still doesn't quite work for me - it recognizes my Core i3-6100T (specs) correctly, but it says I have 4 CPU cores:
when in fact there are only 2. I am not sure why it thinks so, the commands get it right:
# dmidecode -t processor # dmidecode 2.12 SMBIOS 3.0 present. # SMBIOS implementations newer than version 2.7 are not # fully supported by this version of dmidecode. Handle 0x000C, DMI type 4, 48 bytes Processor Information Socket Designation: CPUSocket Type: Central Processor Family: Core i3 Manufacturer: Intel(R) Corporation ID: E3 06 05 00 FF FB EB BF Signature: Type 0, Family 6, Model 94, Stepping 3 Flags: FPU (Floating-point unit on-chip) VME (Virtual mode extension) DE (Debugging extension) PSE (Page size extension) TSC (Time stamp counter) MSR (Model specific registers) PAE (Physical address extension) MCE (Machine check exception) CX8 (CMPXCHG8 instruction supported) APIC (On-chip APIC hardware supported) SEP (Fast system call) MTRR (Memory type range registers) PGE (Page global enable) MCA (Machine check architecture) CMOV (Conditional move instruction supported) PAT (Page attribute table) PSE-36 (36-bit page size extension) CLFSH (CLFLUSH instruction supported) DS (Debug store) ACPI (ACPI supported) MMX (MMX technology supported) FXSR (FXSAVE and FXSTOR instructions supported) SSE (Streaming SIMD extensions) SSE2 (Streaming SIMD extensions 2) SS (Self-snoop) HTT (Multi-threading) TM (Thermal monitor supported) PBE (Pending break enabled) Version: Intel(R) Core(TM) i3-6100T CPU @ 3.20GHz Voltage: 1.1 V External Clock: 100 MHz Max Speed: 3200 MHz Current Speed: 3200 MHz Status: Populated, Enabled Upgrade: Other L1 Cache Handle: 0x0009 L2 Cache Handle: 0x000A L3 Cache Handle: 0x000B Serial Number: To Be Filled By O.E.M. Asset Tag: To Be Filled By O.E.M. Part Number: To Be Filled By O.E.M. Core Count: 2 Core Enabled: 2 Thread Count: 4 Characteristics: 64-bit capable Multi-Core Hardware Thread Execute Protection Enhanced Virtualization Power/Performance Control
# cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 94 model name : Intel(R) Core(TM) i3-6100T CPU @ 3.20GHz stepping : 3 microcode : 0xc2 cpu MHz : 3101.000 cache size : 3072 KB physical id : 0 siblings : 4 core id : 0 cpu cores : 2 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 22 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch ida arat epb xsaveopt pln pts invpcid_single spec_ctrl ibpb_support tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap bogomips : 6384.58 clflush size : 64 cache_alignment : 64 address sizes : 39 bits physical, 48 bits virtual power management:
Maybe your code is confusing number of threads with number of cores?
Thanks again 😊
- 1
-
- Outcome of the update: SUCCESSFUL
- DSM version prior update: 6.2.1-23824
- Loader version and model: Jun's loader v1.03b - DS3617xs
- Using custom extra.lzma: NO
- Installation type: BAREMETAL - ASRock E3C236D2I
- 1
-
A general question to the folks here, why are you using XPEnology over similar solutions? I'll talk about my own use case first, I have a moderately beefy CPU (i3-6100T) on an Intel C236 chipset, 8GB of ECC RAM and 5 6TB drives. I'd like to turn that into a reliable (preferably using as modern, copy-on-write filesystem) file server - right now I'm less interested in media streaming or VMs.
- Why not just get a Synology? Good question. I already spent all this money on my hardware, and I don't think Synology's boxes are particularly powerful from a hardware point of view...
- FreeNAS? That was my original plan. But ZFS, while an awesome filesystem in an enterprise scenario, just isn't flexible enough for home users (I'm sure you all know that you can't just add drives to a ZFS array).
-
OpenMediaVault? This was the second NAS OS I tested. It is (as the name suggests) open, well organized, and very flexible. It runs on top of regular Debian so it's easy to drop into a Linux shell and run commands from there. Unfortunately, I found I needed to do that a lot more than anticipated. OMV was a little too "fiddly" for me...
OMV has a good ZFS plugin, but BTRFS isn't as well supported. It does offer SnapRAID though, which you can think of as non-realtime parity. -
unRAID is what I checked out next (and decided to buy). I was blown away by its slickness and user friendliness. Everything just....works. Enterprise sysadmins might turn up their noses at it, but it provides most of what I need - up to two parity drives give plenty of redundancy. What's more, if the worst comes to the worst, I can still take out any functioning drives and read them individually.
unRAID doesn't have built-in bitrot protection unfortunately, although you can use either a file integrity plugin or a BTRFS scrub to at least be warned about checksum mismatches. - Rockstor is a BTRFS-only NAS OS. Looks good on paper, but development seems to have pretty much stopped, and the constant upsell attempts are annoying too.
- So, finally - why XPEnology? I am obviously concerned about the long-term viability of such a "hacky" environment. But DSM is just so simple and powerful. 😍 I love that I can make automated, cyclical BTRFS snapshots of my files... I don't think any other comparable system offers this!
So, that's me. Would love to hear your viewpoints on what I may have missed, and on why YOU are using XPEnology (and what for).
Cheers!
- 2
-
I have several TB of data that I would like to migrate onto my new XPEnology server. I know there is a "USB Copy" package, but I'd prefer to hook up the drive to my server via SATA which is much faster. How would I be able to copy the files in that case? I'm assuming this would have to be via the command prompt - cp and rsync commands both exist, but how do I find out where my new drive is mounted? And which destination should I copy to, just /volume1/ ?
Thanks in advance for any tips.
-
- Outcome of the installation/update: SUCCESSFUL
- DSM version prior update: None (fresh install)
- Loader version and model: Jun's loader v1.03b - DS3617xs
- Using custom extra.lzma: No
- Installation type: Baremetal - ASRock E3C236D2I (Intel C236), 5 6TB SATA disks
- Additional comments: worked first time! 😊
-
On 8/31/2018 at 11:53 PM, luchuma said:
DSM 6.2.1-23824 - DSM_DS3615xs_23824.pat is working on VM
change vm network settings vm adapter to e1000e (default is vmxnet3)
Little confused here - DSM_DS3615xs_23824.pat is working or not (or only on a VM)?
Thanks for your tutorial by the way, with your help I finally managed to install DSM 6.2!
Running DSM_DS3615xs_23739.pat on VirtualBox (yes!) but want to try on bare metal, too. Any advice?
DSM 5.x/6.x/7.x CPU name & cores infomation Change tool
in Software Modding
Posted
Oh, that's great that you shared your code on GitHub. Thank you! What a good idea.
There is a version 6? It looks like the latest version is 5.2, no?
Thanks again for your work 😊