Message ID | 20210401133633.1307240-3-rsalvaterra@gmail.com |
---|---|
State | Accepted |
Delegated to: | Hauke Mehrtens |
Headers | show
Return-Path: <openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org> 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.openwrt.org (client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; helo=desiato.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=FZRImlPr; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=U6syhTHR; dkim-atps=neutral Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FB45N1kNCz9sWF for <incoming@patchwork.ozlabs.org>; Fri, 2 Apr 2021 00:38:31 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=XPfFwApqoOyOYjRIQRlXkkjdkuB9KjVZTTgVQe5FgPc=; b=FZRImlPrJNUP41gQti7vmY+a5 pGXiMuZxQjfg0TJMwXiGUcz3Q6cTE4HY8acxB+ikxyFzrlMR1XoQr+8pQDMcNiff1fSspBXwZXPYI UOCIqtLGGU9J517/RRDBpWnEobnnxvH0Z2JQ/0pduRv6G2dY/yogj4EFPihZJvNMZVZK3S01HKSgE OL3LbArSxkg/BdTCm2Lx8EC9NL0+RCi8B7exFNZ93DBDHSejRNKgyo+93n2LqbFJBCaf+IYeO5yb5 gtbRYtPf5ubipj2RIF+LQJA93FdANH9jUniO59uXLt77IbdSH0NG+lg8yIZOqIO0TWCkx2uztXsUv 4Q/rwxbBA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lRxVJ-009hH5-3K; Thu, 01 Apr 2021 13:36:57 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lRxV0-009hDH-AX for openwrt-devel@lists.openwrt.org; Thu, 01 Apr 2021 13:36:41 +0000 Received: by mail-wm1-x329.google.com with SMTP id m20-20020a7bcb940000b029010cab7e5a9fso2858926wmi.3 for <openwrt-devel@lists.openwrt.org>; Thu, 01 Apr 2021 06:36:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HDckVIcXXjzZWfXI1v9m60CaukGMvC4yg9ot/eREwCg=; b=U6syhTHRnHIl+L+lIOCOKllMQaH9aJ7jMy5ihmMSfsCusbR39T/iw4YPuxAOxEM6Qp X+HEydQGBVzc0fMSmwMuJbFH2NqSTWCWg2x+LwVETWRB1oR/Uyslmk98/ud+wNAbQSeL /jQhn6+sismAG2MPmxFCtFUCC81xHRsb3UKu9I/JvimQcb0QI7PHYPjfWA/cKLhKTXEL FwKBSiIEF40NDwSMOFKbRbOem6d6J3lPkYKuDx9vyQxd8BmhURhvYyfbHhfKgN4yM7wo 0W/uIPf72TFXYBpeo70zG1R4twL4sdhHEMYND5nFUrpnviDzGDGnEBSN8GPm9D3XudwS 1M9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HDckVIcXXjzZWfXI1v9m60CaukGMvC4yg9ot/eREwCg=; b=aDARW/PaBXZAOC8IxA81a6WXnNg1OujyG8DPeFWwq6QZjihidzlgnjCC8EsNT6fBMC cI2uFdEBhGh9xEk2tiHCe1b9PNpUyAuNMk8zq6oPZ3iRaDfevYC+lV5qxHa/YTPdY0cD KYEjZ6uBPtdYEqafZM1sUxesVG5HC2Dabgi0Y99Ia+j6lLY521oLGEmte9LmdccAmelX xHWafNE7pX4WqeTyNhPnveHsQIbvSRZZ9+b8UNQV9M5vaz6KZOww8sDxkpTsMZQ6zyL5 vjxrUKv/0KmARYXUIpEAjuA/gNGS0MFqZ5RQvwGwFs875gxG9JI93zLr1pAlqKxTX0Jf pJKA== X-Gm-Message-State: AOAM532iNtQI5hZvsUCKh3LtlxYt7zc11SBVBby9lD6cHoptJmHhKrCX 3M0JWkqh4AY9nNygvkh6+QNqEnUuErm5 X-Google-Smtp-Source: ABdhPJyWOPW+CphXBy173zZ1UaIBYnexlxuDe/TvYXpBaLDXMsJ9/LRaFba+KIGGwOowPOkGH+1teQ== X-Received: by 2002:a7b:c188:: with SMTP id y8mr8016468wmi.76.1617284197815; Thu, 01 Apr 2021 06:36:37 -0700 (PDT) Received: from mallard.lan (a95-94-147-174.cpe.netcabo.pt. [95.94.147.174]) by smtp.gmail.com with ESMTPSA id y18sm10166150wrq.61.2021.04.01.06.36.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Apr 2021 06:36:37 -0700 (PDT) From: Rui Salvaterra <rsalvaterra@gmail.com> To: openwrt-devel@lists.openwrt.org Subject: [PATCH v2 2/2] zram-swap: bail out early if the kernel doesn't support swap Date: Thu, 1 Apr 2021 14:36:33 +0100 Message-Id: <20210401133633.1307240-3-rsalvaterra@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210401133633.1307240-1-rsalvaterra@gmail.com> References: <20210401133633.1307240-1-rsalvaterra@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210401_143638_408162_340AC0A0 X-CRM114-Status: GOOD ( 11.00 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "desiato.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Since KERNEL_SWAP is only enabled by default for !SMALL_FLASH targets, we need to check if the current kernel supports swap before trying to configure zram-swap, as opkg can't check for kernel depende [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:329 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [rsalvaterra[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List <openwrt-devel.lists.openwrt.org> List-Unsubscribe: <https://lists.openwrt.org/mailman/options/openwrt-devel>, <mailto:openwrt-devel-request@lists.openwrt.org?subject=unsubscribe> List-Archive: <http://lists.openwrt.org/pipermail/openwrt-devel/> List-Post: <mailto:openwrt-devel@lists.openwrt.org> List-Help: <mailto:openwrt-devel-request@lists.openwrt.org?subject=help> List-Subscribe: <https://lists.openwrt.org/mailman/listinfo/openwrt-devel>, <mailto:openwrt-devel-request@lists.openwrt.org?subject=subscribe> Cc: stijn@linux-ipv6.be, jo@mein.io, mail@david-bauer.net, Rui Salvaterra <rsalvaterra@gmail.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "openwrt-devel" <openwrt-devel-bounces@lists.openwrt.org> Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org |
Series |
zram-swap improvements
|
expand
|
diff --git a/package/system/zram-swap/files/zram.init b/package/system/zram-swap/files/zram.init index 685648aae5..d97e85efa5 100755 --- a/package/system/zram-swap/files/zram.init +++ b/package/system/zram-swap/files/zram.init @@ -150,6 +150,11 @@ zram_compact() start() { + [ -e /proc/swaps ] || { + logger -s -t zram_start -p daemon.crit "kernel doesn't support swap" + return 1 + } + if [ $( grep -cs zram /proc/swaps ) -ne 0 ]; then logger -s -t zram_start -p daemon.notice "[OK] zram swap is already mounted" return 1
Since KERNEL_SWAP is only enabled by default for !SMALL_FLASH targets, we need to check if the current kernel supports swap before trying to configure zram-swap, as opkg can't check for kernel dependencies. Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com> --- package/system/zram-swap/files/zram.init | 5 +++++ 1 file changed, 5 insertions(+)