On Mon, Jan 28, 2013 at 06:05:00PM +0100, David Sterba wrote: > On Sat, Jan 26, 2013 at 01:09:47AM +0100, Ian Kumlien wrote: > > Sometimes, when you least expect it, a static binary is what you need to > > rescue your data... Or just get a good enough handle on things to make > > it work again ;) > > > > "make static" is a gift to you, dear user with filesystem problems! > > Adding the build target does not cost us anything. The result depends on the > distro and set of the needed libraries provided for a static build. Even > the basic 'btrfs' too needs uuid (due to cmds-receive) and I don't have > it in my distro. The other utilities may need static zlib or lzo > (restore) or libblkid (mkfs.btrfs).
Yes, this is all part of the static package... > I tried to build 'btrfs' only and moved the static libs definition to > the beginning (still needs the uuid static library though): Which you haven't included - you sould also include btrfsck at bare minimum ;) > --- a/Makefile > +++ b/Makefile > @@ -19,6 +19,7 @@ prefix ?= /usr/local > bindir = $(prefix)/bin > LIBS=-luuid -lm > RESTORE_LIBS=-lz > +STATIC_LIBS= -lpthread > > progs = btrfsctl mkfs.btrfs btrfs-debug-tree btrfs-show btrfs-vol btrfsck \ > btrfs btrfs-map-logical btrfs-image btrfs-zero-log btrfs-convert \ > @@ -117,4 +118,9 @@ install: $(progs) install-man > $(INSTALL) -m755 -d $(DESTDIR)$(bindir) > $(INSTALL) $(progs) $(DESTDIR)$(bindir) > > +static: CFLAGS += -static > +static: LIBS = $(STATIC_LIBS) I think you mean += since this will not build since it misses libuuid If you don't have the libs to do a static build - that is one thing but it should work =) > +static: version btrfs -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html