1884c25d1SGordon TetlowThe /rescue build system here has three goals: 2884c25d1SGordon Tetlow 3884c25d1SGordon Tetlow1) Produce a reliable standalone set of /rescue tools. 4884c25d1SGordon Tetlow 5884c25d1SGordon TetlowThe contents of /rescue are all statically linked and do not depend on 6884c25d1SGordon Tetlowanything in /bin or /sbin. In particular, they'll continue to 7884c25d1SGordon Tetlowfunction even if you've hosed your dynamic /bin and /sbin. For 8884c25d1SGordon Tetlowexample, note that /rescue/mount runs /rescue/mount_nfs and not 9884c25d1SGordon Tetlow/sbin/mount_nfs. This is more subtle than it looks. 10884c25d1SGordon Tetlow 11884c25d1SGordon TetlowAs an added bonus, /rescue is fairly small (thanks to crunchgen) and 12884c25d1SGordon Tetlowincludes a number of tools (such as gzip, bzip2, vi) that are not 13884c25d1SGordon Tetlownormally found in /bin and /sbin. 14884c25d1SGordon Tetlow 15884c25d1SGordon Tetlow2) Demonstrate robust use of crunchgen. 16884c25d1SGordon Tetlow 17884c25d1SGordon TetlowThese Makefiles recompile each of the crunchgen components and include 18884c25d1SGordon Tetlowsupport for overriding specific library entries. Such techniques 19*8cb0af95SEitan Adlershould be useful elsewhere. 20884c25d1SGordon Tetlow 21884c25d1SGordon Tetlow3) Produce a toolkit suitable for small distributions. 22884c25d1SGordon Tetlow 23884c25d1SGordon TetlowInstall /rescue on a CD or CompactFlash disk, and symlink /bin and 24884c25d1SGordon Tetlow/sbin to /rescue to produce a small and fairly complete FreeBSD 25884c25d1SGordon Tetlowsystem. 26884c25d1SGordon Tetlow 27884c25d1SGordon TetlowThese tools have one big disadvantage: being statically linked, they 28884c25d1SGordon Tetlowcannot use some advanced library functions that rely on dynamic 29*8cb0af95SEitan Adlerlinking. In particular, nsswitch, locales, and pam all 30*8cb0af95SEitan Adlerrely on dynamic linking. 31884c25d1SGordon Tetlow 32884c25d1SGordon Tetlow 33884c25d1SGordon TetlowTo compile: 34884c25d1SGordon Tetlow 35884c25d1SGordon Tetlow# cd /usr/src/rescue 36884c25d1SGordon Tetlow# make obj 37884c25d1SGordon Tetlow# make 38884c25d1SGordon Tetlow# make install 39884c25d1SGordon Tetlow 40884c25d1SGordon TetlowNote that rebuilds don't always work correctly; if you run into 41884c25d1SGordon Tetlowtrouble, try 'make clean' before recompiling. 42