FreeBSD custom CD and extra files to be included in the iso

Devin Teske devin.teske at fisglobal.com
Sat Feb 4 16:17:02 UTC 2012


On Feb 4, 2012, at 1:37 AM, Amitabh Kant wrote:

> On Sat, Feb 4, 2012 at 2:50 PM, Amitabh Kant <amitabhkant at gmail.com> wrote:
> 
>> I have been able to use the "make release" command to create a custom iso
>> for FreeBSD which includes some changes to the various bsdinstall scripts.
>> It all works well as the iso / memory stick images / ftp files are
>> generated and usable.
>> 
>> What I would now like to do is try adding couple of files, scripts and/or
>> packages, to this custom iso. I am a little confused on where the files
>> should be placed so that it is placed in either root's home directory after
>> installation?
>> 
>> Amitabh
>> 
> 
> Sorry for not making it clear in my last mail, I am using FreeBSD 9.0
> RELEASE on amd64 arch.
> 


If you use the DRUID (http://druidbsd.sf.net/), this is extremely easy.

Step-by-step instructions...

NOTE: Feel free to use ANY operating system you like, so long as it has (1) /bin/sh (2) cvs (3) mkisofs (4) GNU make. Including (but not limited to) Mac OS X (with developer tools installed), Cygwin, Linux, and of course, FreeBSD.

1. mkdir druidbsd.sf.net

2. cd druidbsd.sf.net

3. cvs -d:pserver:anonymous at druidbsd.cvs.sourceforge.net:/cvsroot/druidbsd login

NOTE: Press "ENTER" when prompted for "CVS password:"

NOTE: Ignore warning about "failed to open ~/.cvspass"

4. cvs -z3 -d:pserver:anonymous at druidbsd.cvs.sourceforge.net:/cvsroot/druidbsd co -P druidbsd/druid

NOTE: The screen will stream information for about 5-10 minutes as it downloads 510MB of source code to the FreeBSD DRUID installer -- a sysinstall(8) based custom FreeBSD 9.0 installer capable of installing *either* i386 or amd64 from the same disc (among many many other things).

5. cd druidbsd/druid

NOTE: The DRUID has a special directory in-which anything placed there gets copied to the target installation disk automatically after installation of the Operating System completes (but before any post-installation scripts are run). This directory is called "sys_custom" and it lives within the RELEASE directory. Within sys_custom, files are copied exactly as-is, so since you mentioned that you wanted to copy files to "/root", let's operate under that assumption below.

6. mkdir -p src/freebsd/repos/9.0-RELEASE-amd64/sys_custom/root

7. cp myfiles src/freebsd/repos/9.0-RELEASE-amd64/sys_custom/root/

NOTE: If you want the same files available for the installation of the i386 release of 9.0-RELEASE, you should repeat the above steps 6-7 with the destination directory "src/freebsd/repos/9.0-RELEASE/sys_custom/root" (remember, the DRUID is a unified installer that supports both the installation of i386 and amd64 from the same disc).

8. ./configure

9. make freebsd

NOTE: Replace "make" with "gmake" if on FreeBSD

NOTE: If you're using FreeBSD, you may have to first say "pkg_add -r gmake" followed by "rehash" (if using csh or tcsh as your shell).

NOTE: Also, if you need to get "mkisofs", it's "pkg_add -r cdrtools" (and again, "rehash" if using csh or tcsh as your shell).

10. You now have a custom "FreeBSD_Druid-9.0b56.iso" that will install your custom files automatically to /root when either i386 or amd64 is installed.

ASIDE: sys_custom is like a "dumping ground" for anything and everything you simply want to be copied to-disk post-installation of the OS. If instead you want to write scripts to be run as part of the post-installation process, see instead "dep/freebsd/run_once/template.sh" and "src/freebsd/repos/9.0-RELEASE/run_once/*.sh" and "src/freebsd/repos/9.0-RELEASE-amd64/run_once/*.sh". The "run_once" directory unlike "sys_custom" is a "dumping ground" for post-installation scripts (any script ending in ".sh" in that directory will automatically be executed as part of the post-installation procedure after installing the OS.

ASIDE: As you can tell, the DRUID is a FreeBSD installer that was designed to be *easily* extended by anybody/everybody on any OS they like (any OS that can produce or edit an ISO that is).
-- 
Devin

_____________
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