All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/4] synchronize initab files and enable swap on startup
@ 2018-06-11  6:00 Carlos Santos
  2018-06-11  6:00 ` [Buildroot] [PATCH 1/4] sysvinit: reduce number of mkdir calls in inittab Carlos Santos
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Carlos Santos @ 2018-06-11  6:00 UTC (permalink / raw)
  To: buildroot

* Apply to sysvinit a modification made for busybox in commit e9db8122fb
  (reduce number of mkdir calls in inittab).

* Activate swap on system startup. This still requires a swap entry in
  /etc/inittab, which must be provided by the user.

* Synchronize the custom inittab used on Synopsis boards with the one in
  the busybox package.

Carlos Santos (4):
  sysvinit: reduce number of mkdir calls in inittab
  sysvinit: add an inittab entry to activate swap
  busybox: add an inittab entry to activate swap
  board/synopsys: synchronize custom inittab with BusyBox' one

 board/synopsys/axs10x/fs-overlay/etc/inittab | 16 ++++++++++------
 package/busybox/inittab                      |  1 +
 package/sysvinit/inittab                     |  6 +++---
 3 files changed, 14 insertions(+), 9 deletions(-)

-- 
2.17.0

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH 1/4] sysvinit: reduce number of mkdir calls in inittab
  2018-06-11  6:00 [Buildroot] [PATCH 0/4] synchronize initab files and enable swap on startup Carlos Santos
@ 2018-06-11  6:00 ` 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
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 13+ messages in thread
From: Carlos Santos @ 2018-06-11  6:00 UTC (permalink / raw)
  To: buildroot

The default sysvinit inittab does two separate mkdir calls to create
/dev/pts and /dev/shm. Reduce this to call mkdir only once for both
directories.

This removes id "si3" but keeps ids "si4".."si9" intact rather than
renumbering them. This would just increase the turmoil without any
practical effect.

Based on commit e9db8122fb, by Florian La Roche <F.LaRoche@pilz.de>.

Signed-off-by: Carlos Santos <casantos@datacom.com.br>
---
 package/sysvinit/inittab | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/package/sysvinit/inittab b/package/sysvinit/inittab
index 7eaef59d9e..2ca253ad6c 100644
--- a/package/sysvinit/inittab
+++ b/package/sysvinit/inittab
@@ -6,8 +6,7 @@ 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
-si3::sysinit:/bin/mkdir -p /dev/shm
+si2::sysinit:/bin/mkdir -p /dev/pts /dev/shm
 si4::sysinit:/bin/mount -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
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH 2/4] sysvinit: add an inittab entry to activate swap
  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-11  6:00 ` Carlos Santos
  2018-06-12 12:56   ` Peter Korsgaard
  2018-06-17 15:54   ` Peter Korsgaard
  2018-06-11  6:00 ` [Buildroot] [PATCH 3/4] busybox: " Carlos Santos
  2018-06-11  6:00 ` [Buildroot] [PATCH 4/4] board/synopsys: synchronize custom inittab with BusyBox' one Carlos Santos
  3 siblings, 2 replies; 13+ messages in thread
From: Carlos Santos @ 2018-06-11  6:00 UTC (permalink / raw)
  To: 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 <casantos@datacom.com.br>
---
 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
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH 3/4] busybox: add an inittab entry to activate swap
  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-11  6:00 ` [Buildroot] [PATCH 2/4] sysvinit: add an inittab entry to activate swap Carlos Santos
@ 2018-06-11  6:00 ` Carlos Santos
  2018-06-12 12:58   ` 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
  3 siblings, 2 replies; 13+ messages in thread
From: Carlos Santos @ 2018-06-11  6:00 UTC (permalink / raw)
  To: 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 <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

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH 4/4] board/synopsys: synchronize custom inittab with BusyBox' one
  2018-06-11  6:00 [Buildroot] [PATCH 0/4] synchronize initab files and enable swap on startup Carlos Santos
                   ` (2 preceding siblings ...)
  2018-06-11  6:00 ` [Buildroot] [PATCH 3/4] busybox: " Carlos Santos
@ 2018-06-11  6:00 ` Carlos Santos
  2018-06-12 13:01   ` Peter Korsgaard
  2018-06-17 15:54   ` Peter Korsgaard
  3 siblings, 2 replies; 13+ messages in thread
From: Carlos Santos @ 2018-06-11  6:00 UTC (permalink / raw)
  To: buildroot

Apply modifications made in recent commits:

- 456ea9871e busybox: add /dev/std{in, out, err} symlinks to inittab
- 13dbe73782 busybox: reduce number of mkdir calls in inittab
- 8a89d290d4 busybox: add an inittab entry to activate swap

Signed-off-by: Carlos Santos <casantos@datacom.com.br>
---
This change was tested on a VM, only. I don't have a Synopsys board.
---
 board/synopsys/axs10x/fs-overlay/etc/inittab | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/board/synopsys/axs10x/fs-overlay/etc/inittab b/board/synopsys/axs10x/fs-overlay/etc/inittab
index 43bacc6580..7412a27366 100644
--- a/board/synopsys/axs10x/fs-overlay/etc/inittab
+++ b/board/synopsys/axs10x/fs-overlay/etc/inittab
@@ -14,12 +14,16 @@
 # process   == program to run
 
 # Startup the system
-null::sysinit:/bin/mount -t proc proc /proc
-null::sysinit:/bin/mount -o remount,rw /
-null::sysinit:/bin/mkdir -p /dev/pts
-null::sysinit:/bin/mkdir -p /dev/shm
-null::sysinit:/bin/mount -a
-null::sysinit:/bin/hostname -F /etc/hostname
+::sysinit:/bin/mount -t proc proc /proc
+::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
+null::sysinit:/bin/ln -sf /proc/self/fd/2 /dev/stderr
+::sysinit:/bin/hostname -F /etc/hostname
 # now run any rc scripts
 ::sysinit:/etc/init.d/rcS
 
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH 1/4] sysvinit: reduce number of mkdir calls in inittab
  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
  1 sibling, 0 replies; 13+ messages in thread
From: Peter Korsgaard @ 2018-06-12  9:22 UTC (permalink / raw)
  To: buildroot

>>>>> "Carlos" == Carlos Santos <casantos@datacom.com.br> writes:

 > The default sysvinit inittab does two separate mkdir calls to create
 > /dev/pts and /dev/shm. Reduce this to call mkdir only once for both
 > directories.

 > This removes id "si3" but keeps ids "si4".."si9" intact rather than
 > renumbering them. This would just increase the turmoil without any
 > practical effect.

 > Based on commit e9db8122fb, by Florian La Roche <F.LaRoche@pilz.de>.

 > Signed-off-by: Carlos Santos <casantos@datacom.com.br>

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH 2/4] sysvinit: add an inittab entry to activate swap
  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
  1 sibling, 0 replies; 13+ messages in thread
From: Peter Korsgaard @ 2018-06-12 12:56 UTC (permalink / raw)
  To: buildroot

>>>>> "Carlos" == Carlos Santos <casantos@datacom.com.br> writes:

 > 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>

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH 3/4] busybox: add an inittab entry to activate swap
  2018-06-11  6:00 ` [Buildroot] [PATCH 3/4] busybox: " Carlos Santos
@ 2018-06-12 12:58   ` Peter Korsgaard
  2018-06-17 15:54   ` Peter Korsgaard
  1 sibling, 0 replies; 13+ messages in thread
From: Peter Korsgaard @ 2018-06-12 12:58 UTC (permalink / raw)
  To: buildroot

>>>>> "Carlos" == Carlos Santos <casantos@datacom.com.br> writes:

 > 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.

I guess an explicit swapon <device> after swapon -a (with an entry for
<device> in /etc/fstab) will fail with an error message, but OK - That
is easy to fix if that happens.

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH 4/4] board/synopsys: synchronize custom inittab with BusyBox' one
  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
  1 sibling, 0 replies; 13+ messages in thread
From: Peter Korsgaard @ 2018-06-12 13:01 UTC (permalink / raw)
  To: buildroot

>>>>> "Carlos" == Carlos Santos <casantos@datacom.com.br> writes:

 > Apply modifications made in recent commits:
 > - 456ea9871e busybox: add /dev/std{in, out, err} symlinks to inittab
 > - 13dbe73782 busybox: reduce number of mkdir calls in inittab
 > - 8a89d290d4 busybox: add an inittab entry to activate swap

 > Signed-off-by: Carlos Santos <casantos@datacom.com.br>
 > ---
 > This change was tested on a VM, only. I don't have a Synopsys board.

Committed, thanks.

Me neither. It would be nicer if this synopsys board would just add the
missing lines to the standard inittab in a post-build script, similar to
how we do it for the raspberry pi instead of having a local copy - But
OK.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH 1/4] sysvinit: reduce number of mkdir calls in inittab
  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
  1 sibling, 0 replies; 13+ messages in thread
From: Peter Korsgaard @ 2018-06-17 15:54 UTC (permalink / raw)
  To: buildroot

>>>>> "Carlos" == Carlos Santos <casantos@datacom.com.br> writes:

 > The default sysvinit inittab does two separate mkdir calls to create
 > /dev/pts and /dev/shm. Reduce this to call mkdir only once for both
 > directories.

 > This removes id "si3" but keeps ids "si4".."si9" intact rather than
 > renumbering them. This would just increase the turmoil without any
 > practical effect.

 > Based on commit e9db8122fb, by Florian La Roche <F.LaRoche@pilz.de>.

 > Signed-off-by: Carlos Santos <casantos@datacom.com.br>

Committed to 2018.02.x, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH 3/4] busybox: add an inittab entry to activate swap
  2018-06-11  6:00 ` [Buildroot] [PATCH 3/4] busybox: " Carlos Santos
  2018-06-12 12:58   ` Peter Korsgaard
@ 2018-06-17 15:54   ` Peter Korsgaard
  1 sibling, 0 replies; 13+ messages in thread
From: Peter Korsgaard @ 2018-06-17 15:54 UTC (permalink / raw)
  To: buildroot

>>>>> "Carlos" == Carlos Santos <casantos@datacom.com.br> writes:

 > 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>

Committed to 2018.02.x, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH 2/4] sysvinit: add an inittab entry to activate swap
  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
  1 sibling, 0 replies; 13+ messages in thread
From: Peter Korsgaard @ 2018-06-17 15:54 UTC (permalink / raw)
  To: buildroot

>>>>> "Carlos" == Carlos Santos <casantos@datacom.com.br> writes:

 > 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>

Committed to 2018.02.x, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH 4/4] board/synopsys: synchronize custom inittab with BusyBox' one
  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
  1 sibling, 0 replies; 13+ messages in thread
From: Peter Korsgaard @ 2018-06-17 15:54 UTC (permalink / raw)
  To: buildroot

>>>>> "Carlos" == Carlos Santos <casantos@datacom.com.br> writes:

 > Apply modifications made in recent commits:
 > - 456ea9871e busybox: add /dev/std{in, out, err} symlinks to inittab
 > - 13dbe73782 busybox: reduce number of mkdir calls in inittab
 > - 8a89d290d4 busybox: add an inittab entry to activate swap

 > Signed-off-by: Carlos Santos <casantos@datacom.com.br>
 > ---
 > This change was tested on a VM, only. I don't have a Synopsys board.

Committed to 2018.02.x, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2018-06-17 15:54 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [Buildroot] [PATCH 3/4] busybox: " Carlos Santos
2018-06-12 12:58   ` 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

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.