Generic Installation Instructions
These are the official installation instructions for InitNG 0.6.x (with slight hints on the 0.7 tree). They mainly cover building InitNG from source, because this is what you'll mostly do. If you are one of the lucky users who can obtain a pre-compiled InitNG package from they distributors, you can skip these instructions and go on directly to the Configuration Chapter?.
Note: Before proceeding, please check whether your distributor provides a (recent) package of InitNG. Using packages is preferable over compiling from source since your distributor will most likely have modified the InitNG sources to fit the system better. There are some (propably outdated) instructions for
It is perfectly ok to install InitNG along with an existing System V Init or Upstart; it won't interfere with your previous init system. As long as you keep the INSTALL_AS_INIT Cmake option turned off, that is.
A word of warning: InitNG's integration with the current popular distributions is not yet perfect. This doesn't concern initng itself, but the ifiles. At the time of writing, InitNG will not always work "out of the box". Be prepared to make modifikations to the installed ifiles by hand!
Prerequisites
- Sufficient knowledge about your linux system's interna, about how to (generally) compile sources and hunt down bugs.
- A Linux system; BSD support is under development
- A suffecently recent Cmake (>= 2.2.0), which replaces GNU Autotools since version 0.6.2
- The GNU C Compiler and GNU Bintutils. GCC Versions 3.4.x, 4.0.x and 4.1.x have been reported to work well.
- Optional: Ncurses
Most likeley, your distribution will have packages split up into a normal and a developement version. You can identify those because they'll carry a -dev or -devel suffix to their name. (Of course, when building InitNG, you'll need to have both installed.)
Getting the sources
The download is pretty prominent on the Main Page. Grab both the initng and the initng-ifiles tarball, and unpack them using tar -xzvf <file>.
If you want to help us testing the SVN version which is in development, you must use SVN to check out the current head revision of the following URLs:
svn co https://svn.initng.org/libinitng/trunk libinitng svn co https://svn.initng.org/initng/trunk initng svn co https://svn.initng.org/initng-scripts/trunk initng-scripts
This will check you out the current development versions that will eventually lead to the 0.7 branch. Source organization has heavily changed compared to the current stable 0.6.x versions, and the ifiles have been replaced by a new format (initng-scripts); so take care to read the hints in the following text carefully. However, the general approach is the same, as the build system didn't change.
Building
Important: Remember to build the sources in the correct order. For the current stable version this will be:
- initng
- initng-ifiles
For the 0.7 development tree you'll need to build in the following order:
- libinitng
- initng
- initng-scripts
Warning: Make sure to uninstall any previous version of InitNG before commencing the installation, otherwise the linker may pick up old versions of the libraries, and as the API is not stable yet, this might provoke unpredictable results.
mkdir build cd build
Will create a directory in which Cmake will drop Makefiles and GCC will create binaries. Although this is not neccessary, it will gurantee that no source files are changed during the build.
What is the configure script in GNU Autotools is Cmake with... well, Cmake. ;-) Simply running
cmake ..
from your build directory will configure the sources with the default settings. This might not always be what you want, e. g. in-/exclusion of plugins is done via command line switches to cmake. To get a list of options, you can either run
cmake -LAH ..
or
ccmake ..
While the first command will give you an extensive help, the latter one provides a nice little TUI for changeing cmake options. Remeber that if you run Cmake with the parameter -DINSTALL_AS_INIT=ON, some System V Init tools will be replaced by InitNG's replacements. Namely sulogin and mountpoint will get overwritten. Currently, those tools are more or less a direct copy from the original sources, but that may change in future versions.
After Cmake has successfully completed, run
make
to do the actual build. Afterwards, installation is done via
make install
Repeat these steps for the remaining pieces of InitNG.
Bootloader configuration
InitNG isn't used for system startup by default. The simple reason for that is that the initng binary is installed as /sbin/initng, while the kernel per default seeks to start /sbin/init, which is the name of the default System V Init binary. To tell the kernel to use InitNG, the boot-time kernel option init is needed.
Caution: We strongly suggest that you keep a backup of your original bootloader entry to switch back and forth between InitNG and your old init system!
LiLo
Edit /etc/lilo.conf, thereby copying the current entry. Add a line stating append = "init=/sbin/initng", so that it looks similar to this one:
image = /boot/vmlinuz
root = /dev/sda1
label = linux-initng
append = "init=/sbin/initng"
read-only
Afterwards, run
lilo
to write the modified configuration to the MBR.
GRUB
Configuration of GRUB is similar. Edit /boot/grub/menu.lst, copying the current entry. Modifiy the kernel line and add init=/sbin/initng. Your configuration might look like this:
title linux-initng root (hd0,1) kernel /vmlinuz root=/dev/hda6 init=/sbin/initng initrd /initrd
Because GRUB allows you to edit the boot configuration before you actually boot, you can use a fancy feature of InitNG and add/remove services prior to booting, or set the runlevel that is to be booted. (This change isn't permanent, though.) Use runlevel:NAME to specify a runlevel other than default. A plus sign will cause InitNG to add that particular service to the designated runlevel, a minus sign will cause a removal:
title linux-initng at runlevel ''single'' with system/modules and without net/lo root (hd1,0) kernel /kernel-2.6.16-gentoo-r1 root=/dev/sda2 init=/sbin/initng runlevel:single +system/modules -net/lo
Init Scripts
When using InitNG for the first time, it is advisable to let InitNG try to create a default runlevel that matches your current configuration. Run
genrunlevel --all
to do so. When you're ugrading from a prior version (from 0.0.x to 0.1.x), running
genrunlevel --migrate
will do the trick. Please note that there are two dashes in front of the "all" and "migrate"!
Please examine your configuration in /etc/initng/runlevel/default.runlevel, and add/remove services and daemons as needed. You can either do this by hand (each line a new service/daemon), or use ng-update:
ng-update add service/alsasound default ng-update remove service/alsasound/mixerstate default
Last Steps
- Please remove the references to /dev/shm and /dev/pts in your /etc/fstab, e. g. by commenting them out.
- Don't be confused when you don't get a login prompt on tty1. You won't get one. InitNG uses tty1 for logging and status information, and insted of cluttering your current terminal as the traditional System V Init does, it keeps everything clean on one virtual console. Just press Alt + F2, and you'll get one.
Have a lot of fun! :-)
