--- VirtualBox-2.1.4-orig/routines.sh	2009-02-26 09:24:55.000000000 -0600
+++ VirtualBox-2.1.4/routines.sh	2009-03-26 19:30:15.000000000 -0500
@@ -184,7 +184,7 @@
         ro_INIT_TYPE=sysv
     elif [ -f /etc/lfs-release -a -d /etc/rc.d/init.d ]; then
         ro_SYS_TYPE=lfs
-        ro_INIT_TYPE=sysv
+        ro_INIT_TYPE=lfs
     elif [ -f /etc/rc.d/rc.local ]; then
         ro_SYS_TYPE=unknown
         ro_INIT_TYPE=bsd
@@ -223,6 +223,9 @@
     elif [ "$ro_INIT_TYPE" = "bsd" ]; then
         cp "$1" "/etc/rc.d/rc.$2" 2> /dev/null
         chmod 755 "/etc/rc.d/rc.$2" 2> /dev/null
+    elif [ "$ro_INIT_TYPE" = "lfs" ]; then
+        cp "$1" "/etc/rc.d/init.d/$2" 2> /dev/null
+        chmod 755 "/etc/rc.d/init.d/$2" 2> /dev/null
     else
         log "install_init_script: error: unknown init type"
         return 1
@@ -243,6 +246,8 @@
         rm -f "/etc/init.d/$1" > /dev/null 2>&1
     elif [ "$ro_INIT_TYPE" = "bsd" ]; then
         rm -f "/etc/rc.d/rc.$1" > /dev/null 2>&1
+    elif [ "$ro_INIT_TYPE" = "lfs" ]; then
+        rm -f "/etc/rc.d/init.d/$1" > /dev/null 2>&1
     else
         log "remove_init_script: error: unknown init type"
         return 1
@@ -263,6 +268,8 @@
         "/etc/init.d/$1" start >> $ro_LOG_FILE 2>&1
     elif [ "$ro_INIT_TYPE" = "bsd" ]; then
         "/etc/rc.d/rc.$1" start >> $ro_LOG_FILE  2>&1
+    elif [ "$ro_INIT_TYPE" = "lfs" ]; then
+        "/etc/rc.d/init.d/$1" start >> $ro_LOG_FILE 2>&1
     else
         log "start_init_script: error: unknown init type"
         return 1
@@ -282,6 +289,8 @@
         "/etc/init.d/$1" stop >> $ro_LOG_FILE 2>&1
     elif [ "$ro_INIT_TYPE" = "bsd" ]; then
         "/etc/rc.d/rc.$1" stop >> $ro_LOG_FILE 2>&1
+    elif [ "$ro_INIT_TYPE" = "lfs" ]; then
+        "/etc/rc.d/init.d/$1" stop >> $ro_LOG_FILE 2>&1
     else
         log "stop_init_script: error: unknown init type"
         return 1
@@ -349,13 +358,13 @@
         expr "$3" + 0 > /dev/null 2>&1 && expr 0 \<= "$3" > /dev/null && \
             [ `expr length "$3"` -eq 2 ] || \
             { log "addrunlevel: stop sequence number must be between 00 and 99" && return 1; }
-        ln -fs "/etc/rc.d/init.d/$1" "/etc/rc0.d/K`expr $3`$1" > /dev/null 2>&1
-        ln -fs "/etc/rc.d/init.d/$1" "/etc/rc1.d/K`expr $3`$1" > /dev/null 2>&1
-        ln -fs "/etc/rc.d/init.d/$1" "/etc/rc2.d/S`expr $2`$1" > /dev/null 2>&1
-        ln -fs "/etc/rc.d/init.d/$1" "/etc/rc3.d/S`expr $2`$1" > /dev/null 2>&1
-        ln -fs "/etc/rc.d/init.d/$1" "/etc/rc4.d/S`expr $2`$1" > /dev/null 2>&1
-        ln -fs "/etc/rc.d/init.d/$1" "/etc/rc5.d/S`expr $2`$1" > /dev/null 2>&1
-        ln -fs "/etc/rc.d/init.d/$1" "/etc/rc6.d/K`expr $3`$1" > /dev/null 2>&1
+        ln -fs "/etc/rc.d/init.d/$1" "/etc/rc.d/rc0.d/K`expr $3`$1" > /dev/null 2>&1
+        ln -fs "/etc/rc.d/init.d/$1" "/etc/rc.d/rc1.d/K`expr $3`$1" > /dev/null 2>&1
+        ln -fs "/etc/rc.d/init.d/$1" "/etc/rc.d/rc2.d/S`expr $2`$1" > /dev/null 2>&1
+        ln -fs "/etc/rc.d/init.d/$1" "/etc/rc.d/rc3.d/S`expr $2`$1" > /dev/null 2>&1
+        ln -fs "/etc/rc.d/init.d/$1" "/etc/rc.d/rc4.d/S`expr $2`$1" > /dev/null 2>&1
+        ln -fs "/etc/rc.d/init.d/$1" "/etc/rc.d/rc5.d/S`expr $2`$1" > /dev/null 2>&1
+        ln -fs "/etc/rc.d/init.d/$1" "/etc/rc.d/rc6.d/K`expr $3`$1" > /dev/null 2>&1
     # BSD-based systems require changing the rc.local file to start a new service.
     elif [ "$ro_INIT_TYPE" = "bsd" ]; then
         if ! grep $1 $ro_RC_LOCAL
@@ -420,13 +429,13 @@
         rc-update del "$1" > /dev/null 2>&1
     # Linux from scratch, by the book
     elif [ "$ro_SYS_TYPE" = "lfs" ]; then
-        rm "/etc/rc0.d/K??$1" > /dev/null 2>&1
-        rm "/etc/rc1.d/K??$1" > /dev/null 2>&1
-        rm "/etc/rc2.d/S??$1" > /dev/null 2>&1
-        rm "/etc/rc3.d/S??$1" > /dev/null 2>&1
-        rm "/etc/rc4.d/S??$1" > /dev/null 2>&1
-        rm "/etc/rc5.d/S??$1" > /dev/null 2>&1
-        rm "/etc/rc6.d/K??$1" > /dev/null 2>&1
+        rm "/etc/rc.d/rc0.d/K??$1" > /dev/null 2>&1
+        rm "/etc/rc.d/rc1.d/K??$1" > /dev/null 2>&1
+        rm "/etc/rc.d/rc2.d/S??$1" > /dev/null 2>&1
+        rm "/etc/rc.d/rc3.d/S??$1" > /dev/null 2>&1
+        rm "/etc/rc.d/rc4.d/S??$1" > /dev/null 2>&1
+        rm "/etc/rc.d/rc5.d/S??$1" > /dev/null 2>&1
+        rm "/etc/rc.d/rc6.d/K??$1" > /dev/null 2>&1
     # Unknown sysv-type system
     elif [ "$ro_INIT_TYPE" = "sysv" ]; then
         echo 1>&2 "Please remove remove references to the initialization script"
