From 1143f52f25ac9af286ee4259dc38cdcffec18715 Mon Sep 17 00:00:00 2001
From: Eduardo Cavazos <wayo.cavazos@gmail.com>
Date: Wed, 21 Nov 2007 18:34:25 -0600
Subject: [PATCH] Activate swap and mount root fs in raptor

---
 extra/raptor/config.factor | 15 ++++++++++++++-
 extra/raptor/raptor.factor | 13 ++++++++++++-
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/extra/raptor/config.factor b/extra/raptor/config.factor
index 386ddf7744..ecdbf98f17 100644
--- a/extra/raptor/config.factor
+++ b/extra/raptor/config.factor
@@ -26,6 +26,14 @@ IN: raptor
   configure-route
 ] networking-hook set-global
 
+! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+! Filesystems
+! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+"/dev/hda1"     root-device     set-global
+
+{ "/dev/hda5" } swap-devices	set-global
+
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 ! boot-hook
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -43,7 +51,12 @@ IN: raptor
   "mountdevsubfs" 		    start-service
   "module-init-tools" 		    start-service
   "procps.sh" 			    start-service
-  "checkroot.sh"		    start-service
+
+  !  "checkroot.sh"		    start-service
+
+     				    activate-swap
+				    mount-root
+
   "mtab"			    start-service
   "checkfs.sh" 			    start-service
   "mountall.sh"			    start-service
diff --git a/extra/raptor/raptor.factor b/extra/raptor/raptor.factor
index 7e32463ea1..e6f960cd8d 100644
--- a/extra/raptor/raptor.factor
+++ b/extra/raptor/raptor.factor
@@ -33,7 +33,7 @@ SYMBOL: networking-hook
 
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
-: getty ( tty -- ) `{ "/sbin/getty" "38400" , } fork-exec-wait ;
+: getty ( tty -- ) `{ "/sbin/getty" "38400" , } fork-exec-args-wait ;
 
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
@@ -46,6 +46,17 @@ USING: io io.files io.streams.lines io.streams.plain io.streams.duplex
 
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
+USING: unix.linux.swap unix.linux.fs ;
+
+SYMBOL: root-device
+SYMBOL: swap-devices
+
+: activate-swap ( -- ) swap-devices get [ 0 swapon drop ] each ;
+
+: mount-root ( -- ) root-device get "/" "ext3" MS_REMOUNT f mount drop ;
+
+! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
 : start-networking ( -- ) networking-hook  get call ;
 
 : boot     ( -- ) boot-hook     get call ;