build(quic): bundle Linux runtime libraries [CI]
This commit is contained in:
1 parent
e2e5e437cb
commit
29d998bc94
18 files changed
+227
-15
No files matched your search
+13
-1
@@ -62,6 +62,14 @@ install_binary() {
|
||||
put 0755 "$HERE/$src" "$PREFIX/$src"
|
||||
}
|
||||
|
||||
install_quic_runtime() {
|
||||
[ -f "$HERE/libmsquic.so.2" ] || die "libmsquic.so.2 is missing from this Linux release archive"
|
||||
[ -f "$HERE/libnuma.so.1" ] || die "libnuma.so.1 is missing from this Linux release archive"
|
||||
set -- "$HERE"/lib*.so.*
|
||||
mkdir -p "$PREFIX"
|
||||
for library do put 0644 "$library" "$PREFIX/$(basename "$library")"; done
|
||||
}
|
||||
|
||||
write_config() {
|
||||
if [ "$1" = agent ]; then
|
||||
cat >"$CONFIG/agent.json" <<JSON
|
||||
@@ -104,6 +112,7 @@ install_role() {
|
||||
|
||||
install_binary "moshiro-$role"
|
||||
install_binary fleet-enroll
|
||||
install_quic_runtime
|
||||
say "installed binaries to $PREFIX"
|
||||
|
||||
init="$(init_system)"
|
||||
@@ -117,7 +126,7 @@ install_role() {
|
||||
put 0755 "$HERE/openwrt/moshiro-probe.init" /etc/init.d/moshiro-probe
|
||||
mkdir -p /lib/upgrade/keep.d
|
||||
put 0644 "$HERE/openwrt/moshiro.keep" /lib/upgrade/keep.d/moshiro ;;
|
||||
*) echo "warning: no systemd or procd found: start $PREFIX/moshiro-$role --config $CONFIG/$role.json with your own supervisor" >&2 ;;
|
||||
*) echo "warning: no systemd or procd found: start with LD_LIBRARY_PATH=$PREFIX $PREFIX/moshiro-$role --config $CONFIG/$role.json under your own supervisor" >&2 ;;
|
||||
esac
|
||||
|
||||
ready=0
|
||||
@@ -162,6 +171,9 @@ uninstall() {
|
||||
esac
|
||||
rm -f "$PREFIX/moshiro-$role"
|
||||
rm -f "$PREFIX/fleet-enroll"
|
||||
other_role=agent
|
||||
[ "$role" = agent ] && other_role=probe
|
||||
[ -x "$PREFIX/moshiro-$other_role" ] || rm -f "$PREFIX"/lib*.so.*
|
||||
rmdir "$PREFIX" 2>/dev/null || true
|
||||
if [ "$purge" -eq 1 ]; then
|
||||
rm -rf "$CONFIG"
|
||||
|
||||
Reference in new issue
Block a user