X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=bookworm%2Fsetup_scripts%2Fsetup_desktop.sh;h=9675df81987ac29ebfc3198ea6aa122f603121f6;hb=05af7e748a62b71f20597bb559106c8692c34ef4;hp=f265697f17c33726a7461019eb3e214deb27ec70;hpb=f50c2ff925fb389818dcb23a684acc0275821a36;p=config diff --git a/bookworm/setup_scripts/setup_desktop.sh b/bookworm/setup_scripts/setup_desktop.sh index f265697..9675df8 100755 --- a/bookworm/setup_scripts/setup_desktop.sh +++ b/bookworm/setup_scripts/setup_desktop.sh @@ -1,27 +1,36 @@ #!/bin/sh set -e -debian_version="bookworm" -legal_system_names="x220 w530" +set -x +. ./misc.sh -if [ "$#" -ne 1 ]; then - echo 'Need exactly one argument (system name).' - false -fi -found=0 -for system_name_i in $legal_system_names; do - if [ "$1" = "$system_name_i" ]; then - found=1 - system_name="${system_name_i}" - continue - fi -done -if [ "$found" = 0 ]; then - echo "Need legal system name." - false -fi +expect_n_args 1 "(system name)" "$@" +get_system_name_arg "$1" # Set up system without user environment. -config_tree_prefix="${HOME}/config/${debian_version}" -setup_scripts_dir="${config_tree_prefix}/setup_scripts" cd "${setup_scripts_dir}" ./setup.sh "${system_name}" "" user desktop thinkpad "${system_name}" + +# Set up NVIDIA eGPU config. +if [ "$system_name" = "w530" ]; then + cd + git clone https://github.com/NVIDIA/open-gpu-kernel-modules + cd open-gpu-kernel-modules + git checkout 337e28e + make modules -j$(nproc) + make modules_install + cd + driver_version=535.86.05 + runscript=NVIDIA-Linux-x86_64-${driver_version}.run + wget https://us.download.nvidia.com/XFree86/Linux-x86_64/${driver_version}/${runscript} + chmod u+x ${runscript} + ./${runscript} --no-kernel-modules +fi + +# Set up user environments. +cd "${setup_scripts_dir}" +./copy_dirtree.sh "${config_tree_prefix}/home_files" "/root" minimal root +adduser --disabled-password --gecos "" plom +usermod -a -G sudo plom +passwd plom +cp setup_home.sh /home/plom +chown plom:plom /home/plom/setup_home.sh