summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Mercer <bmercer@cvs.openbsd.org>2013-06-01 01:23:24 +0000
committerBrandon Mercer <bmercer@cvs.openbsd.org>2013-06-01 01:23:24 +0000
commit45293e5b3c3d3b99d2820c2a7dfddc8112bf370f (patch)
tree1c4211a4aca2a4213e790a1497fb87525464512f
parent0808e97495d787939a23ffcc439fce439b0f396d (diff)
Setup miniroot for the arm boards.
get it in deraadt@
-rw-r--r--distrib/beagle/Makefile4
-rw-r--r--distrib/beagle/miniroot/Makefile3
-rw-r--r--distrib/beagle/miniroot/Makefile.inc70
-rw-r--r--distrib/beagle/miniroot/am335x/Makefile3
-rw-r--r--distrib/beagle/miniroot/beagle/Makefile3
-rw-r--r--distrib/beagle/miniroot/panda/Makefile3
6 files changed, 84 insertions, 2 deletions
diff --git a/distrib/beagle/Makefile b/distrib/beagle/Makefile
index 5dc60356f46..7e4ca9ba886 100644
--- a/distrib/beagle/Makefile
+++ b/distrib/beagle/Makefile
@@ -1,5 +1,5 @@
-# $OpenBSD: Makefile,v 1.1 2011/03/14 16:40:23 drahn Exp $
+# $OpenBSD: Makefile,v 1.2 2013/06/01 01:23:21 bmercer Exp $
-SUBDIR= ramdisk
+SUBDIR= ramdisk miniroot
.include <bsd.subdir.mk>
diff --git a/distrib/beagle/miniroot/Makefile b/distrib/beagle/miniroot/Makefile
new file mode 100644
index 00000000000..98abfe080b5
--- /dev/null
+++ b/distrib/beagle/miniroot/Makefile
@@ -0,0 +1,3 @@
+SUBDIR= am335x beagle panda
+
+.include <bsd.subdir.mk>
diff --git a/distrib/beagle/miniroot/Makefile.inc b/distrib/beagle/miniroot/Makefile.inc
new file mode 100644
index 00000000000..cff520c1d06
--- /dev/null
+++ b/distrib/beagle/miniroot/Makefile.inc
@@ -0,0 +1,70 @@
+
+REV= ${OSrev}
+BSD_RD= bsd.rd
+
+BOARD= am335x
+
+IMAGE= miniroot-${BOARD}-${REV}.fs
+
+MOUNT_POINT= /mnt
+
+VND?= vnd0
+VND_DEV= /dev/${VND}a
+VND_CDEV= /dev/${VND}c
+VND_IDEV= /dev/${VND}i
+VND_RDEV= /dev/r${VND}a
+VND_CRDEV= /dev/r${VND}c
+VND_RIDEV= /dev/r${VND}i
+PID!= echo $$$$
+
+NBLKS= 36864
+
+
+.ifndef DESTDIR
+all ${IMAGE}:
+ @echo setenv DESTDIR before making a ramdisk!
+ @false
+.else
+all: ${IMAGE}
+
+${IMAGE}: rd_setup do_files rd_teardown
+
+.endif
+
+bsd:
+ cd ${.CURDIR}/../../../../sys/arch/beagle/conf && config RAMDISK
+ cd ${.CURDIR}/../../../../sys/arch/beagle/compile/RAMDISK && \
+ ${MAKE} clean && COPTS=-Os exec make bsd.umg
+ cp ${.CURDIR}/../../../../sys/arch/beagle/compile/RAMDISK/bsd.umg bsd
+
+do_files: bsd
+ cp ${.CURDIR}/bsd ${MOUNT_POINT}/bsd.umg
+
+rd_setup:
+ dd if=/dev/zero of=${IMAGE} bs=512 count=${NBLKS}
+ vnconfig -c ${VND} ${IMAGE}
+ fdisk -c 2 -h 255 -s 63 -yi ${VND} >/dev/null
+ echo 'u\ne 0\nC\ny\n0\n1\n1\n1\n254\n63\nf 0\nw\nq\n' | fdisk -c 2 -h 255 -s 63 -e ${VND} >/dev/null
+ newfs_msdos -F 16 -L boot ${VND_RIDEV} >/dev/null
+ mount ${VND_IDEV} ${MOUNT_POINT}
+
+rd_teardown:
+ @df -i ${MOUNT_POINT}
+ -umount ${MOUNT_POINT}
+ -vnconfig -u ${VND}
+
+
+unconfig:
+ -umount -f ${MOUNT_POINT}
+ -vnconfig -u ${VND}
+
+.PRECIOUS: ${IMAGE}
+
+.ifdef RELEASEDIR
+install:
+ cp ${IMAGE} ${RELEASEDIR}
+.endif
+
+.include <bsd.obj.mk>
+.include <bsd.subdir.mk>
+.include <bsd.own.mk>
diff --git a/distrib/beagle/miniroot/am335x/Makefile b/distrib/beagle/miniroot/am335x/Makefile
new file mode 100644
index 00000000000..c79cd2b34ba
--- /dev/null
+++ b/distrib/beagle/miniroot/am335x/Makefile
@@ -0,0 +1,3 @@
+BOARD= am335x
+
+.include "../Makefile.inc"
diff --git a/distrib/beagle/miniroot/beagle/Makefile b/distrib/beagle/miniroot/beagle/Makefile
new file mode 100644
index 00000000000..04145bf8730
--- /dev/null
+++ b/distrib/beagle/miniroot/beagle/Makefile
@@ -0,0 +1,3 @@
+BOARD= beagle
+
+.include "../Makefile.inc"
diff --git a/distrib/beagle/miniroot/panda/Makefile b/distrib/beagle/miniroot/panda/Makefile
new file mode 100644
index 00000000000..1a9d8766098
--- /dev/null
+++ b/distrib/beagle/miniroot/panda/Makefile
@@ -0,0 +1,3 @@
+BOARD= panda
+
+.include "../Makefile.inc"