From patchwork Mon Jun 11 06:00:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 927499 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=datacom.com.br Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4142S42jxKz9ryk for ; Mon, 11 Jun 2018 16:00:36 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id B1B1188CB6; Mon, 11 Jun 2018 06:00:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id D2aZn5+fYN9o; Mon, 11 Jun 2018 06:00:34 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id E7D4188BDD; Mon, 11 Jun 2018 06:00:33 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id DAFDB1C2AB3 for ; Mon, 11 Jun 2018 06:00:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id D7D0B87D2E for ; Mon, 11 Jun 2018 06:00:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id I2ZAebmC99JL for ; Mon, 11 Jun 2018 06:00:31 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.datacom.com.br (mx.datacom.ind.br [177.66.5.10]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 0CE9D87D2A for ; Mon, 11 Jun 2018 06:00:30 +0000 (UTC) Received: from mail.datacom.com.br (localhost [127.0.0.1]) by mail.datacom.com.br (Postfix) with ESMTPS id 10E251BA0422; Mon, 11 Jun 2018 03:00:51 -0300 (-03) Received: from localhost (localhost [127.0.0.1]) by mail.datacom.com.br (Postfix) with ESMTP id F15171BA0415; Mon, 11 Jun 2018 03:00:50 -0300 (-03) Received: from mail.datacom.com.br ([127.0.0.1]) by localhost (mail.datacom.com.br [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 89MDnlIOT0iN; Mon, 11 Jun 2018 03:00:50 -0300 (-03) Received: from p7-1130br.casantos.org (unknown [187.113.211.25]) by mail.datacom.com.br (Postfix) with ESMTPSA id 903BA1BA0444; Mon, 11 Jun 2018 03:00:50 -0300 (-03) From: Carlos Santos To: buildroot@buildroot.org Date: Mon, 11 Jun 2018 03:00:15 -0300 Message-Id: <20180611060016.20755-4-casantos@datacom.com.br> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180611060016.20755-1-casantos@datacom.com.br> References: <20180611060016.20755-1-casantos@datacom.com.br> Subject: [Buildroot] [PATCH 3/4] busybox: add an inittab entry to activate swap X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ARC Maintainers , Adam Duskett MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" There is a call to swapoff in the shutdown sequence, so call "swapon -a" on startup. As stated in the swapon man page, All devices marked as "swap" in /etc/fstab are made available, except for those with the "noauto" option. Devices that are already being used as swap are silently skipped. So even if the system has some init script to start/stop swap (e.g. from a rootfs ovelay) calling swapon/swapoff would be harmless. Signed-off-by: Carlos Santos --- package/busybox/inittab | 1 + 1 file changed, 1 insertion(+) diff --git a/package/busybox/inittab b/package/busybox/inittab index 7cd203de0b..ff1725c775 100644 --- a/package/busybox/inittab +++ b/package/busybox/inittab @@ -18,6 +18,7 @@ ::sysinit:/bin/mount -o remount,rw / ::sysinit:/bin/mkdir -p /dev/pts /dev/shm ::sysinit:/bin/mount -a +::sysinit:/sbin/swapon -a null::sysinit:/bin/ln -sf /proc/self/fd /dev/fd null::sysinit:/bin/ln -sf /proc/self/fd/0 /dev/stdin null::sysinit:/bin/ln -sf /proc/self/fd/1 /dev/stdout