#!/bin/sh basedir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) cp /etc/slackpkg/mirrors $basedir/.mirrors-old printf "\x1b[1;31m======================= [ \x1b[7;31m ATTENTION \x1b[0;0m\x1b[1;31m ] ========================\n\x1b[0;0m" printf "\x1b[16;32mREAD CAREFULLY:\n\x1b[0;0m" echo "this script will open a text editor to edit the mirror list" echo "for the package manager." echo "please uncomment a mirror from a location near you," echo "by removing the '#' from the beginning of the line." printf "\x1b[16;32mONLY CHOOSE ONE MIRROR !\n\x1b[0;0m" printf "\x1b[16;32mDO NOT CHOOSE A -CURRENT MIRROR NOW !\n\x1b[0;0m" echo "you can save the file by pressing ctrl+x." printf "\x1b[1;31m================================================================\n\x1b[0;0m" read -p "press enter to continue" nano /etc/slackpkg/mirrors echo "running slackpkg update ..." slackpkg update slackpkg update gpg echo "============== [ system update ] ===============" echo "simply press OK on the package selection screen" echo "================================================" read -p "press enter to continue" printf "\x1b[1;31m======================= [ \x1b[7;31m ATTENTION \x1b[0;0m\x1b[1;31m ] ========================\n\x1b[0;0m" echo "updating slackpkg, if prompted to overwrite configuration files" echo "pick 'Remove (R)' !!!!" slackpkg upgrade slackpkg echo "==== [ updating system... ] ====" slackpkg upgrade-all slackpkg install-new cp -f $basedir/.mirrors-old /etc/slackpkg/mirrors printf "\x1b[1;31m======================= [ \x1b[7;31m ATTENTION \x1b[0;0m\x1b[1;31m ] ========================\n\x1b[0;0m" printf "\x1b[16;32mREAD CAREFULLY:\n\x1b[0;0m" echo "you will now have to switch the branch to -current" echo "same as before, you will have to manually" echo "edit the mirror list." echo "scroll down below the 15.0 section" echo "and select a suitable -current mirror" printf "\x1b[1;31m================================================================\n\x1b[0;0m" read -p "press enter to continue" nano /etc/slackpkg/mirrors cp -f $basedir/slackpkg-blacklist-allowkern /etc/slackpkg/blacklist echo "running full system update ..." slackpkg update slackpkg update gpg printf "\x1b[1;31m======================= [ \x1b[7;31m ATTENTION \x1b[0;0m\x1b[1;31m ] ========================\n\x1b[0;0m" echo "updating slackpkg, if prompted to overwrite configuration files" echo "pick 'Remove (R)' !!!!" slackpkg upgrade slackpkg echo "==== [ updating system... ] ====" slackpkg update gpg slackpkg upgrade glibc libgcrypt aaa_glibc-solibs glib2 libffi slackpkg upgrade gnupg gnupg2 openssl openssl-solibs openssl11 openssl11-solibs slackpkg update gpg cp -f $basedir/slackpkg-nogpg.conf /etc/slackpkg/slackpkg.conf slackpkg install-new slackpkg upgrade-all slackpkg update gpg slackpkg upgrade-all cp -f $basedir/slackpkg-blacklist /etc/slackpkg/blacklist cp -f $basedir/slackpkg.conf /etc/slackpkg/slackpkg.conf isgeneric=1 kernel=$(ls /boot | grep "vmlinuz-generic-" | sort | tail -1 | cut -d '-' -f 3) if [[ $kernel == "" ]]; then kernel=$(ls /boot | grep "vmlinuz-[0-9]" | sort | tail -1 | cut -d '-' -f 2) isgeneric=0 fi initrdcmd="$(/usr/share/mkinitrd/mkinitrd_command_generator.sh -k $kernel)" initrdcmd=$(echo $initrdcmd | tail -1) $initrdcmd echo "==================== [ kernel update ] ==========================" echo "your kernel has been updated by slackpkg. in order to boot," echo "you will need to update your bootloader config." echo "if you do not use LILO, or do not boot off of your slackware disk" echo "simply input 'n'" echo "=================================================================" read -p "would you like to update your bootloader? [y/n] (y): " choice if [[ $choice != 'n' ]]; then liloconfig fi rm /boot/vmlinuz if [[ $isgeneric == 1 ]]; then ln -s /boot/vmlinuz-generic-$kernel /boot/vmlinuz else ln -s /boot/vmlinuz-$kernel /boot/vmlinuz fi rm /boot/System.map if [[ $isgeneric == 1 ]]; then ln -s /boot/System.map-generic-$kernel /boot/System.map else ln -s /boot/System.map-$kernel /boot/System.map fi rm /boot/config if [[ $isgeneric == 1 ]]; then ln -s /boot/config-generic-$kernel.x64 /boot/config else ln -s /boot/config-$kernel.x64 /boot/config fi echo "================= [ kde purge ] ==================" echo "due to how install-new works, kde is always" echo "installed during the first system update." echo "if you would like, you can now purge the install." echo "==================================================" echo "would you like to purge all kde packages now?" read -p "enter your choice [y/n] (n): " choice if [[ $choice == 'y' ]]; then echo "purging kde packages ..." slackpkg remove kde fi echo "================== [ TeX packages ] ===============" echo "similarly to kde, tex packages are always installed" echo "during the first system update. if you would like," echo "you can now purge the install." echo "==================================================" echo "would you like to purge all tex packages now?" read -p "enter your choice [y/n] (y): " choice if [[ $choice == 'y' ]]; then echo "purging tex packages ..." slackpkg remove texlive fi