[pve-devel] [PATCH kernel-meta 1/3] efiboot: add new mount namespace helper

Fabian Grünbichler f.gruenbichler at proxmox.com
Thu Jul 11 11:22:49 CEST 2019


to re-execute the currently running script in an unshared mount name
space.

Co-Developed-By: Thomas Lamprecht <t.lamprecht at proxmox.com>
Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
Not sure whether we want to keep the echo here, or just in
pve-efiboot-tool?

 efiboot/functions | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/efiboot/functions b/efiboot/functions
index cb6cd62..79062d8 100755
--- a/efiboot/functions
+++ b/efiboot/functions
@@ -63,3 +63,12 @@ boot_kernel_list() {
 warn() {
 	echo "$@" 1>&2
 }
+
+reexec_in_mountns() {
+	if [ -z "$PVE_EFIBOOT_UNSHARED" ]; then
+		export PVE_EFIBOOT_UNSHARED=1
+		echo "Re-executing '$0' in new private mount namespace.."
+		unshare --mount --propagation private "$0" "$@"
+		exit 0
+	fi
+}
-- 
2.20.1





More information about the pve-devel mailing list