Makefile 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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.3
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  12. PKG_SOURCE_URL:=@KERNEL/linux/utils/kernel/kexec
  13. PKG_MD5SUM:=b3ced2097ce3981abba38ceedc84f939
  14. PKG_FIXUP:=autoreconf
  15. PKG_CONFIG_DEPENDS := CONFIG_KEXEC_ZLIB
  16. include $(INCLUDE_DIR)/package.mk
  17. define Package/kexec-tools
  18. SECTION:=utils
  19. CATEGORY:=Utilities
  20. DEPENDS:=@armeb||@arm||@i386||@powerpc64||@mipsel||@mips +KEXEC_ZLIB:zlib
  21. TITLE:=Kernel boots kernel
  22. URL:=http://kernel.org/pub/linux/kernel/people/horms/kexec-tools/
  23. MAINTAINER:=Florian Fainelli <[email protected]>
  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. TARGET_CFLAGS += -ffunction-sections -fdata-sections
  48. TARGET_LDFLAGS += -Wl,--gc-sections
  49. CONFIGURE_VARS += \
  50. BUILD_CC="$(HOSTCC)" \
  51. TARGET_CC="$(TARGET_CC)"
  52. kexec-extra-sbin-$(CONFIG_KEXEC_TOOLS_kdump) += kdump
  53. define Build/Compile
  54. $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" all install
  55. endef
  56. define Package/kexec-tools/install
  57. $(INSTALL_DIR) $(1)/usr/sbin
  58. $(INSTALL_BIN) \
  59. $(addprefix $(PKG_INSTALL_DIR)/usr/sbin/, \
  60. $(kexec-extra-sbin-y)) \
  61. $(kexec-extra-bin-y) \
  62. $(PKG_INSTALL_DIR)/usr/sbin/kexec \
  63. $(1)/usr/sbin
  64. # make a link for compatability with other distros
  65. $(INSTALL_DIR) $(1)/sbin
  66. ln -s /usr/sbin/kexec $(1)/sbin/kexec
  67. endef
  68. $(eval $(call BuildPackage,kexec-tools))