From c2ac4102d8e6357c69bffb6fe97076e790a2ce9f Mon Sep 17 00:00:00 2001 From: Francois B Date: Fri, 30 Mar 2018 19:02:06 +0200 Subject: [PATCH] some improvements + kernel update/cleaner + . --- core_functions.sh | 10 ++++++++++ repo_functions.sh | 14 ++++++++++++-- tools_functions.sh | 28 ++++++++++++---------------- yggdrasil.sh | 10 +++++++++- 4 files changed, 43 insertions(+), 19 deletions(-) diff --git a/core_functions.sh b/core_functions.sh index 4d0e98e..79b30d0 100644 --- a/core_functions.sh +++ b/core_functions.sh @@ -182,6 +182,15 @@ function yggInit () { fi } +# +# update kernel to the latest version +# +function kernelUpdate () { + checkAndInstallDep apt ukuu ukuu \ + && runCmd "sudo ukuu --install-latest --yes" \ + "installing latest kernel" +} + # # system update #TODO: add pip, npm, gem @@ -564,6 +573,7 @@ function usage () { printf " "$BOLDVERT"-s"$NORMAL" : install Solaar for Logitech Unifying devices\n" printf " "$BOLDVERT"-t"$NORMAL" : install TLP for Laptops and low energy usage\n" printf " "$BOLDVERT"-n"$NORMAL" : install lastest Nvidia graphic drivers\n" + printf " "$BOLDVERT"-k"$NORMAL" : update system to the latest kernel\n" printf " "$BOLDVERT"-u"$NORMAL" : update system (apt,snap,...)\n" printf " "$BOLDVERT"-p"$NORMAL" : clean useless packages\n" printf " "$BOLDVERT"-v"$NORMAL" : show verison number\n" diff --git a/repo_functions.sh b/repo_functions.sh index e8b001b..c23e030 100644 --- a/repo_functions.sh +++ b/repo_functions.sh @@ -462,7 +462,17 @@ telegram;addRepo_Telegram skypeforlinux;addRepo_SkypeForLinux shotwell;addRepo_Shotwell peek;addRepo_Peek -sqlitebrowser;addRepo_SQLiteBrowser" +sqlitebrowser;addRepo_SQLiteBrowser +ukuu;addRepo_Teejee2008 +aptik;addRepo_Teejee2008 +conky-manager;addRepo_Teejee2008" + +# +# +# +function addRepo_Teejee2008 () { + addPPA "teejee2008/ppa" +} # # SQLiteBrowser @@ -820,7 +830,7 @@ function addRequiredPPA () { addPPA "noobslab/icons" # icons from noobslab addPPA "numix/ppa" # theme Numix addPPA "ravefinity-project/ppa" # Themes - addPPA "teejee2008/ppa" # Aptik - Conky-Manage + #addPPA "teejee2008/ppa" # Aptik - Conky-Manage - Ukuu addPPA "yktooo/ppa" # indicator-sound-switcher addPPA "webupd8team/y-ppa-manager" # y-ppa-manager addPPA "videolan/stable-daily" # video player diff --git a/tools_functions.sh b/tools_functions.sh index 1e3affc..adfce03 100644 --- a/tools_functions.sh +++ b/tools_functions.sh @@ -14,7 +14,6 @@ # enable ufw at boot time and add rules for installed apps # function enableUFW () { - msg "Enabling FireWall (UFW)" runCmd "sudo ufw enable"\ "enabling UFW at boot" @@ -28,13 +27,12 @@ function enableUFW () { # enable numlock by default on LightDM # function enableNumLockX () { - msg "Adding NumLockX to MDM/LightDM Default Init" checkAndInstallDep apt numlockx numlockx if which lightdm >/dev/null; then runCmd "sudo cp /etc/lightdm/lightdm.conf.d/70-linuxmint.conf /etc/lightdm/lightdm.conf.d/70-linuxmint.conf.yggbak" \ - "Backing up original config file" + "backing up lightdm original config file" runCmd "echo -e '\ngreeter-setup-script=/usr/bin/numlockx on' | sudo tee -a /etc/lightdm/lightdm.conf.d/70-linuxmint.conf" \ - "Enabling numlockx on in lightdm at boot" + "enabling numlockx on in lightdm at boot" fi } @@ -43,7 +41,7 @@ function enableNumLockX () { #TODO: add possibily to choose amount of ram function enableTmpRAM () { runCmd "echo 'tmpfs /tmp tmpfs defaults,size=2g 0 0' | sudo tee -a /etc/fstab" \ - "Enabling /tmp in RAM by modifying /etc/fstab" + "enabling /tmp in RAM by modifying /etc/fstab" if (whiptail --title "/tmp in RAM - Reboot" --yesno "Reboot required, proceed now ?" 10 60) then sudo reboot fi @@ -53,12 +51,11 @@ function enableTmpRAM () { # add screenfetch exec in .bashrc # function addScreenfetchBashrc () { - msg "Adding screenfetch to .bashrc" checkAndInstallDep apt screenfetch screenfetch runCmd "touch /home/$myHomedir/.bashrc" \ - "Creating .bashrc file if necessary" + "creating .bashrc file if necessary" \ runCmd "echo 'screenfetch -t' | tee -a /home/$myHomedir/.bashrc" \ - "Adding screenfetch to .bashrc" + "adding screenfetch to .bashrc" } # @@ -66,7 +63,7 @@ function addScreenfetchBashrc () { # function enableHistoryTS () { typeset ret_code - printf "Enabling CLI History TimeStamp " + printf "enabling CLI History TimeStamp " echo "export HISTTIMEFORMAT='%F %T '" | tee -a /home/$myHomedir/.bashrc &>> $logFile ret_code=$? retCode $ret_code @@ -76,8 +73,7 @@ function enableHistoryTS () { # install/enable auto install of security updates # function installUnattendedUpgrades () { - msg "Installing unattended-upgrades" - installPackage apt "unattended-upgrades" + installPackage apt unattended-upgrades } # @@ -128,16 +124,16 @@ function toolOptimizeFirefox () { # function toolAutoremove () { runCmd "sudo apt-get -y autoremove" \ - "Removing not necessary dependencies" + "removing not necessary dependencies" } # # remove old versions of installed kernels # function toolClearOldKernels () { - checkAndInstallDep apt byobu purge-old-kernels - runCmd "sudo purge-old-kernels --keep 3" \ - "Removing old kernels" + checkAndInstallDep apt ukuu ukuu \ + && runCmd "sudo ukuu --purge-old-kernels --yes" \ + "removing old kernels" } # @@ -145,5 +141,5 @@ function toolClearOldKernels () { # function toolSoundCardsDetection () { runCmd "sudo alsa force-reload" \ - "Detecting ALSA sound cards" + "detecting ALSA sound cards" } \ No newline at end of file diff --git a/yggdrasil.sh b/yggdrasil.sh index 27552dc..1bbcbe5 100755 --- a/yggdrasil.sh +++ b/yggdrasil.sh @@ -50,7 +50,7 @@ echo "--[ Yggdrasil log ]--[ "$cDate" ]--[ "$cTime" ]-----------------------" >> # # arguments/options management with getopts -while getopts ":h,v,f,c,u,a,d,q,s,t,n,w,p,T" option; do +while getopts ":h,v,f,c,u,a,d,q,s,t,n,w,p,k,T" option; do case "$option" in T) #test purpose only yggInit @@ -70,6 +70,7 @@ while getopts ":h,v,f,c,u,a,d,q,s,t,n,w,p,T" option; do # tlp, KeyID # dev apps : all # customization : themes, icons + # sys : latest kernel msg "Initializing" yggInit msg "Updating the system" @@ -155,6 +156,7 @@ while getopts ":h,v,f,c,u,a,d,q,s,t,n,w,p,T" option; do installUnattendedUpgrades installNitrogen enableUnbound + kernelUpdate msg "Installing additional themes/icons" installIcons installThemes @@ -209,6 +211,12 @@ while getopts ":h,v,f,c,u,a,d,q,s,t,n,w,p,T" option; do installNvidia390 exit ;; + k) + yggInit + updateSystem + kernelUpdate + exit + ;; u) yggInit updateSystem