synchronize initab files and enable swap on startup
cover synchronize initab files and enable swap on startup
* 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(-)
Signature · 1 line
2.17.0
PATCH 1/4 sysvinit: reduce number of mkdir calls in inittab
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 <[email protected]>.
--- package/sysvinit/inittab | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
package/sysvinit/inittab +1 -2
@@ -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
Signature · 1 line
2.17.0
PATCH 1/4 sysvinit: reduce number of mkdir calls in inittab
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Carlos" == Carlos Santos <[email protected]> writes:
The default sysvinit inittab does two separate mkdir calls to create
/dev/ptsand/dev/shm. Reduce this to call mkdir only once for both directories.
Quoted 7 lines
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 <[email protected]>.Signed-off-by Carlos Santos <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 1/4 sysvinit: reduce number of mkdir calls in inittab
In reply to Carlos SantosQuoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Carlos" == Carlos Santos <[email protected]> writes:
The default sysvinit inittab does two separate mkdir calls to create
/dev/ptsand/dev/shm. Reduce this to call mkdir only once for both directories.
Quoted 7 lines
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 <[email protected]>.Signed-off-by Carlos Santos <[email protected]>
Committed to 2018.02.x, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 2/4 sysvinit: add an inittab entry to activate swap
In reply to Carlos SantosThere 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.
--- package/sysvinit/inittab | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
package/sysvinit/inittab +2 -1
@@ -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
Signature · 1 line
2.17.0
PATCH 2/4 sysvinit: add an inittab entry to activate swap
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Carlos" == Carlos Santos <[email protected]> writes:
There is a call to swapoff in the shutdown sequence, so call "swapon -a" on startup. As stated in the swapon man page,
Quoted 8 lines
All devices marked as "swap" in
/etc/fstabare 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 <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 2/4 sysvinit: add an inittab entry to activate swap
In reply to Carlos SantosQuoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Carlos" == Carlos Santos <[email protected]> writes:
There is a call to swapoff in the shutdown sequence, so call "swapon -a" on startup. As stated in the swapon man page,
Quoted 8 lines
All devices marked as "swap" in
/etc/fstabare 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 <[email protected]>
Committed to 2018.02.x, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 3/4 busybox: add an inittab entry to activate swap
In reply to Carlos SantosThere 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.
--- package/busybox/inittab | 1 + 1 file changed, 1 insertion(+)
package/busybox/inittab +1 -0
@@ -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
Signature · 1 line
2.17.0
PATCH 3/4 busybox: add an inittab entry to activate swap
Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Carlos" == Carlos Santos <[email protected]> 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/fstabare 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.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 3/4 busybox: add an inittab entry to activate swap
In reply to Carlos SantosQuoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Carlos" == Carlos Santos <[email protected]> writes:
There is a call to swapoff in the shutdown sequence, so call "swapon -a" on startup. As stated in the swapon man page,
Quoted 8 lines
All devices marked as "swap" in
/etc/fstabare 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 <[email protected]>
Committed to 2018.02.x, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 4/4 board/synopsys: synchronize custom inittab with BusyBox' one
In reply to Carlos SantosApply 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
---
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(-)
board/synopsys/axs10x/fs-overlay/etc/inittab +10 -6
@@ -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
Signature · 1 line
2.17.0
PATCH 4/4 board/synopsys: synchronize custom inittab with BusyBox' one
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Carlos" == Carlos Santos <[email protected]> writes:
Apply modifications made in recent commits:
-456ea9871ebusybox: add/dev/std{in, out, err} symlinks to inittab
-13dbe73782busybox: reduce number of mkdir calls in inittab
-8a89d290d4busybox: add an inittab entry to activate swapSigned-off-by Carlos Santos <[email protected]>---
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.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 4/4 board/synopsys: synchronize custom inittab with BusyBox' one
In reply to Carlos SantosQuoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Carlos" == Carlos Santos <[email protected]> writes:
Apply modifications made in recent commits:
-456ea9871ebusybox: add/dev/std{in, out, err} symlinks to inittab
-13dbe73782busybox: reduce number of mkdir calls in inittab
-8a89d290d4busybox: add an inittab entry to activate swapSigned-off-by Carlos Santos <[email protected]>---
This change was tested on a VM, only. I don't have a Synopsys board.
Committed to 2018.02.x, thanks.
Signature · 1 line
Bye, Peter Korsgaard