first commit
This commit is contained in:
commit
093e6a7c14
39 files changed
+1112
No files matched your search
Executable
+22
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
if [[ ${EUID} -ne 0 ]]; then
|
||||
echo "Run as root" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
apt-get update
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y docker.io rustup build-essential pkg-config
|
||||
systemctl enable --now docker
|
||||
|
||||
TARGET_USER="${SUDO_USER:-root}"
|
||||
if [[ "$TARGET_USER" == "root" ]]; then
|
||||
rustup default stable
|
||||
cargo install cross --locked
|
||||
else
|
||||
sudo -u "$TARGET_USER" -H sh -c 'rustup default stable && cargo install cross --locked'
|
||||
fi
|
||||
|
||||
echo "Docker + rustup + cross installed for $TARGET_USER."
|
||||
echo "Use BUILD_MODE=cross-binary only for development validation."
|
||||
Reference in new issue
Block a user