Dear
請問一下,Android 目前都是運行在ARM或X86,
我使用Renessas的migo-R平台,它的CPU是SH7722,kernel iMage編譯出來了想透過NFS與Android filesystem連接,但是啟動init出了問題;
因為 我的Android filesystem是從emulator抓出來的,它只能給ARM使用,我觀察init它的檔案型態是
[root@mirl194052 rootfs]# file init
init: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically
linked, stripped
所以 透過u-boot啟動Android kernel iMage在執行init時會出現
" Failed to execute /init. Attempting defaults...
Kernel panic - not syncing: No init found. Try passing init= option
to kernel. "
請問 (1)有人在其他CPU使用過嗎? (2)Android filesystem有原始碼可供編譯成其他CPU架構的方式嗎?
謝謝
adik/
mail: adikliu@gmail.com

18 則回應
renessas 的工具大本營 www.kpitgnutools.com 不過要先 register
KPIT GNU Tools are free, user-friendly GNU toolchains for Renesas micros with free customer support across the world.
Register now for free and get unlimited downloads and support - it's easy:
建議到這來問! 一堆業界的高手在這!
http://0xlab.org/index.html
直接問jserv可能比較快!
你好~
關於你的
setp5
1. The download source is :www.androidin.com/bbs/pub/armv4.tar.gz
2. 從emulator 拉出來的.
想請問可以分享一下armv4.tar.gz嗎 我找很多 都是同個連結
但 已失效
還有你的第二種方法是怎樣做的?
我有試過開模擬
再用 adb pull 把檔案都拉出來到暫存的資料夾
最後cramfs包起來
但不知道是容量太大或是沒有拉完整
結果是失敗的
不知道你的做法是如何?
跟你請教一下
謝謝~
http://bbs.androidin.com/forumdisplay.php?fid=86
这里应该有人可以解答你的问题。
其實就我所知, 國內 linux 人才在網通界裡很多, 但可能因為礙於工作之外根本就
沒其他多餘時間可以上網跟大家分享, 所以網路上看到的大部分都是 soho 族所寫的分享文章...
回到樓主的問題, 或許你可以利用重新 build android cupcake 把 TARGET_ARCH 改成你要的 (sh4?) compiler 的環境設一設或許是個可以嘗試的點... 還沒空去一一把相關的 makefile 抓出來, 可能樓主要花點時間看一看囉...
@localhost merged]$ make
build/core/product_config.mk:211: WARNING: adding test OTA key
============================================
TARGET_PRODUCT=generic
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=
============================================
build/core/main.mk:180: implicitly installing apns-conf_sdk.xml
建議你~直接去台灣的各linux大站討論版,問問看!!
畢竟Linux這種東西,要簡單有簡單~ 要難有超難!!
太冷門又高超的技術,很少有人懂~也不見得會在網路分享!!
android source 可以從這邊下載...source.android.com/projects
follow to download android source code.
從終端機,就是U-boot的啟動資訊看到,我改的Android Kernel iMage應該是OK了,
另外 我也有在Renesas的討論區發問,有個網友有回應我,提供給大家參考看看...
As far as I can see your kernel is ok. What is not ok is your root filesystem, and all the tools in it.Check this page:
You would probably want to start with porting everything from system/core. This should provide a minimal boot environment to start your system after the kernel is done starting. Once you have that, you can add all the other parts of the core systems.
It's quite a bit of work, but most of it should (AFAIK) be not too difficult to cross compile for SH.
有沒人看的懂 改如何從system/core做出minimal boot environment ??
謝謝唷
adik/ adikliu@gmail.com
android source 可以從這邊下載...
follow http://source.android.com/download to download android source code.
從終端機,就是U-boot的啟動資訊看到,我改的Android Kernel iMage應該是OK了,
另外 我也有在Renesas的討論區發問,有個網友有回應我,提供給大家參考看看...
As far as I can see your kernel is ok. What is not ok is your root filesystem, and all the tools in it.Check this page:http://source.android.com/projects
You would probably want to start with porting everything from system/core. This should provide a minimal boot environment to start your system after the kernel is done starting. Once you have that, you can add all the other parts of the core systems.
It's quite a bit of work, but most of it should (AFAIK) be not too difficult to cross compile for SH.
有沒人看的懂 改如何從system/core做出minimal boot environment ??
謝謝唷
adik/ adikliu@gmail.com
手上拿到的是 Android cupcake, 或許您要去找找 Renasas 看看有沒有 Android cupcake
的 delta files...
嗚嗚~我看不懂~~
可能需要有更多嵌入式的高手來幫忙解決
肉肉的板主
嗚嗚~我看不懂~~
可能需要有更多嵌入式的高手來幫忙解決
肉肉的板主
我也看不懂.. @@"
有這些高手,像我們這種使用者才有好用的手機啊
真是幸福
啊, 看錯問題了!
你的問題在於沒有 superH 的 root file system... 可能要 google 一下看有沒有人已經有
build 好的 file system, 要不然就是重新抓下 android cupcake package 來 rebuild...
但也不一定找的到 superH 的 branch...
啊, 看錯問題了!
你的問題在於沒有 superH 的 root file system... 可能要 google 一下看有沒有人已經有
build 好的 file system, 要不然就是重新抓下 android cupcake package 來 rebuild...
但也不一定找的到 superH 的 branch...
感恩阿~~~
我在對岸也有PO 但似乎沒有人回應,還是自己人比較好~~
我目前遇到的難題就是 沒有superH 的 root file system,得要自己build,
問題是 我的功力還沒辦法bulid出來...只能錯誤中學習...啦
有沒人想要一起共襄盛舉~~~一起改改看哩...
Hi 用一招偷吃步, 改用 initramfs in Linux 2.6 一起把它包在 kernel image 裡
... 如果你手上有 android source package 的話, 把 linux kernel 裡的 initramfs path
指到 android built 出來的 out/target/[platform]/root 這樣 root filesystem 就會一起包進
kernel image 裡了!
應該是 initial console 的 device node 沒在 /dev/ 裡面...
ㄟㄟ... 這個講來話長耶, 要檢查一下你的 root filesystem /dev 目錄底下的東西喔!
有可能是裡面的檔案並不是實際的 device node... 另外在 bootup cmdline 裡的
console device node 一定要存在裡面喔, major/minor number 也要對.
一時間也不知道該怎麼回答您的問題, 把 /dev/ 裡面的東東貼上來看看吧!
非常感激你的回覆,忘記說明我用是mips-android的那一包
我還有把build出來的/system/裡面的檔案copy到/root/system中,再把path指到/root
我check了root/dev/裡面本來就是空的,是不是要建立一個initial console?
你說的bootup cmdline是指.config中的 CONFIG_CMDLINE="console=ttyS0,115200"嗎?
major/minor number我就不知道是什麼了,請幫忙指點迷津~
Hi 用一招偷吃步, 改用 initramfs in Linux 2.6 一起把它包在 kernel image 裡
... 如果你手上有 android source package 的話, 把 linux kernel 裡的 initramfs path
指到 android built 出來的 out/target/[platform]/root 這樣 root filesystem 就會一起包進
kernel image 裡了!
Dear bohemianx,
我用你偷吃步的方法,把root包進kernel裡
可是最後卻出現error如下:
Warning: unable to open an initial console.
<0>Kernel panic: Attempted to kill init!
請問可能是什麼問題,有何解決方法呢?
ps: 我的kernel跟filesystem ,ARCH是一樣的
應該是 initial console 的 device node 沒在 /dev/ 裡面...
ㄟㄟ... 這個講來話長耶, 要檢查一下你的 root filesystem /dev 目錄底下的東西喔!
有可能是裡面的檔案並不是實際的 device node... 另外在 bootup cmdline 裡的
console device node 一定要存在裡面喔, major/minor number 也要對.
一時間也不知道該怎麼回答您的問題, 把 /dev/ 裡面的東東貼上來看看吧!
Hi 用一招偷吃步, 改用 initramfs in Linux 2.6 一起把它包在 kernel image 裡
... 如果你手上有 android source package 的話, 把 linux kernel 裡的 initramfs path
指到 android built 出來的 out/target/[platform]/root 這樣 root filesystem 就會一起包進
kernel image 裡了!
Dear bohemianx,
我用你偷吃步的方法,把root包進kernel裡
可是最後卻出現error如下:
Warning: unable to open an initial console.
<0>Kernel panic: Attempted to kill init!
請問可能是什麼問題,有何解決方法呢?
ps: 我的kernel跟filesystem ,ARCH是一樣的
Dear
請問一下,Android 目前都是運行在ARM或X86,
我使用Renessas的migo-R平台,它的CPU是SH7722,kernel iMage編譯出來了想透過NFS與Android filesystem連接,但是啟動init出了問題;
因為 我的Android filesystem是從emulator抓出來的,它只能給ARM使用,我觀察init它的檔案型態是
[root@mirl194052 rootfs]# file init
init: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically
linked, stripped
所以 透過u-boot啟動Android kernel iMage在執行init時會出現
" Failed to execute /init. Attempting defaults...
Kernel panic - not syncing: No init found. Try passing init= option
to kernel. "
請問 (1)有人在其他CPU使用過嗎? (2)Android filesystem有原始碼可供編譯成其他CPU架構的方式嗎?
謝謝
adik/
mail: adikliu@gmail.com
Dear ,
我再將我的流程詳述,看能否有人能提供協助~~~謝謝
我用的平台是Migo-R,Renesas SH7722
http://tw.renesas.com/fmwk.jsp?cnt=sh7722_root.jsp&fp=/products/mpumcu/superh_family/sh7780_series/sh7722_group/
我從這地方下載android kernel source"linux-2.6.25-android-1.0_r1.tar.gz" from "http://code.google.com/p/android/downloads/list".
toolchain 來源 "gnush4-nofpu_linux_v0701-1.tar.gz".
http://www.superh-linux.org/platforms/index.html#sh7722migor
(step 1).
我利用NFS連接Migo-R 及 Host PC.
(step 2).
利用預設的default .config 去初始化核心,Migo_R的.config是參照/kernel/arch/sh/configs/migor_defconfig
下此指令 將會產生.config
--> make migor_defconfig ARCH=sh
(step 3).
很奇怪的事是我在ARM及X86編譯Andorid kernel都不會有"binder"的錯誤訊息,從網上得知binder是很重要的功能; 錯誤訊息如下
In file included from drivers/android/binder.c:19:
include/linux/binder.h:122: error: expected specifier-qualifier-list before 'size_t'
include/linux/binder.h:130: error: expected specifier-qualifier-list before 'pid_t
*****詳細的error我掛在附件*********
於是我在kernel的binder,修改為<M>模組型態,這樣就可以編出iMage.
p.s 我不清楚 這樣改會不會影響到後續Android的運作?? 有人可以說明嗎?
(step 4).
接下來 我利用u-boot啟動uImage 利用NFS與Host PC的Android filesystem相連.
U-Boot 1.3.2 (Feb 20 2009 - 10:09:17)
CPU: SH4
BOARD: Renesas MigoR
DRAM: 64MB
FLASH: 64MB
In: serial
Out: serial
Err: serial
Net: Hit any key to stop autoboot: 0
=> tftp 8c400000 uImage_myandroid_nfs0317_v2
Warning: MAC addresses don't match:
HW MAC address: FF:FF:FF:FF:FF:FF
"ethaddr" value: 12:34:56:78:9A:BC
Using MAC Address 12:34:56:78:9A:BC
TFTP from server 192.168.0.3; our IP address is 192.168.0.15
Filename 'uImage_myandroid_nfs0317_v2'.
Load address: 0x8c400000
Loading:
#################################################################
###########################################
done
Bytes transferred = 1584452 (182d44 hex)
=> bootm 8c400000
## Booting image at 8c400000 ...
Image Name: Linux-2.6.27-00114-g462bfbf-dirt
Image Type: SuperH Linux Kernel Image (gzip compressed)
Data Size: 1584388 Bytes = 1.5 MB
Load Address: 8c001000
Entry Point: 8c002000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
Linux version 2.6.27-00114-g462bfbf-dirty
(root@mirl194052.mirl.itri.org.tw) (gcc version 4.2-SH4-LINUX_v0701)
#3 Tue Mar 17 11:38:48 CST 2009
Boot params:
... MOUNT_ROOT_RDONLY - 00000000
... RAMDISK_FLAGS - 00000000
... ORIG_ROOT_DEV - 00000000
... LOADER_TYPE - 00000000
... INITRD_START - 00000000
... INITRD_SIZE - 00000000
Booting machvec: Migo-R
Node 0: start_pfn = 0xc000, low = 0x10000
Node 1: start_pfn = 0x55f0, low = 0x5610
Zone PFN ranges:
Normal 0x000055f0 -> 0x00010000
Movable zone start PFN for each node
early_node_map[2] active PFN ranges
1: 0x000055f0 -> 0x00005610
0: 0x0000c000 -> 0x00010000
Built 2 zonelists in Node order, mobility grouping on. Total pages:
16287
Policy zone: Normal
Kernel command line: console=ttySC0 root=/dev/nfs nfsroot=/home/MigoR-
Linux-BSP/MigoR_JPN/packages/rootfs/rootfs ip=192.168.0.15:192.168.0.3
init=/init
PID hash table entries: 256 (order: 8, 1024 bytes)
Using tmu for system timer
Using 8.333 MHz high precision timer.
Console: colour dummy device 80x25
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 61048k/65664k available (2305k kernel code, 570k data, 140k
init)
PVR=10300800 CVR=01440111 PRR=00000a10
I-cache : n_ways=4 n_sets=256 way_incr=8192
I-cache : entry_mask=0x00001fe0 alias_mask=0x00001000 n_aliases=2
D-cache : n_ways=4 n_sets=256 way_incr=8192
D-cache : entry_mask=0x00001fe0 alias_mask=0x00001000 n_aliases=2
Calibrating delay loop... 132.09 BogoMIPS (lpj=264192)
Mount-cache hash table entries: 512
CPU: SH7722
net_namespace: 288 bytes
NET: Registered protocol family 16
SCSI subsystem initialized
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NET: Registered protocol family 1
JFFS2 version 2.2. (NAND) ?? 2001-2006 Red Hat, Inc.
yaffs Mar 17 2009 11:37:52 Installing.
msgmni has been set to 119
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
SuperH SCI(F) driver initialized
sh-sci: ttySC0 at MMIO 0xffe00000 (irq = 80) is a scif
console [ttySC0] enabled
sh-sci: ttySC1 at MMIO 0xffe10000 (irq = 81) is a scif
sh-sci: ttySC2 at MMIO 0xffe20000 (irq = 82) is a scif
brd: module loaded
logger: created 64K log 'log_main'
logger: created 256K log 'log_events'
logger: created 64K log 'log_radio'
smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre <nico@cam.org>
eth0: SMC91C11xFD (rev 2) at b0000300 IRQ 32 [nowait]
eth0: Ethernet addr: 12:34:56:78:9a:bc
Driver 'sd' needs updating - please use bus_type methods
physmap platform flash device: 04000000 at 00000000
physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
Amd/Fujitsu Extended Query Table at 0x0040
physmap-flash.0: CFI does not contain boot bank location. Assuming
top.
number of CFI chips: 1
cfi_cmdset_0002: Disabling erase-suspend-program due to code
brokenness.
RedBoot partition parsing not available
Using physmap partition information
Creating 3 MTD partitions on "physmap-flash.0":
0x00000000-0x00100000 : "uboot"
0x00100000-0x01000000 : "rootfs"
0x01000000-0x04000000 : "other"
NAND device: Manufacturer ID: 0xec, Chip ID: 0xd3 (Samsung NAND 1GiB
3,3V 8-bit)
Scanning device for bad blocks
Bad eraseblock 3924 at 0x1ea80000
Bad eraseblock 3925 at 0x1eaa0000
Bad eraseblock 3949 at 0x1eda0000
Creating 2 MTD partitions on "gen_nand.0":
0x00000000-0x20000000 : "nanddata1"
0x20000000-0x40000000 : "nanddata2"
m66592_udc m66592_udc: version 18 Oct 2007
g_serial gadget: Gadget Serial v2.4
g_serial gadget: g_serial ready
input: sh_keysc as /class/input/input0
rtc-rs5c372 0-0032: can't read registers
rtc-rs5c372: probe of 0-0032 failed with error -5
oprofile: using timer interrupt.
TCP cubic registered
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
eth0: link down
IP-Config: Guessing netmask 255.255.255.0
IP-Config: Complete:
device=eth0, addr=192.168.0.15, mask=255.255.255.0,
gw=255.255.255.255,
host=192.168.0.15, domain=, nis-domain=(none),
bootserver=192.168.0.3, rootserver=192.168.0.3, rootpath=
Looking up port of RPC 100003/2 on 192.168.0.3
eth0: link up, 100Mbps, full-duplex, lpa 0x41E1
Looking up port of RPC 100005/1 on 192.168.0.3
VFS: Mounted root (nfs filesystem).
Freeing unused kernel memory: 140k freed
Failed to execute /init. Attempting defaults...
Kernel panic - not syncing: No init found. Try passing init= option
to kernel.
(step 5).
我的Android file system來源有兩個地方 ;
1. The download source is :www.androidin.com/bbs/pub/armv4.tar.gz
2. 從emulator 拉出來的.
這兩個結果都是無法利用NFS連進去Android file system並啟動Android.
我觀察從終端機的訊息,似乎這個"init"只有給ARM使用!!??
the console message shows -->
" Failed to execute /init. Attempting defaults...
Kernel panic - not syncing: No init found. Try passing init= option
to kernel. "
[root@mirl194052 rootfs]# file init
init: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically
linked, stripped
我想請教的是:
(1) 以上這些流程不曉的有沒哪邊有問題,
(2) 這個init是不是只有給ARM使用,無法使用在SuperH?
(3) 哪邊可以下載Android file system的原始碼?
(4) 該怎麼產生給SuperH或其他CPU可用的init呢?
(5) 在核心中將binder改成<M>, 模組型態會對往後的Android運作有影響嗎?
(6) 有人知道該怎麼修改上述的binder error嗎?
THx