Difference between revisions of "Gentoo Install"

From ZoneMinder Wiki
Jump to navigationJump to search
m (More cleanup, page added to contents)
Line 8: Line 8:


== What You Will Need ==
== What You Will Need ==
* A [Gentoo LiveCD|http://www.gentoo.org/main/en/where.xml]
* A [http://www.gentoo.org/main/en/where.xml Gentoo LiveCD]
* An internet connection
* An internet connection, to download and install the necessary packages


== About ZoneMinder for Gentoo ==
== About ZoneMinder for Gentoo ==
There are some ZoneMinder packages (called 'ebuilds') available for Gentoo in the 'portage' tree. However, they are not readily available in the mainstream portage tree ''and'' are a few releases behind. In addition, these ebuids have questionable configurability. It is best to compile from source.
There are some ZoneMinder packages (called 'ebuilds') available for Gentoo in the 'portage' tree. However, they are not readily available in the mainstream portage tree ''and'' are a few releases behind. In addition, these ebuids have questionable configurability. It is best to compile from source.


Overview of a Gentoo Installation
 
== Installation of Gentoo Linux ==
=== Overview of a Gentoo Installation ===
* Prepare filesystems
* Prepare filesystems
* Mount filesystems
* Mount filesystems
Line 25: Line 27:
* Set Up Init Scripts
* Set Up Init Scripts


 
The quickest way to install Gentoo is to use the bootable [http://www.gentoo.org/main/en/where.xml Gentoo LiveCD]. I've found that the automatic installer does not work well and randomly fails over CDROM read "errors". Instead, use the commands from the Gentoo Install Guide to manually copy over the system to your hard drive.
== Installation ==
The quickest way to install Gentoo is to use the bootable LiveCD available at [http://www.gentoo.org|gentoo.org]. I've found that the automatic installer does not work very well and often errors out over simple CDROM read errors. Instead, use the commands from the Gentoo Install Guide to manually copy over the system to your hard drive.


=== Chrooting Your New System ===
=== Chrooting Your New System ===
Line 42: Line 42:


=== Building a Kernel ===
=== Building a Kernel ===
Before Building a kernel, you may want to get some details about the hardware on your computer. You can do this using the tools on your LiveCD. Switch to another virtual console (Ctrl+Alt+F2-F6). These consoles are still running in the CD environment, NOT chrooted in the system you are building. From here you can do a dmesg|less and lspci to see what devices you have installed.
Before Building a kernel, you may want to get some details about the hardware on your computer. You can do this using the tools on your LiveCD. Switch to another virtual console (Ctrl+Alt+F2-F6). These consoles are still running in the CD environment, NOT chrooted in the system you are building. From here you can do a dmesg|less and lspci to see what devices you have installed.
Follow the standard procedure in compiling a kernel. The process usually proceeds as:
Follow the standard procedure in compiling a kernel. The process usually proceeds as:
Line 50: Line 49:
# make modules
# make modules
# make modules_install
# make modules_install
Be sure to included the drivers for your capture cards/cameras in the kernel if applicable.


Necessary Packages
== Necessary Packages ==
ZoneMinder mentions a few packages that are required; namely php, mysql and apache. But in my experience it requires many more.
ZoneMinder mentions a few packages that are required; namely php, mysql and apache. But in my experience ZM requires many more.


You'll need:
You'll need:
Line 65: Line 65:
Luckily, many of these packages are installed automatically as a result of dependencies. Gentoo will let you know what packages will also be installed with a selected package.
Luckily, many of these packages are installed automatically as a result of dependencies. Gentoo will let you know what packages will also be installed with a selected package.


You may want:
You may also want:
* pciutils, to get information about PCI devices to assist in troubleshooting.
* pciutils, to get information about PCI devices to assist in troubleshooting.
* usbutils, to get information about USB devices to assist in troubleshooting.
* usbutils, to get information about USB devices to assist in troubleshooting.
Line 71: Line 71:
* vixie-cron, for ZoneMinder to complete scheduled cron jobs.
* vixie-cron, for ZoneMinder to complete scheduled cron jobs.
* samba, to exchange files with Windows clients/servers.
* samba, to exchange files with Windows clients/servers.
* camsource, lets you view the same pictures your capture card is seeing. Can be useful for diagnosis.
* camsource, lets you serve up web images from your capture card. Can be useful for diagnosis.


== ZoneMinder Compilation ==
These packages are easily installed by typing emerge <package_name>
 
== ZoneMinder Installation ==


You can retreive the ZoneMinder source by using the Links web browser and navigating to http://www2.zoneminder.com/downloads. If anyone has a better way, could you please amend the Wiki?
You can retreive the ZoneMinder source by using the Links web browser and navigating to http://www2.zoneminder.com/downloads. If anyone has a better way, could you please amend the Wiki?
*Extract the source of the tarball to the /usr/src directory
<code>tar -xjvf ZoneMinder-src.tar.bz2 /usr/src</code>
*Change to the directory
<code>cd /usr/src/ZoneMinder-src</code>
*See the ZoneMinder Manual for further instructions

Revision as of 13:29, 15 January 2007

About Gentoo

Gentoo is a distribution that prides itself on being extra-configurable, processor native, and easy to update. Gentoo users usually compile their installation from srouce, but while it's great to nitpick on the details, Gentoo also has the option of installing a precompiled system quickly from a LiveCD.

Why Gentoo?

  • Many binary distributions make it difficult to locate the appropriate libraries for ZoneMinder to build properly. Packages for these distrubutions often do not include development libraries and headers necessary for building software from source.
  • A Gentoo system is highly configurable, and is easy to update and maintain.
  • Gentoo's portage package system in conjunction with the emerge command makes it much easier to obtain the needed packages for ZoneMinder and whatever else you might need.

What You Will Need

  • A Gentoo LiveCD
  • An internet connection, to download and install the necessary packages

About ZoneMinder for Gentoo

There are some ZoneMinder packages (called 'ebuilds') available for Gentoo in the 'portage' tree. However, they are not readily available in the mainstream portage tree and are a few releases behind. In addition, these ebuids have questionable configurability. It is best to compile from source.


Installation of Gentoo Linux

Overview of a Gentoo Installation

  • Prepare filesystems
  • Mount filesystems
  • Copy over base system from CD
  • Retrieve latest portage tree from the internet
  • Build a kernel
  • Install necessary system packages
    • grub
    • dhcpcd
  • Set Up Init Scripts

The quickest way to install Gentoo is to use the bootable Gentoo LiveCD. I've found that the automatic installer does not work well and randomly fails over CDROM read "errors". Instead, use the commands from the Gentoo Install Guide to manually copy over the system to your hard drive.

Chrooting Your New System

That's it! You're ready to change your context into the actual running of your new system environment. That's where chrooting comes in.

Setting USE Flags to Determine Compile Behavior

Gentoo has a neat concept of system management called USE flags. The USE variable is set by the file /etc/make.conf. In the USE variable, you specify what kinds of features you want included in packages. For example, if you set the 'apache2' use flag, any software that can take advantage of the apache webserver will be compiled to do just that. In addition, if you do not have apache installed and you try to install that same software, Apache will be automatically installed. There are many, many USE flags available. Many of them, along with their descriptions can be found here.

Here are the flags I use on my Gentoo system that's meant to be a media/ZM/camera server. USE="-3dfx -arts -berkdb -cups -doc -esd -flac -fortran -gnome -gps -gtk -gtk2 -hardened -imap -ipv6 -kde -nls -opengl -oss -recode -qt -X -xv apache2 mpm-prefork bzip2 mysql php encode exif ffmpeg fbcon gd java javascript jpeg jpeg2k matroska mime mmx sse mp3 mpeg ogg oggvorbis vorbis pcre perl quicktime readline samba ssl symlink theora usb v4l vcd wifi xml xml2 xvid"

As you can see, this says a lot about how my system behaves. I do not use an X Server, so I disabled X, gtk, gtk2, gnome, kde, qt, xv (everything having to do with a graphical desktop). I enabled things like apache2, php, jpeg, mpeg, v4l, xvid (anything media related).


Building a Kernel

Before Building a kernel, you may want to get some details about the hardware on your computer. You can do this using the tools on your LiveCD. Switch to another virtual console (Ctrl+Alt+F2-F6). These consoles are still running in the CD environment, NOT chrooted in the system you are building. From here you can do a dmesg|less and lspci to see what devices you have installed. Follow the standard procedure in compiling a kernel. The process usually proceeds as:

  1. make menuconfig, to configure the kernel
  2. make, to comile the kernel
  3. make install,
  4. make modules
  5. make modules_install

Be sure to included the drivers for your capture cards/cameras in the kernel if applicable.

Necessary Packages

ZoneMinder mentions a few packages that are required; namely php, mysql and apache. But in my experience ZM requires many more.

You'll need:

  • apache
  • php
  • mysql
  • ffmpeg
  • libperl
  • openssl
  • jpeg

Luckily, many of these packages are installed automatically as a result of dependencies. Gentoo will let you know what packages will also be installed with a selected package.

You may also want:

  • pciutils, to get information about PCI devices to assist in troubleshooting.
  • usbutils, to get information about USB devices to assist in troubleshooting.
  • syslog-ng, to manage system logs. ZoneMinder will need to be configured to use it. (/etc/syslog-ng/syslog-ng.conf)
  • vixie-cron, for ZoneMinder to complete scheduled cron jobs.
  • samba, to exchange files with Windows clients/servers.
  • camsource, lets you serve up web images from your capture card. Can be useful for diagnosis.

These packages are easily installed by typing emerge <package_name>

ZoneMinder Installation

You can retreive the ZoneMinder source by using the Links web browser and navigating to http://www2.zoneminder.com/downloads. If anyone has a better way, could you please amend the Wiki?

  • Extract the source of the tarball to the /usr/src directory

tar -xjvf ZoneMinder-src.tar.bz2 /usr/src

  • Change to the directory

cd /usr/src/ZoneMinder-src

  • See the ZoneMinder Manual for further instructions