mirror of
https://github.com/nix-community/nixos-anywhere.git
synced 2024-08-16 20:00:36 +03:00
add --kexec paramter to specify custom image
This commit is contained in:
parent
6af2a6650f
commit
5029d6a0fb
@ -14,6 +14,8 @@ Options:
|
||||
pass value to nix-build. can be used to set disk-names for example
|
||||
* --argstr name value
|
||||
pass value to nix-build as string
|
||||
* --kexec url
|
||||
use another kexec tarball to bootstrap NixOS
|
||||
USAGE
|
||||
}
|
||||
|
||||
@ -23,6 +25,7 @@ abort() {
|
||||
}
|
||||
|
||||
nix_args=()
|
||||
kexec_url=https://github.com/nix-community/nixos-images/releases/download/nixos-22.05/nixos-kexec-installer-x86_64-linux.tar.gz
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
@ -39,6 +42,10 @@ while [[ $# -gt 0 ]]; do
|
||||
showUsage
|
||||
exit 0
|
||||
;;
|
||||
--kexec)
|
||||
kexec_url=$2
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
if [ -z ${ssh_connection+x} ]; then
|
||||
ssh_connection=$1
|
||||
@ -80,7 +87,7 @@ fetch(){
|
||||
}
|
||||
rm -rf /root/kexec
|
||||
mkdir -p /root/kexec
|
||||
fetch https://github.com/nix-community/nixos-images/releases/download/nixos-22.05/nixos-kexec-installer-x86_64-linux.tar.gz | tar -C /root/kexec -xvzf-
|
||||
fetch "$kexec_url" | tar -C /root/kexec -xvzf-
|
||||
export TMPDIR=/root/kexec
|
||||
setsid /root/kexec/kexec/run
|
||||
SSH
|
||||
|
Loading…
Reference in New Issue
Block a user