瀏覽代碼

Z991239-5505 #comment 清理sudo_spexplorer字眼

80374374 1 年之前
父節點
當前提交
2215feca64

+ 0 - 180
addin/packaging/DEBIAN/postinst

@@ -1,180 +0,0 @@
-#!/bin/sh
-echo "============== post installation custom scripts start: $*=============="
-curr_timestamp=`date "+%Y%m%d-%H%M%S.%3N"`
-lightdm_file=/etc/lightdm/lightdm.conf
-rvc_install_path_root="/opt"
-rvc_install_path_rvc_dir=${rvc_install_path_root}/rvc
-rvc_install_path_Run_dir=${rvc_install_path_root}/Run
-rvc_install_path_hardware_dir=${rvc_install_path_Run_dir}/hardwarecfg
-rvc_install_path_versions_dir=${rvc_install_path_Run_dir}/version
-
-setup_autologin()
-{
-    given_user=$1
-    given_sudoers_file=$2
-
-    if [ ! -f "$given_sudoers_file" ]; then
-        echo "[Seat:*]" > $given_sudoers_file
-        # echo "autologin-guest=false" >> $given_sudoers_file
-        echo "autologin-user=$given_user" >> $given_sudoers_file
-        echo "autologin-user-timeout=0" >> $given_sudoers_file
-    fi
-
-    if [ "$(grep -c "^\\s*autologin-user=${given_user}" $given_sudoers_file)" -gt 0 ]; then
-        echo "autologin-user is already setted in ^lightdm.conf^"
-    else
-        echo "setting autologin-user in ^$given_sudoers_file^"
-        #sed -i.bak -E "s|^#(autologin-user=).*|\\1$given_user|;s|^#(autologin-user-timeout=).*|\\0|" $given_sudoers_file
-        sed -i "s/^\s*#\s*autologin-user=/autologin-user=/g;s/autologin-user=.*$/autologin-user=$given_user/g" $given_sudoers_file
-        #sed -i "s/^#autologin-user=$/autologin-user=${given_user}/" $given_sudoers_file
-        #sed -i "s/^#autologin-user-timeout=$/autologin-user-timeout=0/" $given_sudoers_file
-        sed -i "s/^\s*#\s*autologin-user-timeout=/autologin-user-timeout=/g;s/autologin-user-timeout=.*$/autologin-user-timeout=0/g" $given_sudoers_file
-    fi
-}
-
-sudo_priviledge() {
-
-    given_user=$1
-    given_sudoers_file=$2
-
-    if [ -e ${given_sudoers_file}.tmp -o "$(pidof visudo)" ]; then
-        echo "[ERROR]: ${given_sudoers_file} is working now,  wait a little and then try again later"
-        return 2
-    fi
-
-    ret=0
-	echo "[INFO]: to process editing sudoers file..."
-    
-    cp ${given_sudoers_file} ${given_sudoers_file}.tmp
-	
-    chmod 0640 ${given_sudoers_file}.tmp
-    cat ${given_sudoers_file}.tmp | grep  'includedir /etc/sudoers.d' > /dev/null
-    if [ $? = 0 ]; then
-        echo "[INFO]: '#includedir /etc/sudoers.d' already exists in /etc/sudoers file"
-    else
-        echo "#includedir /etc/sudoers.d"  >> ${given_sudoers_file}.tmp
-        ret=1
-    fi
-
-	if [  "`cat /etc/sudoers|grep ${given_user}|grep ALL=(ALL)`" != "" ]; then
-        echo "[WARN]: sudoers file has been loaded up all(all) config"
-    else
-        new_entry="${given_user} ALL=(ALL) ALL"
-        echo "${new_entry}" >> ${given_sudoers_file}.tmp
-        ret=1
-    fi
-
-    if [  "`cat /etc/sudoers|grep ${given_user}|grep Run`" != "" ]; then
-        echo "[WARN]: sudoers file has been loaded up rvc config"
-    else
-        new_entry="${given_user} ALL=(ALL) NOPASSWD: /opt/Run/version/*, NOPASSWD: /bin/sh, NOPASSWD: /bin/bash"
-        echo "${new_entry}" >> ${given_sudoers_file}.tmp
-        ret=1
-    fi
-
-    chmod 0440 ${given_sudoers_file}.tmp
-
-    if visudo -c -f ${given_sudoers_file}.tmp ; then
-        echo check syntax correct on ${given_sudoers_file}
-    else
-        echo "[ERROR]: syntax check failed on file ${given_sudoers_file}"
-        rm ${given_sudoers_file}.tmp
-        return 3
-    fi
-
-    if [ $ret -eq 1 ]; then
-        echo "[SUCCESS]: config file has been change !!"
-        cp ${given_sudoers_file} ${given_sudoers_file}.backup.${curr_timestamp}
-        mv ${given_sudoers_file}.tmp ${given_sudoers_file}
-        ret=0
-    else
-        echo "[WARN]: config file not change"
-        rm ${given_sudoers_file}.tmp
-        ret=0
-    fi
-
-    return $ret
-}
-
-res=0
-
-if [ "$1" = "configure" ]; then
-
-    rvc_user=$USER
-    sudoers_file=/etc/sudoers
-
-    if [ -z "$rvc_user" -o "$rvc_user" = "root" ]; then
-        users=$(cat /etc/passwd | awk -F: '$3>=500' | cut -f 1 -d :)
-        echo "user list: $users"
-        cnt=0
-        for var in $(echo ${users} | awk '{split($0,arr,",");for(i in arr) print arr[i]}')
-        do
-            if [ ${var} != 'nobody' -a ${var} != 'systemd-coredump' -a ${var} != 'liuwt' -a ${var} != 'deepin-anything-server' ]; then
-                cnt=$((${cnt}+1))
-                rvc_user=${var}
-            fi
-        done
-        if [ $cnt -ne 1 ]; then
-            echo "too many users: $cnt"
-            rvc_user=''
-        else
-            echo "aim user: $rvc_user"
-        fi
-    fi
-
-    if [ -z "$rvc_user" ]; then
-        echo "[ERROR]: username is empty, please use cmd 'dpkg -i {.deb file} to install'"
-        exit 1
-    elif [ "$rvc_user" = "root" ]; then
-        echo "[ERROR]: username is invalid, please use cmd 'dpkg -i {.deb file} to install'"
-        exit 2
-    fi
-
-    echo "[INFO]: Going to add entry into /etc/sudoers file for user: $rvc_user"
-
-    if [ ! -d '/etc/sudoers.d' ]; then
-        mkidr /etc/sudoers.d
-        chmod 750 /etc/sudoers.d
-    fi
-
-    sudo_priviledge ${rvc_user}   ${sudoers_file}
-    res=$?
-    if [ $res -eq 0 ]; then
-
-        echo "[INFO]: rm file under desktop directory..."
-        rm -rf /home/$rvc_user/Desktop/* > /dev/null 2>&1
-        echo "[INFO]: rm file under desktop directory done!"
-
-        echo "[INFO]: setup user $rvc_user auto login.." 
-        setup_autologin  ${rvc_user}   ${lightdm_file}
-        echo "[INFO]: Copy application icon to menu tools..."
-        cp /opt/rvc/Resources/spexplorerauto.desktop /usr/share/applications
-        echo "[INFO]: Active application icon autorun after boot..."
-        cp /opt/rvc/Resources/spexplorerauto.desktop /etc/xdg/autostart/
-        echo "[INFO]: Copy application icon to desktop..."
-        cp /opt/rvc/Resources/spexplorerauto.desktop /home/$rvc_user/Desktop
-    fi
-
-    echo "[INFO]: change the run scripts priviledge..."
-    chmod 777 ${rvc_install_path_root}
-    chmod 777 -R ${rvc_install_path_Run_dir}
-    chmod 777 -R ${rvc_install_path_rvc_dir}
-    chmod 777 -R ${rvc_install_path_hardware_dir}
-    chmod 777 ${rvc_install_path_versions_dir}/spexplorer.sh > /dev/null 2>&1
-    chmod 777 ${rvc_install_path_versions_dir}/sudo_spexplorer.sh > /dev/null 2>&1
-    chmod a+rw ${rvc_install_path_versions_dir}/active.txt
-    echo "[INFO]: change the run scripts priviledge done!"
-
-    keyring_file=/home/$rvc_user/.local/share/keyrings/login.keyring
-    if [ -f "$keyring_file" ]; then
-        rm $keyring_file
-        echo "[INFO]: remove keyring file."
-    fi
-
-    echo "[INFO]: set menu tool as hidden mode..."
-    gsettings set com.deepin.dde.dock hide-mode  keep-hidden
-    echo "[INFO]: set menu tool as hidden mode done!"
-
-fi
-
-exit $res

+ 0 - 71
addin/packaging/DEBIAN/postrm

@@ -1,71 +0,0 @@
-#!/bin/sh
-echo "================= post remove custom scripts start: $*================="
-
-if [ "$1" = "remove" ]; then
-
-    rm /etc/xdg/autostart/spexplorerauto.desktop > /dev/null 2>&1
-    rm /usr/share/applications/spexplorerauto.desktop > /dev/null 2>&1
-    rm -rf /opt/rvc > /dev/null 2>&1
-    rm -rf /opt/Run > /dev/null 2>&1
-    rm -rf /opt/wlog > /dev/null 2>&1
-    rm Run.ini > /dev/null 2>&1
-
-    rm /usr/lib/cef_100_percent.pak > /dev/null 2>&1
-    rm /usr/lib/cef_200_percent.pak > /dev/null 2>&1
-    rm /usr/lib/cef_extensions.pak > /dev/null 2>&1
-    rm /usr/lib/cef.pak > /dev/null 2>&1
-    rm /usr/lib/chrome-sandbox > /dev/null 2>&1
-    rm /usr/lib/devtools_resources.pak > /dev/null 2>&1
-    rm /usr/lib/icudtl.dat > /dev/null 2>&1
-    rm /usr/lib/libcef.so > /dev/null 2>&1
-    rm /usr/lib/libEGL.so > /dev/null 2>&1
-    rm /usr/lib/libGLESv2.so > /dev/null 2>&1
-    rm /usr/lib/snapshot_blob.bin > /dev/null 2>&1
-    rm /usr/lib/v8_context_snapshot.bin > /dev/null 2>&1
-
-    rvc_user=$USER
-    if [ -z "$rvc_user" -o "$rvc_user" = "root" ]; then
-        users=$(cat /etc/passwd | awk -F: '$3>=500' | cut -f 1 -d :)
-        echo "user list: $users"
-        cnt=0
-        for var in $(echo ${users} | awk '{split($0,arr,",");for(i in arr) print arr[i]}')
-        do
-            if [ ${var} != 'nobody' -a ${var} != 'systemd-coredump' -a ${var} != 'liuwt' -a ${var} != 'deepin-anything-server' ]; then
-                cnt=$((${cnt}+1))
-                rvc_user=${var}
-            fi
-        done
-        if [ $cnt -ne 1 ]; then
-            echo "too many users: $cnt"
-            rvc_user=''
-        else
-            echo "aim user: $rvc_user"
-        fi
-    fi
-    rm /home/$rvc_user/Desktop/spexplorerauto.desktop > /dev/null 2>&1
-
-    echo "[INFO]: set menu tool as show mode..."
-    gsettings set com.deepin.dde.dock hide-mode  keep-showing
-    echo "[INFO]: set menu tool as show mode done!"
-
-    papers_dir=/usr/share/wallpapers/deepin
-    papers_bak_dir=/usr/share/wallpapers/deepin_bak
-    if [ -d $papers_bak_dir ]; then
-        rm -rf $papers_dir/*  > /dev/null 2>&1
-        cp $papers_bak_dir/* $papers_dir
-    fi
-
-else
-
-    rm -rf /opt/rvc/dbg > /dev/null 2>&1
-    rm -rf /opt/rvc/dmp > /dev/null 2>&1
-    rm -rf /opt/rvc/slv > /dev/null 2>&1
-    rm -rf /opt/rvc/terminaldbstorage > /dev/null 2>&1
-    rm -rf /opt/rvc/Downloads > /dev/null 2>&1
-    rm -rf /opt/wlog > /dev/null 2>&1
-    rm Run.ini > /dev/null 2>&1
-    rm /opt/Run/hardwarecfg/root.ini > /dev/null 2>&1
-    rm -rf /opt/Run/runinfo > /dev/null 2>&1
-fi
-
-exit 0

+ 0 - 18
addin/packaging/DEBIAN/preinst

@@ -1,18 +0,0 @@
-#!/bin/sh
-echo "============== previous installation custom scripts start: $* =============="
-user1=$(ps -o user= -p $$ | awk '{print $1}')
-echo "user1: $user1"
-user2=$(whoami)
-echo "user2: $user2"
-#user3=$(logname)
-#echo "user3: $user3"
-
-papers_dir=/usr/share/wallpapers/deepin
-papers_bak_dir=/usr/share/wallpapers/deepin_bak
-if [ ! -d $papers_bak_dir ]; then
-    mkdir -p ${papers_bak_dir}
-    cp $papers_dir/* $papers_bak_dir
-fi
-rm -rf $papers_dir/* > /dev/null 2>&1
-
-exit 0

+ 0 - 12
addin/packaging/DEBIAN/prerm

@@ -1,12 +0,0 @@
-#!/bin/sh
-echo "================= pre remove custom scripts start: $* =================="
-
-if [ "$1" = "remove" ]; then
-    killall -9 spshell > /dev/null 2>&1
-    killall -9 sphost > /dev/null 2>&1
-    killall -9 guardian > /dev/null 2>&1
-    killall -9 uosbrowser > /dev/null 2>&1
-    killall -s 9 `ps -aux | grep browser | awk '{print $2}'` > /dev/null 2>&1
-fi
-
-exit 0

+ 0 - 0
addin/packaging/DEBIAN/test.sh → addin/packaging/Misc/test.sh


+ 0 - 1
addin/packaging/UOS/installsub.in

@@ -225,7 +225,6 @@ sudo chmod a+rw -R ${rvc_install_path_hardware_dir}
 
 sudo chmod 777 -R ${rvc_install_path_root}/${rel_version_dir}
 sudo chmod 777 ${rvc_install_path_versions_dir}/spexplorer.sh > /dev/null 2>&1
-sudo chmod 777 ${rvc_install_path_versions_dir}/sudo_spexplorer.sh > /dev/null 2>&1
 sudo chmod a+rw ${rvc_install_path_versions_dir}/active.txt
 sudo chmod a+rw ${rvc_install_path_versions_dir}
 sudo chmod a+rw ${rvc_install_path_Run_dir}

+ 0 - 1
addin/packaging/UOS/original.sh

@@ -237,7 +237,6 @@ sudo chmod a+rw -R ${rvc_install_path_hardware_dir}
 
 sudo chmod 777 -R ${rvc_install_path_root}/${rel_version_dir}
 sudo chmod 777 ${rvc_install_path_versions_dir}/spexplorer.sh > /dev/null 2>&1
-sudo chmod 777 ${rvc_install_path_versions_dir}/sudo_spexplorer.sh > /dev/null 2>&1
 sudo chmod a+rw ${rvc_install_path_versions_dir}/active.txt
 sudo chmod a+rw ${rvc_install_path_versions_dir}
 sudo chmod a+rw ${rvc_install_path_Run_dir}