Allow kexec to directly use the kernel exposed in a mtd partition and reboot using...
authorFlorian Fainelli <florian@openwrt.org>
Sun, 14 Oct 2007 18:39:20 +0000 (18:39 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Sun, 14 Oct 2007 18:39:20 +0000 (18:39 +0000)
SVN-Revision: 9322

package/kexec-tools/Makefile
package/kexec-tools/files/kexec.sh [new file with mode: 0644]

index d31aeaa856b145da370f68a32a60c628565ad521..6274cb81c3240b0d0c985b1b089ca3ce2acd45e5 100644 (file)
@@ -48,6 +48,7 @@ define Package/kexec-tools/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kexec $(1)/usr/bin/
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kdump $(1)/usr/bin/
+       $(INSTALL_BIN) ./files/kexec.sh $(1)/usr/bin/kexec.mtd
 endef
 
 $(eval $(call BuildPackage,kexec-tools))
diff --git a/package/kexec-tools/files/kexec.sh b/package/kexec-tools/files/kexec.sh
new file mode 100644 (file)
index 0000000..8871d8a
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+. /etc/functions.sh
+cmdline="$(cat /proc/cmdline)"
+kernel="$(find_mtd_part kernel)"
+kexec -l $kernel --command-line=$cmdline