Archived
fix: sudo the tarball/image staging into /var/lib/vz
Check NixOS configurations / eval-hosts (pull_request) Successful in 10m20s
Check NixOS configurations / eval-hosts (pull_request) Successful in 10m20s
The post-build cp/mv into /var/lib/vz/template/cache (LXC) and /var/lib/vz/import (VM) are Proxmox-owned root directories -- they need sudo_pfx just like pct/qm/pvesh do. nix build writes to the nix store as the SSH user, but staging into /var/lib/vz/ requires root. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -705,8 +705,8 @@ if [[ -z "$built" ]]; then
|
|||||||
echo "ERROR: no tarball found under result-${target}/tarball after build." >&2
|
echo "ERROR: no tarball found under result-${target}/tarball after build." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
mkdir -p "$dest_dir"
|
$sudo_pfx mkdir -p "$dest_dir"
|
||||||
cp "$built" "${dest_dir}/${dest_name}"
|
$sudo_pfx cp "$built" "${dest_dir}/${dest_name}"
|
||||||
echo "Built and staged: ${dest_dir}/${dest_name}"
|
echo "Built and staged: ${dest_dir}/${dest_name}"
|
||||||
REMOTE_SCRIPT
|
REMOTE_SCRIPT
|
||||||
local_image="$remote_path"
|
local_image="$remote_path"
|
||||||
@@ -748,8 +748,8 @@ if [[ -z "$built" ]]; then
|
|||||||
echo "ERROR: no .raw image found in ${repo_dir} after build." >&2
|
echo "ERROR: no .raw image found in ${repo_dir} after build." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
mkdir -p "$dest_dir"
|
$sudo_pfx mkdir -p "$dest_dir"
|
||||||
mv "$built" "${dest_dir}/${dest_name}"
|
$sudo_pfx mv "$built" "${dest_dir}/${dest_name}"
|
||||||
echo "Built and staged: ${dest_dir}/${dest_name}"
|
echo "Built and staged: ${dest_dir}/${dest_name}"
|
||||||
REMOTE_SCRIPT
|
REMOTE_SCRIPT
|
||||||
local_image="$remote_path"
|
local_image="$remote_path"
|
||||||
|
|||||||
Reference in New Issue
Block a user