2
0

Makefile 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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.14-rc1
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=@KERNEL/linux/utils/kernel/kexec
  13. PKG_HASH:=3fc505ff8d8a2d24c68aac5e6b4783997d5a086966ff3de8b05a0ceb27e5e23b
  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:=@armeb||@arm||@i386||@x86_64||@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:=$(ARCH)-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_LD="$(TARGET_CROSS)ld"
  49. TARGET_CFLAGS += -ffunction-sections -fdata-sections
  50. TARGET_LDFLAGS += -Wl,--gc-sections
  51. CONFIGURE_VARS += \
  52. BUILD_CC="$(HOSTCC)" \
  53. TARGET_CC="$(TARGET_CC)"
  54. kexec-extra-sbin-$(CONFIG_KEXEC_TOOLS_kdump) += kdump
  55. define Build/Compile
  56. $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" all install
  57. endef
  58. define Package/kexec-tools/install
  59. $(INSTALL_DIR) $(1)/usr/sbin
  60. $(INSTALL_BIN) \
  61. $(addprefix $(PKG_INSTALL_DIR)/usr/sbin/, \
  62. $(kexec-extra-sbin-y)) \
  63. $(kexec-extra-bin-y) \
  64. $(PKG_INSTALL_DIR)/usr/sbin/kexec \
  65. $(1)/usr/sbin
  66. # make a link for compatability with other distros
  67. $(INSTALL_DIR) $(1)/sbin
  68. $(LN) ../usr/sbin/kexec $(1)/sbin/kexec
  69. endef
  70. $(eval $(call BuildPackage,kexec-tools))