home · contact · privacy
Update bookworm setup to accommodate h610m.
[config] / bookworm / setup_scripts / setup_desktop.sh
1 #!/bin/sh
2 set -e
3 . ./misc.sh
4
5 expect_n_args 1 "(system name)" "$@"
6 get_system_name_arg "$1"
7
8 # Set up system without user environment.
9 cd "${setup_scripts_dir}"
10 if [ "$system_name" = "w530" || "$system_name" = "x220"]; then
11     ./_setup.sh "${system_name}" "" user desktop thinkpad "${system_name}"
12 else
13     ./_setup.sh "${system_name}" "" user desktop "${system_name}"
14 fi
15
16 # # Set up printer.
17 # ppd_deb="hll2350dwpdrv-4.0.0-1.i386.deb"
18 # wget "https://download.brother.com/welcome/dlf103566/${ppd_deb}"
19 # dpkg --add-architecture i386
20 # apt update
21 # apt install -y "./${ppd_deb}"
22 # service cups restart
23 # # lpadmin -p 'Brother_HLL2350DW' -m 'brother-HLL2350DW-cups-en.ppd'
24 # rm "./${ppd_deb}"
25 # # TODO explore potential lpadmin options like -o 'OutputMode=NormalGray'
26
27 # Set up NVIDIA eGPU config.
28 if [ "$system_name" = "w530" ]; then
29     cd
30     git clone https://github.com/NVIDIA/open-gpu-kernel-modules
31     cd open-gpu-kernel-modules
32     git checkout 337e28e
33     # git checkout 4c29105335610933e744f4ab2524ea63fc39edaf
34     make modules -j$(nproc)
35     make modules_install
36     cd
37     driver_version=535.86.05
38     # driver_version=545.29.06
39     runscript=NVIDIA-Linux-x86_64-${driver_version}.run
40     wget https://us.download.nvidia.com/XFree86/Linux-x86_64/${driver_version}/${runscript}
41     rmmod nouveau
42     chmod u+x ${runscript} 
43     ./${runscript} --no-kernel-modules --silent
44     depmod
45     # TODO I suspect that the GPU falling of the bus may be mildened by running nvidia-persistenced, check https://github.com/NVIDIA/nvidia-persistenced/tree/main/init  
46 fi
47
48 # Set up user environments.
49 cd "${setup_scripts_dir}"
50 ./copy_dirtree.sh "${config_tree_prefix}/home_files" "/root" minimal root
51 adduser --disabled-password --gecos "" plom
52 usermod -a -G sudo plom
53 passwd plom
54 cp -a ~/config /home/plom
55 chown -R plom:plom /home/plom/config