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_CONFIG_DEPENDS
:= CONFIG_KEXEC_ZLIB CONFIG_KEXEC_LZMA
20 PKG_BUILD_FLAGS
:=gc-sections
22 include $(INCLUDE_DIR
)/package.mk
24 define Package
/kexec-tools
/Default
27 URL
:=https
://github.com
/horms
/kexec-tools
30 define Package
/kexec-tools
31 $(call Package
/kexec-tools
/Default
)
32 TITLE
:=kexec-tools transition meta package
36 define Package
/kexec-tools
/description
37 kexec is a set of system calls that allows you to load
38 another kernel from the currently executing Linux kernel.
39 The kexec utility allows to load and boot another kernel.
43 $(call Package
/kexec-tools
/Default
)
44 TITLE
:=Kernel boots kernel
46 @
(armeb||arm||i386||x86_64||powerpc64||mipsel||mips
) \
47 +KEXEC_ZLIB
:zlib
+KEXEC_LZMA
:liblzma @KERNEL_KEXEC
50 define Package
/kexec
/description
51 The kexec utility allows to load and boot another kernel.
55 $(call Package
/kexec-tools
/Default
)
56 TITLE
:=Kernel crash analysis
57 DEPENDS
:=+kexec @
(i386||x86_64||arm
) @KERNEL_CRASH_DUMP
60 define Package
/kdump
/description
61 The kdump package allows to automatically boot into a
62 special kernel for analyzing kernel crashes using kdump.
65 define Package
/kexec
/config
66 source
"$(SOURCE)/Config.in"
69 KEXEC_TARGET_NAME
:=$(ARCH
)-linux-
$(TARGET_SUFFIX
)
72 --target
=$(KEXEC_TARGET_NAME
) \
73 --host
=$(REAL_GNU_TARGET_NAME
) \
74 --build
=$(GNU_HOST_NAME
) \
81 --libexecdir
=/usr
/lib \
83 $(if
$(CONFIG_KEXEC_ZLIB
),--with
,--without
)-zlib \
84 $(if
$(CONFIG_KEXEC_LZMA
),--with
,--without
)-lzma \
85 TARGET_LD
="$(TARGET_CROSS)ld"
88 BUILD_CC
="$(HOSTCC)" \
89 TARGET_CC
="$(TARGET_CC)"
92 $(MAKE
) -C
$(PKG_BUILD_DIR
) DESTDIR
="$(PKG_INSTALL_DIR)" all install
95 define Package
/kexec-tools
/install
99 define Package
/kexec
/install
100 $(INSTALL_DIR
) $(1)/usr
/sbin
101 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/kexec
$(1)/usr
/sbin
103 # make a link for compatability with other distros
104 $(INSTALL_DIR
) $(1)/sbin
105 $(LN
) ..
/usr
/sbin
/kexec
$(1)/sbin
/kexec
108 define Package
/kdump
/install
109 $(INSTALL_DIR
) $(1)/usr
/sbin
$(1)/etc
/init.d
$(1)/etc
/config
$(1)/etc
/uci-defaults
110 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/vmcore-dmesg
$(1)/usr
/sbin
111 $(INSTALL_BIN
) .
/files
/kdump.init
$(1)/etc
/init.d
/kdump
112 $(INSTALL_BIN
) .
/files
/kdump.defaults
$(1)/etc
/uci-defaults
/kdump
113 $(INSTALL_CONF
) .
/files
/kdump.config
$(1)/etc
/config
/kdump
116 define Package
/kdump
/prerm
121 if grep
-q
" crashkernel=" /boot
/grub
/grub.cfg
; then
122 mount
/boot
-o remount
,rw
123 sed
-i
's/ crashkernel=[^ ]*//' /boot
/grub
/grub.cfg
124 mount
/boot
-o remount
,ro
130 $(eval
$(call BuildPackage
,kexec-tools
))
131 $(eval
$(call BuildPackage
,kexec
))
132 $(eval
$(call BuildPackage
,kdump
))