Commit 7b8376c2 authored by James T. Lee's avatar James T. Lee
Browse files

install: Fix systemd-nspawn on systems without qemu-user

parent 3e773b66
...@@ -148,10 +148,22 @@ destructive_cmd() { ...@@ -148,10 +148,22 @@ destructive_cmd() {
[[ $resume ]] || cmd "$@" [[ $resume ]] || cmd "$@"
} }
nspawn() {
local -a bindargs
for arch in aarch64 arm; do
if [[ -f "/usr/bin/qemu-${arch}" ]]; then
bindargs+=("--bind-ro=/usr/bin/qemu-${arch}")
fi
done
systemd-nspawn "${bindargs[@]}" "$@"
}
chroot_cmd() { chroot_cmd() {
echo ">> $@" echo ">> $@"
if [[ ! $dryrun ]]; then if [[ ! $dryrun ]]; then
if ! systemd-nspawn --console=pipe -q --bind=/dev --bind=/nest --bind-ro=/usr/bin/qemu-aarch64 --bind-ro=/usr/bin/qemu-arm --capability=all --property='DeviceAllow=block-* rwm' -D "$target" "$@"; then if ! nspawn --console=pipe -q --bind=/dev --bind=/nest --capability=all --property='DeviceAllow=block-* rwm' -D "$target" "$@"; then
echo "FAILED" echo "FAILED"
exit 1 exit 1
fi fi
...@@ -279,7 +291,7 @@ END ...@@ -279,7 +291,7 @@ END
destructive_cmd zfs create -V "$swap_size" -b 4096 -o refreservation=none "${zroot}/swap" destructive_cmd zfs create -V "$swap_size" -b 4096 -o refreservation=none "${zroot}/swap"
destructive_cmd udevadm settle destructive_cmd udevadm settle
destructive_cmd mkswap -L "${labelname}-swap" /dev/zvol/${zroot}/swap" destructive_cmd mkswap -L "${labelname}-swap" "/dev/zvol/${zroot}/swap"
if grep "${name}-fscache" "${img}/etc/fstab" > /dev/null; then if grep "${name}-fscache" "${img}/etc/fstab" > /dev/null; then
task "Creating fscache..." task "Creating fscache..."
...@@ -301,7 +313,7 @@ if [[ $shell ]]; then ...@@ -301,7 +313,7 @@ if [[ $shell ]]; then
# This is inteneded for debugging a failed installation # This is inteneded for debugging a failed installation
# Not really meant for recovering established images # Not really meant for recovering established images
task "Launching debug shell..." task "Launching debug shell..."
systemd-nspawn --console=interactive -q -E TERM="$TERM" --bind=/nest --bind-ro=/usr/bin/qemu-aarch64 --bind-ro=/usr/bin/qemu-arm --capability=all -D "$target" zsh nspawn --console=interactive -q -E TERM="$TERM" --bind=/nest --capability=all -D "$target" zsh
exit exit
fi fi
......
...@@ -12,7 +12,7 @@ class nest::base::dracut { ...@@ -12,7 +12,7 @@ class nest::base::dracut {
} }
} }
$vconsole_params = "rd.vconsole.font=ter-v${::nest::console_font_size}b rd.vconsole.keymap=${::nest::base::systemd::keymap}" $vconsole_params = "rd.hostonly=1 rd.vconsole.font=ter-v${::nest::console_font_size}b rd.vconsole.keymap=${::nest::base::systemd::keymap}"
if $facts['profile']['platform'] == 'live' { if $facts['profile']['platform'] == 'live' {
$base_config_content = @("EOT") $base_config_content = @("EOT")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment