From eb4e4048682c6c06b894fdb6ff9d7c32c3646ae5 Mon Sep 17 00:00:00 2001 From: Yaroslav Tykhiy Date: Sat, 27 Oct 2007 18:18:58 +0000 Subject: [PATCH] Add some essential tools to rescue(8) in order to make it a versatile emergency tool: o sed(1) as a multi-purpose text filter -- can do grep's job and much more. o head(1), tail(1), and tee(1) as idiomatic text filters. o mt(1) to control tape drives (PR misc/98383). o chown(8) aka chgrp(8) to complement the ch* subset. o pkill(1) aka pgrep(1) to control running processes easily and thus to be able to recover from a serious problem or a fatal typo in an otherwise live system w/o a reboot. (It also deserves adding to rescue(8) for its having triggered a latent bug in crunchgen(1), but we had better add a regression test for that. :-) The resulting change in rescue(8) size has the following order of magnitude on i386: 3787656 - 3727872 = 59784, i.e. just a tad. Discussed on: -hackers (I seem to have wearied all opponents :-) PR: misc/98383 --- rescue/rescue/Makefile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/rescue/rescue/Makefile b/rescue/rescue/Makefile index e0c05be2c4f6..859e778a99c5 100644 --- a/rescue/rescue/Makefile +++ b/rescue/rescue/Makefile @@ -85,6 +85,10 @@ CRUNCH_ALIAS_ln= link CRUNCH_ALIAS_rm= unlink CRUNCH_ALIAS_ed= red +CRUNCH_PROGS_bin+= pkill +CRUNCH_SRCDIR_pkill= ${.CURDIR}/../../usr.bin/pkill +CRUNCH_ALIAS_pkill= pgrep + .if ${MK_RCMDS} != "no" CRUNCH_PROGS_bin+= rcp .endif @@ -190,6 +194,8 @@ CRUNCH_BUILDOPTS_dhclient= -DRELEASE_CRUNCH -Dlint # CRUNCH_SRCDIRS+= usr.bin +CRUNCH_PROGS_usr.bin= head mt sed tail tee + CRUNCH_PROGS_usr.bin+= gzip CRUNCH_ALIAS_gzip= gunzip gzcat zcat @@ -211,7 +217,10 @@ CRUNCH_ALIAS_id= groups whoami # CRUNCH_SRCDIRS+= usr.sbin -CRUNCH_PROGS_usr.sbin+= chroot +CRUNCH_PROGS_usr.sbin= chroot + +CRUNCH_PROGS_usr.sbin+= chown +CRUNCH_ALIAS_chown= chgrp ################################################################## # The following is pretty nearly a generic crunchgen-handling makefile