Advertisement
ChrRaible

ceph1.sh

Aug 28th, 2011
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. echo "Checklist:"
  4. echo "[ ] ip address static?"
  5. echo "[ ] ceph config stored on ceph3?"
  6. echo "[ ] kernel config stored on ceph3?"
  7.  
  8. read n #just to wait...
  9.  
  10. echo -n "installing required basic packages... "
  11. apt-get -y install bash-completion bzip2 build-essential ssh ncurses-dev iftop screen dvtm pciutils htop less uuid-dev e2fslibs-dev libacl1-dev zlib1g-dev > /dev/null
  12. echo "done"
  13.  
  14. read n
  15.  
  16. #FIXME: THIS KEYFILE HAS AN EMPTY PASSPHRASE
  17. echo "generating SSH keys ... "
  18. ssh-keygen -t rsa -f ~/.ssh/id_rsa -N ""
  19. echo "done"
  20.  
  21. echo -n "adding static entries for /etc/hosts... "
  22. echo "172.30.100.110 ceph01" >> /etc/hosts
  23. echo "172.30.100.111 ceph02" >> /etc/hosts
  24. echo "172.30.100.112 ceph03" >> /etc/hosts
  25. echo "done"
  26.  
  27. echo "announcing this host to the other ones via SSH... "
  28. for i in ceph01 ceph02 ceph03; do
  29. ssh-copy-id -i ~/.ssh/id_rsa.pub $i
  30. done
  31. echo "done"
  32.  
  33.  
  34. echo -n "getting and installing btrfs-tools 0.19... "
  35. wget http://www.kernel.org/pub/linux/kernel/people/mason/btrfs/btrfs-progs-0.19.tar.gz
  36. tar xf btrfs-progs-0.19.tar.gz
  37. cd btrfs-progs-0.19/
  38. make clean
  39. make > /dev/null
  40. make convert
  41. make install
  42. echo "done"
  43.  
  44.  
  45.  
  46. echo -n "downloading and extracting kernel... "
  47. #wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.38.3.tar.bz2 #> /dev/null
  48. scp ceph01:/root/linux-2.6.38.3.tar.bz2 .
  49.  
  50. tar xf linux-2.6.38.3.tar.bz2 -C /usr/src
  51. ln -s /usr/src/linux-2.6.38.3.tar.bz2/ /usr/src/linux
  52. echo "done"
  53.  
  54. echo -n "getting kernel config file from ceph01... "
  55. scp ceph01:/root/.config /usr/src/linux
  56.  
  57. echo -n "compiling kernel... "
  58. cd /usr/src/linux
  59. make -j3
  60. make -j3 install
  61. make -j3 modules
  62. make -j3 modules_install
  63. mkinitramfs -k 2.6.38.3 -o /boot/initrd.img-2.6.38.3
  64.  
  65. update-grub
  66. echo "done (hopefully...)"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement