New article: FreeBSD From Scratch
This article describes my efforts at FreeBSD From Scratch: a fully automated installation of a customized FreeBSD system compiled from source, including compilation of all your favorite ports and configured to match your idea of the perfect system. If you think "make world" is a wonderful concept, FreeBSD From Scratch extends it to "make evenmore".
This commit is contained in:
parent
51c9d8d63f
commit
e1f0bf4fc3
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=16215
5 changed files with 1115 additions and 0 deletions
23
en_US.ISO8859-1/articles/fbsd-from-scratch/Makefile
Normal file
23
en_US.ISO8859-1/articles/fbsd-from-scratch/Makefile
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
#
|
||||||
|
# $FreeBSD$
|
||||||
|
#
|
||||||
|
# Article: FreeBSD From Scratch
|
||||||
|
|
||||||
|
DOC?= article
|
||||||
|
|
||||||
|
FORMATS?= html
|
||||||
|
|
||||||
|
MAINTAINER= schweikh@FreeBSD.org
|
||||||
|
|
||||||
|
INSTALL_COMPRESSED?= gz
|
||||||
|
INSTALL_ONLY_COMPRESSED?=
|
||||||
|
|
||||||
|
# SGML content
|
||||||
|
SRCS= article.sgml stage_1.sh stage_2.sh stage_3.mk
|
||||||
|
|
||||||
|
DOC_PREFIX?= ${.CURDIR}/../../..
|
||||||
|
|
||||||
|
afterinstall:
|
||||||
|
${INSTALL_DOCS} stage_1.sh stage_2.sh stage_3.mk ${DESTDIR}
|
||||||
|
|
||||||
|
.include "${DOC_PREFIX}/share/mk/doc.project.mk"
|
571
en_US.ISO8859-1/articles/fbsd-from-scratch/article.sgml
Normal file
571
en_US.ISO8859-1/articles/fbsd-from-scratch/article.sgml
Normal file
|
@ -0,0 +1,571 @@
|
||||||
|
<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook V4.1-Based Extension//EN" [
|
||||||
|
<!ENTITY % man PUBLIC "-//FreeBSD//ENTITIES DocBook Manual Page Entities//EN">
|
||||||
|
%man;
|
||||||
|
<!ENTITY % freebsd PUBLIC "-//FreeBSD//ENTITIES DocBook Miscellaneous FreeBSD Entities//EN">
|
||||||
|
%freebsd;
|
||||||
|
<!ENTITY scratch.ap "<application>FreeBSD From Scratch</application>">
|
||||||
|
]>
|
||||||
|
|
||||||
|
<article>
|
||||||
|
<articleinfo>
|
||||||
|
<title>FreeBSD From Scratch</title>
|
||||||
|
|
||||||
|
<author>
|
||||||
|
<firstname>Jens</firstname>
|
||||||
|
<surname>Schweikhardt</surname>
|
||||||
|
<affiliation>
|
||||||
|
<address><email>schweikh@FreeBSD.org</email></address>
|
||||||
|
</affiliation>
|
||||||
|
</author>
|
||||||
|
<copyright>
|
||||||
|
<year>2002</year>
|
||||||
|
<holder>Jens Schweikhardt</holder>
|
||||||
|
</copyright>
|
||||||
|
|
||||||
|
<pubdate>$FreeBSD$</pubdate>
|
||||||
|
</articleinfo>
|
||||||
|
|
||||||
|
<abstract>
|
||||||
|
<para>This article describes my efforts at &scratch.ap;: a fully
|
||||||
|
automated installation of a customized &os; system compiled from
|
||||||
|
source, including compilation of all your favorite ports and
|
||||||
|
configured to match your idea of the perfect system. If you
|
||||||
|
think <command>make world</command> is a wonderful concept,
|
||||||
|
&scratch.ap; extends it to <command>make evenmore</command>.</para>
|
||||||
|
</abstract>
|
||||||
|
|
||||||
|
<sect1 id="introduction">
|
||||||
|
<title>Introduction</title>
|
||||||
|
|
||||||
|
<para>Have you ever upgraded your system with <command>make world</command>?
|
||||||
|
There is a problem if you have only one system on your disks. If
|
||||||
|
the <maketarget>installworld</maketarget> fails partway through,
|
||||||
|
you are left with a broken system that might not even boot any
|
||||||
|
longer. Or maybe the <maketarget>installworld</maketarget> runs
|
||||||
|
smoothly but the new kernel does not boot. Then it is time to
|
||||||
|
reach for the Fixit CD and dig for those backups you have taken
|
||||||
|
half a year ago.</para>
|
||||||
|
|
||||||
|
<para>I believe in the <quote>wipe your disks when upgrading systems</quote>
|
||||||
|
paradigm. Wiping disks, or rather partitions, makes sure there is no
|
||||||
|
old cruft left lying around, something which most upgrade procedures
|
||||||
|
just do not care about. But wiping the partitions means you have to
|
||||||
|
also recompile/reinstall all your ports and packages and then
|
||||||
|
redo all your carefully crafted configuration tweaks.
|
||||||
|
If you think that this task should be automated as well, read on.</para>
|
||||||
|
</sect1>
|
||||||
|
|
||||||
|
<sect1 id="why">
|
||||||
|
<title>Why would I (not) want &scratch.ap;?</title>
|
||||||
|
|
||||||
|
<para>This is a legitimate question. We have
|
||||||
|
<application>sysinstall</application> and the well known way to
|
||||||
|
compile the kernel and the userland tools.</para>
|
||||||
|
|
||||||
|
<para>The problem with <application>sysinstall</application> is
|
||||||
|
that it is severely limited in what, where and how it can install.</para>
|
||||||
|
|
||||||
|
<itemizedlist>
|
||||||
|
<listitem>
|
||||||
|
<para>It is normally used to install pre-built distribution sets and
|
||||||
|
packages from some other source (CD, DVD, FTP). It cannot install
|
||||||
|
the result of a <literal>make buildworld</literal>.</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>It cannot install a second system under a directory
|
||||||
|
in a running system.</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>It cannot install in <application>Vinum</application>
|
||||||
|
partitions.</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>It cannot compile ports, only install precompiled packages.</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>It is hard to script or to make arbitrary post-installation
|
||||||
|
changes.</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>Last but not least, <application>sysinstall</application>
|
||||||
|
is semi-officially at its End-Of-Life.</para>
|
||||||
|
</listitem>
|
||||||
|
</itemizedlist>
|
||||||
|
|
||||||
|
<para>The well known way to build and install the world, as
|
||||||
|
described in <ulink url="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html">the
|
||||||
|
Handbook</ulink>, by default replaces
|
||||||
|
the existing system. Only the kernel and modules are saved.
|
||||||
|
System binaries, headers and a lot of other files are overwritten;
|
||||||
|
obsolete files are still present and can cause surprises. If the
|
||||||
|
upgrade fails for any reason, it may be hard or even impossible to
|
||||||
|
restore the previous state of the system.</para>
|
||||||
|
|
||||||
|
<para>&scratch.ap; solves all these problems. The strategy is
|
||||||
|
simple: use a running system to install a new system under an empty
|
||||||
|
directory tree, while new partitions are mounted appropriately
|
||||||
|
in that tree. Many config files can be copied to the appropriate
|
||||||
|
place and &man.mergemaster.8; can take care of those that cannot.
|
||||||
|
Arbitrary post-configuration of the new system can be
|
||||||
|
done from within the old system, up to the point where you can
|
||||||
|
chroot to the new system. In other words, we go through three
|
||||||
|
stages, where each stage consists of either running a shell
|
||||||
|
script or invoke <command>make</command>:</para>
|
||||||
|
|
||||||
|
<orderedlist>
|
||||||
|
<listitem>
|
||||||
|
<para><filename>stage_1.sh</filename>:
|
||||||
|
Create a new bootable system under an empty directory and merge
|
||||||
|
or copy as many files as are necessary.
|
||||||
|
Then boot the new system.</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para><filename>stage_2.sh</filename>:
|
||||||
|
Install desired ports.</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para><filename>stage_3.mk</filename>:
|
||||||
|
Do post-configuration for software installed in previous stage.</para>
|
||||||
|
</listitem>
|
||||||
|
</orderedlist>
|
||||||
|
|
||||||
|
<para>Once you have used &scratch.ap; to build a second system and
|
||||||
|
found it works satisfactorily for a couple of weeks, you can then
|
||||||
|
use it again to reinstall the original system. From now on, whenever
|
||||||
|
you feel like an update is in order, you simply toggle the
|
||||||
|
partitions you want to wipe and reinstall.</para>
|
||||||
|
|
||||||
|
<para>Maybe you have heard of or even tried <ulink
|
||||||
|
url="http://www.linuxfromscratch.org/">Linux From Scratch</ulink>,
|
||||||
|
or LFS for short. LFS also describes how to build and install a
|
||||||
|
system from scratch in empty partitions using a running system.
|
||||||
|
The focus in LFS seems to be to show the role of each system
|
||||||
|
component (such as kernel, compiler, devices, shell, terminal database,
|
||||||
|
etc) and the details of each component's installation.
|
||||||
|
&scratch.ap; does not go into that much detail. My goal is to
|
||||||
|
provide an automated and complete installation, not explaining all
|
||||||
|
the gory details that go on under the hood when making the world.
|
||||||
|
In case you want to explore &os; at this level of detail, start
|
||||||
|
looking at <filename>/usr/src/Makefile</filename> and follow the
|
||||||
|
actions of a <command>make buildworld</command>.</para>
|
||||||
|
|
||||||
|
<para>There are also downsides in the approach taken by &scratch.ap;
|
||||||
|
that you should bear in mind.</para>
|
||||||
|
|
||||||
|
<!-- XXX: A nice idea would be to write stage2.sh using a jail
|
||||||
|
that runs into the newly installed world from stage1. Having
|
||||||
|
properly set up a network address as the jail's primary IP
|
||||||
|
address, it might even be possible to build ports in a chroot
|
||||||
|
without uninstalling anything from the 'host' system. But
|
||||||
|
keep in mind that even jails run on the 'host' kernel. -->
|
||||||
|
|
||||||
|
<itemizedlist>
|
||||||
|
<listitem>
|
||||||
|
<para>While compiling the ports during stage two the system can
|
||||||
|
not be used for its usual duties. If you run a production server
|
||||||
|
you have to consider the downtime caused by stage two. The ports
|
||||||
|
compiled by <filename>stage_2.sh</filename> below require about 4
|
||||||
|
hours to build on an AMD1800+ SCSI system with 10krpm disks and
|
||||||
|
1GB of RAM.</para>
|
||||||
|
</listitem>
|
||||||
|
</itemizedlist>
|
||||||
|
|
||||||
|
</sect1>
|
||||||
|
|
||||||
|
<sect1 id="prerequisites">
|
||||||
|
<title>Prerequisites</title>
|
||||||
|
|
||||||
|
<para>For going the &scratch.ap; way, you need to have:</para>
|
||||||
|
|
||||||
|
<itemizedlist>
|
||||||
|
<listitem>
|
||||||
|
<para>A running &os; system with sources and a ports tree.</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>At least one unused partition where the new system will be
|
||||||
|
installed.</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>Experience with running &man.mergemaster.8;. Or at least no fear
|
||||||
|
doing so.</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>If you have no or only a slow link to the Internet: the distfiles
|
||||||
|
for your favorite ports.</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>Basic knowledge of shell scripting with the Bourne shell,
|
||||||
|
&man.sh.1;.</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>Finally, you should also be able to tell your boot
|
||||||
|
loader how to boot the new system, either interactively, or
|
||||||
|
by means of a config file.</para>
|
||||||
|
</listitem>
|
||||||
|
</itemizedlist>
|
||||||
|
|
||||||
|
</sect1>
|
||||||
|
|
||||||
|
<sect1 id="stage1">
|
||||||
|
<title>Stage One: System Installation</title>
|
||||||
|
|
||||||
|
<para>The following is my <filename>stage_1.sh</filename>. You
|
||||||
|
need to customize it in various places to match your idea of
|
||||||
|
the <quote>perfect system</quote>. I have tried to
|
||||||
|
extensively comment the places you should adapt. The points to
|
||||||
|
ponder are:</para>
|
||||||
|
|
||||||
|
<itemizedlist>
|
||||||
|
<listitem>
|
||||||
|
<para>Partition layout.</para>
|
||||||
|
|
||||||
|
<para>I do not subscribe to the idea of a single huge partition
|
||||||
|
for the whole system. My systems generally have at least
|
||||||
|
one partition for
|
||||||
|
<filename>/</filename>,
|
||||||
|
<filename>/usr</filename> and
|
||||||
|
<filename>/var</filename> with
|
||||||
|
<filename>/tmp</filename> symlinked to
|
||||||
|
<filename>/var/tmp</filename>.
|
||||||
|
In addition I share the file systems for
|
||||||
|
<filename>/home</filename> (user homes),
|
||||||
|
<filename>/home/ncvs</filename> (&os; CVS repository replica),
|
||||||
|
<filename>/usr/ports</filename> (the ports tree),
|
||||||
|
<filename>/src</filename> (various checked out src trees) and
|
||||||
|
<filename>/share</filename> (other shared data without the need
|
||||||
|
for backups, like the news spool).</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>Luxury items.</para>
|
||||||
|
|
||||||
|
<para>What you want immediately after booting the new system and
|
||||||
|
even before starting stage two. In my case this is <filename
|
||||||
|
role="package">shells/zsh</filename> because this is the login
|
||||||
|
shell for my account as specified in <filename>/etc/passwd</filename>.
|
||||||
|
Strictly speaking you can do without luxury items, because all you
|
||||||
|
need to do is log in as root and run the next stage.</para>
|
||||||
|
|
||||||
|
<para>The reason for not simply installing all my beloved ports
|
||||||
|
during stage one is that in theory and in practice there are
|
||||||
|
bootstrap and consistency issues: stage one has your old kernel
|
||||||
|
running, but the chrooted environment consists of new binaries
|
||||||
|
and headers. If the new system for example supports a new system
|
||||||
|
call (according to its headers), some configure-type script
|
||||||
|
might try to use it and get killed because it executes on the
|
||||||
|
old kernel. I have seen other issues when I tried building
|
||||||
|
<filename role="package">lang/perl5</filename>.</para>
|
||||||
|
</listitem>
|
||||||
|
</itemizedlist>
|
||||||
|
|
||||||
|
<para>Before you run <filename>stage_1.sh</filename> make sure
|
||||||
|
you have completed the usual tasks in preparation for
|
||||||
|
<command>make installworld installkernel</command>, like:</para>
|
||||||
|
|
||||||
|
<itemizedlist>
|
||||||
|
<listitem>
|
||||||
|
<para>configured your kernel config file</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>successfully completed <command>make buildworld</command></para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>successfully completed <command>make buildkernel
|
||||||
|
KERNCONF=<replaceable>whatever</replaceable></command></para>
|
||||||
|
</listitem>
|
||||||
|
</itemizedlist>
|
||||||
|
|
||||||
|
<para>When you run <filename>stage_1.sh</filename> for the first
|
||||||
|
time, and the config files copied from your running system to the
|
||||||
|
new system are not up-to-date with respect to what is under
|
||||||
|
<filename>/usr/src</filename>, <command>mergemaster</command> will
|
||||||
|
ask you how to proceed. I recommend merging the changes. If you get
|
||||||
|
tired of going through the dialogues you can simply update the files
|
||||||
|
on your <emphasis>running</emphasis> system once (Only if this is an
|
||||||
|
option. You probably do not want to do this if one of your systems
|
||||||
|
runs <literal>-STABLE</literal> and the other
|
||||||
|
<literal>-CURRENT</literal>. The changes may be incompatible).
|
||||||
|
Subsequent <command>mergemaster</command> invocations will detect
|
||||||
|
that the RCS version IDs match those under
|
||||||
|
<filename>/usr/src</filename> and skip the file.</para>
|
||||||
|
|
||||||
|
<para>The <filename>stage_1.sh</filename> script will stop at the
|
||||||
|
first command that fails (returns a non-zero exit status) due to
|
||||||
|
<command>set -e</command>, so you cannot overlook errors. You should
|
||||||
|
correct any errors in your version of
|
||||||
|
<filename>stage_1.sh</filename> before you go on.</para>
|
||||||
|
|
||||||
|
<para>In <filename>stage_1.sh</filename> we invoke
|
||||||
|
<command>mergemaster</command>. Even if none of the files requires a
|
||||||
|
merge, it will display and ask at the end</para>
|
||||||
|
|
||||||
|
<screen>*** Comparison complete
|
||||||
|
|
||||||
|
Do you wish to delete what is left of /var/tmp/temproot.stage1? [no] <userinput>no</userinput></screen>
|
||||||
|
|
||||||
|
<para>Please answer <literal>no</literal> or just hit
|
||||||
|
<keycap>Enter</keycap>. The reason is that <command>mergemaster</command>
|
||||||
|
will have left a few zero sized files below
|
||||||
|
<filename>/var/tmp/temproot.stage1</filename> which will be copied to the
|
||||||
|
new system later (unless already there).</para>
|
||||||
|
|
||||||
|
<para>After that it will list the files it installed, making use of
|
||||||
|
a pager (&man.more.1; by default, optionally &man.less.1;):</para>
|
||||||
|
|
||||||
|
<screen>*** You chose the automatic install option for files that did not
|
||||||
|
exist on your system. The following were installed for you:
|
||||||
|
/newroot/etc/defaults/rc.conf
|
||||||
|
...
|
||||||
|
/newroot/COPYRIGHT
|
||||||
|
|
||||||
|
(END)</screen>
|
||||||
|
|
||||||
|
<para>Type <keycap>q</keycap> to quit the pager. Then you will
|
||||||
|
be informed about <filename>login.conf</filename>:</para>
|
||||||
|
|
||||||
|
<screen>*** You installed a login.conf file, so make sure that you run
|
||||||
|
'/usr/bin/cap_mkdb /newroot/etc/login.conf'
|
||||||
|
to rebuild your login.conf database
|
||||||
|
|
||||||
|
Would you like to run it now? y or n [n]</screen>
|
||||||
|
|
||||||
|
<para>The answer does not matter since we will run &man.cap.mkdb.1; in any
|
||||||
|
case.</para>
|
||||||
|
|
||||||
|
<para>Everything <filename>stage_1.sh</filename> does is logged to
|
||||||
|
<filename>stage_1.log</filename> for you to examine if you wish to
|
||||||
|
do so.</para>
|
||||||
|
|
||||||
|
<para>Here is the author's <filename>stage_1.sh</filename>, which
|
||||||
|
you need to modify substantially, especially steps 1, 2, 5 and 6.</para>
|
||||||
|
|
||||||
|
<warning>
|
||||||
|
<para>Please pay attention to the &man.newfs.8; commands.
|
||||||
|
While you can not create new file systems on mounted partitions, the
|
||||||
|
script will happily erase any unmounted
|
||||||
|
<filename>/dev/da3s1a</filename>, <filename>/dev/vinum/var_a</filename>
|
||||||
|
and <filename>/dev/vinum/usr_a</filename>. This can be enough to ruin
|
||||||
|
your day, so be sure to modify the device names.</para>
|
||||||
|
</warning>
|
||||||
|
|
||||||
|
<programlisting><inlinegraphic fileref="stage_1.sh" format="linespecific"></programlisting>
|
||||||
|
|
||||||
|
<para>Download <ulink
|
||||||
|
url="stage_1.sh"><filename>stage_1.sh</filename></ulink>.</para>
|
||||||
|
|
||||||
|
<para>Running this script installs a system that when booted
|
||||||
|
provides:</para>
|
||||||
|
<itemizedlist>
|
||||||
|
<listitem>
|
||||||
|
<para>Inherited users and groups.</para>
|
||||||
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>Firewalled Internet connectivity over Ethernet and PPP.</para>
|
||||||
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>Correct time zone and NTP.</para>
|
||||||
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>Some more minor configuration, like
|
||||||
|
<filename>/etc/ttys</filename> and
|
||||||
|
<command>inetd</command>.</para>
|
||||||
|
</listitem>
|
||||||
|
</itemizedlist>
|
||||||
|
|
||||||
|
<para>Other areas are prepared for configuration, but will not work
|
||||||
|
until stage two is completed. For example we have copied files to
|
||||||
|
configure printing and X11. Printing however is likely to need
|
||||||
|
applications not found in the base system, like PostScript
|
||||||
|
utilities. X11 will not run before we have compiled the server,
|
||||||
|
libraries and programs.</para>
|
||||||
|
</sect1>
|
||||||
|
|
||||||
|
<sect1 id="stage2">
|
||||||
|
<title>Stage Two: Ports Installation</title>
|
||||||
|
|
||||||
|
<note>
|
||||||
|
<para>It is also possible to install the (precompiled)
|
||||||
|
packages at this stage, instead of compiling ports. In this case,
|
||||||
|
<filename>stage_2.sh</filename> would be nothing more than a list of
|
||||||
|
<command>pkg_add</command> commands. I trust you know how to write
|
||||||
|
such a script. Here we concentrate on the more flexible and
|
||||||
|
traditional way of using the ports.</para>
|
||||||
|
</note>
|
||||||
|
|
||||||
|
<para>The following <filename>stage_2.sh</filename> script is how I
|
||||||
|
install my favorite ports. It can be run any number of times and
|
||||||
|
will skip all ports that are already installed. It supports the
|
||||||
|
<emphasis>dryrun</emphasis> option (<option>-n</option>) to just
|
||||||
|
show what would be done. You will certainly want to edit the list of
|
||||||
|
ports, and possibly change a few environment variables.</para>
|
||||||
|
|
||||||
|
<para>The list of ports consists of lines with two or more space
|
||||||
|
separated words: the category and the port, optionally followed by
|
||||||
|
an installation command that will compile and install the port
|
||||||
|
(default: <command>make install</command>). Empty lines and lines
|
||||||
|
starting with # are ignored. Most of the time it suffices to only
|
||||||
|
name category and port. A few ports however can be fine tuned by
|
||||||
|
specifying <command>make</command> variables, e.g.:</para>
|
||||||
|
|
||||||
|
<programlisting>www mozilla make WITHOUT_MAILNEWS=yes WITHOUT_CHATZILLA=yes install
|
||||||
|
mail procmail make BATCH=yes install</programlisting>
|
||||||
|
|
||||||
|
<para>In fact you can specify arbitrary shell commands, so you are
|
||||||
|
not restricted to simple <command>make</command> invocations:</para>
|
||||||
|
|
||||||
|
<programlisting>java linux-sun-jdk13 yes | make install
|
||||||
|
news inn-stable CONFIGURE_ARGS="--enable-uucp-rnews --enable-setgid-inews" make install</programlisting>
|
||||||
|
|
||||||
|
<para>Note that the line for
|
||||||
|
<filename role="package">news/inn-stable</filename> is an example
|
||||||
|
for a one-shot shell variable assignment to
|
||||||
|
<literal>CONFIGURE_ARGS</literal>. The port
|
||||||
|
<filename>Makefile</filename> will use this as an initial value
|
||||||
|
and augment some other essential args. The difference to
|
||||||
|
specifying a <filename>make</filename> variable on the command line
|
||||||
|
with</para>
|
||||||
|
|
||||||
|
<programlisting>news inn-stable make CONFIGURE_ARGS="--enable-uucp-rnews --enable-setgid-inews" install</programlisting>
|
||||||
|
|
||||||
|
<para>is that the latter will override instead of augment. It depends on
|
||||||
|
the particular port which method you want.</para>
|
||||||
|
|
||||||
|
<para>Be careful that your ports do not use an interactive install, i.e.
|
||||||
|
they should not try to read from stdin other than what you explicitly
|
||||||
|
give them on stdin. If they do, they will read the next line(s) from
|
||||||
|
your list of ports in the here-document and get confused. If
|
||||||
|
<filename>stage_2.sh</filename> mysteriously skips a port or stops
|
||||||
|
processing, this is likely the reason.</para>
|
||||||
|
|
||||||
|
<para>Here is <filename>stage_2.sh</filename>. It creates a log file
|
||||||
|
named <filename>LOGDIR/category+port</filename> for each port
|
||||||
|
it actually installs. If you do not have
|
||||||
|
<filename>stage_2.sh</filename> on a shared partition make sure you
|
||||||
|
copy it to the new system before you boot it.</para>
|
||||||
|
|
||||||
|
<programlisting><inlinegraphic fileref="stage_2.sh" format="linespecific"></programlisting>
|
||||||
|
|
||||||
|
<para>Download <ulink
|
||||||
|
url="stage_2.sh"><filename>stage_2.sh</filename></ulink>.</para>
|
||||||
|
</sect1>
|
||||||
|
|
||||||
|
<sect1 id="stage3">
|
||||||
|
<title>Stage Three</title>
|
||||||
|
|
||||||
|
<para>You have installed your beloved ports during stage two. Some
|
||||||
|
ports require a little bit of configuration. This is what stage three,
|
||||||
|
the post-configuration is for. I could have integrated this
|
||||||
|
post-configuration at the end of the <filename>stage_2.sh</filename>
|
||||||
|
script. However, I think there is a conceptual difference between
|
||||||
|
installing a port and modifying its out-of-the-box configuration
|
||||||
|
that warrants a separate stage.</para>
|
||||||
|
|
||||||
|
<para>I have chosen to implement stage three as a
|
||||||
|
<filename>Makefile</filename> because this allows easy selection of
|
||||||
|
what you want to configure simply by running:</para>
|
||||||
|
|
||||||
|
<informalexample>
|
||||||
|
<screen>&prompt.root; <userinput>make -f stage_3.mk <replaceable>target</replaceable></userinput></screen>
|
||||||
|
</informalexample>
|
||||||
|
|
||||||
|
<para>As with <filename>stage_2.sh</filename> make sure you have
|
||||||
|
<filename>stage_3.mk</filename> available after booting the new
|
||||||
|
system, either by putting it on a shared partition or copying it
|
||||||
|
somewhere on the new system.</para>
|
||||||
|
|
||||||
|
<programlisting><inlinegraphic fileref="stage_3.mk" format="linespecific"></programlisting>
|
||||||
|
|
||||||
|
<para>Download <ulink
|
||||||
|
url="stage_3.mk"><filename>stage_3.mk</filename></ulink>.</para>
|
||||||
|
</sect1>
|
||||||
|
|
||||||
|
<sect1 id="limitations">
|
||||||
|
<title>Limitations</title>
|
||||||
|
|
||||||
|
<para>The automated installation of a port may prove difficult if it
|
||||||
|
is interactive and does not support <command>make BATCH=YES
|
||||||
|
install</command>. For a few ports the interaction is nothing more
|
||||||
|
than typing <literal>yes</literal> when asked to accept some license.
|
||||||
|
If such input is read from the standard input, we simply pipe the
|
||||||
|
appropriate answers to the installation command (usually <command>make
|
||||||
|
install</command>; this is how we deal with <filename
|
||||||
|
role="package">java/linux-sun-jdk13</filename> in
|
||||||
|
<filename>stage_2.sh</filename>).</para>
|
||||||
|
|
||||||
|
<para>This strategy for example does not work for <filename
|
||||||
|
role="package">editors/staroffice52</filename>, which requires that
|
||||||
|
X11 is running. The installation procedure involves a fair amount of
|
||||||
|
clicking and typing, so it cannot be automated like other ports can.
|
||||||
|
However the following workaround does the trick for me: first I
|
||||||
|
create a staroffice package on the old system with</para>
|
||||||
|
|
||||||
|
<informalexample>
|
||||||
|
<screen>&prompt.root; <userinput>cd /usr/ports/editors/staroffice52</userinput>
|
||||||
|
&prompt.root; <userinput>make package</userinput>
|
||||||
|
===> Building package for staroffice-5.2_1
|
||||||
|
Creating package /usr/ports/editors/staroffice52/staroffice-5.2_1.tbz
|
||||||
|
Registering depends:.
|
||||||
|
Creating bzip'd tar ball in '/usr/ports/editors/staroffice52/staroffice-5.2_1.tbz'</screen>
|
||||||
|
</informalexample>
|
||||||
|
|
||||||
|
<para>and during stage two I simply use:</para>
|
||||||
|
|
||||||
|
<informalexample>
|
||||||
|
<screen>&prompt.root; <userinput>pkg_add /usr/ports/editors/staroffice52/staroffice-5.2_1.tbz</userinput></screen>
|
||||||
|
</informalexample>
|
||||||
|
|
||||||
|
<para>You should also be aware of upgrade issues for config files.
|
||||||
|
In general you do not know when and if the format or contents of a
|
||||||
|
config file changes. A new group may be added to
|
||||||
|
<filename>/etc/group</filename>, or <filename>/etc/passwd</filename>
|
||||||
|
may gain another field. All of this has happened in the past. Simply
|
||||||
|
copying a config file from the old to the new system may be enough
|
||||||
|
most of the time, but in these cases it was not. If you update a
|
||||||
|
system the canonical way (by overwriting the old files) you are
|
||||||
|
expected to use <command>mergemaster</command> to deal with changes
|
||||||
|
where you effectively want to merge your local config with
|
||||||
|
potentially new items. Unfortunately, <command>mergemaster</command>
|
||||||
|
is only available for base system files, not for anything installed
|
||||||
|
by ports. Some third party software seems to be especially designed
|
||||||
|
to keep me on my toes by changing the config file format every
|
||||||
|
fortnight. All you can do is be alert, especially when the major
|
||||||
|
version number bumps. In the past I had to tweak or rewrite files
|
||||||
|
for web servers, news servers and readers. All software actively
|
||||||
|
maintained is a prime candidate for config file scrutiny.</para>
|
||||||
|
|
||||||
|
<para>I have used &scratch.ap; several times to update a
|
||||||
|
<literal>5-CURRENT</literal> to <literal>5-CURRENT</literal>, i.e.
|
||||||
|
I have never tried to install a <literal>5-CURRENT</literal> from
|
||||||
|
a <literal>4-STABLE</literal> system or vice versa. Due to the
|
||||||
|
number of changes between different major release numbers I would
|
||||||
|
expect this process to be a bit more involved. Using &scratch.ap;
|
||||||
|
for upgrades within the realm of <literal>4-STABLE</literal>
|
||||||
|
should work painlessly (although I have not yet tried it.) Users of
|
||||||
|
<literal>4-STABLE</literal> may want to consider the following
|
||||||
|
areas:</para>
|
||||||
|
|
||||||
|
<itemizedlist>
|
||||||
|
<listitem>
|
||||||
|
<para>If you do not use the device file system
|
||||||
|
(<literal>devfs</literal>) you may want to create devices for
|
||||||
|
some of your hardware with &man.MAKEDEV.8; in stage one, step
|
||||||
|
six.</para>
|
||||||
|
</listitem>
|
||||||
|
</itemizedlist>
|
||||||
|
|
||||||
|
</sect1>
|
||||||
|
</article>
|
228
en_US.ISO8859-1/articles/fbsd-from-scratch/stage_1.sh
Normal file
228
en_US.ISO8859-1/articles/fbsd-from-scratch/stage_1.sh
Normal file
|
@ -0,0 +1,228 @@
|
||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# stage_1.sh - FreeBSD From Scratch, Stage 1: System Installation.
|
||||||
|
# Usage: ./stage_1.sh
|
||||||
|
#
|
||||||
|
# $FreeBSD$
|
||||||
|
|
||||||
|
set -x -e
|
||||||
|
PATH=/bin:/usr/bin:/sbin:/usr/sbin
|
||||||
|
|
||||||
|
# Prerequisites:
|
||||||
|
#
|
||||||
|
# a) Successfully completed "make buildworld" and "make buildkernel"
|
||||||
|
# b) Unused partitions (at least one for the root fs, probably more for
|
||||||
|
# the new /usr and /var, to your liking.)
|
||||||
|
|
||||||
|
# Root mount point where you create the new system. Because it is only
|
||||||
|
# used as a mount point, no space will be used on that file system as all
|
||||||
|
# files are of course written to the mounted file system(s).
|
||||||
|
DESTDIR=/newroot
|
||||||
|
SRC=/usr/src # Where your src tree is.
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------------------- #
|
||||||
|
# Step 1: Create an empty directory tree below $DESTDIR.
|
||||||
|
# ---------------------------------------------------------------------------- #
|
||||||
|
|
||||||
|
step_one () {
|
||||||
|
# The new root file system. Mandatory.
|
||||||
|
# Change device names (DEV_*) or risk foot shooting.
|
||||||
|
DEV_ROOT=/dev/da3s1a
|
||||||
|
mkdir -p ${DESTDIR}
|
||||||
|
newfs ${DEV_ROOT}
|
||||||
|
tunefs -n enable ${DEV_ROOT}
|
||||||
|
mount -o noatime ${DEV_ROOT} ${DESTDIR}
|
||||||
|
|
||||||
|
# Additional file systems and initial mount points. Optional.
|
||||||
|
DEV_VAR=/dev/vinum/var_a
|
||||||
|
newfs ${DEV_VAR}
|
||||||
|
tunefs -n enable ${DEV_VAR}
|
||||||
|
mkdir -m 755 ${DESTDIR}/var
|
||||||
|
mount -o noatime ${DEV_VAR} ${DESTDIR}/var
|
||||||
|
|
||||||
|
DEV_USR=/dev/vinum/usr_a
|
||||||
|
newfs ${DEV_USR}
|
||||||
|
tunefs -n enable ${DEV_USR}
|
||||||
|
mkdir -m 755 ${DESTDIR}/usr
|
||||||
|
mount -o noatime ${DEV_USR} ${DESTDIR}/usr
|
||||||
|
|
||||||
|
mkdir -m 755 -p ${DESTDIR}/usr/ports
|
||||||
|
mount /dev/vinum/ports ${DESTDIR}/usr/ports
|
||||||
|
|
||||||
|
# Now create all the other directories. Mandatory.
|
||||||
|
cd ${SRC}/etc; make distrib-dirs DESTDIR=${DESTDIR}
|
||||||
|
# My personal preference is to symlink tmp -> var/tmp. Optional.
|
||||||
|
cd ${DESTDIR}; rmdir tmp; ln -s var/tmp
|
||||||
|
}
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------------------- #
|
||||||
|
# Step 2: Fill the empty /etc directory tree and put a few files in /.
|
||||||
|
# ---------------------------------------------------------------------------- #
|
||||||
|
|
||||||
|
step_two () {
|
||||||
|
# Add or remove from this list at your discretion. Mostly mandatory.
|
||||||
|
for f in \
|
||||||
|
/.profile \
|
||||||
|
/etc/group \
|
||||||
|
/etc/hosts \
|
||||||
|
/etc/inetd.conf \
|
||||||
|
/etc/ipfw.conf \
|
||||||
|
/etc/make.conf \
|
||||||
|
/etc/master.passwd \
|
||||||
|
/etc/nsswitch.conf \
|
||||||
|
/etc/ntp.conf \
|
||||||
|
/etc/printcap \
|
||||||
|
/etc/profile \
|
||||||
|
/etc/rc.conf \
|
||||||
|
/etc/resolv.conf \
|
||||||
|
/etc/start_if.xl0 \
|
||||||
|
/etc/ttys \
|
||||||
|
/etc/ppp/* \
|
||||||
|
/etc/mail/aliases \
|
||||||
|
/etc/mail/aliases.db \
|
||||||
|
/etc/mail/hal9000.mc \
|
||||||
|
/etc/mail/service.switch \
|
||||||
|
/etc/ssh/*key* \
|
||||||
|
/etc/ssh/*_config \
|
||||||
|
/etc/X11/XF86Config-4 \
|
||||||
|
/boot/splash.bmp \
|
||||||
|
/boot/loader.conf \
|
||||||
|
/boot/device.hints ; do
|
||||||
|
cp -p ${f} ${DESTDIR}${f}
|
||||||
|
done
|
||||||
|
# Delete mergemaster's temproot, if any.
|
||||||
|
TEMPROOT=/var/tmp/temproot.stage1
|
||||||
|
if test -d ${TEMPROOT}; then
|
||||||
|
chflags -R 0 ${TEMPROOT}
|
||||||
|
rm -rf ${TEMPROOT}
|
||||||
|
fi
|
||||||
|
mergemaster -i -m ${SRC}/etc -t ${TEMPROOT} -D ${DESTDIR}
|
||||||
|
cap_mkdb ${DESTDIR}/etc/login.conf
|
||||||
|
pwd_mkdb -d ${DESTDIR}/etc -p ${DESTDIR}/etc/master.passwd
|
||||||
|
|
||||||
|
# Mergemaster does not create empty files, e.g. in /var/log. Do so now,
|
||||||
|
# but do not clobber files that may have been copied in the loop above.
|
||||||
|
cd ${TEMPROOT}
|
||||||
|
find . -type f | sed 's,^\./,,' |
|
||||||
|
while read f; do
|
||||||
|
if test -r ${DESTDIR}/${f}; then
|
||||||
|
echo "${DESTDIR}/${f} already exists; not copied"
|
||||||
|
else
|
||||||
|
echo "Creating empty ${DESTDIR}/${f}"
|
||||||
|
cp -p ${f} ${DESTDIR}/${f}
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
chflags -R 0 ${TEMPROOT}
|
||||||
|
rm -rf ${TEMPROOT}
|
||||||
|
}
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------------------- #
|
||||||
|
# Step 3: Install world.
|
||||||
|
# ---------------------------------------------------------------------------- #
|
||||||
|
|
||||||
|
step_three () {
|
||||||
|
cd ${SRC}
|
||||||
|
make installworld DESTDIR=${DESTDIR}
|
||||||
|
}
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------------------- #
|
||||||
|
# Step 4: Install kernel and modules.
|
||||||
|
# ---------------------------------------------------------------------------- #
|
||||||
|
|
||||||
|
step_four () {
|
||||||
|
cd ${SRC}
|
||||||
|
# The loader.conf and device.hints are required by the installkernel target.
|
||||||
|
# If you have not copied them in Step 2, cp them as shown in the next 2 lines.
|
||||||
|
# cp sys/boot/forth/loader.conf ${DESTDIR}/boot/defaults
|
||||||
|
# cp sys/i386/conf/GENERIC.hints ${DESTDIR}/boot/device.hints
|
||||||
|
make installkernel DESTDIR=${DESTDIR} KERNCONF=HAL9000
|
||||||
|
}
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------------------- #
|
||||||
|
# Step 5: Install or modify a few essential files.
|
||||||
|
# ---------------------------------------------------------------------------- #
|
||||||
|
|
||||||
|
step_five () {
|
||||||
|
# Create /etc/fstab; mandatory. Modify to match your devices.
|
||||||
|
cat <<EOF >${DESTDIR}/etc/fstab
|
||||||
|
# Device Mountpoint FStype Options Dump Pass#
|
||||||
|
/dev/da3s1b none swap sw 0 0
|
||||||
|
/dev/da4s2b none swap sw 0 0
|
||||||
|
/dev/da3s1a / ufs rw 1 1
|
||||||
|
/dev/da1s2a /src ufs rw 0 2
|
||||||
|
/dev/da2s2f /share ufs rw 0 2
|
||||||
|
/dev/vinum/var_a /var ufs rw 0 2
|
||||||
|
/dev/vinum/usr_a /usr ufs rw 0 2
|
||||||
|
/dev/vinum/home /home ufs rw 0 2
|
||||||
|
/dev/vinum/ncvs /home/ncvs ufs rw,noatime 0 2
|
||||||
|
/dev/vinum/ports /usr/ports ufs rw,noatime 0 2
|
||||||
|
#
|
||||||
|
/dev/cd0 /dvd cd9660 ro,noauto 0 0
|
||||||
|
/dev/cd1 /cdrom cd9660 ro,noauto 0 0
|
||||||
|
proc /proc procfs rw 0 0
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# More directories; optional.
|
||||||
|
mkdir -m 755 -p ${DESTDIR}/src; chown root:wheel ${DESTDIR}/src
|
||||||
|
mkdir -m 755 -p ${DESTDIR}/share; chown root:wheel ${DESTDIR}/share
|
||||||
|
mkdir -m 755 -p ${DESTDIR}/dvd; chown root:wheel ${DESTDIR}/dvd
|
||||||
|
mkdir -m 755 -p ${DESTDIR}/home; chown root:wheel ${DESTDIR}/home
|
||||||
|
mkdir -m 755 -p ${DESTDIR}/usr/ports; chown root:wheel ${DESTDIR}/usr/ports
|
||||||
|
# Setup time zone info; pretty much mandatory.
|
||||||
|
cp ${DESTDIR}/usr/share/zoneinfo/Europe/Berlin ${DESTDIR}/etc/localtime
|
||||||
|
if test -r /etc/wall_cmos_clock; then
|
||||||
|
cp -p /etc/wall_cmos_clock ${DESTDIR}/etc/wall_cmos_clock
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------------------- #
|
||||||
|
# Step 6: Things important to me when I first login to a new system.
|
||||||
|
# NOTE: Do not install too many binaries here. With the old system running and
|
||||||
|
# the new binaries and headers installed you are likely to run into bootstrap
|
||||||
|
# problems. Ports should be compiled after you have booted in the new system.
|
||||||
|
# ---------------------------------------------------------------------------- #
|
||||||
|
|
||||||
|
step_six () {
|
||||||
|
chroot ${DESTDIR} sh -c "cd /usr/ports/shells/zsh; make clean install clean"
|
||||||
|
chroot ${DESTDIR} sh -c "cd /etc/mail; make install" # configure sendmail
|
||||||
|
|
||||||
|
# Without the compat symlink the linux_base files end up on the root fs:
|
||||||
|
cd ${DESTDIR}; mkdir -m 755 usr/compat
|
||||||
|
chown root:wheel usr/compat; ln -s usr/compat
|
||||||
|
mkdir -m 755 usr/compat/linux
|
||||||
|
mkdir -m 755 boot/grub
|
||||||
|
|
||||||
|
# Make spooldirs for the printers in my /etc/printcap.
|
||||||
|
cd ${DESTDIR}/var/spool/output/lpd; mkdir -p as od ev te lp da
|
||||||
|
touch ${DESTDIR}/var/log/lpd-errs
|
||||||
|
|
||||||
|
# More files I want to inherit from the old system.
|
||||||
|
for f in \
|
||||||
|
/var/cron/tabs/root \
|
||||||
|
/var/mail/* \
|
||||||
|
/boot/grub/*; do
|
||||||
|
cp -p ${f} ${DESTDIR}${f}
|
||||||
|
done
|
||||||
|
|
||||||
|
# If you do not have /home on a shared partition, you may want to copy it:
|
||||||
|
# mkdir -p ${DESTDIR}/home
|
||||||
|
# cd /home; tar cf - . | (cd ${DESTDIR}/home; tar xpvf -)
|
||||||
|
|
||||||
|
# Starting with FreeBSD 5.x, perl lives in /usr/local/bin but many scripts
|
||||||
|
# use a hardcoded #!/usr/bin/perl; use a symlink to make them work.
|
||||||
|
cd ${DESTDIR}/usr/bin; ln -s ../local/bin/perl
|
||||||
|
cd ${DESTDIR}/usr; rmdir src; ln -s ../src/current src
|
||||||
|
}
|
||||||
|
|
||||||
|
do_steps () {
|
||||||
|
step_one
|
||||||
|
step_two
|
||||||
|
step_three
|
||||||
|
step_four
|
||||||
|
step_five
|
||||||
|
step_six
|
||||||
|
}
|
||||||
|
|
||||||
|
do_steps 2>&1 | tee stage_1.log
|
||||||
|
|
||||||
|
# EOF $RCSfile: stage_1.sh,v $ vim: tabstop=2:expandtab:
|
147
en_US.ISO8859-1/articles/fbsd-from-scratch/stage_2.sh
Normal file
147
en_US.ISO8859-1/articles/fbsd-from-scratch/stage_2.sh
Normal file
|
@ -0,0 +1,147 @@
|
||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# stage_2.sh - FreeBSD From Scratch, Stage 2: Ports Installation.
|
||||||
|
# Usage: ./stage_2.sh
|
||||||
|
#
|
||||||
|
# $FreeBSD$
|
||||||
|
|
||||||
|
DBDIR=/var/db/pkg
|
||||||
|
PORTS=/usr/ports
|
||||||
|
LOGDIR=/home/root/setup/ports.log; mkdir -p ${LOGDIR}
|
||||||
|
|
||||||
|
# Set some variables used by more than one port.
|
||||||
|
PAPERSIZE=a4; export PAPERSIZE
|
||||||
|
USA_RESIDENT=NO; export USA_RESIDENT
|
||||||
|
|
||||||
|
MYNAME=$(basename $0)
|
||||||
|
usage () {
|
||||||
|
exec >&2
|
||||||
|
echo "usage: ${MYNAME} [-hn]"
|
||||||
|
echo ""
|
||||||
|
echo " Options:"
|
||||||
|
echo " -h Print this help text."
|
||||||
|
echo " -n Dryrun: just show what would be done."
|
||||||
|
echo ""
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
args=`getopt hn $*`
|
||||||
|
if test $? != 0; then
|
||||||
|
usage
|
||||||
|
fi
|
||||||
|
set -- $args
|
||||||
|
DRYRUN=
|
||||||
|
for i; do
|
||||||
|
case "$i" in
|
||||||
|
-n) DRYRUN=yes;;
|
||||||
|
--) break;;
|
||||||
|
*) usage;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
cat << EOF |
|
||||||
|
lang perl5
|
||||||
|
security sudo
|
||||||
|
x11-servers XFree86-4-Server
|
||||||
|
x11 wrapper
|
||||||
|
x11 XFree86-4-libraries
|
||||||
|
x11 XFree86-4-clients
|
||||||
|
x11-fonts XFree86-4-font75dpi
|
||||||
|
x11-fonts XFree86-4-font100dpi
|
||||||
|
x11-fonts XFree86-4-fontScalable
|
||||||
|
x11-fonts urwfonts
|
||||||
|
x11-fonts webfonts
|
||||||
|
x11-toolkits open-motif
|
||||||
|
x11 rxvt
|
||||||
|
x11-wm ctwm
|
||||||
|
security openssh-askpass
|
||||||
|
astro xplanet
|
||||||
|
astro setiathome make BATCH=yes install
|
||||||
|
astro xephem
|
||||||
|
editors vim
|
||||||
|
print ghostscript-gnu make A4=yes BATCH=yes install
|
||||||
|
print a2ps-a4
|
||||||
|
print psutils-a4
|
||||||
|
print gv
|
||||||
|
print acroread5
|
||||||
|
print transfig
|
||||||
|
archivers zip
|
||||||
|
archivers unzip
|
||||||
|
java linux-sun-jdk13 yes | make install
|
||||||
|
java jdk13
|
||||||
|
www apache2
|
||||||
|
www weblint
|
||||||
|
www amaya
|
||||||
|
www mozilla make WITHOUT_MAILNEWS=yes WITHOUT_CHATZILLA=yes install
|
||||||
|
www netscape48-navigator
|
||||||
|
www checkbot
|
||||||
|
www privoxy
|
||||||
|
graphics xfig
|
||||||
|
graphics xv
|
||||||
|
graphics fxtv
|
||||||
|
lang expect
|
||||||
|
news tin
|
||||||
|
net freebsd-uucp
|
||||||
|
net cvsup-without-gui
|
||||||
|
net pathchar make NO_CHECKSUM=yes install
|
||||||
|
ftp wget
|
||||||
|
ftp ncftp3
|
||||||
|
textproc ispell
|
||||||
|
german ispell-neu
|
||||||
|
german ispell-alt
|
||||||
|
textproc docproj make JADETEX=yes HAVE_MOTIF=yes install
|
||||||
|
sysutils samefile
|
||||||
|
sysutils pstree
|
||||||
|
sysutils mkisofs
|
||||||
|
sysutils cdrtools
|
||||||
|
sysutils grub
|
||||||
|
devel ddd
|
||||||
|
devel ctags
|
||||||
|
devel ElectricFence
|
||||||
|
mail procmail make BATCH=yes install
|
||||||
|
mail metamail
|
||||||
|
mail mutt
|
||||||
|
mail spamoracle
|
||||||
|
emulators mtools
|
||||||
|
sysutils portupgrade
|
||||||
|
news inn-stable CONFIGURE_ARGS="--enable-uucp-rnews --enable-setgid-inews" make install
|
||||||
|
misc figlet-fonts
|
||||||
|
textproc gmat
|
||||||
|
EOF
|
||||||
|
while read CATEGORY NAME CMD; do
|
||||||
|
case "${CATEGORY}" in
|
||||||
|
\#*) continue;;
|
||||||
|
'') continue;;
|
||||||
|
esac
|
||||||
|
DIR="${PORTS}/${CATEGORY}/${NAME}"
|
||||||
|
if ! test -d "${DIR}"; then
|
||||||
|
echo "$DIR does not exist -- ignored"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
cd ${DIR}
|
||||||
|
PKGNAME=`make -V PKGNAME`
|
||||||
|
if test -d "${DBDIR}/${PKGNAME}"; then
|
||||||
|
echo "${CATEGORY}/${NAME} already installed as ${PKGNAME}"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
LOG="${LOGDIR}/${CATEGORY}+${NAME}"
|
||||||
|
echo "===> Installing ${CATEGORY}/${NAME}; logging to ${LOG}"
|
||||||
|
test -n "${CMD}" || CMD="make install"
|
||||||
|
if test -n "${DRYRUN}"; then
|
||||||
|
echo "${CMD}"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
date "++++++++++ %v %T +++++++++" > ${LOG}
|
||||||
|
echo "CMD: ${CMD}" >> ${LOG}
|
||||||
|
(
|
||||||
|
make clean
|
||||||
|
eval "${CMD}"
|
||||||
|
# make clean # Uncomment if diskspace is tight under ${PORTS}.
|
||||||
|
) 2>&1 | tee -a ${LOG}
|
||||||
|
done
|
||||||
|
|
||||||
|
# Install StarOffice as a package, created on old the system with
|
||||||
|
# "make package", because the port uses an interactive X11 install.
|
||||||
|
#pkg_add ${PORTS}/editors/staroffice52/staroffice-*.tbz
|
||||||
|
|
||||||
|
# EOF $RCSfile: stage_2.sh,v $ vim: tabstop=4:
|
146
en_US.ISO8859-1/articles/fbsd-from-scratch/stage_3.mk
Normal file
146
en_US.ISO8859-1/articles/fbsd-from-scratch/stage_3.mk
Normal file
|
@ -0,0 +1,146 @@
|
||||||
|
# stage_3.mk - FreeBSD From Scratch, Stage 3: Ports Post-Configuration.
|
||||||
|
# Usage: make -f stage_3.mk all (config everything)
|
||||||
|
# or make -f stage_3.mk target (to just config target)
|
||||||
|
#
|
||||||
|
# It is a good idea to make sure any target can be made more than
|
||||||
|
# once without ill effect.
|
||||||
|
#
|
||||||
|
# $FreeBSD$
|
||||||
|
|
||||||
|
.POSIX:
|
||||||
|
|
||||||
|
message:
|
||||||
|
@echo "Please use one of the following targets:"
|
||||||
|
@echo "config_apache"
|
||||||
|
@echo "config_inn"
|
||||||
|
@echo "config_javaplugin"
|
||||||
|
@echo "config_privoxy"
|
||||||
|
@echo "config_setiathome"
|
||||||
|
@echo "config_sgml"
|
||||||
|
@echo "config_sudo"
|
||||||
|
@echo "config_TeX"
|
||||||
|
@echo "config_tin"
|
||||||
|
@echo "config_uucp"
|
||||||
|
@echo "all -- all of the above"
|
||||||
|
|
||||||
|
all: config_apache \
|
||||||
|
config_inn \
|
||||||
|
config_javaplugin \
|
||||||
|
config_privoxy \
|
||||||
|
config_setiathome \
|
||||||
|
config_sgml \
|
||||||
|
config_sudo \
|
||||||
|
config_TeX \
|
||||||
|
config_tin \
|
||||||
|
config_uucp
|
||||||
|
|
||||||
|
config_apache:
|
||||||
|
# 1. Modify httpd.conf.
|
||||||
|
perl -pi \
|
||||||
|
-e 's/#ServerName new.host.name/ServerName hal9000.s.shuttle.de/;' \
|
||||||
|
-e 's/^ServerAdmin.*/ServerAdmin schweikh\@schweikhardt.net/;' \
|
||||||
|
-e 's,/usr/local/www/cgi-bin/,/home/opt/www/cgi-bin/,;' \
|
||||||
|
/usr/local/etc/apache2/httpd.conf
|
||||||
|
# 2. Restore symlinks to web pages.
|
||||||
|
cd /usr/local/www/data; \
|
||||||
|
ln -fs /home/schweikh/prj/homepage schweikhardt.net; \
|
||||||
|
ln -fs /home/opt/www/test .
|
||||||
|
|
||||||
|
config_inn:
|
||||||
|
pw usermod -n news -d /usr/local/news -s /bin/sh
|
||||||
|
# Give the news system its initial configuration.
|
||||||
|
cd /home/root/setup; \
|
||||||
|
install -C -o news -g news -m 664 active newsgroups /usr/local/news/db
|
||||||
|
# The innd.sh that comes with the port is broken, it
|
||||||
|
# checks for history.pag which does not exist.
|
||||||
|
cd /home/root/setup; \
|
||||||
|
install -C -o root -g wheel -m 555 innd.sh /usr/local/etc/rc.d
|
||||||
|
# Configure storage method.
|
||||||
|
cd /home/root/setup; \
|
||||||
|
printf "%s\n%s\n%s\n%s\n" \
|
||||||
|
"method tradspool {" \
|
||||||
|
" newsgroups: *" \
|
||||||
|
" class: 0" \
|
||||||
|
"}" \
|
||||||
|
>storage.conf; \
|
||||||
|
install -C -o news -g news -m 664 storage.conf /usr/local/news/etc
|
||||||
|
# Configure newsfeeds.
|
||||||
|
printf "%s\n%s\n" \
|
||||||
|
"ME:*::" \
|
||||||
|
"shuttle/news2.shuttle.de:!junk,!control:B32768/512,Tf,Wfb:" \
|
||||||
|
>/usr/local/news/etc/newsfeeds
|
||||||
|
# Configure inn.conf.
|
||||||
|
perl -pi \
|
||||||
|
-e 's/^(organization:\s*).*/$$1 An Open Pod Bay Door/;' \
|
||||||
|
-e 's/^(pathhost:\s*).*/$$1 hal9000.schweikhardt.net/;' \
|
||||||
|
-e 's/^(server:).*/$$1 localhost/;' \
|
||||||
|
-e 's/^(domain:).*/$$1 schweikhardt.net/;' \
|
||||||
|
-e 's/^(fromhost:).*/$$1 schweikhardt.net/;' \
|
||||||
|
-e 's,^(moderatormailer:).*,$$1 \%s\@moderators.isc.org,;' \
|
||||||
|
-e 's,/usr/local/news/spool,/share/news/spool,;' \
|
||||||
|
/usr/local/news/etc/inn.conf
|
||||||
|
|
||||||
|
config_javaplugin:
|
||||||
|
cd /usr/local/lib/netscape-linux/plugins; \
|
||||||
|
if ! test -h javaplugin.so; then \
|
||||||
|
ln -s ../../../linux-sun-jdk1.3.1/jre/plugin/i386/ns4/javaplugin.so; \
|
||||||
|
fi; \
|
||||||
|
ls -l javaplugin.so
|
||||||
|
|
||||||
|
config_privoxy:
|
||||||
|
install -C -o root -g wheel -m 644 config /usr/local/etc/privoxy
|
||||||
|
|
||||||
|
config_setiathome:
|
||||||
|
perl -pi \
|
||||||
|
-e 's,^.*seti_wrkdir.*#,seti_wrkdir=/home/nobody/setiathome #,;' \
|
||||||
|
/usr/local/etc/rc.setiathome.conf
|
||||||
|
|
||||||
|
config_sgml:
|
||||||
|
cp -p /usr/local/share/gmat/sgml/ISO_8879-1986/entities/* \
|
||||||
|
/usr/local/share/sgml/docbook/4.1
|
||||||
|
|
||||||
|
config_sudo:
|
||||||
|
if ! grep -q schweikh /usr/local/etc/sudoers; then \
|
||||||
|
echo 'schweikh ALL = (ALL) NOPASSWD: ALL' >> /usr/local/etc/sudoers; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
config_TeX:
|
||||||
|
# textproc/docproj advises: to typeset the FreeBSD Handbook with JadeTeX,
|
||||||
|
# change the following settings to the listed values:
|
||||||
|
perl -pi \
|
||||||
|
-e 's/^% original texmf.cnf/% texmf.cnf/;' \
|
||||||
|
-e 's/^(hash_extra\s*=).*/$$1 60000/;' \
|
||||||
|
-e 's/^(pool_size\s*=).*/$$1 1000000/;' \
|
||||||
|
-e 's/^(max_strings\s*=).*/$$1 70000/;' \
|
||||||
|
-e 's/^(save_size\s*=).*/$$1 10000/;' \
|
||||||
|
/usr/local/share/texmf/web2c/texmf.cnf
|
||||||
|
|
||||||
|
config_tin:
|
||||||
|
# Point tin to our files.
|
||||||
|
printf "%s\n%s\n%s\n" \
|
||||||
|
"activefile=/usr/local/news/db/active" \
|
||||||
|
"newsgroupsfile=/usr/local/news/db/newsgroups" \
|
||||||
|
"spooldir=/share/news/spool/articles" \
|
||||||
|
>/usr/local/etc/tin.defaults
|
||||||
|
|
||||||
|
config_uucp:
|
||||||
|
# UUCP expects to find /usr/bin/rnews.
|
||||||
|
cd /usr/bin; ln -fs ../local/news/bin/rnews .
|
||||||
|
# Actual UUCP configuration.
|
||||||
|
echo nodename js2015 > /usr/local/etc/uucp/config
|
||||||
|
echo shuttle js2015 `cat uucp` > /usr/local/etc/uucp/call
|
||||||
|
printf 'port tcp\ntype tcp\n' > /usr/local/etc/uucp/port
|
||||||
|
printf "%s\n%s\n%s\n%s\n%s\n%s\n%s\n" \
|
||||||
|
"call-login *" \
|
||||||
|
"call-password *" \
|
||||||
|
"time any" \
|
||||||
|
"system shuttle" \
|
||||||
|
"address mail.s.shuttle.de" \
|
||||||
|
"commands rmail rnews" \
|
||||||
|
"port tcp" \
|
||||||
|
>/usr/local/etc/uucp/sys
|
||||||
|
cd /usr/local/etc/uucp; chown uucp:uucp *; chmod o-rwx *
|
||||||
|
# Trigger uucico after booting.
|
||||||
|
mkdir -p /usr/local/etc/rc.d; cp uucp.sh /usr/local/etc/rc.d
|
||||||
|
|
||||||
|
# EOF $RCSfile: stage_3.mk,v $ vim: tabstop=4:
|
Loading…
Reference in a new issue