Rebuilding the System

1. Rebuilding World

The easiest way is to rebuild "world". It will rebuild and install the operating system, as well as all the utilities.

$ su
# cd /usr/src
# make world

That will create the necessary .depend files and library Makefiles; and then, proceed to install the new includes, build and install the new libraries; and then, rebuild the system (servers, drivers, and kernel), install it as a new image, and build and install the commands, with the new libraries.

"Make world" does nothing with the 'etc files'. Sometimes, it might be necessary to get new or updated etc files. There is no automated procedure for that, though. Compare files in src/etc and /etc, and see if any updates have happened. Especially, an outdated /etc/system.conf (or, /etc/drivers.conf) file can cause all sorts of problems.

In some instances, commands will have been updated, in order to make the new compiling work. Therefore, if make world fails unexpectedly, try going to /usr/src/commands, and running make install there. Then, go back to /usr/src, and make world, again.

2. Rebuilding the OS and Libraries

This will rebuild the kernel, drivers, servers, etc. It also will rebuild the libraries.

Type:

$ su
# cd /usr/src/tools
# make depend
# make fresh
# make libraries install

If changes were made to the process tables in the kernel and/or the servers, commands that read the process table directly from memory will fail after installing the new boot image. In particular, ps almost certainly will experience segmentation faults after such changes. It is recommended to make install in /usr/src/commands (or, to make world), in that case.

3. Rebuilding the OS (Kernel and Services)

<!> In general, you should follow the process in "Rebuilding the OS and Libraries", because you probably will want to rebuild the libraries, as well. If your build breaks when you follow this process, it likely is due to out-of-date libraries.

Backup! It's a good idea to back up your old (usable) boot image before clobbering it with a new image. A simple method of doing that is going to /boot/image, and copying your old image to oldname.stable. If your new kernel doesn't work, you can boot your old kernel instead, and repair problems.

Below is the process to update the MINIX kernel.

Note: comments start with # symbols, and stop at the end of the line (but, a # in the left-most column actually is the super-user prompt).
Run these commands, in order, to build your modified kernel:

$ su
# cd /usr/src/tools
# make clean
# make install

4. Rebuilding the Kernel Only

<!> In general, you should follow the process in "Rebuilding the OS and Libraries".

$ su
# cd /usr/src/tools   # this directory contains tools that make creating and installing the kernel easier
# make hdboot         # this installs the kernel to your hard disk

5. Other Build Targets

Type

$ cd /usr/src/tools
$ make

to see the various options available.

Now, make a new bootable image by typing:

$ cd /usr/src/tools
$ make image

6. Making a Boot Floppy

If you have a legacy floppy disk drive, you can make a bootable floppy for use later by inserting a formatted floppy, and typing:

$ su
# make fdboot

When you are asked to complete the path, type:

fd0

That approach currently does not work with USB floppies because there is no MINIX 3 USB floppy disk driver yet.

MinixWiki: DevelopersGuide/RebuildingSystem (last edited 2010-01-27 12:48:45 by GregKing)