From patchwork Fri Jul 16 11:14:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 4539 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4GR7t45fgtz3xGY for ; Fri, 16 Jul 2021 11:14:20 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4GR7t42S6gz17W; Fri, 16 Jul 2021 11:14:20 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4GR7t356VYz2xb4; Fri, 16 Jul 2021 11:14:19 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4GR7t21dMQz2xb4 for ; Fri, 16 Jul 2021 11:14:18 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4GR7t160PSz17W; Fri, 16 Jul 2021 11:14:17 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1626434057; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=yN3YE21nt94A67slfCoc96jSTx15bUA2SR3ju7mNA2U=; b=supxJbDqKUoihKpUuUPDzxOJR6AdY0VAGWpe/Kyobk54YNGpj91abnHcHDApL2jJZmCjra NrVBTOSvqtDYY+Ag== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1626434057; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=yN3YE21nt94A67slfCoc96jSTx15bUA2SR3ju7mNA2U=; b=gxznanjtPq1gKgBtt5sZf6657xfJNBEhVPwH8bWPcCXXHuQ9DcjHsvE8aUaplXXuBc2K68 LMIsL5+pD4bMqeA0f9hFB/BJ+gG0j4njHgVdzpxEjJmuK+dkZs0hc8moUT17ySdRpYaMOn U0LTF67bpv5F2qTawwIzrUYPPCMc/Qdr8L0vzFFVVyK0WVNsX2kZKJM/G7bIWzVmah9Mkl 1YND1PS41QoLB4OFzUlYZILj9cfhSlg8OWIkL+yCe4kc4slQA6q62J9QwBeF/oChrfesAT 8tMplGwqKl14PVF9clW/zv35CwZyrwUYPnf6tcz0io8cS1hp9zWh1E7UGQ2zxg== From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 1/2] mountkernfs: Mount cgroup2 hierarchy Date: Fri, 16 Jul 2021 11:14:12 +0000 Message-Id: <20210716111413.23497-1-michael.tremer@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Tremer Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Signed-off-by: Michael Tremer --- src/initscripts/system/mountkernfs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/initscripts/system/mountkernfs b/src/initscripts/system/mountkernfs index f0bfc5289..264da24c4 100644 --- a/src/initscripts/system/mountkernfs +++ b/src/initscripts/system/mountkernfs @@ -34,6 +34,11 @@ case "${1}" in mount -n -t tmpfs -o nosuid,nodev,mode=755,size=8M /run /run || failed=1 fi + if ! mountpoint /sys/fs/cgroup &> /dev/null; then + boot_mesg -n " /sys/fs/cgroup" ${NORMAL} + mount -t cgroup2 none /sys/fs/cgroup || failed=1 + fi + # create folder for dhcpcd changeroot mkdir -p /run/dhcpcd/chroot chown dhcpcd:dhcpcd /run/dhcpcd/chroot From patchwork Fri Jul 16 11:14:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 4540 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4GR7t51ly7z3xGl for ; Fri, 16 Jul 2021 11:14:21 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4GR7t43bbnz6FZ; Fri, 16 Jul 2021 11:14:20 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4GR7t35mhFz2yyN; Fri, 16 Jul 2021 11:14:19 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4GR7t22S7Xz2xgw for ; Fri, 16 Jul 2021 11:14:18 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4GR7t21gb9z1xQ; Fri, 16 Jul 2021 11:14:18 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1626434058; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=010KidPP3+axarzloH1mGhI2dSQRjyYsn5/PV9a0iiM=; b=p1/+jvZLIiSNQMNaFQPnBU5BmGSb5/QzdmHFK+usBmd9Sw42zpgP0CT6/uQ9GYvO/lwO6K JhFg/NO0L2lefRDg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1626434058; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=010KidPP3+axarzloH1mGhI2dSQRjyYsn5/PV9a0iiM=; b=sonU15G9pZbOno0FKQeHwHyOcs5pXs/+AkUpyBzOsY04xcagIKel74T5DbI2m9lRnHYM/N njz1O6oV54Zw80kgjDu+ohQaccfaSaZPWBNYy/1IibAE7belcXXNoB3h+nRSDuSZZVs99x n4JjHGEICLAj1+kave7TtOo4TYfvEcfSE+0YpBSKFsoduF055f04QQuWdz112eyvYuuDaj dCLetER/pg3u2HWD1Kb20HBNBoOruScCvpu62aUvOaLUIycQT6mCNnVS+Sh0nfMw81Bhpn j5lHDXue5IZ01NAh+B/mR2cZUxjIooInGMeB+YgWoVpczcI7mVn4ikbesB7Lyg== From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 2/2] libvirtd: Enable required cgroups Date: Fri, 16 Jul 2021 11:14:13 +0000 Message-Id: <20210716111413.23497-2-michael.tremer@ipfire.org> In-Reply-To: <20210716111413.23497-1-michael.tremer@ipfire.org> References: <20210716111413.23497-1-michael.tremer@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Tremer Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Signed-off-by: Michael Tremer --- lfs/libvirt | 2 +- src/initscripts/packages/libvirtd | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lfs/libvirt b/lfs/libvirt index 28a95d317..b680cbb3d 100644 --- a/lfs/libvirt +++ b/lfs/libvirt @@ -33,7 +33,7 @@ DIR_APP = $(DIR_SRC)/$(THISAPP) TARGET = $(DIR_INFO)/$(THISAPP) SUP_ARCH = i586 x86_64 PROG = libvirt -PAK_VER = 25 +PAK_VER = 26 DEPS = ebtables libpciaccess libtirpc libyajl ncat qemu diff --git a/src/initscripts/packages/libvirtd b/src/initscripts/packages/libvirtd index 40bc6bee3..f0a0b1e8a 100644 --- a/src/initscripts/packages/libvirtd +++ b/src/initscripts/packages/libvirtd @@ -20,9 +20,14 @@ case $1 in boot_mesg "Load required kernel modules for Libvirt" modprobe tun vhost_net evaluate_retval + + # Enable required cgroup controllers + if [ -d "/sys/fs/cgroup" ]; then + echo "+cpu +io" > /sys/fs/cgroup/cgroup.subtree_control + fi + boot_mesg "Starting Libvirt Daemon..." loadproc /usr/sbin/libvirtd -d - ;; stop)