`

How to make root file system image file

阅读更多
Refer to : http://topic.csdn.net/t/20051103/17/4369767.html#
http://en.wikipedia.org/wiki/Loop_device

dd if=/dev/zero of=/tmp/tmp_loop bs=1k count=512 (容量根据需要自定义)
losetup /dev/loop0 /tmp/tmp_loop (associate )
mkfs -t ext2 /dev/loop0
mount -t ext2 /dev/loop0 /mnt
mkdir -P /mnt/dev
mkdir -P /mnt/bin
mkdir -P /mnt/etc
...
umount /mnt
losetup -d /dev/loop0
dd if=/tmp/tmp_loop | gzip -9 > /tmp/Image.gz
rm -f /tmp/tmp_loop
sync
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics