Add maemo-kexec helper scripts for booting maemo from openwrt on the Nokia n810.
authorMichael Büsch <mb@bu3sch.de>
Sat, 14 Aug 2010 14:44:50 +0000 (14:44 +0000)
committerMichael Büsch <mb@bu3sch.de>
Sat, 14 Aug 2010 14:44:50 +0000 (14:44 +0000)
SVN-Revision: 22641

utils/maemo-kexec/Config.in [new file with mode: 0644]
utils/maemo-kexec/Makefile [new file with mode: 0644]
utils/maemo-kexec/files/sbin/boot-maemo [new file with mode: 0755]

diff --git a/utils/maemo-kexec/Config.in b/utils/maemo-kexec/Config.in
new file mode 100644 (file)
index 0000000..7a6a9eb
--- /dev/null
@@ -0,0 +1,15 @@
+config MAEMO_KEXEC_KERNEL_PATH
+       string
+       prompt "Path to the Maemo kernel image"
+       default "PLEASE_CONFIGURE_MAEMO_ZIMAGE"
+       depends on PACKAGE_maemo-kexec
+       help
+         Defines the path to the Maemo kernel zImage.
+
+         The image can be extracted from the Fiasco firmware image.
+         Use the proprietary flasher to extract the image. The
+         opensource tool "0xFFFF" is not able to extract the zImage correctly.
+
+         The zImage defined here will be included in the OpenWrt rootfs
+         for kexec-ing of the Maemo operating system. The Maemo rootfs
+         has to be installed on the n810's "rootfs" MTD partition (MTD4).
diff --git a/utils/maemo-kexec/Makefile b/utils/maemo-kexec/Makefile
new file mode 100644 (file)
index 0000000..02cdcaf
--- /dev/null
@@ -0,0 +1,46 @@
+#
+# Copyright (C) 2010 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=maemo-kexec
+PKG_VERSION:=0.1
+PKG_RELEASE:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/maemo-kexec
+  SECTION:=utils
+  CATEGORY:=Utilities
+  DEPENDS:=@TARGET_omap24xx +kexec-tools
+  TITLE:=Kexec Maemo from OpenWRT
+  MENU:=1
+endef
+
+define Package/maemo-kexec/description
+ Kexec Maemo from OpenWRT.
+ The Maemo kernel image must be provided and the Maemo rootfs
+ must be in the rootfs MTD partition.
+endef
+
+define Package/maemo-kexec/config
+       source "$(SOURCE)/Config.in"
+endef
+
+define Build/Compile
+endef
+
+define Package/maemo-kexec/install
+       $(INSTALL_DIR) $(1)/sbin
+       $(INSTALL_DIR) $(1)/boot
+       $(INSTALL_BIN) ./files/sbin/boot-maemo $(1)/sbin/
+       # --- COPYING MAEMO zImage ---
+       # If this fails, please check CONFIG_MAEMO_KEXEC_KERNEL_PATH
+       $(INSTALL_DATA) $(CONFIG_MAEMO_KEXEC_KERNEL_PATH) $(1)/boot/maemo.zImage
+endef
+
+$(eval $(call BuildPackage,maemo-kexec))
diff --git a/utils/maemo-kexec/files/sbin/boot-maemo b/utils/maemo-kexec/files/sbin/boot-maemo
new file mode 100755 (executable)
index 0000000..6bcd8b1
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+set -e
+/usr/sbin/kexec --load /boot/maemo.zImage --append "root=1f03 rootfstype=jffs2 ro console=tty0 console=ttyMTD5"
+/usr/sbin/kexec --exec