diff options
| -rw-r--r-- | slackware-bootstrap/bootstrap | 49 | ||||
| -rw-r--r-- | slackware-bootstrap/kernel | 40 | ||||
| -rw-r--r-- | slackware-bootstrap/nvidia-driver | 25 | ||||
| -rwxr-xr-x | slackware-bootstrap/slackpkg | 8 |
4 files changed, 115 insertions, 7 deletions
diff --git a/slackware-bootstrap/bootstrap b/slackware-bootstrap/bootstrap index 1fcbc5c..c55767a 100644 --- a/slackware-bootstrap/bootstrap +++ b/slackware-bootstrap/bootstrap @@ -2,6 +2,8 @@ basedir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) username="user" +kernelver="6.15.2" + while getopts u:a:f: flag do case "${flag}" in @@ -17,10 +19,45 @@ sh $basedir/slackpkg sh $basedir/slpkg sh $basedir/multilib -echo "============== [ setup done ] ===============" -echo "username: $username" -echo "it's recommended to reboot your system." -echo "upon reboot you can sign in with your new user" -echo "==============================================" +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 + +read -p "do you want to update your kernel [y/n]? (y):" choice +if [[ $choice == "y" ]]; then + nreboot=1 + echo "sh $basedir/kernel" >> /root/.bashrc +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 + echo "sh $basedir/nvidia-driver" >> /root/.bashrc +fi -read -p "press enter to return to shell" +if [[ $nreboot == 1 ]]; then + echo "rm -rf /root/.bashrc" >> /root/.bashrc + echo "============================ [ reboot ] ===========================" + printf "\x1b[1;31mupon reboot, make sure to log in as ROOT first !!!\x1b[0;0m\n" + echo "===================================================================" + read -p "press enter to reboot your system" + echo "rebooting..." + reboot +else + echo "============== [ setup done ] ===============" + echo "username: $username" + echo "you may now log into your user account." + echo "it is recommended to reboot your system now." + echo "==============================================" +fi diff --git a/slackware-bootstrap/kernel b/slackware-bootstrap/kernel new file mode 100644 index 0000000..1a6e31b --- /dev/null +++ b/slackware-bootstrap/kernel @@ -0,0 +1,40 @@ +#!/bin/bash +basedir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +pushd + +mkdir $basedir/linux +cd $basedir/linux +wget https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.15.2.tar.xz +unxz linux* +tar -xvf linux* + +cd linux* +make clean +make mrproper + +zcat /proc/config.gz > .config +make olddefconfig + +make -j12 +make modules_install + +cp arch/x86/boot/bzImage /boot/vmlinuz-generic-6.15.2 + +dirstr=$(ls /boot | grep vmlinuz-6.15.2) +if [[ $dirstr != '' ]]; then + cp System.map /boot/System.map-6.15.2 + cp .config /boot/config-6.15.2 + + rm /boot/vmlinuz + ln -s /boot/vmlinuz-generic-6.15.2 /boot/vmlinuz + + rm /boot/System.map + ln -s /boot/System.map-6.15.2 /boot/System.map + + rm /boot/config + ln -s /boot/config-6.15.2 /boot/config +fi + +popd + diff --git a/slackware-bootstrap/nvidia-driver b/slackware-bootstrap/nvidia-driver new file mode 100644 index 0000000..2efa26b --- /dev/null +++ b/slackware-bootstrap/nvidia-driver @@ -0,0 +1,25 @@ +#!/bin/sh + +pushd + +slpkg --repository="sbo" -d nvidia-kernel +slpkg --repository="sbo" -d nvidia-driver + +cd /tmp/slpkg/nvidia-kernel + +kernelver=$(ls /boot | grep "vmlinuz-generic" | sort | tail -1) +chmod +x ./nvidia-kernel.SlackBuild +KERNEL=$kernelver ./nvidia-kernel.SlackBuild + +cd /tmp/slpkg/nvidia-driver +chmod +x ./nvidia-driver.SlackBuild +COMPAT32="yes" ./nvidia-driver.SlackBuild + +upgradepkg --install-new /tmp/nvidia-kernel* +upgradepkg --install-new /tmp/nvidia-driver* + +touch /etc/modprobe.d/BLACKLIST-nouveau.conf +echo "blacklist nouveau" >> /etc/modprobe.d/BLACKLIST-nouveau.conf +echo "/usr/bin/nvidia-modprobe -c 0 -u" >> /etc/rc.d/rc.local + +popd diff --git a/slackware-bootstrap/slackpkg b/slackware-bootstrap/slackpkg index 7a5942f..4b764e4 100755 --- a/slackware-bootstrap/slackpkg +++ b/slackware-bootstrap/slackpkg @@ -20,6 +20,7 @@ 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" @@ -49,10 +50,15 @@ cp $basedir/slackpkg-blacklist-allowkern /etc/slackpkg/blacklist echo "running full system update ..." slackpkg update slackpkg upgrade slackpkg -slackpkg upgrade-all slackpkg install-new +slackpkg upgrade-all cp $basedir/slackpkg-blacklist /etc/slackpkg/blacklist +kernel=$(ls /boot | grep vmlinuz-generic | sort | tail -1 | cut -d '-' -f 2) + +initrdcmd=$(/usr/share/mkinitrd/mkinitrd_command_generator.sh -k $kernel | tail -1) +$initrdcmd + echo "================= [ kde purge ] ==================" echo "due to how install-new works, kde is always" echo "installed during the first system update." |
