Advertisement
metalx1000

Core File System image of TinyCore

Feb 3rd, 2015
543
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.53 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. img=tinycore.img
  4. tmp=tiny
  5. mnt=mnt
  6.  
  7. #check if root user
  8. if [[ $EUID -ne 0 ]]; then
  9.   echo "You must be a root user"
  10.   echo "Trying to restart script as sudo"
  11.   sudo $0
  12.   exit
  13. fi
  14.  
  15. mkdir $tmp
  16. mkdir $mnt
  17. cd $tmp
  18.  
  19. wget "http://tinycorelinux.net/5.x/armv7/Allwinner-A10/uCore"
  20. dd if=uCore of=tiny.gz bs=1 skip=64
  21. zcat tiny.gz|cpio -i -H newc -d
  22.  
  23. rm tiny.gz uCore
  24. cd ../
  25. dd bs=512 count=500000 if=/dev/zero of=$img
  26. mkfs.ext2 $img
  27. mount -o loop $img $mnt
  28. cp -pfr $tmp/* $mnt/
  29.  
  30. umount $mnt
  31. rm -fr $tmp $mnt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement