fs

morpheus filesystem files
git clone git://git.2f30.org/fs.git
Log | Files | Refs

commit bc7a883776a4935401aa5f27efc621c0bf0e914a
parent 9dcb3f886c703004b1cb02e597b047549bdc7263
Author: sin <sin@2f30.org>
Date:   Wed Feb  5 18:25:02 +0000

Move rc scripts over to /bin

/etc should not have executable files in it.

Diffstat:
bin/rc | 62++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
bin/rc.d/dropbear | 19+++++++++++++++++++
bin/rc.d/network | 21+++++++++++++++++++++
bin/rc.local | 1+
bin/rc.multi | 19+++++++++++++++++++
bin/rc.shutdown | 36++++++++++++++++++++++++++++++++++++
etc/rc | 62--------------------------------------------------------------
etc/rc.d/dropbear | 19-------------------
etc/rc.d/network | 21---------------------
etc/rc.local | 1-
etc/rc.multi | 19-------------------
etc/rc.shutdown | 36------------------------------------
12 files changed, 158 insertions(+), 158 deletions(-)
diff --git a/bin/rc b/bin/rc @@ -0,0 +1,62 @@ +#!/bin/sh + +. /etc/rc.conf + +echo +echo +echo " Morpheus booting" +echo +echo + +echo Mounting filesystems +mkdir -p /dev/pts /dev/shm +mkdir -p /sys +mkdir -p /proc +mount -n -t proc proc /proc +mount -n -t sysfs sysfs /sys +mount -n -t devpts devpts /dev/pts + +grep -q " verbose" /proc/cmdline && dmesg -n 8 || dmesg -n 3 + +echo Running smdev +smdev -s + +echo Setting smdev as the kernel hotplug +echo /bin/smdev > /proc/sys/kernel/hotplug + +echo "Setting hostname to $HOSTNAME" +hostname $HOSTNAME + +echo Bringing up the lo interface +ifconfig lo up + +HWCLOCK_PARAMS="-s" +case $HARDWARECLOCK in + "") + ;; + UTC) + HWCLOCK_PARAMS="${HWCLOCK_PARAMS} -u" + ;; + localtime) + HWCLOCK_PARAMS="${HWCLOCK_PARAMS} -l" + ;; + *) + HWCLOCK_PARAMS="" + ;; +esac + +if [ -n "$HWCLOCK_PARAMS" ]; then + echo Setting hwclock + [ -n "$TIMEZONE" ] && export TZ="$TIMEZONE" + hwclock $HWCLOCK_PARAMS + unset TZ +fi + +echo Setting random seed +[ -f /etc/random-seed ] && cat /etc/random-seed >/dev/urandom +dd if=/dev/urandom of=/etc/random-seed count=1 bs=512 2>/dev/null + +dmesg > /var/log/dmesg.log + +echo Running rc.multi +/bin/rc.multi diff --git a/bin/rc.d/dropbear b/bin/rc.d/dropbear @@ -0,0 +1,19 @@ +#!/bin/sh + +. /etc/rc.conf + +case "$1" in + -s) + dropbear -B + ;; + -k) + pkill dropbear + ;; + -r) + pkill dropbear + dropbear -B + ;; + *) + echo "usage: $0 [-s|-k|-r]" +esac +exit 0 diff --git a/bin/rc.d/network b/bin/rc.d/network @@ -0,0 +1,21 @@ +#!/bin/sh + +. /etc/rc.conf + +case "$1" in + -s) + ifconfig $INTERFACE up && sdhcp $INTERFACE + ;; + -k) + pkill sdhcp + ifconfig $INTERFACE down + ;; + -r) + pkill sdhcp + ifconfig $INTERFACE down + ifconfig $INTERFACE up && sdhcp $INTERFACE + ;; + *) + echo "usage: $0 [-s|-k|-r]" +esac +exit 0 diff --git a/bin/rc.local b/bin/rc.local @@ -0,0 +1 @@ +#!/bin/sh diff --git a/bin/rc.multi b/bin/rc.multi @@ -0,0 +1,19 @@ +#!/bin/sh + +. /etc/rc.conf + +if [ -x /etc/dropbearkeys ]; then + echo Generating dropbear keys + /etc/dropbearkeys +fi +chmod 644 /etc/dropbearkeys + +for s in $SVC; do + echo Starting $s + /bin/rc.d/$s -s +done + +echo Running rc.local +[ -x /bin/rc.local ] && /bin/rc.local + +while :; do getty 38400 tty1 linux; done diff --git a/bin/rc.shutdown b/bin/rc.shutdown @@ -0,0 +1,36 @@ +#!/bin/sh + +PATH=/bin + +. /etc/rc.conf + +echo Shutting down + +hwclock -u -w + +echo $SVC | sed 's/ /\n/g' | tac | while read s; do + echo Stopping $s + /bin/rc.d/$s -k +done + +killall5 -15 +sleep 5 +killall5 -9 + +echo Storing random seed +dd if=/dev/urandom of=/etc/random-seed count=1 bs=512 2>/dev/null + +echo Mounting root read-only +mount -o remount,ro / + +sync +sleep 3 +wait + +echo bye + +if test "$1" = "reboot"; then + halt -r +else + halt -p +fi diff --git a/etc/rc b/etc/rc @@ -1,62 +0,0 @@ -#!/bin/sh - -. /etc/rc.conf - -echo -echo -echo " Morpheus booting" -echo -echo - -echo Mounting filesystems -mkdir -p /dev/pts /dev/shm -mkdir -p /sys -mkdir -p /proc -mount -n -t proc proc /proc -mount -n -t sysfs sysfs /sys -mount -n -t devpts devpts /dev/pts - -grep -q " verbose" /proc/cmdline && dmesg -n 8 || dmesg -n 3 - -echo Running smdev -smdev -s - -echo Setting smdev as the kernel hotplug -echo /bin/smdev > /proc/sys/kernel/hotplug - -echo "Setting hostname to $HOSTNAME" -hostname $HOSTNAME - -echo Bringing up the lo interface -ifconfig lo up - -HWCLOCK_PARAMS="-s" -case $HARDWARECLOCK in - "") - ;; - UTC) - HWCLOCK_PARAMS="${HWCLOCK_PARAMS} -u" - ;; - localtime) - HWCLOCK_PARAMS="${HWCLOCK_PARAMS} -l" - ;; - *) - HWCLOCK_PARAMS="" - ;; -esac - -if [ -n "$HWCLOCK_PARAMS" ]; then - echo Setting hwclock - [ -n "$TIMEZONE" ] && export TZ="$TIMEZONE" - hwclock $HWCLOCK_PARAMS - unset TZ -fi - -echo Setting random seed -[ -f /etc/random-seed ] && cat /etc/random-seed >/dev/urandom -dd if=/dev/urandom of=/etc/random-seed count=1 bs=512 2>/dev/null - -dmesg > /var/log/dmesg.log - -echo Running rc.multi -/etc/rc.multi diff --git a/etc/rc.d/dropbear b/etc/rc.d/dropbear @@ -1,19 +0,0 @@ -#!/bin/sh - -. /etc/rc.conf - -case "$1" in - -s) - dropbear -B - ;; - -k) - pkill dropbear - ;; - -r) - pkill dropbear - dropbear -B - ;; - *) - echo "usage: $0 [-s|-k|-r]" -esac -exit 0 diff --git a/etc/rc.d/network b/etc/rc.d/network @@ -1,21 +0,0 @@ -#!/bin/sh - -. /etc/rc.conf - -case "$1" in - -s) - ifconfig $INTERFACE up && sdhcp $INTERFACE - ;; - -k) - pkill sdhcp - ifconfig $INTERFACE down - ;; - -r) - pkill sdhcp - ifconfig $INTERFACE down - ifconfig $INTERFACE up && sdhcp $INTERFACE - ;; - *) - echo "usage: $0 [-s|-k|-r]" -esac -exit 0 diff --git a/etc/rc.local b/etc/rc.local @@ -1 +0,0 @@ -#!/bin/sh diff --git a/etc/rc.multi b/etc/rc.multi @@ -1,19 +0,0 @@ -#!/bin/sh - -. /etc/rc.conf - -if [ -x /etc/dropbearkeys ]; then - echo Generating dropbear keys - /etc/dropbearkeys -fi -chmod 644 /etc/dropbearkeys - -for s in $SVC; do - echo Starting $s - /etc/rc.d/$s -s -done - -echo Running rc.local -[ -x /etc/rc.local ] && /etc/rc.local - -while :; do getty 38400 tty1 linux; done diff --git a/etc/rc.shutdown b/etc/rc.shutdown @@ -1,36 +0,0 @@ -#!/bin/sh - -PATH=/bin - -. /etc/rc.conf - -echo Shutting down - -hwclock -u -w - -echo $SVC | sed 's/ /\n/g' | tac | while read s; do - echo Stopping $s - /etc/rc.d/$s -k -done - -killall5 -15 -sleep 5 -killall5 -9 - -echo Storing random seed -dd if=/dev/urandom of=/etc/random-seed count=1 bs=512 2>/dev/null - -echo Mounting root read-only -mount -o remount,ro / - -sync -sleep 3 -wait - -echo bye - -if test "$1" = "reboot"; then - halt -r -else - halt -p -fi