diff --git a/.gitignore b/.gitignore index 639d6e7..56f7b2e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ !.cargo !.cargo/** !install.sh +!dev.sh !Readme.md !src diff --git a/assets/var/gnu/aeropkg.md b/assets/var/gnu/aeropkg.md new file mode 100644 index 0000000..9d1b6a7 --- /dev/null +++ b/assets/var/gnu/aeropkg.md @@ -0,0 +1,8 @@ +aeropkg += +https://root-kit.ru/AeroLinux/AeroPkg.git + +``` sh *** build *** +cargo build --release +./install.sh +``` diff --git a/dev.sh b/dev.sh new file mode 100755 index 0000000..2a94255 --- /dev/null +++ b/dev.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +# 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" + +echo "Installing to '$INSTALL_PATH'..." +rsync -a --delete --exclude='etc/' "$SCRIPT_DIR/assets/" "$SCRIPT_DIR/target/release/bin" "$INSTALL_PATH/" +PATH="/bin:/pkg/musl/bin:/pkg/musl/sbin:/pkg/gnu/bin:/pkg/gnu/sbin" chroot /mnt/aerolinux /pkg/gnu/aeropkg/bin/pkg link aeropkg +rsync -a --delete --exclude='etc/' "$SCRIPT_DIR/assets/" "$SCRIPT_DIR/target/release/bin" air:"$INSTALL_PATH/" +ssh air /pkg/gnu/aeropkg/bin/pkg link aeropkg +rsync -a --delete --exclude='etc/index-conflict.md' "$SCRIPT_DIR/assets/" "$SCRIPT_DIR/target/release/bin" aura:"$INSTALL_PATH/" +ssh aura /pkg/gnu/aeropkg/bin/pkg link aeropkg + +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'." >&2 + exit 1 + fi +else + echo "Error: Executable '$BIN_PATH' not found after installation." >&2 + exit 1 +fi + +echo "Project successfully installed to '$INSTALL_PATH'" +echo "Base directory: '$BASE_PATH'" diff --git a/install.sh b/install.sh index 2a94255..625d2a2 100755 --- a/install.sh +++ b/install.sh @@ -21,11 +21,8 @@ cp -f "$SCRIPT_DIR/target/release/pkg" "$SCRIPT_DIR/target/release/bin" echo "Installing to '$INSTALL_PATH'..." rsync -a --delete --exclude='etc/' "$SCRIPT_DIR/assets/" "$SCRIPT_DIR/target/release/bin" "$INSTALL_PATH/" -PATH="/bin:/pkg/musl/bin:/pkg/musl/sbin:/pkg/gnu/bin:/pkg/gnu/sbin" chroot /mnt/aerolinux /pkg/gnu/aeropkg/bin/pkg link aeropkg -rsync -a --delete --exclude='etc/' "$SCRIPT_DIR/assets/" "$SCRIPT_DIR/target/release/bin" air:"$INSTALL_PATH/" -ssh air /pkg/gnu/aeropkg/bin/pkg link aeropkg -rsync -a --delete --exclude='etc/index-conflict.md' "$SCRIPT_DIR/assets/" "$SCRIPT_DIR/target/release/bin" aura:"$INSTALL_PATH/" -ssh aura /pkg/gnu/aeropkg/bin/pkg link aeropkg +"$INSTALL_PATH/bin/pkg" link aeropkg + BIN_PATH="$INSTALL_PATH/bin/pkg" if [ -f "$BIN_PATH" ]; then