uboot 用 ramdisk 引导linux命令行,u-boot,bootargs,arm

ramdisk的制作:

#! /bin/sh rm -rf ramdisk dd if=/dev/zero of=ramdisk bs=1024 count=6144 mkfs.ext2 -F ramdisk gzip ramdisk

 

#! /bin/sh #1 fs=ramdisk4M gunzip -v ${fs}.gz mount -o loop ${fs} mnt_ramdisk #2 echo "delete mnt_ramdisk's files(y/n)?" read key_value if [ "${key_value}" = "y" ]; then cd mnt_ramdisk ls | grep -v lost+found | xargs rm -rf echo $PWD cd .. echo $PWD else echo "not delete!" fi echo "copy files to mnt_ramdisk" cp -a -rf tmpramdisk/* mnt_ramdisk #3 umount mnt_ramdisk gzip -v9 ${fs} echo "copy uboot fs image to /tftpboot" cp -rf ${fs}.gz /tftpboot

 

其中,tmpramdisk是fs所在,mnt_ramdisk是临时挂载文件夹,空的。

 

uboot命令行:

setenv bootargs 'mem=48M console=ttyS0,115200n8 initrd=0x20600000,16M root=/dev/ram rw'

你可能感兴趣的:(linux,image,delete)