upd install.sh script

This commit is contained in:
2026-06-13 02:45:26 +03:00
parent a3bcf16eaa
commit 2be695fa6a
2 changed files with 14 additions and 9 deletions

View File

@ -0,0 +1,3 @@
wpa_supplicant 2.12
=
https://git.w1.fi/hostap.git

View File

@ -1,18 +1,20 @@
#!/bin/sh
errors=""
[ -z "$aeropkg_home" ] && errors="${errors}aeropkg_home must be set to build\n"
[ -z "$aeropkg_base" ] && errors="${errors}aeropkg_base must be set to build\n"
if [ -n "$errors" ]; then
printf "Error:\n$errors" >&2
exit 1
# Set default values if not provided
if [ -z "$aeropkg_home" ]; then
export aeropkg_home="/pkg/gnu/aeropkg"
echo "Warning: aeropkg_home not set. Using default: $aeropkg_home"
fi
if [ -z "$aeropkg_base" ]; then
export aeropkg_base="/pkg"
echo "Warning: aeropkg_base not set. Using default: $aeropkg_base"
fi
INSTALL_PATH="$aeropkg_home"
BASE_PATH="$aeropkg_base"
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
cargo build --release
mkdir -p "$SCRIPT_DIR/target/release/bin"
cp -f "$SCRIPT_DIR/target/release/pkg" "$SCRIPT_DIR/target/release/bin"
@ -24,11 +26,11 @@ BIN_PATH="$INSTALL_PATH/bin/pkg"
if [ -f "$BIN_PATH" ]; then
patchelf --set-interpreter /pkg/gnu/glibc/lib/ld-linux-x86-64.so.2 "$BIN_PATH"
if [ $? -ne 0 ]; then
echo "Error: Failed to apply patchelf to '$BIN_PATH'."
echo "Error: Failed to apply patchelf to '$BIN_PATH'." >&2
exit 1
fi
else
echo "Error: Executable '$BIN_PATH' not found after installation."
echo "Error: Executable '$BIN_PATH' not found after installation." >&2
exit 1
fi