From patchwork Wed Mar 12 03:45:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Kerr X-Patchwork-Id: 329287 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 31ABB2C00C3 for ; Wed, 12 Mar 2014 14:46:44 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 5EBA7331B8; Wed, 12 Mar 2014 03:46:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DyRJ6b-GZX2q; Wed, 12 Mar 2014 03:46:38 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 3DEA6331C2; Wed, 12 Mar 2014 03:46:20 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 0BB171C2826 for ; Wed, 12 Mar 2014 03:46:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 059028C39A for ; Wed, 12 Mar 2014 03:46:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GPm7dMEkECUf for ; Wed, 12 Mar 2014 03:46:09 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from ozlabs.org (ozlabs.org [203.10.76.45]) by whitealder.osuosl.org (Postfix) with ESMTPS id 387BA8C5BE for ; Wed, 12 Mar 2014 03:46:09 +0000 (UTC) Received: by ozlabs.org (Postfix, from userid 1023) id 6B5712C00E0; Wed, 12 Mar 2014 14:46:05 +1100 (EST) MIME-Version: 1.0 Message-Id: <1394595957.566180.688264078486.7.gpush@pablo> In-Reply-To: <1394595957.563937.119075350083.0.gpush@pablo> To: buildroot@busybox.net From: Jeremy Kerr Date: Wed, 12 Mar 2014 11:45:57 +0800 Subject: [Buildroot] [PATCH 07/10 v2] package/kexec-lite: Add a package for the kexec-lite tools X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Kexec-lite is a tiny impementation of kexec for devicetree-based platforms. Signed-off-by: Jeremy Kerr --- package/Config.in | 1 package/kexec-lite/Config.in | 12 +++ package/kexec-lite/kexec-lite-01-clean-restart.patch | 34 +++++++++++ package/kexec-lite/kexec-lite.mk | 22 +++++++ 4 files changed, 69 insertions(+) diff --git a/package/Config.in b/package/Config.in index 5fe0594..e8662e0 100644 --- a/package/Config.in +++ b/package/Config.in @@ -53,6 +53,7 @@ source "package/fio/Config.in" source "package/gdb/Config.in" source "package/iozone/Config.in" source "package/kexec/Config.in" +source "package/kexec-lite/Config.in" source "package/ktap/Config.in" source "package/latencytop/Config.in" source "package/lmbench/Config.in" diff --git a/package/kexec-lite/Config.in b/package/kexec-lite/Config.in new file mode 100644 index 0000000..daf7eb9 --- /dev/null +++ b/package/kexec-lite/Config.in @@ -0,0 +1,12 @@ +config BR2_PACKAGE_KEXEC_LITE + bool "kexec-lite" + depends on BR2_powerpc + select BR2_PACKAGE_LIBELF + select BR2_PACKAGE_DTC + select BR2_PACKAGE_DTC_PROGRAMS + help + Kexec is a user space utiltity for loading another kernel + and asking the currently running kernel to do something with it. + + This package is a tiny implementation of the kexec userspace + components, for devicetree-based platforms. diff --git a/package/kexec-lite/kexec-lite-01-clean-restart.patch b/package/kexec-lite/kexec-lite-01-clean-restart.patch new file mode 100644 index 0000000..faaa93a --- /dev/null +++ b/package/kexec-lite/kexec-lite-01-clean-restart.patch @@ -0,0 +1,34 @@ +From 0a654c20e1b9324c57ba4116b52fb6ab33847e1d Mon Sep 17 00:00:00 2001 +From: Jeremy Kerr +Date: Thu, 8 Aug 2013 17:16:31 +0800 +Subject: [PATCH] kexec: Implement clean restart for busybox init + +Signed-off-by: Jeremy Kerr +--- + kexec.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/kexec.c b/kexec.c +index 2edb7df..b2a0c42 100644 +--- a/kexec.c ++++ b/kexec.c +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -818,7 +819,7 @@ int main(int argc, char *argv[]) + sync(); + exec_kexec(); + } else { +- execlp("shutdown", "shutdown", "-r", "now", NULL); ++ kill(1, SIGQUIT); + } + + return -1; +-- +1.7.10.4 + diff --git a/package/kexec-lite/kexec-lite.mk b/package/kexec-lite/kexec-lite.mk new file mode 100644 index 0000000..aa09abc --- /dev/null +++ b/package/kexec-lite/kexec-lite.mk @@ -0,0 +1,22 @@ +################################################################################ +# +# kexec-lite +# +################################################################################ + +KEXEC_LITE_VERSION = 0e30677d8232595c135772e1121b7be98c118e13 +KEXEC_LITE_SITE = $(call github,antonblanchard,kexec-lite,$(KEXEC_LITE_VERSION)) +KEXEC_LITE_LICENSE = GPL +KEXEC_LITE_DEPENDENCIES = libelf dtc + +define KEXEC_LITE_BUILD_CMDS + $(MAKE) CC="$(TARGET_CC)" LD="$(TARGET_LD)" \ + CFLAGS="$(TARGET_CFLAGS)" \ + -C $(@D) all +endef + +define KEXEC_LITE_INSTALL_TARGET_CMDS + $(INSTALL) -D -m 755 $(@D)/kexec $(TARGET_DIR)/usr/sbin/ +endef + +$(eval $(generic-package))