From 31f80cc8dad59014a7bce8a766d1f790801986fb Mon Sep 17 00:00:00 2001 From: fbt Date: Mon, 5 Jan 2015 22:32:29 +0300 Subject: [PATCH 1/5] avoid heredocs, they don't work on a fully readonly VFS --- rc.in | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/rc.in b/rc.in index 10173d2..b3cc208 100755 --- a/rc.in +++ b/rc.in @@ -33,14 +33,14 @@ rc.tmpdirs() { rc.mount_misc() { for m in "${cfg_mounts[@]}"; do - IFS=':' read fs fs_type mountpoint mount_options <<< "$m" + echo "$m" | while IFS=':' read fs fs_type mountpoint mount_options; do + [[ "$mount_options" ]] || { mount_options='defaults'; } - [[ "$mount_options" ]] || { mount_options='defaults'; } - - mountpoint -q "$mountpoint" || { - [[ -d "$mountpoint" ]] || { mkdir -p "$mountpoint"; } - mount "$fs" -n -t "$fs_type" -o "$mount_options" "$mountpoint" - } + mountpoint -q "$mountpoint" || { + [[ -d "$mountpoint" ]] || { mkdir -p "$mountpoint"; } + mount "$fs" -n -t "$fs_type" -o "$mount_options" "$mountpoint" + } + done done } From 1c91d7498476f0027eb1a10c362e82e4848d58ce Mon Sep 17 00:00:00 2001 From: fbt Date: Thu, 8 Jan 2015 11:13:47 +0300 Subject: [PATCH 2/5] support for reading hostname from /etc/hostname --- rc.in | 1 + 1 file changed, 1 insertion(+) diff --git a/rc.in b/rc.in index b3cc208..298f546 100755 --- a/rc.in +++ b/rc.in @@ -143,6 +143,7 @@ rc.shutdown() { } rc.hostname() { + [[ -f '/etc/hostname' ]] && { hostname "$( Date: Thu, 8 Jan 2015 12:42:44 +0300 Subject: [PATCH 3/5] simplify the default rc.conf --- rc.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc.conf b/rc.conf index 08fb49a..518162a 100644 --- a/rc.conf +++ b/rc.conf @@ -10,7 +10,7 @@ cfg_hostname='changeme' # Services cfg_services+=( 'fsck' 'mount' 'systemd-udevd' 'sysctl' ) # Services that need tp be started in an order -cfg_services+=( '@lo.iface' '@crond' '@dbus' '@alsa' ) # These start in parallel. +cfg_services+=( '@lo.iface' ) # These start in parallel. cfg_services+=( @agetty-tty{2..6} ) # Comment this if your init starts something on the ttys itself. cfg_services+=( 'rc.local' ) # Traditionally, rc.local starts last. Technically here it doesn't. Not quite :) From 782b0a3fe884e6531b842e641683392f2e991710 Mon Sep 17 00:00:00 2001 From: fbt Date: Thu, 8 Jan 2015 15:35:06 +0300 Subject: [PATCH 4/5] Newline, bitch --- rc.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc.in b/rc.in index 298f546..a7aec2b 100755 --- a/rc.in +++ b/rc.in @@ -20,7 +20,7 @@ rc.rescue() { exec "${cfg_rc_rescue_shell:-"$SHELL"}"; } rc.motd() { [[ -f "/etc/rc.motd" ]] && { while read; do - printf "$REPLY" + printf "$REPLY\n" done < "/etc/rc.motd" } From a607a631078aceb72cffc089d15f37278d1342dc Mon Sep 17 00:00:00 2001 From: fbt Date: Sat, 17 Jan 2015 16:37:15 +0300 Subject: [PATCH 5/5] Code cleanup, thx to http://www.shellcheck.net --- rc.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rc.in b/rc.in index a7aec2b..89434f6 100755 --- a/rc.in +++ b/rc.in @@ -20,7 +20,7 @@ rc.rescue() { exec "${cfg_rc_rescue_shell:-"$SHELL"}"; } rc.motd() { [[ -f "/etc/rc.motd" ]] && { while read; do - printf "$REPLY\n" + printf "%s\n" "$REPLY" done < "/etc/rc.motd" } @@ -166,7 +166,7 @@ rc.main() { case "$action" in boot) - echo "Welcome to `uname -rs`" + echo "Welcome to $(uname -rs)" rc.boot ;;