make release and mfsroot

Devin Teske devin.teske at fisglobal.com
Tue Dec 11 21:22:28 UTC 2012


Hi Rick,

If you want, you could follow my approach which is to take the completed mfsroot.gz and use a Makefile to manage the creation of custom mfsroots (keeping the original unmodified, making it simpler to test different iterations).

The advantage is that you don't have to re-perform the release(7) process each time you want to make a change to your mfsroot.

Check it out:

http://druidbsd.cvs.sourceforge.net/viewvc/druidbsd/druidbsd/druid/dep/freebsd/mfsroot/standard/

Basically, you'd grab the Makefile (link below):

http://druidbsd.cvs.sourceforge.net/viewvc/druidbsd/druidbsd/druid/dep/freebsd/mfsroot/standard/Makefile?revision=1.1

Then create a "dep" directory and "src" directory:

Next, take the virgin mfsroot.gz produced by the release(7) process and dump it into the "dep" directory.

Next, put your install.cfg into the "src" directory (just like you see that I did).

Optionally populate more files into the "src" directory (see the first link above for an example -- example includes "boot/modules/nullfs.ko", "etc/fstab", and "etc/group", etc.).

When the "src" directory represents what you'd like to add to the mfsroot, you're ready to produce a new copy of the stored original (at "dep/mfsroot.gz"), complete with your additions.

Execute:

make from_dep

NOTE: sudo is required

What will happen is that "dep/mfsroot.gz" will be copied to the current working directory, the mfsroot is ripped open (requires sudo privileges), the "src" directory is layered onto the mfsroot, and finally the mfsroot is packaged back up (leaving you with a custom "./mfsroot.gz" for deployment).
-- 
Cheers,
Devin

On Dec 11, 2012, at 11:02 AM, Rick Miller wrote:

> Hi All,
> 
> I generate a bootonly ISO and want to add files to the mfsroot.gz
> created by the release.8 target.  I want sysinstall to load an
> install.cfg which makes a call to doconfig.sh.  The target destination
> for the files is stand/.  My question is will the below patch
> accomplish this for me provided install.cfg and doconfig.sh exist in
> /usr/src/release?
> 
> # diff -u Makefile.orig Makefile
> --- Makefile.orig	2012-12-11 18:15:29.000000000 +0000
> +++ Makefile	2012-12-11 19:01:46.000000000 +0000
> @@ -509,6 +509,7 @@
> 		rm foo; \
> 	fi
> 	-test -f install.cfg && cp install.cfg ${CHROOTDIR}/usr/src/release
> +	-test -f doconfig.sh && cp doconfig.sh ${CHROOTDIR}/usr/src/release
> 	echo "#!/bin/sh"			> ${_MK}
> 	echo "set -ex"				>> ${_MK}
> 	echo "trap 'umount /dev || true' 0"	>> ${_MK}
> @@ -823,7 +824,9 @@
> 	done
> .endif
> 	-test -f ${.CURDIR}/install.cfg \
> -	    && cp ${.CURDIR}/install.cfg ${RD}/mfsfd
> +	    && cp ${.CURDIR}/install.cfg ${RD}/mfsfd/stand
> +	-test -f ${.CURDIR}/doconfig.sh \
> +	    && cp ${.CURDIR}/doconfig.sh ${RD}/mfsfd/stand
> 	@mkdir -p ${RD}/mfsfd/boot
> .if ${TARGET_ARCH} != "ia64" && ${TARGET_ARCH} != "powerpc"
> 	@cp ${RD}/trees/base/boot/boot* ${RD}/mfsfd/boot
> 
> 
> -- 
> Take care
> Rick Miller
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"

_____________
The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you.


More information about the freebsd-questions mailing list