Advertisement
Guest User

ramdisk_utiity

a guest
Oct 22nd, 2014
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. #!/bin/sh
  2. echo "** Motorhead's Ramdisk Utility **"
  3. sleep 1
  4. echo ''
  5. echo 'Press 1 to disassemble'
  6. echo ''
  7. echo 'Press 2 to rebuild'
  8.  
  9. read utility
  10.  
  11. if [ $utility = "1" ]; then
  12. echo 'Going to disassembly'
  13. mkdir ramdisk
  14.  
  15. cd ramdisk
  16.  
  17. echo 'which ramdisk do you want disassembled?'
  18. read input
  19. gunzip -c ../$input.cpio.gz | cpio -i
  20.  
  21. cd ../
  22.  
  23. echo 'Continue to renaming?'
  24. read answer
  25. if [ "$answer" = "y" ] || [ "$answer" = "yes" ] || [ "$answer" = "Y" ] || [ "$answer" = "Yes" ]; then
  26. echo 'Name your new ramdisk directory';
  27. read name
  28. mv ./ramdisk ./$name
  29. else echo 'Ok, no renaming then. Make your changes before rebuilding';
  30. fi
  31. fi
  32.  
  33. if [ $utility = "2" ]; then
  34. echo 'Going to rebuild'
  35. sleep 1
  36.  
  37. echo 'what ramdisk do you want rebuilt?'
  38. read dir
  39. cd $dir
  40.  
  41. find . | cpio -o -H newc | gzip > ../new-ramdisk.cpio.gz
  42.  
  43. cd ../
  44. echo ''
  45. echo 'Done! Continue on with your image building';
  46. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement