You are hereDual boot N810Wimax BootFromMMC
Dual boot N810Wimax BootFromMMC
We tried dual booting my N810Wimax but the default initfs kept crashing with the error:
wimax init
Also, you couldn't use the direction pad to select any options in the menu.
Thankfully my friend Brian was able to fix the problem. linuxrc needed a few hacks and the applications fb_update_mode and evkey needed to be added to /usr/bin
Bootmenu needed to be patched to correctly set the memory card location. The mmc cards change numbers during boot, which can be confusing.
Tags
Basically, the problem in the Wimax version is that /proc/component_version returns RX-48. The standard n810 returns RX-44 and the n800 returns RX-34.
The regular bootmenu.sh and linuxrc scripts only respond to RX-44 and RX-34. I had to hack them to accept RX-48.
Actually, to be honest, I manually removed a bunch of the code and just hard coded it to RX-48 and hard coded the boot devices. I figured that an n810-wimax wouldn't magically change to another type for any reason. Makes the code ugly and non-portable, but I guess someone else can clean it up.
Here is the diff for the bootmenu.sh
--- jffs2.bootmenu/bootmenu.sh 2008-11-17 11:42:44.000000000 -0500
+++ jffs2/bootmenu.sh 2008-11-19 16:07:38.000000000 -0500
@@ -1,3 +1,4 @@
+#!/bin/sh
# show onscreen boot menu
# modify default_root,root_dev,root_fstype,root_fsoptions variables
@@ -21,9 +22,13 @@
# up 103 down 108 left 105 right 106 select 28
# esc 1 menu 62 home 63 fullscreen 64 plus 65 minus 66
-PRODUCT=`awk '/product/ { print $2 }' /proc/component_version`
-[ "$EVNAME" = "" ] && case $PRODUCT in SU-18) EVNAME=event1 ;; RX-34) EVNAME=event2 ;; RX-44) EVNAME=event0 ;; esac
+#PRODUCT=`awk '/product/ { print $2 }' /proc/component_version`
+PRODUCT="RX-48"
+
+#[ "$EVNAME" = "" ] && case $PRODUCT in SU-18) EVNAME=event1 ;; RX-34) EVNAME=event2 ;; RX-48) EVNAME=event0 ;; esac
+
+EVNAME=event0
#wait 1 second for keyup event
GETKEY="evkey -u -t 1000 /dev/input/${EVNAME}"
T2S="${initfs_prefix}/usr/bin/text2screen"
And here is the one for the linuxrc
--- jffs2.bootmenu/bootmenu.sh 2008-11-17 11:42:44.000000000 -0500
+++ jffs2/bootmenu.sh 2008-11-19 16:07:38.000000000 -0500
[2]ep:~/n800/n810$ diff -uN jffs2.bootmenu/linuxrc.orig jffs2/linuxrc
--- jffs2.bootmenu/linuxrc.orig 2008-11-18 12:26:47.000000000 -0500
+++ jffs2/linuxrc 2008-11-19 16:07:10.000000000 -0500
@@ -17,8 +17,14 @@
. /initfs.config
fi
-text2screen -c
-text2screen -s 2 -H center -y 20 -T 0 -t "Press and hold MENU key for advanced boot menu"
+report()
+{
+ text2screen -c
+ text2screen -s 2 -H center -y 20 -T 0 -t "$*"
+}
+
+report "Brian was here"
+sleep 3
init_system()
{
@@ -537,15 +543,14 @@
enter_state
enable_powersave
-grep RX-48 /proc/component_version >/dev/null
-if [ $? -eq 0 ]; then
- echo not loading
+#grep RX-48 /proc/component_version >/dev/null
+#if [ $? -eq 0 ]; then
# show_pr_wimax &
-fi
+#fi
+
# We are in USER state now
want_menu=0
-# conflicts with on-screen bootmenu, disabled
#if [ $rd_mode -ne 0 ]; then
# echo
# echo "Press any key for interactive startup"
@@ -555,48 +560,53 @@
# fi
#fi
-if [ $want_menu -ne 1 ]; then
- default_root=$(cal-tool --get-root-device 2> /dev/null)
- set_default_root_params
- #now check HW key state
- case `grep product /proc/component_version` in *RX-34) EVNAME=event2 ;; *RX-44) EVNAME=event0 ;; *SU-18) EVNAME=event1 ;; esac
- HWKEYSTATE=$(evkey -s /dev/input/$EVNAME)
- # if Escape was not pressed, execute advanced menu script
- if [ "$HWKEYSTATE" != "1" ] ; then
- [ -f /bootmenu.sh ] && . /bootmenu.sh
- fi
- case "$default_root" in
- mmc)
- load_mmc_modules
- if search_root_onmmc; then
- root_dev_name="MMC"
- root_dev_set=1
- root_fstype=""
- root_fsoptions=""
- else
- echo "No mmc root found, try default"
- set_default_root_params
- fi
- ;;
- usb)
- root_dev=sda1
- root_dev_name="USB hard drive"
- root_dev_set=1
- root_fstype=""
- root_fsoptions=""
- ;;
+
+#if [ $want_menu -ne 1 ]; then
+ default_root=$(cal-tool --get-root-device 2> /dev/null)
+ set_default_root_params
+# case `grep product /proc/component_version` in *RX-34) EVNAME=event2 ;;
+# case `grep product /proc/component_version` in *RX-48) EVNAME=event0 ;;
+ EVNAME=event0
+ HWKEYSTATE=$(evkey -s /dev/input/$EVNAME)
+ report "before calling bootmenu.sh"
+ if [ "$HWKEYSTATE" != "1" ] ; then
+ [ -f /bootmenu.sh ] && . /bootmenu.sh
+ fi
+ report "after calling bootmenu.sh - default_root = $default_root"
+# case "$default_root" in
+# mmc)
+# load_mmc_modules
+# if search_root_onmmc; then
+# report "search_root_onmmc succeeded"
+# root_dev_name="MMC"
+# root_dev_set=1
+# root_fstype=""
+# root_fsoptions=""
+# else
+# report "search_root_onmmc failed"
+# echo "No mmc root found, try default"
+# set_default_root_params
+# fi
+# ;;
+# usb)
+# root_dev=sda1
+# root_dev_name="USB hard drive"
+# root_dev_set=1
+# root_fstype=""
+# root_fsoptions=""
+# ;;
# *)
# set_default_root_params
# ;;
- esac
-# wait_for_device
- boot
- #in case it fails
- text2screen -c
- text2screen -s 2 -H center -y 20 -T 0 -t "Boot from $default_root failed, booting from flash ..."
- set_default_root_params
+# esac
+ report "${root_dev}"
+ report "${root_dev_name}"
+ report "${root_dev_set}"
+ report "${root_fstype}"
+ report "${root_fsoptions}"
+ wait_for_device
boot
-fi
+#fi
root="invalid"
while [ true ]; do
I have no idea if those diffs will display correctly, but anyway, you should get an idea of what they do.
These files are found in the initfs.bootmenu.jffs2 file. You need jffs2 filesystem to mount and change the files. I did this under Fedora.
Hope that helps,
Brian
There were a few other changes, the direction pad uses a program in the 810. If you compare the regular init from the 810 to the dual boot from the 800, you'll see the changes needed. The one I posted has a lot of comments in it from Brian (the guy who actually fixed it). You can mount it locally and play around with it to see.
is it enough to add fb_update_mode to /usr/bin ?
Post new comment