procd: make mDNS TXT record parsing more solid
[openwrt/openwrt.git] / package / boot / kexec-tools / Makefile
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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=kexec-tools
11 PKG_VERSION:=2.0.21
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=@KERNEL/linux/utils/kernel/kexec
16 PKG_HASH:=e113142dee891638ad96e0f72cf9277b244477619470b30c41999d312e8e8702
17
18 PKG_CONFIG_DEPENDS := CONFIG_KEXEC_ZLIB CONFIG_KEXEC_LZMA
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/kexec-tools/Default
23 SECTION:=utils
24 CATEGORY:=Utilities
25 URL:=http://kernel.org/pub/linux/kernel/people/horms/kexec-tools/
26 endef
27
28 define Package/kexec-tools
29 $(call Package/kexec-tools/Default)
30 TITLE:=kexec-tools transition meta package
31 DEPENDS:=+kexec
32 endef
33
34 define Package/kexec-tools/description
35 kexec is a set of system calls that allows you to load
36 another kernel from the currently executing Linux kernel.
37 The kexec utility allows to load and boot another kernel.
38 endef
39
40 define Package/kexec
41 $(call Package/kexec-tools/Default)
42 TITLE:=Kernel boots kernel
43 DEPENDS:=\
44 @(armeb||arm||i386||x86_64||powerpc64||mipsel||mips) \
45 +KEXEC_ZLIB:zlib +KEXEC_LZMA:liblzma @KERNEL_KEXEC
46 endef
47
48 define Package/kexec/description
49 The kexec utility allows to load and boot another kernel.
50 endef
51
52 define Package/kexec/config
53 source "$(SOURCE)/Config.in"
54 endef
55
56 KEXEC_TARGET_NAME:=$(ARCH)-linux-$(TARGET_SUFFIX)
57
58 CONFIGURE_ARGS = \
59 --target=$(KEXEC_TARGET_NAME) \
60 --host=$(REAL_GNU_TARGET_NAME) \
61 --build=$(GNU_HOST_NAME) \
62 --program-prefix="" \
63 --program-suffix="" \
64 --prefix=/usr \
65 --exec-prefix=/usr \
66 --bindir=/usr/bin \
67 --sbindir=/usr/sbin \
68 --libexecdir=/usr/lib \
69 --sysconfdir=/etc \
70 $(if $(CONFIG_KEXEC_ZLIB),--with,--without)-zlib \
71 $(if $(CONFIG_KEXEC_LZMA),--with,--without)-lzma \
72 TARGET_LD="$(TARGET_CROSS)ld"
73
74 TARGET_CFLAGS += -ffunction-sections -fdata-sections
75 TARGET_LDFLAGS += -Wl,--gc-sections
76
77 CONFIGURE_VARS += \
78 BUILD_CC="$(HOSTCC)" \
79 TARGET_CC="$(TARGET_CC)"
80
81 define Build/Compile
82 $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" all install
83 endef
84
85 define Package/kexec-tools/install
86 :
87 endef
88
89 define Package/kexec/install
90 $(INSTALL_DIR) $(1)/usr/sbin
91 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kexec $(1)/usr/sbin
92
93 # make a link for compatability with other distros
94 $(INSTALL_DIR) $(1)/sbin
95 $(LN) ../usr/sbin/kexec $(1)/sbin/kexec
96 endef
97
98 $(eval $(call BuildPackage,kexec-tools))
99 $(eval $(call BuildPackage,kexec))