summaryrefslogtreecommitdiff
path: root/package/simpleinit
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2014-08-26 12:28:55 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2014-08-26 12:29:24 +0200
commit9d6eef9b39547d230d5a7cb871735bae71f5fd55 (patch)
treed204388625afbaed50d26c136bbea12861a0d2c6 /package/simpleinit
parent8e2707b81b0c90295c9fdf92a576925442d22147 (diff)
we need to remove crtbegin.o/crtend.o from gcc specs file. otherwise broken executables (f.e. sash) with a wrong data start are created by elf2flt)
Diffstat (limited to 'package/simpleinit')
-rw-r--r--package/simpleinit/Makefile4
-rw-r--r--package/simpleinit/files/inittab2
-rwxr-xr-xpackage/simpleinit/files/rc54
3 files changed, 17 insertions, 43 deletions
diff --git a/package/simpleinit/Makefile b/package/simpleinit/Makefile
index aeeedfc08..43ea68660 100644
--- a/package/simpleinit/Makefile
+++ b/package/simpleinit/Makefile
@@ -20,10 +20,14 @@ BUILD_STYLE:= manual
INSTALL_STYLE:= manual
do-build:
+ PATH="${TOOLCHAIN_DIR}/usr/bin:$$PATH" \
${TARGET_CC} ${TARGET_CPPFLAGS} ${TARGET_CFLAGS} ${TARGET_LDFLAGS} \
-o ${WRKBUILD}/simpleinit ${WRKBUILD}/simpleinit.c
do-install:
+ ${INSTALL_DIR} ${IDIR_SIMPLEINIT}/etc
+ ${CP} ./files/rc ${IDIR_SIMPLEINIT}/etc
+ ${CP} ./files/inittab ${IDIR_SIMPLEINIT}/etc
${INSTALL_DIR} ${IDIR_SIMPLEINIT}/sbin
${INSTALL_BIN} ${WRKBUILD}/simpleinit ${IDIR_SIMPLEINIT}/sbin/init
diff --git a/package/simpleinit/files/inittab b/package/simpleinit/files/inittab
new file mode 100644
index 000000000..1c4744d6a
--- /dev/null
+++ b/package/simpleinit/files/inittab
@@ -0,0 +1,2 @@
+# example
+#inet:unknown:/bin/inetd
diff --git a/package/simpleinit/files/rc b/package/simpleinit/files/rc
index 33d60a4b6..ec8ace337 100755
--- a/package/simpleinit/files/rc
+++ b/package/simpleinit/files/rc
@@ -1,47 +1,15 @@
#!/bin/sh
-set -x
-export PATH=/bin:/sbin:/usr/bin:/usr/sbin
-ln -s /proc/self/fd/2 /dev/stderr
-: ${rcquiet=0}
-if [ $rcquiet -ne 1 ];then
- echo "System initialization ..."
-fi
-
-# remount /dev with smaller size
-mount -o remount,nosuid,size=128k,mode=0755 -t tmpfs mdev /dev
-
-# start mdev dynamic device node management
-echo >/dev/mdev.seq
-if [ -f /proc/sys/kernel/hotplug ];then
- echo "/sbin/mdev" >/proc/sys/kernel/hotplug
-fi
-# creates f.e. /dev/root
-mdev -s
-
-# seed some random
-cat /etc/.rnd >/dev/urandom 2>&1
-
-# setup cfgfs
-[ -x /sbin/cfgfs ] && {
- cfgfs setup
- mount -o remount,ro /
-}
-
-# remount /tmp with smaller size
-size=$(cat /etc/tmpfs 2>/dev/null)
-[ -z $size ] && size=2048
-mount -o remount,nosuid,nodev,mode=1777,size=${size}k -t tmpfs tmpfs /tmp
-
-# create some useful directories in tmpfs
+echo Starting OpenADK
+hostname openadk
+mount -t proc proc /proc
+mount -t sysfs sys /sys
+mkdir -m 755 /dev/pts
+mount -t devpts devpts /dev/pts
+mount -t tmpfs -o size=8M tmpfs /tmp
+chmod 1777 /tmp
mkdir -p /var/log
mkdir -p /var/run
mkdir -p /var/tmp
-touch /var/log/lastlog
-touch /var/log/wtmp
-
-HOSTNAME=
-[[ -s /etc/hostname ]] && HOSTNAME=$(cat /etc/hostname)
-HOSTNAME=${HOSTNAME%%.*}
-echo ${HOSTNAME:=openadk} >/proc/sys/kernel/hostname
-
-chown 0:0 /tmp; chmod 1777 /tmp
+mdev -s
+mount
+ifconfig lo 127.0.0.1 up