MonkeyBrains.net/~rudy/example Random examples

  custom FreeBSD ISO 
How To
  1. First, downlaod the ISO you want to start with (ftp.freebsd.org)
  2. Mount the ISO so you can 'see' inside it.
        mdconfig -a -t vnode -f 6.1-RC2-i386-disc1.iso  -u 0
        mount_cd9660 /dev/md0 /mnt
        
  3. Prepare a spot to modify the ISO contents. (We are going to copy everything and then make a new ISO.)
        mkdir 6.1-RC2-i386-custom
        cd 6.1-RC2-i386-custom
        rsync -a /mnt/ .
        
  4. Now, you need to edit the files that this CD will install. They live in the '6.1-RC2' folder. Or, the 7.1-RELEASE, or whatever version you downloaded. Figure it out. Anyhow, go into the 6.1-RC2/base directory. Now, you need to make all the 'base.XX' files one big tar, untar it, edit, then retar.
         # find the source, unpack it, delete it
         cd 6.1-RC2/base
         mkdir TEMP &&  cat base.?? | tar --unlink -xpzf - -C TEMP
         rm base.??
    
         # Go there (into the new ISO staging area)
         cd TEMP
    
         # copy some handy files from your desktop to your new ISO staging area
         cp /etc/localtime etc
         cp /etc/ntp.conf etc
         cp /root/.tcshrc root
    
         # need these for cvsup!
         cp /usr/src/*supfile usr/src/
         # Having a good refuse will make youre CVSUPs run faster
         mkdir usr/sup  &&  cp /usr/sup/refuse usr/sup/
    
         # You can also grab files off your website.
         fetch -o etc/rc.conf http://www.monkeybrains.net/~rudy/freebsd/files/rc.conf 
         fetch -o etc/ntp.conf http://www.monkeybrains.net/~rudy/freebsd/files/ntp.conf
         fetch -o etc/rc.firewall http://www.monkeybrains.net/~rudy/freebsd/files/rc.firewall
    
    	 # the hext steps are advice from narcnad, thanks!
    	 # Take note of the md5 sum and size of new file, you'll need this information later
    	 # for example, edit etc/ttys change ttyd0 from dialup to vt100 from off to on
    	 # run this command:
    	 md5 etc/ttys
    	 # the output will be something like this: MD5 (etc/ttys) = dc9a444ad37f8b15841d9aab068cd718
    
         # finally, pack up the modified base install
         tar -czf ../base.aa *
         cd ..
         # fix TEMP so that you can delete it, then delete it.
    	 find TEMP/ -exec chflags noschg {} \; && rm -rf TEMP
    
    	 # modify base.mtree to reflect your file additions and modifications using the notes taken on size and md5 checksum.
    	 # get checksum of base.aa, note values
    	 cksum base.aa
    	 # Output is something like this: 2063703439 42557916 base.aa
    
    	 # create fresh CHECKSUM.MD5 and CHECKSUM.SHA256 files
    	 cat /dev/null > CHECKSUM.MD5
    	 cat /dev/null > CHECKSUM.SHA256
    	 md5 * | grep -v CHECKSUM > CHECKSUM.MD5
    	 sha256 * | grep -v CHECKSUM > CHECKSUM.SHA256
    
    	 # YOu are done!  If you were modifing the base directory outside of the release directory, you need to sync
    	 # your changes to the /path/to/releases/6.3-RELEASE/ or whereever...
         
  5. You modified the default install, terrific! Now, we need to button it all back up into an ISO file so we can burn a CD. (Or, you could run an FTP deamon and install over your network.)
    	 	cd ../.. (assuming you were still in the 'base' directory)
    		 mkisofs -L -D -R -b boot/cdboot -no-emul-boot -o 6.1-RC2-i386-custom.iso 6.1-RC2-i386-custom
    		 burncd -s 48  -f /dev/acd0 data 6.1-RC2-i386-custom.iso fixate