forked from opencomputeproject/onie
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This patch adds the kexec-tools (kexec and kdump) to the ONIE build system. These tools are built by default for x86 platforms and included in the final image. For powerpc these tools can be built, but are not by default. To build these tools for a powerpc platform add this to the platform's machine.make: KEXEC_ENABLE = yes Signed-off-by: Curt Brune <[email protected]>
- Loading branch information
Curt Brune
committed
Jun 4, 2015
1 parent
bb295dc
commit 02f34e4
Showing
5 changed files
with
123 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
#------------------------------------------------------------------------------- | ||
# | ||
# Copyright (C) 2015 Curt Brune <[email protected]> | ||
# | ||
# SPDX-License-Identifier: GPL-2.0 | ||
# | ||
#------------------------------------------------------------------------------- | ||
# | ||
# This is a makefile fragment that defines the build of kexec-tools | ||
# | ||
|
||
KEXEC_VERSION = 2.0.9 | ||
KEXEC_TARBALL = kexec-tools-$(KEXEC_VERSION).tar.xz | ||
KEXEC_TARBALL_URLS += $(ONIE_MIRROR) \ | ||
https://www.kernel.org/pub/linux/utils/kernel/kexec | ||
KEXEC_BUILD_DIR = $(MBUILDDIR)/kexec-tools | ||
KEXEC_DIR = $(KEXEC_BUILD_DIR)/kexec-tools-$(KEXEC_VERSION) | ||
|
||
KEXEC_SRCPATCHDIR = $(PATCHDIR)/kexec-tools | ||
KEXEC_DOWNLOAD_STAMP = $(DOWNLOADDIR)/kexec-tools-download | ||
KEXEC_SOURCE_STAMP = $(STAMPDIR)/kexec-tools-source | ||
KEXEC_PATCH_STAMP = $(STAMPDIR)/kexec-tools-patch | ||
KEXEC_CONFIGURE_STAMP = $(STAMPDIR)/kexec-tools-configure | ||
KEXEC_BUILD_STAMP = $(STAMPDIR)/kexec-tools-build | ||
KEXEC_INSTALL_STAMP = $(STAMPDIR)/kexec-tools-install | ||
KEXEC_STAMP = $(KEXEC_SOURCE_STAMP) \ | ||
$(KEXEC_PATCH_STAMP) \ | ||
$(KEXEC_CONFIGURE_STAMP) \ | ||
$(KEXEC_BUILD_STAMP) \ | ||
$(KEXEC_INSTALL_STAMP) | ||
|
||
PHONY += kexec-tools kexec-tools-download kexec-tools-source \ | ||
kexec-tools-configure kexec-tools-build kexec-tools-install kexec-tools-clean \ | ||
kexec-tools-download-clean | ||
|
||
KEXEC_SBIN = kexec kdump | ||
|
||
kexec-tools: $(KEXEC_STAMP) | ||
|
||
DOWNLOAD += $(KEXEC_DOWNLOAD_STAMP) | ||
kexec-tools-download: $(KEXEC_DOWNLOAD_STAMP) | ||
$(KEXEC_DOWNLOAD_STAMP): $(PROJECT_STAMP) | ||
$(Q) rm -f $@ && eval $(PROFILE_STAMP) | ||
$(Q) echo "==== Getting upstream kexec-tools ====" | ||
$(Q) $(SCRIPTDIR)/fetch-package $(DOWNLOADDIR) $(UPSTREAMDIR) \ | ||
$(KEXEC_TARBALL) $(KEXEC_TARBALL_URLS) | ||
$(Q) touch $@ | ||
|
||
SOURCE += $(KEXEC_SOURCE_STAMP) | ||
kexec-tools-source: $(KEXEC_SOURCE_STAMP) | ||
$(KEXEC_SOURCE_STAMP): $(TREE_STAMP) | $(KEXEC_DOWNLOAD_STAMP) | ||
$(Q) rm -f $@ && eval $(PROFILE_STAMP) | ||
$(Q) echo "==== Extracting upstream kexec-tools ====" | ||
$(Q) $(SCRIPTDIR)/extract-package $(KEXEC_BUILD_DIR) $(DOWNLOADDIR)/$(KEXEC_TARBALL) | ||
$(Q) touch $@ | ||
|
||
# For PowerPC add booke support | ||
powerpc_KEXEC_CONFIG_OPTS = --with-booke | ||
|
||
kexec-tools-configure: $(KEXEC_CONFIGURE_STAMP) | ||
$(KEXEC_CONFIGURE_STAMP): $(ZLIB_INSTALL_STAMP) \ | ||
$(KEXEC_SOURCE_STAMP) | $(DEV_SYSROOT_INIT_STAMP) | ||
$(Q) rm -f $@ && eval $(PROFILE_STAMP) | ||
$(Q) echo "==== Configure kexec-tools-$(KEXEC_VERSION) ====" | ||
$(Q) cd $(KEXEC_DIR) && PATH='$(CROSSBIN):$(PATH)' \ | ||
$(KEXEC_DIR)/configure \ | ||
--prefix=$(DEV_SYSROOT)/usr \ | ||
--host=$(TARGET) \ | ||
$($(ARCH)_KEXEC_CONFIG_OPTS) \ | ||
CC=$(CROSSPREFIX)gcc \ | ||
CFLAGS="$(ONIE_CFLAGS)" | ||
$(Q) touch $@ | ||
|
||
ifndef MAKE_CLEAN | ||
KEXEC_NEW_FILES = $(shell test -d $(KEXEC_DIR) && test -f $(KEXEC_BUILD_STAMP) && \ | ||
find -L $(KEXEC_DIR) -newer $(KEXEC_BUILD_STAMP) -type f \ | ||
\! -name symlinks \! -name symlinks.o -print -quit) | ||
endif | ||
|
||
kexec-tools-build: $(KEXEC_BUILD_STAMP) | ||
$(KEXEC_BUILD_STAMP): $(KEXEC_NEW_FILES) $(KEXEC_CONFIGURE_STAMP) | ||
$(Q) rm -f $@ && eval $(PROFILE_STAMP) | ||
$(Q) echo "==== Building kexec-tools-$(KEXEC_VERSION) ====" | ||
$(Q) PATH='$(CROSSBIN):$(PATH)' $(MAKE) -C $(KEXEC_DIR) | ||
$(Q) touch $@ | ||
|
||
kexec-tools-install: $(KEXEC_INSTALL_STAMP) | ||
$(KEXEC_INSTALL_STAMP): $(SYSROOT_INIT_STAMP) $(KEXEC_BUILD_STAMP) | ||
$(Q) rm -f $@ && eval $(PROFILE_STAMP) | ||
$(Q) echo "==== Installing kexec-tools in $(DEV_SYSROOT) ====" | ||
PATH='$(CROSSBIN):$(PATH)' \ | ||
$(MAKE) -C $(KEXEC_DIR) install | ||
$(Q) for f in $(KEXEC_SBIN) ; do \ | ||
cp -a $(DEV_SYSROOT)/usr/sbin/$$f $(SYSROOTDIR)/usr/sbin ; \ | ||
done | ||
$(Q) touch $@ | ||
|
||
USERSPACE_CLEAN += kexec-tools-clean | ||
kexec-tools-clean: | ||
$(Q) rm -rf $(KEXEC_BUILD_DIR) | ||
$(Q) rm -f $(KEXEC_STAMP) | ||
$(Q) echo "=== Finished making $@ for $(PLATFORM)" | ||
|
||
DOWNLOAD_CLEAN += kexec-tools-download-clean | ||
kexec-tools-download-clean: | ||
$(Q) rm -f $(KEXEC_DOWNLOAD_STAMP) $(DOWNLOADDIR)/kexec-tools* | ||
|
||
#------------------------------------------------------------------------------- | ||
# | ||
# Local Variables: | ||
# mode: makefile-gmake | ||
# End: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ff087d5a0caaec3f21687b7fd930be835954f0ba kexec-tools-2.0.9.tar.xz |