2 # Copyright (C) 2006-2012 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.xz
15 PKG_SOURCE_URL
:=@KERNEL
/linux
/utils
/kernel
/kexec
16 PKG_HASH
:=e113142dee891638ad96e0f72cf9277b244477619470b30c41999d312e8e8702
18 PKG_CONFIG_DEPENDS
:= CONFIG_KEXEC_ZLIB CONFIG_KEXEC_LZMA
20 include $(INCLUDE_DIR
)/package.mk
22 define Package
/kexec-tools
/Default
25 URL
:=http
://kernel.org
/pub
/linux
/kernel
/people
/horms
/kexec-tools
/
28 define Package
/kexec-tools
29 $(call Package
/kexec-tools
/Default
)
30 TITLE
:=kexec-tools transition meta package
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.
41 $(call Package
/kexec-tools
/Default
)
42 TITLE
:=Kernel boots kernel
44 @
(armeb||arm||i386||x86_64||powerpc64||mipsel||mips
) \
45 +KEXEC_ZLIB
:zlib
+KEXEC_LZMA
:liblzma @KERNEL_KEXEC
48 define Package
/kexec
/description
49 The kexec utility allows to load and boot another kernel.
53 $(call Package
/kexec-tools
/Default
)
54 TITLE
:=Kernel crash analysis
55 DEPENDS
:=+kexec @
(i386||x86_64||arm
) @KERNEL_CRASH_DUMP
58 define Package
/kdump
/description
59 The kdump package allows to automatically boot into a
60 special kernel for analyzing kernel crashes using kdump.
63 define Package
/kexec
/config
64 source
"$(SOURCE)/Config.in"
67 KEXEC_TARGET_NAME
:=$(ARCH
)-linux-
$(TARGET_SUFFIX
)
70 --target
=$(KEXEC_TARGET_NAME
) \
71 --host
=$(REAL_GNU_TARGET_NAME
) \
72 --build
=$(GNU_HOST_NAME
) \
79 --libexecdir
=/usr
/lib \
81 $(if
$(CONFIG_KEXEC_ZLIB
),--with
,--without
)-zlib \
82 $(if
$(CONFIG_KEXEC_LZMA
),--with
,--without
)-lzma \
83 TARGET_LD
="$(TARGET_CROSS)ld"
85 TARGET_CFLAGS
+= -ffunction-sections
-fdata-sections
86 TARGET_LDFLAGS
+= -Wl
,--gc-sections
89 BUILD_CC
="$(HOSTCC)" \
90 TARGET_CC
="$(TARGET_CC)"
93 $(MAKE
) -C
$(PKG_BUILD_DIR
) DESTDIR
="$(PKG_INSTALL_DIR)" all install
96 define Package
/kexec-tools
/install
100 define Package
/kexec
/install
101 $(INSTALL_DIR
) $(1)/usr
/sbin
102 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/kexec
$(1)/usr
/sbin
104 # make a link for compatability with other distros
105 $(INSTALL_DIR
) $(1)/sbin
106 $(LN
) ..
/usr
/sbin
/kexec
$(1)/sbin
/kexec
109 define Package
/kdump
/install
110 $(INSTALL_DIR
) $(1)/usr
/sbin
$(1)/etc
/init.d
$(1)/etc
/config
$(1)/etc
/uci-defaults
111 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/vmcore-dmesg
$(1)/usr
/sbin
112 $(INSTALL_BIN
) .
/files
/kdump.init
$(1)/etc
/init.d
/kdump
113 $(INSTALL_BIN
) .
/files
/kdump.defaults
$(1)/etc
/uci-defaults
/kdump
114 $(INSTALL_CONF
) .
/files
/kdump.config
$(1)/etc
/config
/kdump
117 define Package
/kdump
/prerm
122 if grep
-q
" crashkernel=" /boot
/grub
/grub.cfg
; then
123 mount
/boot
-o remount
,rw
124 sed
-i
's/ crashkernel=[^ ]*//' /boot
/grub
/grub.cfg
125 mount
/boot
-o remount
,ro
131 $(eval
$(call BuildPackage
,kexec-tools
))
132 $(eval
$(call BuildPackage
,kexec
))
133 $(eval
$(call BuildPackage
,kdump
))