ition here
burn_image $MTD $IMAGE_FILE
}
while getopts "afku" opt
do
case $opt in
a)
IMAGE_TYPE=APPS
shift 1
break;
;;
k)
IMAGE_TYPE=KERNEL
shift 1
break;
;;
f)
IMAGE_TYPE=ROOTFS
shift 1
break;
;;
u)
IMAGE_TYPE=BOOTLOADER
shift 1
break;
;;
h)
usage
;;
)
usage
;;
esac
done
IMAGE_FILE=$1
if [ ! -n "$IMAGE_FILE" ] ; then
usage
fi
if [ ! -n "$IMAGE_TYPE" ] ; then
check_image_type $IMAGE_FILE
fi
if [ $IMAGE_TYPE == BOOTLOADER ] ; then
up_bootloader $IMAGE_FILE
elif [ $IMAGE_TYPE == KERNEL ] ; then
up_kernel $IMAGE_FILE
elif [ $IMAGE_TYPE == ROOTFS ] ; then
echo "$IMAGE_FILE ***************"
up_rootfs $IMAGE_FILE
else
echo "============================================================================================"
echo "ERROR: Unknow image type: '$IMAGE_NAME'"
echo "============================================================================================"
usage
fi
文件系统如下:
[lingyun@localhost fulinux]$ ls
kernel rootfs systools u-boot
[lingyun@localhost fulinux]$ cd rootfs/
[lingyun@localhost rootfs]$ ls
ramdisk-s3c2440.gz rootfs rootfs_tree.tar.bz2 tools
[lingyun@localhost rootfs]$ cd rootfs
[lingyun@localhost rootfs]$ pwd
/home/lingyun/fulinux/rootfs/rootfs
[lingyun@localhost rootfs]$
因为上面的shell脚本需要用到两个应用程序flash_eraseall和nandwrite所以需要在上面的文件系统里有这两个程序。如果没有添加方式如下:
[lingyun@localhost fulinux]$ ls
kernel rootfs systools u-boot
[lingyun@localhost fulinux]$ cd systools/
[lingyun@localhost systools]$ ls
busybox
[lingyun@localhost systools]$ cd busybox/
[lingyun@localhost busybox]$ ls
build.sh busybox-1.20.2 busybox-1.20.2.tar.bz2 patch
[lingyun@localhost busybox]$ cd busybox-1.20.2
[lingyun@localhost busybox-1.20.2]$
[lingyun@localhost busybox]$ ls
build.sh busybox-1.20.2 busybox-1.20.2.tar.bz2 patch
[lingyun@localhost busybox]$ cd busybox-1.20.2
[lingyun@localhost busybox-1.20.2]$ vt100
[lingyun@localhost busybox-1.20.2]$ make menuconfig
主目录:
Busybox Settings --->
。。。
Installation Options ("make install" behavior) --->
What kind of applet links to install (as soft-links) --->
指定文件系统的目录位置:
(/home/lingyun/fulinux/systools/busybox/../../rootfs/rootfs) BusyBox installation prefix
。。。
回到主目录:
Miscellaneous Utilities --->
选择如下的两个程序:
。。。
[*] nandwrite
。。。
[*] flash_eraseall
。。。
保存退出。