Skip to content

Instantly share code, notes, and snippets.

@bols-blue
Created November 21, 2011 07:33
Show Gist options
  • Save bols-blue/1381929 to your computer and use it in GitHub Desktop.
Save bols-blue/1381929 to your computer and use it in GitHub Desktop.
setup script
#add-apt-repositoryなどのインストール
sudo apt-get install python-software-properties
#
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk
#Installing required packages
sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs \
x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev \
libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \
libxml2-utils
cat >51-android.rules <<EOF
# adb protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e12", MODE="0600", OWNER="$LOGNAME"
# fastboot protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0fff", MODE="0600", OWNER="$LOGNAME"
# adb protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e22", MODE="0600", OWNER="$LOGNAME"
# fastboot protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e20", MODE="0600", OWNER="$LOGNAME"
# adb protocol on maguro (Galaxy Nexus)
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", MODE="0600", OWNER="$LOGNAME"
# fastboot protocol on maguro (Galaxy Nexus)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e30", MODE="0600", OWNER="$LOGNAME"
# adb protocol on panda (PandaBoard)
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d101", MODE="0600", OWNER="$LOGNAME"
# fastboot protocol on panda (PandaBoard)
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d022", MODE="0600", OWNER="$LOGNAME"
EOF
sudo mv 51-android.rules /etc/udev/rules.d/
#DL
mkdir ~/bin
PATH=~/bin:$PATH
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
mkdir ANDROID_WORKING_DIRECTORY
cd ANDROID_WORKING_DIRECTORY
repo init -u https://android.googlesource.com/platform/manifest
#repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1
#Getting the files
repo sync
#Verifying Git Tags
gpg --import
RUBY_VERSION=1.9.2-p290
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-$RUBY_VERSION.tar.bz2
tar jxf ruby-$RUBY_VERSION.tar.bz2
rm -rf ruby-$RUBY_VERSION-selfbuild/
mkdir ruby-$RUBY_VERSION-selfbuild/
cd ruby-$RUBY_VERSION-selfbuild/
../ruby-$RUBY_VERSION/configure ;
make > makefile_log.txt
#keyの取得
mkdir .ssh
chmod 700 .ssh
cd /tmp/
wget https://gist.github.com/gists/1381904/download pubkey.tar.gz
tar zxvf download
mv gist*/authorized_keys ~/.ssh/
rm -rf download gist*/
#sshdの設定を追加
sudo cat >>/etc/ssh/sshd_config <<EOF
PasswordAuthentication no
RSAAuthentication yes
PubkeyAuthentication yes
RhostsAuthentication no
EOF
sudo cat >>/root/.forward <<EOF
bols\
[email protected]
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment