Skip to content

Commit

Permalink
Recepción de la arquitectura por argumento.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaqm committed Feb 8, 2014
1 parent f6bfbe7 commit 59b0a31
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions chroot-builder/chrootBuilder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ cd $(dirname $0)
BASEDIR=$(pwd)

##################################

## ARGUMENTOS
ARCH=$1

#VARIABLES
CHROOT_NAME=binary
TEST_DIR=chroot
Expand All @@ -35,6 +39,9 @@ function parada(){

function buildDebootstrap(){

DEBOOTSTRAP_ARCH=$1
[ -z $DEBOOTSTRAP_ARCH ] && DEBOOTSTRAP_ARCH=armhf

mkdir $TEST_DIR || true

cd $TEST_DIR
Expand All @@ -51,8 +58,8 @@ function buildDebootstrap(){

# [ -d $CHROOT_NAME/debootsrap -o -d $CHROOT_NAME/usr/ ] ||
[ -e $CHROOT_NAME/debootstrap/debootstrap ] || (
sudo debootstrap --verbose --download-only --arch armhf --variant=minbase --foreign wheezy $CHROOT_NAME http://ftp.us.debian.org/debian
sudo debootstrap --verbose --arch armhf --variant=minbase --foreign wheezy $CHROOT_NAME http://ftp.es.debian.org/debian || true
sudo debootstrap --verbose --download-only --arch $DEBOOTSTRAP_ARCH --variant=minbase --foreign wheezy $CHROOT_NAME http://ftp.us.debian.org/debian
sudo debootstrap --verbose --arch $DEBOOTSTRAP_ARCH --variant=minbase --foreign wheezy $CHROOT_NAME http://ftp.es.debian.org/debian || true
)
# parada

Expand All @@ -74,16 +81,18 @@ function copySecondStage2chroot(){

# main(){

# installDeps
#sudo aptitude install debootstrap qemu-user-static binfmt-support

buildDebootstrap
buildDebootstrap $ARCH

echo " At the end, you should see \"I: Base system installed successfully.\""

parada
copySecondStage2chroot

# Compatibilidad arm
sudo cp /usr/bin/qemu-arm-static $CHROOT_NAME/usr/bin/
[ $ARCH == armhf ] && sudo cp /usr/bin/qemu-arm-static $CHROOT_NAME/usr/bin/

#parada
echo "DEBOOTSTRAP SECOND-STAGE:"
Expand Down

0 comments on commit 59b0a31

Please sign in to comment.