How to create a fork of freebsd

Bertram Scharpf lists at bertram-scharpf.de
Sun May 29 14:35:46 UTC 2016


Hi,

On Sunday, 29. May 2016, 13:06:46 +0200, Mathe Eliel wrote:
> Now, I would like to create a sample OS based on freeBSD. I have a web
> application written in PHP and running on Apache Server in a FreeBSD
> computer. How can I make this kind of fork of FreeBSD thus I give a .iso
> file to my friends containing the webserver, the php application and other
> downloaded ports such as apinger, dhcpd? To allow them use my application
> without redownloading all those applications but they can install it in a
> computer and it starts working?

This is roughly what I do:

  # dd if=/dev/zero of=myliveusb.img bs=2G count=2
  # mdconfig -a -f myliveusb.img
  # gpart add ... md0
  # gpart bootcode ... md0
  # gpart modify -i N -l myliveusb md0
  # newfs -U /dev/gpt/myliveusb
  # mount /dev/gpt/myliveusb /mnt/install

  # cd /usr/src
  # make DESTDIR=/mnt/install installworld installkernel distrib-dirs distribution

  - Create an /etc/fstab that mounts / to /dev/gpt/myliveusb,
    /tmp, /var/tmp, /var/run, /var/log to mfs.

  - Create an elementary /etc/rc.conf:
      ifconfig_DEFAULT="DHCP"
      ntpdate_enable="YES"

  - Copy /etc/localtime

  - Chroot into it:

    # cp /etc/resolv.conf /mnt/install/etc/
    # chroot /mnt/install /bin/sh
    # mount_devfs devfs /dev

  - Install packages

  - Leave the chroot, umount the partition and release the md.
    dd the .img to a USB stick.

Good luck!

Bertram


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de


More information about the freebsd-questions mailing list