Skip to content

Commit f964678

Browse files
johbomergify[bot]
authored andcommitted
Add new parameter "--kexec-extra-flags"
This allows to pass in special flags like "--no-sync" into the call to "kexec".
1 parent 4079e0d commit f964678

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/nixos-anywhere.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Options:
2727
do not reboot after installation, allowing further customization of the target installation.
2828
* --kexec <path>
2929
use another kexec tarball to bootstrap NixOS
30+
* --kexec-extra-flags
31+
extra flags to add into the call to kexec, e.g. "--no-sync"
3032
* --post-kexec-ssh-port <ssh_port>
3133
after kexec is executed, use a custom ssh port to connect. Defaults to 22
3234
* --copy-host-keys
@@ -65,6 +67,7 @@ step() {
6567

6668
here=$(dirname "${BASH_SOURCE[0]}")
6769
kexec_url=""
70+
kexec_extra_flags=""
6871
enable_debug=""
6972
maybe_reboot="sleep 6 && reboot"
7073
nix_options=(
@@ -123,6 +126,10 @@ while [[ $# -gt 0 ]]; do
123126
kexec_url=$2
124127
shift
125128
;;
129+
--kexec-extra-flags)
130+
kexec_extra_flags=$2
131+
shift
132+
;;
126133
--post-kexec-ssh-port)
127134
post_kexec_ssh_port=$2
128135
shift
@@ -396,7 +403,7 @@ SSH
396403
fi
397404

398405
ssh_ <<SSH
399-
TMPDIR=/root/kexec setsid ${maybe_sudo} /root/kexec/kexec/run
406+
TMPDIR=/root/kexec setsid ${maybe_sudo} /root/kexec/kexec/run --kexec-extra-flags "${kexec_extra_flags}"
400407
SSH
401408

402409
# use the default SSH port to connect at this point

0 commit comments

Comments
 (0)