Skip to content

Commit

Permalink
Fix dracut-interactive with systemd 256
Browse files Browse the repository at this point in the history
With systemd 256, /usr (and thus also /bin/) is read-only in the initrd.
Move dracut-interactive and its .service into /run instead.
  • Loading branch information
Vogtinator committed Jul 30, 2024
1 parent d9102d3 commit 32a3d3f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
7 changes: 4 additions & 3 deletions dracut/modules.d/90kiwi-live/kiwi-live-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@ function runMediaCheck {
# Methods considered private
#-----------------------------------------
function _setup_interactive_service {
local service=/usr/lib/systemd/system/dracut-run-interactive.service
local service=/run/systemd/system/dracut-run-interactive.service
mkdir -p /run/systemd/system
[ -e ${service} ] && return
{
echo "[Unit]"
Expand All @@ -294,7 +295,7 @@ function _setup_interactive_service {
echo "Environment=DRACUT_SYSTEMD=1"
echo "Environment=NEWROOT=/sysroot"
echo "WorkingDirectory=/"
echo "ExecStart=/bin/bash /bin/dracut-interactive"
echo "ExecStart=/bin/bash /run/dracut-interactive"
echo "Type=oneshot"
echo "StandardInput=tty-force"
echo "StandardOutput=inherit"
Expand All @@ -312,7 +313,7 @@ function _run_interactive {
}

function _run_dialog {
echo "dialog $*" >/bin/dracut-interactive
echo "dialog $*" >/run/dracut-interactive
_run_interactive
}

Expand Down
9 changes: 5 additions & 4 deletions dracut/modules.d/99kiwi-lib/kiwi-dialog-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function run_dialog {
{
echo "dialog $* 2>$dialog_result"
echo "echo -n \$? >$dialog_exit_code"
} >/bin/dracut-interactive
} >/run/dracut-interactive
_run_interactive
return "$(cat $dialog_exit_code)"
}
Expand Down Expand Up @@ -48,7 +48,7 @@ function run_progress_dialog {
echo -n "cat ${fifo} | dialog --backtitle \"${backtitle}\" "
echo -n "--gauge \"${title}\"" 7 65 0
echo
} >/bin/dracut-interactive
} >/run/dracut-interactive
_run_interactive
}

Expand All @@ -69,8 +69,9 @@ function stop_plymouth {
# Methods considered private
#-----------------------------------------
function _setup_interactive_service {
local service=/usr/lib/systemd/system/dracut-run-interactive.service
local script=/bin/dracut-interactive
local service=/run/systemd/system/dracut-run-interactive.service
local script=/run/dracut-interactive
mkdir -p /run/systemd/system
[ -e ${service} ] && return
{
echo "[Unit]"
Expand Down

0 comments on commit 32a3d3f

Please sign in to comment.