Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/distrib/mipsco Installation bootimage for NetBSD/mipsco



details:   https://anonhg.NetBSD.org/src/rev/9a1bb5b3156e
branches:  trunk
changeset: 503968:9a1bb5b3156e
user:      wdk <wdk%NetBSD.org@localhost>
date:      Mon Feb 19 07:45:38 2001 +0000

description:
Installation bootimage for NetBSD/mipsco

Currently supports Hard Disk boot only.   Mips Firmware cannot boot to
read-only media suchas CDROM drive

diffstat:

 distrib/mipsco/Makefile                         |    5 +
 distrib/mipsco/Makefile.inc                     |    9 ++
 distrib/mipsco/instkernel/Makefile              |   91 +++++++++++++++++++++
 distrib/mipsco/instkernel/diskimage.label.proto |   24 +++++
 distrib/mipsco/instkernel/disktab.diskimage     |    8 +
 distrib/mipsco/list2sh.awk                      |   55 +++++++++++++
 distrib/mipsco/ramdisk/Makefile                 |   78 ++++++++++++++++++
 distrib/mipsco/ramdisk/disktab.preinstall       |   31 +++++++
 distrib/mipsco/ramdisk/disktab.ramdisk          |    6 +
 distrib/mipsco/ramdisk/dot.hdprofile            |   62 ++++++++++++++
 distrib/mipsco/ramdisk/dot.profile              |   67 +++++++++++++++
 distrib/mipsco/ramdisk/list                     |  101 ++++++++++++++++++++++++
 distrib/mipsco/ramdisk/mtree.conf               |   82 +++++++++++++++++++
 distrib/mipsco/ramdisk/ramdiskbin.conf          |   35 ++++++++
 distrib/mipsco/ramdisk/termcap.src              |   61 ++++++++++++++
 distrib/mipsco/runlist.sh                       |   13 +++
 16 files changed, 728 insertions(+), 0 deletions(-)

diffs (truncated from 792 to 300 lines):

diff -r e9d1458c408e -r 9a1bb5b3156e distrib/mipsco/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/distrib/mipsco/Makefile   Mon Feb 19 07:45:38 2001 +0000
@@ -0,0 +1,5 @@
+#      $NetBSD: Makefile,v 1.1 2001/02/19 07:45:38 wdk Exp $
+
+SUBDIR=        ramdisk instkernel
+
+.include <bsd.subdir.mk>
diff -r e9d1458c408e -r 9a1bb5b3156e distrib/mipsco/Makefile.inc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/distrib/mipsco/Makefile.inc       Mon Feb 19 07:45:38 2001 +0000
@@ -0,0 +1,9 @@
+#      $NetBSD: Makefile.inc,v 1.1 2001/02/19 07:45:38 wdk Exp $
+
+.include "../../Makefile.inc"
+.include <bsd.own.mk>
+
+# REV is revision without dots, as in "15R"
+# VER is revision with dots, as in "1.5R"
+REV!=sh ${BSDSRCDIR}/sys/conf/osrelease.sh -s
+VER!=sh ${BSDSRCDIR}/sys/conf/osrelease.sh 
diff -r e9d1458c408e -r 9a1bb5b3156e distrib/mipsco/instkernel/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/distrib/mipsco/instkernel/Makefile        Mon Feb 19 07:45:38 2001 +0000
@@ -0,0 +1,91 @@
+#      $NetBSD: Makefile,v 1.1 2001/02/19 07:45:39 wdk Exp $
+
+.include "../../../Makefile.inc"
+.include <bsd.kernobj.mk>
+.include <bsd.own.mk>
+
+DISKBINDIR=    /installation/diskimage
+KERNBINDIR=    /binary/kernel
+
+IMAGE=         diskimage
+IMAGESIZE=     4096 # 512 byte blocks, update disktab.diskimage if changed
+DISKTAB=       ${.CURDIR}/disktab.diskimage
+DISKTYPE=      miniroot
+NEWFSOPTS?=    -c 32 -B be -i 32768    # don't need many inodes!
+
+KERN=          ${KERNOBJDIR}/RAMDISK/netbsd
+RAMDISK!=      cd ${.CURDIR}/../ramdisk; ${MAKE} echoimage
+CLEANFILES=    netbsd netbsd.gz netbsd.ecoff netbsd.ecoff.gz ${IMAGE}.gz
+
+# DEV/RDEV file system device, CDEV/RDEV vnconfig device
+VND?=          vnd0
+VND_DEV=       /dev/${VND}c
+VND_RDEV=      /dev/r${VND}c
+VND_CDEV=      /dev/${VND}c
+VND_CRDEV=     /dev/r${VND}c
+#VND_GEOM=     512/18/2/$$((${IMAGESIZE} / (18 * 2)))
+
+MOUNT_POINT?=  /mnt
+
+#
+# install bootblock, so that we can boot from there
+#
+BOOTINSTALL= ${DESTDIR}/usr/mdec/installboot ${VND_CDEV} \
+       ${DESTDIR}/usr/mdec/bootxx_ffs
+
+all:   ${IMAGE}.gz
+
+netbsd.gz: ${KERN} ${RAMDISK}
+       cp ${KERN} netbsd
+       mdsetimage -v netbsd ${RAMDISK}
+.ifdef ECOFF_KERNEL
+       elf2ecoff netbsd netbsd.ecoff
+       rm -f netbsd.ecoff.gz
+       gzip -9 netbsd.ecoff
+.endif # ECOFF_KERNEL
+       rm -f netbsd.gz
+       gzip -9 netbsd
+
+${IMAGE}.gz: netbsd.gz ${DESTDIR}/usr/mdec/boot
+       dd if=/dev/zero of=${IMAGE} count=${IMAGESIZE}
+       vnconfig ${DISKTYPEARG} -v -c ${VND} ${IMAGE} ${VND_GEOM}
+.ifdef notyet
+       -disklabel ${VND} > /dev/null
+       disklabel -rw -f ${DISKTAB} ${VND} ${DISKTYPE}
+.endif
+       newfs -B be -m 0 -o space ${NEWFSOPTS} ${VND_DEV}
+       ${BOOTINSTALL}
+       mount ${VND_DEV} ${MOUNT_POINT}
+       cp -p ${DESTDIR}/usr/mdec/boot ${MOUNT_POINT}
+       cp -p netbsd.gz ${MOUNT_POINT}/netbsd
+       @echo ""
+       @df -i ${MOUNT_POINT}
+       @echo ""
+       umount ${MOUNT_POINT}
+       vnconfig -u ${VND}
+       rm -f ${IMAGE}.gz
+       gzip -9 ${IMAGE}
+
+unconfig:
+       -umount -f ${MOUNT_POINT}
+       -vnconfig -u ${VND}
+       -/bin/rm -f ${IMAGE} ${IMAGE}.gz
+
+realinstall:
+       ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} -o root -g wheel \
+               -m ${NONBINMODE} ${IMAGE}.gz ${RELEASEDIR}${DISKBINDIR}
+       ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} -o root -g wheel \
+               -m ${BINMODE} netbsd.gz ${RELEASEDIR}${KERNBINDIR}/install.gz
+.ifdef ECOFF_KERNEL
+       ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} -o root -g wheel \
+               -m ${BINMODE} netbsd.ecoff.gz \
+               ${RELEASEDIR}${KERNBINDIR}/install.ecoff.gz
+.endif #ECOFF_KERNEL
+
+clean cleandir distclean:
+       rm -f ${CLEANFILES}
+
+# XXX
+depend:
+
+.include <bsd.obj.mk>
diff -r e9d1458c408e -r 9a1bb5b3156e distrib/mipsco/instkernel/diskimage.label.proto
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/distrib/mipsco/instkernel/diskimage.label.proto   Mon Feb 19 07:45:38 2001 +0000
@@ -0,0 +1,24 @@
+# /dev/rvnd1c:
+type: SCSI
+disk: install diskimag
+label: 
+flags:
+bytes/sector: 512
+sectors/track: 32
+tracks/cylinder: 32
+sectors/cylinder: 1024
+cylinders: 1648
+total sectors: 1312344
+rpm: 3600
+interleave: 1
+trackskew: 0
+cylinderskew: 0
+headswitch: 0          # milliseconds
+track-to-track seek: 0 # milliseconds
+drivedata: 0 
+
+3 partitions:
+#        size   offset     fstype   [fsize bsize   cpg]
+  a:     4096        0     4.2BSD     1024  8192    16   # (Cyl.    0 - 82*)
+  b:     4096     4096    unknown                        # (Cyl.   82*- 247*)
+  c:     4096        0    unknown                        # (Cyl.    0 - 82*)
diff -r e9d1458c408e -r 9a1bb5b3156e distrib/mipsco/instkernel/disktab.diskimage
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/distrib/mipsco/instkernel/disktab.diskimage       Mon Feb 19 07:45:38 2001 +0000
@@ -0,0 +1,8 @@
+#      $NetBSD: disktab.diskimage,v 1.1 2001/02/19 07:45:39 wdk Exp $
+#
+miniroot:2MB Install Diskimage\
+       :ty=simulated:se#512:nt#2:ns#16:nc#128:\
+       :ta=4.4BSD:\
+       :pa#4096:oa#0:ba#4096:fa#512:\
+       :pb#0:ob#0:\
+       :pc#4096:oc#0:
diff -r e9d1458c408e -r 9a1bb5b3156e distrib/mipsco/list2sh.awk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/distrib/mipsco/list2sh.awk        Mon Feb 19 07:45:38 2001 +0000
@@ -0,0 +1,55 @@
+#      $NetBSD: list2sh.awk,v 1.1 2001/02/19 07:45:38 wdk Exp $
+
+BEGIN {
+       printf("cd ${CURDIR}\n");
+       printf("\n");
+}
+/^$/ || /^#/ {
+       print $0;
+       next;
+}
+$1 == "COPY" {
+       printf("echo '%s'\n", $0);
+       printf("rm -f ${TARGDIR}/%s\n", $3);
+       printf("cp %s ${TARGDIR}/%s\n", $2, $3);
+       next;
+}
+$1 == "LINK" {
+       printf("echo '%s'\n", $0);
+       printf("rm -f ${TARGDIR}/%s\n", $3);
+       printf("(cd ${TARGDIR}; ln %s %s)\n", $2, $3);
+       next;
+}
+$1 == "SYMLINK" {
+       printf("echo '%s'\n", $0);
+       printf("rm -f ${TARGDIR}/%s\n", $3);
+       printf("(cd ${TARGDIR}; ln -s %s %s)\n", $2, $3);
+       next;
+}
+$1 == "COPYDIR" {
+       printf("echo '%s'\n", $0);
+       printf("(cd ${TARGDIR}/%s && find . ! -name . | xargs /bin/rm -rf)\n",
+           $3);
+       printf("(cd %s && find . ! -name . | cpio -pdamu ${TARGDIR}/%s)\n", $2,
+           $3);
+       next;
+}
+$1 == "SPECIAL" {
+       printf("echo '%s'\n", $0);
+       printf("(cd ${TARGDIR};");
+       for (i = 2; i <= NF; i++)
+               printf(" %s", $i);
+       printf(")\n");
+       next;
+}
+{
+       printf("echo '%s'\n", $0);
+       printf("echo 'Unknown keyword \"%s\" at line %d of input.'\n", $1, NR);
+       printf("exit 1\n");
+       exit 1;
+}
+END {
+       printf("\n");
+       printf("exit 0\n");
+       exit 0;
+}
diff -r e9d1458c408e -r 9a1bb5b3156e distrib/mipsco/ramdisk/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/distrib/mipsco/ramdisk/Makefile   Mon Feb 19 07:45:38 2001 +0000
@@ -0,0 +1,78 @@
+#      $NetBSD: Makefile,v 1.1 2001/02/19 07:45:40 wdk Exp $
+
+TOP?=          ${.CURDIR}/..
+ARCHDIR?=      ${.CURDIR}/../miniroot
+
+.include "${TOP}/Makefile.inc"
+
+DESTDIR=       ${RELEASEDIR}/installation/netboot
+
+IMAGE=         ramdisk.fs
+DISKIMAGE=     diskimage.tgz
+
+CBIN=          ramdiskbin
+CSIZE=         6144 # 512 byte blocks, update disktab.ramdisk if changed
+DISKTAB=       ${.CURDIR}/disktab.ramdisk
+DISKTYPE=      install-ramdisk
+MOUNT_POINT?=  /mnt
+
+# DEV/RDEV file system device, CDEV/RDEV vnconfig device
+VND?=          vnd0
+VND_DEV=       /dev/${VND}c
+VND_RDEV=      /dev/r${VND}c
+VND_CDEV=      /dev/${VND}c
+VND_CRDEV=     /dev/r${VND}c
+
+CLEANFILES=    ${IMAGE} ${DISKIMAGE} ${CBIN} ${CBIN}.mk ${CBIN}.cache
+
+LISTS=         ${.CURDIR}/list
+CRUNCHCONF=    ${.CURDIR}/${CBIN}.conf
+MTREE=         ${.CURDIR}/mtree.conf
+
+all: ${IMAGE}
+
+${IMAGE}: ${CBIN}
+       dd if=/dev/zero of=${IMAGE} count=${CSIZE}
+       vnconfig -v -c ${VND} ${IMAGE}
+       disklabel -rw -f ${DISKTAB} ${VND_CDEV} ${DISKTYPE}
+       newfs -B be -m 0 -o space -i 5120 ${VND_DEV}
+       mount ${VND_DEV} ${MOUNT_POINT}
+       mtree -def ${MTREE} -p ${MOUNT_POINT}/ -u
+       TOPDIR=${TOP} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} ARCHDIR=${ARCHDIR} \
+           KERNOBJDIR=${KERNOBJDIR} \
+           TARGDIR=${MOUNT_POINT} sh ${TOP}/runlist.sh ${LISTS}
+       @echo ""
+       @df -i ${MOUNT_POINT}
+       @echo ""
+       @echo Building diskimage tar file...
+       tar cf - -C ${MOUNT_POINT} . | gzip -9 > ${DISKIMAGE}
+       @echo ""
+       umount ${MOUNT_POINT}
+       vnconfig -u ${VND}
+
+unconfig:
+       -umount -f ${MOUNT_POINT}
+       -vnconfig -u ${VND}
+       -/bin/rm -f ${IMAGE}
+
+${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CRUNCHCONF}
+       crunchgen -D ${TOP}/../.. -L ${DESTDIR}/usr/lib ${.ALLSRC}
+
+${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c
+       ${MAKE} -f ${CBIN}.mk all
+
+echoimage:
+       @echo ${.OBJDIR}/${IMAGE}
+
+realinstall:
+       ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} -o root -g wheel \
+               -m ${NONBINMODE} ${DISKIMAGE} ${DESTDIR}
+
+clean cleandir distclean:
+       /bin/rm -f *.core ${CLEANFILES} *.o *.cro *.c
+
+# XXX
+depend:
+
+.include <bsd.own.mk>
+.include <bsd.obj.mk>
diff -r e9d1458c408e -r 9a1bb5b3156e distrib/mipsco/ramdisk/disktab.preinstall
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000



Home | Main Index | Thread Index | Old Index