diff --git a/root/etc/cont-init.d/94-ros2-src b/root/etc/cont-init.d/94-ros2-src index 720dbba..f91299b 100755 --- a/root/etc/cont-init.d/94-ros2-src +++ b/root/etc/cont-init.d/94-ros2-src @@ -6,7 +6,8 @@ if ! dpkg -l | grep gnupg > /dev/null; then fi source /etc/lsb-release -[[ ! -f "/etc/apt/sources.list.d/ros2.list" ]] && \ +if [ ! -f "/etc/apt/sources.list.d/ros2.list" ]; then curl -sL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key | apt-key add - && \ echo "deb http://packages.ros.org/ros2/ubuntu ${DISTRIB_CODENAME} main" \ > /etc/apt/sources.list.d/ros2.list +fi diff --git a/root/etc/cont-init.d/98-ros2 b/root/etc/cont-init.d/98-ros2 index 3e2b01a..cc07d7b 100755 --- a/root/etc/cont-init.d/98-ros2 +++ b/root/etc/cont-init.d/98-ros2 @@ -4,3 +4,6 @@ echo "**** Installing ros2 and ros dev tools" apt-get install -y \ ros-humble-ros-base \ ros-dev-tools + +echo "**** Automatically sourcing ROS2 ****" + printf "\n# Automatically source ROS2 humble\nsource /opt/ros/humble/setup.bash" >> /config/.bashrc \ No newline at end of file diff --git a/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-ros2-add-package/run b/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-ros2-add-package/run index 2d82736..761af83 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-ros2-add-package/run +++ b/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-ros2-add-package/run @@ -12,7 +12,7 @@ if [ ! -f "/etc/apt/sources.list.d/ros2.list" ]; then echo "ros-humble-ros-base ros-dev-tools" >> /mod-repo-packages-to-install.list echo "**** Automatically sourcing ROS2 ****" - printf "\n# Automatically source ROS2 humble\nsource /opt/ros/humble/setup.bash" >> /etc/bash.bashrc + printf "\n# Automatically source ROS2 humble\nsource /opt/ros/humble/setup.bash" >> /config/.bashrc else echo "**** ROS2 packages already installed, skipping ****" fi \ No newline at end of file