Makefile 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #
  2. # Copyright (C) 2006-2012 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=kexec-tools
  9. PKG_VERSION:=2.0.9
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=@KERNEL/linux/utils/kernel/kexec
  13. PKG_MD5SUM:=6681319934e22e74c532bd392ccb1bbb
  14. PKG_FIXUP:=autoreconf
  15. PKG_CONFIG_DEPENDS := CONFIG_KEXEC_ZLIB CONFIG_KEXEC_LZMA
  16. include $(INCLUDE_DIR)/package.mk
  17. define Package/kexec-tools
  18. SECTION:=utils
  19. CATEGORY:=Utilities
  20. DEPENDS:=@KERNEL_KEXEC @armeb||@arm||@i386||@powerpc64||@mipsel||@mips +KEXEC_ZLIB:zlib +KEXEC_LZMA:liblzma
  21. TITLE:=Kernel boots kernel
  22. URL:=http://kernel.org/pub/linux/kernel/people/horms/kexec-tools/
  23. MAINTAINER:=Florian Fainelli <florian@openwrt.org>
  24. MENU:=1
  25. endef
  26. define Package/kexec-tools/description
  27. kexec is a set of systems call that allows you to load
  28. another kernel from the currently executing Linux kernel.
  29. endef
  30. define Package/kexec-tools/config
  31. source "$(SOURCE)/Config.in"
  32. endef
  33. KEXEC_TARGET_NAME:=$(call qstrip,$(CONFIG_KEXEC_TOOLS_TARGET_NAME))-linux-$(TARGET_SUFFIX)
  34. CONFIGURE_ARGS = \
  35. --target=$(KEXEC_TARGET_NAME) \
  36. --host=$(REAL_GNU_TARGET_NAME) \
  37. --build=$(GNU_HOST_NAME) \
  38. --program-prefix="" \
  39. --program-suffix="" \
  40. --prefix=/usr \
  41. --exec-prefix=/usr \
  42. --bindir=/usr/bin \
  43. --sbindir=/usr/sbin \
  44. --libexecdir=/usr/lib \
  45. --sysconfdir=/etc \
  46. $(if $(CONFIG_KEXEC_ZLIB),--with,--without)-zlib \
  47. $(if $(CONFIG_KEXEC_LZMA),--with,--without)-lzma
  48. TARGET_CFLAGS += -ffunction-sections -fdata-sections
  49. TARGET_LDFLAGS += -Wl,--gc-sections
  50. CONFIGURE_VARS += \
  51. BUILD_CC="$(HOSTCC)" \
  52. TARGET_CC="$(TARGET_CC)"
  53. kexec-extra-sbin-$(CONFIG_KEXEC_TOOLS_kdump) += kdump
  54. define Build/Compile
  55. $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" all install
  56. endef
  57. define Package/kexec-tools/install
  58. $(INSTALL_DIR) $(1)/usr/sbin
  59. $(INSTALL_BIN) \
  60. $(addprefix $(PKG_INSTALL_DIR)/usr/sbin/, \
  61. $(kexec-extra-sbin-y)) \
  62. $(kexec-extra-bin-y) \
  63. $(PKG_INSTALL_DIR)/usr/sbin/kexec \
  64. $(1)/usr/sbin
  65. # make a link for compatability with other distros
  66. $(INSTALL_DIR) $(1)/sbin
  67. $(LN) ../usr/sbin/kexec $(1)/sbin/kexec
  68. endef
  69. $(eval $(call BuildPackage,kexec-tools))