From f1e35ecc5097f4c0a959e5484f666509561bd95b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michael=20B=C3=BCsch?= Date: Sat, 14 Aug 2010 14:44:50 +0000 Subject: [PATCH 1/1] Add maemo-kexec helper scripts for booting maemo from openwrt on the Nokia n810. SVN-Revision: 22641 --- utils/maemo-kexec/Config.in | 15 ++++++++ utils/maemo-kexec/Makefile | 46 +++++++++++++++++++++++++ utils/maemo-kexec/files/sbin/boot-maemo | 5 +++ 3 files changed, 66 insertions(+) create mode 100644 utils/maemo-kexec/Config.in create mode 100644 utils/maemo-kexec/Makefile create mode 100755 utils/maemo-kexec/files/sbin/boot-maemo diff --git a/utils/maemo-kexec/Config.in b/utils/maemo-kexec/Config.in new file mode 100644 index 0000000000..7a6a9eb66c --- /dev/null +++ b/utils/maemo-kexec/Config.in @@ -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 index 0000000000..02cdcaff3c --- /dev/null +++ b/utils/maemo-kexec/Makefile @@ -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 index 0000000000..6bcd8b17a4 --- /dev/null +++ b/utils/maemo-kexec/files/sbin/boot-maemo @@ -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 -- 2.30.2