Commit a8c92e80 authored by Eric Andersen's avatar Eric Andersen
Browse files

add support for dmraid soft raid handling

parent b6de822b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ source "package/dialog/Config.in"
source "package/directfb/Config.in"
source "package/distcc/Config.in"
source "package/dm/Config.in"
source "package/dmraid/Config.in"
source "package/dnsmasq/Config.in"
source "package/dropbear/Config.in"
source "package/ethtool/Config.in"
+5 −0
Original line number Diff line number Diff line
config BR2_PACKAGE_DMRAID
	bool "dmraid"
	default n
	help
	  Device-Mapper Software RAID support tool/
+65 −0
Original line number Diff line number Diff line
#############################################################
#
# dmraid
#
#############################################################

DMRAID_VERSION=1.0.0.rc10
DMRAID_SOURCE:=dmraid-$(DMRAID_VERSION).tar.bz2
DMRAID_SITE:=http://people.redhat.com/~heinzm/sw/dmraid/src
DMRAID_DIR:=$(BUILD_DIR)/dmraid/$(DMRAID_VERSION)
DMRAID_CAT:=bzcat
DMRAID_BINARY:=dmraid
DMRAID_STAGING_BINARY:=$(DMRAID_DIR)/STAGING_DIR)/tools/$(DMRAID_BINARY)
DMRAID_TARGET_BINARY:=$(TARGET_DIR)/sbin/$(DMRAID_BINARY)

$(DL_DIR)/$(DMRAID_SOURCE):
	 $(WGET) -P $(DL_DIR) $(DMRAID_SITE)/$(DMRAID_SOURCE)

$(DMRAID_DIR)/.unpacked: $(DL_DIR)/$(DMRAID_SOURCE)
	$(DMRAID_CAT) $(DL_DIR)/$(DMRAID_SOURCE) | tar -C $(BUILD_DIR) -xvf -
	$(SOURCE_DIR)/patch-kernel.sh $(DMRAID_DIR) $(SOURCE_DIR) dmraid\*.patch
	touch $(DMRAID_DIR)/.unpacked

$(DMRAID_DIR)/.configured: $(DMRAID_DIR)/.unpacked
	(cd $(DMRAID_DIR); rm -rf config.cache; \
		$(TARGET_CONFIGURE_OPTS) \
		CFLAGS="$(TARGET_CFLAGS)" \
		./configure \
		--target=$(GNU_TARGET_NAME) \
		--host=$(GNU_TARGET_NAME) \
		--build=$(GNU_HOST_NAME) \
		--prefix=/usr \
		$(DISABLE_NLS) \
		$(DISABLE_LARGEFILE) \
		--with-user=$(shell id -un) --with-group=$(shell id -gn) \
	);
	touch $(DMRAID_DIR)/.configured

$(DMRAID_DIR)/tools/$(DMRAID_BINARY): $(DMRAID_DIR)/.configured
	$(MAKE1) -C $(DMRAID_DIR)
	-$(STRIP) $(DMRAID_DIR)/tools/$(DMRAID_BINARY)
	-$(UPX) --best $(DMRAID_DIR)/tools/$(DMRAID_BINARY)
	touch -c $(DMRAID_DIR)/tools/$(DMRAID_BINARY)

$(DMRAID_TARGET_BINARY): $(DMRAID_DIR)/tools/$(DMRAID_BINARY)
	$(INSTALL) -m 0755 $? $@
	$(INSTALL) -m 0755 $(SOURCE_DIR)/dmraid.init $(TARGET_DIR)/etc/init.d/dmraid

dmraid: uclibc dm $(DMRAID_TARGET_BINARY)

dmraid-clean:
	rm $(DMRAID_TARGET_BINARY)
	$(MAKE) -C $(DMRAID_DIR) clean

dmraid-dirclean:
	rm -rf $(DMRAID_DIR)

#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(strip $(BR2_PACKAGE_DMRAID)),y)
TARGETS+=dmraid
endif