gentoo_bootstrap / README.md

Gentoo Bootstrap

setup_build_gentoo.sh

Sets up common needs for 32 and 64 bootstrap scripts and will print out the commands to execute them:

can pass 4 options, in order:

  1. region
  2. security group
  3. key pair
  4. private key of key pair

if you do not set these:

  • region defaults to us-east-1
  • security group defaults to gentoo-bootstrap and it will be created if needed
  • key pair defaults to gentoo-bootstrap_$region e.g. gentoo-bootstrap_us-east-1
  • key file defaults to gentoo-bootstrap_$region.pem e.g. gentoo-bootstrap_us-east-1.pem
  • The key pair will be created if needed.

Sample command to setup us-east-1

./setup_build_gentoo.sh us-east-1

build_gentoo_64.sh

Builds 64 bit Gentoo image. Will use a c1.medium for bootstrap instance.

Will use a t1.micro as test instance.

Because sudo will be called, this script cannot be run in the backgroud.

Recommend running screen before running.

Takes 4 options:

  1. region
  2. security group
  3. key pair
  4. keyfile

if you do not set these:

  • region defaults to us-east-1
  • security group default to gentoo-bootstrap_64-bit and will be created if needed
  • key pair defaults to gentoo-bootstrap_64-bit_$region e.g. gentoo-bootstrap_64-bit_us-east-1
  • key file defaults to gentoo-bootstrap_64-bit_$region.pem e.g. gentoo-bootstrap_64-bit_us-east-1.pem
  • key pair will be created if needed.

Sample command for building 64 bit gentoo on us-east-1

./build_gentoo_64.sh us-east-1 gentoo-bootstrap gentoo-bootstrap_us-east-1 gentoo-bootstrap_us-east-1.pem

build_gentoo_32.sh

Builds 32 bit Gentoo image. Will use a c1.medium for bootstrap instance.

Will use a t1.micro as test instance.

Because sudo will be called, this script cannot be run in the backgroud.

Recommend running screen before running.

Takes 4 options:

  1. region
  2. security group
  3. key pair
  4. keyfile

if you do not set these:

  • region defaults to us-east-1
  • security group default to gentoo-bootstrap_32-bit and will be created if needed
  • key pair defaults to gentoo-bootstrap_32-bit_$region e.g. gentoo-bootstrap_32-bit_us-east-1
  • key file defaults to gentoo-bootstrap_32-bit_$region.pem e.g. gentoo-bootstrap_32-bit_us-east-1.pem
  • key pair will be created if needed.

Sample command for building 64 bit gentoo on us-east-1

./build_gentoo_32.sh us-east-1 gentoo-bootstrap gentoo-bootstrap_us-east-1 gentoo-bootstrap_us-east-1.pem

x86_64/

The contents of this directory will be copied to /tmp on the instance building the 64-bit gentoo image.

i386

The contents of this directory will be copied to /tmp on the instance building the 32-bit gentoo image.

x86_64/remote_gentoo.sh & i386/remote_gentoo.sh

The script to be copied to and executed on bootstrap instance.

x86_64/.config & i386/.config

The .config file for building the kernel.

make_latest_push.sh

Makes the latest gentoo AMI public.

Takes 3 options:

  1. region
  2. architecture
  3. root_device_type

Sample command for making us-east-1 64-bit EBS image public

./make_latest_public.sh us-east-1 x86_64 ebs

Sample command for making us-east-1 32-bit EBS image public

./make_latest_public.sh us-east-1 i386 ebs

Sample command for making us-east-1 64-bit Instance Store image public

./make_latest_public.sh us-east-1 x86_64 instance-store

copy_ebs_across_region.sh

Copies latest public EBS gentoo image across regions.

Takes 3 options:

  1. from_region
  2. architecture
  3. to_region

Sample command for copying 64-bit image from us-east-1 to us-west-2

./copy_ebs_across_region.sh us-east-1 x86_64 us-west-2

Sample command for copying 32-bit image from us-east-1 to us-west-2

./copy_ebs_across_region.sh us-east-1 i386 us-west-2

Setup across all regions

Need to setup only once.

./setup_build_gentoo.sh us-east-1

Building can be run in parallel to save time.

./build_gentoo_64.sh us-east-1 gentoo-bootstrap gentoo-bootstrap_us-east-1 gentoo-bootstrap_us-east-1.pem
./build_gentoo_32.sh us-east-1 gentoo-bootstrap gentoo-bootstrap_us-east-1 gentoo-bootstrap_us-east-1.pem

Copy across regions

./make_latest_public.sh us-east-1 x86_64 ebs
./make_latest_public.sh us-east-1 i386 ebs

./copy_ebs_across_region.sh us-east-1 x86_64 us-west-2
./copy_ebs_across_region.sh us-east-1 i386 us-west-2
./make_latest_public.sh us-west-2 x86_64 ebs
./make_latest_public.sh us-west-2 i386 ebs

./copy_ebs_across_region.sh us-east-1 x86_64 us-west-1
./copy_ebs_across_region.sh us-east-1 i386 us-west-1
./make_latest_public.sh us-west-1 x86_64 ebs
./make_latest_public.sh us-west-1 i386 ebs

./copy_ebs_across_region.sh us-east-1 x86_64 eu-west-1
./copy_ebs_across_region.sh us-east-1 i386 eu-west-1
./make_latest_public.sh eu-west-1 x86_64 ebs
./make_latest_public.sh eu-west-1 i386 ebs

./copy_ebs_across_region.sh us-east-1 x86_64 sa-east-1
./copy_ebs_across_region.sh us-east-1 i386 sa-east-1
./make_latest_public.sh sa-east-1 x86_64 ebs
./make_latest_public.sh sa-east-1 i386 ebs

./copy_ebs_across_region.sh us-east-1 x86_64 ap-northeast-1
./copy_ebs_across_region.sh us-east-1 i386 ap-northeast-1
./make_latest_public.sh ap-northeast-1 x86_64 ebs
./make_latest_public.sh ap-northeast-1 i386 ebs

./copy_ebs_across_region.sh us-east-1 x86_64 ap-southeast-1
./copy_ebs_across_region.sh us-east-1 i386 ap-southeast-1
./make_latest_public.sh ap-southeast-1 x86_64 ebs
./make_latest_public.sh ap-southeast-1 i386 ebs

./copy_ebs_across_region.sh us-east-1 x86_64 ap-southeast-2
./copy_ebs_across_region.sh us-east-1 i386 ap-southeast-2
./make_latest_public.sh ap-southeast-2 x86_64 ebs
./make_latest_public.sh ap-southeast-2 i386 ebs
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.