Skip to content

Commit 0a619ab

Browse files
committed
create-deb-deploy: cleanup due to base image switch
1 parent c349baf commit 0a619ab

1 file changed

Lines changed: 10 additions & 91 deletions

File tree

scripts/create-deb-deploy.sh

Lines changed: 10 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -84,24 +84,6 @@ CLEAN_BUILD="${CLEAN_BUILD:-0}"
8484
CMAKE_ARGS="${CMAKE_ARGS:-}"
8585
BUILD_ARGS="${BUILD_ARGS:--j${JOBS}}"
8686

87-
DEPLOY_FLAGS=(
88-
DLS_DEPLOY_gazebo_sim
89-
DLS_DEPLOY_pid_controller
90-
DLS_DEPLOY_periodic_generator
91-
DLS_DEPLOY_foot_traj_generator
92-
DLS_DEPLOY_gait_timer
93-
DLS_DEPLOY_terrain_estimator
94-
DLS_DEPLOY_trunk_controller
95-
DLS_DEPLOY_dls_keyboard
96-
DLS_DEPLOY_dls_gamepad
97-
)
98-
99-
CMAKE_DEPLOY_ARGS=()
100-
for flag in "${DEPLOY_FLAGS[@]}"; do
101-
value="${!flag:-ON}"
102-
CMAKE_DEPLOY_ARGS+=("-D${flag}=${value}")
103-
done
104-
10587
mkdir -p "${ART_DIR}"
10688
rm -f "${DEB_PATH}" "${ART_DIR}/pkg_files.txt" "${BUILD_LOG}"
10789

@@ -129,7 +111,6 @@ run_pipeline() {
129111

130112
cmake -S "${ROOT_DIR}" -B "${build_dir}" -DCMAKE_BUILD_TYPE=Release \
131113
-DCMAKE_INSTALL_PREFIX=/ \
132-
"${CMAKE_DEPLOY_ARGS[@]}" \
133114
"${cmake_user_args[@]}"
134115

135116
if [[ "${BUILD_VERBOSE}" == "1" ]]; then
@@ -151,86 +132,24 @@ run_pipeline() {
151132
strip "${stage_dir}/usr/bin/dls2/child_process_launcher" || true
152133
strip "${stage_dir}/usr/lib/librobotlib.so" || true
153134

154-
copy_into_stage() {
155-
local src="$1"
156-
local dst="${stage_dir}${src}"
157-
[[ -f "${src}" ]] || return 0
158-
mkdir -p "$(dirname "${dst}")"
159-
if [[ -L "${src}" ]]; then
160-
cp -a --no-dereference "${src}" "${dst}"
161-
local resolved
162-
resolved="$(readlink -f "${src}" || true)"
163-
if [[ -n "${resolved}" && "${resolved}" != "${src}" && -f "${resolved}" ]]; then
164-
copy_into_stage "${resolved}"
165-
fi
166-
else
167-
cp -a "${src}" "${dst}"
168-
fi
169-
}
170-
171-
copy_ldd_closure() {
172-
local target="$1"
173-
[[ -e "${target}" ]] || return 0
174-
(ldd "${target}" 2>/dev/null || true) \
175-
| awk '
176-
/=> \/ {print $3}
177-
/^\// {print $1}
178-
' \
179-
| sort -u \
180-
| while IFS= read -r lib; do
181-
[[ -f "${lib}" ]] || continue
182-
case "$(basename "${lib}")" in
183-
libfastdds.so*|libfastcdr.so*|libfastdds_statistics_backend.so*|libpinocchio*.so*|libcoal.so*)
184-
continue
185-
;;
186-
liburdfdom_model.so*|liburdfdom_model_state.so*|liburdfdom_sensor.so*|liburdfdom_world.so*)
187-
continue
188-
;;
189-
libgz-math*.so*|libgz-utils*.so*)
190-
continue
191-
;;
192-
esac
193-
case "${lib}" in
194-
/usr/local/lib/*)
195-
copy_into_stage "${lib}"
196-
;;
197-
*)
198-
;;
199-
esac
200-
done
201-
}
202-
203-
for p in /usr/local/lib/liburdfdom*.so*; do
204-
for f in $p; do
205-
[[ -e "${f}" ]] || continue
206-
copy_into_stage "${f}"
207-
done
208-
done
209-
210-
if [[ -d "${stage_dir}/usr/lib/dls2" ]]; then
211-
while IFS= read -r sofile; do
212-
copy_ldd_closure "${sofile}"
213-
done < <(find "${stage_dir}/usr/lib/dls2" -type f -name '*.so*' | sort -u)
214-
fi
215-
if [[ -d "${stage_dir}/usr/bin/dls2" ]]; then
216-
while IFS= read -r exe; do
217-
copy_ldd_closure "${exe}"
218-
done < <(find "${stage_dir}/usr/bin/dls2" -type f -perm -111 | sort -u)
219-
fi
220-
if [[ -x "${stage_dir}/usr/bin/dls" ]]; then
221-
copy_ldd_closure "${stage_dir}/usr/bin/dls"
222-
fi
223-
224135
if [[ -f "${stage_dir}/usr/bin/dls" ]]; then
225136
awk '
226137
NR == 1 {
227138
print
228-
print "export LD_LIBRARY_PATH=\"/opt/ros/jazzy/lib/x86_64-linux-gnu:/usr/local/lib:/usr/lib:${LD_LIBRARY_PATH:-}\""
139+
print "export LD_LIBRARY_PATH=\"/opt/ros/jazzy/lib/x86_64-linux-gnu:/usr/local/lib:/usr/lib:/usr/lib/dls2:/usr/lib/dls2/motion_generators:/usr/lib/dls2/controllers:/usr/lib/dls2/estimators:/usr/lib/dls2/messages:${LD_LIBRARY_PATH:-}\""
140+
print "export DLS_SERVERS_PATH=\"${DLS_SERVERS_PATH:-/usr/include/dls2/util/messaging/servers.yaml}\""
141+
print "export DLS_SAFETY_LAYER_PATH=\"${DLS_SAFETY_LAYER_PATH:-/usr/include/dls2/supervisor/data/safety_layer.yaml}\""
142+
print "export DLS_SCHEDULER_PATH=\"${DLS_SCHEDULER_PATH:-/usr/include/dls2/schedulers}\""
143+
print "export GZ_SIM_RESOURCE_PATH=\"${GZ_SIM_RESOURCE_PATH:-/usr/local/share/dls-gazebo/worlds}\""
229144
next
230145
}
231146
/fastdds shm clean/ {
232147
print "command -v fastdds >/dev/null 2>&1 && fastdds shm clean > /dev/null 2>/dev/null || true"
233-
print
148+
next
149+
}
150+
/dynamic_legged_systems_framework / {
151+
sub(/^[[:space:]]*/, "")
152+
print "exec " $0
234153
next
235154
}
236155
{ print }

0 commit comments

Comments
 (0)