From patchwork Wed Dec 4 16:28:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Henrique Cerri X-Patchwork-Id: 1204270 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47Sknc149Zz9sP6; Thu, 5 Dec 2019 03:29:07 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1icXWS-0005YW-9F; Wed, 04 Dec 2019 16:29:04 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1icXWQ-0005XS-Cp for kernel-team@lists.ubuntu.com; Wed, 04 Dec 2019 16:29:02 +0000 Received: from mail-qt1-f200.google.com ([209.85.160.200]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1icXWQ-0006ry-1t for kernel-team@lists.ubuntu.com; Wed, 04 Dec 2019 16:29:02 +0000 Received: by mail-qt1-f200.google.com with SMTP id d9so237675qtq.13 for ; Wed, 04 Dec 2019 08:29:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BJ03Ko4v/X8ELNL9GhS2t5gBsabzn5Qq3JpEG3e54cY=; b=S0tNOcIcVQ6VD41t8HTQ8hnQ/iYZtoU7QJxelnbDqStaIbyZWJsHhomy4ac1WkoSrN NcGYwmQG/euLBtN6gQLq06ZCcq/8PXMimcpElU3JfHmFZx+cwth/DEkt7zsny6K+HLVs 33LpKsZ+01zmtJDLtbKtZeS+GVr8yCy2FZyTFt/TClflcjL2CSF+h92tWzyuAdKJiVF1 i118E+4++V7RkVvgUMIT5LNNSvh/KvBgCZpRUUWWMw81fVPMUEzyuWgsiKFldXc8Gm5f a5ig6g3Pf7EAiovZi12jekiXDhK9Q78oHI1SMTam+zsZV2TxeqcJ5x6Xept0TigSPJ5a z0/w== X-Gm-Message-State: APjAAAXHvrDscBxHd1izMyRmoZ1O0VTlAFoEsYZZaCKzYAaEUKq4RP/D +805KIdQmR1i6Jfn4t7Hh1rktZbZ95Z8/C0WTkQqPxtzah1m2esMp+ALbnavpcYLvlIHpRU5Mrj DFTwsrxiH8CY1XxK/2zuUL8dCToFfhUo3ptRHAgOZ X-Received: by 2002:ac8:31f0:: with SMTP id i45mr3516795qte.327.1575476940794; Wed, 04 Dec 2019 08:29:00 -0800 (PST) X-Google-Smtp-Source: APXvYqziEUIO2UTwqu2q6dq9ucE8Q2hzGeK+IuicLA15s8VXmUlUeyinwqBATZDJ6hG22imP07MeHA== X-Received: by 2002:ac8:31f0:: with SMTP id i45mr3516761qte.327.1575476940427; Wed, 04 Dec 2019 08:29:00 -0800 (PST) Received: from localhost.localdomain ([2804:14c:4e6:1bc:c996:3e2:8668:ca74]) by smtp.gmail.com with ESMTPSA id v7sm4048268qtk.89.2019.12.04.08.28.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Dec 2019 08:28:59 -0800 (PST) From: Marcelo Henrique Cerri To: kernel-team@lists.ubuntu.com Subject: [{eoan, disco, bionic, xenial}:linux PATCH 1/1] UBUNTU: [Packaging] Add systemd service to load intel_sgx Date: Wed, 4 Dec 2019 13:28:52 -0300 Message-Id: <20191204162852.28509-2-marcelo.cerri@canonical.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191204162852.28509-1-marcelo.cerri@canonical.com> References: <20191204162437.25733-1-marcelo.cerri@canonical.com> <20191204162852.28509-1-marcelo.cerri@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" 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 --- ...cloud-tools-common.intel-sgx-load-module.service | 13 +++++++++++++ debian/rules.d/3-binary-indep.mk | 3 +++ 2 files changed, 16 insertions(+) create mode 100644 debian/linux-cloud-tools-common.intel-sgx-load-module.service 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 index 000000000000..a1882acbda22 --- /dev/null +++ b/debian/linux-cloud-tools-common.intel-sgx-load-module.service @@ -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 diff --git a/debian/rules.d/3-binary-indep.mk b/debian/rules.d/3-binary-indep.mk index b27275685612..7b115e0a9bb9 100644 --- a/debian/rules.d/3-binary-indep.mk +++ b/debian/rules.d/3-binary-indep.mk @@ -196,6 +196,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