Solaris boot archive

来源:互联网 发布:玻璃尺寸计算软件 编辑:程序博客网 时间:2024/04/27 05:30
The boot archive is a compressed version of Solaris including all of the drivers it need to boot the kernel on your machine. Once the kernel is booted, it can then access the filesystem directly, and continue booting. It therefore needs to have all of the drivers for your devices inside it. The boot archive is a single file for each architecture. On x64 systems you will see 2 boot archives being created, in case the system needs to be booted in 32-bit mode. The rebuild is triggered if Solaris things that it needs to make changes to the boot archive in order to successfully boot the system then next time it comes up.

The boot archive is Solaris' equivalent of the "initrd" that many Linux distributions used to use. (Many now use the initramfs which is more efficient).

To update the boot archive manually, run the following command as root:

bootadm update-archive

(Note also that it's a dash and not underscore.)

This is often useful after doing something (such as a reboot after
installing new kernel parts) that may have delayed effects.  You can
use "-vn" if you're curious about what things might be triggering it
to run, but note that you'll need to ignore a bunch of bogus "cannot
find" messages the tool emits in that mode.

Why Solaris boot-archive is much larger than Linux initrd?
=============================================

With recent opensolaris releases, there are two boot_archive
files, one for 32-bit kernel modules, and another one for 64-bit
kernel module. (Before that change, both 32- and 64-bit kernel
modules were written to a single big boot_archive).

If you have /usr/bin/mkisofs installed, the two boot_archive files
have a size of 25 - 30 MB:

# ls -lh /platform/i86pc/boot_archive /platform/i86pc/amd64/boot
_archive
-rw-r--r--   1 root     root         28M May 14 18:42 /platform/i86pc/amd64/boot_archive
-rw-r--r--   1 root     root         26M May 14 18:42 /platform/i86pc/boot_archive


If you don't have /usr/bin/mkisofs installed, the boot archives are
*much* bigger (~ 100MB), and contain an ufs filesystem with lots
of unused space (the /boot/solaris/bin/create_ramdisk script does
not know how well the driver binaries compress, the size estimate
for the ufs boot archive filesystem image is way too big).

Linux is a static OS while Solaris is fully dynamic loaded since ~ 1992.
People on Linux used to hand craft kernels that contain everything to mount the
root fs. People on Solaris never did this and thus may not know the complete
list.

For this reason, _all_ possible drivers for mounting the root filesystem
appear in the boot archive.

In theory, you could create a hand crafted archive that only contains what your
machine needs.

What triggers these recreations exactly ?
================================

Whenever a file from the list of files / directories
contained in /boot/solaris/filelist.ramdisk has changed.
For directories from the filelist.ramdisk (like "kernel")
this extends to all files below that directory.

Typical examples that trigger an out-of-sync boot_archive:

- hotplugging devices: changes etc/path_to_inst
- switching to / from daylight saving time: changes etc/rtc_config
- installing or removing device drivers: changes files under
 kernel or platform/xxx/kernel
- use of "eeprom x=y": changes boot/solaris/bootenv.rc