| 1 |
AUTHOR: Richard A Downing FBCS CITP (geek109 at hotmail dot com) |
|---|
| 2 |
|
|---|
| 3 |
DATE: 2004-03-29 |
|---|
| 4 |
|
|---|
| 5 |
LICENSE: Creative Commons Attribution-NonCommercial-ShareAlike License |
|---|
| 6 |
http://creativecommons.org/licenses/by-nc-sa/1.0/ |
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
SYNOPSIS: How to replace SysVinit with runit when you build LFS. |
|---|
| 10 |
|
|---|
| 11 |
PRIMARY URI: |
|---|
| 12 |
http://wiki.linuxfromscratch.org/index.php?pagename=Building%20LFS%20with%20Runit |
|---|
| 13 |
|
|---|
| 14 |
IMPORTANT NOTE: |
|---|
| 15 |
------------------------------------------------------------------------- |
|---|
| 16 |
This hint is NOW UNMAINTAINED. The Author no longer uses runit |
|---|
| 17 |
and does not support using it. The copyright is not chnged by this fact. |
|---|
| 18 |
------------------------------------------------------------------------- |
|---|
| 19 |
|
|---|
| 20 |
DESCRIPTION: |
|---|
| 21 |
|
|---|
| 22 |
The LFS book installs SysVinit and a set of bootscripts. Together |
|---|
| 23 |
these provide the mechanism for starting processes that run under the |
|---|
| 24 |
Linux Kernel, and every process is a child of 'init', process |
|---|
| 25 |
one. Other schemes exist, notably the BSD-init scripts, but these are |
|---|
| 26 |
just an alternative set of scripts. This hint uses runit |
|---|
| 27 |
http://smarden.org/runit/ by Gerrit Pape, a completely different |
|---|
| 28 |
scheme that replaces init, and all its paraphernalia (with its own |
|---|
| 29 |
paraphernalia). Runit is derived from the ideas of DJ Bernstein, but |
|---|
| 30 |
the applications can easily be installed in FHS conformant places. |
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
PREREQUISITES: None. This hint should apply to all versions of LFS. |
|---|
| 34 |
|
|---|
| 35 |
HINT: |
|---|
| 36 |
|
|---|
| 37 |
Introduction |
|---|
| 38 |
------------ |
|---|
| 39 |
|
|---|
| 40 |
There is a hint at http://109bean.org.uk/betterboot that explains how |
|---|
| 41 |
to modify an existing LFS system to use runit. Those pages contain a |
|---|
| 42 |
lot of explanatory text that is not repeated here. If you want |
|---|
| 43 |
explanation, go and read that. |
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 |
This hint will just show the minimal steps to build a fresh LFS system |
|---|
| 47 |
using the book as modified by these instructions. |
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 |
Note: If you are reading this as a text document, you might find |
|---|
| 51 |
it better to look at the wiki version, which is maintained |
|---|
| 52 |
on-line. http://wiki.linuxfromscratch.org |
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 |
Obtaining Sources and Scripts |
|---|
| 56 |
----------------------------- |
|---|
| 57 |
|
|---|
| 58 |
Download the latest version of Gerrit Pape's packages from his website: |
|---|
| 59 |
|
|---|
| 60 |
http://smarden.org/runit/runit-1.0.1.tar.gz |
|---|
| 61 |
|
|---|
| 62 |
http://smarden.org/socklog/socklog-1.4.2.tar.gz |
|---|
| 63 |
|
|---|
| 64 |
http://smarden.org/ipsvd/ipsvd-0.8.2.tar.gz |
|---|
| 65 |
|
|---|
| 66 |
Note: There may be later versions - the ones above are the ones that |
|---|
| 67 |
have been tested with these instructions |
|---|
| 68 |
|
|---|
| 69 |
Follow the LFS book up to SysVInit |
|---|
| 70 |
---------------------------------- |
|---|
| 71 |
|
|---|
| 72 |
Carefully follow the LFS book through all its chapters until you get |
|---|
| 73 |
to the page concerning SysVInit. Now follow these instructions: |
|---|
| 74 |
|
|---|
| 75 |
Building and installing runit |
|---|
| 76 |
----------------------------- |
|---|
| 77 |
|
|---|
| 78 |
A word of warning, runit is designed to be unpacked into a directory, |
|---|
| 79 |
/package, which is neither LFS nor FHS conformant. These instructions |
|---|
| 80 |
therefore build an LFS and FHS conformant version. |
|---|
| 81 |
|
|---|
| 82 |
|
|---|
| 83 |
Unpack the runit tarball, it will unpack as admin/runit-1.0.1. |
|---|
| 84 |
|
|---|
| 85 |
cd admin/runit-1.0.1 |
|---|
| 86 |
package/compile |
|---|
| 87 |
cd command |
|---|
| 88 |
install runit runit-init /sbin |
|---|
| 89 |
install runsvdir runsvchdir runsv runsvstat runsvctrl /usr/sbin |
|---|
| 90 |
install svlogd svwaitdown svwaitup chpst utmpset /usr/sbin |
|---|
| 91 |
cp ../man/* /usr/share/man/man8 |
|---|
| 92 |
ln -s /sbin/runit-init /sbin/init |
|---|
| 93 |
|
|---|
| 94 |
Install runit's bootscripts |
|---|
| 95 |
--------------------------- |
|---|
| 96 |
|
|---|
| 97 |
These scripts tell runit how to boot your system, how to run the |
|---|
| 98 |
initial tty terminals, and how to shut down the system (including |
|---|
| 99 |
forcing a shutdown with ctrl-alt-del). They depend on the |
|---|
| 100 |
LFS-bootscripts that you will install in chapter 7 of the LFS book. |
|---|
| 101 |
|
|---|
| 102 |
Obtain the scripts from the LFS Hints webpage's attachments link. |
|---|
| 103 |
http://www.linuxfromscratch.org/hints/downloads/attachments/ |
|---|
| 104 |
|
|---|
| 105 |
Continue from the LFS book |
|---|
| 106 |
-------------------------- |
|---|
| 107 |
|
|---|
| 108 |
Now continue from the LFS book starting with the section after SysVInit. |
|---|
| 109 |
|
|---|
| 110 |
The section How does the booting process with these scripts work? is |
|---|
| 111 |
not relevant, and can be skipped. |
|---|
| 112 |
|
|---|
| 113 |
Finally, you will want to understand what you have built, so visit the |
|---|
| 114 |
runit webpages at http://smarden.org/runit. |
|---|
| 115 |
|
|---|
| 116 |
You will also want to know how to build BLFS packages with runit |
|---|
| 117 |
support, if so, visit the author's runit pages at |
|---|
| 118 |
http://109bean.org.uk/betterboot. |
|---|
| 119 |
|
|---|
| 120 |
|
|---|
| 121 |
ACKNOWLEDGEMENTS: |
|---|
| 122 |
|
|---|
| 123 |
This hint started life on the LFS wiki (and the best version is still |
|---|
| 124 |
maintained there). Kind people make improvements to it there, so far |
|---|
| 125 |
these are: Uli Fahrenberg, Anderson Lizardo. |
|---|
| 126 |
|
|---|
| 127 |
CHANGELOG: |
|---|
| 128 |
|
|---|
| 129 |
[2004-03-25] |
|---|
| 130 |
* Wrote the first draft on the wiki. |
|---|
| 131 |
[2004-03-29] |
|---|
| 132 |
* Issued 1st Text version for the Hints project. |
|---|
| 133 |
|
|---|