mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-18 23:12:59 +02:00
Merge branch 'master' of ssh://git.ipfire.org/srv/git/ipfire-2.x
Conflicts: make.sh
This commit is contained in:
@@ -98,19 +98,17 @@ case "${1}" in
|
||||
|
||||
if [ "${error_value}" -gt 3 -a "${error_value}" -lt 16 ]; then
|
||||
echo_failure
|
||||
sleep 2
|
||||
boot_mesg -n "FAILURE:\n\nFile system errors" ${FAILURE}
|
||||
boot_mesg -n " were encountered that could not be"
|
||||
boot_mesg -n " fixed automatically. This system"
|
||||
boot_mesg -n " cannot continue to boot and will"
|
||||
boot_mesg -n " therefore be halted until those"
|
||||
boot_mesg -n " errors are fixed manually by a"
|
||||
boot_mesg -n " System Administrator.\n\nAfter you"
|
||||
boot_mesg -n " press Enter, this system will be"
|
||||
boot_mesg -n " halted and powered off."
|
||||
boot_mesg -n "\n\nPress Enter to continue or wait a minute..." ${INFO}
|
||||
boot_mesg -n " System Administrator.\n\n"
|
||||
boot_mesg "" ${NORMAL}
|
||||
read -t 60 ENTER
|
||||
${rc_base}/init.d/halt stop
|
||||
sulogin
|
||||
reboot -f
|
||||
fi
|
||||
|
||||
if [ "${error_value}" -ge 16 ]; then
|
||||
|
||||
@@ -17,10 +17,16 @@
|
||||
|
||||
case "${1}" in
|
||||
start)
|
||||
#Skip if root is set by UUID
|
||||
if (grep "root=UUID=" /proc/cmdline > /dev/null); then
|
||||
exit 0;
|
||||
fi
|
||||
boot_mesg "Checking fstab bootdevice ..."
|
||||
ROOTPOS=`expr index "$CMDLINE" root=`
|
||||
read CMDLINE < /proc/cmdline
|
||||
ROOTPOS=${CMDLINE%%root=*}
|
||||
ROOTPOS=${#ROOTPOS}
|
||||
NEWROOT=`echo ${CMDLINE:$ROOTPOS} | cut -d"=" -f2 | cut -d" " -f1`;
|
||||
OLDBOOT=`cat /etc/fstab | grep -m1 "/boot" | cut -d" " -f1 | cut -f1`;
|
||||
OLDBOOT=`cat /etc/fstab | grep -m1 " / " | cut -d" " -f1 | cut -f1`;
|
||||
OLDDRV=${OLDBOOT::`expr length $OLDBOOT`-1}
|
||||
NEWDRV=${NEWROOT::`expr length $NEWROOT`-1}
|
||||
if [ "$OLDDRV" == "$NEWDRV" ]; then
|
||||
@@ -33,6 +39,15 @@ case "${1}" in
|
||||
boot_mesg "Bootdrive: $NEWDRV"
|
||||
boot_mesg "fstab-entry: $OLDDRV"
|
||||
boot_mesg
|
||||
if [ "${OLDDRV:0:4}" == "UUID" ]; then
|
||||
#Short sleep because the kernel has not finished hardware detections
|
||||
#and made many messages here and the password question is not readable
|
||||
sleep 3
|
||||
boot_mesg "${FAILURE}Error OLD Bootdrive is already a UUID. Can't fix."
|
||||
boot_mesg "${NORMAL}"
|
||||
sulogin
|
||||
reboot -f
|
||||
fi
|
||||
boot_mesg "Attempt to repair it ..."
|
||||
mount -o remount,rw /
|
||||
sed -i -e "s|$OLDDRV|$NEWDRV|g" /etc/fstab
|
||||
|
||||
71
src/initscripts/init.d/client175
Normal file
71
src/initscripts/init.d/client175
Normal file
@@ -0,0 +1,71 @@
|
||||
#!/bin/sh
|
||||
########################################################################
|
||||
# Begin $rc_base/init.d/
|
||||
#
|
||||
# Description : Client175 (MPD Client with Webinterface)
|
||||
#
|
||||
# Author : Arne Fitzenreiter
|
||||
#
|
||||
# Version : 01.00
|
||||
#
|
||||
# Notes : for www.ipfire.org - GPLv3
|
||||
#
|
||||
########################################################################
|
||||
|
||||
. /etc/sysconfig/rc
|
||||
. ${rc_functions}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
if [ -e /var/run/client175.pid ]; then
|
||||
if ps -p $(cat /var/run/client175.pid) > /dev/null
|
||||
then
|
||||
boot_mesg "Client175 is already running."
|
||||
echo_failure
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
boot_mesg "Starting Client175 MPD WebIF..."
|
||||
sudo -u nobody python /srv/client175/server.py > /var/log/client175 2>&1 &
|
||||
echo $! > /var/run/client175.pid
|
||||
evaluate_retval
|
||||
;;
|
||||
|
||||
stop)
|
||||
if [ ! -e /var/run/client175.pid ]; then
|
||||
boot_mesg "Client175 pidfile not found!"
|
||||
echo_failure
|
||||
exit 0
|
||||
fi
|
||||
boot_mesg "Stopping Client175 MPD WebIF..."
|
||||
kill $(cat /var/run/client175.pid)
|
||||
evaluate_retval
|
||||
rm -f /var/run/client175.pid
|
||||
;;
|
||||
|
||||
restart)
|
||||
${0} stop
|
||||
sleep 1
|
||||
${0} start
|
||||
|
||||
;;
|
||||
status)
|
||||
if [ -e /var/run/client175.pid ]; then
|
||||
if ps -p $(cat /var/run/client175.pid) > /dev/null
|
||||
then
|
||||
|
||||
boot_mesg "Client175 is running with Process Id(s) $(cat /var/run/client175.pid)"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
boot_mesg "Client175 should not running"
|
||||
exit 0
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: ${0} {start|stop|reload|restart|status}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# End $rc_base/init.d/
|
||||
@@ -6,7 +6,7 @@
|
||||
#
|
||||
# Authors : Arne Fitzenreiter - arne_f@ipfire.org
|
||||
#
|
||||
# Version : 01.00
|
||||
# Version : 01.01
|
||||
#
|
||||
# Notes :
|
||||
#
|
||||
@@ -21,7 +21,7 @@ case "${1}" in
|
||||
|
||||
# try cpufreq hardware depend modules
|
||||
for i in $(find /lib/modules/$(uname -r)/kernel/arch/x86/kernel/cpu/cpufreq \
|
||||
! -name speedstep-lib.ko | sort -d -r); do
|
||||
! -name speedstep-lib.ko ! -name p4-clockmod.ko | sort -d -r); do
|
||||
module=$(basename $i | cut -d. -f1);
|
||||
modprobe $module > /dev/null 2>&1;
|
||||
if [ ${?} = 0 ]; then
|
||||
|
||||
9
src/initscripts/init.d/firstsetup
Normal file
9
src/initscripts/init.d/firstsetup
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
export LANG=en_US.utf8
|
||||
/usr/local/sbin/setup /dev/tty2 INSTALL
|
||||
echo Restarting udev...
|
||||
killall udevd
|
||||
/sbin/udevd --daemon
|
||||
/sbin/udevadm trigger
|
||||
/sbin/udevadm settle
|
||||
rm -f /etc/rc.d/rcsysinit.d/S75firstsetup
|
||||
@@ -74,7 +74,7 @@ case "${1}" in
|
||||
fi
|
||||
fi
|
||||
|
||||
/usr/sbin/iwconfig $INTERFACE channel $CHANNEL
|
||||
/usr/sbin/iwconfig $INTERFACE channel $CHANNEL 2>/dev/null
|
||||
/usr/sbin/iwconfig $INTERFACE txpower $TXPOWER
|
||||
|
||||
/usr/bin/hostapd -P /var/run/hostapd /etc/hostapd.conf >/dev/null 2>&1 &
|
||||
|
||||
@@ -57,8 +57,8 @@ case "$1" in
|
||||
fi
|
||||
if [ -e /var/ipfire/proxy/enable -o -e /var/ipfire/proxy/enable_blue ]; then
|
||||
boot_mesg "Starting Squid Proxy Server..."
|
||||
loadproc /usr/sbin/squid -D -z >/dev/null 2>&1
|
||||
loadproc /usr/sbin/squid -D
|
||||
loadproc /usr/sbin/squid -z >/dev/null 2>&1
|
||||
loadproc /usr/sbin/squid
|
||||
fi
|
||||
|
||||
eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
|
||||
|
||||
@@ -60,10 +60,10 @@ case "${1}" in
|
||||
|
||||
# Now traverse /sys in order to "coldplug" devices that have
|
||||
# already been discovered
|
||||
/sbin/udevtrigger
|
||||
/sbin/udevadm trigger
|
||||
|
||||
# Now wait for udevd to process the uevents we triggered
|
||||
/sbin/udevsettle
|
||||
/sbin/udevadm settle
|
||||
evaluate_retval
|
||||
|
||||
;;
|
||||
|
||||
@@ -26,7 +26,7 @@ case "${1}" in
|
||||
done 2>/dev/null
|
||||
|
||||
# Now wait for udevd to process the uevents we triggered
|
||||
/sbin/udevsettle
|
||||
/sbin/udevadm settle
|
||||
evaluate_retval
|
||||
;;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user