home · contact · privacy
c306dbeedc34a66405d1f9d1c89257b801f36bde
[config] / bookworm / setup_scripts / setup_desktop.sh
1 #!/bin/sh
2 set -e
3 set -x
4 debian_version="bookworm"
5 legal_system_names="x220 w530"
6
7 if [ "$#" -ne 1 ]; then
8     echo 'Need exactly one argument (system name).'
9     false
10 fi
11 found=0
12 for system_name_i in $legal_system_names; do
13     if [ "$1" = "$system_name_i" ]; then
14         found=1
15         system_name="${system_name_i}"
16         continue        
17     fi
18 done
19 if [ "$found" = 0 ]; then
20     echo "Need legal system name."
21     false
22 fi
23
24 # Set up system without user environment.
25 config_tree_prefix="${HOME}/config/${debian_version}"
26 setup_scripts_dir="${config_tree_prefix}/setup_scripts"
27 cd "${setup_scripts_dir}"
28 ./setup.sh "${system_name}" "" user desktop thinkpad "${system_name}"
29
30 if [ "$system_name" = "w530" ]; then
31     cd
32     git clone https://github.com/NVIDIA/open-gpu-kernel-modules
33     cd open-gpu-kernel-modules
34     git checkout 337e28e
35     make modules -j$(nproc)
36     make modules_install
37     cd
38     driver_version=535.86.05
39     runscript=NVIDIA-Linux-x86_64-${driver_version}.run
40     wget https://us.download.nvidia.com/XFree86/Linux-x86_64/${driver_version}/${runscript}
41     chmod u+x ${runscript} 
42     ./${runscript} --no-kernel-modules
43 fi
44
45 # Set up user environments.
46 cd "${setup_scripts_dir}"
47 ./copy_dirtree.sh "${config_tree_prefix}/home_files" "/root" minimal root
48 adduser --disabled-password --gecos "" plom
49 usermod -a -G sudo plom
50 passwd plom
51 cp setup_home.sh /home/plom
52 chown plom:plom /home/plom/setup_home.sh