Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Oct 2002 21:58:49 +0200
From:      Udo Erdelhoff <ue@nathan.ruhr.de>
To:        freebsd-doc@freebsd.org
Subject:   Please review: new handbook chapter on serial install
Message-ID:  <20021015195849.GA76747@nathan.internal>

next in thread | raw e-mail | index | archive | help
Hi,
the chapter about using a serial console lacks one important feature:
A description how to install FreeBSD with a serial console.  As I had
to re-install one of my boxes today anyway, I recorded what needs to
be done and turned it into sgml.  Here's the result:

Index: chapter.sgml
===================================================================
RCS file: /home/ncvs/doc/en_US.ISO8859-1/books/handbook/serialcomms/chapter.sgml,v
retrieving revision 1.66
diff -u -r1.66 chapter.sgml
--- chapter.sgml	30 Sep 2002 15:33:26 -0000	1.66
+++ chapter.sgml	15 Oct 2002 19:47:57 -0000
@@ -2609,6 +2609,135 @@
 	attach a monitor into it. You might also try installing an AMI
 	BIOS.</para>
     </sect2>
+
+    <sect2 id="serialconsole-install">
+      <sect2info>
+	<author>
+	  <firstname>Udo</firstname>
+	  <surname>Erdelhoff</surname>
+	  <contrib>Contributed by </contrib>
+	</author>
+      </sect2info>
+
+      <title>Using a Serial Console to Install FreeBSD</title>
+
+      <para>With only a little bit of work, it is also possible to
+	<emphasis>install</emphasis> a FreeBSD system over a serial
+	console.  Of course, you will have to prepare your BIOS first
+	to be able to boot without a keyboard (or even without a
+	graphics adapter).  You will have to configure it to try to
+	boot from floppy before it tries to boot from hard disk.  This
+	cannot be done over a serial console on most PC
+	mainboards.</para>
+
+      <para>The secret of installing FreeBSD over a serial console is
+	the fact that even the boot loader and the kernel used on the
+	installation floppies support a serial console, just like
+	their big counterparts that are installed on your hard disk.
+	In other words, all you have to do is to create a
+	<filename>boot.config</filename> file on the boot medium.  In
+	theory, this could be a remotely mounted root file system for
+	a diskless installation, a modified installation CD/DVD, or a
+	modified boot floppy.  The easiest solution (and the only one
+	described in this chapter) is to create a modified boot floppy
+	because this can be done with the on-board tools of a standard
+	installation.  Please note that you do
+	<emphasis>NOT</emphasis> have to install the complete system
+	from floppy disk, you can still use your CD-ROM, DVD-ROM, or
+	your internet connection to get the distributions.</para>
+
+
+      <para>The official way of creating a modified boot floppy is to
+	modify the scripts and <filename>Makefile</filename> used by
+	<command>make release</command>.  This is not required if the
+	only change is the addition of a
+	<filename>boot.config</filename> file on the boot disk.  The
+	boot disk consists of two parts, the boot sector/loader and
+	the installation kernel.  The latter is stored in a small UFS
+	file system that can be modified and manipulated with all the
+	usual tools.  This includes the creation of
+	<filename>boot.config</filename>.  All you need is a system
+	that can mount, read, and write FreeBSD file systems.  As a
+	rule of thumb, this means another FreeBSD system.  Once you
+	have this, it is rather easy to create a modified
+	<filename>boot.flp</filename> for installation over a serial
+	console.</para>
+
+      <procedure>
+	<step>
+	  <para>Create floppy disks from the
+	    <filename>kern.flp</filename> and
+	    <filename>mfsroot.flp</filename> images.</para>
+	</step>
+
+	<step>
+	  <para>Insert the floppy disk with the
+	    <filename>kern.flp</filename> into the drive.</para>
+	</step>
+
+	<step>
+	  <para>Mount the file system on
+	    <filename>kern.flp</filename>, create a sutitable
+	    <filename>boot.config</filename>, and unmount the
+	    disk.</para>
+
+	  <screen>&prompt.root; <userinput>mount /dev/fd<replaceable>X</replaceable> /mnt</userinput>
+&prompt.root; <userinput>echo -P &gt; /mnt/boot.config</userinput>
+&prompt.root; <userinput>umount /mnt</userinput></screen>
+	</step>
+
+	<step>
+	  <para>Connect your serial console to the new FreeBSD system,
+	    just as explained above.</para>
+	</step>
+
+	<step>
+	  <para>Insert the modified <filename>kern.flp</filename> into
+	    the disk drive of the new FreeBSD system and start/reboot
+	    it.</para>
+	</step>
+      </procedure>
+
+      <para>After a while, you should see activity on your serial
+	console, probably the <quote>sppiner</quote>, followed by the
+	usual start messages from the kernel.  With two minor
+	exceptions, you can use &man.sysinstall.8;  just as if you
+	were installing FreeBSD with a conventional set-up:</para>
+
+      <itemizedlist>
+	<listitem>
+	  <para>&man.sysinstall.8; cannot start the emergency
+	    holographic shell on an additional VTY because there is
+	    only one serial console.</para>
+	</listitem>
+
+	<listitem>
+	  <para>There is an additional dialog at the start of
+	    &man.sysinstall.8; where you can define which kind of
+	    terminal you are using.</para>
+	</listitem>
+      </itemizedlist>
+
+      <para>Once &man.sysinstall.8; has finished extracting all the
+	distributions, it will ask you if you want to change your
+	settings.  You will have to do this, because the newly
+	installed system is not configured for a serial console
+	yet.  In order to allow log-ins over the serial console,
+	you will have to select <menuentry>TTYs</menuentry> from
+	the <menuentry>Configuration<menuentry>.  Activate the
+	&man.getty.8; on <devicename>ttyd0</devicename> and
+	configure the terminal type to the appropriate value
+	for your terminal.</para>
+
+      <para>The second required change is the creation of a
+	<filename>boot.config</filename> file on the root file system
+	of your newly installed FreeBSD box.  This can be done by
+	selecting <literal>shell</literal> from the
+	<literal>Fixit</literal> menu.  Just type <command>echo -P
+	&gt;  /boot.config</command>, exit the shell, quit
+	&man.sysinstall.8; and watch your newly installed system boot
+	with an active serial console.</para>
+    </sect2>
   </sect1>
 </chapter>
 
Comments?

/s/Udo
-- 
Enjoy the beauty and power of root

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021015195849.GA76747>