diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-03-02 15:57:35 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-03-02 15:57:35 +0000 |
commit | 15515d3a5428eddfe49b9f3d9c980d36813fc9dd (patch) | |
tree | ec199f961fe449c299f89b667189716d724ebb12 /distrib/i386 | |
parent | 3d0182e0fd8b066b13a3b4926068171e1b46b2d8 (diff) |
Build a (USB or other disk) miniroot, which can be dd'd and booted since
it is in LBA form.
Work by chris@, integration methodology proposed by me. Needs improvements
after release..
Diffstat (limited to 'distrib/i386')
-rw-r--r-- | distrib/i386/common/Makefile.inc | 5 | ||||
-rw-r--r-- | distrib/i386/iso/Makefile | 67 |
2 files changed, 67 insertions, 5 deletions
diff --git a/distrib/i386/common/Makefile.inc b/distrib/i386/common/Makefile.inc index b4db72efe39..5d7cd8f8c2a 100644 --- a/distrib/i386/common/Makefile.inc +++ b/distrib/i386/common/Makefile.inc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.inc,v 1.35 2014/01/20 05:15:51 jsing Exp $ +# $OpenBSD: Makefile.inc,v 1.36 2014/03/02 15:57:32 deraadt Exp $ TOP= ${.CURDIR}/.. @@ -29,6 +29,9 @@ all: ${FS} ${FS}: bsd.gz dd if=/dev/zero of=${REALIMAGE} bs=512 count=${FLOPPYSIZE} vnconfig -v -c ${VND} ${REALIMAGE} +.ifdef LBA + fdisk -yi -l ${FLOPPYSIZE} -f ${DESTDIR}/usr/mdec/mbr ${VND} +.endif disklabel -w ${VND} ${FLOPPYTYPE} newfs -m 0 -o space -i 524288 -c ${FLOPPYSIZE} ${VND_RDEV} mount ${VND_DEV} ${MOUNT_POINT} diff --git a/distrib/i386/iso/Makefile b/distrib/i386/iso/Makefile index f152c112ba4..38f786afff5 100644 --- a/distrib/i386/iso/Makefile +++ b/distrib/i386/iso/Makefile @@ -1,13 +1,24 @@ -# $OpenBSD: Makefile,v 1.9 2014/03/02 05:46:26 deraadt Exp $ +# $OpenBSD: Makefile,v 1.10 2014/03/02 15:57:34 deraadt Exp $ TOP= ${.CURDIR}/.. .include "${TOP}/Makefile.inc" CDROM= install${REV}.iso + +FS= install${REV}.fs +FSSIZE= 491520 +FSTYPE= install240 + +RAMDISK= RAMDISK_CD + +MOUNT_POINT= /mnt +MTREE= ${UTILS}/mtree.conf + RELXDIR?= /home/relx-${MACHINE} RELDIR?= /home/rel-${MACHINE} +BSDRD= ${RELDIR}/bsd.rd BASE= ${RELDIR}/base${OSrev}.tgz ${RELDIR}/comp${OSrev}.tgz \ ${RELDIR}/etc${OSrev}.tgz ${RELDIR}/game${OSrev}.tgz \ ${RELDIR}/man${OSrev}.tgz \ @@ -17,7 +28,47 @@ XBASE= ${RELXDIR}/xbase${OSrev}.tgz ${RELXDIR}/xetc${OSrev}.tgz \ ${RELXDIR}/xfont${OSrev}.tgz ${RELXDIR}/xshare${OSrev}.tgz \ ${RELXDIR}/xserv${OSrev}.tgz -all: ${CDROM} +VND?= vnd0 +VND_DEV= /dev/${VND}a +VND_RDEV= /dev/r${VND}a +VND_CRDEV= /dev/r${VND}c +BOOT?= ${DESTDIR}/usr/mdec/boot +PID!= echo $$$$ +REALIMAGE!= echo /var/tmp/image.${PID} + +all: ${CDROM} ${FS} + +${FS}: ${BASE} ${XBASE} bsd.gz + dd if=/dev/zero of=${REALIMAGE} bs=512 count=${FSSIZE} + vnconfig -v -c ${VND} ${REALIMAGE} + fdisk -yi -l ${FSSIZE} -f ${DESTDIR}/usr/mdec/mbr ${VND} + disklabel -w ${VND} ${FSTYPE} + newfs -m 0 -o space -i 524288 -c ${FSSIZE} ${VND_RDEV} + mount ${VND_DEV} ${MOUNT_POINT} + cp ${BOOT} ${MOUNT_POINT}/boot + strip ${MOUNT_POINT}/boot + strip -R .comment ${MOUNT_POINT}/boot + dd if=bsd.gz of=${MOUNT_POINT}/bsd bs=512 + installboot -v -r ${MOUNT_POINT} ${VND_CRDEV} \ + ${DESTDIR}/usr/mdec/biosboot ${MOUNT_POINT}/boot + mkdir -p ${MOUNT_POINT}/${OSREV}/${MACHINE} + mkdir -p ${MOUNT_POINT}/etc + echo "set image /${OSREV}/${MACHINE}/bsd.rd" > ${MOUNT_POINT}/etc/boot.conf + + cp -p ${BASE} ${MOUNT_POINT}/${OSREV}/${MACHINE} + cp -p ${XBASE} ${MOUNT_POINT}/${OSREV}/${MACHINE} + + cat ${RELDIR}/SHA256 ${RELXDIR}/SHA256 > \ + ${MOUNT_POINT}/${OSREV}/${MACHINE}/SHA256 + # XXX no SHA256.sig + + @echo "" + @df -i ${MOUNT_POINT} + @echo "" + umount ${MOUNT_POINT} + vnconfig -u ${VND} + cp ${REALIMAGE} ${FS} + rm ${REALIMAGE} ${CDROM}: ${BASE} ${XBASE} -rm -rf ${.OBJDIR}/cd-dir @@ -44,11 +95,19 @@ ${CDROM}: ${BASE} ${XBASE} ${.OBJDIR}/cd-dir install: - cp ${CDROM} ${RELDIR}/ + cp ${CDROM} ${FS} ${RELDIR}/ clean cleandir: - /bin/rm -f ${CDROM} + /bin/rm -f ${CDROM} ${FS} rm -rf cd-dir +bsd.gz: bsd.rd + cp ${BSDRD} bsd.strip + strip bsd.strip + strip -R .comment bsd.strip + gzip -c9n bsd.strip > bsd.gz + +bsd.rd: ${BSDRD} + .include <bsd.obj.mk> .include <bsd.subdir.mk> |