From 2be695fa6ace149f32ae24bf0376346a9e6ebef3 Mon Sep 17 00:00:00 2001 From: TraceLumen Date: Sat, 13 Jun 2026 02:45:26 +0300 Subject: [PATCH] upd install.sh script --- assets/var/gnu/wpa_supplicant.md | 3 +++ install.sh | 20 +++++++++++--------- 2 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 assets/var/gnu/wpa_supplicant.md diff --git a/assets/var/gnu/wpa_supplicant.md b/assets/var/gnu/wpa_supplicant.md new file mode 100644 index 0000000..71d5315 --- /dev/null +++ b/assets/var/gnu/wpa_supplicant.md @@ -0,0 +1,3 @@ +wpa_supplicant 2.12 += +https://git.w1.fi/hostap.git diff --git a/install.sh b/install.sh index f069bfe..45060af 100755 --- a/install.sh +++ b/install.sh @@ -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