Merge branch 'master' of builder:git/spark-rc

This commit is contained in:
Jack L. Frost 2015-03-02 17:40:16 +03:00
commit e4b9660bce
2 changed files with 11 additions and 10 deletions

View File

@ -10,7 +10,7 @@ cfg_hostname='changeme'
# Services # Services
cfg_services+=( 'fsck' 'mount' 'systemd-udevd' 'sysctl' ) # Services that need tp be started in an order 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+=( @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 :) cfg_services+=( 'rc.local' ) # Traditionally, rc.local starts last. Technically here it doesn't. Not quite :)

19
rc.in
View File

@ -20,7 +20,7 @@ rc.rescue() { exec "${cfg_rc_rescue_shell:-"$SHELL"}"; }
rc.motd() { rc.motd() {
[[ -f "/etc/rc.motd" ]] && { [[ -f "/etc/rc.motd" ]] && {
while read; do while read; do
printf "$REPLY" printf "%s\n" "$REPLY"
done < "/etc/rc.motd" done < "/etc/rc.motd"
} }
@ -33,14 +33,14 @@ rc.tmpdirs() {
rc.mount_misc() { rc.mount_misc() {
for m in "${cfg_mounts[@]}"; do 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"; }
mountpoint -q "$mountpoint" || { mount "$fs" -n -t "$fs_type" -o "$mount_options" "$mountpoint"
[[ -d "$mountpoint" ]] || { mkdir -p "$mountpoint"; } }
mount "$fs" -n -t "$fs_type" -o "$mount_options" "$mountpoint" done
}
done done
} }
@ -144,6 +144,7 @@ rc.shutdown() {
} }
rc.hostname() { rc.hostname() {
[[ -f '/etc/hostname' ]] && { hostname "$(</etc/hostname)"; }
[[ "$cfg_hostname" ]] && { hostname "$cfg_hostname"; } [[ "$cfg_hostname" ]] && { hostname "$cfg_hostname"; }
} }
@ -170,7 +171,7 @@ rc.main() {
case "$action" in case "$action" in
boot) boot)
echo "Welcome to `uname -rs`" echo "Welcome to $(uname -rs)"
rc.boot rc.boot
;; ;;