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