summaryrefslogtreecommitdiff
path: root/slackware-bootstrap/step2
blob: 2598cf71959cc682480a6ef273bfc237d166a37f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
basedir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

kernelver="6.15.2"

rm /root/.bash_profile

if [[ ! -f "~/.slpkg-done" ]]; then
  sh $basedir/slpkg
fi

if [[ ! -f "~/.multilib-done" ]]; then
  sh $basedir/multilib
fi

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

  read -p "do you want to update your kernel [y/n]? (y):" choice
  if [[ $choice == "y" ]]; then
    nreboot=1
    sh $basedir/kernel
  fi
fi

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/.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 "==================================================================="
  read -p "press enter to reboot your system"
  echo "rebooting..."
  reboot
else
  sh $basedir/runlevel
  sh $basedir/cleanup

  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