Permalink
Browse files

Add rules to build an initrd.

  • Loading branch information...
1 parent 0a54f3e commit 64b4ce9f72a20a73d5fa670d9301251e767c2209 @nelhage committed Aug 9, 2011
Showing with 35 additions and 0 deletions.
  1. +3 −0 .gitignore
  2. +25 −0 Makefile
  3. +7 −0 init
View
@@ -0,0 +1,3 @@
+out
+virtunoid
+initrd.gz
View
@@ -0,0 +1,25 @@
+LDFLAGS=-static
+PROGS=mknod mount ifconfig udhcpc sh
+
+all: virtunoid initrd.gz
+
+virtunoid: virtunoid-config.h
+
+initrd: out/virtunoid out/init out/proc $(PROGS:%=out/bin/%)
+ (cd out && find | cpio -o -Hnewc) > $@
+
+%.gz: %
+ gzip -f $<
+
+out out/bin out/proc: %: $(dirname %)
+ mkdir -p $@
+
+$(PROGS:%=out/bin/%): out/bin/%: out/bin/busybox
+ ln -sf busybox $@
+
+out/bin/busybox: out out/bin
+ cp /bin/busybox $@
+
+out/init out/virtunoid: out/%: % out
+ cp $< $@
+
View
7 init
@@ -0,0 +1,7 @@
+#!/bin/sh
+mknod /dev/rtc c 254 0
+mount -t proc none /proc
+ifconfig eth0 10.0.2.15 up
+udhcpc
+/virtunoid
+sh

0 comments on commit 64b4ce9

Please sign in to comment.