From 536366a7565f07d7e2bdb9c0a1abe133010650ef Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sat, 10 May 2014 10:40:48 +0200 Subject: move bootup code into rcS, we need to setup cfgfs before starting services --- package/base-files/Makefile | 2 +- package/base-files/src/etc/init.d/boot | 46 ---------------------------------- package/base-files/src/etc/init.d/done | 0 package/base-files/src/etc/init.d/fs | 0 package/base-files/src/etc/init.d/kmod | 12 +++++++++ package/base-files/src/etc/init.d/rcS | 37 ++++++++++++++++++++++++++- 6 files changed, 49 insertions(+), 48 deletions(-) delete mode 100644 package/base-files/src/etc/init.d/boot mode change 100644 => 100755 package/base-files/src/etc/init.d/done mode change 100644 => 100755 package/base-files/src/etc/init.d/fs create mode 100755 package/base-files/src/etc/init.d/kmod (limited to 'package') diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 1c31ba485..ceb20837a 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/mk/rootfs.mk PKG_NAME:= base-files PKG_VERSION:= 1.0 -PKG_RELEASE:= 88 +PKG_RELEASE:= 89 PKG_SECTION:= base PKG_DESCR:= basic files and scripts diff --git a/package/base-files/src/etc/init.d/boot b/package/base-files/src/etc/init.d/boot deleted file mode 100644 index 291bf6ab4..000000000 --- a/package/base-files/src/etc/init.d/boot +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh -#INIT 10 -[[ $1 = autostart ]] || exit 0 - -. /etc/functions.sh - -# remount /dev with smaller size -mount -o remount,nosuid,size=128k,mode=0755 -t tmpfs mdev /dev - -# 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 - -# start mdev dynamic device node management -echo >/dev/mdev.seq -echo "/sbin/mdev" >/proc/sys/kernel/hotplug -# 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 /;} || mount -o remount,rw / - -# create some useful directories in tmpfs -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 - -load_modules /etc/modules -for f in /etc/modules.d/*; do - [[ -e $f ]] && load_modules /etc/modules.d/* - break -done -exit 0 diff --git a/package/base-files/src/etc/init.d/done b/package/base-files/src/etc/init.d/done old mode 100644 new mode 100755 diff --git a/package/base-files/src/etc/init.d/fs b/package/base-files/src/etc/init.d/fs old mode 100644 new mode 100755 diff --git a/package/base-files/src/etc/init.d/kmod b/package/base-files/src/etc/init.d/kmod new file mode 100755 index 000000000..18aeedb42 --- /dev/null +++ b/package/base-files/src/etc/init.d/kmod @@ -0,0 +1,12 @@ +#!/bin/sh +#INIT 10 +[[ $1 = autostart ]] || exit 0 + +. /etc/functions.sh + +load_modules /etc/modules +for f in /etc/modules.d/*; do + [[ -e $f ]] && load_modules /etc/modules.d/* + break +done +exit 0 diff --git a/package/base-files/src/etc/init.d/rcS b/package/base-files/src/etc/init.d/rcS index 3a58d4d17..c7cbb31da 100755 --- a/package/base-files/src/etc/init.d/rcS +++ b/package/base-files/src/etc/init.d/rcS @@ -1,11 +1,46 @@ #!/bin/sh +export PATH=/bin:/sbin:/usr/bin:/usr/sbin # disable kernel messages if [ -f /proc/sys/kernel/printk ];then echo 0 > /proc/sys/kernel/printk fi ln -s /proc/self/fd/2 /dev/stderr echo "System initialization ..." -export PATH=/bin:/sbin:/usr/bin:/usr/sbin + +# 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 +echo "/sbin/mdev" >/proc/sys/kernel/hotplug +# 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 /;} || mount -o remount,rw / + +# 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 +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 + : ${rcquiet=0} if test x"$rcquiet" = x"0" && sh -n /etc/rc.conf >/dev/null 2>&1; then . /etc/rc.conf -- cgit v1.2.3