mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 19:23:24 +02:00
Hinzugefügt:
* Nodes für Framebuffer. Geändert: * Bootvorgang für Laufbalken bearbeitet. * Installer sollte Bootsplash in initrd installieren. * Neue Boot-Bilder. git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@199 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
6
src/boot.d/01-unmountinitrd
Normal file
6
src/boot.d/01-unmountinitrd
Normal file
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
# Unmount the initrd, if necessary
|
||||
if grep -q /initrd /proc/mounts && ! grep -q /initrd/loopfs /proc/mounts ; then
|
||||
umount /initrd >/dev/null 2>&1
|
||||
blockdev --flushbufs /dev/ram0 >/dev/null 2>&1
|
||||
fi
|
||||
7
src/boot.d/02-sethostname
Normal file
7
src/boot.d/02-sethostname
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
echo "Setting hostname"
|
||||
if [ -z "$DOMAINNAME" ]; then
|
||||
hostname $HOSTNAME
|
||||
else
|
||||
hostname ${HOSTNAME}.${DOMAINNAME}
|
||||
fi
|
||||
4
src/boot.d/03-loadkeymap
Normal file
4
src/boot.d/03-loadkeymap
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
if [ "$KEYMAP" != "" ]; then
|
||||
loadkeys $KEYMAP
|
||||
fi
|
||||
11
src/boot.d/04-initpowermanagement
Normal file
11
src/boot.d/04-initpowermanagement
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
# Initializing Power Management ACPI first, then APM.
|
||||
# APM won't load if ACPI is initialized anyway.
|
||||
echo "Initializing Power Management"
|
||||
modprobe ac > /dev/null 2>&1
|
||||
modprobe battery > /dev/null 2>&1
|
||||
modprobe button > /dev/null 2>&1
|
||||
modprobe fan > /dev/null 2>&1
|
||||
modprobe processor > /dev/null 2>&1
|
||||
modprobe thermal > /dev/null 2>&1
|
||||
modprobe apm > /dev/null 2>&1
|
||||
22
src/boot.d/05-initusb
Normal file
22
src/boot.d/05-initusb
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
# Initialize USB controllers
|
||||
echo "Initializing USB controllers"
|
||||
aliases=`/sbin/modprobe -c | awk '/^alias usb-controller/ { print $3 }'`
|
||||
if [ -n "$aliases" -a "$aliases" != "off" ] ; then
|
||||
modprobe usbcore
|
||||
mount -n -t usbdevfs usbdevfs /proc/bus/usb
|
||||
for alias in $aliases ; do
|
||||
[ "$alias" != "off" ] && modprobe $alias
|
||||
done
|
||||
|
||||
echo "Initializing USB storage devices"
|
||||
modprobe usb-storage
|
||||
modprobe sd_mod
|
||||
|
||||
echo "Initializing USB keyboard"
|
||||
modprobe hid
|
||||
modprobe keybdev
|
||||
|
||||
echo "Initializing USB modems"
|
||||
modprobe acm
|
||||
fi
|
||||
29
src/boot.d/06-mountrootfs
Normal file
29
src/boot.d/06-mountrootfs
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
STRING="Checking root filesystem"
|
||||
|
||||
fsck -R -T -a -C /
|
||||
RC=$?
|
||||
|
||||
if [ "$RC" = "0" ]; then
|
||||
echo "$STRING: Success"
|
||||
elif [ "$RC" = "1" ]; then
|
||||
echo "$STRING: Passed"
|
||||
fi
|
||||
|
||||
# A return of 2 or higher means there were serious problems.
|
||||
if [ $RC -gt 1 ]; then
|
||||
echo "$STRING: Failed"
|
||||
echo "*** An error occurred during the file system check."
|
||||
echo "*** Dropping you to a shell; the system will reboot"
|
||||
echo "*** when you leave the shell."
|
||||
export PS1="(Repair filesystem) \# # "
|
||||
sulogin
|
||||
echo "Unmounting filesystems"
|
||||
umount -a
|
||||
mount -n -o remount,ro /
|
||||
echo "Automatic reboot in progress."
|
||||
reboot -f
|
||||
fi
|
||||
|
||||
echo "Mounting root read/write"
|
||||
mount -n -o remount,rw /
|
||||
34
src/boot.d/07-mountotherfs
Normal file
34
src/boot.d/07-mountotherfs
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/bin/sh
|
||||
STRING="Checking other filesystems"
|
||||
fsck -R -T -a -C -A
|
||||
RC=$?
|
||||
|
||||
if [ "$RC" = "0" ]; then
|
||||
echo "$STRING: Success"
|
||||
elif [ "$RC" = "1" ]; then
|
||||
echo "$STRING: Passed"
|
||||
fi
|
||||
|
||||
# A return of 2 or higher means there were serious problems.
|
||||
if [ $RC -gt 1 ]; then
|
||||
echo "$STRING: Failed"
|
||||
echo "*** An error occurred during the file system check."
|
||||
echo "*** Dropping you to a shell; the system will reboot"
|
||||
echo "*** when you leave the shell."
|
||||
export PS1="(Repair filesystem) \# # "
|
||||
sulogin
|
||||
echo "Unmounting filesystems"
|
||||
umount -n -a
|
||||
mount -n -o remount,ro /
|
||||
echo "Automatic reboot in progress."
|
||||
reboot -f
|
||||
fi
|
||||
|
||||
echo "Mounting other filesystems"
|
||||
mount -a -n
|
||||
|
||||
if [ -e /swapfile ]; then
|
||||
echo "Turning on swap"
|
||||
chmod 600 /swapfile
|
||||
swapon /swapfile
|
||||
fi
|
||||
9
src/boot.d/08-updatesystem.map
Normal file
9
src/boot.d/08-updatesystem.map
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
echo "Updating System.map file location"
|
||||
if [ -L /boot/System.map -a -r /boot/System.map-`uname -r` -a \
|
||||
! /boot/System.map -ef /boot/System.map-`uname -r` ]; then
|
||||
ln -s -f System.map-`uname -r` /boot/System.map
|
||||
fi
|
||||
if [ ! -e /boot/System.map -a -r /boot/System.map-`uname -r` ]; then
|
||||
ln -s -f System.map-`uname -r` /boot/System.map
|
||||
fi
|
||||
3
src/boot.d/09-updatefstab
Normal file
3
src/boot.d/09-updatefstab
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
echo "Updating /etc/fstab to reflect removable devices"
|
||||
/usr/sbin/updfstab
|
||||
3
src/boot.d/10-setkernelsettings
Normal file
3
src/boot.d/10-setkernelsettings
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
echo "Setting kernel settings"
|
||||
/sbin/sysctl -e -p /etc/sysctl.conf >/dev/null
|
||||
7
src/boot.d/11-startflash
Normal file
7
src/boot.d/11-startflash
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
if [ -e /etc/FLASH ]; then
|
||||
if [ -e /etc/rc.d/rc.flash.up ]; then
|
||||
echo "Decompressing Flash"
|
||||
. /etc/rc.d/rc.flash.up
|
||||
fi
|
||||
fi
|
||||
32
src/boot.d/12-setconsole
Normal file
32
src/boot.d/12-setconsole
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
echo "Setting locale"
|
||||
LANG=en_US.utf8
|
||||
export LANG
|
||||
|
||||
echo "Setting consolefonts"
|
||||
eval $(/usr/local/bin/readhash /var/ipfire/main/settings)
|
||||
for i in 2 3 4 5 6; do
|
||||
> /dev/tty$i
|
||||
done
|
||||
if [ "$LANGUAGE" = "el" ]; then
|
||||
/usr/bin/unicode_start iso07u-16
|
||||
elif [ "$LANGUAGE" = "pt" -o "$LANGUAGE" = "bz" ]; then
|
||||
/usr/bin/unicode_start lat1-16
|
||||
elif [ "$LANGUAGE" = "cs" -o "$LANGUAGE" = "hu" -o "$LANGUAGE" = "pl" -o "$LANGUAGE" = "sk" ]; then
|
||||
/usr/bin/unicode_start lat2-16
|
||||
elif [ "$LANGUAGE" = "tr" ]; then
|
||||
/usr/bin/unicode_start lat5-16
|
||||
elif [ "$LANGUAGE" = "vi" ]; then
|
||||
/usr/bin/unicode_start viscii10-8x16
|
||||
else
|
||||
/usr/bin/unicode_start lat0-16
|
||||
fi
|
||||
|
||||
|
||||
#/sbin/splash -n -s -u 0 /boot/splash/config/bootsplash-1024x768.cfg
|
||||
/sbin/splash -n -s -u 1 /boot/splash/config/bootsplash-1024x768.cfg
|
||||
/sbin/splash -n -s -u 2 /boot/splash/config/bootsplash-1024x768.cfg
|
||||
/sbin/splash -n -s -u 3 /boot/splash/config/bootsplash-1024x768.cfg
|
||||
/sbin/splash -n -s -u 4 /boot/splash/config/bootsplash-1024x768.cfg
|
||||
/sbin/splash -n -s -u 5 /boot/splash/config/bootsplash-1024x768.cfg
|
||||
/sbin/splash -n -s -u 11 /boot/splash/config/bootsplash-1024x768.cfg
|
||||
6
src/boot.d/13-depmod
Normal file
6
src/boot.d/13-depmod
Normal file
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
echo "Update modules dependencies when necessary"
|
||||
if [ -e /var/run/need-depmod-`uname -r` ]; then
|
||||
/sbin/depmod -a
|
||||
/bin/rm -f /var/run/need-depmod-`uname -r`
|
||||
fi
|
||||
7
src/boot.d/14-clearoldfiles
Normal file
7
src/boot.d/14-clearoldfiles
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
echo "Clearing old files"
|
||||
rm -f /var/run/{*.pid,*.sem,*.tdb}
|
||||
rm -f /var/run/dhcpcd-*.pid
|
||||
rm -f /var/lock/{LCK..tty*,rc.updatered.lock}
|
||||
rm -f /var/ipfire/dhcpc/{*.pid,*.cache,*.info}
|
||||
rm -f /var/ipfire/red/{active,eciadsl-synch-done}
|
||||
3
src/boot.d/15-setclock
Normal file
3
src/boot.d/15-setclock
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
echo "Setting the clock"
|
||||
/sbin/hwclock --hctosys
|
||||
6
src/boot.d/16-cleanwtmputmp
Normal file
6
src/boot.d/16-cleanwtmputmp
Normal file
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
# Cleaning up wtmp/utmp files
|
||||
>/var/run/utmp
|
||||
touch /var/log/wtmp
|
||||
chgrp utmp /var/run/utmp /var/log/wtmp
|
||||
chmod 0664 /var/run/utmp /var/log/wtmp
|
||||
5
src/boot.d/17-runisapnp
Normal file
5
src/boot.d/17-runisapnp
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
if [ -x /usr/sbin/isapnp -a -f /var/ipfire/isapnp/isapnp.conf -a ! -f /proc/isapnp ]; then
|
||||
echo "Running isapnp"
|
||||
/usr/sbin/isapnp /var/ipfire/isapnp/isapnp.conf 2>/dev/null
|
||||
fi
|
||||
13
src/boot.d/18-sshcerts
Normal file
13
src/boot.d/18-sshcerts
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
if [ ! -e /etc/ssh/ssh_host_key ]; then
|
||||
echo "Generating SSH RSA1 key. This may take several minutes."
|
||||
/usr/bin/ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_key -N ""
|
||||
fi
|
||||
if [ ! -e /etc/ssh/ssh_host_rsa_key ]; then
|
||||
echo "Generating SSH RSA key. This may take several minutes."
|
||||
/usr/bin/ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ""
|
||||
fi
|
||||
if [ ! -e /etc/ssh/ssh_host_dsa_key ]; then
|
||||
echo "Generating SSH DSA key. This may take several minutes."
|
||||
/usr/bin/ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ""
|
||||
fi
|
||||
7
src/boot.d/19-httpcerts
Normal file
7
src/boot.d/19-httpcerts
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
# https certificate
|
||||
if [ -f /etc/httpd/server.key -a -f /etc/httpd/server.crt -a -f /etc/httpd/server.csr ]; then
|
||||
/usr/local/bin/httpscert read
|
||||
else
|
||||
/usr/local/bin/httpscert new
|
||||
fi
|
||||
3
src/boot.d/20-rotatelogs
Normal file
3
src/boot.d/20-rotatelogs
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
echo "Rotating logs"
|
||||
/usr/sbin/logrotate /etc/logrotate.conf
|
||||
3
src/boot.d/21-startsyslogd
Normal file
3
src/boot.d/21-startsyslogd
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
echo "Starting syslogd"
|
||||
/usr/sbin/syslogd -m 0
|
||||
3
src/boot.d/22-startklogd
Normal file
3
src/boot.d/22-startklogd
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
echo "Starting klogd"
|
||||
/usr/sbin/klogd -u klogd -j /var/empty
|
||||
4
src/boot.d/23-startnetwork
Normal file
4
src/boot.d/23-startnetwork
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
echo "Running /etc/rc.d/rc.network"
|
||||
. /etc/rc.d/rc.network
|
||||
echo 7200 > /proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_timeout_established
|
||||
3
src/boot.d/24-dumpbootmsg
Normal file
3
src/boot.d/24-dumpbootmsg
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
echo "Dumping boot messages"
|
||||
dmesg > /var/log/dmesg
|
||||
21
src/boot.d/25-hddshutdown
Normal file
21
src/boot.d/25-hddshutdown
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
if [ -e /var/log/rrd/disk.rrd ]; then echo "Adjusting graphs to compensate for boot"; \
|
||||
/usr/bin/perl -e 'use RRDs;RRDs::update("/var/log/rrd/disk.rrd","-t","readsect:writesect","N:U:U");'; fi
|
||||
if [ -e /var/log/rrd/disk-hda.rrd ]; then \
|
||||
/usr/bin/perl -e 'use RRDs;RRDs::update("/var/log/rrd/disk-hda.rrd","-t","readsect:writesect:sleeping","N:U:U:U");'; fi
|
||||
if [ -e /var/log/rrd/disk-hdb.rrd ]; then \
|
||||
/usr/bin/perl -e 'use RRDs;RRDs::update("/var/log/rrd/disk-hdb.rrd","-t","readsect:writesect:sleeping","N:U:U:U");'; fi
|
||||
if [ -e /var/log/rrd/disk-hdc.rrd ]; then \
|
||||
/usr/bin/perl -e 'use RRDs;RRDs::update("/var/log/rrd/disk-hdc.rrd","-t","readsect:writesect:sleeping","N:U:U:U");'; fi
|
||||
if [ -e /var/log/rrd/disk-hdd.rrd ]; then \
|
||||
/usr/bin/perl -e 'use RRDs;RRDs::update("/var/log/rrd/disk-hdd.rrd","-t","readsect:writesect:sleeping","N:U:U:U");'; fi
|
||||
if [ -e /var/log/rrd/disk-hde.rrd ]; then \
|
||||
/usr/bin/perl -e 'use RRDs;RRDs::update("/var/log/rrd/disk-hde.rrd","-t","readsect:writesect:sleeping","N:U:U:U");'; fi
|
||||
if [ -e /var/log/rrd/disk-hdf.rrd ]; then \
|
||||
/usr/bin/perl -e 'use RRDs;RRDs::update("/var/log/rrd/disk-hdf.rrd","-t","readsect:writesect:sleeping","N:U:U:U");'; fi
|
||||
if [ -e /var/log/rrd/disk-hdg.rrd ]; then \
|
||||
/usr/bin/perl -e 'use RRDs;RRDs::update("/var/log/rrd/disk-hdg.rrd","-t","readsect:writesect:sleeping","N:U:U:U");'; fi
|
||||
if [ -e /var/log/rrd/disk-hdh.rrd ]; then \
|
||||
/usr/bin/perl -e 'use RRDs;RRDs::update("/var/log/rrd/disk-hdh.rrd","-t","readsect:writesect:sleeping","N:U:U:U");'; fi
|
||||
rm -rf /tmp/hddshutdown-*
|
||||
/usr/local/bin/hddshutdown
|
||||
3
src/boot.d/30-startcron
Normal file
3
src/boot.d/30-startcron
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
echo "Starting crond"
|
||||
/usr/sbin/fcron
|
||||
3
src/boot.d/31-startsnort
Normal file
3
src/boot.d/31-startsnort
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
echo "Starting Snort (if enabled)"
|
||||
/usr/local/bin/restartsnort red blue orange green
|
||||
3
src/boot.d/32-starthttpd
Normal file
3
src/boot.d/32-starthttpd
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
echo "Starting httpd"
|
||||
/usr/sbin/httpd
|
||||
3
src/boot.d/33-startdhcp
Normal file
3
src/boot.d/33-startdhcp
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
echo "Starting dhcpd (if enabled)"
|
||||
/usr/local/bin/restartdhcp
|
||||
3
src/boot.d/34-startssh
Normal file
3
src/boot.d/34-startssh
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
echo "Starting sshd (if enabled)"
|
||||
/usr/local/bin/restartssh
|
||||
3
src/boot.d/35-startntp
Normal file
3
src/boot.d/35-startntp
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
echo "Starting ntpd (if enabled)"
|
||||
/usr/local/bin/restartntpd
|
||||
5
src/boot.d/36-startsquid
Normal file
5
src/boot.d/36-startsquid
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
if [ -e "/var/ipfire/proxy/squid.conf" ]; then
|
||||
echo "Starting squid (if enabled)"
|
||||
/usr/local/bin/restartsquid
|
||||
fi
|
||||
3
src/boot.d/40-startopenvpn
Normal file
3
src/boot.d/40-startopenvpn
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
echo "Starting openvpn (if enabled)"
|
||||
/usr/local/bin/openvpnctrl --start-daemon-only >& /dev/null
|
||||
3
src/boot.d/99-rclocal
Normal file
3
src/boot.d/99-rclocal
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
echo "Running rc.local"
|
||||
. /etc/rc.d/rc.local
|
||||
Reference in New Issue
Block a user