]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
UBUNTU: [Packaging] Add systemd service to load intel_sgx
authorMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Wed, 4 Dec 2019 16:28:52 +0000 (13:28 -0300)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 17 Jan 2020 13:55:45 +0000 (10:55 -0300)
BugLink: https://bugs.launchpad.net/bugs/1844245
Include a systemd service to simplify the process of loading intel_sgx
during the boot if the user decides to do so.

Since intel_sgx will only be available in linux-azure, restrict the
new service with ConditionVirtualization=microsoft.

Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Acked-by: Connor Kuehl <connor.kuehl@canonical.com>
Acked-by: Andy Whitcroft <andy.whitcroft@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
debian/linux-cloud-tools-common.intel-sgx-load-module.service [new file with mode: 0644]
debian/rules.d/3-binary-indep.mk

diff --git a/debian/linux-cloud-tools-common.intel-sgx-load-module.service b/debian/linux-cloud-tools-common.intel-sgx-load-module.service
new file mode 100644 (file)
index 0000000..a1882ac
--- /dev/null
@@ -0,0 +1,13 @@
+[Unit]
+Description=Install SGX kernel module
+DefaultDependencies=false
+ConditionVirtualization=microsoft
+
+[Service]
+Type=oneshot
+RemainAfterExit=true
+ExecStart=/sbin/modprobe intel_sgx
+ExecStop=/sbin/modprobe -r intel_sgx
+
+[Install]
+WantedBy=multi-user.target
index 870a6b8ddfa2582f928f38694ea1dd29faded820..d79e866dfe2e3419881be2d3cfe8c19ed8274811 100644 (file)
@@ -207,6 +207,9 @@ ifeq ($(do_tools_hyperv),true)
        dh_installinit -p$(cloudpkg) -o --name hv-fcopy-daemon
        dh_systemd_start -p$(cloudpkg)
 endif
+       # Keep intel_sgx service disabled by default, so add it after dh_systemd_enable
+       # and dh_systemd_start are called:
+       dh_installinit -p$(cloudpkg) --no-start --no-enable --name intel-sgx-load-module
 endif
 endif
        dh_installdeb -i