Magellan Linux

Diff of /trunk/initscripts/busybox/rc/rc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/busybox-initscripts/rc/rc revision 724 by niro, Mon Jun 2 22:14:35 2008 UTC trunk/initscripts/busybox/rc/rc revision 1789 by niro, Mon Apr 2 11:27:25 2012 UTC
# Line 1  Line 1 
1  #!/bin/sh  #!/bin/sh
2  # $Header: /home/cvsd/magellan-cvs/magellan-src/busybox-initscripts/rc/rc,v 1.1 2008-06-02 22:14:35 niro Exp $  # $Header: /home/cvsd/magellan-cvs/magellan-src/busybox-initscripts/rc/rc,v 1.2 2008-12-22 22:09:27 niro Exp $
3    
4  source /etc/conf.d/rc  source /etc/conf.d/rc
5  source ${rc_functions}  source ${rc_functions}
6    
7  # load udev helper functions  # source kernel config if exists
8  source ${rc_base}/init.d/udev  [ -f /etc/conf.d/kernel ] && source /etc/conf.d/kernel
9    
10  # get mage version  # get mage version
11  MAGEVER="$(< /etc/mageversion)"  if [[ -f /etc/os-release ]]
12    then
13     MAGEVER="$(read_os_release version_id)"
14    elif [ -f /etc/mageversion ]
15    then
16     MAGEVER="$(< /etc/mageversion)"
17    else
18     MAGEVER="unkown"
19    fi
20    
21  # source kernel config if exists  # source kernel config if exists
22  [ -f /etc/conf.d/kernel ] && source /etc/conf.d/kernel  [ -f /etc/conf.d/kernel ] && source /etc/conf.d/kernel
23    
24  trap "" INT QUIT TSTP  # override devicemanager helper functions
25    if [[ ${RC_DEVICEMANAGER} = udev ]] && [[ -f ${rc_base}/init.d/udev ]]
26  [[ ! -z $1 ]] && runlevel=$1  then
27     source ${rc_base}/init.d/udev
28    
29  if [[ -z ${runlevel} ]]  elif [[ ${RC_DEVICEMANAGER} = mdev ]] && [[ -f ${rc_base}/init.d/mdev ]]
30  then  then
31   echo "Usage: $0 <runlevel>" >&2   source ${rc_base}/init.d/mdev
  exit 1  
32  fi  fi
33    
34    trap "" INT QUIT TSTP
35    
36    [ "$1" != "" ] && runlevel=$1
37    
38  if [[ $runlevel = sysinit ]]  if [[ $runlevel = sysinit ]]
39  then  then
40   echo   rc_echo
41   echo -e "${COLGREEN}Starting ${COLBLUE}MAGELLAN (v${MAGEVER}) ${COLGREEN}Linux${COLDEFAULT}"   rc_echo -e "${COLGREEN}Starting ${COLBLUE}MAGELLAN (v${MAGEVER}) ${COLGREEN}Linux${COLDEFAULT}"
42   echo -e "Copyright 2001-2008 Niels Rogalla; http://magellan-linux.net"   rc_echo "Copyright 2001-2012 Niels Rogalla; http://magellan-linux.net"
43   echo   rc_echo
44    
45   # mount proc filesystem, needed for bootsplash;   # mount proc filesystem, needed for bootsplash;
46   # no use of '/etc/rc.d/init.d/mountproc' anymore   # no use of '/etc/rc.d/init.d/mountproc' anymore
47   if [ ! -e /proc/mounts ]   if [ ! -e /proc/mounts ]
48   then   then
49   echo -e ${COLOREDSTAR}"Mounting proc file system ..."   rc_print "Mounting proc file system ..."
50   mount -n /proc   mount -n /proc
51   evaluate_retval   evaluate_retval
52   fi   fi
53    
54     # load bootsplash
55     splash "rc_init" "${runlevel}"
56    
57   # set default verbose level for kernel messages   # set default verbose level for kernel messages
58   [ -z "${RC_VERBOSE_LEVEL}" ] && RC_VERBOSE_LEVEL=3   [ -z "${RC_VERBOSE_LEVEL}" ] && RC_VERBOSE_LEVEL=3
59   echo "${RC_VERBOSE_LEVEL}" > /proc/sys/kernel/printk   echo "${RC_VERBOSE_LEVEL}" > /proc/sys/kernel/printk
# Line 47  then Line 61  then
61   # mount sys file system before udev   # mount sys file system before udev
62   if [ -d /sys ]   if [ -d /sys ]
63   then   then
64   echo -e ${COLOREDSTAR}"Mounting sysfs file system ..."   if [ ! -e /sys/kernel/notes ]
65   mount -n -t sysfs sysfs /sys   then
66   evaluate_retval   rc_print "Mounting sysfs file system ..."
67     mount -n -t sysfs sysfs /sys
68     evaluate_retval
69     fi
70   else   else
71   echo -e ${COLORED}"Fatal: mountpoint /sys missing ..."   rc_echo -e ${COLRED}"Fatal: mountpoint /sys missing ..."
72   echo -e ${COLYELLOW}"Please create the directory /sys (mkdir -p /sys)."   rc_echo -e ${COLYELLOW}"Please create the directory /sys (mkdir -p /sys)."
73   echo -e ${COLYELLOW}"It's essential for a 2.6 kernel."   rc_echo -e ${COLYELLOW}"It's essential for a 2.6 kernel."
74   fi   fi
75    
76   #### load udev ####   # start device management
77   start_udev   start_devicemanager
  ## end udev ##  
78    
79   ## load devpts ##   ## load devpts ##
80   # devfs/udev with 2.6 has no ptys, so devpts is also needed   # devfs/udev with 2.6 has no ptys, so devpts is also needed
# Line 72  then Line 88  then
88   if [ ! -d "/dev/pts" -a -e "/dev/.devfsd" ] && is_fs_mounted devfs   if [ ! -d "/dev/pts" -a -e "/dev/.devfsd" ] && is_fs_mounted devfs
89   then   then
90   mkdir -p /dev/pts &> /dev/null || \   mkdir -p /dev/pts &> /dev/null || \
91   echo "Could not create /dev/pts !"   rc_echo "Could not create /dev/pts !"
92   fi   fi
93    
94   # now mount devpts   # now mount devpts
95   if [ -d /dev/pts ]   if [ -d /dev/pts ]
96   then   then
97   echo -e ${COLOREDSTAR}"Mounting devpts at /dev/pts ..."   rc_print "Mounting devpts at /dev/pts ..."
98   mount -n -t devpts -o gid=4,mode=0620 devpts /dev/pts   mount -n -t devpts -o gid=4,mode=0620 devpts /dev/pts
99   evaluate_retval   evaluate_retval
100   fi   fi
101   else   else
102   # devpts is not supported, give a warning   # devpts is not supported, give a warning
103   echo -e ${COLRED}"No devpts filesystem found ..."   rc_echo -e ${COLRED}"No devpts filesystem found ..."
104   echo -e ${COLYELLOW}"Your Kernel doesn't support the devpts filesystem."   rc_echo -e ${COLYELLOW}"Your Kernel doesn't support the devpts filesystem."
105   echo -e ${COLYELLOW}"Devfs with a kernel-2.6.x needs devpts,"   rc_echo -e ${COLYELLOW}"Devfs/Udev with a kernel-2.6.x needs devpts,"
106   echo -e ${COLYELLOW}"or no pty's are available."   rc_echo -e ${COLYELLOW}"or no pty's are available."
107   echo -e ${COLYELLOW}"Please make shure that this is enabled in your kernel."   rc_echo -e ${COLYELLOW}"Please make sure that this is enabled in your kernel."
108   echo   rc_echo
109   echo -e ${COLYELLOW}"Press any key to continue ..."   rc_echo -e ${COLYELLOW}"Press any key to continue ..."
110   read   read
111   fi   fi
112   ## end devpts ##   ## end devpts ##
# Line 99  then Line 115  then
115   ## load usbfs ##   ## load usbfs ##
116   if kernel_supports_fs usbfs   if kernel_supports_fs usbfs
117   then   then
118   echo -e ${COLOREDSTAR}"Mounting usbfs at /proc/bus/usb ..."   rc_print "Mounting usbfs at /proc/bus/usb ..."
119   mount -n -t usbfs usbfs /proc/bus/usb   mount -n -t usbfs usbfs /proc/bus/usb
120   evaluate_retval   evaluate_retval
121   fi   fi
122   ## end usbfs ##   ## end usbfs ##
123    
124   ## services state dir ##   ## services state dir ##
125   echo -e ${COLOREDSTAR}"Mounting tmpfs at ${svcdir} ..."   rc_print "Mounting tmpfs at ${svcdir} ..."
126   mount -n -t tmpfs tmpfs "${svcdir}" -o rw,mode=0644,size="${svcsize}"k   mount -n -t tmpfs tmpfs "${svcdir}" -o rw,mode=0644,size="${svcsize}"k
127   evaluate_retval   evaluate_retval
   
  # load bootsplash  
  splash "rc_init" "${runlevel}"  
128  fi  fi
129    
130  if [[ ${runlevel} = shutdown ]] || [[ ${runlevel} = reboot ]]  if [[ ${runlevel} = shutdown ]] || [[ ${runlevel} = reboot ]]
# Line 125  then Line 138  then
138   if [[ ${RC_DEVICE_TARBALL} = yes ]] && \   if [[ ${RC_DEVICE_TARBALL} = yes ]] && \
139   [ -e /dev/.udev -a ! -e /dev/.devfsd -a ! -e /.bootdev ]   [ -e /dev/.udev -a ! -e /dev/.devfsd -a ! -e /.bootdev ]
140   then   then
141   echo -e ${COLOREDSTAR}"Saving /dev device nodes ..."   rc_print "Saving /dev device nodes ..."
142   ( cd /dev; tar -jclpf "/tmp/devices-$$.tar.bz2" * &> /dev/null )   ( cd /dev; tar -jclpf "/tmp/devices-$$.tar.bz2" * &> /dev/null )
143   mv -f "/tmp/devices-$$.tar.bz2" /lib/udev/state/devices.tar.bz2   mv -f "/tmp/devices-$$.tar.bz2" /lib/udev/state/devices.tar.bz2
144   evaluate_retval   evaluate_retval
145   fi   fi
146    
147     # stop device management
148     stop_devicemanager
149    
150   # run through all runlevel scripts   # run through all runlevel scripts
151   for i in $(ls -v ${rc_base}/rc${runlevel}.d/K* 2> /dev/null)   for i in $(ls -v ${rc_base}/rc${runlevel}.d/K* 2> /dev/null)
152   do   do
# Line 163  then Line 179  then
179   fi   fi
180   done   done
181  fi  fi
182    
183    if [[ ${runlevel} = boot ]]
184    then
185     # exit bootsplash
186     splash "rc_exit" "${runlevel}"
187    fi

Legend:
Removed from v.724  
changed lines
  Added in v.1789