]> Zhao Yanbai Git Server - minix.git/commitdiff
/etc/rc.rescue initializes driver rescue environment
authorBen Gras <ben@minix3.org>
Fri, 21 Oct 2005 10:47:13 +0000 (10:47 +0000)
committerBen Gras <ben@minix3.org>
Fri, 21 Oct 2005 10:47:13 +0000 (10:47 +0000)
etc/Makefile
etc/rc
etc/rc.rescue [new file with mode: 0644]

index 3630b403b19c8eaeaf60cbc5a094f186b39befa7..4645585f47dd867223911cc0eb22275469d39966 100644 (file)
@@ -1,7 +1,7 @@
 
 ETC=/etc/
 USRETC=/usr/etc/
-FILES1=fstab group hostname.file inet.conf motd mtab passwd profile protocols rc services termcap ttytab utmp rc.cd binary_sizes binary_sizes.big
+FILES1=fstab group hostname.file inet.conf motd mtab passwd profile protocols rc services termcap ttytab utmp rc.cd binary_sizes binary_sizes.big rc.rescue
 FILES2=shadow
 FILES3=daily dhcptags.conf rc
 
diff --git a/etc/rc b/etc/rc
index bc4d8f0056e055ecf2cb632f7c498c6021a4fba1..61e542df78b4768afb5bee2a69cb18570ad120e5 100755 (executable)
--- a/etc/rc
+++ b/etc/rc
@@ -179,6 +179,7 @@ esac
 # Further initialization.
 test -f /usr/etc/rc && sh /usr/etc/rc $action
 test -f /usr/local/etc/rc && sh /usr/local/etc/rc $action
+test -f /etc/rc.rescue && sh /etc/rc.rescue $action
 
 # Any messages?
 test "$action" = start -a -f /etc/issue && cat /etc/issue
diff --git a/etc/rc.rescue b/etc/rc.rescue
new file mode 100644 (file)
index 0000000..f17aded
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+DRIVERS=/sbin
+RESCUE=/boot/rescue
+
+if [ "$1" != start ]
+then   exit
+fi
+
+service up $DRIVERS/rescue -dev /dev/rescue -arg 128
+mkfs /dev/rescue || exit
+mount /dev/rescue $RESCUE || exit
+cp $DRIVERS/memory $RESCUE
+label=`sysenv label`
+case "$label" in
+AT)
+       d=at_wini
+       ;;
+FLOPPY)
+       d=floppy
+       ;;
+BIOS)
+       d=bios_wini
+       ;;
+*)     exit
+       ;;
+esac
+cp $DRIVERS/$d $RESCUE
+service rescue $RESCUE