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
:=d2f0ef872f39e2fe4b1b01feb62b0001383207239b9f8041f98a95564161d053
18 PKG_LICENSE
:=GPL-2.0
-only
19 PKG_LICENSE_FILES
:=COPYING
20 PKG_CPE_ID
:=cpe
:/a
:kernel
:kexec-tools
22 PKG_CONFIG_DEPENDS
:= CONFIG_KEXEC_ZLIB CONFIG_KEXEC_LZMA
24 PKG_BUILD_FLAGS
:=gc-sections
26 include $(INCLUDE_DIR
)/package.mk
28 define Package
/kexec-tools
/Default
31 URL
:=https
://github.com
/horms
/kexec-tools
34 define Package
/kexec-tools
35 $(call Package
/kexec-tools
/Default
)
36 TITLE
:=kexec-tools transition meta package
40 define Package
/kexec-tools
/description
41 kexec is a set of system calls that allows you to load
42 another kernel from the currently executing Linux kernel.
43 The kexec utility allows to load and boot another kernel.
47 $(call Package
/kexec-tools
/Default
)
48 TITLE
:=Kernel boots kernel
50 @
(armeb||arm||i386||x86_64||powerpc64||mipsel||mips
) \
51 +KEXEC_ZLIB
:zlib
+KEXEC_LZMA
:liblzma @KERNEL_KEXEC
54 define Package
/kexec
/description
55 The kexec utility allows to load and boot another kernel.
59 $(call Package
/kexec-tools
/Default
)
60 TITLE
:=Kernel crash analysis
61 DEPENDS
:=+kexec @
(i386||x86_64||arm
) @KERNEL_CRASH_DUMP
64 define Package
/kdump
/description
65 The kdump package allows to automatically boot into a
66 special kernel for analyzing kernel crashes using kdump.
69 define Package
/kexec
/config
70 source
"$(SOURCE)/Config.in"
73 KEXEC_TARGET_NAME
:=$(ARCH
)-linux-
$(TARGET_SUFFIX
)
76 --target
=$(KEXEC_TARGET_NAME
) \
77 --host
=$(REAL_GNU_TARGET_NAME
) \
78 --build
=$(GNU_HOST_NAME
) \
85 --libexecdir
=/usr
/lib \
87 $(if
$(CONFIG_KEXEC_ZLIB
),--with
,--without
)-zlib \
88 $(if
$(CONFIG_KEXEC_LZMA
),--with
,--without
)-lzma \
89 TARGET_LD
="$(TARGET_CROSS)ld"
92 BUILD_CC
="$(HOSTCC)" \
93 TARGET_CC
="$(TARGET_CC)"
96 $(MAKE
) -C
$(PKG_BUILD_DIR
) DESTDIR
="$(PKG_INSTALL_DIR)" all install
99 define Package
/kexec-tools
/install
103 define Package
/kexec
/install
104 $(INSTALL_DIR
) $(1)/usr
/sbin
105 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/kexec
$(1)/usr
/sbin
107 # make a link for compatability with other distros
108 $(INSTALL_DIR
) $(1)/sbin
109 $(LN
) ..
/usr
/sbin
/kexec
$(1)/sbin
/kexec
112 define Package
/kdump
/install
113 $(INSTALL_DIR
) $(1)/usr
/sbin
$(1)/etc
/init.d
$(1)/etc
/config
$(1)/etc
/uci-defaults
114 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/vmcore-dmesg
$(1)/usr
/sbin
115 $(INSTALL_BIN
) .
/files
/kdump.init
$(1)/etc
/init.d
/kdump
116 $(INSTALL_BIN
) .
/files
/kdump.defaults
$(1)/etc
/uci-defaults
/kdump
117 $(INSTALL_CONF
) .
/files
/kdump.config
$(1)/etc
/config
/kdump
120 define Package
/kdump
/prerm
125 if grep
-q
" crashkernel=" /boot
/grub
/grub.cfg
; then
126 mount
/boot
-o remount
,rw
127 sed
-i
's/ crashkernel=[^ ]*//' /boot
/grub
/grub.cfg
128 mount
/boot
-o remount
,ro
134 $(eval
$(call BuildPackage
,kexec-tools
))
135 $(eval
$(call BuildPackage
,kexec
))
136 $(eval
$(call BuildPackage
,kdump
))