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 19884c25d1SGordon Tetlowshould be useful elsewhere. For example, boot floppies could use this 20884c25d1SGordon Tetlowto conditionally compile out features to reduce executable size. 21884c25d1SGordon Tetlow 22884c25d1SGordon Tetlow3) Produce a toolkit suitable for small distributions. 23884c25d1SGordon Tetlow 24884c25d1SGordon TetlowInstall /rescue on a CD or CompactFlash disk, and symlink /bin and 25884c25d1SGordon Tetlow/sbin to /rescue to produce a small and fairly complete FreeBSD 26884c25d1SGordon Tetlowsystem. 27884c25d1SGordon Tetlow 28884c25d1SGordon TetlowThese tools have one big disadvantage: being statically linked, they 29884c25d1SGordon Tetlowcannot use some advanced library functions that rely on dynamic 30884c25d1SGordon Tetlowlinking. In particular, nsswitch, locales, and pam are likely to all 31884c25d1SGordon Tetlowrely on dynamic linking in the near future. 32884c25d1SGordon Tetlow 33884c25d1SGordon Tetlow 34884c25d1SGordon TetlowTo compile: 35884c25d1SGordon Tetlow 36884c25d1SGordon Tetlow# cd /usr/src/rescue 37884c25d1SGordon Tetlow# make obj 38884c25d1SGordon Tetlow# make 39884c25d1SGordon Tetlow# make install 40884c25d1SGordon Tetlow 41884c25d1SGordon TetlowNote that rebuilds don't always work correctly; if you run into 42884c25d1SGordon Tetlowtrouble, try 'make clean' before recompiling. 43884c25d1SGordon Tetlow 44884c25d1SGordon Tetlow$FreeBSD$ 45