| Depan | Profil | Galeri | Artikel | Tutorial | Humor | Berita Terkini | Info Lowongan Kerja | Cara Cari Uang |
-----------------------------------------------------------------
"Tujuan yang besar memberikan hasil yang besar. Tidak ada tujuan tidak ada hasil apapun, atau menghasilkan tujuan orang lain" (Mark Victor Hansen)

Sep 2, 2008

13 - Customizing the install process

siteXX.tgz file

The OpenBSD install/upgrade scripts allow the selection of a user-created set called "siteXX.tgz", where XX is the release version (e.g. 41). The siteXX.tgz file set is, like the other file sets, a gzip(1) compressed tar(1) archive rooted in '/' and is un-tarred like the other sets with the options xzpf. This set will be installed last, after all other file sets.
This file set allows the user to add to and/or override the files installed in the 'normal' sets and thus customize the installation or upgrade.
You can also create and use hostname-specific install sets, which are named siteXX-.tgz, for example, "site41-puffy.tgz". This allows easy per-host customized installations, upgrades, or disaster recovery.
Some example uses of a siteXX.tgz file:
• Create a siteXX.tgz file that contains all the file changes you made since first installing OpenBSD. Then, if you have to re-create the system you simply select siteXX.tgz during the re-install and all of your changes are replicated on the new system.
• Create a series of machine specific directories that each contain a siteXX.tgz file that contains files specific to those machine types. Installation of machines (e.g. boxes with different graphics cards) of a particular category can be completed by selecting the appropriate siteXX.tgz file.
• Put the files you routinely customize in a same or similar way in a siteXX.tgz file -- /etc/skel files, /etc/pf.conf, /var/www/conf/httpd.conf, /etc/rc.conf.local, etc.
install.site/upgrade.site scripts
As the last step in the install/upgrade process, the scripts look in the root directory of the newly installed/upgraded system for install.site or upgrade.site, as appropriate to the current process, and runs this script in an environment chrooted to the installed/upgraded system's root. Remember, the upgrade is done from a booted file system, so your target file system is actually mounted on /mnt. However, because of the chroot, your script can be written as if it is running in the "normal" root of your file system. Since this script is run after all the files are installed, you have almost full functionality of your system (though, in single user mode) when your script runs.
Note that the install.site script would have to be in a siteXX.tgz file, while the upgrade.site script could be put in the root directory before the upgrade, or could be put in a siteXX.tgz file.
The scripts can be used to do many things:
• Remove files that are installed/upgraded that you don't want present on the system.
• Remove/upgrade/install the packages you want on the installed system.
• Do an immediate backup/archive of the new system before you expose it to the rest of the world.
• Use rdate(8) to set the system time.
The combination of siteXX.tgz and install.site/upgrade.site files is intended to give users broad customization capabilities without having to build their own custom install sets.
Note: if you will be doing your install from an http server, you will need to add your site*.tgz file(s) to the file index.txt in the source directory in order for them to be listed as an option at install time. This is not needed for FTP or other installs.


No comments: