Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=fvbe.git;a=commitdiff;h=c942362896dac5aa2abc13f499054954a7c9fb52

commit c942362896dac5aa2abc13f499054954a7c9fb52
Author: James Buren <[email protected]>
Date:   Thu Nov 7 22:57:49 2013 -0600

init: add bash script to serve as initrd init

diff --git a/bin/init b/bin/init
new file mode 100644
index 0000000..fc436eb
--- /dev/null
+++ b/bin/init
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+error()
+{
+  echo "$1"
+  halt
+  exit 1
+}
+
+ROOT="/root"
+PATH="/sbin:/usr/sbin:/bin:/usr/bin"
+
+export PATH
+
+if ! test -c /dev/zero; then
+       mount -t devtmpfs none /dev
+       test "$?" -ne 0 && error "Failed to mount /dev"
+fi
+
+if ! test -d /sys/kernel; then
+       mount -t sysfs none /sys
+       test "$?" -ne 0 && error "Failed to mount /sys"
+fi
+
+if ! test -d /proc/self; then
+  mount -t proc none /proc
+       test "$?" -ne 0 && error "Failed to mount /proc"
+fi
+
+if ! test -d "$ROOT"; then
+       mkdir -p -m 0755 "$ROOT"
+       test "$?" -ne 0 && error "Failed to create $ROOT"
+fi
+
+bash
+
+halt
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to