summaryrefslogtreecommitdiff
path: root/package/nbd
diff options
context:
space:
mode:
authorVincent Palatin <vincent.palatin_buildroot@m4x.org>2009-11-22 21:18:11 +0100
committerPeter Korsgaard <jacmet@sunsite.dk>2009-11-22 21:18:11 +0100
commit6aac003abf821e220f7d3c6c597c1f0f1dd84a06 (patch)
treef8c350de066dbcce209eaeff63250b2eaa117281 /package/nbd
parent07019b2c13ab85e8bc18128ef2772d090f2d18d5 (diff)
package/nbd: add nbd-server support
Closes #645 Signed-off-by: Vincent Palatin <vincent.palatin_buildroot@m4x.org> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'package/nbd')
-rw-r--r--package/nbd/Config.in16
-rw-r--r--package/nbd/nbd.mk25
2 files changed, 37 insertions, 4 deletions
diff --git a/package/nbd/Config.in b/package/nbd/Config.in
index 788240b66..66c24afa3 100644
--- a/package/nbd/Config.in
+++ b/package/nbd/Config.in
@@ -4,8 +4,22 @@ config BR2_PACKAGE_NBD
help
NBD is a set of utilities to configure network block devices,
allowing access to remote block devices over TCP/IP network.
- Notice: This package only provides the NBD client.
Depends on glib.
http://nbd.sf.net/
+
+if BR2_PACKAGE_NBD
+
+config BR2_NBD_CLIENT
+ bool "nbd client"
+ default y
+ help
+ the client part of NBD.
+
+config BR2_NBD_SERVER
+ bool "nbd server"
+ help
+ the server part of NBD.
+
+endif
diff --git a/package/nbd/nbd.mk b/package/nbd/nbd.mk
index 6a2f6bc6e..df8e16731 100644
--- a/package/nbd/nbd.mk
+++ b/package/nbd/nbd.mk
@@ -10,6 +10,13 @@ NBD_CAT:=$(BZCAT)
NBD_SITE=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/nbd/
NBD_DIR=$(BUILD_DIR)/nbd-$(NBD_VERSION)
+ifeq ($(BR2_NBD_CLIENT),y)
+NBD_TARGET_BINARY+= $(TARGET_DIR)/sbin/nbd-client
+endif
+ifeq ($(BR2_NBD_SERVER),y)
+NBD_TARGET_BINARY+= $(TARGET_DIR)/bin/nbd-server
+endif
+
$(DL_DIR)/$(NBD_SOURCE):
$(call DOWNLOAD,$(NBD_SITE),$(NBD_SOURCE))
@@ -17,7 +24,11 @@ $(NBD_DIR)/.unpacked: $(DL_DIR)/$(NBD_SOURCE)
$(NBD_CAT) $(DL_DIR)/$(NBD_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
touch $@
-$(NBD_DIR)/.configured: $(NBD_DIR)/.unpacked
+$(NBD_DIR)/.patched: $(NBD_DIR)/.unpacked
+ toolchain/patch-kernel.sh $(NBD_DIR) package/nbd/ nbd\*.patch
+ touch $@
+
+$(NBD_DIR)/.configured: $(NBD_DIR)/.patched
(cd $(NBD_DIR); rm -rf config.cache; \
$(TARGET_CONFIGURE_OPTS) \
$(TARGET_CONFIGURE_ARGS) \
@@ -27,6 +38,7 @@ $(NBD_DIR)/.configured: $(NBD_DIR)/.unpacked
--host=$(GNU_TARGET_NAME) \
--build=$(GNU_HOST_NAME) \
--prefix=/usr \
+ --sysconfdir=/etc \
)
touch $@
@@ -37,12 +49,19 @@ $(TARGET_DIR)/sbin/nbd-client: $(NBD_DIR)/nbd-client
cp $< $@
$(STRIPCMD) $@
-nbd: libglib2 $(TARGET_DIR)/sbin/nbd-client
+$(NBD_DIR)/nbd-server: $(NBD_DIR)/.configured
+ $(MAKE) -C $(NBD_DIR) nbd-server
+
+$(TARGET_DIR)/bin/nbd-server: $(NBD_DIR)/nbd-server
+ cp $< $@
+ $(STRIPCMD) $@
+
+nbd: libglib2 $(NBD_TARGET_BINARY)
nbd-source: $(DL_DIR)/$(NBD_SOURCE)
nbd-clean:
- rm -f $(TARGET_DIR)/sbin/nbd-client
+ rm -f $(NBD_TARGET_BINARY)
-$(MAKE) -C $(NBD_DIR) clean
nbd-dirclean: