Commit 81650fd1 authored by Marcelo Henrique Cerri's avatar Marcelo Henrique Cerri Committed by Connor Kuehl

UBUNTU: [Packaging] Add systemd service to load intel_sgx

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: default avatarMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Acked-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Acked-by: default avatarAndy Whitcroft <andy.whitcroft@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
[ Connor Kuehl: dh_installinit on Xenial does not have the --no-enable
  switch, so I've removed that switch from this patch for Xenial. ]
Signed-off-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
parent 3f389fc5
[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
......@@ -206,6 +206,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 --name intel-sgx-load-module
endif
endif
dh_installdeb -i
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment