4.7.4到JZ2440开发板(3)


三.修改U-boot支持新内核:

启动jz2440,进入uboot set bootargs console=ttySAC0,115200 root=/dev/mtdblock3 set bootcmd 'nboot 0x32000000 kernel; bootm 0x32000000' set ipaddr 192.168.199.148 #根据自己修改 set serverip 192.168.199.146 #根据自己修改 save tftp 0x30000000 uImage nand erase nand write.jffs2 0x30000000 kernel $(filesize) reset

如果系统启动成功则会最后显示类似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

本文永久更新链接地址

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/14932.html