Useful tools missing from /rescue
Dmitry Morozovsky
marck at rinet.ru
Mon Sep 3 08:02:50 PDT 2007
On Sat, 1 Sep 2007, Julian Stacey wrote:
JS> > I've had to use /rescue recently and felt lack of a few basic tools
JS> > in it, namely pgrep(1), head(1), tail(1), tee(1), and a text filter,
JS> > e.g., sed(1). Well, in fact most functionality of pgrep(1), head(1),
JS> > tail(1), and even tee(1) can be emulated if one has sed(1), but the
JS> > tools are so tiny and convenient that it's a pity not to have them
JS> > all handy during hard times.
JS> >
JS> > In addition, there are chflags and chmod in /rescue, but there's
JS> > no chown in it, so the toolset is a bit incomplete.
JS> >
JS> > Would anyone mind if I add those tools to /rescue? The size growth
JS> > will be rather small:
JS> >
JS> > -r-xr-xr-x 121 root wheel 3715096 1 сен 10:22 /mnt2/rescue.old/rescue
JS> > -r-xr-xr-x 129 root wheel 3761828 1 сен 11:22 /mnt2/rescue/rescue
JS>
JS> Don't do it without approval of re@ (who might be too busy just now
JS> anyway) It might blow the limit on the tight packed rescue floppy.
JS> (& though desk workstations have CDs, lost of small boxes still
JS> just have floppies for rescue) Best try to build a rescue floppy
JS> yourself before adding bloat.
JS>
JS> BTW I've never used pgrep thus superfluous to rescue. Others also
JS> not really needed, merely nice. True rescue is just to fix FS at
JS> which point you can mount other FS or CDROM or NFS etc for more
JS> tools.
What about adding support for zfs then (see below)? I found it especially
useful when you have zfs-on-root and copy /rescue to /bootdisk and symlink bin
and sbin to rescue - this allows emergency management of zfs when booting with
/bootdisk as root.
Trick with -lm seems to be needed because libzfs itself refers to pow(3) - or
did I miss something trivial to resolve this?
Sincerely,
D.Marck [DM5020, MCK-RIPE, DM3-RIPN]
[ FreeBSD committer: marck at FreeBSD.org ]
------------------------------------------------------------------------
*** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck at rinet.ru ***
------------------------------------------------------------------------
Index: Makefile
===================================================================
RCS file: /home/ncvs/src/rescue/rescue/Makefile,v
retrieving revision 1.56
diff -u -r1.56 Makefile
--- Makefile 14 Jul 2007 21:49:22 -0000 1.56
+++ Makefile 31 Aug 2007 11:24:34 -0000
@@ -71,7 +71,7 @@
CRUNCH_PROGS_bin= cat chflags chio chmod cp date dd df echo \
ed expr getfacl hostname kenv kill ln ls mkdir mv pax ps pwd \
realpath rm rmdir setfacl sh stty sync test
-CRUNCH_LIBS+= -lcrypt -ledit -lkvm -ll -lm -ltermcap -lutil
+CRUNCH_LIBS+= -lcrypt -ledit -lkvm -ll -ltermcap -lutil
.if ${MK_OPENSSL} != "no"
CRUNCH_LIBS+= -lcrypto
.endif
@@ -185,5 +185,17 @@
CRUNCH_PROGS_sbin+= dhclient
CRUNCH_BUILDOPTS_dhclient= -DRELEASE_CRUNCH -Dlint
+# zfs-related: zpool and zfs
+.if ${MK_CDDL} != "no" && ${MK_ZFS} != "no"
+CRUNCH_PROGS_sbin+= zfs zpool
+CRUNCH_SRCDIR_zfs= $(.CURDIR)/../../cddl/sbin/zfs
+CRUNCH_SRCDIR_zpool= $(.CURDIR)/../../cddl/sbin/zpool
+CRUNCH_LIBS+= -lzfs -lavl -lnvpair -luutil
+.endif
+
+# XXX libzfs needs pow()
+CRUNCH_LIBS+= -lm
+
##################################################################
# Programs from stock /usr/bin
#
More information about the freebsd-hackers
mailing list