Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Nest
Puppet
Commits
7b8376c2
Commit
7b8376c2
authored
Jul 07, 2021
by
James T. Lee
Browse files
install: Fix systemd-nspawn on systems without qemu-user
parent
3e773b66
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
files/scripts/install.sh
files/scripts/install.sh
+15
-3
manifests/base/dracut.pp
manifests/base/dracut.pp
+1
-1
No files found.
files/scripts/install.sh
View file @
7b8376c2
...
@@ -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
...
...
manifests/base/dracut.pp
View file @
7b8376c2
...
@@ -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"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment