三.修改U-boot支持新内核:
如果系统启动成功则会最后显示类似end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-bl,则证明系统启动成功,下面就是制作根文件系统了。
四.制作新根文件系统采用ubifs文件系统:
首先下载busybox,我这里用的版本是1.20.0
cd busybox1.20.0 make menconfig Busybox Settings --> Build options --> Cross Compiler prefix 填arm-linux- Build Options ---> [*]Build BusyBox as a static binary (no shared libs) make make CONFIG_PREFIX=~/2440/ubifs install cd '/home/zzm/arm/opt/FriendlyARM/toolschain/4.4.3/lib' cp *.so.* ~/2440/ubifs/lib -d cd ~/2440/ubifs cp -r ~/2440/busybox-1.20.0/examples/bootfloppy/etc ./ vim inittab内容如下:
::sysinit:/etc/init.d/rcS console::askfirst:-/bin/sh ::ctrlaltdel:/bin/umount -a -r ::shutdown:/bin/umount -a -r vim fstab内容如下:
proc /proc proc defaults 0 0 tmpfs /tmp tmpfs defaults 0 0 sysfs /sys sysfs defaults 0 0 tmpfs /dev tmpfs defaults 0 0 vim init.d/rcS内容如下:
#! /bin/sh mount -a mkdir /dev/pts mount -t devpts devpts /dev/pts echo /sbin/mdev > /proc/sys/kernel/hotplug mdev -s cd ~/2440/ubifs mkdir dev cd dev sudo mknod null c 1 3 sudo mknod console c 5 1 cd .. mkdir proc mnt tmp sys root home cd .. mkfs.ubifs -r ubifs -m 2048 -e 129024 -c 105 -o fs_jz2440.img#129024*105=13MB vim ubinize.cfg [ubifs] mode=ubi image=fs_jz2440.img vol_id=0 vol_size=13MiB vol_type=dynamic vol_name=root vol_flags=autoresize ubinize -o ubi.img -m 2048 -p 128KiB -s 512 ubinize.cfg 生成ubi.img最后烧写
tftp 0x30000000 ubi.img nand erase root nand write.i 0x30000000 root $(filesize) bootargs=console=ttySAC0,115200 ubi.mtd=3 root=ubi0:root rootfstype=ubifs set bootcmd 'nboot 0x32000000 kernel; bootm 0x32000000' save reset