From ae89cebca11fb20c823263ce2b32ed80d371d27a Mon Sep 17 00:00:00 2001 From: James Meyer Date: Fri, 3 Oct 2008 22:25:42 -0700 Subject: setup_env.sh now takes an 2nd argument naming the developer template to use. If the template is not found the script will exit. If the template is found it will copy loginrun.sh to the chroot, and also execute custom_chroot.sh --- setup_env.sh | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/setup_env.sh b/setup_env.sh index 986b5ca..85a5ad8 100755 --- a/setup_env.sh +++ b/setup_env.sh @@ -1,6 +1,6 @@ #!/bin/bash # Script to setup the LinHES development enviroment -# ./setup_env.sh ( i586|i686|x86_64 ) +# ./setup_env.sh ( i586|i686|x86_64 ) devID # This script assumes that /tmp is usable. MIRROR_DIR=../pkg_repo @@ -17,8 +17,23 @@ case $1 in exit 1 ;; esac + +if [ ! x$2 = x ] +then + #check if developer template is present + if [ -d templates/developers/$2 ] + then + echo "found the template for $2 " + FOUNDTEMPLATE="TRUE" + else + echo "couldn't find templates/developers/$2" + exit 2 + fi +fi + } + function pacman_check { which pacman status=$? @@ -32,7 +47,7 @@ function pacman_check { #----------------------------------------------- -arg_check $1 +arg_check $1 $2 pacman_check @@ -69,6 +84,22 @@ fi #clear out the default resolve.con mv -f ../build_root.$ARCH/etc/resolv.conf ../build_root.$ARCH/etc/resolv.conf.orig +if [ x$FOUNDTEMPLATE = xTRUE ] +then + #check for login run + if [ -f templates/developers/$2/loginrun.sh ] + then + cp -f templates/developers/$2/loginrun.sh ../build_root.$ARCH/root/loginrun.sh + fi + + if [ -f templates/developers/$2/custom_chroot.sh ] + then + cd templates/developers/$2 + ./custom_chroot.sh $ARCH + cd - + fi +fi + #create custom enter_dev_chroot.sh script sed -e "s/REPLACEME/$ARCH/g" templates/enter_dev_chroot.sh > ../enter_dev_chroot.$ARCH.sh chmod 755 ../enter_dev_chroot.$ARCH.sh @@ -78,6 +109,7 @@ echo "** cd .. **" echo "** ./enter_dev_chroot.$ARCH.sh **" echo "********************************************************" + #copy makepkg.conf into the chroot sed -e "s/i686/$ARCH/g" templates/makepkg.conf > ../build_root.$ARCH/etc/makepkg.conf #copy pacman.conf into the chroot -- cgit v0.12