(2007-04-11) Kable-distro
This commit is contained in:
36
bsd-bootscripts/etc/rc.d/functions
Normal file
36
bsd-bootscripts/etc/rc.d/functions
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/bin/sh
|
||||
# Environmental setup
|
||||
umask 022
|
||||
export PATH="/bin:/usr/bin:/sbin:/usr/sbin"
|
||||
|
||||
# Color definitions
|
||||
NORMAL="\\033[0;39m"
|
||||
GREEN="\\033[1;32m"
|
||||
YELLOW="\\033[1;33m"
|
||||
RED="\\033[1;31m"
|
||||
CYAN="\\033[1;36m"
|
||||
BLUE="\\033[1;34m"
|
||||
|
||||
msg_red()
|
||||
{
|
||||
echo -e "${RED}${1}${NORMAL}"
|
||||
}
|
||||
msg_green()
|
||||
{
|
||||
echo -e "${GREEN}${1}${NORMAL}"
|
||||
}
|
||||
|
||||
msg_blue()
|
||||
{
|
||||
echo -e "${BLUE}${1}${NORMAL}"
|
||||
}
|
||||
msg_yellow()
|
||||
{
|
||||
echo -e "${YELLOW}${1}${NORMAL}"
|
||||
}
|
||||
msg_cyan()
|
||||
{
|
||||
echo -e "${CYAN}${1}${NORMAL}"
|
||||
}
|
||||
|
||||
|
||||
70
bsd-bootscripts/etc/rc.d/rc.0
Normal file
70
bsd-bootscripts/etc/rc.d/rc.0
Normal file
@@ -0,0 +1,70 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
#########################################
|
||||
######## HALT or REBOOT #################
|
||||
#########################################
|
||||
|
||||
#import functions
|
||||
. /etc/rc.d/functions
|
||||
|
||||
msg_green "Sending all processes the TERM signal..."
|
||||
/sbin/killall5 -15
|
||||
sleep 1
|
||||
|
||||
msg_green "Sending all processes the KILL signal..."
|
||||
/sbin/killall5 -9
|
||||
sleep 1
|
||||
|
||||
msg_green "Deactivating swap partitions..."
|
||||
/sbin/swapoff -a
|
||||
|
||||
msg_green "Saving random seed to a temporary file..."
|
||||
/bin/dd if=/dev/urandom of=/etc/random-seed count=1 bs=512 2>/dev/null
|
||||
|
||||
|
||||
msg_green "Saving mixer settings..."
|
||||
/usr/sbin/alsactl store
|
||||
|
||||
|
||||
msg_green "Saving the system time to hardware clock..."
|
||||
# For UTC
|
||||
#/sbin/hwclock --systohc --utc
|
||||
# For localtime
|
||||
/sbin/hwclock --systohc --localtime
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
case "$0" in
|
||||
*6)
|
||||
/sbin/reboot -w
|
||||
;;
|
||||
|
||||
*0)
|
||||
/sbin/halt -w
|
||||
;;
|
||||
esac
|
||||
|
||||
msg_green "Flushing filesystem buffers..."
|
||||
/bin/sync
|
||||
|
||||
msg_green "Remounting root filesystem read-only..."
|
||||
/bin/mount -n -o remount,ro /
|
||||
|
||||
msg_green "Unmounting local filesystems..."
|
||||
/bin/umount -a -tnonfs
|
||||
|
||||
case "$0" in
|
||||
*6)
|
||||
msg_green "Please stand by while rebooting..."
|
||||
/sbin/reboot -d -f -i
|
||||
;;
|
||||
|
||||
*0)
|
||||
msg_green "Bye..."
|
||||
/sbin/halt -d -f -p
|
||||
;;
|
||||
esac
|
||||
|
||||
23
bsd-bootscripts/etc/rc.d/rc.1
Normal file
23
bsd-bootscripts/etc/rc.d/rc.1
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
|
||||
#########################################
|
||||
######## SINGLE USER ####################
|
||||
#########################################
|
||||
|
||||
#import functions
|
||||
. /etc/rc.d/functions
|
||||
|
||||
|
||||
msg_green "Sending all processes the TERM signal..."
|
||||
/sbin/killall5 -15
|
||||
sleep 1
|
||||
|
||||
|
||||
|
||||
msg_green "Sending all processes the KILL signal..."
|
||||
/sbin/killall5 -9
|
||||
|
||||
|
||||
# inittab takes care of the rest
|
||||
27
bsd-bootscripts/etc/rc.d/rc.2
Normal file
27
bsd-bootscripts/etc/rc.d/rc.2
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
|
||||
#import functions
|
||||
. /etc/rc.d/functions
|
||||
|
||||
#echo 1 > /proc/sys/net/ipv4/ip_forward # enable IP forwarding
|
||||
#echo 1 > /proc/sys/net/ipv4/tcp_syncookies # defend against SYN flood
|
||||
|
||||
msg_green "Setting up loopback networking..."
|
||||
ifconfig lo 127.0.0.1 netmask 255.0.0.0
|
||||
|
||||
msg_green "Setting up eth0 "
|
||||
ifconfig eth0 192.168.1.20 netmask 255.255.255.0
|
||||
|
||||
#msg_green "Setting up eth1 "
|
||||
#ifconfig eth1 192.168.0.20 netmask 255.255.255.0
|
||||
|
||||
|
||||
|
||||
msg_green "Setting default route"
|
||||
#ip route add default via 192.168.0.1 scope link metric 1 dev eth0
|
||||
route add default gw 192.168.1.1
|
||||
|
||||
|
||||
if [ -x /etc/rc.d/rc.local ]; then
|
||||
/etc/rc.d/rc.local
|
||||
fi
|
||||
1
bsd-bootscripts/etc/rc.d/rc.3
Symbolic link
1
bsd-bootscripts/etc/rc.d/rc.3
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../../../../media/hdc1/Kable-distro/bsd-bootscripts/etc/rc.d/rc.2
|
||||
1
bsd-bootscripts/etc/rc.d/rc.4
Symbolic link
1
bsd-bootscripts/etc/rc.d/rc.4
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../../../../media/hdc1/Kable-distro/bsd-bootscripts/etc/rc.d/rc.2
|
||||
8
bsd-bootscripts/etc/rc.d/rc.5
Normal file
8
bsd-bootscripts/etc/rc.d/rc.5
Normal file
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
#import functions
|
||||
. /etc/rc.d/functions
|
||||
|
||||
if [ -x /etc/rc.d/rc.local ]; then
|
||||
/etc/rc.d/rc.local
|
||||
fi
|
||||
1
bsd-bootscripts/etc/rc.d/rc.6
Symbolic link
1
bsd-bootscripts/etc/rc.d/rc.6
Symbolic link
@@ -0,0 +1 @@
|
||||
../../../../../../media/hdc1/Kable-distro/bsd-bootscripts/etc/rc.d/rc.0
|
||||
6
bsd-bootscripts/etc/rc.d/rc.daemons
Normal file
6
bsd-bootscripts/etc/rc.d/rc.daemons
Normal file
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
#import functions
|
||||
. /etc/rc.d/functions
|
||||
|
||||
|
||||
5
bsd-bootscripts/etc/rc.d/rc.local
Normal file
5
bsd-bootscripts/etc/rc.d/rc.local
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
#import functions
|
||||
. /etc/rc.d/functions
|
||||
|
||||
132
bsd-bootscripts/etc/rc.d/rc.sysinit
Normal file
132
bsd-bootscripts/etc/rc.d/rc.sysinit
Normal file
@@ -0,0 +1,132 @@
|
||||
#!/bin/sh
|
||||
|
||||
####################################
|
||||
####### SYSINIT ####################
|
||||
####################################
|
||||
|
||||
|
||||
#import functions
|
||||
. /etc/rc.d/functions
|
||||
|
||||
|
||||
msg_green "Remounting root device read-write..."
|
||||
/bin/mount -n -v -o remount,rw /
|
||||
|
||||
msg_green "Mounting kernel-based file systems..."
|
||||
mount -n -t proc proc /proc
|
||||
mount -n -t sysfs sysfs /sys
|
||||
mount -n -t tmpfs tmpfs /dev -o mode=755
|
||||
mkdir /dev/pts
|
||||
mkdir /dev/shm
|
||||
mount -n -t devpts devpts /dev/pts -o gid=4,mode=620
|
||||
mount -n -t tmpfs tmpfs /dev/shm
|
||||
|
||||
msg_green "Starting UDEV..."
|
||||
|
||||
# Avoid other binarys reciving kernel events
|
||||
echo > /proc/sys/kernel/hotplug
|
||||
|
||||
# Copy static device nodes to /dev
|
||||
cp -a /lib/udev/devices/* /dev
|
||||
|
||||
/sbin/udevd --daemon
|
||||
/sbin/udevtrigger
|
||||
/sbin/udevsettle
|
||||
|
||||
msg_green "Setting HD params"
|
||||
hdparm -d1 -c1 -u1 -m16 /dev/hda
|
||||
|
||||
msg_green "Starting system and kernel log daemons...."
|
||||
/usr/sbin/syslogd
|
||||
/usr/sbin/klogd -c3
|
||||
|
||||
|
||||
msg_green "Initializing swap partitions..."
|
||||
/sbin/swapon -a
|
||||
|
||||
# Creaning mtab
|
||||
echo "" >/etc/mtab
|
||||
/bin/mount -f -o remount,rw /
|
||||
|
||||
|
||||
|
||||
msg_green "Mounting other local filesystems..."
|
||||
/bin/mount -a -v -tnonfs
|
||||
|
||||
|
||||
|
||||
msg_green "Setting up hostname..."
|
||||
/bin/hostname `cat /etc/hostname |cut -d . -f1`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if [ -f "/etc/random-seed" ]; then
|
||||
msg_green "Initializing random number generator..."
|
||||
/bin/cat /etc/random-seed >/dev/urandom
|
||||
rm -f /etc/random-seed
|
||||
fi
|
||||
|
||||
|
||||
|
||||
msg_green "restoring mixer settings..."
|
||||
/usr/sbin/alsactl restore
|
||||
|
||||
|
||||
# removing stale PID files is good, too
|
||||
msg_green "Removing stale PID files..."
|
||||
/bin/rm /var/run/*.pid &> /dev/null
|
||||
/bin/rm /etc/dhcpc/*.pid &> /dev/null
|
||||
|
||||
|
||||
|
||||
msg_green "Loading keymap..."
|
||||
/bin/loadkeys es &> /dev/null
|
||||
|
||||
|
||||
msg_green "Setting console font..."
|
||||
/usr/bin/setfont lat9u-12.psfu.g
|
||||
|
||||
|
||||
msg_green "Setting keyboard rate (30) and delay (250)..."
|
||||
/usr/bin/kbdrate -r 30 -d 250
|
||||
|
||||
|
||||
msg_green "Setting up Mouse(gpm)..."
|
||||
gpm -m /dev/input/mice -t imps2
|
||||
|
||||
|
||||
### mplayer likes this...
|
||||
msg_green "Configuring RTC..."
|
||||
echo 1024 > /proc/sys/dev/rtc/max-user-freq
|
||||
|
||||
|
||||
msg_green "Setting system time from hardware clock..."
|
||||
# For UTC
|
||||
#/sbin/hwclock --hctosys --utc
|
||||
# For Localtime
|
||||
/sbin/hwclock --hctosys --localtime
|
||||
|
||||
|
||||
|
||||
### Use modules? If yes, uncomment this:
|
||||
# echo "Updating module dependencies..."
|
||||
# /sbin/depmod -a
|
||||
|
||||
# Load Modules
|
||||
if [ -f "/etc/modules" ]; then
|
||||
msg_green "Loading modules..."
|
||||
for i in $(cat /etc/modules)
|
||||
do
|
||||
modprobe $i
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
### You may find this useful when you have some (non-networking) daemons
|
||||
### and an extra .rc-file for them:
|
||||
if [ -x /etc/rc.d/rc.daemons ]; then
|
||||
/etc/rc.d/rc.daemons
|
||||
fi
|
||||
Reference in New Issue
Block a user