diff options
Diffstat (limited to 'usr.sbin/crunch/examples')
| -rw-r--r-- | usr.sbin/crunch/examples/Makefile | 31 | ||||
| -rw-r--r-- | usr.sbin/crunch/examples/filesystem.conf | 30 | ||||
| -rw-r--r-- | usr.sbin/crunch/examples/fixit.conf | 45 | ||||
| -rw-r--r-- | usr.sbin/crunch/examples/kcopy.conf | 20 | ||||
| -rw-r--r-- | usr.sbin/crunch/examples/really-big.conf | 156 | 
5 files changed, 282 insertions, 0 deletions
| diff --git a/usr.sbin/crunch/examples/Makefile b/usr.sbin/crunch/examples/Makefile new file mode 100644 index 000000000000..24c151438911 --- /dev/null +++ b/usr.sbin/crunch/examples/Makefile @@ -0,0 +1,31 @@ +CRUNCHED=	fixit + +# below is boiler-plate to make $(CRUNCHED) from $(CRUNCHED).conf +# I'd use PROG instead of CRUNCHED, but the system makefiles REALLY want +# to build things in the normal way if you use PROG. + +CONF=	$(CRUNCHED).conf + +OUTMK=	$(CRUNCHED).mk +OUTPUTS= $(OUTMK) $(CRUNCHED).c $(CRUNCHED).cache + +MAN= +CLEANFILES+= $(CRUNCHED) *.o *.lo *.c *.mk *.cache +CLEANDIRFILES+= $(OUTPUTS) + +all: $(CRUNCHED) +exe: $(CRUNCHED) + +$(OUTPUTS): $(CONF) +	MAKE=${MAKE} crunchgen ${.CURDIR}/$(CONF) + +$(CRUNCHED): $(OUTPUTS) submake + +submake: +	${MAKE} -f $(OUTMK) +objs: +	${MAKE} -f $(OUTMK) objs +cleandir: +	rm -f $(CLEANDIRFILES) + +.include <bsd.prog.mk> diff --git a/usr.sbin/crunch/examples/filesystem.conf b/usr.sbin/crunch/examples/filesystem.conf new file mode 100644 index 000000000000..c9a6cf0ce018 --- /dev/null +++ b/usr.sbin/crunch/examples/filesystem.conf @@ -0,0 +1,30 @@ + +srcdirs /usr/src/bin /usr/src/sbin /usr/src/gnu/usr.bin /usr/src/usr.sbin +srcdirs /usr/src/sbin/i386 + +# /bin +progs sh expr ls mkdir rm sync test +ln test [ + +# These are needed because of UN*X's idiotic way of indicating that something +# is a login shell. +ln sh - +ln sh -sh + +# /sbin +progs disklabel init mount newfs reboot umount +ln reboot halt +ln reboot fastboot +ln reboot fasthalt + + +# /usr/bin +progs cpio gzip +ln gzip gunzip +ln gzip gzcat +ln gzip zcat + +# /usr/sbin +progs bad144 + +libs -ll -ledit -ltermcap -lutil -lscrypt diff --git a/usr.sbin/crunch/examples/fixit.conf b/usr.sbin/crunch/examples/fixit.conf new file mode 100644 index 000000000000..7c6539cf8aa5 --- /dev/null +++ b/usr.sbin/crunch/examples/fixit.conf @@ -0,0 +1,45 @@ +# fixit.conf - put in anything we think we might want on a fixit floppy + +# first, we list the source dirs that our programs reside in.  These are +# searched in order listed to find the dir containing each program. + +srcdirs /usr/src/bin /usr/src/sbin /usr/src/usr.bin /usr/src/usr.sbin +srcdirs /usr/src/gnu/usr.bin /usr/src/usr.bin/vi +srcdirs /usr/src/sbin/i386 + +# second, we list all the programs we want to include in our crunched binary. +# The order doesn't matter.  Any program that needs hard links to it gets an +# `ln' directive.   + +# /bin stuff + +progs cat chmod cp date dd df echo ed expr hostname kill ln ls mkdir +progs mt mv pwd rcp rm rmdir sh sleep stty sync test + +ln test [ +ln sh -sh		# init invokes the shell this way + +# /sbin stuff + +progs chown clri disklabel dump dmesg fsck ifconfig init +progs mknod mount newfs ping reboot restore swapon umount +ln dump rdump +ln restore rrestore + +# /usr/bin stuff + +progs ftp sed telnet common find +ln common vi +ln common view +ln common ex + +# gnu stuff + +progs cpio gzip +ln gzip gunzip +ln gzip gzcat + +# finally, we specify the libraries to link in with our binary + +libs -lcrypt -ltelnet -lutil -ll +libs -lcurses -ltermcap -ledit -lkvm diff --git a/usr.sbin/crunch/examples/kcopy.conf b/usr.sbin/crunch/examples/kcopy.conf new file mode 100644 index 000000000000..78e92191fc0a --- /dev/null +++ b/usr.sbin/crunch/examples/kcopy.conf @@ -0,0 +1,20 @@ + +srcdirs /usr/src/bin /usr/src/sbin + +# Programs from bin/ +progs sh cp echo test +ln test [ + +# These are needed because of UN*X's idiotic way of indicating that something +# is a login shell. +ln sh - +ln sh -sh + +# +# Programs from sbin/ +progs mount mount_cd9660 fsck init reboot umount +ln reboot halt +ln reboot fastboot +ln reboot fasthalt + +libs -ll -ledit -ltermcap -lcompat -lutil -lscrypt diff --git a/usr.sbin/crunch/examples/really-big.conf b/usr.sbin/crunch/examples/really-big.conf new file mode 100644 index 000000000000..9c227a7b8d29 --- /dev/null +++ b/usr.sbin/crunch/examples/really-big.conf @@ -0,0 +1,156 @@ +# really-big.conf - just about everything, just for testing. +#	This ends up having some good examples of the use of specials for +#	those hard-to-reach programs.  I stopped when I got tired, but we +#	could probably get even more stuff (like libexec stuff) in here. +# +#       This produces a 4608000 byte binary.  Pretty sick and twisted, eh? +# +# + +# ========================================================================= + +srcdirs /usr/src/bin + +progs cat chmod cp csh date dd df domainname echo ed expr hostname kill +progs ln ls mkdir mt mv ps pwd rcp rm rmail rmdir sh sleep stty sync test + +ln test [ +ln sh -sh + + +# ========================================================================= + +srcdirs /usr/src/sbin + +progs bim clri disklabel dmesg dump dumpfs fsck halt +progs ifconfig init mknod modload modunload mount mount_isofs +progs mount_lofs mount_msdosfs mountd +progs newfs nfsd nfsiod ping quotacheck reboot restore route routed savecore +progs shutdown swapon ttyflags tunefs umount +# shell scripts: fastboot + +ln dump rdump +ln restore rrestore + + +# ========================================================================= + +srcdirs /usr/src/usr.bin + +progs apropos ar asa at basename biff cal calendar cap_mkdb checknr chpass +progs cksum cmp col colcrt colrm column comm compress crontab ctags cut +progs dirname du env error expand false file find finger fmt fold fpr from +progs fsplit fstat ftp getconf getopt gprof head hexdump id indent ipcrm +progs ipcs join kdump ktrace last lastcomm leave lex lock logger locate +progs login logname look m4 machine mail make man mesg mkfifo +progs mkstr modstat more msgs netstat newsyslog nfsstat nice nm nohup +progs pagesize passwd paste patch pr printenv printf quota ranlib +progs renice rev rlogin rpcgen rpcinfo rsh rup ruptime rusers rwall rwho +progs script sed showmount size soelim split strings strip su tail talk +progs tcopy tee telnet tftp time tip tn3270 touch tput tr true tset tsort +progs tty ul uname unexpand unifdef uniq units unvis users uudecode uuencode +progs vacation vgrind vi vis vmstat w wall wc what whatis whereis who +progs whois window write xargs xinstall xstr yacc yes ypcat ypmatch ypwhich + +# shell scripts: lorder mkdep which +# problems: rdist uses libcompat.a(regex.o), which conflicts with  +#           libedit(readline.o) over regerror(). + +# special requirements + +special locate srcdir /usr/src/usr.bin/locate/locate +special tn3270 srcdir /usr/src/usr.bin/tn3270/tn3270 + + +# ========================================================================= + +srcdirs /usr/src/usr.sbin + +progs ac accton amd arp bad144 chown chroot config config.new cron +progs dev_mkdb diskpart edquota flcopy gettable grfinfo hilinfo htable inetd +progs iostat iteconfig kvm_mkdb mtree named portmap pppd +progs pstat pwd_mkdb quot quotaon rarpd rbootd repquota rmt rpc.bootparamd +progs rwhod sa spray sysctl syslogd tcpdump +progs traceroute trpt update vipw vnconfig ypbind yppoll ypset + +special amd srcdir /usr/src/usr.sbin/amd/amd +special amd objs vers.amd.o afs_ops.o am_ops.o clock.o util.o xutil.o efs_ops.o mapc.o info_file.o info_hes.o info_ndbm.o info_passwd.o info_nis.o info_union.o map.o srvr_afs.o srvr_nfs.o mntfs.o misc_rpc.o mount_fs.o mtab.o mtab_bsd.o nfs_ops.o nfs_prot_svc.o nfs_start.o nfs_subr.o opts.o pfs_ops.o rpc_fwd.o sched.o sfs_ops.o amq_svc.o amq_subr.o umount_fs.o host_ops.o nfsx_ops.o ufs_ops.o ifs_ops.o amd.o get_args.o restart.o wire.o + + +srcdirs /usr/src/usr.sbin/lpr		# lpr subsystem +progs lpr lpc lpq lprm pac lptest +special lpr srcdir /usr/src/usr.sbin/lpr/lpr + +srcdirs /usr/src/usr.sbin/sendmail	# sendmail subsystem +progs mailstats makemap praliases sendmail +special sendmail srcdir /usr/src/usr.sbin/sendmail/src +ln sendmail newaliases +ln sendmail mailq + +srcdirs /usr/src/usr.sbin/timed		# timed & timedc +progs timed timedc +special timed srcdir /usr/src/usr.sbin/timed/timed + +srcdirs /usr/src/usr.sbin/xntpd		# NTP subsystem +# xntpd uses a gross hack to pass some information in the global +# variable `progname' between the actual program (ntpdate in this +# case), and the NTP library.  Add `progname' to the keep list. +progs ntpdate +special ntpdate srcdir /usr/src/usr.sbin/xntpd/ntpdate +special ntpdate keep progname +libs -L/usr/src/usr.sbin/xntpd/lib -lntp + +srcdirs /usr/src/usr.sbin/yp		# yp subsystem +progs ypbind ypwhich ypcat ypmatch ypset yppoll + + +# ========================================================================= + +srcdirs /usr/src/gnu/usr.bin + +progs bc cpio diff diff3 gas gawk grep gzip sdiff sort tar + +srcdirs /usr/src/gnu/usr.bin/ld		# ldd and ldconfig +progs ld ldd ldconfig + +# rcs stuff loses because there are cross dependencies between librcs.a and +# the individual programs.  The solution would be to specify the objpaths +# directly for each one, and include the full path to librcs.a each the +# objpaths. + +# srcdirs /usr/src/gnu/usr.bin/rcs	# rcs subsystem +# progs ci co ident merge rcs rcsclean rcsdiff rcsmerge rlog +# # shell script: rcsfreeze +# special rcs srcdir /usr/src/gnu/usr.bin/rcs/rcs +# libs /usr/src/gnu/usr.bin/rcs/lib/obj/librcs.a + +# gdb loses too +# progs gdb +# special gdb srcdir /usr/src/gnu/usr.bin/gdb/gdb +# libs /usr/src/gnu/usr.bin/gdb/bfd/obj/libbfd.a +# libs /usr/src/gnu/usr.bin/gdb/readline/obj/libreadline.a +# libs /usr/src/gnu/usr.bin/gdb/libiberty/obj/libiberty.a + +# groff has the same problem as rcs +# srcdirs /usr/src/gnu/usr.bin/groff	# groff subsystem +# progs groff troff tbl pic eqn grops grotty grodvi refer lookbib +# progs indxbib lkbib tfmtodit addftinfo pfbtops psbb +# shell script: nroff +# special groff srcdir /usr/src/gnu/usr.bin/groff/groff +# libs /usr/src/gnu/usr.bin/groff/libgroff/obj/libgroff.a +# libs /usr/src/gnu/usr.bin/groff/libbib/obj/libbib.a +# libs /usr/src/gnu/usr.bin/groff/libdriver/obj/libdriver.a + +srcdirs /usr/src/gnu/usr.bin/gcc2	# gcc & friends +progs cc cpp cc1 + +# cc1 has the same problem as rcs and groff, but since there's only one program +# I'll go ahead and solve it as an example. + +special cc1 objpaths /usr/src/gnu/usr.bin/gcc2/cc1/obj/c-parse.o /usr/src/gnu/usr.bin/gcc2/cc1/obj/c-lang.o /usr/src/gnu/usr.bin/gcc2/cc1/obj/c-lex.o /usr/src/gnu/usr.bin/gcc2/cc1/obj/c-pragma.o /usr/src/gnu/usr.bin/gcc2/cc1/obj/c-decl.o /usr/src/gnu/usr.bin/gcc2/cc1/obj/c-typeck.o /usr/src/gnu/usr.bin/gcc2/cc1/obj/c-convert.o /usr/src/gnu/usr.bin/gcc2/cc1/obj/c-aux-info.o /usr/src/gnu/usr.bin/gcc2/cc1/obj/c-iterate.o /usr/src/gnu/usr.bin/gcc2/common/obj/libcc1.a + +ln gzip gunzip +ln gzip gzcat + +libs -ledit -lgnumalloc -lc -lcrypt -ltermcap -lcurses -ltelnet -lutil -lkvm  +libs -ll -ly -lm -lresolv -lrpcsvc -lcompat | 
