File: dfs.sgml

package info (click to toggle)
dfsbuild 1.0.2.0
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 1,312 kB
  • ctags: 6
  • sloc: haskell: 831; sh: 200; makefile: 99
file content (506 lines) | stat: -rw-r--r-- 19,418 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
  <!ENTITY index SYSTEM "index/index.sgml">
  <!ENTITY dfsbuild "<application>dfsbuild</application>">
  <!ENTITY man.dfsbuild SYSTEM "dfsbuild.sgml">
]>

<book id="dfs">
  <bookinfo>
    <title>Using Debian From Scratch</title>
    <author>
      <firstname>John</firstname> <surname>Goerzen</surname>
    </author>
    <address><email>jgoerzen@complete.org</email></address>
    <legalnotice>
    <para>
        PLEASE NOTE: THIS DOCUMENTATION IS NOT YET ANYWHERE NEAR FINISHED.
    </para>
    <para>
      FIXME: add copyright here
      </para>

    </legalnotice>
  </bookinfo>


  <chapter id="intro">
    <title>Introduction to DFS</title>
    <para>
      Welcome to Debian From Scratch (DFS).  DFS is really two
      systems: 1) a bootable CD for repairing Linux systems or
      installing Debian; and 2) the program that generates the CDs
      that are used for #1.  Most of this manual focuses on #1.
      A wide variety of DFS CDs can be made using the DFS build
      tools.  This manual will refer to CDs made using the default
      configuration.
    </para>
    <sect1 id="features">
      <title>DFS Features</title>
      <indexterm><primary>Features</primary></>
      <para>
	You can expect the following from your DFS CD:
      </para>
      <itemizedlist>
	<listitem><para>Bootable CD featuring the GNU Grub
	    bootloader.  Can be used to boot hard disk partitions even
	    if no hard disk bootloader is present.</para>
	</listitem>
	<listitem><para>Kernel and userland support for all major
	    filesystems, including ext2, ext3, JFS, XFS, ReiserFS,
	    FAT, VFAT, NTFS, ISO9660, CramFS, tmpfs, and more.  Userland support for Reiser4.
	  </para>
	</listitem>
	<listitem><para>Kernel and userland support for different disk
	    layout schemes including standard partitioning, Logical
	    Volume Manager 2 (LVM2), software RAID, etc.
	  </para>
	</listitem>
	<listitem><para>Full recovery tools runnable directly from CD,
	    including:
	  </para>
	  <itemizedlist>
	    <listitem><para>Filesystem utilities for all major filesystems, including undeletion tools for ext2</para>
	    </listitem>
	    <listitem><para>Partition editors (fdisk, cfdisk, parted)</para>
	    </listitem>
	    <listitem><para>Text editors (nano, joe, vim, emacs)</para>
	    </listitem>
	    <listitem><para>C, Perl, Python, and OCaml development
		environments.  Enough to configure and compile a new
		kernel and build basic .debs.  Kernel 2.6.6 sources
                included on CD.</para>
	    </listitem>
	    <listitem><para>Full networking support, including PPP and
		various Ethernet cards and DHCP</para>
	    </listitem>
	    <listitem><para>Network tools including FTP clients, Web
		client, ssh, telnet, NFS, smbclient, tcpdump, netcat, etc.
	      </para>
	    </listitem>
	    <listitem><para>Backup restoration tools such as
		rdiff-backup, dump/restore, tar, cpio, amanda client,
		afbackup client, etc.</para>
	    </listitem>
	    <listitem><para>CD and DVD burning tools</para>
	    </listitem>
	    <listitem><para>Basic printing tools (cat for local
                printers, rlpr for remote ones, and netcat for
                Jetdirect, plus unix2dos for text files and
                Ghostscript for emergency conversions)
              </para>
	    </listitem>
            <listitem><para>Mail reader (mutt)</para>
            </listitem>
          </itemizedlist>
	</listitem>
	<listitem><para>Base systems for multiple versions of Debian
	    installable directly from CD, including: sarge, etch, and
	    sid (stable, testing, and unstable).
	  </para>
	</listitem>
        <listitem><para>
            Hybrid amd64 support: A single i386/amd64 hybrid CD
            provides
            enough to install or fix either an i386 or an
            AMD64 system.  Includes 64-bit kernel with 32-bit
            emulation (to run the 32-bit userland on the CD).   Also
            includes 64-bit packages for bootstrapping a new AMD64
            support.  In short, you can boot a 64-bit kernel and be
            treated as a first-class citizen in almost all respects.
          </para>
        </listitem>
        <listitem><para>
            Easy porting to other architectures.  Existing ports to
            Alpha and PowerPC.
          </para>
        </listitem>
	<listitem><para>i386 or x86_64 (amd64) kernels bootable
	    directly from initial boot menu.</para>
	</listitem>
	<listitem><para>DFS generation scripts support custom kernels,
	    packages, mirrors, compressed ISO images, and a high
	    degree of flexibility.
	  </para>
	</listitem>
      </itemizedlist>
    </sect1>
    <sect1 id="getting">
      <title>Getting DFS</title>
      <para>
        You may download ISO images for DFS from John Goerzen's
        <ulink url="http://people.debian.org/~jgoerzen/dfs/">DFS
        site</ulink>.  The &dfsbuild; program is available from within
        Debian itself, or you may find it on the
        <ulink url="http://packages.debian.org/dfsbuild">Debian
        package page</ulink>.
      </para>
      <para>
        For more resources, please visit <xref
        linkend="dfsbuild.links"/>.
      </para>
    </sect1>
    <sect1 id="history">
      <title>History of DFS</title>
      <para>
        DFS begain as the first installer for the amd64 port of
        Debian.  I also wanted to have a handy rescue disk for systems
        that use LVM, Reiser4, etc.  At the time, the Debian
        installers didn't support any of this.
      </para>
    </sect1>
          
  </chapter>

  <chapter id="booting">
    <title>Booting DFS</title>
    <indexterm><primary>Booting</></>
    <para>
      Booting procedures vary by architecture.  Here are some basics:
    </para>
    <sect1 id="booting.i386">
      <title>Booting on i386 (PC)</title>
      <para>
        Booting DFS usually is as simple as inserting a CD into the
        drive.  DFS can boot from an IDE or SCSI CD-ROM.  On some
        systems,
        you may need to access your BIOS to enable booting from CD.
        When you have successfully booted DFS the CD, you'll see a blue
        Grub selection screen.
      </para>
    </sect1>
    <sect1 id="booting.alpha">
      <title>Booting on Alpha</title>
      <para>
        The DFS images for Alpha support the SRM console only at this
        time.  If your system uses AlphaBIOS or some other BIOS, you
        may need to convert to SRM.  If you need the SRM firmware, you
        may be able to find it on the <ulink
          url="http://ftp.digital.com/pub/DEC/Alpha/firmware/">Alpha
          firmware updates</ulink> page.
      </para>
      <para>
        Details about SRM can be found at the SRM HOWTO.  If you are
        reading this manual directly from the DFS CD-ROM, you can find
        the HOWTO at <ulink
          url="file:///usr/share/doc/aboot-base/SRM-HOWTO/index.html"></ulink>.
        If you are reading this on the Web, the SRM HOWTO can be found
        at <ulink url="http://www.tldp.org/HOWTO/SRM-HOWTO/"></ulink>
        or <ulink
          url="http://www.alphalinux.org/faq/srm.html"></ulink>.
      </para>
      <para>
        Booting the DFS CD generally involves these steps:
      </para>
      <orderedlist>
        <listitem><para>Boot to an SRM prompt.  If your system is set
            to automatically boot an operating system, Ctrl-C at the
            appropriate time may accomplish this.
          </para>
        </listitem>
        <listitem><para>Set the operating system type with:
            <command>set os_type Unix</command>.</para>
        </listitem>
        <listitem><para>Find the device that represents your CD-ROM
            drive.  Typing <command>show dev</command> will help you
            out.  IDE users may often find dqa2 as their CD-ROM
            device.
            Please consult <command>show dev</command> to discover the
            proper value for your system.
          </para>
        </listitem>
        <listitem><para>Boot the aboot bootloader.  Run: <command>boot
              <replaceable>device</replaceable> -fl i</command>.
            Replace <replaceable>device</replaceable> with your
            particular CD-ROM device.
          </para>
        </listitem>
        <listitem><para>
            You should now see an aboot prompt.  You can press "l"
            (lower-case "L") to see a list of available kernels.
            Press zero through 9 to boot one of them; the default
            should be set to 0.  If you don't know what to do, just
            press 0.
          </para>
        </listitem>
        <listitem><para>
            Linux should now start.
          </para>
        </listitem>
      </orderedlist>
    </sect1>
    <sect1 id="booting.powerpc">
      <title>Booting on PowerPC</title>
      <para>
        The DFS images for PowerPC support booting from OpenFirmware
	(OF) into yaboot.
      </para>
      <para>
        Booting the DFS CD generally involves these steps:
      </para>
      <orderedlist>
        <listitem><para>Boot into yaboot. On newer PowerPC (NewWorld)
            you can press "c" (or "Command-Option-Shift-Delete") 
	    during boot until you reach the yaboot
            bootprompt. If this does not work, you have to boot into
            OpenFirmware first. This can be done by pressing
            "Option-Command-o-f" (all four at the same time) during boot.
            The Option key might also be labeled "Alt" and the
            Command key with the Apple sign on your keyboard. Once
            you have reached the OpenFirmware prompt, type <command>boot
            cd:,\boot\yaboot</command> to boot into yaboot.
          </para>
        </listitem>
        <listitem><para>
            You should now see an yaboot prompt.  You can press "TAB"
            to see a list of available kernels. Enter the kernel's name
            to boot it. The *-safe options use "video=ofonly" which
            is needed if your machine has a framebuffer that is not well
            supported and booting would give flickering lines on the screen. 
            "ofonly" relies on the OpenFirmware console.
          </para>
        </listitem>
        <listitem><para>
            Linux should now start.
          </para>
        </listitem>
      </orderedlist>
    </sect1>
           
    <sect1 id="dfsboot-kernel">
      <title>Booting a Kernel</title>
      <para>
        Depending on how your CD was built, you'll see options for one
        or more different kernel images.  Select one appropriate for
        your system.  If a given image says "amd64", this should only
        be used on amd64 systems such as Opteron or Athlon64 system.
	<emphasis>
          Note: if you intend to install a 64-bit amd64 system, you MUST
          boot from the 64-bit amd64 kernel.
        </emphasis>
      </para>
    </sect1>
    <sect1 id="dfsboot-selcd">
      <title>Selecting CD-ROM device</title>
      <para>
        In most cases, DFS can automatically detect which drive holds
        your DFS CD.  However, if that check is time-consuming or
        fails, you can manually specify your CD with the
        <command>dfscd</command> parameter.  To use it, select the
        kernel
        you wish, press e to edit the command and edit the "kernel"
        line.  Insert something such as
        <command>dfscd=/dev/hdc</command>, press Enter, then b to
        boot.
      </para>
    </sect1>
    <sect1 id="dfsboot-hardware">
      <title>Detecting Hardware</title>
      <indexterm><primary>Hardware</><secondary>Detecting</></>
      <indexterm><primary>discover</></>
      <indexterm><primary>USB</></>
      <para>
        Some hardware will automatically be configured.  You can
        attempt to autodetect more hardware by running
        <command>/etc/init.d/discover start</command>.  If you want to
        use USB devices, try <command>/etc/init.d/hotplug
          start</command>.  Otherwise, you will likely need to
        manually load kernel modules.  You can find them under
        <filename>/lib/modules/<replaceable>kernelversion</replaceable></filename>.  
        Tools such as <command>lspci</command> can help you find out
        what hardware you have that needs to be loaded.
      </para>
      <para>
        <indexterm><primary>PCMCIA</></>
        If you have PCMCIA devices, run <command>/etc/init.d/pcmcia
          start</command>.
      </para>
    </sect1>

    <sect1 id="ethernet">
      <title>Enabling Ethernet</title>
      <indexterm><primary>Ethernet</><see>Networking, Ethernet</></>
      <indexterm><primary>Networking</><secondary>Ethernet</></>
      <para>
        <indexterm><primary>ifup</primary></indexterm>
        If your network hardware was detected and your LAN uses DHCP,
        you can simply say <command>ifup eth0</command>.  Your network
        will be activated.
      </para>
      <para>
        <indexterm><primary>/etc/network/interfaces</></>
        If your LAN does not use DHCP, you will need to edit
        <filename>/etc/networking/interfaces</filename>.  You should
        delete the eth0 line and replace it with something along these
        lines:</para>
      <screen>
iface eth0 inet static
    address 192.168.0.4
    netmask 255.255.255.0
    gateway 192.168.0.1
      </screen>
      <para>Then run <command>ifup eth0</command>.  You'll also need
        to edit <filename>/etc/resolv.conf</filename> and add a line
        such as <command>nameserver 192.168.0.1</command> to specify
        your nameserver.  (If you run DHCP, this is usually taken care
        of for you, but you may occasionally need to do it anyway.)
      </para>
      <sect2 id="wireless">
        <title>Wireless Networking</title>
        <indexterm><primary>Networking</><secondary>Wireless</></>
        <indexterm><primary>Wireless</><see>Networking, Wireless</></>
        <para>
          If you are using wireless networking, first make sure that
          your hardware is detected.  Sometimes the device name is not
          eth0; if so, figure out what your device is called.  If your
          network is open -- has no encryption -- you should be able
          to enable your wireless device the same as a wired device.
          Otherwise, you will need to modify
          <filename>/etc/network/interfaces</filename> as described in
          the file
          <filename>/usr/share/doc/wireless-tools/README.Debian</filename> on the live DFS system.
        </para>
      </sect2>

    </sect1>
    
    <sect1 id="dfsboot.ppp">
      <title>Dialup with PPP</title>
      <indexterm><primary>PPP</><see>Networking, PPP</></>
      <indexterm><primary>Networking</><secondary>PPP</></>
      <indexterm><primary>Dial-up</><see>Networking, PPP</></>
      <para>
        To dial-up with ppp, first run <command>pppconfig</> to set up
        your access.  Name your connection "provider".  Now, you can
        use
        <command>pon</command> to connect and <command>poff</command>
        to disconnect.
      </para>
    </sect1>
    
  </chapter>

  <chapter id="install">
    <title>Installation</title>
    <para>
      Installation from DFS involves the following general steps:
    </para>
    <orderedlist>
      <listitem><para>Partitioning</para>
      </listitem>
      <listitem><para>Initialize and mount swap</para>
      </listitem>
      <listitem><para>Formatting and Mounting Filesystems</para>
      </listitem>
      <listitem><para>Installing Base System</para>
        <para>You can do this (assuming you have mounted your new
          partitions at /mnt) with: <command>cdebootstrap sid /mnt
	    file:///opt/packages</command>.  (amd64: add <command>-a
	    amd64</command> before "sid".  Also, I recommend using the
	amd64 mirror directly, since things change frequently and the
	  data available when the CD was made may or may not be usable for
	  you.
	</para>
      </listitem>
      <listitem><para>Configuring Base System</para>
	<para>You should copy your
	  <filename>/etc/resolv.conf</filename> to the new system.
	  Then, configure its
	  <filename>/etc/apt/sources.list</filename>,
          <filename>/etc/fstab</filename>, and
	  <filename>/etc/network/interfaces</filename>.  Then,
	  <filename>chroot /mnt</filename> and:
	</para>
	<orderedlist>
	  <listitem><para><command>apt-get update</command></para>
	  </listitem>
	  <listitem><para>i386: <command>apt-get install module-init-tools
		grub ppp</command></para>
            <para>alpha: <command>apt-get install module-init-tools
                aboot ppp</command></para>
            <para>powerpc: <command>apt-get install module-init-tools
                yaboot ppp</command></para>
	  </listitem>
	  <listitem><para><command>apt-get install</command>
	      appropriate filesystem tools for your chosen filesystem</para>
	  </listitem>
	  <listitem><para>i386: <command>mkdir /boot/grub; cp
                /lib/grub/i386-pc/* /boot/grub</command></para>
                <para>If your /boot is its own partition, also run
                 <command>cd /boot; ln -s . boot</command>.</para>
	    <note><para>
	      amd64 did not have a grub package as of the last check.
	      However, you can simulate it; just 
		<command>mkdir /mnt/boot/grub</command>
	      and copy the files from
		<filename>/lib/grub/i386-pc</filename> on the
	      live CD image to <filename>/boot/grub</filename>
		on your new system.</para>
	    </note>
            <para>alpha: see aboot docs</para>
            <para>powerpc: see yaboot docs</para>

	  </listitem>
	</orderedlist>
      </listitem>
      <listitem><para>Installing Kernel</para>
	<para>If you like the kernel on the DFS CD, you can do this:
	  <command>cd /mnt/root; dpkg-repack
	    linunx-image-2.6.16.4</command>.  Then, <command>chroot
	    /mnt</command> and <command>dpkg -i
	    /root/linux-image-*</command>.
	</para>
      </listitem>
      <listitem><para>Installing Grub</para>
	    <screen>
# grub
grub> root (hd0,0)
grub> setup (hd0)
grub> quit
# update-grub
	    </screen>
	<para>amd64 users: if this doesn't work, try rebooting the DFS
	  cd.  Press "c" when you see the blue Grub menu to get a
	  command line.  Then run the above.</para>
      </listitem>
      <listitem><para>Rebooting into new system</para>
      </listitem>
    </orderedlist>
  </chapter>

  <appendix id="dfsbuild.reference">
    <title>Command Reference</title>
    &man.dfsbuild;
  </appendix>

  <appendix id="dfsbuild.links">
    <title>Links to Related Resources</title>
    <para>
      Here are some links to websites where you may find DFS-related
      resources:
    </para>
    <itemizedlist>
      <listitem><para><ulink
      url="http://people.debian.org/~jgoerzen/dfs">DFS pre-built ISO
      images</ulink></para>
      </listitem>
      <listitem><para>NewsForge article: <ulink
      url="http://www.newsforge.com/article.pl?sid=05/01/10/1727246">Installing
      Debian From Scratch</ulink></para></listitem>
      <listitem><para>Article by Suramya Tomar: <ulink
      url="http://linux.suramya.com/tutorials/Install_DFS/">How to
      Install Debian From Scratch</ulink></para>
      </listitem>
    </itemizedlist>
  </appendix>

</book>

<!--
Local Variables:
mode: sgml
sgml-set-face: T
End:

# arch-tag: top-level whole manual file
-->