Files
balena-supervisor/build-utils/setup-systemd-tools.sh
Ken Bannister 8ddc095612 Initial commit to run upgrade-2.x.sh from within Supervisor
Presently always runs 90 seconds after startup.
2025-06-19 20:29:13 -04:00

24 lines
637 B
Bash
Executable File

#!/bin/sh
set -e
# journalctl
mkdir -p /sysroot/bin
cp /bin/journalctl /sysroot/bin/
# Get all library dependencies from the binary
for lib in $(ldd /bin/journalctl | grep -oE '(\/.+?) '); do
mkdir -p "/sysroot/$(dirname "$lib")"
# Copy the dependency dereferencing any symlinks
cp -L "$lib" "/sysroot/$lib"
done
# systemd-run
mkdir -p /sysroot/usr/bin
cp /usr/bin/systemd-run /sysroot/usr/bin/
# Get all library dependencies from the binary
for lib in $(ldd /usr/bin/systemd-run | grep -oE '(\/.+?) '); do
mkdir -p "/sysroot/$(dirname "$lib")"
# Copy the dependency dereferencing any symlinks
cp -L "$lib" "/sysroot/$lib"
done