代码拉取完成,页面将自动刷新
#!/bin/bash
#########################################################################
# Author : zkk@crscd.com.cn
# Created Time: Thu 26 Mar 2015 05:33:39 AM PDT
# File Name : mkramdisk_p1.sh
# Description :
#########################################################################
RDSIZE=20000
BLKSIZE=1024
ROOTFS=rootfs-basic
echo ""
echo "Script to generate initial ramdisk for embedde linux -- Part 1"
echo "Script will copy $ROOTFS and generate a ramdisk"
echo ""
# check the rootfs-basic
echo ""
echo "rootfs-basic exist. start to release it!"
echo ""
# Create an empty ramdisk image
echo "dd if=/dev/zero of=/tmp/ramdisk.img bs=$BLKSIZE count=$RDSIZE"
dd if=/dev/zero of=/tmp/ramdisk.img bs=$BLKSIZE count=$RDSIZE
echo ""
# Make it an ext2 mountable file system
echo "/sbin/mke2fs -F -m 0 -b $BLKSIZE /tmp/ramdisk.img $RDSIZE"
/sbin/mke2fs -F -m 0 -b $BLKSIZE /tmp/ramdisk.img $RDSIZE
echo ""
# Mount it so that we can populate
echo "mount /tmp/ramdisk.img ./new -t ext2 -o loop=/dev/loop1"
mount /tmp/ramdisk.img ./new -t ext2 -o loop=/dev/loop1
echo ""
# copy from old to new
echo "cp ./$ROOTFS/* ./new/ -r"
cp -a -r ./$ROOTFS/* ./new/
echo ""
echo "Finished Part 1"
echo "Now make changes as you like in ./new, then run the Part 2"
echo ""
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。