All of lore.kernel.org
 help / color / mirror / Atom feed
From: Carlos Santos <casantos@datacom.com.br>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 3/4] busybox: add an inittab entry to activate swap
Date: Mon, 11 Jun 2018 03:00:15 -0300	[thread overview]
Message-ID: <20180611060016.20755-4-casantos@datacom.com.br> (raw)
In-Reply-To: <20180611060016.20755-1-casantos@datacom.com.br>

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 <casantos@datacom.com.br>
---
 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
-- 
2.17.0

  parent reply	other threads:[~2018-06-11  6:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-11  6:00 [Buildroot] [PATCH 0/4] synchronize initab files and enable swap on startup Carlos Santos
2018-06-11  6:00 ` [Buildroot] [PATCH 1/4] sysvinit: reduce number of mkdir calls in inittab Carlos Santos
2018-06-12  9:22   ` Peter Korsgaard
2018-06-17 15:54   ` Peter Korsgaard
2018-06-11  6:00 ` [Buildroot] [PATCH 2/4] sysvinit: add an inittab entry to activate swap Carlos Santos
2018-06-12 12:56   ` Peter Korsgaard
2018-06-17 15:54   ` Peter Korsgaard
2018-06-11  6:00 ` Carlos Santos [this message]
2018-06-12 12:58   ` [Buildroot] [PATCH 3/4] busybox: " Peter Korsgaard
2018-06-17 15:54   ` Peter Korsgaard
2018-06-11  6:00 ` [Buildroot] [PATCH 4/4] board/synopsys: synchronize custom inittab with BusyBox' one Carlos Santos
2018-06-12 13:01   ` Peter Korsgaard
2018-06-17 15:54   ` Peter Korsgaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180611060016.20755-4-casantos@datacom.com.br \
    --to=casantos@datacom.com.br \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.