DEVFS - rollup - Userland, nrelease, and installer
[dragonfly.git] / nrelease / root / README
1                             DRAGONFLY CDROM README FILE
2
3     This CDROM boots DragonFly BSD.  Basically what you get is a full base
4     system on CD with certain critical directories, such as /tmp, remounted
5     read-write using MFS.  Your existing hard drive is not affected by
6     booting this CDROM.
7
8     NOTE!!! DRAGONFLY IS UNDERGOING DEVELOPMENT AND IS CONSIDERED
9     EXPERIMENTAL!  BSD RELATED EXPERIENCE IS RECOMMENDED WHEN USING
10     THIS CDROM.
11
12     If you just want to play with DragonFly and not mess with your hard disk,
13     this CDROM boots into a fully operational console-based system, though
14     without swap it should be noted that you are limited by available memory.
15     It is a good idea to test your hardware for compatibility from a CD boot
16     before spending time installing the dist on your hard disk.
17
18
19                             AUTOMATIC INSTALLATION
20
21     There are currently two installation tools available - the installer, and
22     rconfig.
23
24     The installer can be run with a text-based (curses) user interface
25     from the serial console or a VTY, and provides a straightforward method
26     for installing DragonFly on your HD.  To start it, just login with the
27     username 'installer'.
28
29     The installer can also be run with a web-based (CGI) user interface.
30     To set this up manually is a bit of work, but much of it can be automated
31     by writing a couple of lines into a configuration file on a floppy disk
32     or USB pendrive, and inserting or attaching that to the computer before
33     booting the CDROM.  See the file /etc/defaults/pfi.conf for more info.
34
35     rconfig is a client/server protocol which requires a server (typically on
36     the same network).  An example server setup can be found in
37     /usr/share/examples/rconfig.  If you have multiple machines you can setup
38     an installation script and run rconfig on a server and then install the
39     clients from CD boot with network connectivity (e.g. dhclient <blah>)
40     and then, typically, 'rconfig -a'.
41
42     You can also just boot from the CD, login as 'root' to get a shell
43     prompt, copy the sample script to /tmp, edit, and run it directly
44     (assuming that blowing away your existing disk is ok).
45
46
47                                   CONSOLE OPERATION
48
49     The second stage boot (boot2) and third stage boot (loader) default
50     to dual serial & video console I/O.  The system will also throw a login
51     prompt up on ttyd0 by default.  You can direct the boot output
52     to just the serial port by creating the file /boot.config with the
53     line '-h', or to just the screen using '-V'.  If you wish to leave
54     boot2 in dual I/O mode but want the third stage to use just one or the
55     other, you can set the 'console' environment variable in /boot/loader.conf
56     to either 'console=vidconsole' or 'console=comconsole'.
57
58     The dual serial port operation might have to be disabled if you use
59     the serial port for things like UPSs.  Also note that by default
60     the CD will run a login prompt on the serial port after booting is
61     complete.  This can be disabled by editing the 'ttyd0' line in /etc/ttys
62     after installation is complete.
63
64     Note that the kernel itself currently only supports one console or the
65     other.  If both are enabled, the kernel will use the video console or
66     the last one for which input was received.
67
68
69                                 MANUAL INSTALLATION
70
71     Manual installation of DragonFly onto an HD involves the following sequence
72     of commands.  You must be familiar with BSD style UNIX systems to do
73     installations manually.  The primary IDE hard drive is typically 'ad0'
74     and DragonFly is typically installed onto the first free slice
75     (ad0s1 if disk is empty, ad0s2 if your first slice contains
76     another OS, etc).  Be careful to substitute the correct partition name
77     in the steps below.
78
79         # OPTIONAL STEP: If your disk is already partitioned and you
80         # have a spare primary partition on which you want to install
81         # Dragonfly, skip this step.  However, sometimes old boot
82         # blocks or cruft in the boot area can interfere with the
83         # initialization process.  A cure is to zero out the start of
84         # the disk before running fdisk.
85         #
86         # WARNING: This COMPLETELY WIPES and repartitions your hard drive.
87         #
88         dd if=/dev/zero of=/dev/ad0 bs=32k count=16
89         fdisk -I ad0
90         fdisk -B ad0
91
92         # If you didn't zero the disk as above, but have a spare slice
93         # whose partition type you want to change to UFS, use fdisk(8).
94
95         # This installs boot blocks onto the HD and verifies their 
96         # installation.  See note just above the 'reboot' below for
97         # things to try if it does not boot from your HD.  If you
98         # already have a multi-OS bootloader installed you can skip
99         # this step.
100         #
101         boot0cfg -B ad0
102         boot0cfg -v ad0
103
104         # This creates an initial label on the chosen slice of the HD.  If
105         # you have problems booting you could try wiping the first 32 blocks
106         # of the slice with dd and then reinstalling the label.  Replace
107         # 'ad0s1' with the chosen slice.
108         #
109         # dd if=/dev/zero of=/dev/ad0s1 bs=32k count=16
110         disklabel -B -r -w ad0s1 auto
111
112         # Edit the label.  Create various standard partitions.  The typical
113         # configuration is:
114         #
115         #       ad0s1a  256m            This will be your /
116         #       ad0s1b  1024m           This will be your swap
117         #       ad0s1c                  (leave alone)
118         #       ad0s1d  256m            This will be your /var
119         #       ad0s1e  256m            This will be your /tmp
120         #       ad0s1f  8192m           This will be your /usr (min 4096m)
121         #       ad0s1g  *               All remaining space to your /home
122         #
123         # An example disklabel can be found in /etc/disklabel.ad0s1.
124         #
125         disklabel -e ad0s1
126
127         # Newfs (format) the various filesystems.  Softupdates is not 
128         # normally enabled on the root filesystem because large kernel or
129         # world installs/upgrades can run it out of space due to softupdate's
130         # delayed bitmap freeing code.
131         #
132         newfs /dev/ad0s1a
133         newfs -U /dev/ad0s1d
134         newfs -U /dev/ad0s1e
135         newfs -U /dev/ad0s1f
136         newfs -U /dev/ad0s1g
137
138         # Mount the filesystems.
139         #
140         mount /dev/ad0s1a /mnt
141         mkdir /mnt/var
142         mkdir /mnt/tmp
143         mkdir /mnt/usr
144         mkdir /mnt/home
145         mount /dev/ad0s1d /mnt/var
146         mount /dev/ad0s1e /mnt/tmp
147         mount /dev/ad0s1f /mnt/usr
148         mount /dev/ad0s1g /mnt/home
149
150         # Copy the CDRom onto the target.  cpdup won't cross mount boundaries
151         # on the source (e.g. the MFS remounts) so it takes a few commands.
152         #
153         # Note that /etc contains the config files used for booting from the
154         # CDROM itself, and /etc.hdd contains those for booting off a
155         # hard disk.  So it's the latter that you want to copy to /mnt/etc.
156         #
157         cpdup / /mnt
158         cpdup /var /mnt/var
159         cpdup /etc.hdd /mnt/etc
160         cpdup /dev /mnt/dev
161         cpdup /usr /mnt/usr
162
163         # Cleanup.  Also, with /tmp a partition it is usually reasonable
164         # to make /var/tmp a softlink to /tmp.
165         #
166         chmod 1777 /mnt/tmp
167         rm -rf /mnt/var/tmp
168         ln -s /tmp /mnt/var/tmp
169
170         # Edit /mnt/etc/fstab to reflect the new mounts.  An example fstab
171         # file based on the above parameters exists as /mnt/etc/fstab.example
172         # which you can rename to /mnt/etc/fstab.
173         #
174         mv /mnt/etc/fstab.example /mnt/etc/fstab
175         vi /mnt/etc/fstab
176
177         # Save out your disklabel just in case.  It's a good idea to save
178         # it to /etc so you can get at it from your backups.  You do intend
179         # to backup your system, yah? :-)  (This isn't critical but it's a
180         # good idea).
181         # 
182         disklabel ad0s1 > /mnt/etc/disklabel.ad0s1
183
184
185                         MISC CLEANUPS BEFORE REBOOTING
186
187     Once you've duplicated the CD onto your HD you have to make some edits
188     so the system boots properly from your HD.  Primarily you must remove
189     or edit /mnt/boot/loader.conf, which exists on the CD to tell the kernel
190     to mount the CD's root partition.
191
192         # Remove or edit /mnt/boot/loader.conf so the kernel does not try
193         # to obtain the root filesystem from the CD, and remove the other
194         # cruft that was sitting on the CD that you don't need on the HD.
195         #
196         rm /mnt/boot/loader.conf
197         rm /mnt/README* /mnt/autorun* /mnt/index.html /mnt/dflybsd.ico
198         rm /mnt/boot.catalog
199         rm -r /mnt/rr_moved
200
201     At this point it should be possible to reboot.  The CD may be locked
202     since it is currently mounted.  To remove the CD, type 'halt' instead
203     of 'reboot', wait for the machine to halt, then the CD door should be
204     unlocked.  Remove the CD and hit any key to reboot.
205
206     Be careful of the CD drawer closing on you if you try to remove the CD
207     while the machine is undergoing a reboot or reset.
208
209     WARNING: Do not just hit reset; the kernel may not have written out
210     all the pending data to your HD.  Either unmount the HD partitions
211     or type halt or reboot.
212
213         # halt
214         (let the machine halt)
215         (remove CD when convenient, be careful of the CD drawer closing on you)
216         (hit any key to reboot)
217
218
219                                     THE ACPI ISSUE
220
221     You will notice in the boot menu that you can choose to boot with or 
222     without ACPI.  ACPI is an infrastructure designed to allow an operating
223     system to configure hardware devices associated with the system.
224     Unfortunately, as usual, PC BIOS makers have royally screwed up the
225     standard and ACPI is as likely to hurt as it is to help.  Worse, some
226     PCs cannot be booted without it, so there is no good 'default' choice.
227
228     The system will use ACPI by default.  You can disable it in the default
229     boot by adding the line 'hint.acpi.0.disabled=1' in /boot/loader.conf.
230     If you boot without hitting any menu options the system will boot without
231     ACPI.  To boot without ACPI no matter what, place 'unset acpi_load' in
232     our /boot/loader.conf instead.  This is not recommended.
233
234
235                         IF YOU HAVE PROBLEMS BOOTING FROM HD
236
237     There are a couple of things to try.  Try booting from the CD again and
238     use boot0cfg to turn off packet mode (boot0cfg -o nopacket ad0).  If you
239     can select CHS or LBA mode in your BIOS, try changing the mode to LBA.
240     Also try booting with and without ACPI (option 1 or 2 in the boot menu).
241
242     Once you have a working HD based system you can clean up /etc/rc.conf
243     to enable things like cron, sendmail, setup your networking, and so
244     forth.  If 'ifconfig' does not show your networking device you could
245     try to kldload it from /modules.  With a recognized network device
246     you can ifconfig its IP address or, if you have a DHCP server on your
247     network, use 'dhclient <interfacename>' to obtain an IP address from
248     the network.
249
250
251             USING GIT TO OBTAIN A SOURCE TREE AND DOING BUILDWORLDS
252
253     Instructions on how to obtain and maintain DragonFly source code using
254     git are in the development(7) manual page.
255
256     To upgrade a DragonFly system from sources you run the following
257     sequence:
258
259     cd /usr/src
260     make buildworld
261     make buildkernel KERNCONF=<KERNELNAME>
262     make installkernel KERNCONF=<KERNELNAME>
263     make installworld
264
265     You will also want to run the 'upgrade' target to upgrade your /etc
266     and the rest of your system.  The upgrade target is aware of stale
267     files created by older DragonFly installations and should delete them
268     automatically.
269
270     make upgrade
271
272     See the build(7) manual page for further information.
273
274     Once you've done a full build of the world and kernel you can do
275     incremental upgrades of either by using the 'quickworld' and
276     'quickkernel' targets instead of 'buildworld' and 'buildkernel'.  If
277     you have any problems with the quick targets, try updating your repo
278     first, and then a full buildworld and buildkernel as shown above, before
279     asking for help.
280
281
282                 OBTAINING A PKGSRC TREE TO BUILD/INSTALL PACKAGES
283
284     In order to obtain a reasonably current snapshot of the pkgsrc tree, use
285     the tarball from NetBSD:
286
287     fetch -o /tmp/pkgsrc.tar.gz ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc.tar.gz
288     cd /usr; tar -xzf /tmp/pkgsrc.tar.gz; chown -R root:wheel pkgsrc
289
290     This tree can then be kept up to date with cvs update:
291
292     cd /usr/pkgsrc; cvs up
293
294
295                         EMERGENCY RECOVERY FROM THE CD
296
297     Lets say you blew up your kernel or something else in / and you need to
298     boot the CD to fix it.  Remember that you have a fully operational 
299     system when booting the CD, but that you have to fsck and mount your
300     hard drive (typically onto /mnt) to get at the contents of your HD.
301
302     Your HD is typically an IDE hard drive, so the device is typically
303     /dev/ad0.  DragonFly is typically on the first slice, which is
304     /dev/ad0s1, and the root partition is always in partition 'a',
305     which is /dev/ad0s1a.
306
307     # fsck root before trying to mount it.  
308     fsck /dev/ad0s1a
309     # mount root read-write onto /mnt
310     mount /dev/ad0s1a /mnt
311     # copy files from the CD as appropriate to make it possible to boot
312     # from your HD again.  Note that /mnt/kernel may be flags-protected.
313     chflags noschg /mnt/kernel
314     cp /kernel /mnt/kernel
315     cp /modules/* /mnt/modules/
316
317     If you want to mount other partitions from your HD but have forgotten
318     what they are, simply cat /mnt/etc/fstab after mounting the root
319     partition.
320
321 $DragonFly: src/nrelease/root/README,v 1.22 2006/10/24 17:09:45 swildner Exp $
322