移植Mer到海思的hi3716m平台

目标:将Mer的rootfs烧写到FLASH上,从FLASH上能直接启动Mer。

[2012/01/18]

问题: devicedriver ,对于 hi3716m 的平台 SDK ,是放在 kernel 中还是放在 rootfs 中?在 Mer 中,又是如何的呢(从目前情况初步判断, mer-tv-pandaboard 将设备驱动放到了 kernel 包中)?生成 meego-panda-rootfs 时,可以参考!

分析:从meego-panda-rootfs生成来看,就是两件事情:一是在kernel目录下makemodules_install,将devicedriver放到rootfs;二是在/etc/X11/x11.conf.d/下加入显示config

至于往SD卡拷贝MLO,u-boot.bin,uImageboot.scr,应该是为了从SD卡启动的原因;SD卡已经根据omap平台的要求进行了格式化,因此omap能在上电后找到SD中的bootloader。其中boot.scr指定了内核命令行参数。而hi3716m上,在fastboot命令行中就可以指定内核命令行参数。

结论:不必重新编译kernel。做好Merrootfs,然后将hi3716mdriverx11.conf拷贝到rootfs中即可。需要考虑rootfs的文件格式以写入NANDFLASH


[2012/01/19]

merrootfshi3716m驱动的事情可以往后放。首先应该让kernel能挂载merrootfs

Kernel挂载merrootfs需要完成如下事情:

mer的参考rootfs打包;(可以直接参考Stskeeps给出的参考ks

mer-hi3716m-rootfs-ref打包成hi3716m能支持的格式(比如yaffs2)(需要阅读hi3716m的资料,搞清原rootfs的生成办法);

mer-hi3716m-rootfs-ref写入FLASH


决定:先做mer-base-rootfs

1)生成bootstrap

sudomic-create-bootstrap -n trunk -k rpms -rhttp://repo.meego.com/MeeGo/builds/trunk/latest/repos/oss/ia32/packages/-o /home/zhanghui/Mer/buildrootfs/cache/mer-bootstrap

2)生成rootfs

sudomic-image-creator --config=mer-core-armv7l-base.ks --format=fs--bootstrap=/home/zhanghui/Mer/buildrootfs/cache/mer-bootstrap--cache=rpms --outdir=/home/zhanghui/Mer/mer-base-rootfs--arch=armv7l –pkgmgr=yum

注意:

--format=fs表示在会给生成的rootfs指定一个目录;

pkgmgr=yum则表示用yum。默认用zypper,但zypperBUG。如果不指定yum,会报错:

Registering package manager: zypp
Registering package manager: yum
Use package manager zypp
Use package manager zypp
Retrieving repo metadata from http://releases.merproject.org/releases/latest/builds/armv7l/packages ...
zypp architecture: armv7l
Problem count: 25
Problem: bash-1:3.2.51-1.4.Mer.armv7l 不能安装(means: Cannot be installed), 

[2012-01-21]

修改bootargs

setenvbootargs '内容'

saveenv


启动错误:

VFS:Mounted root (cramfs filesystem) readonly on device 31:9.

Freeinginit memory: 120K

cramfs:bad compressed blocksize 417793690

cramfs:bad compressed blocksize 417793690


cramfs:bad compressed blocksize 3329639899


cramfs:bad compressed blocksize 3329639899


cramfs:bad compressed blocksize 3329639899


/bin/sh:error while loading shared libraries: libtinfo.so.5: cannot openshared object file: Input/output error


Kernelpanic - not syncing: Attempted to kill init!


据分析,可能是Merboot时需要写rootfs,或者其他原因。尝试jffs2

mkfs.jffs2时,需要指定pad,否则在nandwrite.jffs2时会出错(即5127072不能整除0x20000:

NAND write: device 0 offset 0x1500000, size 0x30e5280
Attempt to write non page aligned data
 51270272 bytes written: ERROR

也可以指定-n”,这样在启动时就不会打印一堆CLEANMARKER信息;

最终的命令应该是:

mkfs.jffs2--root=meego-mer-core-armv7l-base-1.2.90.20120119.2151/--little-endian --eraseblock=0x20000 --output hi3716m_rootfs.jffs2--pad –no-cleanmarkers

其中little-endianeraseblock=0x20000来自海思的文档。

(如果不指定little-endian,那么jffs2镜像就会和HOSTendian一致!)


烧写jffs2后,启动时报错:

Failedto open /dev/kmsg for logging: No such file or directory


modprobe:FATAL: Could not load /lib/modules/2.6.35.7_hi3716m/modules.dep: Nosuch file or directory



Failedto mount /dev: No such device

按照Stskeeps的分析,后续做法参考2012-01-21IRClog


[2012-01-22]

参考http://wiki.merproject.org/wiki/Adaptation_Guide#Kernel,修改linux-2.6.35下的.config文件。包括CONFIG_DEVTMPFS=y以及CONFIG_DEVTMPFS_MOUNT=y


Make后错误依旧,Stskeeps分析可能是新加入的内核配置没有起作用。

Makeclean后,再makeuImage,烧到flash,就没有”Failedto mount /dev: No such device”的问题了,但启动时有如下错误:

Starting D-Bus System Message Bus...
Started Permit User Sessions.
Started D-Bus Sy<27>stem Message Bussystemd-logind.
[328]: Failed to open /sys/class/tty/tty0/active: No such file or directory
<27>systemd-logind[328]: Failed to fully start up daemon: No such file or directory
<29>systemd[1]: systemd-logind.service: main process exited, code=exited, status=1
Starting Login Service failed, see 'systemctl status systemd-logind.service' for details.
<29>systemd[1]: Unit systemd-logind.service entered failed state.
<27>systemd-update-utmp[332]: Failed to write utmp record: No such file or directory
<29>systemd[1]: systemd-update-utmp-runlevel.service: main process exited, code=exited, status=1
<30>systemd[1]: Startup finished in 6s 335ms 331us (kernel) + 6s 113ms 583us (userspace) = 12s 448ms 914us.
<29>systemd[1]: Unit systemd-update-utmp-runlevel.service entered failed state.

rootfs下,执行:

ln -s../[email protected]./lib/systemd/system/getty.target.wants/[email protected]

add'ttyAMA0' to /etc/securetty in the file system

重新制作jffs2文件系统,烧写FLASH,重启。。。


终于出现了登录提示。

Stskeepslbt的大力帮助下,至此Mer移植成功!


你可能感兴趣的:(manager,File,Flash,System,logging,平台)