summaryrefslogtreecommitdiff
path: root/distrib/sparc
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2012-09-10 22:21:04 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2012-09-10 22:21:04 +0000
commitb8e68c155c86d7cd5ebad7770fd38db92925fa36 (patch)
tree226e233008c0fd5ae8b52268bfcc73839b17547c /distrib/sparc
parentf1af1ea230931ec44bcae88a4faa64e0ad138653 (diff)
turn sparc miniroot into a proper ramdisk (thereby removing the last
consumer of the ../miniroot build method) ok miod, product of this tested by todd
Diffstat (limited to 'distrib/sparc')
-rw-r--r--distrib/sparc/Makefile8
-rw-r--r--distrib/sparc/Makefile.inc3
-rw-r--r--distrib/sparc/miniroot/Makefile64
-rw-r--r--distrib/sparc/miniroot/Makefile.inc3
-rw-r--r--distrib/sparc/miniroot/list.local45
5 files changed, 71 insertions, 52 deletions
diff --git a/distrib/sparc/Makefile b/distrib/sparc/Makefile
index c11961930cf..82b8207f789 100644
--- a/distrib/sparc/Makefile
+++ b/distrib/sparc/Makefile
@@ -1,13 +1,13 @@
-# $OpenBSD: Makefile,v 1.9 2009/04/17 03:58:55 deraadt Exp $
+# $OpenBSD: Makefile,v 1.10 2012/09/10 22:21:03 deraadt Exp $
-SUBDIR+= ../ramdisk ../miniroot cdfs
+# preserve order: 'miniroot' and 'cdfs' depend on 'ramdisk'
+SUBDIR+= ../ramdisk miniroot cdfs
.if make(obj) || make(cleandir) || make(clean)
SUBDIR+= iso
.endif
unconfig:
- cd ramdisk; ${MAKE} unconfig
- cd ramdiskA; ${MAKE} unconfig
+ cd ../ramdisk; ${MAKE} unconfig
.include <bsd.subdir.mk>
diff --git a/distrib/sparc/Makefile.inc b/distrib/sparc/Makefile.inc
new file mode 100644
index 00000000000..4d42dbfe34d
--- /dev/null
+++ b/distrib/sparc/Makefile.inc
@@ -0,0 +1,3 @@
+# $OpenBSD: Makefile.inc,v 1.1 2012/09/10 22:21:03 deraadt Exp $
+
+REV= ${OSrev}
diff --git a/distrib/sparc/miniroot/Makefile b/distrib/sparc/miniroot/Makefile
new file mode 100644
index 00000000000..1428e0413a5
--- /dev/null
+++ b/distrib/sparc/miniroot/Makefile
@@ -0,0 +1,64 @@
+# $OpenBSD: Makefile,v 1.1 2012/09/10 22:21:03 deraadt Exp $
+
+TOP= ${.CURDIR}/..
+
+.include "${TOP}/Makefile.inc"
+
+TARGET=miniroot${REV}.fs
+
+.ifndef DESTDIR
+all ${TARGET}:
+ @echo setenv DESTDIR before making a ramdisk!
+ @false
+.else
+
+all: ${TARGET}
+
+${TARGET}: vn_up install_files installboot showit vn_down
+
+vn_up: blank_filesystem
+ vnconfig vnd0 ${TARGET}
+ disklabel -w vnd0 fakeramdisk
+ newfs -m 0 /dev/rvnd0a
+ mount /dev/vnd0a /mnt
+
+showit:
+ df -ki /mnt
+
+vn_down:
+ -umount /mnt
+ -vnconfig -u vnd0
+
+install_files: bsd.rd ofwboot
+
+bsd.rd:
+ install -c -m 555 -o root -g wheel \
+ ${.OBJDIR}/../../ramdisk/bsd.rd /mnt/bsd
+
+ofwboot:
+ install -c -m 555 -o root -g wheel \
+ ${DESTDIR}/usr/mdec/boot /mnt/boot
+
+installboot:
+ /usr/mdec/binstall -v ffs /mnt
+
+blank_filesystem:
+ dd if=/dev/zero of=${TARGET} bs=512 count=12288
+
+.endif
+
+unconfig:
+ -umount -f /mnt
+ -vnconfig -u /dev/vnd0a
+
+.ifdef RELEASEDIR
+install:
+ cp ${TARGET} ${RELEASEDIR}
+.endif
+
+clean:
+ rm -f ${TARGET}
+
+.include <bsd.own.mk>
+.include <bsd.obj.mk>
+.include <bsd.subdir.mk>
diff --git a/distrib/sparc/miniroot/Makefile.inc b/distrib/sparc/miniroot/Makefile.inc
deleted file mode 100644
index a666f0c94eb..00000000000
--- a/distrib/sparc/miniroot/Makefile.inc
+++ /dev/null
@@ -1,3 +0,0 @@
-# $OpenBSD: Makefile.inc,v 1.5 2007/06/17 00:28:21 deraadt Exp $
-
-IMAGESIZE?= 12288 # 6MB in 512 byte blocks
diff --git a/distrib/sparc/miniroot/list.local b/distrib/sparc/miniroot/list.local
deleted file mode 100644
index 04e96165f2a..00000000000
--- a/distrib/sparc/miniroot/list.local
+++ /dev/null
@@ -1,45 +0,0 @@
-# $OpenBSD: list.local,v 1.1 2010/10/18 04:08:32 deraadt Exp $
-# $NetBSD: list,v 1.2.4.2 1996/06/26 19:25:00 pk Exp $
-
-# Sparc extra's
-LINK instbin bin/sha256
-
-LINK instbin sbin/disklabel
-LINK instbin sbin/dhclient
-LINK instbin usr/bin/grep usr/bin/egrep usr/bin/fgrep
-LINK instbin usr/bin/less usr/bin/more
-LINK instbin usr/sbin/installboot
-
-SRCDIRS sys/arch/sparc/stand
-
-SYMLINK /tmp var/tmp
-
-# copy the MAKEDEV script and make some devices
-SCRIPT ${DESTDIR}/dev/MAKEDEV dev/MAKEDEV
-SPECIAL cd dev; sh MAKEDEV ramdisk
-
-# we need the contents of /usr/mdec
-COPYDIR ${DESTDIR}/usr/mdec usr/mdec
-SPECIAL rm -f usr/mdec/binstall usr/mdec/installboot
-
-# copy the kernel
-COPY bsd bsd
-
-# various files that we need in /etc for the install
-SYMLINK /tmp/fstab.shadow etc/fstab
-SYMLINK /tmp/resolv.conf.shadow etc/resolv.conf
-SYMLINK /tmp/hosts etc/hosts
-TERMCAP vt100,vt220,dumb,sun usr/share/misc/termcap
-
-# dhcp things
-SCRIPT ${DESTDIR}/sbin/dhclient-script sbin/dhclient-script
-SPECIAL chmod 755 sbin/dhclient-script
-
-# and the installation tools
-SCRIPT ${ARCHDIR}/../install.md install.md
-
-COPY ${DESTDIR}/usr/mdec/boot boot
-SPECIAL sync; ${DESTDIR}/usr/mdec/binstall -v ffs ${TARGDIR}
-
-HASH var/hash
-TZ