Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

od: Avoid subshell in rcS and rcK #104

Draft
wants to merge 1 commit into
base: opendingux
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion board/opendingux/gcw0/overlay/etc/init.d/S50bluetooth.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ case "$1" in
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
${EXIT:-exit} 1
esac
2 changes: 1 addition & 1 deletion board/opendingux/gcw0/overlay/etc/init.d/S90volume.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ case "$1" in
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
${EXIT:-exit} 1
esac
2 changes: 1 addition & 1 deletion board/opendingux/lepus/overlay/etc/init.d/S90volume.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ case "$1" in
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
${EXIT:-exit} 1
esac
2 changes: 1 addition & 1 deletion board/opendingux/rs90/overlay/etc/init.d/S49alsa-hack.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

[ -z "$1" ] || [ "x$1" = "xstart" ] || exit 0
[ -z "$1" ] || [ "x$1" = "xstart" ] || ${EXIT:-exit} 0

psplash_write "Setup ALSA hack..."

Expand Down
2 changes: 1 addition & 1 deletion board/opendingux/rs90/overlay/etc/init.d/S98usb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ case "$MODEL" in
ylm,rs90)
;;
*)
return 0
${EXIT:-exit} 0
;;
esac

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
NR_HUGEPAGES=8
[ -r /etc/default/hugepages ] && . /etc/default/hugepages

[ -z "$1" ] || [ "x$1" = "xstart" ] || exit 0
[ -z "$1" ] || [ "x$1" = "xstart" ] || ${EXIT:-exit} 0

if [ -d /sys/kernel/mm/hugepages/hugepages-2048kB ] ; then
psplash_write "Configuring huge pages..."
Expand Down
4 changes: 2 additions & 2 deletions board/opendingux/target_skeleton/etc/init.d/S02modules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ case "$1" in

if [ "`grep '/lib/modules' /proc/mounts`" ] ; then
echo 'Modules filesystem is already mounted' >&2
exit 1
${EXIT:-exit} 1
fi

if [ -r "$MODULES_FILESYSTEM" ] ; then
Expand All @@ -29,5 +29,5 @@ case "$1" in

*)
echo "Usage: $0 {start|stop}"
exit 1
${EXIT:-exit} 1
esac
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

[ -z "$1" ] || [ "x$1" = "xstart" ] || exit 0
[ -z "$1" ] || [ "x$1" = "xstart" ] || ${EXIT:-exit} 0

mkdir -p /media/data

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

[ -z "$1" ] || [ "x$1" = "xstart" ] || exit 0
[ -z "$1" ] || [ "x$1" = "xstart" ] || ${EXIT:-exit} 0

psplash_write "Initializing filesystem..."

Expand Down
2 changes: 1 addition & 1 deletion board/opendingux/target_skeleton/etc/init.d/S05hostname.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

[ -z "$1" ] || [ "x$1" = "xstart" ] || exit 0
[ -z "$1" ] || [ "x$1" = "xstart" ] || ${EXIT:-exit} 0

IFS= read -r -d $'\0' MODEL </sys/firmware/devicetree/base/compatible

Expand Down
2 changes: 1 addition & 1 deletion board/opendingux/target_skeleton/etc/init.d/S09passwd.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

[ -z "$1" ] || [ "x$1" = "xstart" ] || exit 0
[ -z "$1" ] || [ "x$1" = "xstart" ] || ${EXIT:-exit} 0

if [ ! -f /usr/local/etc/shadow ]; then
echo 'od:*:::::::' > /usr/local/etc/shadow
Expand Down
4 changes: 2 additions & 2 deletions board/opendingux/target_skeleton/etc/init.d/S09swap.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

[ -z "$1" ] || [ "x$1" = "xstart" ] || exit 0
[ -z "$1" ] || [ "x$1" = "xstart" ] || ${EXIT:-exit} 0

SWAP_PERCENT_MEM=80
SWAPPINESS=20
Expand All @@ -9,7 +9,7 @@ SWAP_COMPRESSOR=lzo-rle
# User overrides.
[ -r /usr/local/etc/swap.conf ] && . /usr/local/etc/swap.conf

[ $SWAP_PERCENT_MEM -gt 0 ] || return 0
[ $SWAP_PERCENT_MEM -gt 0 ] || ${EXIT:-exit} 0

psplash_write "Setup swap..."

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

[ -z "$1" ] || [ "x$1" = "xstart" ] || exit 0
[ -z "$1" ] || [ "x$1" = "xstart" ] || ${EXIT:-exit} 0

mkdir -p /etc/local/dropbear

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ case "$1" in
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
${EXIT:-exit} 1
esac
2 changes: 1 addition & 1 deletion board/opendingux/target_skeleton/etc/init.d/S97perms.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

[ -z "$1" ] || [ "x$1" = "xstart" ] || exit 0
[ -z "$1" ] || [ "x$1" = "xstart" ] || ${EXIT:-exit} 0

psplash_write "Setup permissions..."

Expand Down
4 changes: 1 addition & 3 deletions package/initscripts/init.d/rcK
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ for i in $(ls -r /etc/init.d/S??*) ;do
case "$i" in
*.sh)
# Source shell script for speed.
(
trap - INT QUIT TSTP
EXIT=return
set stop
. $i
)
;;
*)
# No sh extension, so fork subprocess.
Expand Down
4 changes: 1 addition & 3 deletions package/initscripts/init.d/rcS
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ for i in /etc/init.d/S??* ;do
case "$i" in
*.sh)
# Source shell script for speed.
(
trap - INT QUIT TSTP
EXIT=return
set start
. $i
)
;;
*)
# No sh extension, so fork subprocess.
Expand Down