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