From 11d8a6db9d82230b45c77d64bcd3fa735a04d92b Mon Sep 17 00:00:00 2001 From: Bohdan Tkachenko Date: Mon, 1 Apr 2024 20:14:31 -0400 Subject: [PATCH] Fix ZFSBootMenu initialization with systemd --- zfsbootmenu/pre-init/zfsbootmenu-parse-commandline.sh | 3 +++ zfsbootmenu/pre-init/zfsbootmenu-preinit.sh | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/zfsbootmenu/pre-init/zfsbootmenu-parse-commandline.sh b/zfsbootmenu/pre-init/zfsbootmenu-parse-commandline.sh index e15626e9e..6bb282726 100755 --- a/zfsbootmenu/pre-init/zfsbootmenu-parse-commandline.sh +++ b/zfsbootmenu/pre-init/zfsbootmenu-parse-commandline.sh @@ -79,6 +79,9 @@ else zinfo "defaulting controlling terminal to: ${control_term}" fi +# Make sure control_term is available for zfsbootmenu-preinit.sh +export control_term + # hostid - discover the hostid used to import a pool on failure, assume it # force - append -f to zpool import # strict - legacy behavior, drop to an emergency shell on failure diff --git a/zfsbootmenu/pre-init/zfsbootmenu-preinit.sh b/zfsbootmenu/pre-init/zfsbootmenu-preinit.sh index 2047039dd..f12d98559 100755 --- a/zfsbootmenu/pre-init/zfsbootmenu-preinit.sh +++ b/zfsbootmenu/pre-init/zfsbootmenu-preinit.sh @@ -42,5 +42,5 @@ EOF echo "ZFSBootMenu" > /proc/sys/kernel/hostname # https://busybox.net/FAQ.html#job_control -ZFSBOOTMENU_CONSOLE=yes exec setsid \ +ZFSBOOTMENU_CONSOLE=yes setsid \ bash -c "exec /libexec/zfsbootmenu-init <${control_term} >${control_term} 2>&1"