diff -Naur magellan-initscripts/etc/rc.d/init.d/devfs magellan-initscripts-external-udev/etc/rc.d/init.d/devfs --- magellan-initscripts/etc/rc.d/init.d/devfs 1970-01-01 01:00:00.000000000 +0100 +++ magellan-initscripts-external-udev/etc/rc.d/init.d/devfs 2010-12-02 14:07:40.000000000 +0100 @@ -0,0 +1,44 @@ +# starts devfs devicemanager +# $Header$ + +start_devfs() +{ + # start devfsd daemon, needed for bootsplash; + # no use of '/etc/rc.d/init.d/devfs' anymore + # check if devfs was mounted by the kernel, + # if not mount it (mbuild_livecd needs this one) + if [ ! -e /dev/.devfsd ] + then + echo -e ${COLOREDSTAR}"Mounting devfs file system ..." + mount -n -t devfs devfs /dev + evaluate_retval + fi + + if [ -e /dev/.devfsd ] + then + echo -e ${COLOREDSTAR}"Starting devfsd ..." + ## directory /lib/dev-state !must! exists ## + /sbin/devfsd /dev &> /dev/null + evaluate_retval + else + echo -e ${COLRED}"No devfs filesystem found ..." + echo -e ${COLYELLOW}"Your Kernel doesn't support the devfs filesystem." + echo -e ${COLYELLOW}"Devfs is necessary to run Magellan-Linux." + echo -e ${COLYELLOW}"Please make shure that this is enabled in your kernel." + echo + echo -e ${COLYELLOW}"Press any key to shutdown the system safely ..." + read + $rc_base/init.d/halt + fi +} + +start_devicemanager() +{ + start_devfs +} + +stop_devicemanager() +{ + # do nothing + return 0 +} diff -Naur magellan-initscripts/etc/rc.d/init.d/mountfs magellan-initscripts-external-udev/etc/rc.d/init.d/mountfs --- magellan-initscripts/etc/rc.d/init.d/mountfs 2005-07-03 23:32:06.000000000 +0200 +++ magellan-initscripts-external-udev/etc/rc.d/init.d/mountfs 2010-12-02 13:50:21.000000000 +0100 @@ -44,7 +44,10 @@ # records udev as mounted if is_fs_mounted udev then - mount -f -t ramfs udev /dev + fstype=ramfs + kernel_supports_fs tmpfs && fstype=tmpfs + kernel_supports_fs devtmpfs && fstype=devtmpfs + mount -f -t ${fstype}ramfs udev /dev fi evaluate_retval diff -Naur magellan-initscripts/etc/rc.d/init.d/mountfslivecd magellan-initscripts-external-udev/etc/rc.d/init.d/mountfslivecd --- magellan-initscripts/etc/rc.d/init.d/mountfslivecd 2005-08-31 23:45:02.000000000 +0200 +++ magellan-initscripts-external-udev/etc/rc.d/init.d/mountfslivecd 2010-12-02 13:51:15.000000000 +0100 @@ -63,7 +63,10 @@ # records udev as mounted if is_fs_mounted udev then - mount -f -t ramfs udev /dev + fstype=ramfs + kernel_supports_fs tmpfs && fstype=tmpfs + kernel_supports_fs devtmpfs && fstype=devtmpfs + mount -f -t ${fstype} udev /dev fi # fake mounts tmpfs diff -Naur magellan-initscripts/etc/rc.d/init.d/rc magellan-initscripts-external-udev/etc/rc.d/init.d/rc --- magellan-initscripts/etc/rc.d/init.d/rc 2005-07-03 23:34:35.000000000 +0200 +++ magellan-initscripts-external-udev/etc/rc.d/init.d/rc 2010-12-02 13:24:04.000000000 +0100 @@ -10,26 +10,16 @@ # source kernel config if exists [ -f /etc/conf.d/kernel ] && source /etc/conf.d/kernel -# some needed functions functions -populate_udev() { - /sbin/udevstart - - # not provided by sysfs but needed - ln -snf /proc/self/fd /dev/fd - ln -snf fd/0 /dev/stdin - ln -snf fd/1 /dev/stdout - ln -snf fd/2 /dev/stderr - ln -snf /proc/kcore /dev/core - ln -snf /proc/asound/oss/sndstat /dev/sndstat - - # create problematic directories - mkdir -p /dev/{pts,shm} - - # same as /dev/.devfsd - touch /dev/.udev +# source udev functions +if [[ ${RC_USED_DEV} = udev ]] && [[ -f ${rc_base}/init.d/udev ]] +then + source ${rc_base}/init.d/udev - return 0 -} +# load devfs only with a 2.4 kernel or its really wanted with a 2.6 +elif [[ $(kernel_major_version) = 2.4 ]] || [[ ${RC_USED_DEV} = devfs ]] && [[ -f ${rc_base}/init.d/devfs ]] +then + source ${rc_base}/init.d/devfs +fi trap "" INT QUIT TSTP @@ -70,76 +60,8 @@ fi fi - ## load devfs ## - # load devfs only with a 2.4 kernel or its really wanted with a 2.6 - if [[ $(kernel_major_version) = 2.4 ]] || [[ ${RC_USED_DEV} = devfs ]] - then - # start devfsd daemon, needed for bootsplash; - # no use of '/etc/rc.d/init.d/devfs' anymore - # check if devfs was mounted by the kernel, - # if not mount it (mbuild_livecd needs this one) - if [ ! -e /dev/.devfsd ] - then - echo -e ${COLOREDSTAR}"Mounting devfs file system ..." - mount -n -t devfs devfs /dev - evaluate_retval - fi - - if [ -e /dev/.devfsd ] - then - echo -e ${COLOREDSTAR}"Starting devfsd ..." - ## directory /lib/dev-state !must! exists ## - /sbin/devfsd /dev &> /dev/null - evaluate_retval - else - echo -e ${COLRED}"No devfs filesystem found ..." - echo -e ${COLYELLOW}"Your Kernel doesn't support the devfs filesystem." - echo -e ${COLYELLOW}"Devfs is necessary to run Magellan-Linux." - echo -e ${COLYELLOW}"Please make shure that this is enabled in your kernel." - echo - echo -e ${COLYELLOW}"Press any key to shutdown the system safely ..." - read - $rc_base/init.d/halt - fi - fi - - #### load udev #### - # load udev only with a 2.6 kernel - if [[ $(kernel_major_version) = 2.6 ]] && [[ ${RC_USED_DEV} = udev ]] - then - # create a ramdisk for populating udev - echo -e ${COLOREDSTAR}"Mounting udev at /dev ..." - # tmpfs was suggested by Greg Kroah-Hartman - # many video drivers needed exec access - mount -n -t ramfs udev /dev -o exec,nosuid,mode=0755 - evaluate_retval - - # if a device tarball exists load it and if it is activated - echo -e ${COLOREDSTAR}"Configurating system to use udev ..." - if [[ ${RC_DEVICE_TARBALL} = yes ]] - then - echo -e ${COLOREDSTAR}" Populating /dev with with device nodes ..." - tar -jxpf /lib/udev-state/devices.tar.bz2 -C /dev - evaluate_retval - fi - - # now load udev - populate_udev - - # if hotplug support exists in the kernel use it to manage udev - if [ -e /proc/sys/kernel/hotplug -a -x /sbin/hotplug ] - then - echo -e ${COLOREDSTAR}" Using /sbin/hotplug for udev management ..." - - elif [ -e /proc/sys/kernel/hotplug ] - then - echo -e ${COLOREDSTAR}" Setting /sbin/udev as hotplug agent ..." - echo "/sbin/udev" > /proc/sys/kernel/hotplug - else - echo -e ${COLOREDSTAR}${COLYELLOW}" Kernel was not compiled with hotplug support !" - fi - evaluate_retval - fi + # load devicemanager (udev or devfs) + start_devicemanager ## load devpts ## # devfs/udev with 2.6 has no ptys, so devpts is also needed @@ -193,17 +115,8 @@ # load bootsplash splash "rc_init" "${runlevel}" - # if requested save devices to a device tarball before halt - # only for kernels >=2.6 *and* udev - # make shure that udev is mounted but *not* devfs --> /dev/.devfsd - if [[ ${RC_DEVICE_TARBALL} = yes ]] && \ - [ -e /dev/.udev -a ! -e /dev/.devfsd -a ! -e /.bootdev ] - then - echo -e ${COLOREDSTAR}"Saving /dev device nodes ..." - ( cd /dev; tar -jclpf "/tmp/devices-$$.tar.bz2" * &> /dev/null ) - mv -f "/tmp/devices-$$.tar.bz2" /lib/udev-state/devices.tar.bz2 - evaluate_retval - fi + # stop devicemanager (udev or devfs) + stop_devicemanager fi diff -Naur magellan-initscripts/sbin/rc-config magellan-initscripts-external-udev/sbin/rc-config --- magellan-initscripts/sbin/rc-config 2005-07-03 15:54:15.000000000 +0200 +++ magellan-initscripts-external-udev/sbin/rc-config 2010-12-02 13:52:07.000000000 +0100 @@ -2,9 +2,9 @@ # $Header: /magellan-cvs/magellan-src/magellan-initscripts/sbin/rc-config,v 1.3 2005/07/03 13:54:15 niro Exp $ RC_INIT_BASE=/etc/init.d -RC_EXCLUDE="rc functions template splash-functions" +RC_EXCLUDE="rc functions template splash-functions devfs udev" -VERSION=0.2 +VERSION=0.2.1 get_run_levels(){ local SCRIPT