1117035SgordonThe /rescue build system here has three goals: 2117035Sgordon 3117035Sgordon1) Produce a reliable standalone set of /rescue tools. 4117035Sgordon 5117035SgordonThe contents of /rescue are all statically linked and do not depend on 6117035Sgordonanything in /bin or /sbin. In particular, they'll continue to 7117035Sgordonfunction even if you've hosed your dynamic /bin and /sbin. For 8117035Sgordonexample, note that /rescue/mount runs /rescue/mount_nfs and not 9117035Sgordon/sbin/mount_nfs. This is more subtle than it looks. 10117035Sgordon 11117035SgordonAs an added bonus, /rescue is fairly small (thanks to crunchgen) and 12117035Sgordonincludes a number of tools (such as gzip, bzip2, vi) that are not 13117035Sgordonnormally found in /bin and /sbin. 14117035Sgordon 15117035Sgordon2) Demonstrate robust use of crunchgen. 16117035Sgordon 17117035SgordonThese Makefiles recompile each of the crunchgen components and include 18117035Sgordonsupport for overriding specific library entries. Such techniques 19117035Sgordonshould be useful elsewhere. For example, boot floppies could use this 20117035Sgordonto conditionally compile out features to reduce executable size. 21117035Sgordon 22117035Sgordon3) Produce a toolkit suitable for small distributions. 23117035Sgordon 24117035SgordonInstall /rescue on a CD or CompactFlash disk, and symlink /bin and 25117035Sgordon/sbin to /rescue to produce a small and fairly complete FreeBSD 26117035Sgordonsystem. 27117035Sgordon 28117035SgordonThese tools have one big disadvantage: being statically linked, they 29117035Sgordoncannot use some advanced library functions that rely on dynamic 30117035Sgordonlinking. In particular, nsswitch, locales, and pam are likely to all 31117035Sgordonrely on dynamic linking in the near future. 32117035Sgordon 33117035Sgordon 34117035SgordonTo compile: 35117035Sgordon 36117035Sgordon# cd /usr/src/rescue 37117035Sgordon# make obj 38117035Sgordon# make 39117035Sgordon# make install 40117035Sgordon 41117035SgordonNote that rebuilds don't always work correctly; if you run into 42117035Sgordontrouble, try 'make clean' before recompiling. 43117035Sgordon 44117035Sgordon$FreeBSD$ 45