Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Mar 2011 16:06:57 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r219181 - head/release
Message-ID:  <201103021606.p22G6vou020460@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nwhitehorn
Date: Wed Mar  2 16:06:57 2011
New Revision: 219181
URL: http://svn.freebsd.org/changeset/base/219181

Log:
  Add additional release makefile for bsdinstall-based media, along with
  support files. This does not change the default behavior of anything.
  
  To make bsdinstall-based media, pre-build world and GENERIC, then run
  the release target in Makefile.bsdinstall.

Added:
  head/release/Makefile.bsdinstall   (contents, props changed)
  head/release/rc.local   (contents, props changed)

Added: head/release/Makefile.bsdinstall
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/release/Makefile.bsdinstall	Wed Mar  2 16:06:57 2011	(r219181)
@@ -0,0 +1,53 @@
+# $FreeBSD$
+
+WORLDDIR?=	${.CURDIR}/..
+DISTDIR?=	${DESTDIR}/usr/freebsd-dist
+PORTSDIR?=	/usr/ports
+
+TARGET_ARCH?=	${MACHINE_ARCH}
+.if ${TARGET_ARCH} == ${MACHINE_ARCH}
+TARGET?=	${MACHINE}
+.else
+TARGET?=	${TARGET_ARCH}
+.endif
+IMAKE=		${MAKE} TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}
+
+packagesystem:
+	-mkdir -p ${DISTDIR}
+	cd ${WORLDDIR} && ${IMAKE} distributeworld distributekernel DISTDIR=${DISTDIR}
+# Set up mergemaster root database
+	sh ${.CURDIR}/scripts/mm-mtree.sh -F "TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}" -D "${DISTDIR}/base"
+	cd ${WORLDDIR} && ${IMAKE} packageworld packagekernel DISTDIR=${DISTDIR}
+	-mkdir -p ${DISTDIR}/usr
+# Package up src and ports trees
+	ln -fs ${WORLDDIR} ${DISTDIR}/usr/src
+	ln -fs ${PORTSDIR} ${DISTDIR}/usr/ports
+.if !defined(NOPORTS)
+	cd ${DISTDIR} && tar cLvJf ${DISTDIR}/ports.txz --exclude usr/ports/distfiles --exclude usr/ports/packages --exclude 'usr/ports/INDEX*' usr/ports
+.endif
+.if !defined(NOSRC)
+	cd ${DISTDIR} && tar cLvJf ${DISTDIR}/src.txz --exclude .svn --exclude CVS usr/src
+.endif
+
+system:
+# Install system
+	-mkdir ${DISTDIR}/release
+	cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution DESTDIR=${DISTDIR}/release
+	-rm ${DISTDIR}/release/boot/kernel/*.symbols
+# Copy distfiles
+	mkdir ${DISTDIR}/release/usr/freebsd-dist
+	cp ${DISTDIR}/*.txz ${DISTDIR}/release/usr/freebsd-dist
+# Set up installation environment
+	ln -s /tmp/bsdinstall_etc/resolv.conf ${DISTDIR}/release/etc/resolv.conf
+	echo sendmail_enable=\"NONE\" > ${DISTDIR}/release/etc/rc.conf
+	echo hostid_enable=\"NO\" >> ${DISTDIR}/release/etc/rc.conf
+	touch ${DISTDIR}/release/etc/fstab
+	cp rc.local ${DISTDIR}/release/etc
+
+cdrom:
+	echo kernel_options=\"-C\" > ${DISTDIR}/release/boot/loader.conf
+	sh /usr/src/release/${TARGET}/mkisoimages.sh -b FreeBSD_Install ${DISTDIR}/release.iso ${DISTDIR}/release
+	rm ${DISTDIR}/release/boot/loader.conf
+
+release: packagesystem system cdrom
+	

Added: head/release/rc.local
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/release/rc.local	Wed Mar  2 16:06:57 2011	(r219181)
@@ -0,0 +1,33 @@
+#!/bin/sh
+# $FreeBSD$
+
+: ${DIALOG_OK=0}
+: ${DIALOG_CANCEL=1}
+: ${DIALOG_HELP=2}
+: ${DIALOG_EXTRA=3}
+: ${DIALOG_ITEM_HELP=4}
+: ${DIALOG_ESC=255}
+
+TERM=xterm; export TERM # XXX: serial consoles
+
+dialog --backtitle "FreeBSD Installer" --title "Welcome" --extra-button --extra-label "Shell" --ok-label "Install" --cancel-label "Live CD" --yesno "Welcome to FreeBSD! Would you like to begin an installation or use the live CD?" 0 0
+
+case $? in
+$DIALOG_OK)	# Install
+	BSDINSTALL_CONFIGCURRENT=yes; export BSDINSTALL_CONFIGCURRENT
+	trap true SIGINT	# Ignore cntrl-C here
+	bsdinstall
+	dialog --backtitle "FreeBSD Installer" --title "Complete" --msgbox "Installation of FreeBSD complete! The system will now reboot." 0 0
+	reboot
+	;;
+$DIALOG_CANCEL)	# Live CD
+	exit 0
+	;;
+$DIALOG_EXTRA)	# Shell
+	clear
+	echo "When finished, type 'exit' to return to the installer."
+	/bin/sh
+	. /etc/rc.local
+	;;
+esac
+



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201103021606.p22G6vou020460>