#!/bin/bash

if [ -e "buildroot" ]; then
  echo
  echo "I think you did the wrong operation."
  echo "This is because there is already a buildroot directory."
  echo
  echo "This script is used only for the first construction."
  echo "If you want to reset your all work (all changes will be removed),"
  echo "please remove the buildroot directory and try again."
  exit
fi

wget https://buildroot.uclibc.org/downloads/buildroot-2017.02.2.tar.gz
tar -zxvf buildroot-2017.02.2.tar.gz
ln -s buildroot-2017.02.2 buildroot
cp raspmx/* buildroot/
cp buildroot/raspmx_buildroot_config buildroot/.config

echo "please execute following script."
echo "./post_kernel_update.sh"

