mkrootfs.sh 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. echo "*********************************"
  2. echo "* make root file system *"
  3. echo "*********************************"
  4. mkdir -p ./mnt ./rootfs ./davapp
  5. #cp -dR /home/wangqian/workdir/rootfs/* ./rootfs/
  6. #chmod 777 ./rootfs/
  7. #cp -dR /tftpboot/ttt/* ./rootfs/
  8. #cp -dR /home/wangqian/workdir/rootfs/* ./rootfs/
  9. #cp -dR ./davincifile/* ./davapp
  10. #mv -f ./rootfs/etc/passwd_ram ./rootfs/etc/passwd
  11. #rm -f ./rootfs/dav/1280.422
  12. #rm -f ./rootfs/dav/1920.422
  13. #rm -f ./rootfs/dav/lib_tls.tar.bz2
  14. #mv -f ./rootfs/dav/* ./davapp/
  15. ###### 以下制作initrd ########
  16. dd if=/dev/zero of=./initrd bs=1024 count=65536
  17. /sbin/losetup /dev/loop0 ./initrd
  18. #./mkfs.minix /dev/loop0
  19. mkfs.ext2 /dev/loop0
  20. mount /dev/loop0 ./mnt
  21. chmod 777 ./mnt/
  22. rm -rf ./mnt/lost+found
  23. cp -dR ./rootfs/* ./mnt/
  24. umount ./mnt
  25. /sbin/losetup -d /dev/loop0
  26. gzip -9 ./initrd
  27. mv -f initrd.gz system/rootfs.img
  28. ###### 制作initrd完成 ########
  29. ###### 以下制作yaffs2镜像 ########
  30. #mv -f ./initrd.gz ./rootfs.img
  31. #cp ./rootfs.img ./davapp/rootfs.img
  32. #./mkyaffs2img 1 ./davapp ./davinci.img
  33. #cp ./davinci.img /tftpboot/
  34. ################### clean dir ###################
  35. rm -rf ./mnt
  36. #rm -rf ./rootfs
  37. rm -rf ./davapp
  38. echo "*********************************"
  39. echo "* make yafffs2 system *"
  40. echo "*********************************"
  41. rm -fr system.yaffs*
  42. tar czvf app.tar.gz home
  43. mv app.tar.gz system/
  44. mkyaffs2image610 system system.yaffs.2k_4bit 1 2