From c6c0f342c889eee0e6db6a192a3b5aad510120a7 Mon Sep 17 00:00:00 2001 From: navewindre Date: Thu, 3 Jul 2025 21:59:24 +0200 Subject: split --- slackware-bootstrap/cleanup | 11 +++ slackware-bootstrap/finish | 1 + slackware-bootstrap/kernel | 1 + slackware-bootstrap/multilib | 1 + slackware-bootstrap/nvidia-driver | 2 + slackware-bootstrap/package-purge | 30 ++++++++ slackware-bootstrap/slackpkg | 141 ------------------------------------- slackware-bootstrap/slpkg | 1 + slackware-bootstrap/step1 | 18 ++++- slackware-bootstrap/step2 | 59 +++++++++------- slackware-bootstrap/update-current | 81 +++++++++++++++++++++ slackware-bootstrap/update-stable | 40 +++++++++++ 12 files changed, 220 insertions(+), 166 deletions(-) create mode 100644 slackware-bootstrap/cleanup create mode 100644 slackware-bootstrap/package-purge delete mode 100755 slackware-bootstrap/slackpkg create mode 100644 slackware-bootstrap/update-current create mode 100755 slackware-bootstrap/update-stable diff --git a/slackware-bootstrap/cleanup b/slackware-bootstrap/cleanup new file mode 100644 index 0000000..7747c9d --- /dev/null +++ b/slackware-bootstrap/cleanup @@ -0,0 +1,11 @@ +#!/bin/sh + +rm ~/.step1-done +rm ~/.stable-done +rm ~/.current-done +rm ~/.purge-done +rm ~/.slpkg-done +rm ~/.multilib-done +rm ~/.kernel-done +rm ~/.nvidia-done +rm ~/.step2-done diff --git a/slackware-bootstrap/finish b/slackware-bootstrap/finish index a1a8ad6..7468739 100755 --- a/slackware-bootstrap/finish +++ b/slackware-bootstrap/finish @@ -2,6 +2,7 @@ basedir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) sh $basedir/runlevel +sh $basedir/cleanup echo "================= [ setup complete ] ====================" echo "the system will now reboot" diff --git a/slackware-bootstrap/kernel b/slackware-bootstrap/kernel index abfc29e..07775fe 100755 --- a/slackware-bootstrap/kernel +++ b/slackware-bootstrap/kernel @@ -52,3 +52,4 @@ fi popd +touch ~/.kernel-done diff --git a/slackware-bootstrap/multilib b/slackware-bootstrap/multilib index ffb7545..5485e8c 100755 --- a/slackware-bootstrap/multilib +++ b/slackware-bootstrap/multilib @@ -23,3 +23,4 @@ if [[ $iscurrent == 0 ]]; then fi cd $oldpwd +touch ~/.multilib-done diff --git a/slackware-bootstrap/nvidia-driver b/slackware-bootstrap/nvidia-driver index b899169..e1d669f 100755 --- a/slackware-bootstrap/nvidia-driver +++ b/slackware-bootstrap/nvidia-driver @@ -27,3 +27,5 @@ echo "blacklist nouveau" >> /etc/modprobe.d/BLACKLIST-nouveau.conf echo "/usr/bin/nvidia-modprobe -c 0 -u" >> /etc/rc.d/rc.local popd + +touch ~/.nvidia-done diff --git a/slackware-bootstrap/package-purge b/slackware-bootstrap/package-purge new file mode 100644 index 0000000..5f681b8 --- /dev/null +++ b/slackware-bootstrap/package-purge @@ -0,0 +1,30 @@ +#!/bin/sh +basedir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +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 + +touch ~/.purge-done diff --git a/slackware-bootstrap/slackpkg b/slackware-bootstrap/slackpkg deleted file mode 100755 index 5333f9b..0000000 --- a/slackware-bootstrap/slackpkg +++ /dev/null @@ -1,141 +0,0 @@ -#!/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 diff --git a/slackware-bootstrap/slpkg b/slackware-bootstrap/slpkg index dbed15e..b87d094 100755 --- a/slackware-bootstrap/slpkg +++ b/slackware-bootstrap/slpkg @@ -30,3 +30,4 @@ cp -f $basedir/slpkg.toml /etc/slpkg/slpkg.toml slpkg -u cd $oldpwd +touch ~/.slpkg-done diff --git a/slackware-bootstrap/step1 b/slackware-bootstrap/step1 index 8085554..d48abac 100644 --- a/slackware-bootstrap/step1 +++ b/slackware-bootstrap/step1 @@ -1,9 +1,25 @@ #!/bin/bash basedir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -sh $basedir/slackpkg +if [[ -f "~/.step1-done" ]]; then + sh $basedir/step2 + exit +fi + +if [[ ! -f "~/.stable-done" ]]; then + sh $basedir/update-stable +fi + +if [[ ! -f "~/.current-done" ]]; then + sh $basedir/update-current +fi + +if [[ ! -f "~/.purge-done" ]]; then + sh $basedir/package-purge +fi echo "sh $basedir/step2" >> /root/.bash_profile +touch ~/.step1-done echo "=================== [ system reboot ] ==================" printf "\x1b[1;31mREAD CAREFULLY:\033[0m\n" diff --git a/slackware-bootstrap/step2 b/slackware-bootstrap/step2 index ffc4b1d..2598cf7 100644 --- a/slackware-bootstrap/step2 +++ b/slackware-bootstrap/step2 @@ -5,39 +5,49 @@ kernelver="6.15.2" rm /root/.bash_profile -sh $basedir/slpkg -sh $basedir/multilib +if [[ ! -f "~/.slpkg-done" ]]; then + sh $basedir/slpkg +fi + +if [[ ! -f "~/.multilib-done" ]]; then + sh $basedir/multilib +fi -echo "============== [ kernel update ] ===============" -echo "you can choose to update your kernel" -echo "after system reboot." -echo "this will update your kernel to $kernelver" -echo "================================================" +if [[ ! -f "~/.kernel-done" ]]; then + echo "============== [ kernel update ] ===============" + echo "you can choose to update your kernel" + echo "after system reboot." + echo "this will update your kernel to $kernelver" + echo "================================================" -nreboot=0 + nreboot=0 -read -p "do you want to update your kernel [y/n]? (y):" choice -if [[ $choice == "y" ]]; then - nreboot=1 - sh $basedir/kernel + read -p "do you want to update your kernel [y/n]? (y):" choice + if [[ $choice == "y" ]]; then + nreboot=1 + sh $basedir/kernel + fi fi -echo "================= [ nvidia driver ] =================" -echo "you can choose to install the nvidia driver" -echo "after system reboot." -echo "this will install the nvidia kernel module and the" -echo "gpu driver." -echo "=====================================================" - -read -p "do you want to install the nvidia driver [y/n]? (y):" choice -if [[ $choice == "y" ]]; then - nreboot=1 - sh $basedir/nvidia +if [[ ! -f "~/.nvidia-done" ]]; then + echo "================= [ nvidia driver ] =================" + echo "you can choose to install the nvidia driver" + echo "after system reboot." + echo "this will install the nvidia kernel module and the" + echo "gpu driver." + echo "=====================================================" + + read -p "do you want to install the nvidia driver [y/n]? (y):" choice + if [[ $choice == "y" ]]; then + nreboot=1 + sh $basedir/nvidia + fi fi +touch ~/.step2-done if [[ $nreboot == 1 ]]; then echo "sh $basedir/finish" >> /root/.bash_profile - echo "rm -f /root/.bashrc" >> /root/.bash_profile + echo "rm -f /root/.bash_profile" >> /root/.bash_profile echo "============================ [ reboot ] ===========================" printf "\x1b[1;31mupon reboot, make sure to log in as ROOT first !!!\x1b[0;0m\n" echo "===================================================================" @@ -46,6 +56,7 @@ if [[ $nreboot == 1 ]]; then reboot else sh $basedir/runlevel + sh $basedir/cleanup echo "============== [ setup done ] ===============" echo "username: $username" diff --git a/slackware-bootstrap/update-current b/slackware-bootstrap/update-current new file mode 100644 index 0000000..a0e07fa --- /dev/null +++ b/slackware-bootstrap/update-current @@ -0,0 +1,81 @@ +#!/bin/sh +basedir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +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 + +touch ~/.current-done diff --git a/slackware-bootstrap/update-stable b/slackware-bootstrap/update-stable new file mode 100755 index 0000000..5d4667e --- /dev/null +++ b/slackware-bootstrap/update-stable @@ -0,0 +1,40 @@ +#!/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 + +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 "============== [ system update ] ===============" +echo "simply press OK on the package selection screen" +echo "================================================" +read -p "press enter to continue" + +echo "==== [ updating system... ] ====" +slackpkg upgrade-all +slackpkg install-new + +cp -f $basedir/.mirrors-old /etc/slackpkg/mirrors +touch ~/.stable-done -- cgit v1.2.3