From 99609378228a5a5e88ec160df6325ed495a1fa83 Mon Sep 17 00:00:00 2001 From: leegs Date: Tue, 29 Oct 2024 22:47:40 -0400 Subject: [PATCH] Update postinstall.sh Updates to simplify functionality. --- focal_install/o405-uxx/postinstall.sh | 79 ++++----------------------- 1 file changed, 12 insertions(+), 67 deletions(-) diff --git a/focal_install/o405-uxx/postinstall.sh b/focal_install/o405-uxx/postinstall.sh index 15e7838..8cec4e2 100644 --- a/focal_install/o405-uxx/postinstall.sh +++ b/focal_install/o405-uxx/postinstall.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -#### BASIC DESKTOP INSTALLATION STUFF #### +#### BASIC DESKTOP INSTALLATION #### # Update the APT database apt update @@ -13,11 +13,6 @@ apt install -y -qq ubuntu-desktop # Convert the installation to an Ubuntu Desktop (snap) snap install firefox gnome-3-38-2004 gtk-common-themes snap-store snapd-desktop-integration -#### CAMPUS COMPUTER PACKAGES #### - -# # Install things required for campus computers -# apt install -y -qq nfs-common sssd-ad sssd sssd-tools libnss-sss libpam-sss realmd samba-common-bin adcli sssd-ldap ldap-utils sssd-ldap krb5-user sshfs - #### ROS INSTALLATION #### # Add ROS repository @@ -29,7 +24,7 @@ apt update apt install -y -qq git ros-noetic-desktop-full python3-rosdep snap install --classic code -#### EXTRA ROS REPOSITORIES #### +#### EXTRA CWRU ROS REPOSITORIES and GAZEBO REPOSITORY #### # Add cwru-ecse-373 repository wget -q https://cwru-ecse-373.github.io/cwru-ecse-373.asc -O - | apt-key add - @@ -38,14 +33,18 @@ apt-add-repository https://cwru-ecse-373.github.io/repo # Add cwru-ecse-376 repository wget -q https://cwru-ecse-376.github.io/cwru-ecse-376.asc -O - | apt-key add - apt-add-repository https://cwru-ecse-376.github.io/repo -apt update # Add Gazebo repository +# This is necessary because the ECSE 373 repository packages were built with it installed. +# It would be ideal to rebuild those packages, but not likely to happen. wget https://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add - sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list' -# Install stuff from new repositories -apt install -y -qq ros-noetic-stdr-simulator ros-noetic-osrf-gear ros-noetic-ur-kinematics ros-noetic-ecse-373-ariac +# Update the apt database with the packages from the new repositories +apt update + +# Install packages from new repositories +apt install -y ros-noetic-stdr-simulator ros-noetic-osrf-gear ros-noetic-ur-kinematics ros-noetic-ecse-373-ariac #### BASIC CONFIGURAIONS #### @@ -63,40 +62,10 @@ mkdir /etc/skel/.config/update-notifier # Logout stale users echo '#!/usr/bin/env sh' > /etc/cron.hourly/logout_stale.sh -echo "kill -9 `who -u | gawk '/old/ {print $6}' - `" >> /etc/cron.hourly/logout_stale.sh - -# Add logout script -# Update the logout script everytime in case it changed -echo "cp /etc/skel/.bash_logout ~/" >> /etc/bash.bashrc -# # Remove the build directory for ariac (hopefully obsolete) -# echo "rm -rf /tmp/ariac >/dev/null 2>/dev/null & disown" >> /etc/skel/.bash_logout -# Make sure every thing ROS (and Gazebo) related is killed when logging out -echo "killall roslaunch roscore gzserver gzclient >/dev/null 2>/dev/null & disown" >> /etc/skel/.bash_logout - -# # # Add saabd drive -# # mkdir /mgc -# echo "# saabd.eecs.cwru.edu:/mgc /mgc nfs rsize=8192,wsize=8192,timeo=14,intr" >> /etc/fstab - - -#### TEMPORARY FIXES FOR GLENNAN FIFTH FLOOR #### - -# # This is temporary until individual accounts work -# echo "rm -rf ~/.ssh/*" >> /etc/bash.bashrc -# echo "rm -rf ~/.git" >> /etc/bash.bashrc -# echo "rm -rf ~/*_ws" >> /etc/bash.bashrc - -# # Add LabHome stuff (seems broken) -# wget -O /etc/xdg/autostart/mounthomegui.desktop http://raw.githubusercontent.com/cwru-robotics/cwru_robotics_autoinstall_scripts/focal_install/o405-uxx/mounthomegui.desktop -# wget -O /usr/bin/mountHomePrompt.sh http://raw.githubusercontent.com/cwru-robotics/cwru_robotics_autoinstall_scripts/focal_install/o405-uxx/mountHomePrompt.sh -# wget -O /usr/bin/mountHomeGUI.sh http://raw.githubusercontent.com/cwru-robotics/cwru_robotics_autoinstall_scripts/focal_install/o405-uxx/mountHomeGUI.sh -# wget -O /usr/bin/mountHome.sh http://raw.githubusercontent.com/cwru-robotics/cwru_robotics_autoinstall_scripts/focal_install/o405-uxx/mountHome.sh -# chmod ugo+x /usr/bin/mountHome*.sh - -# echo "/usr/bin/mountHomePrompt.sh" /etc/skel/.profile - -# wget -O /etc/cron.hourly/logout_stale.sh http://raw.githubusercontent.com/cwru-robotics/cwru_robotics_autoinstall_scripts/focal_install/o405-uxx/logout_stale.sh -# chmod ugo+x /usr/cron.hourly/logout_stale.sh +echo "kill -9 \`who -u | gawk '/old/ {print $6}' - \`" >> /etc/cron.hourly/logout_stale.sh +# Kill any stray ROS or Gazebo processes when logging in. +echo "killall roslaunch gzclient gzserver roscore >/dev/null 2>/dev/null & disown" >> /etc/bash.bashrc #### FINISH UP #### @@ -104,29 +73,5 @@ echo "killall roslaunch roscore gzserver gzclient >/dev/null 2>/dev/null & disow apt-get update apt-get upgrade -y - -# apt-get install ./ros-noetic-* - -# # Build custom ROS stuff for now -# mkdir -p ros_ws/src -# cd ros_ws/src -# git clone https://github.com/cwru-eecs-275/stdr_simulator.git -# git clone https://github.com/cwru-eecs-373/cwru_ariac_2019.git -# git clone https://github.com/cwru-eecs-373/ecse_373_ariac.git - -# cd ../ - -# source /opt/ros/noetic/setup.bash - -# rosdep init -# rosdep update - -# rosdep install --from-paths src --ignore-src -r -y - -# catkin_make -j 4 -l 4.0 -DCMAKE_INSTALL_PREFIX=/opt/ros/noetic - -# sudo bash -c "source /opt/ros/noetic/setup.bash; catkin_make -j 4 -l 4.0 -DCMAKE_INSTALL_PREFIX=/opt/ros/noetic install" - - # return 0