From patchwork Mon Jun 11 06:00:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 927500 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 4142S83qDdz9ryk for ; Mon, 11 Jun 2018 16:00:40 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 39B1B88D5F; Mon, 11 Jun 2018 06:00:37 +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 cgXvCtbeVL7p; Mon, 11 Jun 2018 06:00:36 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id A56EE88BDD; Mon, 11 Jun 2018 06:00:36 +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 31D5A1C2AB3 for ; Mon, 11 Jun 2018 06:00:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 2CA7487D2A for ; Mon, 11 Jun 2018 06:00:34 +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 4s_USSWElW30 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 0BDA487D1C 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 A31D71BA0213; Mon, 11 Jun 2018 03:00:50 -0300 (-03) Received: from localhost (localhost [127.0.0.1]) by mail.datacom.com.br (Postfix) with ESMTP id 89C681BA0415; 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 6g-tXdumfJAg; 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 27F051BA0213; Mon, 11 Jun 2018 03:00:50 -0300 (-03) From: Carlos Santos To: buildroot@buildroot.org Date: Mon, 11 Jun 2018 03:00:14 -0300 Message-Id: <20180611060016.20755-3-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 2/4] sysvinit: 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/sysvinit/inittab | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/sysvinit/inittab b/package/sysvinit/inittab index 2ca253ad6c..a31471031f 100644 --- a/package/sysvinit/inittab +++ b/package/sysvinit/inittab @@ -7,7 +7,8 @@ id:3:initdefault: si0::sysinit:/bin/mount -t proc proc /proc si1::sysinit:/bin/mount -o remount,rw / si2::sysinit:/bin/mkdir -p /dev/pts /dev/shm -si4::sysinit:/bin/mount -a +si3::sysinit:/bin/mount -a +si4::sysinit:/sbin/swapon -a si5::sysinit:/bin/ln -sf /proc/self/fd /dev/fd 2>/dev/null si6::sysinit:/bin/ln -sf /proc/self/fd/0 /dev/stdin 2>/dev/null si7::sysinit:/bin/ln -sf /proc/self/fd/1 /dev/stdout 2>/dev/null