summaryrefslogtreecommitdiffstats
path: root/poky/meta/recipes-core/sysvinit/sysvinit
diff options
context:
space:
mode:
Diffstat (limited to 'poky/meta/recipes-core/sysvinit/sysvinit')
-rw-r--r--poky/meta/recipes-core/sysvinit/sysvinit/0001-This-fixes-an-issue-that-clang-reports-about-mutlipl.patch52
-rw-r--r--poky/meta/recipes-core/sysvinit/sysvinit/01_bootlogd1
-rwxr-xr-xpoky/meta/recipes-core/sysvinit/sysvinit/bootlogd.init98
-rwxr-xr-xpoky/meta/recipes-core/sysvinit/sysvinit/rc182
-rwxr-xr-xpoky/meta/recipes-core/sysvinit/sysvinit/rcS34
-rw-r--r--poky/meta/recipes-core/sysvinit/sysvinit/rcS-default29
-rw-r--r--poky/meta/recipes-core/sysvinit/sysvinit/realpath.patch78
7 files changed, 474 insertions, 0 deletions
diff --git a/poky/meta/recipes-core/sysvinit/sysvinit/0001-This-fixes-an-issue-that-clang-reports-about-mutlipl.patch b/poky/meta/recipes-core/sysvinit/sysvinit/0001-This-fixes-an-issue-that-clang-reports-about-mutlipl.patch
new file mode 100644
index 000000000..f35c15cb3
--- /dev/null
+++ b/poky/meta/recipes-core/sysvinit/sysvinit/0001-This-fixes-an-issue-that-clang-reports-about-mutlipl.patch
@@ -0,0 +1,52 @@
+From 36ac97bfe51797458442a6035219a504a42e703a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 21 Aug 2015 10:56:40 -0700
+Subject: [PATCH] This fixes an issue that clang reports about mutliple output
+ files
+
+Issue is that we are passing .h file to link step as seen below.
+
+| arm-oe-linux-gnueabi-clang -march=armv7-a -mthumb -mfloat-abi=hard
+-mfpu=neon-vfpv4 -mtune=cortex-a7 -D__extern_always_inline=inline
+-no-integrated-as
+--sysroot=/mnt/home/kraj/work/angstrom/sources/openembedded-core/build/tmp-glibc/sysroots/raspberrypi2
+-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed halt.o ifdown.o hddown.o
+utmp.o reboot.h -o halt
+| clang-3.7: error: cannot specify -o when generating multiple output
+files
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/Makefile | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/Makefile b/src/Makefile
+index e77ed5f..a6f9f40 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -103,9 +103,9 @@ all: $(BIN) $(SBIN) $(USRBIN)
+ init: LDLIBS += $(INITLIBS) $(STATIC)
+ init: init.o init_utmp.o
+
+-halt: halt.o ifdown.o hddown.o utmp.o reboot.h
++halt: halt.o ifdown.o hddown.o utmp.o
+
+-last: last.o oldutmp.h
++last: last.o
+
+ mesg: mesg.o
+
+@@ -120,7 +120,7 @@ sulogin: sulogin.o
+
+ wall: dowall.o wall.o
+
+-shutdown: dowall.o shutdown.o utmp.o reboot.h
++shutdown: dowall.o shutdown.o utmp.o
+
+ bootlogd: LDLIBS += -lutil
+ bootlogd: bootlogd.o
+--
+2.1.4
+
diff --git a/poky/meta/recipes-core/sysvinit/sysvinit/01_bootlogd b/poky/meta/recipes-core/sysvinit/sysvinit/01_bootlogd
new file mode 100644
index 000000000..a689d92d6
--- /dev/null
+++ b/poky/meta/recipes-core/sysvinit/sysvinit/01_bootlogd
@@ -0,0 +1 @@
+f root root 0644 /var/log/boot none
diff --git a/poky/meta/recipes-core/sysvinit/sysvinit/bootlogd.init b/poky/meta/recipes-core/sysvinit/sysvinit/bootlogd.init
new file mode 100755
index 000000000..df5aa430c
--- /dev/null
+++ b/poky/meta/recipes-core/sysvinit/sysvinit/bootlogd.init
@@ -0,0 +1,98 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides: bootlogd
+# Required-Start:
+# Required-Stop:
+# Default-Start: S
+# Default-Stop: 2 3 4 5
+# Short-Description: One of the first scripts to be executed. Starts or stops
+# the bootlogd log program. If this script is called as
+# "stop-bootlogd", it will stop the daemon instead of
+# starting it even when called with the "start" argument.
+#
+### END INIT INFO
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/sbin/bootlogd
+NAME=bootlogd
+DESC="Bootlog daemon"
+
+# source function library
+. /etc/init.d/functions
+
+test -f $DAEMON || exit 0
+
+[ -r /etc/default/bootlogd ] && . /etc/default/bootlogd
+
+## set -e # not needed
+
+case "$BOOTLOGD_ENABLE" in
+ [Nn]*)
+ exit 0
+ ;;
+esac
+
+STOPPER=
+ACTION="$1"
+case "$0" in
+ *stop-bootlog*)
+ STOPPER=Y
+ if [ "$ACTION" = start ]
+ then
+ ACTION=stop
+ fi
+ ;;
+esac
+
+case "$ACTION" in
+ start)
+ [ "${VERBOSE}" != "no" ] && echo -n "Starting $DESC: "
+ if [ -d /proc/1/. ]
+ then
+ umask 027
+ start-stop-daemon --start --quiet \
+ --exec $DAEMON -- -r -c
+ else
+ $DAEMON -r -c
+ fi
+ [ "${VERBOSE}" != "no" ] && echo "$NAME."
+ ;;
+ stop)
+ # stop may get called during bootup, so let it honor
+ # rcS VERBOSE setting
+ [ "${VERBOSE}" != "no" ] && echo -n "Stopping $DESC: "
+ start-stop-daemon --stop --quiet --exec $DAEMON
+
+ if [ "$STOPPER" ] && [ "$(which savelog 2>/dev/null)" ] && \
+ [ -f /var/log/boot ] && [ -f /var/log/boot~ ]
+ then
+ cd /var/log
+ chgrp adm boot
+ savelog -p -c 5 boot > /dev/null 2>&1
+ mv boot.0 boot
+ mv boot~ boot.0
+ fi
+
+ [ "${VERBOSE}" != "no" ] && echo "$NAME."
+ ;;
+ restart|force-reload)
+ echo -n "Restarting $DESC: "
+ start-stop-daemon --stop --quiet --exec $DAEMON
+ sleep 1
+ start-stop-daemon --start --quiet --exec $DAEMON
+ echo "$NAME."
+ ;;
+ status)
+ status $DAEMON
+ exit $?
+ ;;
+ *)
+ N=${0##*/}
+ N=${N#[SK]??}
+ echo "Usage: $N {start|stop|status|restart|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
diff --git a/poky/meta/recipes-core/sysvinit/sysvinit/rc b/poky/meta/recipes-core/sysvinit/sysvinit/rc
new file mode 100755
index 000000000..7ca41ae1a
--- /dev/null
+++ b/poky/meta/recipes-core/sysvinit/sysvinit/rc
@@ -0,0 +1,182 @@
+#!/bin/sh
+#
+# rc This file is responsible for starting/stopping
+# services when the runlevel changes.
+#
+# Optimization feature:
+# A startup script is _not_ run when the service was
+# running in the previous runlevel and it wasn't stopped
+# in the runlevel transition (most Debian services don't
+# have K?? links in rc{1,2,3,4,5} )
+#
+# Author: Miquel van Smoorenburg <miquels@cistron.nl>
+# Bruce Perens <Bruce@Pixar.com>
+#
+# Version: @(#)rc 2.78 07-Nov-1999 miquels@cistron.nl
+#
+
+. /etc/default/rcS
+export VERBOSE
+
+startup_progress() {
+ step=$(($step + $step_change))
+ if [ "$num_steps" != "0" ]; then
+ progress=$((($step * $progress_size / $num_steps) + $first_step))
+ else
+ progress=$progress_size
+ fi
+ #echo "PROGRESS is $progress $runlevel $first_step + ($step of $num_steps) $step_change $progress_size"
+ #if type psplash-write >/dev/null 2>&1; then
+ # TMPDIR=/mnt/.psplash psplash-write "PROGRESS $progress" || true
+ #fi
+ if [ -e /mnt/.psplash/psplash_fifo ]; then
+ echo "PROGRESS $progress" > /mnt/.psplash/psplash_fifo
+ fi
+}
+
+
+#
+# Start script or program.
+#
+startup() {
+ # Handle verbosity
+ [ "$VERBOSE" = very ] && echo "INIT: Running $@..."
+
+ case "$1" in
+ *.sh)
+ # Source shell script for speed.
+ (
+ trap - INT QUIT TSTP
+ scriptname=$1
+ shift
+ . $scriptname
+ )
+ ;;
+ *)
+ "$@"
+ ;;
+ esac
+ startup_progress
+}
+
+ # Ignore CTRL-C only in this shell, so we can interrupt subprocesses.
+ trap ":" INT QUIT TSTP
+
+ # Set onlcr to avoid staircase effect.
+ stty onlcr 0>&1
+
+ # Limit stack size for startup scripts
+ [ "$STACK_SIZE" == "" ] || ulimit -S -s $STACK_SIZE
+
+ # Now find out what the current and what the previous runlevel are.
+
+ runlevel=$RUNLEVEL
+ # Get first argument. Set new runlevel to this argument.
+ [ "$1" != "" ] && runlevel=$1
+ if [ "$runlevel" = "" ]
+ then
+ echo "Usage: $0 <runlevel>" >&2
+ exit 1
+ fi
+ previous=$PREVLEVEL
+ [ "$previous" = "" ] && previous=N
+
+ export runlevel previous
+
+ # Is there an rc directory for this new runlevel?
+ if [ -d /etc/rc$runlevel.d ]
+ then
+ # Find out where in the progress bar the initramfs got to.
+ PROGRESS_STATE=0
+ #if [ -f /dev/.initramfs/progress_state ]; then
+ # . /dev/.initramfs/progress_state
+ #fi
+
+ # Split the remaining portion of the progress bar into thirds
+ progress_size=$(((100 - $PROGRESS_STATE) / 3))
+
+ case "$runlevel" in
+ 0|6)
+ # Count down from -100 to 0 and use the entire bar
+ first_step=-100
+ progress_size=100
+ step_change=1
+ ;;
+ S)
+ # Begin where the initramfs left off and use 2/3
+ # of the remaining space
+ first_step=$PROGRESS_STATE
+ progress_size=$(($progress_size * 2))
+ step_change=1
+ ;;
+ *)
+ # Begin where rcS left off and use the final 1/3 of
+ # the space (by leaving progress_size unchanged)
+ first_step=$(($progress_size * 2 + $PROGRESS_STATE))
+ step_change=1
+ ;;
+ esac
+
+ num_steps=0
+ for s in /etc/rc$runlevel.d/[SK]*; do
+ case "${s##/etc/rc$runlevel.d/S??}" in
+ gdm|xdm|kdm|reboot|halt)
+ break
+ ;;
+ esac
+ num_steps=$(($num_steps + 1))
+ done
+ step=0
+
+ # First, run the KILL scripts.
+ if [ $previous != N ]
+ then
+ for i in /etc/rc$runlevel.d/K[0-9][0-9]*
+ do
+ # Check if the script is there.
+ [ ! -f $i ] && continue
+
+ # Stop the service.
+ startup $i stop
+ done
+ fi
+
+ # Now run the START scripts for this runlevel.
+ for i in /etc/rc$runlevel.d/S*
+ do
+ [ ! -f $i ] && continue
+
+ if [ $previous != N ] && [ $previous != S ]
+ then
+ #
+ # Find start script in previous runlevel and
+ # stop script in this runlevel.
+ #
+ suffix=${i#/etc/rc$runlevel.d/S[0-9][0-9]}
+ stop=/etc/rc$runlevel.d/K[0-9][0-9]$suffix
+ previous_start=/etc/rc$previous.d/S[0-9][0-9]$suffix
+ #
+ # If there is a start script in the previous level
+ # and _no_ stop script in this level, we don't
+ # have to re-start the service.
+ #
+ [ -f $previous_start ] && [ ! -f $stop ] && continue
+ fi
+ case "$runlevel" in
+ 0|6)
+ startup $i stop
+ ;;
+ *)
+ startup $i start
+ ;;
+ esac
+ done
+ fi
+
+#Uncomment to cause psplash to exit manually, otherwise it exits when it sees a VC switch
+if [ "x$runlevel" != "xS" ] && [ ! -x /etc/rc${runlevel}.d/S??xserver-nodm ]; then
+ if type psplash-write >/dev/null 2>&1; then
+ TMPDIR=/mnt/.psplash psplash-write "QUIT" || true
+ umount -l /mnt/.psplash
+ fi
+fi
diff --git a/poky/meta/recipes-core/sysvinit/sysvinit/rcS b/poky/meta/recipes-core/sysvinit/sysvinit/rcS
new file mode 100755
index 000000000..080b04f32
--- /dev/null
+++ b/poky/meta/recipes-core/sysvinit/sysvinit/rcS
@@ -0,0 +1,34 @@
+#!/bin/sh
+#
+# rcS Call all S??* scripts in /etc/rcS.d in
+# numerical/alphabetical order.
+#
+# Version: @(#)/etc/init.d/rcS 2.76 19-Apr-1999 miquels@cistron.nl
+#
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+runlevel=S
+prevlevel=N
+umask 022
+export PATH runlevel prevlevel
+
+# Make sure proc is mounted
+#
+[ -d "/proc/1" ] || mount /proc
+
+#
+# Source defaults.
+#
+. /etc/default/rcS
+
+#
+# Trap CTRL-C &c only in this shell so we can interrupt subprocesses.
+#
+trap ":" INT QUIT TSTP
+
+#
+# Call all parts in order.
+#
+exec /etc/init.d/rc S
+
+
diff --git a/poky/meta/recipes-core/sysvinit/sysvinit/rcS-default b/poky/meta/recipes-core/sysvinit/sysvinit/rcS-default
new file mode 100644
index 000000000..709cdf6ec
--- /dev/null
+++ b/poky/meta/recipes-core/sysvinit/sysvinit/rcS-default
@@ -0,0 +1,29 @@
+#
+# Defaults for the boot scripts in /etc/rcS.d
+#
+
+# Time files in /tmp are kept in days.
+TMPTIME=0
+# Set to yes if you want sulogin to be spawned on bootup
+SULOGIN=no
+# Set to no if you want to be able to login over telnet/rlogin
+# before system startup is complete (as soon as inetd is started)
+DELAYLOGIN=no
+# Assume that the BIOS clock is set to UTC time (recommended)
+UTC=yes
+# Set VERBOSE to "no" if you would like a more quiet bootup.
+VERBOSE=no
+# Set EDITMOTD to "no" if you don't want /etc/motd to be edited automatically
+EDITMOTD=no
+# Whether to fsck root on boot
+ENABLE_ROOTFS_FSCK=no
+# Set FSCKFIX to "yes" if you want to add "-y" to the fsck at startup.
+FSCKFIX=yes
+# Set TICKADJ to the correct tick value for this specific machine
+#TICKADJ=10000
+# Enable caching in populate-volatile.sh
+VOLATILE_ENABLE_CACHE=yes
+# Indicate whether the rootfs is intended to be read-only or not.
+# Setting ROOTFS_READ_ONLY to yes and rebooting will give you a read-only rootfs.
+# Normally you should not change this value.
+ROOTFS_READ_ONLY=no
diff --git a/poky/meta/recipes-core/sysvinit/sysvinit/realpath.patch b/poky/meta/recipes-core/sysvinit/sysvinit/realpath.patch
new file mode 100644
index 000000000..5e0dca3bf
--- /dev/null
+++ b/poky/meta/recipes-core/sysvinit/sysvinit/realpath.patch
@@ -0,0 +1,78 @@
+Fix build on musl use realpath() API its available on all libcs
+
+realpath() API doesnt work on systems with PATH_MAX set to be unlimited e.g. GNU/Hurd
+However for Linux it should always work
+
+Upstream-Status: Inappropriate[Linux specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: sysvinit-2.88dsf/src/ifdown.c
+===================================================================
+--- sysvinit-2.88dsf.orig/src/ifdown.c 2010-03-23 07:37:01.000000000 -0700
++++ sysvinit-2.88dsf/src/ifdown.c 2014-04-02 00:43:43.675437029 -0700
+@@ -26,11 +26,11 @@
+ #include <unistd.h>
+ #include <time.h>
+ #include <string.h>
++#include <errno.h>
+
+ #include <sys/ioctl.h>
+ #include <sys/socket.h>
+ #include <sys/time.h>
+-#include <sys/errno.h>
+
+ #include <net/if.h>
+ #include <netinet/in.h>
+Index: sysvinit-2.88dsf/src/init.c
+===================================================================
+--- sysvinit-2.88dsf.orig/src/init.c 2014-04-02 00:42:10.488770162 -0700
++++ sysvinit-2.88dsf/src/init.c 2014-04-02 00:42:59.432103823 -0700
+@@ -49,6 +49,7 @@
+ #include <utmp.h>
+ #include <ctype.h>
+ #include <stdarg.h>
++#include <sys/ttydefaults.h>
+ #include <sys/syslog.h>
+ #include <sys/time.h>
+
+Index: sysvinit-2.88dsf/src/mountpoint.c
+===================================================================
+--- sysvinit-2.88dsf.orig/src/mountpoint.c 2009-09-10 01:28:49.000000000 -0700
++++ sysvinit-2.88dsf/src/mountpoint.c 2014-04-02 00:44:18.248770942 -0700
+@@ -23,6 +23,7 @@
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
++#include <sys/types.h>
+ #include <sys/stat.h>
+ #include <unistd.h>
+ #include <stdlib.h>
+Index: sysvinit-2.88dsf/src/killall5.c
+===================================================================
+--- sysvinit-2.88dsf.orig/src/killall5.c 2014-03-26 00:49:52.982668074 -0700
++++ sysvinit-2.88dsf/src/killall5.c 2014-04-02 00:46:45.838771653 -0700
+@@ -846,9 +846,9 @@
+ char *oargv1, *pargv1;
+ if ((o->argv0 && p->argv0 && !strcmp(o->argv0,p->argv0))) {
+ if (o->argv1 && p->argv1) {
+- if ((oargv1 = canonicalize_file_name(o->argv1)) == NULL)
++ if ((oargv1 = realpath(o->argv1, NULL)) == NULL)
+ oargv1 = strdup(o->argv1);
+- if ((pargv1 = canonicalize_file_name(p->argv1)) == NULL)
++ if ((pargv1 = realpath(p->argv1, NULL)) == NULL)
+ pargv1 = strdup(p->argv1);
+ if (! strcmp(oargv1, pargv1)) {
+ ret = 1;
+Index: sysvinit-2.88dsf/src/wall.c
+===================================================================
+--- sysvinit-2.88dsf.orig/src/wall.c 2009-11-22 14:05:53.000000000 -0800
++++ sysvinit-2.88dsf/src/wall.c 2014-04-02 00:49:15.258772217 -0700
+@@ -29,6 +29,7 @@
+ #include <unistd.h>
+ #include <pwd.h>
+ #include <syslog.h>
++#include <time.h>
+ #include "init.h"
+
+
OpenPOWER on IntegriCloud